From 626a12b3d42def5b6a38c2501ce83af55c9fdc6c Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 6 Dec 2008 11:15:07 +0100 Subject: [PATCH] push 3600ceb9798742c4473b49518e0ae238427fc4b7 --- ANNOUNCE | 1254 +++++++++++--------- VERSION | 2 +- configure | 38 +- configure.ac | 21 +- dlls/advapi32/tests/security.c | 23 +- dlls/advpack/tests/install.c | 21 +- dlls/atl/atl_ax.c | 2 +- dlls/atl/registrar.c | 2 +- dlls/avifil32/avifile_Si.rc | 2 +- dlls/browseui/progressdlg.c | 2 +- dlls/browseui/rsrc_Si.rc | 2 +- dlls/comctl32/commctrl.c | 4 +- dlls/comctl32/tab.c | 5 +- dlls/comctl32/tests/header.c | 6 +- dlls/comctl32/tests/subclass.c | 4 +- dlls/comctl32/tests/tab.c | 8 +- dlls/comctl32/tests/tooltips.c | 4 +- dlls/comdlg32/cdlg.h | 4 - dlls/comdlg32/cdlg32.c | 8 - dlls/comdlg32/cdlg_Si.rc | 6 +- dlls/comdlg32/filedlg.c | 10 +- dlls/comdlg32/filedlgbrowser.h | 4 - dlls/crypt32/encode.c | 2 +- dlls/crypt32/msg.c | 2 +- dlls/crypt32/object.c | 5 +- dlls/crypt32/rootstore.c | 2 +- dlls/cryptdlg/Makefile.in | 4 +- .../rpcss/rpcss.h => dlls/cryptdlg/cryptdlg.rc | 15 +- dlls/cryptdlg/cryptdlg.spec | 2 +- .../sane_Si.rc => cryptdlg/cryptdlg_En.rc} | 36 +- programs/rpcss/rpcss.h => dlls/cryptdlg/cryptres.h | 23 +- dlls/cryptdlg/main.c | 661 +++++++++++ dlls/d3d10core/tests/device.c | 1 - dlls/d3d8/device.c | 2 +- dlls/d3d8/tests/device.c | 9 + dlls/d3d8/tests/surface.c | 7 +- dlls/d3d8/tests/texture.c | 7 +- dlls/d3d8/tests/visual.c | 7 +- dlls/d3d8/tests/volume.c | 7 +- dlls/d3d9/d3d9_private.h | 5 - dlls/d3d9/device.c | 12 +- dlls/d3d9/tests/d3d9ex.c | 7 +- dlls/d3d9/tests/device.c | 8 + dlls/d3d9/tests/shader.c | 7 +- dlls/d3d9/tests/stateblock.c | 7 +- dlls/d3d9/tests/surface.c | 7 +- dlls/d3d9/tests/texture.c | 7 +- dlls/d3d9/tests/vertexdeclaration.c | 7 +- dlls/d3d9/tests/visual.c | 9 +- dlls/d3d9/tests/volume.c | 7 +- dlls/d3dx9_36/sprite.c | 2 +- dlls/d3dxof/d3dxof.c | 110 +- dlls/d3dxof/d3dxof_private.h | 8 +- dlls/dbghelp/type.c | 2 +- dlls/ddraw/ddraw.c | 3 +- dlls/ddraw/ddraw_private.h | 1 - dlls/ddraw/main.c | 2 +- dlls/ddraw/tests/ddrawmodes.c | 2 +- dlls/ddraw/tests/dsurface.c | 22 + dlls/ddraw/tests/visual.c | 3 +- dlls/ddraw/utils.c | 5 +- dlls/devenum/createdevenum.c | 4 +- dlls/devenum/devenum_private.h | 5 - dlls/dinput/device.c | 28 +- dlls/dinput/device_private.h | 9 - dlls/dinput/joystick_linux.c | 2 +- dlls/dinput/tests/joystick.c | 2 +- dlls/dmband/dmutils.c | 220 ---- dlls/dmband/dmutils.h | 10 - dlls/dmcompos/dmcompos_main.c | 147 +-- dlls/dmcompos/dmcompos_private.h | 9 - dlls/dmime/dmutils.c | 227 ---- dlls/dmime/dmutils.h | 9 - dlls/dmloader/container.c | 79 +- dlls/dmloader/debug.c | 5 - dlls/dmloader/debug.h | 2 - dlls/dmloader/dmloader_private.h | 12 - dlls/dmloader/loader.c | 154 ++- dlls/dmloader/loaderstream.c | 51 +- dlls/dmscript/dmscript_main.c | 146 +-- dlls/dmscript/dmscript_private.h | 9 - dlls/dmstyle/dmutils.c | 243 +--- dlls/dmstyle/dmutils.h | 13 - dlls/dmsynth/dmsynth_main.c | 172 --- dlls/dmsynth/dmsynth_private.h | 9 - dlls/dmusic/dmusic.c | 17 - dlls/dmusic/dmusic_main.c | 142 +-- dlls/dmusic/dmusic_private.h | 17 - dlls/dmusic/port.c | 2 +- dlls/dnsapi/ns_parse.c | 2 +- dlls/dplayx/dplay.c | 151 ++- dlls/dplayx/dplay_global.h | 2 - dlls/dplayx/dplayx_global.c | 69 +- dlls/dplayx/dplayx_global.h | 11 - dlls/dplayx/dplobby.c | 8 +- dlls/dsound/propset.c | 16 +- dlls/dswave/dswave_main.c | 147 +-- dlls/dswave/dswave_private.h | 9 - dlls/dxdiagn/dxdiag_private.h | 1 - dlls/dxdiagn/provider.c | 4 +- dlls/dxgi/dxgi_main.c | 8 +- dlls/dxgi/tests/device.c | 1 - dlls/gdi32/freetype.c | 3 +- dlls/gdi32/gdi_private.h | 1 - dlls/gdi32/path.c | 3 +- dlls/gdi32/tests/bitmap.c | 30 +- dlls/gdiplus/brush.c | 67 +- dlls/gdiplus/font.c | 25 +- dlls/gdiplus/gdiplus.spec | 16 +- dlls/gdiplus/gdiplus_private.h | 2 + dlls/gdiplus/image.c | 45 +- dlls/gdiplus/matrix.c | 2 +- dlls/gdiplus/pen.c | 41 + dlls/gdiplus/region.c | 92 ++ dlls/gdiplus/tests/image.c | 15 +- dlls/gdiplus/tests/pen.c | 79 ++ dlls/gdiplus/tests/region.c | 53 +- dlls/gphoto2.ds/gphoto2_Si.rc | 4 +- dlls/gphoto2.ds/gphoto2_i.h | 10 - dlls/gphoto2.ds/gphoto2_main.c | 2 +- dlls/gphoto2.ds/ui.c | 4 +- dlls/hal/hal.c | 4 +- dlls/hlink/tests/hlink.c | 8 +- dlls/iccvid/iccvid.c | 5 +- dlls/imm32/imm.c | 14 +- dlls/imm32/tests/imm32.c | 52 +- dlls/inetcomm/pop3transport.c | 2 +- dlls/iphlpapi/icmp.c | 2 - dlls/iphlpapi/tests/iphlpapi.c | 36 +- dlls/itss/chm_lib.c | 12 +- dlls/jscript/array.c | 2 +- dlls/jscript/engine.c | 2 +- dlls/jscript/parser.y | 8 +- dlls/jscript/regexp.c | 2 +- dlls/jscript/string.c | 55 +- dlls/jscript/tests/api.js | 63 + dlls/kernel32/computername.c | 2 +- dlls/kernel32/heap.c | 2 +- dlls/kernel32/kernel32.spec | 2 +- dlls/kernel32/ne_module.c | 12 +- dlls/kernel32/ne_segment.c | 2 +- dlls/kernel32/resource16.c | 2 +- dlls/kernel32/snoop16.c | 2 +- dlls/kernel32/task.c | 12 +- dlls/kernel32/tests/debugger.c | 11 +- dlls/kernel32/tests/file.c | 16 +- dlls/kernel32/tests/loader.c | 7 +- dlls/kernel32/tests/pipe.c | 1 - dlls/kernel32/tests/sync.c | 2 +- dlls/localspl/localspl_main.c | 8 +- dlls/lz32/tests/lzexpand_main.c | 2 +- dlls/mciavi32/info.c | 2 +- dlls/mciavi32/private_mciavi.h | 1 - dlls/mountmgr.sys/mountmgr.c | 2 +- dlls/mshtml/dispex.c | 2 +- dlls/mshtml/htmlcomment.c | 19 +- dlls/mshtml/htmlstyle.c | 34 +- dlls/mshtml/htmlstyle.h | 1 + dlls/mshtml/htmltextnode.c | 4 +- dlls/mshtml/mshtml_private.h | 1 - dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/tests/dom.c | 43 + dlls/mshtml/view.c | 2 +- dlls/msrle32/msrle32.c | 14 +- dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/tests/scanf.c | 2 +- dlls/msvcrt/time.c | 2 +- dlls/mswsock/mswsock.spec | 2 +- dlls/msxml3/attribute.c | 8 +- dlls/msxml3/cdata.c | 6 + dlls/msxml3/domdoc.c | 41 +- dlls/msxml3/element.c | 2 +- dlls/msxml3/msxml_private.h | 2 - dlls/msxml3/node.c | 24 +- dlls/msxml3/saxreader.c | 2 +- dlls/msxml3/tests/domdoc.c | 20 + dlls/msxml3/tests/xmldoc.c | 21 +- dlls/msxml3/tests/xmlelem.c | 21 +- dlls/msxml3/text.c | 7 + dlls/ntdll/exception.c | 24 +- dlls/ntdll/ntdll.spec | 6 +- dlls/ntdll/om.c | 19 + dlls/ntdll/tests/atom.c | 2 +- dlls/ntdll/tests/reg.c | 16 +- dlls/ntdll/tests/rtl.c | 13 + dlls/ntdll/threadpool.c | 5 +- dlls/ntoskrnl.exe/ntoskrnl.c | 5 + dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 +- dlls/ole32/Makefile.in | 5 +- dlls/ole32/compobj.c | 11 +- dlls/ole32/compobj_private.h | 9 +- dlls/ole32/ole2.c | 8 +- dlls/ole32/oleproxy.c | 21 +- dlls/ole32/regsvr.c | 45 +- dlls/ole32/storage.c | 40 - dlls/ole32/stubmanager.c | 2 +- dlls/oleacc/tests/main.c | 15 +- dlls/oleaut32/Makefile.in | 5 +- dlls/oleaut32/oleaut.c | 18 +- dlls/oleaut32/olefont.c | 6 +- dlls/oleaut32/regsvr.c | 401 +------ dlls/oleaut32/tests/olefont.c | 1 - dlls/oleaut32/tests/olepicture.c | 1 - dlls/oleaut32/tests/safearray.c | 1 - dlls/oleaut32/tests/varformat.c | 1 - dlls/oleaut32/tests/vartest.c | 1 - dlls/oleaut32/typelib.c | 2 +- dlls/oleaut32/usrmarshal.c | 22 - dlls/oleaut32/vartype.c | 6 +- dlls/oledlg/insobjdlg.c | 12 +- dlls/opengl32/tests/opengl.c | 9 +- dlls/quartz/filtergraph.c | 11 +- dlls/quartz/filtermapper.c | 2 +- dlls/quartz/main.c | 20 - dlls/quartz/memallocator.c | 60 +- dlls/quartz/parser.c | 2 +- dlls/quartz/quartz_private.h | 34 - dlls/quartz/systemclock.c | 4 +- dlls/quartz/videorenderer.c | 7 +- dlls/rpcrt4/cpsf.c | 107 +- dlls/rpcrt4/rpcrt4_main.c | 2 +- dlls/sane.ds/capability.c | 4 +- dlls/sane.ds/sane_Si.rc | 2 +- dlls/sane.ds/sane_i.h | 11 - dlls/sane.ds/sane_main.c | 2 +- dlls/setupapi/setupapi.spec | 4 +- dlls/setupapi/stubs.c | 28 + dlls/setupapi/tests/devinst.c | 29 +- dlls/setupapi/tests/misc.c | 25 +- dlls/setupapi/tests/query.c | 62 +- dlls/shdoclc/Si.rc | 32 +- dlls/shell32/autocomplete.c | 2 +- dlls/shell32/dialogs.c | 4 +- dlls/shell32/iconcache.c | 4 +- dlls/shell32/pidl.c | 9 +- dlls/shell32/pidl.h | 8 - dlls/shell32/shell32_main.h | 4 - dlls/shell32/shellole.c | 21 +- dlls/shell32/shellpath.c | 18 +- dlls/shell32/shellreg.c | 11 - dlls/shell32/shellstring.c | 12 +- dlls/shell32/shlexec.c | 2 +- dlls/shell32/shlfileop.c | 2 +- dlls/shell32/shlfsbind.c | 47 - dlls/shell32/tests/Makefile.in | 3 + dlls/shell32/tests/autocomplete.c | 122 ++ .../rpcss/rpcss.h => dlls/shell32/tests/rsrc.rc | 16 +- dlls/shell32/tests/shfldr_special.c | 45 +- dlls/shell32/tests/shlexec.c | 6 +- dlls/shell32/tests/shlfileop.c | 5 +- dlls/shell32/tests/shlfolder.c | 124 ++ dlls/shell32/undocshell.h | 4 - dlls/shlwapi/tests/url.c | 2 +- dlls/twain_32/twain32_main.c | 2 +- dlls/twain_32/twain_i.h | 14 - dlls/user32/controls.h | 5 +- dlls/user32/cursoricon.c | 23 +- dlls/user32/defdlg.c | 38 +- dlls/user32/dialog16.c | 2 +- dlls/user32/resources/user32_Si.rc | 6 +- dlls/user32/tests/broadcast.c | 4 +- dlls/user32/tests/dde.c | 4 +- dlls/user32/tests/msg.c | 4 +- dlls/user32/win.h | 2 + dlls/uxtheme/msstyles.c | 12 +- dlls/winealsa.drv/alsa.c | 16 +- dlls/winealsa.drv/alsa.h | 12 +- dlls/winealsa.drv/midi.c | 26 +- dlls/winealsa.drv/wavein.c | 34 +- dlls/winealsa.drv/waveout.c | 26 +- dlls/wined3d/arb_program_shader.c | 484 +++----- dlls/wined3d/ati_fragment_shader.c | 58 +- dlls/wined3d/baseshader.c | 219 ++-- dlls/wined3d/basetexture.c | 183 +-- dlls/wined3d/context.c | 2 +- dlls/wined3d/cubetexture.c | 40 +- dlls/wined3d/device.c | 98 +- dlls/wined3d/directx.c | 361 +++--- dlls/wined3d/drawprim.c | 301 ++--- dlls/wined3d/glsl_shader.c | 404 +++---- dlls/wined3d/indexbuffer.c | 20 +- dlls/wined3d/nvidia_texture_shader.c | 28 +- dlls/wined3d/pixelshader.c | 12 +- dlls/wined3d/resource.c | 113 +- dlls/wined3d/state.c | 132 ++- dlls/wined3d/stateblock.c | 25 +- dlls/wined3d/surface.c | 196 +-- dlls/wined3d/surface_base.c | 23 +- dlls/wined3d/surface_gdi.c | 28 +- dlls/wined3d/swapchain.c | 6 +- dlls/wined3d/swapchain_base.c | 7 +- dlls/wined3d/swapchain_gdi.c | 17 +- dlls/wined3d/texture.c | 40 +- dlls/wined3d/utils.c | 130 +- dlls/wined3d/vertexbuffer.c | 38 +- dlls/wined3d/vertexshader.c | 10 +- dlls/wined3d/volume.c | 22 +- dlls/wined3d/volumetexture.c | 40 +- dlls/wined3d/wined3d_gl.h | 11 +- dlls/wined3d/wined3d_private.h | 330 +++--- dlls/winedos/timer.c | 2 +- dlls/winedos/vga.c | 2 +- dlls/winemp3.acm/common.c | 6 +- dlls/winemp3.acm/layer3.c | 6 +- dlls/winemp3.acm/mpg123.h | 3 - dlls/wineoss.drv/audio.c | 89 +- dlls/wineoss.drv/audio.h | 2 +- dlls/wineoss.drv/dscapture.c | 6 +- dlls/wineoss.drv/dsrender.c | 6 +- dlls/wineoss.drv/midi.c | 22 +- dlls/wineoss.drv/mixer.c | 46 +- dlls/wineoss.drv/mmaux.c | 6 +- dlls/wineps.drv/type1.c | 4 +- dlls/winex11.drv/brush.c | 4 +- dlls/winex11.drv/clipboard.c | 23 +- dlls/winex11.drv/desktop.c | 2 +- dlls/winex11.drv/dib.c | 4 +- dlls/winex11.drv/event.c | 4 +- dlls/winex11.drv/ime.c | 18 +- dlls/winex11.drv/opengl.c | 2 +- dlls/winex11.drv/wintab.c | 2 +- dlls/winex11.drv/x11ddraw.c | 2 +- dlls/winex11.drv/x11drv.h | 1 - dlls/winex11.drv/x11font.h | 1 - dlls/winex11.drv/xfont.c | 11 +- dlls/winex11.drv/xrender.c | 6 +- dlls/winex11.drv/xvidmode.c | 6 +- dlls/winex11.drv/xvidmode.h | 4 - dlls/wininet/ftp.c | 2 +- dlls/wininet/http.c | 23 +- dlls/wininet/internet.c | 21 +- dlls/wininet/tests/http.c | 118 ++ dlls/wininet/tests/url.c | 24 + dlls/wininet/urlcache.c | 2 +- dlls/winspool.drv/info.c | 26 +- dlls/winspool.drv/wspool.c | 2 +- dlls/wintab32/context.c | 2 +- dlls/wnaspi32/winaspi16.c | 16 +- dlls/wnaspi32/winaspi32.c | 6 +- dlls/ws2_32/async.c | 64 +- dlls/ws2_32/tests/sock.c | 16 +- include/activdbg.idl | 108 ++ include/cvconst.h | 2 +- include/gdiplusenums.h | 11 + include/gdiplusflat.h | 4 +- include/gdiplusgpstubs.h | 1 + include/mshtml.idl | 294 +++++ include/rpcproxy.h | 25 +- include/wine/library.h | 12 +- include/wine/wined3d.idl | 14 +- include/winnt.h | 17 + libs/wine/ldt.c | 5 +- libs/wine/wine.def | 11 - loader/pthread.c | 18 +- programs/clock/Si.rc | 2 +- programs/cmd/batch.c | 4 +- programs/cmd/directory.c | 2 +- programs/cmd/wcmdmain.c | 2 +- programs/cmdlgtst/Cs.rc | 4 +- programs/cmdlgtst/De.rc | 4 +- programs/cmdlgtst/En.rc | 4 +- programs/cmdlgtst/Es.rc | 4 +- programs/cmdlgtst/It.rc | 4 +- programs/cmdlgtst/Ja.rc | 4 +- programs/cmdlgtst/Ko.rc | 4 +- programs/cmdlgtst/Nl.rc | 4 +- programs/cmdlgtst/Pt.rc | 8 +- programs/cmdlgtst/Si.rc | 4 +- programs/cmdlgtst/Tr.rc | 4 +- programs/regedit/Si.rc | 4 +- programs/regedit/framewnd.c | 2 +- programs/regedit/main.c | 4 +- programs/regedit/regproc.c | 41 +- programs/regedit/treeview.c | 4 +- programs/rpcss/Makefile.in | 2 +- programs/rpcss/rpcss_main.c | 4 +- programs/winecfg/audio.c | 6 +- programs/winecfg/libraries.c | 2 +- programs/winecfg/theme.c | 13 +- programs/winedbg/db_disasm.c | 8 +- programs/winedbg/memory.c | 2 +- programs/winedbg/symbol.c | 2 +- programs/winedbg/types.c | 2 +- programs/winefile/Si.rc | 2 +- server/console.c | 2 +- server/fd.c | 2 +- server/handle.c | 10 +- server/trace.c | 3 +- tools/fnt2bdf.c | 44 +- tools/widl/client.c | 8 +- tools/widl/proxy.c | 133 ++- tools/widl/server.c | 12 +- tools/widl/typegen.c | 114 +- tools/widl/utils.c | 18 +- tools/widl/utils.h | 2 +- tools/widl/widl.c | 1 - tools/winebuild/spec32.c | 4 +- 397 files changed, 6261 insertions(+), 6419 deletions(-) rewrite ANNOUNCE (96%) copy programs/rpcss/rpcss.h => dlls/cryptdlg/cryptdlg.rc (82%) copy dlls/{sane.ds/sane_Si.rc => cryptdlg/cryptdlg_En.rc} (60%) copy programs/rpcss/rpcss.h => dlls/cryptdlg/cryptres.h (64%) create mode 100644 dlls/shell32/tests/autocomplete.c rename programs/rpcss/rpcss.h => dlls/shell32/tests/rsrc.rc (78%) diff --git a/ANNOUNCE b/ANNOUNCE dissimilarity index 96% index 4363f0bd190..c2a9afc4a20 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,553 +1,701 @@ -The Wine development release 1.1.9 is now available. - -What's new in this release (see below for details): - - A large number of regression test fixes. - - Performance improvements in memory management. - - Improved POP3 support in inetcomm. - - Initial implementation of the XInput DLL. - - Various bug fixes. - -The source is available from the following locations: - - http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.9.tar.bz2 - http://prdownloads.sourceforge.net/wine/wine-1.1.9.tar.bz2 - -Binary packages for various distributions will be available from: - - http://www.winehq.org/site/download - -You will find documentation on http://www.winehq.org/site/documentation - -You can also get the current source directly from the git -repository. Check http://www.winehq.org/site/git for details. - -Wine is available thanks to the work of many people. See the file -AUTHORS in the distribution for the complete list. - ----------------------------------------------------------------- - -Bugs fixed in 1.1.9: - - 4355 WMP10 setup fails due to unimplemented functions - 4397 Application doesn't start - 5416 Port royal 2 demo will not start - 5502 Warkanoiddemo hangs with black screen - 6222 updating FFXI PlayOnline produces Unhandled exception after update restart - 6781 "battle for middle earth II" demo fails to install - 6825 imagehlp.ImageDirectoryEntryToData needs to clear out param when entry not found - 6859 renguard does not install - 7206 Scribe3 loops forever on startup adding fonts? - 7652 Transcendence: text and numbers either missing or displayed wrong - 7992 wordweb 5 doesn't download its data - 8047 BOM: DateSerial (VB function) gives 19xx for 2 digit years, but should provide 20xx for years below 30 - 8366 Rainbow Six Vegas fails to start - 8663 Anarchy Online display is completely black when using windowed mode - 8844 ShoreTel Client installer crashes when searching for related applications - 8868 Oblivion crashes outdoors when moving across load boundry - 9064 UBSPay font problem - 9103 X2 The Threat: Bumpmapping broken - 9317 Can't run vbtablet - 9481 LOTRO crash with Alsa at Full Hardware Acceleration - 9529 ETQWBeta2 installer fails to execute vcredist_x86.exe - 9745 Family Archive Viewer 6, Family Tree Maker 8 start off with main window too small - 9912 La Soeur de Barrage: crashes when attempting to start game - 9983 Half-Life 2, Counter Strike Source and other games crash at startup - 10201 Playback progress not working in WMP 9 - 10217 Windows Media Player 10 crashes with builtin urlmon - 10242 RACE - The WTCC Game (Two car DEMO) fails to start - 10314 Switched On Schoolhouse 2000 hangs X on startup - 10395 Programmer's Notepad 2 closes when loading a new file with no existing tabs open - 10592 EVE Online login screen causes some gfx corruptions - 10706 unimplemented ntdll.dll.NtQueryEaFile and ntdll.dll.NtSetEaFile cause CVSNT client included in TortoiseCVS to fail checkout operation - 11663 Guild Wars seems to hang with intel X3100 - 11772 Mathematica 5.1, Help Browser crash everything. - 11777 Guitar Hero 3 fails to start - 12082 Project Nomads: dialog speeches too fast - 12100 lego star wars crashes entering first level - 12550 Farb-Rausch demo 30 "candytron" doesn't render past the loading screen. - 12607 Quake Wars demo crashes on startup - 12774 Caesar 3 crashes on exit - 13035 Bad HAVE_XSLTINIT in msxml3 - 13112 comctl32 trackbar setPos() should not call oncustomdraw if value hasn't changed - 13116 wxDev-C++: Problem building projects - 13150 Guitar Hero 3 crashes without D3DXCreateTextureFromFileInMemoryEx and D3DXCreateTextureFromFileW - 13281 crash during installation of WebEngine V200N by Virtual Mechanics - 13408 ActiveSync 4.5 don't install - error richedit ReadStyleSheet and others - 13426 When installing WebEngine you get the message "http://download.virtualmechanics.com/download/install/webenginev2/200N/WebEngineV200N.msi is not trusted" - 14498 VB6 App problem on MouseIcon property - 14600 Oblivion has wrong thunderbolt spell - 14824 Red Alert 3 Beta requires several functions of WinHttp to be implemented - 14885 [Morrowind] System freeze/reboot required after switching from wine to other apps - 15055 implement undocumented window message 0x0313 (WM_POPUPSYSTEMMENU) - 15233 FamiTracker 0.2.7 does not work - 15289 Warlords Battlecry II and III crash - 15446 Install Aware doesn't work with wine - 15595 Kyodai mahjong crashes - 15690 msvcrt: enumeration value not handled in switch - 15872 Games segfault with wine-1.1.7 and Ubuntu 8.10 intrepid Ibex - 15879 Lotus 6.5.4 - extermelly slow after update to Wine 1.1.6 - 15898 unimplemented function advapi32.dll.LsaSetSecret, aborting - 15916 Winecfg: fails to open drive_c - 15930 ChangeWindowMessageFilter is not implemented - 15944 mountmgr only assign drive letters for up to two removable devices - 15950 wine won't build with bison 2.4 - 15955 Tomb Raider underworld demo crashes at startup - 15972 Clicking close button in Word 2003 closes the window but not the program in 1.1.8 - 15976 MS Exchange 2007 fails to install. - 15992 Sure Thing CD Labeller crashes when you start to try to use it - 15994 DirectX - D3DCAPS errors in WINE 1.1.8 BETA - 16024 typos in include/shlwapi.h - 16044 Cannot accept the Eula. Accept button disabled. - 16061 HEAP_FindSubHeap taking excessive CPU time - 16074 F.E.A.R in wine 1.1.8 regression - 16084 widl crash on vista x86 - ----------------------------------------------------------------- - -Changes since 1.1.8: - -A C Hurst (1): - ntdll: wine_nt_to_unix_file_name() parse string to int instead of cast char, where string may be passed. - -Alexander Morozov (2): - kernel32: NT drivers can handle IOCTL codes with HIWORD == 0. - include: Remove declarations of undefined functions. - -Alexandre Julliard (69): - kernel32/tests: Fix some profile test failures on NT4. - kernel32/tests: Fix some resource test failures on NT4. - kernel32/tests: Fix the thread test on NT4. - kernel32: Explicitly request execute permission in MapViewOfFile. - ntdll/tests: Fix the atom test on NT4. - ntdll: Don't call the dll entry point for native modules. - mountmgr: Return the drive type even when the buffer is too small. - kernel32: Get the drive type from the mount manager instead of the registry. - ntdll/tests: Fix a couple of test failures on Vista. - ntdll: Add support for root directory in NtCreateFile for Win32 file objects. - kernel32: Implemented the Ex variants of CreateEvent/Mutex/Semaphore/WaitableTimer. - ntdll/tests: Fixed more object manager tests on Vista. - user32/tests: Fix window tests on various Windows versions. - user32/tests: Skip the PM_QS_* PeekMessage tests on NT4. - mountmgr: Make the device type more specific than what is possible with the standard Win32 drive types. - user32/tests: Make sure the message test doesn't hang if the window doesn't have focus. - msvcrt/tests: Trace the timezone being used. - user32: Don't process other messages when recursing in peek_message for an internal message. - kernel32: Don't request unneeded access in OpenFileMapping. - kernel32/tests: Fix the thread test to cope with the Win95 InterlockedIncrement behavior. - msvcrt/tests: Run time tests for the current year instead of 1970 and fix wrong DST assumptions. - ole32/tests: Fix a couple of global stream test failures on Win9x. - ole32/tests: Use a CLSID that is more likely to exist on old Windows versions. - ole32/tests: Don't hardcode the Ansi codepage value. - ole32/tests: Fix a couple of test failures on Win9x and NT4. - ntdll: Added stubs for NtGetWriteWatch and NtResetWriteWatch. - kernel32: Added GetWriteWatch and ResetWriteWatch. - kernel32/tests: Added a bunch of tests for write watches. - shell32/tests: Properly cleanup the created favorites shell folder. - include: Added the IInternetProtocolEx interface. - urlmon/tests: Accept IInternetProtocolEx interface id. - kernel32/tests: Fix the file test on various Windows versions. - ntdll: Add private function to manage system virtual views instead of abusing NtAllocateVirtualMemory. - kernel32/tests: Fix the write watch tests on Win98 and Win2000. - user32/tests: Fix the resource tests for various Windows versions. - kernel32/tests: Fix pipe test on w2k3. - user32: Fix FindWindow to not match an empty class name. - ntdll: Don't set noexec protection on builtin dlls, some broken apps clear the execute permission. - wintrust: Fix a buffer overflow. - ntdll: Get rid of the unaligned_mmap wrapper. - kernel32/test: Fix the timer queue tests on Vista. - kernel32/tests: Fix the mailslot tests on Vista. - kernel32/tests: Fix the process tests on NT4. - ntdll: Increase subheap size quadratically to avoid slowdown when allocating tons of heap memory. - kernel32/tests: Allow up to 2 seconds of difference in timestamps. - kernel32: Moved allocation of the DOS memory area to ntdll. - ntdll: Get rid of the Wine-specific MEM_SYSTEM flag. - winetest: Capture the Win32 stderr into the log file too. - winetest: Allow to specify a subset of tests to run on the command line. - winetest: Report an error when a test program completely fails to run. - make_makefiles: Add a target to build only the test directories. - user32/tests: Fix a few more failures in the window test. - kernel32/tests: Add a couple of tests for write watches. - user32/tests: The BSF_SENDNOTIFYMESSAGE flag is not supported on NT4. - user32/tests: Fix the cursor tests on Win9x. - user32/tests: Fix the edit margins tests on Win9x. - user32/tests: Fix wildcard directory lists handling for Win9x. - user32/tests: Fix the monitor tests on NT4. - user32/tests: Fix some of the sysparams tests on Win9x and NT4. - user32/tests: Allow the foreground window to be null in the window tests. - kernel32/tests: Fix test failures on Win9x and NT4. - kernel32/tests: Fix the mailslot tests on Win9x. - mshtml/tests: Avoid crashing on test failure. - rpcrt4/tests: Fix test failures on Win9x. - shell32/tests: Fix the systray tests on Win9x and NT4. - urlmon/tests: Don't expect IHttpNegotiate2 queries if the interface is not supported. - configure: Add a --disable-tests option to avoid building regression tests. - user32/tests: Only test the window caption status if there is a foreground window. - shdocvw: Fix the computation of the default extents. - -Alistair Leslie-Hughes (12): - advapi32: Correct spelling of SE_CHANGE_NOTIFY_PRIVILEGE. - mshtml: Implement IHTMLStyle get/put posLeft. - advapi32: Correct off by one in LookupPrivilegeValueW. - shdocvw: Added Support for the IViewObjectEx interface. - winmm: Increase tolerance range. - mshtml: Add tests for supported interfaces. - shdocvw: Correct tests. - ntoskrnl.exe: Implement MmGetSystemRoutineAddress. - mshtml: Implement IHTMLStyle get/put posTop. - mshtml: Implement IDispatch for IHTMLCurrentStyle. - mshtml: Implement IHTMLDocument2_get_images. - version: VerQueryValueA/W allow blank and NULL strings. - -Andrew Fenn (6): - xinput1_3: Initial implementation. - xinput9_1_0: Initial implementation. - xinput1_1: Initial implementation. - xinput1_2: Initial implementation. - xinput: Added the function XInputGetState with test case. - xinput: Added XInputGetCapabilities function with test case. - -Andrew Nguyen (1): - imagehlp: Rectify and add a forward. - -Andrew Riedi (3): - user32: Initial .ani support (only first frame). - reg: const WCHAR -> static const WCHAR. - user32: Fix the loading of stretched cursors. - -Andrew Talbot (10): - rsaenh: Sign-compare warnings fix. - secur32: Sign-compare warning fix. - setupapi: Sign-compare warnings fix. - shell32: Sign-compare warnings fix. - shlwapi: Sign-compare warnings fix. - urlmon: Sign-compare warnings fix. - msxml3: Void function should not return a value. - widl: Remove superfluous semicolons. - usp10: Sign-compare warnings fix. - wined3d: Sign-compare warnings fix. - -Aric Stewart (2): - winhttp: Correct another difference between InternetCrackurl and WinHttpCrackUrl. - imm32: Implement ImmInstallIME(W/A). - -Austin English (2): - include/shlwapi: Fix some typos. - msvcrt: Fix a compiler warning. - -Christian Costa (12): - d3dxof: Allow template definitions in objects file. - d3dxof: Close source file when releasing EnumObject. - d3dxof: Increase max childs/subobjects and check the limit is not overcome. - d3dxof: Finish strings support. - d3dxof: Fix buffer overflow. - d3dxof: Support also xfile version 3.03. - d3dxof: Increase max objects and check limit. - d3dxof: Add support for DXFILELOAD_FROMMEMORY. - d3dxof: Prepare support for objects binary format. - d3dxof: Allow '-' in names. - d3dxof: Fix data buffer limit check. Increase size of input and data buffers. - d3dxof: Finish support for objects binary format. - -Damjan Jovanovic (4): - winemenubuilder: Generate desktop files instead of wineshelllink. - winemenubuilder: Moved all wineshelllink functionality to winemenubuilder and removed wineshelllink. - shdocvw, winemenubuilder: Generate fd.o entries for .url files. - user32: Handle NULL rectangles in WM_NCCALCSIZE. - -Daniel Zimmermann (1): - widl: Fix check for interface type in get_size_procformatstring. - -David Adam (5): - d3dx8: Simplify D3DXQuaternionInverse. - quartz: Check for NULL condition in FilterGraph2_Disconnect. - d3dx8: Implement D3DXMatrixAffineTransformation2D. - d3dx8: Implement D3DXMatrixTransformation2D. - d3dx8: Change the debug channel of d3dx8 into the generic d3dx. - -Detlef Riekenberg (5): - shlwapi/tests: Add more entries for PathIsURL. - advapi32/tests: Fix tests on win9x (GetFileSecurity not implemented). - advapi32/tests: Fix broken GetLastError tests. - comctl32/tests: Make the header test dpi aware. - shdocvw/tests: Make the webbrowser test dpi aware, make it pass in wine. - -Dmitry Timoshkov (5): - widl: Make the generated string pointers const as well. - appwiz.cpl: Make some data static const. - shell32: Make some data static const. - shdocvw: Fix the COLOR_xxx usage. - user32: Do not change focus if the window is no longer active. - -Dylan Smith (9): - richedit: Created initial tests for windowless richedit controls. - richedit: Initial testing of ITextServices methods. - richedit: Removed comment in header for non-existent wintest.c. - include: Added missing macros for EM_SETIMESTATUS and EM_GETIMESTATUS. - user32: Added message spy string for IME Status messages. - richedit: Update strings and comments regarding IME Status messages. - include: Fixed a typo for ITextHost::TxSetCaretPos declaration. - richedit: Removed unused ME_AutoURLDetect function. - richedit: Removed useless lines in ME_GetDefaultCharFormat. - -Eric Pouech (6): - winedump: Print detailed information about class/struct properties. - dbghelp: Fix all forward declaration cases for UDT. - winedbg: Rewrote the symbol picking mechanism so that it can handle several algorithms. - winedbg: Slightly change the option setting syntax (allows also to get the current state back). - winedbg: Added scoped symbol picker, and options to handle it. - dbghelp: Properly add CPU info to minidump. - -Florian Köberle (2): - user32/tests: Capture tests should not require no active window. - user32/tests: Test size and minmax of WS_THICKFRAME child. - -Francois Gouget (31): - gdiplus: Add a trailing '\n' to a Wine trace. - shell32/tests: Remove spaces before '\n' in ok() calls. - regedit: Remove unneeded variable initializations. - regedit: Check that we were able to allocate line_buf too. - regedit: line_size is supposed to track a string length. - regedit: The xxx_name_len variables track buffer sizes. That is they count the trailing '\0'. Adjust a couple of places that got this wrong and rename them to xxx_name_size. - regedit: Simplify REGPROC_export_string(). - regedit: Tighten a buffer size calculation. - regedit: Simplify / clean up export_hkey(). - regedit: Fix a buffer overflow when exporting binary values in export_hkey(). - regedit: Fix the wrapping of binary values in export_hkey(). - d3dx9_36/tests: Fix compilation on systems that don't support nameless unions. - inetcomm: Fix compilation on systems that don't support nameless unions. - d3d10core: Fix spelling of 'unknown'. - crypt32: Fix Spelling of 'superseded'. - Assorted spelling fixes. - msxml3: Dynamically load libxslt.so and only call xsltInit() if present. - ntdll/tests: Fix typos in test_NtQueryValueKey(). - ntdll/tests: Test how NT(Set, Query)ValueKey() handle non-terminated strings. - kernel32: Fix create_scsi_entry() so it puts properly '\0'-terminated strings in the registry. - kernel32: Simplify and optimize create_(system,env)_registry_keys(). - msxml3: Fix compilation on systems that don't have xsltInit(). - regedit: Fix a buffer allocation in export_registry_key(). - regedit: Pass the string length to REGPROC_export_string(). - regedit: Fix exporting of REG_EXPAND_SZ and other 'weird' strings. - regedit: Avoid wsprintfW() so we can avoid loading user32.dll for 'regedit /E'. - ntdll/tests: Remove a redundant 'if'. - advapi32/tests: Cleanup test_hkey_main_Value_[AW](). - advapi32/tests: Fix the line number reported by test_hkey_main_Value_[AW](). - advapi32/tests: Check how the registry APIs handle non-terminated strings. - reg: Avoid wvsprintfW() so we can avoid loading user32.dll. - -Hans Leidekker (15): - inetcomm: Flesh out the pop3 command parser. - inetcomm: Add an implementation of IPOP3Transport::CommandDELE. - inetcomm: Add an implementation of IPOP3Transport::CommandNOOP. - inetcomm: Add an implementation of IPOP3Transport::CommandRSET. - inetcomm: Add an implementation of IPOP3Transport::CommandRETR. - inetcomm: Add an implementation of IPOP3Transport::CommandTOP. - inetcomm: Support both forms of the UIDL and LIST commands. - inetcomm: Send a notification when disconnecting. - user32: Add a stub implementation of ChangeWindowMessageFilter. - inetcomm: Add an implementation of IVirtualStream. - inetcomm: Get rid of the server info copy. - mlang: Implement IMultiLanguage2::ConvertStringInIStream. - winhttp: Reimplement WinHttpCrackUrl. - winhttp: Add tests for WinHttpCrackUrl. - winhttp: Prefer builtin over native. - -Henri Verbeet (29): - d3d10core: Add a d3d10core dll. - d3d10core: Implement ID3D10Device in d3d10core instead of d3d10. - d3d10core: Allow ID3D10Device to be aggregated. - dxgi: Add a stub for DXGID3D10RegisterLayers. - d3d10core: Implement D3D10CoreRegisterLayers. - dxgi: Implement DXGID3D10RegisterLayers(). - dxgi: Implement DXGID3D10CreateDevice(). - d3d10core: Implement D3D10CoreCreateDevice(). - d3d10: Implement D3D10CreateDevice() on top of D3D10CoreCreateDevice(). - d3d10: Use the factory that created the adapter to create a swapchain. - d3d10core: Add a trace for D3D10CoreCreateDevice(). - dxgi: Add some dxgi return codes. - dxgi: Add a IWineD3D field to dxgi_factory. - dxgi: Add an ordinal field to dxgi_adapter. - dxgi: Add a wined3d device to dxgi_device. - dxgi: Store an array of adapters in dxgi_factory. - dxgi: Implement IDXGIFactory::EnumAdapters(). - dxgi: Add a test for DXGID3D10CreateDevice(). - d3d10core: Add a test for D3D10CoreCreateDevice(). - wininet: Treat an empty username as NULL in FTP_Connect(). - wined3d: Fix the cube map coordinates in surface_blt_to_drawable(). - wined3d: Make it more obvious the pshader path in shader_hw_map2gl() doesn't handle opcodes without parameters. - wined3d: Give mov & mova their own handler. - wined3d: Avoid using a stack buffer in a few places in shader_hw_map2gl(). - wined3d: wined3d_gl.h should be internal to wined3d. - wined3d: Don't use the same GUID for IWineD3D and IWineD3DDevice. - wined3d: Remove some unused code. - dxgi: Implement IDXGIDevice::GetAdapter(). - dxgi: Implement IDXGIAdapter::GetParent(). - -Hirofumi Katayama (2): - wordpad: Accept double-click in date and time dialog. - wordpad: Update resources for date and time dialog. - -Huw Davies (2): - kernel32: Fix a few Welsh translations. - ole32: Don't issue a warning if a flat copy is all that's required. - -Hwang YunSong(황윤성) (2): - winecfg: Updated Korean resource. - oleacc: New Korean resource. - -Jacek Caban (1): - shdocvw: Revert "Added Support for the IViewObjectEx" with tests. - -Juan Lang (28): - crypt32: Don't underreport the size available when formatting szOID_AUTHORITY_KEY_IDENTIFIER2. - crypt32: Fix off-by-one error in formatting szOID_AUTHORITY_KEY_IDENTIFIER2. - crypt32: Implement formatting an alt name entry with type CERT_ALT_NAME_DIRECTORY_NAME. - crypt32: Fix comment typo. - crypt32: Fix indenting for szOID_CRL_DIST_POINTS. - crypt32: Correct heading for a certificate issuer in a CERT_AUTHORITY_KEY_ID2. - crypt32: Use correct string for directory names in a CERT_ALT_NAME_ENTRY. - crypt32: Add a function to format a CERT_NAME_BLOB as an indented string, and implement CertNameToStrW on top of it. - crypt32: Indent directory name when formatting an alt name entry. - crypt32: When formatting a directory name as a multiline string, put a newline between the heading and the value. - crypt32: Implement CryptFormatObject for alternate names. - crypt32: Add tests for encoding/decoding CERT_POLICY_QUALIFIER_USER_NOTICE. - crypt32: Implement encoding CERT_POLICY_QUALIFIER_USER_NOTICE. - crypt32: Implement decoding CERT_POLICY_QUALIFIER_USER_NOTICE. - crypt32: Add tests for encoding/decoding CERT_POLICIES_INFO. - crypt32: Implement encoding CERT_POLICIES_INFO. - crypt32: Implement decoding CERT_POLICIES_INFO. - cryptdlg: Register/unregister the OID functions exported by cryptdlg. - netapi32: Fix dead stores. - include: Fix typos. - include: Add a few missing definitions for Netscape cert extensions. - crypt32: Implement CryptFormatObject for szOID_KEY_USAGE. - crypt32: Implement CryptFormatObject for szOID_NETSCAPE_CERT_TYPE. - crypt32: Fix failing tests on Win9x/NT4. - crypt32: Decoded unicode name value strings should be NULL-terminated. - crypt32: Check registered CryptFormatObject functions before using default hex format. - crypt32: Formatted bits are always in a single line, regardless of dwFormatStrType. - crypt32: Pass next data pointer when decoding a CRL dist point. - -Kai Blin (1): - advapi32: Implement LsaSetSecret stub. - -Ken Thomases (1): - ntdll: Don't poll() on a normal file; it should never block. - -Lei Zhang (2): - comctl32: Check for NULL input in TAB_AdjustRect. - quartz: Reaching a renderer in the filtergraph is not an error. - -Maarten Lankhorst (2): - Revert "quartz: Reaching a renderer in the filtergraph is not an error." - quartz: Fix FilterGraph2_Connect to be thread-safe and not recurse infinitely. - -Marcus Meissner (1): - shdocvw: Fixed buffer size to GetPrivateProfileStringW. - -Nicolas Le Cam (2): - winspool.drv/tests: Fix a test on all platforms. - crypt32/tests: Fix a failing test on win2000. - -Nikolay Sivov (3): - gdiplus: Added GdipGetTextContrast. - gdiplus: Added GdipSetTextContrast. - gdiplus: Return some token value on startup. - -Paul Chitescu (1): - user32: Unimplemented SystemParametersInfoW actions display fixme only once. - -Paul Vriens (25): - ole32/tests: Don't crash on NT4. - advapi32/tests: Fix valgrind warning. - urlmon/tests: Skip some tests on Win9x and WinMe. - urlmon/tests: Fix failures on Win9x and WinMe. - wininet/tests: Fix a test failure on some Win98 boxes. - msi/tests: Fix some test failures on Win9x and WinMe. - winmm/tests: Fix a test failure on Vista and W2K8. - setupapi/tests: Fix some failures on Win9x and WinMe. - ddraw/tests: Fix a typo. - ddraw/tests: Skip tests when DirectDraw4 is not supported. - snmpapi/tests: Fix failures on NT4 and below. - crypt32/tests: Skip some tests if needed. - crypt32/tests: Fix a test failure on Vista and W2K8. - gdi32/tests: Fix a few failures on Win9x and WinMe. - msi/tests: Skip some tests on Win9x and WinMe. - quartz/tests: Fix a few failures on Win95 and NT4. - setupapi/tests: Don't use hardcoded C: for the system drive. - kernel32/tests: Fix timeouts on NT4 and W2K. - msi/tests: Skip tests on win9x by checking functionality instead of registry keys. - user32/tests: Fix a test failure on Win9x, WinMe and NT4. - winetest: Give the 'Running' progress bar the same size as the others. - user32/tests: Don't crash on Win95. - comdlg32/tests 1/2: Fix a test failure on XP and W2K3. - comdlg32/tests 2/2: Fix a test failure on Win9x. - user32/tests: Fix a few test failures on Win9x. - -Peter Dons Tychsen (5): - winedos: Add support for decoding and displaying the 4 bit CGA framebuffer. - winedos: Add support for the Color Control Register (CGA). - winedos: Implement int10 CGA palette control. - winedos: Implement VGA_WritePixel for int10 service in CGA mode. - winedos: Implement mode control register, and the 160x200x4 display mode that it opens. - -Reece Dunn (2): - uxtheme: Add stubs for the double buffer drawing API in Vista. - uxtheme: Draw the correct part of the themed parent background to the DC. - -Ricardo Filipe (27): - appwiz.cpl: Added Portuguese translation. - browseui: Added Portuguese translation. - credui: Added Portuguese translation. - gphoto2.ds: Added Portuguese translation. - localspl: Added Portuguese translation. - localui: Added Portuguese translation. - msvidc32: Added Portuguese translation. - shdoclc: Added Portuguese translation. - wldap32: Added Portuguese translation. - hhctrl.ocx: Added Portuguese translation. - crypt32: Added Portuguese translation. - winspool.drv: Added Portuguese translation. - cabinet: Fix dead stores (llvm/clang). - dbghelp: Fixed dead store (llvm/clang). - gdi32: Fix dead store (llvm/clang). - iphlpapi: Fixed dead store (llvm/clang). - mlang: Fixed dead stores (llvm/clang). - oleaut32: Fixed dead increment (llvm/clang). - ntdll: Fixed dead store (llvm/clang). - rpcrt4: Fixed dead increments (llvm/clang). - msxml3: Check some dead store results (llvm/clang). - sane.ds: Check dead stored status (llvm/clang). - comctl32: Removed dead store (llvm/clang). - comctl32: Removed dead increment (llvm/clang). - comctl32: Removed dead increment (llvm/clang). - comctl32: Remove dead stores (llvm/clang). - atl: Remove dead store (llvm/clang). - -Roderick Colenbrander (1): - wined3d: Add two missing D3D8/D3D9 capabilities. - -Ryan Schmidt (1): - jscript: Fix build with bison 2.4. - -Stefan Dösinger (3): - wined3d: Make sure the arbfp pipeline replacement constants are loaded. - d3d9: Test psize_min vs psize_max vs psize behavior. - wined3d: Rename the fragment ffp desc structures. - -Tony Wasserka (3): - d3dx9: Implement ID3DXSprite_Begin/End. - d3dx9: Implement ID3DXSprite_Flush. - d3dx9: Implement ID3DXSprite_GetDevice. - -Vincent Povirk (4): - msiexec: Build with -mwindows. - comctl32: Do not repaint on TBM_SETPOS if position is unchanged. - gdiplus: Fix GdipFlattenPath for already-flat paths and add a test. - gdiplus: Restore a line I removed by mistake. - -Vitaliy Margolen (1): - user32/tests: Print line numbers of callers in check_wnd_state to help debugging. - --- -Alexandre Julliard -julliard@winehq.org +The Wine development release 1.1.10 is now available. + +What's new in this release (see below for details): + - Support for virtual memory write watches. + - Workarounds for the WINAPI compiler bug on Mac OS. + - Several fixes for the 64-bit build. + - Some more GdiPlus functions. + - Various bug fixes. + +The source is available from the following locations: + + http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.10.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.1.10.tar.bz2 + +Binary packages for various distributions will be available from: + + http://www.winehq.org/site/download + +You will find documentation on http://www.winehq.org/site/documentation + +You can also get the current source directly from the git +repository. Check http://www.winehq.org/site/git for details. + +Wine is available thanks to the work of many people. See the file +AUTHORS in the distribution for the complete list. + +---------------------------------------------------------------- + +Bugs fixed in 1.1.10: + + 709 riched32.dll needs to be improved a lot (was:Richedit does not handle input with PTE) + 1114 Winrar2.90/3.00: Comboex doesn't trigger a event when you mouse-click in some value of it + 1700 Failed to detect Serial Port + 1990 modifier keys not released when switching desktop + 2872 Superpower2 fails to install + 2934 Microsoft Masked Controls 6 Problem + 3552 Unhandled dwRenderStateType playing DeusEx + 3769 photodex plug in or self contained exe's uses 100% CPU + 4090 eMule Plus text entry behavior is broken. cursor is lost in some conditions. + 4095 Warcraft III Polish installer crashes + 4678 DirectX sound doesn't work with OSS Sound driver + 4752 wine client error:1e: write: Bad file descriptor + 5462 Half-Life 2 runs in only part of screen instead of fullscreen (no window) + 5786 Crash while using MSRDO in a Visual Basic 5 Application + 5810 Squeak won't start, complains "failed to create pipe" + 5828 Command and Conquer Generals (Zero Hour) doesn't change the mouse cursor from the default X mouse + 6256 Ankh Demo crashes in DirectX mode + 6314 Emperor.exe crashes when -c is not given in commandline options + 6343 a-10 cuba fails to change resolution and to be topmost window + 6393 Ocad crash report + 6413 Floating point bug exposed in Director MX + 6453 MPLAB 7.43 crashes at startup + 6491 Chief Architech: resizing kde window creates several cloned wine buttons next to file in the bar + 6557 Classic99 v3.7 starts runs extremely slowly + 6587 Missing COM interface Release call in the IGraphBuilder implementation + 6588 Strange return value of the GraphBuilder_Connect function + 6693 wink 2.0 can't capture + 6760 warn:palette:GDISelectPalette invalid selected palette (nil) + 6801 gpstrack help windows are empty + 6807 Sunbird crashes on first run + 6821 Graphical artifacts in HL2:EP1 + 6882 vb3 app hornresp won't run, complains "Invalid property value" on startup. + 6883 vb3 app hornresp crashes on startup + 7113 Hitman Contracts hangs when using Direct3D mode + 7145 Miranda crashes while opening a message window + 7205 Using ALT-F to bring up File menu crashes foobar2000 + 7371 Steinberg License Manager lcc.exe does not run, causes many ole:err + 7440 Command and Conquer Generals (Zero Hour) non-buildable items show as black and white rather than greyscale + 7451 Unreal Editor bitblt fails and crashes + 7538 IvAe crashes with GLXBadDrawable error + 7709 err:d3d_shader:vshader_input_is_color Error + 7903 Crash in CircumReality (maybe related to MIDI) + 7986 Citavi trial fails to install correctly + 8064 DxO Optics Pro 4 installer doesn't display text properly + 8122 Command and Conqueror 3 renders incorrectly with >Low VFX detail + 8134 Finale Notepad 2007: Random crashes during playback. + 8228 Mediamonkey 2.5.5 hangs on startup + 8312 Startopia Demo: Freezes after starting application + 8515 Game Runaway: The dream of the Turtle does not start + 8525 Pokerstars cashier window freezes + 8584 IL-2 Sturmovik: fixme:dbghelp:addr_to_linear Failed to linearize address 4545:00005246 (mode 0) + 8603 Installer crashers during install of Life Balance + 8789 d3d:IWineD3DDeviceImpl_SetMaterial + 8830 IM fails when edit box is a child window in a separate process + 8949 Neocron 2.2 Client.exe crashes at character selection screen + 8998 Unhandled page fault with ME_MarkForPainting in WASTE 1.5 + 9296 Info Select 2007 crashes on startup + 9335 Cannot switch tabs in MYOB + 9349 wine 0.9.43 crash on etherlords 2 + 9353 CreateFile with OPEN_ALWAYS on an existing directory fails with ERROR_ACCESS_DENIED + 9367 Quicktime Player 7.1.0.210 aborts on startup + 9377 Ricochet Infinity cannot download Level Set Catalog + 9514 ABBYY FineReader 8.0 Professional Edition does not start + 9627 Graphical corruption in EVE ONLINE + 9648 Birthday selector in account creation screen positioning is off + 9683 BlipGen's ui disappears + 9773 FileMaker crashes + 9977 Google Earth geographical labels behave strangely + 10029 Tahoma entry in registry, but tahoma related errors re-occur followed by registry entry vanishing + 10104 Oblivion Construction Set main window disappears + 10123 sample .msi file from The Definitive Guide to Windows Installer Chapter 14 crashes wine + 10166 HTML Help (CHM) not working + 10208 testing the high color mode + 10241 Fonts are unreadable when using Turkish Locale + 10420 Nostradamus demo fails to start + 10475 Safari: no space between menu items in menubar + 10492 SDL-based game won't start unless you copy timidity.cfg into current directory + 10511 crash istool on run help/search help/context help/index + 10513 The I of the Dragon: Access violation + 10589 speedfan 4.32 crashes when opened + 10676 Sega rally 2 crashes on start + 10708 Wine lacks support for animated cursors + 10746 ADinstrument Chart crashes when opening a file + 10909 Soul Reaver 2: raziel moves up and down very fast when swimming + 10979 Descent FreeSpace Retail and Demo hang + 11053 Tropico 2: blank screen + 11200 hhctrl.ocx crash in stream_chr + 11517 Microsoft Virtual Earth 3D beta fails to install + 11541 NSIS calls not working on installer + 11813 Port royale: Sound very jittery + 11997 Crash error "Frichinline" on Miranda IM with History++ plugin + 12105 Safari does not have window decorations on KDE + 12125 Enable option No windows border, but use X window manager + 12224 particle effects disappear in everquest 2 + 12256 MathCAD 2000 Pro embedded bit maps not drawn correctly in worksheet + 12646 Guild Wars hang on : GUild Wars hang on this : err:d3d:IWineD3DDeviceImpl_SetLightEnable Too many concurrently active lights + 12756 GunboundWC does not run + 12767 Crash on close of hh when showing any real help file + 12820 Age of Mythology GOLD has strange bars near text + 12951 original lotro-launcher under wine + 13008 tntMPD program will install but not execute (throws error and quits) + 13153 SmartBarXP closes during startup + 13184 Settler 6 Demo SegFault + 13283 ArchiCAD 11 cannot install, overflow of free space? + 13519 Master of Orion 3 shows black screen + 13716 ISIS Draw atom symbol selector disappears + 14208 Star Wars Galactic Battlegrounds crashes + 14270 KeepTools hora.exe gives "OLE error 80004001" at startup + 14440 SWAT4: Severe graphics glitches + 14473 msn 8.5 final does not show the initial screen + 14919 Atomic Bomberman reports 2 gamepads, when 4 are present. + 14993 Microsoft Office 2003 installation not finishing correctly + 15064 MSN Messenger 7.0 hangs after configuring the webcam + 15070 HxD cant find Internetupdate + 15263 Cannot install games in Steam (requires opening new iexplore window) + 15559 winealsa sound regression: scratchiness/stutter in multiple games + 15571 Adobe Photoshop CS3 aborts with missing gdiplus functions + 15748 .NET 1.1's dotnetfx fails to install, aborts when it can't stop the msi service? + 15788 Battlefield 1942 fails to install + 16011 widl: Complex structs should have their pointer layout section after the structure's description + 16090 Fritz 11 Crashes on exit with builtin shdocvw + 16157 Rhino 4.0 fails to install, MSI version not found + 16180 Delphi 1 app won't start, dos support unavailable + 16207 After running for an indeterminate amount of time, the system tray icon disappears. + 16213 Excel 2003 hangs on formulas - Regression from 1.1.8 + 16247 Safari crashes on launch + 16261 SmartBarXP crashes during launch + 16266 Avatar legends of the arena cannot access it's database + 16269 InternetCreateUrl does not encode URL_COMPONENTS.lpszExtraInfo + 16287 InternetCreateUrl does not encode URL_COMPONENTS.lpszExtraInfo + 16318 ‘GdipMultiplyMatrix’ discards qualifiers from pointer target type + 16319 winealsa: compiler errors + 16321 test_ImmSetCompositionString passing argument 1 of ‘winetest_ok’ makes integer from pointer without a cast + +---------------------------------------------------------------- + +Changes since 1.1.9: + +Alexander Morozov (1): + ntoskrnl.exe: Fix ObfDereferenceObject function calling convention. + +Alexandre Julliard (96): + configure: Print a few more hints about requiring 32-bit libraries. + kernel32: Fix the base DOS memory address when the low 64K are not accessible. + winetest: Optionally compress the distributed exe with upx. + services: Properly initialize service status at creation time. + ntdll: Check for valid memory view size directly in VIRTUAL_FindView. + ntdll: Pass the error code to VIRTUAL_HandleFault, and allow it to ignore the exception. + ntdll: Add support for virtual write watches. + widl: Make sure format strings for structure and union types are only output once. + kernel32/tests: Fix the unimplemented check for EnumSystemLanguageGroupsA. + user32/tests: Fix a number of window tests on Win9x and Vista. + advapi32: Reimplemented ChangeServiceConfig2W in services.exe. + widl: Fix the handling of proxy delegation. + rpcrt4: Convert the dll registration routines to Unicode. + rpcrt4: Use RegDeleteTree to properly unregister interfaces. + rpcrt4: Create the NumMethods key too when registering an interface. + widl: Do not make the stub vtbl const for delegating interfaces since it needs to be patched up at run-time. + cryptdlg: Include objbase.h for function prototypes. + gdiplus: Export the GdipGetAllPropertyItems function. + mswsock: Export the WSARecvEx function. + include: Fix an enum definition that was actually defining a variable. + dmband: Remove some unused functions. + dmcompos: Remove some unused functions. + dmime: Remove some unused functions. + dmscript: Remove some unused functions. + dmstyle: Remove some unused functions. + dmsynth: Remove some unused functions. + dmusic: Remove some unused functions. + dplayx: Remove some unused functions. + dswave: Remove some unused functions. + widl: Make the generated global variables and functions hidden. + widl: Don't define PROXY_DELEGATION unconditionally. + widl: Output vtable information even for interfaces that don't define new functions. + widl: Sort the proxy interfaces by iid and use a binary search in IID_Lookup. + ole32: Use a dlldata.c file instead of maintaining the data manually. + oleaut32: Use a dlldata.c file instead of maintaining the data manually. + oleaut32: Make some functions static. + quartz: Make some functions and variables static. + sane.ds: Make some functions static. + gphoto.ds: Make some functions and variables static. + twain_32: Make some functions static. + winemp3.acm: Make some variables static. + winspool.drv: Make some functions static. + localspl: Make some functions static. + jscript: Make some functions and variables static. + ddraw: Make some functions static. + devenum: Make some functions static. + dxdiagn: Make some functions static. + crypt32: Make some functions and variables static. + mshtml: Make some functions static. + wined3d: Make some functions and variables static. + ole32: Register interfaces through dlldata.c as far as possible. + oleaut32: Register interfaces through dlldata.c as far as possible. + wined3d: Fix some macros definitions to make them proper C statements. + shell32: Remove some unused functions. + shell32: Make some functions static. + winex11: Remove some unused functions. + winex11: Make some functions static. + ole32: Remove some unused functions. + dmloader: Remove an unused function. + dmloader: Make some functions static. + comdlg32: Make some functions static. + dinput: Make some functions static. + rpcss: Get rid of the useless rpcss.h header. + rpcss: Build with -D__WINESRC__ since it's using Wine-specific features. + winebuild: Don't add stdcall decorations on non-x86 platforms. + gdiplus: Fix the GdipMultiplyMatrix prototype. + Define _WIN32_WINNT before including any headers. + comctl32/tests: Avoid handle casts in traces. + gdiplus/tests: Don't cast pointers to integers. + imm32/tests: Don't use a pointer in an ok test. + ntdll/tests: Use the correct prototype for RtlAllocateHeap/RtlReAllocateHeap. + quartz: Use FIELD_OFFSET instead of casting a pointer to int. + ntdll: Implemented RtlCaptureContext. + Avoid including time.h before winsock.h in tests. + browseui: Make a function static. + comctl32: Make a function static. + d3d8: Make a function static. + d3d9: Make some functions static. + d3d9_36: Make a function static. + d3dxof: Make some functions static. + dbghelp: Make a function static. + inetcomm: Make a function static. + mciavi32: Make a function static. + ole32: Make a function static. + rpcrt4: Make a variable static. + uxtheme: Make some functions static. + wintab32: Make a function static. + winedos: Make a function static. + mountmgr.sys: Avoid a compiler warning on older gcc. + wininet/tests: Avoid using size_t in a trace. + winealsa.drv: Fix a printf format warning. + wineoss.drv: Fix a couple of printf format warnings. + server: Limit the number of allocated handles before running out of memory. + configure: Disable some modules by default on non-x86. + fnt2bdf: Get rid of useless string constants. + libwine: Don't export the selector functions for the Windows build. + +Alistair Leslie-Hughes (10): + shdocvw: Silence invalid QueryInterface FIXME. + version: Stop crash under vista and 2k8. + mshtml: Implement IHTMLDocument2 get_applets. + mshtml: Implement IHTMLDocument2 get_links. + mshtml: Implement IHTMLDocument2 get_forms. + mshtml: Implement IHTMLDocument2 get_anchors. + mshtml: Add a test case. + mshtml: Implement IDispatch for IHTMLCommentElement. + msxml3: Implement IXMLDOMAttribute get/put value. + mshtml: Implement IHTMLStyle get/put overflow. + +Andrew Nguyen (9): + jscript: Implement the String.toLowerCase() method. + jscript: Implement the String.toUpperCase() method. + jscript: Implement the String.big() method. + jscript: Implement the String.blink() method. + jscript: Implement the String.bold() method. + jscript: Implement the String.fixed() method. + jscript: Implement the String.italics() method. + jscript: Implement the String.small() method. + jscript: Implement the String.strike() method. + +Andrew Riedi (5): + user32: Make the hotspot ICON_HOTSPOT when loading icons. + user32: Cursors can have more than one color. + user32: The frames of .ani cursors are .ico's, not .cur's. + imm32: No need for tests to return 0. + imm32: Add some really basic tests for ImmSetCompositionString(). + +Andrew Talbot (10): + gdiplus: Void function should not return a value. + wined3d: Sign-compare warnings fix. + wined3d: Sign-compare warnings fix. + wineps.drv: Declare some variables static const. + wined3d: Sign-compare warnings fix. + winedos: Sign-compare warning fix. + winemp3.acm: Sign-compare warnings fix. + dxgi: Memory allocation size fix. + wineoss.drv: Sign-compare warnings fix. + winex11.drv: Sign-compare warnings fix. + +Aric Stewart (2): + comctl32/tab: Return default tab width in TCM_SETMINTABWIDTH if lParam is a negative value. + gdi32: Use the substitute name, if it exists, when looking for font system links. + +Austin English (1): + dnsapi: Remove a useless check. + +Chris Robinson (1): + wined3d: Make sure a context is set for query object generation. + +Christian Costa (12): + d3dxof: Support multi-dimentional array in templates. + d3dxof: Small clean-up. + d3dxof: Finish support for multi-dimensional array. + wined3d: Implement CONVERT_CK_RGB24 in d3dfmt_convert_surface. + d3dxof: Keywords are case insensitive. + dmime: Make stub returns a error to avoid crashing. + d3dxof: Make parsing more permissive about semicolon and comma in objects. + d3dxof: Increase some buffer and array sizes. + d3dxof: Handle comments when going to next template or object. + quartz: Avoid leaking penummt and mt on error. + quartz: Return properly when input is flushing or reaching end of stream. + ddraw: Fix some comments. + +David Adam (1): + d3dx8: Add a few tests for MatrixStack. + +Dmitry Timoshkov (1): + gdi32: Make PATH_AddEntry static. + +Francois Gouget (46): + regedit: Fix handling of zero-byte binary values for 'regedit /E'. + atl: Remove WINAPI on static functions where not needed. + comdlg32: Remove WINAPI on static functions where not needed. + crypt32: Remove WINAPI on static functions where not needed. + d3d8: Remove WINAPI on static functions where not needed. + ddraw: Remove WINAPI on static functions where not needed. + Assorted spelling fixes. + d3d9: Remove IDirect3DDevice9Impl_GetFrontBuffer() as it is unused. + d3d9: Remove WINAPI on static functions where not needed. + shlwapi: Remove WINAPI on static functions where not needed. + wined3d: Remove WINAPI on static functions where not needed. + user32: Remove WINAPI/CALLBACK on static functions where not needed. + msxml3: Remove WINAPI on static functions where not needed. + wintrust: Remove WINAPI on static functions where not needed. + wininet: Remove WINAPI on static functions where not needed. + wineoss: Remove WINAPI on static functions where not needed. + version: Remove WINAPI on static functions where not needed. + wrc: parser_error() does not need a trailing '\n'. + ole32: Remove __RPC_USER on static functions where not needed. + oleaut32: Remove WINAPI on static functions where not needed. + opengl32: Remove WINAPI on static functions where not needed. + shdocvw: Remove WINAPI on static functions where not needed. + quartz: Remove WINAPI on static functions where not needed. + quartz: Remove CALLBACK on static functions where not needed. + rpcrt4: Remove WINAPI on static functions where not needed. + ole32: Remove WINAPI on static functions where not needed. + shell32: Remove WINAPI/CALLBACK on static functions where not needed. + Straighten out some ellipses. + dxdiagn: Remove WINAPI on static functions where not needed. + objsel: Remove WINAPI on static functions where not needed. + ntdll: Remove WINAPI on static functions where not needed. + msvcrt: Remove WINAPI on static functions where not needed. + msi: Remove WINAPI on static functions where not needed. + mapi32: Remove WINAPI on static functions where not needed. + mlang: Remove WINAPI on static functions where not needed. + localspl: Remove WINAPI on static functions where not needed. + dmloader: Remove WINAPI on static functions where not needed. + dplay: Remove WINAPI on static functions where not needed. + dplayx: Remove WINAPI on static functions where not needed. + dsound: Remove WINAPI on static functions where not needed. + ws2_32: Fix the checks for AQ_WIN16. + ntdll: Remove an unneeded cast. + regedit: Deal with races in 'regedit /E' by resizing the buffers and retrying. + server: Remove an unneeded cast. + cmdlgtst: Fix an ellipsis in the copyright message. + Make sure we have a space before the ellipses in Slovenian resources. + +Hans Leidekker (16): + gdiplus: Add a stub implementation of GdiplusNotificationHook and GdiplusNotificationUnhook. + gdiplus: Implement GdipGetLineSpacing. + gdiplus: Implement GdipNewPrivateFontCollection and GdipDeletePrivateFontCollection. + gdiplus: Add a stub implementation of GdipPrivateAddMemoryFont. + gdiplus: Implement GdipGetFontCollectionFamilyCount and GdipGetFontCollectionFamilyList. + gdiplus: Improve GdipMeasureString. + gdiplus: Return success from the GdipSaveGraphics and GdipRestoreGraphics stubs. + gdiplus: Add stub implementations of GdipBeginContainer2 and GdipEndContainer. + gdiplus: Add stub implementations of GdipCreateHalftonePalette and GdipImageForceValidation. + gdiplus: Improve GdipGetImageRawFormat stub. + setupapi: Implement SetupInstallFile{A, W}. + gdiplus: Better implementation of GdipGetFontHeightGivenDPI. + wininet: Don't increase index in HttpQueryInfo if requested level is HTTP_QUERY_STATUS_CODE. + wininet: Append the extra info part in InternetCreateUrl{A, W}. + wininet: Support setting username and password options on request handles. + wininet: Stop leaking username and password. + +Henri Verbeet (40): + wined3d: Move caps related constants and structures to wined3d_caps.h. + wined3d: Use IDL to generate wined3d.h. + wined3d: Const correctness fixes. + wined3d: Don't call IWineD3DSurfaceImpl_GetData() from surface_gdi.c. + wined3d: Slightly reduce the scope of fragment_palette_conversion. + wined3d: Make some functions static. + wined3d: Const correctness fixes for utils.c. + wined3d: Make the SHADER_OPCODE_ARG parameter to shader handlers const. + wined3d: Const correctness fixes for arb_program_shader.c. + wined3d: Const correctness fixes for glsl_shader.c. + wined3d: Const correctness fixes for surface.c. + wined3d: Const correctness fixes for ati_fragment_shader.c. + wined3d: Remove some unnecessary casts in process_vertices_strided(). + wined3d: Const correctness fixes for device.c. + wined3d: Make minMipLookup_noFilter and magLookup_noFilter const. + wined3d: Const correctness fixes for surface_base.c. + wined3d: Remove some superfluous casts. + wined3d: Const correctness fixes for directx.c. + wined3d: Fix the glWeightPointerARB prototype. + wined3d: Make the lpData member of WineDirect3DStridedData const. + wined3d: Const correctness fixes for drawprim.c. + wined3d: Handle a few "silent" FIXMEs more consistent with the rest of the code. + wined3d: Const correctness fixes for state.c. + wined3d: Const correctness fixes. + wined3d: IWineD3DBaseTexture and IWineD3DResource don't need Vtbl's. + wined3d: Remove some unused code. + wined3d: Rename basetexture functions to reflect that they're not COM functions. + wined3d: Rename resource functions to reflect that they're not COM functions. + wined3d: Make functions static where possible. + wined3d: Use a bitmask to store which bool and int constants are set. + wined3d: Disable checkGLcall when WINE_NO_DEBUG_MSGS is specified. + wined3d: Move GlPixelFormatDesc to wined3d_private.h where it belongs. + wined3d: Remove sampled_format from IWineD3DBaseShaderClass, it isn't used anywhere. + wined3d: Make shader texture format fixups more generic. + wined3d: Get rid of vcheckGLcall. + wined3d: Slightly improve drawStridedSlow() performance. + wined3d: Remove a redundant condition in shader_get_opcode(). + wined3d: Explicitly pass the version and instruction table to shader_get_opcode(). + wined3d: Explicitly pass the shader version to shader_dump_decl_usage(). + wined3d: Explicitly pass the shader version to shader_dump_param() and shader_dump_arr_entry(). + +Huw Davies (12): + ole32: Factor out the code to release the delegate interfaces. + ole32: Defer releasing the delegate interfaces until after we return from an OnClose notification. + version: Fixed comments. + oleaut32: Add support for loading typelibs from NE files. + comdlg32: GetPrinterW and GetPrinterDriverW return the size in bytes so don't multiply by sizeof(WCHAR). + ole32: Forward the ASYNC_STGMEDIUM user marshallers to the STGMEDIUM quadruple. + d3d8/tests: Skip tests if we can't create the D3D8 object. + d3d9/tests: Skip tests if we can't create the D3D9 object. + d3d10core/tests: Skip the tests if we can't create a DXGI factory. + dxgi: Don't crash and just skip the tests if glX in not available. + ddraw/tests: Skip tests if we can't create a primary surface. + opengl/tests: Skip tests if we can't find a pixel format. + +Hwang YunSong(황윤성) (3): + crypt32: Updated Korean resource. + wordpad: Updated Korean resource. + appwiz.cpl: Updated Korean resource. + +Jacek Caban (6): + mshtml: Call necko's SetUploadStream from wrapper's SetUploadStream. + mshtml: Skip tests on old IE as soon as possible. + mshtml: Skip tests on old IE as soon as possible. + jscript: Set script object instead of ctx lcid in SetScriptSite. + activdbg.idl: Added IDebugApplication64 and IActiveScriptSiteDebug64 declarations. + ntoskrnl.exe: Forward ZwMakeTemporaryObject to ntdll. + +Jan de Mooij (2): + shell32/autocomplete: Fix handling of WM_KILLFOCUS messages. + shell32/autocomplete: Add unit tests for autocomplete. + +Jeff Zaroyko (3): + ntdll: Avoid NULL deref in RtlDeleteTimer. + kernel32: Add a test for CreateFile when using OPEN_ALWAYS on directories. + wineserver: Don't use O_CREAT and O_EXCL when attempting to open directories. + +Jerome Gardou (1): + d3dx8: Implement D3DXMatrixStack_MultMatrix. + +Juan Lang (4): + crypt32: Implement CryptFormatObject for the Netscape string OIDs. + rsaenh: Fix some test failures on older versions of Windows. + crypt32: Accept any string format as the display text of a user notice policy qualifier. + cryptdlg: Implement FormatVerisignExtension. + +Jérôme Gardou (9): + d3dx8: Implement D3DXMatrixStack_MultMatrixLocal. + d3dx8: Implement D3DXMatrixStack_RotateAxis. + d3dx8: Implement D3DXMatrixStack_RotateAxisLocal. + d3dx8: Implement D3DXMatrixStack_RotateYawPitchRoll. + d3dx8: Implement D3DXMatrixStack_RotateYawPitchRollLocal. + d3dx8: Implement D3DXMatrixStack_Scale. + d3dx8: Implement D3DXMatrixStack_ScaleLocal. + d3dx8: Implement D3DXMatrixStack_Translate. + d3dx8: Implement D3DXMatrixStack_TranslateLocal. + +Kai Blin (2): + dbghelp: Upgrade FIXME to ERR. + kernel32/tests: logfile can be NULL, avoid dereferencing it (Coverity). + +Kirill K. Smirnov (3): + winecfg/audio: Fix uninitialized variable. + winecfg/audio: Simplify removeDriver() function. + winecfg/audio: Properly terminate an empty list of drivers. + +Konstantin Kondratyuk (1): + include: Add new interfaces to mshtml.idl. + +Lei Zhang (5): + advapi32: Allow opening HKEY_CLASSES_ROOT subkeys with backslash prefix on NT. + comctl32: Process WM_CHAR instead of WM_KEYDOWN for numbers in datetime. + comctl32: Do ascii to integer conversion only once. + comctl32: Better day of the month input checking in datetime. + msi: Set DllVersion registry key for CLSID_IMsiServerMessage. + +Maarten Lankhorst (20): + includes: Add win64 calling convention. + winebuild: Use ms-abi for delayed load stubs. + ntdll: Make 64-bits wine only able to load amd64 binaries. + msvcrt: Add CDECL to all cdecl functions. + wldap32: Fix winldap_private header compatibility with 64-bit. + tools: Add calling conventions for win64 to winegcc. + qmgrprxy: Fix building on wine64. + kernel32: Fix 64-bits error in profile. + ole32: Add Co*InitializeSpy functions. + winmm: Some 64-bit pointer fixes. + msacm: Fix pointer truncation. + dsound: 64-bit pointer fixes. + ole32: Fix releasing spy. + loader: Implement setting %gs for amd64. + include: Add NtCurrentTeb assembly for win64. + wineoss.drv: Get rid of sizeof in traces. + wineoss.drv: Fix 64-bits incompatibilities. + winealsa.drv: Get rid of sizeof in traces. + winealsa.drv: Fix 64-bits incompatibilities. + user32: Fix dialogs for 64-bits wine. + +Marcus Meissner (1): + wined3d: Output the rectangles in the debug message. + +Michael Karcher (8): + msvcrt: Out strings should be ptr instead of wstr in .spec file. + msxml3: Avoid duplicate encoding. + msxml3/tests: Fix BSTR leak. + msxml3: Quiet noisy fixmes. + msxml3: Move attach_xmlnode.c to domdoc.c. + msxml3: Specialize attach_xmlnode to XML documents. + msxml3: Remove attach_xmldoc(This, NULL) calls. + msxml3: attach_xmldoc may fail. + +Michael Stefaniuc (27): + msi: Remove casts of void pointers. + regedit: Remove NULL check before HeapFree (Smatch). + gdi32: Remove some superfluous casts. + kernel32: Remove some superfluous casts of void pointers. + iphlpapi: Remove a comment that dared to ponder to use malloc. + winex11.drv: Remove some superfluous casts. + wininet: Remove some superfluous casts. + iphlpapi/tests: Replace malloc with HeapAlloc. + oledlg: Remove some superfluous casts. + imm32: Remove some superfluous casts. + itss: Remove unneeded casts of zero. + winecfg: Remove some superfluous casts. + cmd: Remove some superfluous casts. + regedit: Remove some superfluous casts. + ws2_32/tests: Remove some superfluous casts. + hal: Don't cast zero. + mshtml: Remove two superfluous casts. + msrle32: Remove some superfluous casts. + msvcrt: Use NULL instead of casting zero. + msxml3: Do not cast void pointers to other pointer types. + quartz: Don't cast zero. + wnaspi32: Replace malloc with HeapAlloc. + wnaspi32: Remove some superfluous casts. + atl: Remove two superfluous casts. + ddraw: Remove two superfluous casts. + gdiplus: Reduce the number of casts by using the proper type for variables. + gdiplus: Remove some superfluous casts. + +Nikolay Sivov (6): + gdiplus: Stub for GdipGetImagePaletteSize. + gdiplus: Added GdipTranslateTextureTransform. + gdiplus: Added GdipRotateTextureTransform. + gdiplus: Added GdipMultiplyTextureTransform. + gdiplus: Added GdipGetPenFillType. + gdiplus: Added GdipScaleTextureTransform. + +Paul Vriens (26): + advapi32/tests: Fix a test failure on NT4. + rsaenh/tests: Fix a test failure on W2K and below. + rsaenh/tests: Use a 40-bit session key instead of 56-bit. + rsaenh/tests: Fix a test failure on W2K and below. + rsaenh/tests: Use a 40-bit session key instead of 56-bit. + rsaenh/tests: Fix a test failure on W2K and below. + aclocal.m4: Add i686-pc-mingw32 to the cross-compiler prefixes. + rsaenh/tests: Fix a test failure on NT4 and below. + rsaenh/tests: Fix a test failure on NT4 and below. + rsaenh/tests: Fix a test failure on Win98. + shell32/tests: Fix a few test failures on Win9x and NT4. + shell32/tests: Skip some tests on Win9x and WinMe. + lz32/tests: Fix a test failure on Win9x. + advapi32/tests: Fix some crashes on NT4. + shell32/tests: Fix a test failure on Win9x. + ntdll/tests: Fix a test failure on W2K. + shell32/tests: Cast-qual warning fixes. + shell32/tests: Fix some errors on Win9x and Vista and prevent a crash on NT4. + shell32/tests: Fix a test failure on Win9x, NT4, Vista and W2K8. + gdi32/tests: Fix a few test failures on Win9x and WinMe. + shlwapi/tests: Use a codepage that is supported on all platforms. + gdi32/tests: Fix a few test failures on Win9x and WinMe. + hlink/tests: Fix some failures on Win9x and WinMe. + oleacc/tests: Fix the test failures on Win9x/WinMe and Vista/W2K8. + shell32/tests: Fix some new test failures on W2K. + user32/tests: Fix some typos. + +Peter Dons Tychsen (2): + winedos: Fixed memory resize function which returned paragraphs in some cases instead of bytes. + winedos: Fixed a problem with timer values that are below 50ms. + +Reece Dunn (2): + winealsa: Calculate the delay correctly as snd_pcm_delay is not reliable in this context. + winealsa.drv: Correct the period_time value for pulseaudio. + +Ricardo Filipe (7): + advapi32: Removed dead assignments (llvm/clang). + quartz: Removed dead code and variables (llvm/clang). + comctl32: Removed dead assignments (llvm/clang). + comdlg32: Removed dead assignments (llvm/clang). + crypt32: Remove dead code (llvm/clang). + iccvid: Remove dead stores (llvm/clang). + setupapi: Add stubs for SetupPromptForDiskA/W. + +Rob Shearman (3): + widl: Output the correct buffer size required for parameters whose sizes are known at type-generation time. + widl: Fix optimisation for writing out ref pointers to simple structs and base types. + winspool.drv: Use CP_UNIXCP instead of CP_ACP for data that is going to or coming from system library functions. + +Roderick Colenbrander (2): + wined3d: Add registry key for overriding pci device id. + wined3d: Add registry key for overriding the pci vendor id. + +Stefan Dösinger (8): + wined3d: Make the shader backend call CompileShader. + wined3d: Pass some stateblock values around directly. + wined3d: Store shader IDs in the vs and ps impl structures. + wined3d: Add the ability to duplicate GL pixel shaders. + wined3d: Enable blue = 1.0 fixup for D3DFMT_V8U8. + wined3d: Put the ps compile parameters into the glsl program hashmap. + d3d9: Document a Microsoft header bug. + wined3d: Fix D3DFMT_R32F, R16F, G16R16F, ... in the pixel shader. + +Vincent Pelletier (1): + wined3d: Add detection for NVIDIA's GTX 280. + +Vincent Povirk (18): + gdiplus: Implement CachedBitmap based on Image. + setupapi: Implement FLG_PROFITEM_GROUP. + gdiplus: Add parameter checking to GdipGetRegionHRgn. + gdiplus: Implement GdipGetRegionHRgn for infinite regions. + gdiplus: Implement GdipGetRegionHRgn for empty regions. + gdiplus: Implement GdipRegionGetHRgn for paths. + gdiplus: Implement GdipGetRegionHRgn for rects. + gdiplus: Implement GdipGetRegionHRgn for combined regions. + gdiplus: Add stub for GdipSetPenCompoundArray. + shell32: Add test for localized filenames in desktop.ini. + winex11.drv: Fix string format warning. + advpack/tests: Fix string format warning. + dinput/tests: Fix string format warning. + msxml3/tests: Fix string format warnings. + setupapi/tests: Fix string format warnings. + winedbg: Fix string format warnings. + widl: Fix string format warning. + server: Fix string format warning. + +Vitaliy Margolen (2): + dinput: Use correct GetObjectInfo for joystick. + ntdll: Stub NtMakeTemporaryObject. + +Vitaly Lipatov (2): + kernel32: gethostname returns string in CP_UNIXCP encoding. + winex11: Add check for XmbTextPropertyToTextList result. + +Vitaly Perov (2): + mlang: Add implementation of fnIMLangFontLink_GetCharCodePages. + mlang/tests: Add tests for fnIMLangFontLink_GetCharCodePages. + +Vladimir Pankratov (1): + shdocvw: Implement go_home function. + +-- +Alexandre Julliard +julliard@winehq.org diff --git a/VERSION b/VERSION index 0af4e4629b7..ed413deec76 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Wine version 1.1.9 +Wine version 1.1.10 diff --git a/configure b/configure index 3e24125d1c6..441f185875e 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.9. +# Generated by GNU Autoconf 2.61 for Wine 1.1.10. # # 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.9' -PACKAGE_STRING='Wine 1.1.9' +PACKAGE_VERSION='1.1.10' +PACKAGE_STRING='Wine 1.1.10' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -1305,7 +1305,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Wine 1.1.9 to adapt to many kinds of systems. +\`configure' configures Wine 1.1.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1374,7 +1374,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.1.9:";; + short | recursive ) echo "Configuration of Wine 1.1.10:";; esac cat <<\_ACEOF @@ -1506,7 +1506,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.1.9 +Wine configure 1.1.10 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1520,7 +1520,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Wine $as_me 1.1.9, which was +It was created by Wine $as_me 1.1.10, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2250,10 +2250,22 @@ esac case $host_cpu in *i[3456789]86*) - if test "x$enable_win16" != "xno" - then - enable_win16="yes" - fi + enable_win16=${enable_win16:-yes} + ;; + *) + enable_win16=${enable_win16:-no} + enable_ifsmgr_vxd=${enable_ifsmgr_vxd:-no} + enable_mmdevldr_vxd=${enable_mmdevldr_vxd:-no} + enable_monodebg_vxd=${enable_monodebg_vxd:-no} + enable_vdhcp_vxd=${enable_vdhcp_vxd:-no} + enable_vmm_vxd=${enable_vmm_vxd:-no} + enable_vnbt_vxd=${enable_vnbt_vxd:-no} + enable_vnetbios_vxd=${enable_vnetbios_vxd:-no} + enable_vtdapi_vxd=${enable_vtdapi_vxd:-no} + enable_vwin32_vxd=${enable_vwin32_vxd:-no} + enable_w32skrnl=${enable_w32skrnl:-no} + enable_winedos=${enable_winedos:-no} + enable_winevdm=${enable_winevdm:-no} ;; esac @@ -26486,7 +26498,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.9, which was +This file was extended by Wine $as_me 1.1.10, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26539,7 +26551,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 1.1.9 +Wine config.status 1.1.10 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index d7eaecccb40..f07db4c2a87 100644 --- a/configure.ac +++ b/configure.ac @@ -99,10 +99,23 @@ esac dnl enable_win16 defaults to yes on x86, to no on other CPUs case $host_cpu in *i[[3456789]]86*) - if test "x$enable_win16" != "xno" - then - enable_win16="yes" - fi + enable_win16=${enable_win16:-yes} + ;; + *) + enable_win16=${enable_win16:-no} +dnl disable some modules by default on non-x86 + enable_ifsmgr_vxd=${enable_ifsmgr_vxd:-no} + enable_mmdevldr_vxd=${enable_mmdevldr_vxd:-no} + enable_monodebg_vxd=${enable_monodebg_vxd:-no} + enable_vdhcp_vxd=${enable_vdhcp_vxd:-no} + enable_vmm_vxd=${enable_vmm_vxd:-no} + enable_vnbt_vxd=${enable_vnbt_vxd:-no} + enable_vnetbios_vxd=${enable_vnetbios_vxd:-no} + enable_vtdapi_vxd=${enable_vtdapi_vxd:-no} + enable_vwin32_vxd=${enable_vwin32_vxd:-no} + enable_w32skrnl=${enable_w32skrnl:-no} + enable_winedos=${enable_winedos:-no} + enable_winevdm=${enable_winevdm:-no} ;; esac diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 3d027779355..b5c10ff7dcc 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -2146,7 +2146,7 @@ static void test_SetEntriesInAcl(void) if (!pSetEntriesInAclW) { - skip("SetEntriesInAclW is not available\n"); + win_skip("SetEntriesInAclW is not available\n"); return; } @@ -2154,7 +2154,7 @@ static void test_SetEntriesInAcl(void) res = pSetEntriesInAclW(0, NULL, NULL, &NewAcl); if(res == ERROR_CALL_NOT_IMPLEMENTED) { - skip("SetEntriesInAclW is not implemented\n"); + win_skip("SetEntriesInAclW is not implemented\n"); return; } ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); @@ -2164,7 +2164,7 @@ static void test_SetEntriesInAcl(void) res = InitializeAcl(OldAcl, 256, ACL_REVISION); if(!res && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { - skip("ACLs not implemented - skipping tests\n"); + win_skip("ACLs not implemented - skipping tests\n"); HeapFree(GetProcessHeap(), 0, OldAcl); return; } @@ -2209,15 +2209,17 @@ static void test_SetEntriesInAcl(void) ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_BAD_FORM; res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res); - ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl); - LocalFree(NewAcl); + ok(NewAcl == NULL || + broken(NewAcl != NULL), /* NT4 */ + "returned acl wasn't NULL: %p\n", NewAcl); ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_USER; ExplicitAccess.Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE; res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res); - ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl); - LocalFree(NewAcl); + ok(NewAcl == NULL || + broken(NewAcl != NULL), /* NT4 */ + "returned acl wasn't NULL: %p\n", NewAcl); ExplicitAccess.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; ExplicitAccess.grfAccessMode = SET_ACCESS; @@ -2805,6 +2807,13 @@ static void test_GetSecurityInfo(void) LocalFree(sd); + if (!pCreateWellKnownSid) + { + win_skip("NULL parameter test would crash on NT4\n"); + CloseHandle(obj); + return; + } + /* If we don't ask for the security descriptor, Windows will still give us the other stuff, leaving us no way to free it. */ ret = pGetSecurityInfo(obj, SE_FILE_OBJECT, diff --git a/dlls/advpack/tests/install.c b/dlls/advpack/tests/install.c index 854ede6dae5..3b0954fcf23 100644 --- a/dlls/advpack/tests/install.c +++ b/dlls/advpack/tests/install.c @@ -55,27 +55,20 @@ static BOOL is_spapi_err(DWORD err) return (((err & SPAPI_MASK) ^ SPAPI_PREFIX) == 0); } -static void append_str(char **str, const char *data) -{ - sprintf(*str, data); - *str += strlen(*str); -} - static void create_inf_file(LPCSTR filename) { - char data[1024]; - char *ptr = data; DWORD dwNumberOfBytesWritten; HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - append_str(&ptr, "[Version]\n"); - append_str(&ptr, "Signature=\"$Chicago$\"\n"); - append_str(&ptr, "AdvancedINF=2.5\n"); - append_str(&ptr, "[DefaultInstall]\n"); - append_str(&ptr, "CheckAdminRights=1\n"); + static const char data[] = + "[Version]\n" + "Signature=\"$Chicago$\"\n" + "AdvancedINF=2.5\n" + "[DefaultInstall]\n" + "CheckAdminRights=1\n"; - WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL); + WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL); CloseHandle(hf); } diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c index a5ae34259ea..c98cba7e1f9 100644 --- a/dlls/atl/atl_ax.c +++ b/dlls/atl/atl_ax.c @@ -1244,7 +1244,7 @@ HWND WINAPI AtlAxCreateDialogW(HINSTANCE hInst, LPCWSTR name, HWND owner, DLGPRO hgl = LoadResource (hInst, hrsrc); if ( !hgl ) return NULL; - ptr = (LPCDLGTEMPLATEW)LockResource ( hgl ); + ptr = LockResource ( hgl ); if (!ptr) { FreeResource( hgl ); diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c index dd8b7a2f7d5..d3ca9b0709f 100644 --- a/dlls/atl/registrar.c +++ b/dlls/atl/registrar.c @@ -439,7 +439,7 @@ static HRESULT resource_register(Registrar *This, LPCOLESTR resFileName, if(hins) { src = FindResourceW(hins, szID, szType); if(src) { - regstra = (LPSTR)LoadResource(hins, src); + regstra = LoadResource(hins, src); reslen = SizeofResource(hins, src); if(regstra) { len = MultiByteToWideChar(CP_ACP, 0, regstra, reslen, NULL, 0)+1; diff --git a/dlls/avifil32/avifile_Si.rc b/dlls/avifil32/avifile_Si.rc index 5ed3d138367..579be48d02d 100644 --- a/dlls/avifil32/avifile_Si.rc +++ b/dlls/avifil32/avifile_Si.rc @@ -28,7 +28,7 @@ BEGIN LTEXT "&Izbran tok:",-1,2,5,154,10 COMBOBOX IDC_STREAM,2,18,154,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Možnosti...",IDC_OPTIONS,170,17,50,14 + PUSHBUTTON "&Možnosti ...",IDC_OPTIONS,170,17,50,14 AUTOCHECKBOX "&Prepletanje vsake",IDC_INTERLEAVE,3,42,85,11,WS_TABSTOP EDITTEXT IDC_INTERLEAVEEVERY,91,41,32,12,ES_AUTOHSCROLL LTEXT "slike",-1,129,43,36,9 diff --git a/dlls/browseui/progressdlg.c b/dlls/browseui/progressdlg.c index 307ca2804a6..120f072c3aa 100644 --- a/dlls/browseui/progressdlg.c +++ b/dlls/browseui/progressdlg.c @@ -115,7 +115,7 @@ static void set_progress_marquee(ProgressDialog *This) GetWindowLongW(hProgress, GWL_STYLE)|PBS_MARQUEE); } -void update_dialog(ProgressDialog *This, DWORD dwUpdate) +static void update_dialog(ProgressDialog *This, DWORD dwUpdate) { WCHAR empty[] = {0}; diff --git a/dlls/browseui/rsrc_Si.rc b/dlls/browseui/rsrc_Si.rc index 55d4e143daa..e4541f79f48 100644 --- a/dlls/browseui/rsrc_Si.rc +++ b/dlls/browseui/rsrc_Si.rc @@ -22,7 +22,7 @@ LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT STRINGTABLE { - IDS_CANCELLING "Preklicujem..." + IDS_CANCELLING "Preklicujem ..." } IDD_PROGRESS_DLG DIALOG 0, 0, 260, 85 diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index b97a5e580dc..4e447aff60c 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -123,7 +123,7 @@ static const char manifest[] = static const char manifest_filename[] = ARCH "_" NAME "_" PUBLIC_KEY "_" VERSION "_none_deadbeef.manifest"; -LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); LPWSTR COMCTL32_wSubclass = NULL; HMODULE COMCTL32_hModule = 0; @@ -1284,7 +1284,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u * Window procedure for all subclassed windows. * Saves the current subclassing stack position to support nested messages */ -LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { LPSUBCLASS_INFO stack; LPSUBCLASSPROCS proc; diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 6a9b8e85dc2..0cc8cf92c55 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -2662,7 +2662,10 @@ static inline LRESULT TAB_SetMinTabWidth (TAB_INFO *infoPtr, INT cx) TRACE("(%p,%d)\n", infoPtr, cx); - oldcx = infoPtr->tabMinWidth; + if (infoPtr->tabMinWidth < 0) + oldcx = DEFAULT_MIN_TAB_WIDTH; + else + oldcx = infoPtr->tabMinWidth; infoPtr->tabMinWidth = cx; TAB_SetItemBounds(infoPtr); return oldcx; diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index e6a2524b996..c0ff7cd8493 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -984,13 +984,13 @@ static void test_hdm_imageMessages(HWND hParent) flush_sequences(sequences, NUM_MSG_SEQUENCES); hImageListRetVal = (HIMAGELIST) SendMessage(hChild, HDM_SETIMAGELIST, 0, (LPARAM) hImageList); - ok(hImageListRetVal == NULL, "Expected NULL, got %d\n", (int) hImageListRetVal); + ok(hImageListRetVal == NULL, "Expected NULL, got %p\n", hImageListRetVal); hImageListRetVal = (HIMAGELIST) SendMessage(hChild, HDM_GETIMAGELIST, 0, 0); - ok(hImageListRetVal != NULL, "Expected non-NULL handle, got %d\n", (int) hImageListRetVal); + ok(hImageListRetVal != NULL, "Expected non-NULL handle, got %p\n", hImageListRetVal); hImageListRetVal = (HIMAGELIST) SendMessage(hChild, HDM_CREATEDRAGIMAGE, 0, 0); - ok(hImageListRetVal != NULL, "Expected non-NULL handle, got %d\n", (int) hImageListRetVal); + ok(hImageListRetVal != NULL, "Expected non-NULL handle, got %p\n", hImageListRetVal); ok_sequence(sequences, HEADER_SEQ_INDEX, imageMessages_seq, "imageMessages sequence testing", FALSE); diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c index 9c879e30395..c225f726fe7 100644 --- a/dlls/comctl32/tests/subclass.c +++ b/dlls/comctl32/tests/subclass.c @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define _WIN32_WINNT 0x0501 /* For SetWindowSubclass/etc */ + #include #include -#define _WIN32_WINNT 0x0501 /* For SetWindowSubclass/etc */ - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c index 9d98e113fb9..61bab44a873 100644 --- a/dlls/comctl32/tests/tab.c +++ b/dlls/comctl32/tests/tab.c @@ -509,6 +509,9 @@ static void test_tab(INT nMinTabWidth) hwTab = create_tabcontrol(TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE); SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); + /* Get System default MinTabWidth */ + if (nMinTabWidth < 0) + nMinTabWidth = SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); hdc = GetDC(hwTab); dpi = GetDeviceCaps(hdc, LOGPIXELSX); @@ -663,10 +666,7 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs) "Parent after sequence, adding tab control to parent", TRUE); flush_sequences(sequences, NUM_MSG_SEQUENCES); - todo_wine{ - expect(DEFAULT_MIN_TAB_WIDTH, (int)SendMessage(hTab, TCM_SETMINTABWIDTH, 0, -1)); - } - ok_sequence(sequences, TAB_SEQ_INDEX, set_min_tab_width_seq, "Set minTabWidth test sequence", FALSE); + ok(SendMessage(hTab, TCM_SETMINTABWIDTH, 0, -1) > 0,"TCM_SETMINTABWIDTH returned < 0\n"); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Set minTabWidth test parent sequence", FALSE); /* Testing GetItemCount */ diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index b3f28fd8818..4c708a094e4 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -101,8 +101,8 @@ static LRESULT CALLBACK CustomDrawWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP case WM_NOTIFY: if (((NMHDR *)lParam)->code == NM_CUSTOMDRAW) { NMTTCUSTOMDRAW *ttcd = (NMTTCUSTOMDRAW*) lParam; - ok(ttcd->nmcd.hdr.hwndFrom == g_hwnd, "Unexpected hwnd source %x (%x)\n", - (int)ttcd->nmcd.hdr.hwndFrom, (int) g_hwnd); + ok(ttcd->nmcd.hdr.hwndFrom == g_hwnd, "Unexpected hwnd source %p (%p)\n", + ttcd->nmcd.hdr.hwndFrom, g_hwnd); ok(ttcd->nmcd.hdr.idFrom == 0x1234ABCD, "Unexpected id %x\n", (int)ttcd->nmcd.hdr.idFrom); switch (ttcd->nmcd.dwDrawStage) { diff --git a/dlls/comdlg32/cdlg.h b/dlls/comdlg32/cdlg.h index f6a9cbc232d..c85f877c473 100644 --- a/dlls/comdlg32/cdlg.h +++ b/dlls/comdlg32/cdlg.h @@ -182,12 +182,8 @@ extern UINT (WINAPI *COMDLG32_PIDL_ILGetSize)(LPCITEMIDLIST); /* SHELL */ extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD); extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID); -extern BOOL (WINAPI *COMDLG32_SHGetFolderPathA)(HWND,int,HANDLE,DWORD,LPSTR); extern BOOL (WINAPI *COMDLG32_SHGetFolderPathW)(HWND,int,HANDLE,DWORD,LPWSTR); -extern BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType); -extern BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType); - /* * Internal Functions * Do NOT Export to other programs and dlls diff --git a/dlls/comdlg32/cdlg32.c b/dlls/comdlg32/cdlg32.c index 0f0f69bee17..afa3c61bf30 100644 --- a/dlls/comdlg32/cdlg32.c +++ b/dlls/comdlg32/cdlg32.c @@ -52,7 +52,6 @@ UINT (WINAPI *COMDLG32_PIDL_ILGetSize)(LPCITEMIDLIST); /* SHELL */ LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD); DWORD (WINAPI *COMDLG32_SHFree)(LPVOID); -BOOL (WINAPI *COMDLG32_SHGetFolderPathA)(HWND,int,HANDLE,DWORD,LPSTR); BOOL (WINAPI *COMDLG32_SHGetFolderPathW)(HWND,int,HANDLE,DWORD,LPWSTR); /*********************************************************************** @@ -102,13 +101,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved) GPA(COMDLG32_SHAlloc, SHELL32_hInstance, (LPCSTR)196L); GPA(COMDLG32_SHFree, SHELL32_hInstance, (LPCSTR)195L); - /* for the first versions of shell32 SHGetFolderPathA is in SHFOLDER.DLL */ - COMDLG32_SHGetFolderPathA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetFolderPathA"); - if (!COMDLG32_SHGetFolderPathA) - { - SHFOLDER_hInstance = LoadLibraryA("SHFOLDER.DLL"); - GPA(COMDLG32_SHGetFolderPathA, SHFOLDER_hInstance,"SHGetFolderPathA"); - } /* for the first versions of shell32 SHGetFolderPathW is in SHFOLDER.DLL */ COMDLG32_SHGetFolderPathW = (void*)GetProcAddress(SHELL32_hInstance,"SHGetFolderPathW"); diff --git a/dlls/comdlg32/cdlg_Si.rc b/dlls/comdlg32/cdlg_Si.rc index 4a06e1a81cc..59d5e0e58de 100644 --- a/dlls/comdlg32/cdlg_Si.rc +++ b/dlls/comdlg32/cdlg_Si.rc @@ -48,7 +48,7 @@ FONT 8, "MS Shell Dlg" SAVE_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Shrani kot..." +CAPTION "Shrani kot ..." FONT 8, "MS Shell Dlg" { LTEXT "Ime &datoteke:", 1090, 6, 6, 76, 9 @@ -270,7 +270,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "V redu",IDOK,180,156,48,14,WS_GROUP PUSHBUTTON "Prekliči",IDCANCEL,232,156,48,14 -/* PUSHBUTTON "Omrežje...", psh5, 284,156,48,14 */ +/* PUSHBUTTON "Omrežje ...", psh5, 284,156,48,14 */ GROUPBOX "Tiskalnik", grp4, 8, 4, 272,84, WS_GROUP PUSHBUTTON "&Lastnosti", psh2, 212, 17, 60,14, WS_GROUP @@ -324,7 +324,7 @@ BEGIN EDITTEXT edt7, 187, 190, 39, 12, WS_TABSTOP|WS_GROUP|WS_BORDER|ES_NUMBER DEFPUSHBUTTON "V redu", IDOK, 71, 220, 50, 14, BS_PUSHBUTTON PUSHBUTTON "Prekliči", IDCANCEL, 126, 220, 50, 14 - PUSHBUTTON "&Tiskalnik...", psh3, 184, 220, 48, 14 + PUSHBUTTON "&Tiskalnik ...", psh3, 184, 220, 48, 14 END NEWFILEOPENORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 280, 164 diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 953a5baabc2..e1eedd19eca 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -220,6 +220,8 @@ static HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPWST IShellFolder* GetShellFolderFromPidl(LPITEMIDLIST pidlAbs); LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl); static LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPWSTR lpcstrFileName); +static BOOL IsPidlFolder (LPSHELLFOLDER psf, LPCITEMIDLIST pidl); +static UINT GetNumSelected( IDataObject *doSelected ); /* Shell memory allocation */ static void *MemAlloc(UINT size); @@ -312,7 +314,7 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos) * IN : The OPENFILENAMEA initialisation structure passed to * GetOpenFileNameA win api function (see filedlg.c) */ -BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType) +static BOOL GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType) { BOOL ret; FileOpenDlgInfos fodInfos; @@ -449,7 +451,7 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType) * Call GetFileName95 with this structure and clean the memory. * */ -BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) +static BOOL GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) { BOOL ret; FileOpenDlgInfos fodInfos; @@ -3291,7 +3293,7 @@ LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex) * Return the number of selected items in the DataObject. * */ -UINT GetNumSelected( IDataObject *doSelected ) +static UINT GetNumSelected( IDataObject *doSelected ) { UINT retVal = 0; STGMEDIUM medium; @@ -3430,7 +3432,7 @@ static LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPWSTR lpcstrFileName) /* */ -BOOL IsPidlFolder (LPSHELLFOLDER psf, LPCITEMIDLIST pidl) +static BOOL IsPidlFolder (LPSHELLFOLDER psf, LPCITEMIDLIST pidl) { ULONG uAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; HRESULT ret; diff --git a/dlls/comdlg32/filedlgbrowser.h b/dlls/comdlg32/filedlgbrowser.h index 2342d3d3ebb..f8da75eddf7 100644 --- a/dlls/comdlg32/filedlgbrowser.h +++ b/dlls/comdlg32/filedlgbrowser.h @@ -148,10 +148,6 @@ IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner); LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex); -UINT GetNumSelected(IDataObject *doSelected); - -/* pidl handling */ -BOOL IsPidlFolder (LPSHELLFOLDER psf, LPCITEMIDLIST pidl); /* Functions used by the EDIT box */ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd); diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 08120ff560d..12ab05fc0b6 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -3164,7 +3164,7 @@ static BOOL WINAPI CRYPT_AsnEncodeBitsSwapBytes(DWORD dwCertEncodingType, return ret; } -BOOL WINAPI CRYPT_AsnEncodeInt(DWORD dwCertEncodingType, +static BOOL WINAPI CRYPT_AsnEncodeInt(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) { diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index ca94a2e2e8c..7c90d75dd2d 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -46,7 +46,7 @@ typedef BOOL (*CryptMsgUpdateFunc)(HCRYPTMSG hCryptMsg, const BYTE *pbData, typedef BOOL (*CryptMsgControlFunc)(HCRYPTMSG hCryptMsg, DWORD dwFlags, DWORD dwCtrlType, const void *pvCtrlPara); -BOOL CRYPT_DefaultMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags, +static BOOL CRYPT_DefaultMsgControl(HCRYPTMSG hCryptMsg, DWORD dwFlags, DWORD dwCtrlType, const void *pvCtrlPara) { TRACE("(%p, %08x, %d, %p)\n", hCryptMsg, dwFlags, dwCtrlType, pvCtrlPara); diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c index df5e5099a39..825dad587f1 100644 --- a/dlls/crypt32/object.c +++ b/dlls/crypt32/object.c @@ -1723,12 +1723,11 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType, pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size))) { static const WCHAR numFmt[] = { '%','d',0 }; - static const WCHAR commaSep[] = { ',',' ',0 }; static const WCHAR colon[] = { ':',0 }; static BOOL stringsLoaded = FALSE; DWORD bytesNeeded = sizeof(WCHAR); /* space for NULL terminator */ BOOL haveAnEntry = FALSE; - LPCWSTR headingSep, distPointSep, nameSep; + LPCWSTR headingSep, nameSep; WCHAR distPointNum[11]; DWORD i; @@ -1751,13 +1750,11 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType, if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) { headingSep = crlf; - distPointSep = crlf; nameSep = colonCrlf; } else { headingSep = colonSep; - distPointSep = commaSep; nameSep = colon; } diff --git a/dlls/crypt32/rootstore.c b/dlls/crypt32/rootstore.c index c3d47948c87..116c9341139 100644 --- a/dlls/crypt32/rootstore.c +++ b/dlls/crypt32/rootstore.c @@ -663,7 +663,7 @@ static const BYTE rootcertauthority[] = { 0xf8,0x04,0x4d,0x30,0x92,0x3d,0x6e,0x21,0x14,0x21,0xc9,0x3d,0xe0,0xc3,0xfd,0x8a, 0x6b,0x9d,0x4a,0xfd,0xd1,0xa1,0x9d,0x99,0x43,0x77,0x3f,0xb0,0xda }; -struct CONST_BLOB { +static const struct CONST_BLOB { const BYTE *pb; DWORD cb; } msRootCerts[] = { diff --git a/dlls/cryptdlg/Makefile.in b/dlls/cryptdlg/Makefile.in index 0271fa3cc00..dd5a8155860 100644 --- a/dlls/cryptdlg/Makefile.in +++ b/dlls/cryptdlg/Makefile.in @@ -3,11 +3,13 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = cryptdlg.dll -IMPORTS = cryptui crypt32 wintrust advapi32 kernel32 +IMPORTS = cryptui crypt32 wintrust user32 advapi32 kernel32 C_SRCS = \ main.c +RC_SRCS = cryptdlg.rc + @MAKE_DLL_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/programs/rpcss/rpcss.h b/dlls/cryptdlg/cryptdlg.rc similarity index 82% copy from programs/rpcss/rpcss.h copy to dlls/cryptdlg/cryptdlg.rc index 9c2f04f7b86..714151d2cb0 100644 --- a/programs/rpcss/rpcss.h +++ b/dlls/cryptdlg/cryptdlg.rc @@ -1,7 +1,7 @@ /* - * RPCSS definitions + * cryptdlg dll resources * - * Copyright (C) 2002 Greg Turner + * Copyright 2008 Juan Lang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,10 +17,9 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "cryptres.h" -#ifndef __WINE_RPCSS_H -#define __WINE_RPCSS_H - -#include "windows.h" - -#endif /* __WINE_RPCSS_H */ +#include "cryptdlg_En.rc" diff --git a/dlls/cryptdlg/cryptdlg.spec b/dlls/cryptdlg/cryptdlg.spec index 1536b101a39..b417d0d8b80 100644 --- a/dlls/cryptdlg/cryptdlg.spec +++ b/dlls/cryptdlg/cryptdlg.spec @@ -9,7 +9,7 @@ 9 stub EncodeAttrSequence 10 stub EncodeRecipientID 11 stub FormatPKIXEmailProtection -12 stub FormatVerisignExtension +12 stdcall FormatVerisignExtension(long long long ptr str ptr long ptr ptr) 13 stub CertModifyCertificatesToTrust 14 stub CertSelectCertificateA 15 stub CertSelectCertificateW diff --git a/dlls/sane.ds/sane_Si.rc b/dlls/cryptdlg/cryptdlg_En.rc similarity index 60% copy from dlls/sane.ds/sane_Si.rc copy to dlls/cryptdlg/cryptdlg_En.rc index 4a3470c44b0..99126c42898 100644 --- a/dlls/sane.ds/sane_Si.rc +++ b/dlls/cryptdlg/cryptdlg_En.rc @@ -1,7 +1,7 @@ /* - * Slovenian resources for Twain + * cryptdlg dll resources * - * Copyright 2008 Rok Mandeljc + * Copyright 2008 Juan Lang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,27 +18,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#pragma code_page(65001) - -LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT - -IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 46 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTER | DS_SETFOREGROUND -CAPTION "Skeniranje" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Skeniram... Prosim, počakajte",IDC_STATIC,5,19,176,8, SS_CENTER -END +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT STRINGTABLE DISCARDABLE { - 0 "" - 1 "px" - 2 "b" - 3 "mm" - 4 "dpi" - 5 "%" - 6 "ns" + IDS_CERT_POLICY "Certificate Policy" + IDS_POLICY_ID "Policy Identifier: " + IDS_POLICY_QUALIFIER_INFO "Policy Qualifier Info" + IDS_POLICY_QUALIFIER_ID "Policy Qualifier Id=" + IDS_CPS "CPS" + IDS_USER_NOTICE "User Notice" + IDS_QUALIFIER "Qualifier" + IDS_NOTICE_REF "Notice Reference" + IDS_ORGANIZATION "Organization=" + IDS_NOTICE_NUM "Notice Number=" + IDS_NOTICE_TEXT "Notice Text=" } - -#pragma code_page(default) diff --git a/programs/rpcss/rpcss.h b/dlls/cryptdlg/cryptres.h similarity index 64% copy from programs/rpcss/rpcss.h copy to dlls/cryptdlg/cryptres.h index 9c2f04f7b86..b64459aca78 100644 --- a/programs/rpcss/rpcss.h +++ b/dlls/cryptdlg/cryptres.h @@ -1,7 +1,5 @@ /* - * RPCSS definitions - * - * Copyright (C) 2002 Greg Turner + * Copyright 2008 Juan Lang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,10 +15,19 @@ * 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 __CRYPTRES_H__ +#define __CRYPTRES_H__ -#ifndef __WINE_RPCSS_H -#define __WINE_RPCSS_H - -#include "windows.h" +#define IDS_CERT_POLICY 100 +#define IDS_POLICY_ID 101 +#define IDS_POLICY_QUALIFIER_INFO 102 +#define IDS_POLICY_QUALIFIER_ID 103 +#define IDS_CPS 104 +#define IDS_USER_NOTICE 105 +#define IDS_QUALIFIER 106 +#define IDS_NOTICE_REF 107 +#define IDS_ORGANIZATION 108 +#define IDS_NOTICE_NUM 109 +#define IDS_NOTICE_TEXT 110 -#endif /* __WINE_RPCSS_H */ +#endif /* ndef __CRYPTRES_H__ */ diff --git a/dlls/cryptdlg/main.c b/dlls/cryptdlg/main.c index e8f2514adb4..1971578dbf5 100644 --- a/dlls/cryptdlg/main.c +++ b/dlls/cryptdlg/main.c @@ -29,12 +29,17 @@ #include "wincrypt.h" #include "wintrust.h" #include "winuser.h" +#include "objbase.h" #include "cryptdlg.h" #include "cryptuiapi.h" +#include "cryptres.h" +#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(cryptdlg); +static HINSTANCE hInstance; + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); @@ -45,6 +50,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinstDLL); + hInstance = hinstDLL; break; case DLL_PROCESS_DETACH: break; @@ -465,6 +471,661 @@ BOOL WINAPI CertViewPropertiesW(CERT_VIEWPROPERTIES_STRUCT_W *info) return ret; } +static BOOL CRYPT_FormatHexString(const BYTE *pbEncoded, DWORD cbEncoded, + WCHAR *str, DWORD *pcchStr) +{ + BOOL ret; + DWORD charsNeeded; + + if (cbEncoded) + charsNeeded = (cbEncoded * 3); + else + charsNeeded = 1; + if (!str) + { + *pcchStr = charsNeeded; + ret = TRUE; + } + else if (*pcchStr < charsNeeded) + { + *pcchStr = charsNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + static const WCHAR fmt[] = { '%','0','2','x',' ',0 }; + static const WCHAR endFmt[] = { '%','0','2','x',0 }; + DWORD i; + LPWSTR ptr = str; + + *pcchStr = charsNeeded; + if (cbEncoded) + { + for (i = 0; i < cbEncoded; i++) + { + if (i < cbEncoded - 1) + ptr += sprintfW(ptr, fmt, pbEncoded[i]); + else + ptr += sprintfW(ptr, endFmt, pbEncoded[i]); + } + } + else + *ptr = 0; + ret = TRUE; + } + return ret; +} + +static const WCHAR indent[] = { ' ',' ',' ',' ',' ',0 }; +static const WCHAR colonCrlf[] = { ':','\r','\n',0 }; +static const WCHAR colonSpace[] = { ':',' ',0 }; +static const WCHAR crlf[] = { '\r','\n',0 }; +static const WCHAR commaSep[] = { ',',' ',0 }; + +static BOOL CRYPT_FormatCPS(DWORD dwCertEncodingType, + DWORD dwFormatStrType, const BYTE *pbEncoded, DWORD cbEncoded, + WCHAR *str, DWORD *pcchStr) +{ + BOOL ret; + DWORD size, charsNeeded = 1; + CERT_NAME_VALUE *cpsValue; + + if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_UNICODE_ANY_STRING, + pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &cpsValue, &size))) + { + LPCWSTR headingSep, sep; + DWORD headingSepLen, sepLen; + + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + headingSep = colonCrlf; + sep = crlf; + } + else + { + headingSep = colonSpace; + sep = commaSep; + } + sepLen = strlenW(sep); + headingSepLen = strlenW(headingSep); + + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += 3 * strlenW(indent); + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += cpsValue->Value.cbData / sizeof(WCHAR); + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, (LPWSTR)cpsValue->Value.pbData); + str += cpsValue->Value.cbData / sizeof(WCHAR); + } + charsNeeded += sepLen; + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, sep); + str += sepLen; + } + LocalFree(cpsValue); + if (!str) + *pcchStr = charsNeeded; + else if (*pcchStr < charsNeeded) + { + *pcchStr = charsNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + *pcchStr = charsNeeded; + } + return ret; +} + +static BOOL CRYPT_FormatUserNotice(DWORD dwCertEncodingType, + DWORD dwFormatStrType, const BYTE *pbEncoded, DWORD cbEncoded, + WCHAR *str, DWORD *pcchStr) +{ + BOOL ret; + DWORD size, charsNeeded = 1; + CERT_POLICY_QUALIFIER_USER_NOTICE *notice; + + if ((ret = CryptDecodeObjectEx(dwCertEncodingType, + X509_PKIX_POLICY_QUALIFIER_USERNOTICE, pbEncoded, cbEncoded, + CRYPT_DECODE_ALLOC_FLAG, NULL, ¬ice, &size))) + { + static const WCHAR numFmt[] = { '%','d',0 }; + CERT_POLICY_QUALIFIER_NOTICE_REFERENCE *pNoticeRef = + notice->pNoticeReference; + LPCWSTR headingSep, sep; + DWORD headingSepLen, sepLen; + LPWSTR noticeRef, organization, noticeNum, noticeText; + DWORD noticeRefLen, organizationLen, noticeNumLen, noticeTextLen; + WCHAR noticeNumStr[11]; + + noticeRefLen = LoadStringW(hInstance, IDS_NOTICE_REF, + (LPWSTR)¬iceRef, 0); + organizationLen = LoadStringW(hInstance, IDS_ORGANIZATION, + (LPWSTR)&organization, 0); + noticeNumLen = LoadStringW(hInstance, IDS_NOTICE_NUM, + (LPWSTR)¬iceNum, 0); + noticeTextLen = LoadStringW(hInstance, IDS_NOTICE_TEXT, + (LPWSTR)¬iceText, 0); + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + headingSep = colonCrlf; + sep = crlf; + } + else + { + headingSep = colonSpace; + sep = commaSep; + } + sepLen = strlenW(sep); + headingSepLen = strlenW(headingSep); + + if (pNoticeRef) + { + DWORD k; + LPCSTR src; + + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += 3 * strlenW(indent); + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += noticeRefLen; + if (str && *pcchStr >= charsNeeded) + { + memcpy(str, noticeRef, noticeRefLen * sizeof(WCHAR)); + str += noticeRefLen; + } + charsNeeded += headingSepLen; + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, headingSep); + str += headingSepLen; + } + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += 4 * strlenW(indent); + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += organizationLen; + if (str && *pcchStr >= charsNeeded) + { + memcpy(str, organization, organizationLen * sizeof(WCHAR)); + str += organizationLen; + } + charsNeeded += strlen(pNoticeRef->pszOrganization); + if (str && *pcchStr >= charsNeeded) + for (src = pNoticeRef->pszOrganization; src && *src; + src++, str++) + *str = *src; + charsNeeded += sepLen; + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, sep); + str += sepLen; + } + for (k = 0; k < pNoticeRef->cNoticeNumbers; k++) + { + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += 4 * strlenW(indent); + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += noticeNumLen; + if (str && *pcchStr >= charsNeeded) + { + memcpy(str, noticeNum, noticeNumLen * sizeof(WCHAR)); + str += noticeNumLen; + } + sprintfW(noticeNumStr, numFmt, k + 1); + charsNeeded += strlenW(noticeNumStr); + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, noticeNumStr); + str += strlenW(noticeNumStr); + } + charsNeeded += sepLen; + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, sep); + str += sepLen; + } + } + } + if (notice->pszDisplayText) + { + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += 3 * strlenW(indent); + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += noticeTextLen; + if (str && *pcchStr >= charsNeeded) + { + memcpy(str, noticeText, noticeTextLen * sizeof(WCHAR)); + str += noticeTextLen; + } + charsNeeded += strlenW(notice->pszDisplayText); + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, notice->pszDisplayText); + str += strlenW(notice->pszDisplayText); + } + charsNeeded += sepLen; + if (str && *pcchStr >= charsNeeded) + { + strcpyW(str, sep); + str += sepLen; + } + } + LocalFree(notice); + if (!str) + *pcchStr = charsNeeded; + else if (*pcchStr < charsNeeded) + { + *pcchStr = charsNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + *pcchStr = charsNeeded; + } + return ret; +} + +/*********************************************************************** + * FormatVerisignExtension (CRYPTDLG.@) + */ +BOOL WINAPI FormatVerisignExtension(DWORD dwCertEncodingType, + DWORD dwFormatType, DWORD dwFormatStrType, void *pFormatStruct, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, + DWORD *pcbFormat) +{ + CERT_POLICIES_INFO *policies; + DWORD size; + BOOL ret = FALSE; + + if (!cbEncoded) + { + SetLastError(E_INVALIDARG); + return FALSE; + } + if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CERT_POLICIES, + pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &policies, &size))) + { + static const WCHAR numFmt[] = { '%','d',0 }; + DWORD charsNeeded = 1; /* space for NULL terminator */ + LPCWSTR headingSep, sep; + DWORD headingSepLen, sepLen; + WCHAR policyNum[11], policyQualifierNum[11]; + LPWSTR certPolicy, policyId, policyQualifierInfo, policyQualifierId; + LPWSTR cps, userNotice, qualifier; + DWORD certPolicyLen, policyIdLen, policyQualifierInfoLen; + DWORD policyQualifierIdLen, cpsLen, userNoticeLen, qualifierLen; + DWORD i; + LPWSTR str = pbFormat; + + certPolicyLen = LoadStringW(hInstance, IDS_CERT_POLICY, + (LPWSTR)&certPolicy, 0); + policyIdLen = LoadStringW(hInstance, IDS_POLICY_ID, (LPWSTR)&policyId, + 0); + policyQualifierInfoLen = LoadStringW(hInstance, + IDS_POLICY_QUALIFIER_INFO, (LPWSTR)&policyQualifierInfo, 0); + policyQualifierIdLen = LoadStringW(hInstance, IDS_POLICY_QUALIFIER_ID, + (LPWSTR)&policyQualifierId, 0); + cpsLen = LoadStringW(hInstance, IDS_CPS, (LPWSTR)&cps, 0); + userNoticeLen = LoadStringW(hInstance, IDS_USER_NOTICE, + (LPWSTR)&userNotice, 0); + qualifierLen = LoadStringW(hInstance, IDS_QUALIFIER, + (LPWSTR)&qualifier, 0); + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + headingSep = colonCrlf; + sep = crlf; + } + else + { + headingSep = colonSpace; + sep = commaSep; + } + sepLen = strlenW(sep); + headingSepLen = strlenW(headingSep); + + for (i = 0; ret && i < policies->cPolicyInfo; i++) + { + CERT_POLICY_INFO *policy = &policies->rgPolicyInfo[i]; + DWORD j; + LPCSTR src; + + charsNeeded += 1; /* '['*/ + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + *str++ = '['; + sprintfW(policyNum, numFmt, i + 1); + charsNeeded += strlenW(policyNum); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, policyNum); + str += strlenW(policyNum); + } + charsNeeded += 1; /* ']'*/ + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + *str++ = ']'; + charsNeeded += certPolicyLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + memcpy(str, certPolicy, certPolicyLen * sizeof(WCHAR)); + str += certPolicyLen; + } + charsNeeded += headingSepLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, headingSep); + str += headingSepLen; + } + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += strlenW(indent); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += policyIdLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + memcpy(str, policyId, policyIdLen * sizeof(WCHAR)); + str += policyIdLen; + } + charsNeeded += strlen(policy->pszPolicyIdentifier); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + for (src = policy->pszPolicyIdentifier; src && *src; + src++, str++) + *str = *src; + } + charsNeeded += sepLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, sep); + str += sepLen; + } + for (j = 0; j < policy->cPolicyQualifier; j++) + { + CERT_POLICY_QUALIFIER_INFO *qualifierInfo = + &policy->rgPolicyQualifier[j]; + DWORD sizeRemaining; + + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += strlenW(indent); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += 1; /* '['*/ + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + *str++ = '['; + charsNeeded += strlenW(policyNum); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, policyNum); + str += strlenW(policyNum); + } + charsNeeded += 1; /* ','*/ + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + *str++ = ','; + sprintfW(policyQualifierNum, numFmt, j + 1); + charsNeeded += strlenW(policyQualifierNum); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, policyQualifierNum); + str += strlenW(policyQualifierNum); + } + charsNeeded += 1; /* ']'*/ + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + *str++ = ']'; + charsNeeded += policyQualifierInfoLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + memcpy(str, policyQualifierInfo, + policyQualifierInfoLen * sizeof(WCHAR)); + str += policyQualifierInfoLen; + } + charsNeeded += headingSepLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, headingSep); + str += headingSepLen; + } + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += 2 * strlenW(indent); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += policyQualifierIdLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + memcpy(str, policyQualifierId, + policyQualifierIdLen * sizeof(WCHAR)); + str += policyQualifierIdLen; + } + if (!strcmp(qualifierInfo->pszPolicyQualifierId, + szOID_PKIX_POLICY_QUALIFIER_CPS)) + { + charsNeeded += cpsLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + memcpy(str, cps, cpsLen * sizeof(WCHAR)); + str += cpsLen; + } + } + else if (!strcmp(qualifierInfo->pszPolicyQualifierId, + szOID_PKIX_POLICY_QUALIFIER_USERNOTICE)) + { + charsNeeded += userNoticeLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + memcpy(str, userNotice, userNoticeLen * sizeof(WCHAR)); + str += userNoticeLen; + } + } + else + { + charsNeeded += strlen(qualifierInfo->pszPolicyQualifierId); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + for (src = qualifierInfo->pszPolicyQualifierId; + src && *src; src++, str++) + *str = *src; + } + } + charsNeeded += sepLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, sep); + str += sepLen; + } + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + charsNeeded += 2 * strlenW(indent); + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, indent); + str += strlenW(indent); + strcpyW(str, indent); + str += strlenW(indent); + } + } + charsNeeded += qualifierLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + memcpy(str, qualifier, qualifierLen * sizeof(WCHAR)); + str += qualifierLen; + } + charsNeeded += headingSepLen; + if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR)) + { + strcpyW(str, headingSep); + str += headingSepLen; + } + /* This if block is deliberately redundant with the same if + * block above, in order to keep the code more readable (the + * code flow follows the order in which the strings are output.) + */ + if (!strcmp(qualifierInfo->pszPolicyQualifierId, + szOID_PKIX_POLICY_QUALIFIER_CPS)) + { + if (!str || *pcbFormat < charsNeeded * sizeof(WCHAR)) + { + /* Insufficient space, determine how much is needed. */ + ret = CRYPT_FormatCPS(dwCertEncodingType, + dwFormatStrType, qualifierInfo->Qualifier.pbData, + qualifierInfo->Qualifier.cbData, NULL, &size); + if (ret) + charsNeeded += size - 1; + } + else + { + sizeRemaining = *pcbFormat / sizeof(WCHAR); + sizeRemaining -= str - (LPWSTR)pbFormat; + ret = CRYPT_FormatCPS(dwCertEncodingType, + dwFormatStrType, qualifierInfo->Qualifier.pbData, + qualifierInfo->Qualifier.cbData, str, &sizeRemaining); + if (ret || GetLastError() == ERROR_MORE_DATA) + { + charsNeeded += sizeRemaining - 1; + str += sizeRemaining - 1; + } + } + } + else if (!strcmp(qualifierInfo->pszPolicyQualifierId, + szOID_PKIX_POLICY_QUALIFIER_USERNOTICE)) + { + if (!str || *pcbFormat < charsNeeded * sizeof(WCHAR)) + { + /* Insufficient space, determine how much is needed. */ + ret = CRYPT_FormatUserNotice(dwCertEncodingType, + dwFormatStrType, qualifierInfo->Qualifier.pbData, + qualifierInfo->Qualifier.cbData, NULL, &size); + if (ret) + charsNeeded += size - 1; + } + else + { + sizeRemaining = *pcbFormat / sizeof(WCHAR); + sizeRemaining -= str - (LPWSTR)pbFormat; + ret = CRYPT_FormatUserNotice(dwCertEncodingType, + dwFormatStrType, qualifierInfo->Qualifier.pbData, + qualifierInfo->Qualifier.cbData, str, &sizeRemaining); + if (ret || GetLastError() == ERROR_MORE_DATA) + { + charsNeeded += sizeRemaining - 1; + str += sizeRemaining - 1; + } + } + } + else + { + if (!str || *pcbFormat < charsNeeded * sizeof(WCHAR)) + { + /* Insufficient space, determine how much is needed. */ + ret = CRYPT_FormatHexString( + qualifierInfo->Qualifier.pbData, + qualifierInfo->Qualifier.cbData, NULL, &size); + if (ret) + charsNeeded += size - 1; + } + else + { + sizeRemaining = *pcbFormat / sizeof(WCHAR); + sizeRemaining -= str - (LPWSTR)pbFormat; + ret = CRYPT_FormatHexString( + qualifierInfo->Qualifier.pbData, + qualifierInfo->Qualifier.cbData, str, &sizeRemaining); + if (ret || GetLastError() == ERROR_MORE_DATA) + { + charsNeeded += sizeRemaining - 1; + str += sizeRemaining - 1; + } + } + } + } + } + LocalFree(policies); + if (ret) + { + if (!pbFormat) + *pcbFormat = charsNeeded * sizeof(WCHAR); + else if (*pcbFormat < charsNeeded * sizeof(WCHAR)) + { + *pcbFormat = charsNeeded * sizeof(WCHAR); + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + *pcbFormat = charsNeeded * sizeof(WCHAR); + } + } + return ret; +} + #define szOID_MICROSOFT_Encryption_Key_Preference "1.3.6.1.4.1.311.16.4" /*********************************************************************** diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 8a012224cff..2989893d004 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -32,7 +32,6 @@ static ID3D10Device *create_device(void) HRESULT hr; hr = CreateDXGIFactory(&IID_IDXGIFactory, (void *)&factory); - ok(SUCCEEDED(hr), "CreateDXGIFactory failed, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter); diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index b607358e230..f9a0150b4fa 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1606,7 +1606,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 return hrc; } -IWineD3DVertexDeclaration *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8Impl *This, DWORD fvf) +static IWineD3DVertexDeclaration *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8Impl *This, DWORD fvf) { HRESULT hr; IWineD3DVertexDeclaration* pDecl = NULL; diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index cb60d7c4464..717f79c2839 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -1365,6 +1365,15 @@ START_TEST(device) ok(pDirect3DCreate8 != NULL, "Failed to get address of Direct3DCreate8\n"); if (pDirect3DCreate8) { + IDirect3D8 *d3d8; + d3d8 = pDirect3DCreate8( D3D_SDK_VERSION ); + if(!d3d8) + { + skip("could not create D3D8\n"); + return; + } + IDirect3D8_Release(d3d8); + test_display_modes(); test_shader_versions(); test_swapchain(); diff --git a/dlls/d3d8/tests/surface.c b/dlls/d3d8/tests/surface.c index 86fb8843050..e1e65b0bf05 100644 --- a/dlls/d3d8/tests/surface.c +++ b/dlls/d3d8/tests/surface.c @@ -44,8 +44,11 @@ static IDirect3DDevice8 *init_d3d8(HMODULE d3d8_handle) if (!d3d8_create) return NULL; d3d8_ptr = d3d8_create(D3D_SDK_VERSION); - ok(d3d8_ptr != NULL, "Failed to create IDirect3D8 object\n"); - if (!d3d8_ptr) return NULL; + if (!d3d8_ptr) + { + skip("could not create D3D8\n"); + return NULL; + } IDirect3D8_GetAdapterDisplayMode(d3d8_ptr, D3DADAPTER_DEFAULT, &d3ddm ); ZeroMemory(&present_parameters, sizeof(present_parameters)); diff --git a/dlls/d3d8/tests/texture.c b/dlls/d3d8/tests/texture.c index a0027638725..fd97eac8fb8 100644 --- a/dlls/d3d8/tests/texture.c +++ b/dlls/d3d8/tests/texture.c @@ -44,8 +44,11 @@ static IDirect3DDevice8 *init_d3d8(HMODULE d3d8_handle) if (!d3d8_create) return NULL; d3d8_ptr = d3d8_create(D3D_SDK_VERSION); - ok(d3d8_ptr != NULL, "Failed to create IDirect3D8 object\n"); - if (!d3d8_ptr) return NULL; + if (!d3d8_ptr) + { + skip("could not create D3D8\n"); + return NULL; + } IDirect3D8_GetAdapterDisplayMode(d3d8_ptr, D3DADAPTER_DEFAULT, &d3ddm ); ZeroMemory(&present_parameters, sizeof(present_parameters)); diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index efead14d6db..8f853c179b4 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -117,8 +117,11 @@ static IDirect3DDevice8 *init_d3d8(void) if (!d3d8_create) return NULL; d3d8_ptr = d3d8_create(D3D_SDK_VERSION); - ok(d3d8_ptr != NULL, "Failed to create IDirect3D8 object\n"); - if (!d3d8_ptr) return NULL; + if (!d3d8_ptr) + { + skip("could not create D3D8\n"); + return NULL; + } ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = FALSE; diff --git a/dlls/d3d8/tests/volume.c b/dlls/d3d8/tests/volume.c index aee0c3a4dcd..ee431401bb1 100644 --- a/dlls/d3d8/tests/volume.c +++ b/dlls/d3d8/tests/volume.c @@ -44,8 +44,11 @@ static IDirect3DDevice8 *init_d3d8(HMODULE d3d8_handle) if (!d3d8_create) return NULL; d3d8_ptr = d3d8_create(D3D_SDK_VERSION); - ok(d3d8_ptr != NULL, "Failed to create IDirect3D8 object\n"); - if (!d3d8_ptr) return NULL; + if (!d3d8_ptr) + { + skip("could not create D3D8\n"); + return NULL; + } IDirect3D8_GetAdapterDisplayMode(d3d8_ptr, D3DADAPTER_DEFAULT, &d3ddm ); ZeroMemory(&present_parameters, sizeof(present_parameters)); diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index c925cf59e40..d6d6ee9b9b4 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -191,7 +191,6 @@ typedef struct IDirect3DDevice9Impl /* IDirect3DDevice9: */ -extern HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9EX iface, IDirect3D9** ppD3D9); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9EX iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain); extern HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, IDirect3DSwapChain9** pSwapChain); extern UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(LPDIRECT3DDEVICE9EX iface); @@ -206,8 +205,6 @@ extern HRESULT WINAPI IDirect3DDevice9Impl_EndStateBlock(LPDIRECT3DDEVICE9EX i extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9EX iface, CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl); extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexDeclaration9* pDecl); extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexDeclaration9** ppDecl); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9EX iface, DWORD FVF); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWORD* pFVF); extern HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexShader(LPDIRECT3DDEVICE9EX iface, CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader); extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShader(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexShader9* pShader); extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexShader9** ppShader); @@ -217,8 +214,6 @@ extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantI(LPDIRECT3D extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantI(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, int* pConstantData, UINT Vector4iCount); extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantB(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount); extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantB(LPDIRECT3DDEVICE9EX iface, UINT StartRegister, BOOL* pConstantData, UINT BoolCount); -extern HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride); -extern HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride); extern HRESULT WINAPI IDirect3DDevice9Impl_CreatePixelShader(LPDIRECT3DDEVICE9EX iface, CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader); extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(LPDIRECT3DDEVICE9EX iface, IDirect3DPixelShader9* pShader); extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9EX iface, IDirect3DPixelShader9** ppShader); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 679eaabfd85..3bdd8ae8a94 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -142,7 +142,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_EvictManagedResources(LPDIRECT3DDEV return hr; } -HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9EX iface, IDirect3D9** ppD3D9) { +static HRESULT WINAPI IDirect3DDevice9Impl_GetDirect3D(LPDIRECT3DDEVICE9EX iface, IDirect3D9** ppD3D9) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; HRESULT hr = D3D_OK; IWineD3D* pWineD3D; @@ -1235,7 +1235,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9EX return hr; } -IDirect3DVertexDeclaration9 *getConvertedDecl(IDirect3DDevice9Impl *This, DWORD fvf) { +static IDirect3DVertexDeclaration9 *getConvertedDecl(IDirect3DDevice9Impl *This, DWORD fvf) { HRESULT hr; D3DVERTEXELEMENT9* elements = NULL; IDirect3DVertexDeclaration9* pDecl = NULL; @@ -1292,7 +1292,7 @@ IDirect3DVertexDeclaration9 *getConvertedDecl(IDirect3DDevice9Impl *This, DWORD return pDecl; } -HRESULT WINAPI IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9EX iface, DWORD FVF) { +static HRESULT WINAPI IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9EX iface, DWORD FVF) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; HRESULT hr; TRACE("(%p) Relay\n" , This); @@ -1320,7 +1320,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9EX iface, DWORD FV return hr; } -HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWORD* pFVF) { +static HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWORD* pFVF) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; HRESULT hr; TRACE("(%p) Relay\n" , This); @@ -1331,7 +1331,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWORD* p return hr; } -HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) { +static HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; HRESULT hr; TRACE("(%p) Relay\n" , This); @@ -1344,7 +1344,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetStreamSource(LPDIRECT3DDEVICE9EX iface, return hr; } -HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9 **pStream, UINT* OffsetInBytes, UINT* pStride) { +static HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSource(LPDIRECT3DDEVICE9EX iface, UINT StreamNumber, IDirect3DVertexBuffer9 **pStream, UINT* OffsetInBytes, UINT* pStride) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IWineD3DVertexBuffer *retStream = NULL; HRESULT rc = D3D_OK; diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 9b2fd069915..c5d83b0ab5c 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -58,8 +58,11 @@ static void test_qi_base_to_ex(void) HWND window = create_window(); D3DPRESENT_PARAMETERS present_parameters; - ok( d3d9 != NULL, "Failed to create D3D9 object\n" ); - if (!d3d9) return; + if (!d3d9) + { + skip("Direct3D9 is not available\n"); + return; + } hr = IDirect3D9_QueryInterface(d3d9, &IID_IDirect3D9Ex, (void **) &d3d9ex); ok(hr == E_NOINTERFACE, diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index b90d005d34e..a9349744a6b 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -2153,6 +2153,14 @@ START_TEST(device) ok(pDirect3DCreate9 != NULL, "Failed to get address of Direct3DCreate9\n"); if (pDirect3DCreate9) { + IDirect3D9 *d3d9 = pDirect3DCreate9( D3D_SDK_VERSION ); + if(!d3d9) + { + skip("could not create D3D9 object\n"); + return; + } + IDirect3D9_Release(d3d9); + test_display_formats(); test_display_modes(); test_swapchain(); diff --git a/dlls/d3d9/tests/shader.c b/dlls/d3d9/tests/shader.c index 07318e39693..dcf88519dc5 100644 --- a/dlls/d3d9/tests/shader.c +++ b/dlls/d3d9/tests/shader.c @@ -46,8 +46,11 @@ static IDirect3DDevice9 *init_d3d9(void) if (!d3d9_create) return NULL; d3d9_ptr = d3d9_create(D3D_SDK_VERSION); - ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n"); - if (!d3d9_ptr) return NULL; + if (!d3d9_ptr) + { + skip("could not create D3D9\n"); + return NULL; + } ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = TRUE; diff --git a/dlls/d3d9/tests/stateblock.c b/dlls/d3d9/tests/stateblock.c index e5d7ab24b66..d2bfcba53ad 100644 --- a/dlls/d3d9/tests/stateblock.c +++ b/dlls/d3d9/tests/stateblock.c @@ -50,8 +50,11 @@ static HRESULT init_d3d9( if (!d3d9_create) return E_FAIL; d3d9_ptr = d3d9_create(D3D_SDK_VERSION); - ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n"); - if (!d3d9_ptr) return E_FAIL; + if (!d3d9_ptr) + { + skip("could not create D3D9\n"); + return E_FAIL; + } window = create_window(); diff --git a/dlls/d3d9/tests/surface.c b/dlls/d3d9/tests/surface.c index 69016f5a58b..eed45c30eae 100644 --- a/dlls/d3d9/tests/surface.c +++ b/dlls/d3d9/tests/surface.c @@ -43,8 +43,11 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle) if (!d3d9_create) return NULL; d3d9_ptr = d3d9_create(D3D_SDK_VERSION); - ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n"); - if (!d3d9_ptr) return NULL; + if (!d3d9_ptr) + { + skip("could not create D3D9\n"); + return NULL; + } ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = TRUE; diff --git a/dlls/d3d9/tests/texture.c b/dlls/d3d9/tests/texture.c index 515820b3004..ede9467d992 100644 --- a/dlls/d3d9/tests/texture.c +++ b/dlls/d3d9/tests/texture.c @@ -43,8 +43,11 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle) if (!d3d9_create) return NULL; d3d9_ptr = d3d9_create(D3D_SDK_VERSION); - ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n"); - if (!d3d9_ptr) return NULL; + if (!d3d9_ptr) + { + skip("could not create D3D9\n"); + return NULL; + } ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = TRUE; diff --git a/dlls/d3d9/tests/vertexdeclaration.c b/dlls/d3d9/tests/vertexdeclaration.c index ad7b8737b7f..e0b28203179 100644 --- a/dlls/d3d9/tests/vertexdeclaration.c +++ b/dlls/d3d9/tests/vertexdeclaration.c @@ -51,8 +51,11 @@ static IDirect3DDevice9 *init_d3d9(void) if (!d3d9_create) return NULL; d3d9_ptr = d3d9_create(D3D_SDK_VERSION); - ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n"); - if (!d3d9_ptr) return NULL; + if (!d3d9_ptr) + { + skip("could not create D3D9\n"); + return NULL; + } ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = TRUE; diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 32031e4e4c4..fdf341fa71e 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -161,8 +161,11 @@ static IDirect3DDevice9 *init_d3d9(void) if (!d3d9_create) return NULL; d3d9_ptr = d3d9_create(D3D_SDK_VERSION); - ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n"); - if (!d3d9_ptr) return NULL; + if (!d3d9_ptr) + { + skip("could not create D3D9\n"); + return NULL; + } ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = FALSE; @@ -8679,7 +8682,7 @@ struct formats { }; const struct formats test_formats[] = { - { "D3DFMT_G16R16", D3DFMT_G16R16, 0x00181800, 0x002010ff}, + { "D3DFMT_G16R16", D3DFMT_G16R16, 0x001818ff, 0x002010ff}, { "D3DFMT_R16F", D3DFMT_R16F, 0x0018ffff, 0x0020ffff }, { "D3DFMT_G16R16F", D3DFMT_G16R16F, 0x001818ff, 0x002010ff }, { "D3DFMT_A16B16G16R16F", D3DFMT_A16B16G16R16F, 0x00181800, 0x00201000 }, diff --git a/dlls/d3d9/tests/volume.c b/dlls/d3d9/tests/volume.c index 31066a619d7..8b070729ea4 100644 --- a/dlls/d3d9/tests/volume.c +++ b/dlls/d3d9/tests/volume.c @@ -43,8 +43,11 @@ static IDirect3DDevice9 *init_d3d9(HMODULE d3d9_handle) if (!d3d9_create) return NULL; d3d9_ptr = d3d9_create(D3D_SDK_VERSION); - ok(d3d9_ptr != NULL, "Failed to create IDirect3D9 object\n"); - if (!d3d9_ptr) return NULL; + if (!d3d9_ptr) + { + skip("could not create D3D9\n"); + return NULL; + } ZeroMemory(&present_parameters, sizeof(present_parameters)); present_parameters.Windowed = TRUE; diff --git a/dlls/d3dx9_36/sprite.c b/dlls/d3dx9_36/sprite.c index 8c6c664841b..0c2bb207967 100644 --- a/dlls/d3dx9_36/sprite.c +++ b/dlls/d3dx9_36/sprite.c @@ -117,7 +117,7 @@ static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewLH(LPD3DXSPRITE iface, CONST D } /* Helper function */ -void set_states(ID3DXSpriteImpl *object) +static void set_states(ID3DXSpriteImpl *object) { D3DXMATRIX mat; D3DVIEWPORT9 vp; diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c index dbafcc610e5..4be62bdf940 100644 --- a/dlls/d3dxof/d3dxof.c +++ b/dlls/d3dxof/d3dxof.c @@ -81,7 +81,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dxof); #define CLSIDFMT "<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>" #define MAX_INPUT_SIZE 2000000 -#define MAX_DATA_SIZE 200000 +#define MAX_DATA_SIZE 400000 static const struct IDirectXFileVtbl IDirectXFile_Vtbl; static const struct IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl; @@ -96,6 +96,8 @@ static BOOL parse_object(parse_buffer * buf); static const char* get_primitive_string(WORD token); static WORD check_TOKEN(parse_buffer * buf); static BOOL parse_template(parse_buffer * buf); +static HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImpl** ppObj); +static HRESULT IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl** ppObj); static void dump_template(xtemplate* templates_array, xtemplate* ptemplate) { @@ -1177,6 +1179,40 @@ static BOOL parse_template_parts(parse_buffer * buf) return TRUE; } +static void go_to_next_definition(parse_buffer * buf) +{ + while (buf->rem_bytes) + { + char c = *buf->buffer; + if ((c == '#') || (c == '/')) + { + read_bytes(buf, &c, 1); + /* Handle comment (# or //) */ + if (c == '/') + { + if (!read_bytes(buf, &c, 1)) + return; + if (c != '/') + return; + } + c = 0; + while (c != 0x0A) + { + if (!read_bytes(buf, &c, 1)) + return; + } + continue; + } + else if (is_space(*buf->buffer)) + { + buf->buffer++; + buf->rem_bytes--; + } + else + break; + } +} + static BOOL parse_template(parse_buffer * buf) { if (get_TOKEN(buf) != TOKEN_TEMPLATE) @@ -1196,11 +1232,7 @@ static BOOL parse_template(parse_buffer * buf) if (buf->txt) { /* Go to the next template */ - while (buf->rem_bytes && is_space(*buf->buffer)) - { - buf->buffer++; - buf->rem_bytes--; - } + go_to_next_definition(buf); } TRACE("%d - %s - %s\n", buf->pdxf->nb_xtemplates, buf->pdxf->xtemplates[buf->pdxf->nb_xtemplates].name, debugstr_guid(&buf->pdxf->xtemplates[buf->pdxf->nb_xtemplates].class_id)); @@ -1306,22 +1338,6 @@ static const IDirectXFileVtbl IDirectXFile_Vtbl = IDirectXFileImpl_RegisterTemplates }; -HRESULT IDirectXFileBinaryImpl_Create(IDirectXFileBinaryImpl** ppObj) -{ - IDirectXFileBinaryImpl* object; - - TRACE("(%p)\n", ppObj); - - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileBinaryImpl)); - - object->lpVtbl.lpVtbl = &IDirectXFileBinary_Vtbl; - object->ref = 1; - - *ppObj = object; - - return DXFILE_OK; -} - /*** IUnknown methods ***/ static HRESULT WINAPI IDirectXFileBinaryImpl_QueryInterface(IDirectXFileBinary* iface, REFIID riid, void** ppvObject) { @@ -1429,7 +1445,7 @@ static const IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl = IDirectXFileBinaryImpl_Read }; -HRESULT IDirectXFileDataImpl_Create(IDirectXFileDataImpl** ppObj) +static HRESULT IDirectXFileDataImpl_Create(IDirectXFileDataImpl** ppObj) { IDirectXFileDataImpl* object; @@ -1649,7 +1665,7 @@ static const IDirectXFileDataVtbl IDirectXFileData_Vtbl = IDirectXFileDataImpl_AddBinaryObject }; -HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImpl** ppObj) +static HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImpl** ppObj) { IDirectXFileDataReferenceImpl* object; @@ -1777,7 +1793,7 @@ static const IDirectXFileDataReferenceVtbl IDirectXFileDataReference_Vtbl = IDirectXFileDataReferenceImpl_Resolve }; -HRESULT IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl** ppObj) +static HRESULT IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl** ppObj) { IDirectXFileEnumObjectImpl* object; @@ -1874,7 +1890,7 @@ static BOOL parse_object_members_list(parse_buffer * buf) else { /* Allow comma omission */ - if (!((token == TOKEN_FLOAT))) + if (!((token == TOKEN_FLOAT) || (token == TOKEN_INTEGER))) return FALSE; } } @@ -1996,10 +2012,10 @@ static BOOL parse_object_members_list(parse_buffer * buf) } } - if (buf->txt) + if (buf->txt && (check_TOKEN(buf) != TOKEN_CBRACE)) { token = get_TOKEN(buf); - if (token != TOKEN_SEMICOLON) + if ((token != TOKEN_SEMICOLON) && (token != TOKEN_COMMA)) { /* Allow comma instead of semicolon in some specific cases */ if (!((token == TOKEN_COMMA) && ((i+1) < pt->nb_members) && (pt->members[i].type == pt->members[i+1].type) @@ -2136,11 +2152,7 @@ static BOOL parse_object(parse_buffer * buf) if (buf->txt) { /* Go to the next object */ - while (buf->rem_bytes && is_space(*buf->buffer)) - { - buf->buffer++; - buf->rem_bytes--; - } + go_to_next_definition(buf); } return TRUE; @@ -2250,22 +2262,6 @@ static const IDirectXFileEnumObjectVtbl IDirectXFileEnumObject_Vtbl = IDirectXFileEnumObjectImpl_GetDataObjectByName }; -HRESULT IDirectXFileObjectImpl_Create(IDirectXFileObjectImpl** ppObj) -{ - IDirectXFileObjectImpl* object; - - TRACE("(%p)\n", ppObj); - - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileObjectImpl)); - - object->lpVtbl.lpVtbl = &IDirectXFileObject_Vtbl; - object->ref = 1; - - *ppObj = object; - - return S_OK; -} - /*** IUnknown methods ***/ static HRESULT WINAPI IDirectXFileObjectImpl_QueryInterface(IDirectXFileObject* iface, REFIID riid, void** ppvObject) { @@ -2336,22 +2332,6 @@ static const IDirectXFileObjectVtbl IDirectXFileObject_Vtbl = IDirectXFileObjectImpl_GetId }; -HRESULT IDirectXFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl** ppObj) -{ - IDirectXFileSaveObjectImpl* object; - - TRACE("(%p)\n", ppObj); - - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileSaveObjectImpl)); - - object->lpVtbl.lpVtbl = &IDirectXFileSaveObject_Vtbl; - object->ref = 1; - - *ppObj = object; - - return S_OK; -} - /*** IUnknown methods ***/ static HRESULT WINAPI IDirectXFileSaveObjectImpl_QueryInterface(IDirectXFileSaveObject* iface, REFIID riid, void** ppvObject) { diff --git a/dlls/d3dxof/d3dxof_private.h b/dlls/d3dxof/d3dxof_private.h index b2f5b4160ba..c12d574a7b7 100644 --- a/dlls/d3dxof/d3dxof_private.h +++ b/dlls/d3dxof/d3dxof_private.h @@ -36,10 +36,10 @@ #define MAX_NAME_LEN 32 #define MAX_ARRAY_DIM 4 #define MAX_MEMBERS 50 -#define MAX_CHILDS 20 +#define MAX_CHILDS 100 #define MAX_TEMPLATES 200 #define MAX_OBJECTS 500 -#define MAX_SUBOBJECTS 120 +#define MAX_SUBOBJECTS 500 #define MAX_STRINGS_BUFFER 200 typedef struct { @@ -156,10 +156,6 @@ typedef struct { } IDirectXFileSaveObjectImpl; HRESULT IDirectXFileImpl_Create(IUnknown *pUnkOuter, LPVOID *ppObj); -HRESULT IDirectXFileBinaryImpl_Create(IDirectXFileBinaryImpl** ppObj); -HRESULT IDirectXFileDataImpl_Create(IDirectXFileDataImpl** ppObj); -HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImpl** ppObj); -HRESULT IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl** ppObj); HRESULT IDirectXFileFileObjectImpl_Create(IDirectXFileObjectImpl** ppObj); HRESULT IDirectXFileFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl** ppObj); diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c index 3e51782b402..947eb49095e 100644 --- a/dlls/dbghelp/type.c +++ b/dlls/dbghelp/type.c @@ -432,7 +432,7 @@ struct enum_types_AtoW PSYM_ENUMERATESYMBOLS_CALLBACKW callback; }; -BOOL CALLBACK enum_types_AtoW(PSYMBOL_INFO si, ULONG addr, PVOID _et) +static BOOL CALLBACK enum_types_AtoW(PSYMBOL_INFO si, ULONG addr, PVOID _et) { struct enum_types_AtoW* et = _et; SYMBOL_INFOW* siW = (SYMBOL_INFOW*)et->buffer; diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 4f23722669d..cdb33d9df0b 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -3567,8 +3567,9 @@ const IDirectDraw7Vtbl IDirectDraw7_Vtbl = IDirectDrawImpl_WaitForVerticalBlank, /*** IDirectDraw2 ***/ IDirectDrawImpl_GetAvailableVidMem, - /*** IDirectDraw7 ***/ + /*** IDirectDraw3 ***/ IDirectDrawImpl_GetSurfaceFromDC, + /*** IDirectDraw4 ***/ IDirectDrawImpl_RestoreAllSurfaces, IDirectDrawImpl_TestCooperativeLevel, IDirectDrawImpl_GetDeviceIdentifier, diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 7a5eadb306e..fe2e20d3801 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -633,7 +633,6 @@ const IDirect3DVertexBufferVtbl IDirect3DVertexBuffer1_Vtbl; void PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat, WINED3DFORMAT WineD3DFormat); WINED3DFORMAT PixelFormat_DD2WineD3D(const DDPIXELFORMAT *DDPixelFormat); void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd); -void DDRAW_dump_pixelformat(const DDPIXELFORMAT *PixelFormat); void dump_D3DMATRIX(const D3DMATRIX *mat); void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps); DWORD get_flexible_vertex_size(DWORD d3dvtVertexType); diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c index 21cd272d921..4bd08c8976e 100644 --- a/dlls/ddraw/main.c +++ b/dlls/ddraw/main.c @@ -267,7 +267,7 @@ DDRAW_Create(const GUID *guid, This->wnd_class.hInstance = GetModuleHandleA(0); This->wnd_class.hIcon = 0; This->wnd_class.hCursor = 0; - This->wnd_class.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH); + This->wnd_class.hbrBackground = GetStockObject(BLACK_BRUSH); This->wnd_class.lpszMenuName = NULL; This->wnd_class.lpszClassName = This->classname; if(!RegisterClassA(&This->wnd_class)) diff --git a/dlls/ddraw/tests/ddrawmodes.c b/dlls/ddraw/tests/ddrawmodes.c index dcde97d6a45..d21c3b4f350 100644 --- a/dlls/ddraw/tests/ddrawmodes.c +++ b/dlls/ddraw/tests/ddrawmodes.c @@ -47,7 +47,7 @@ static void createwindow(void) wc.hInstance = GetModuleHandleA(0); wc.hIcon = LoadIconA(wc.hInstance, IDI_APPLICATION); wc.hCursor = LoadCursorA(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH); + wc.hbrBackground = GetStockObject(BLACK_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = "TestWindowClass"; if(!RegisterClassA(&wc)) diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index d4626addc4c..80cf9b13417 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -2748,6 +2748,22 @@ static void SurfaceCapsTest(void) } } +static BOOL can_create_primary_surface(void) +{ + DDSURFACEDESC ddsd; + IDirectDrawSurface *surface; + HRESULT hr; + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL); + if(FAILED(hr)) return FALSE; + IDirectDrawSurface_Release(surface); + return TRUE; +} + START_TEST(dsurface) { HRESULT ret; @@ -2765,6 +2781,12 @@ START_TEST(dsurface) } IDirectDraw_Release(dd4); + if(!can_create_primary_surface()) + { + skip("Unable to create primary surface\n"); + return; + } + MipMapCreationTest(); SrcColorKey32BlitTest(); QueryInterface(); diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c index 12f11c9e50a..185cc334b07 100644 --- a/dlls/ddraw/tests/visual.c +++ b/dlls/ddraw/tests/visual.c @@ -89,8 +89,7 @@ static BOOL createObjects(void) ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE; ddsd.dwBackBufferCount = 1; hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &Surface, NULL); - ok(hr==DD_OK, "CreateSurface returned: %08x\n", hr); - if(!Surface) goto err; + if(FAILED(hr)) goto err; hr = IDirect3D7_CreateDevice(Direct3D, &IID_IDirect3DTnLHalDevice, Surface, &Direct3DDevice); if(FAILED(hr)) diff --git a/dlls/ddraw/utils.c b/dlls/ddraw/utils.c index b07ebd880f5..e3dadce6b63 100644 --- a/dlls/ddraw/utils.c +++ b/dlls/ddraw/utils.c @@ -30,6 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw); +static void DDRAW_dump_pixelformat(const DDPIXELFORMAT *pf); /***************************************************************************** * PixelFormat_WineD3DtoDD @@ -724,7 +725,7 @@ void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in) DDRAW_dump_flags(in->dwCaps2, flags2, sizeof(flags2)/sizeof(flags2[0])); } -void +static void DDRAW_dump_DDSCAPS(const DDSCAPS *in) { DDSCAPS2 in_bis; @@ -779,7 +780,7 @@ DDRAW_dump_members(DWORD flags, } } -void +static void DDRAW_dump_pixelformat(const DDPIXELFORMAT *pf) { TRACE("( "); diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c index d62c090f2c6..e64b27ba4d0 100644 --- a/dlls/devenum/createdevenum.c +++ b/dlls/devenum/createdevenum.c @@ -318,7 +318,7 @@ static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2) rgf2->u.s.rgPins = rgPins; } -static HRESULT DEVENUM_RegisterLegacyAmFilters() +static HRESULT DEVENUM_RegisterLegacyAmFilters(void) { HKEY hkeyFilter = NULL; DWORD dwFilterSubkeys, i; @@ -453,7 +453,7 @@ static HRESULT DEVENUM_RegisterLegacyAmFilters() /********************************************************************** * DEVENUM_ICreateDevEnum_CreateClassEnumerator */ -HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator( +static HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator( ICreateDevEnum * iface, REFCLSID clsidDeviceClass, IEnumMoniker **ppEnumMoniker, diff --git a/dlls/devenum/devenum_private.h b/dlls/devenum/devenum_private.h index b50afb8ae57..5266d0309f0 100644 --- a/dlls/devenum/devenum_private.h +++ b/dlls/devenum/devenum_private.h @@ -82,11 +82,6 @@ typedef struct MediaCatMoniker * DEVENUM_IMediaCatMoniker_Construct(void); HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker); -HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator( - ICreateDevEnum * iface, - REFCLSID clsidDeviceClass, - IEnumMoniker **ppEnumMoniker, - DWORD dwFlags); extern ClassFactoryImpl DEVENUM_ClassFactory; extern CreateDevEnumImpl DEVENUM_CreateDevEnum; diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 7d9f72843b1..aaf55778e66 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dinput); /****************************************************************************** * Various debugging tools */ -void _dump_cooperativelevel_DI(DWORD dwFlags) { +static void _dump_cooperativelevel_DI(DWORD dwFlags) { if (TRACE_ON(dinput)) { unsigned int i; static const struct { @@ -67,7 +67,7 @@ void _dump_cooperativelevel_DI(DWORD dwFlags) { } } -void _dump_EnumObjects_flags(DWORD dwFlags) { +static void _dump_EnumObjects_flags(DWORD dwFlags) { if (TRACE_ON(dinput)) { unsigned int i; DWORD type, instance; @@ -342,13 +342,13 @@ void release_DataFormat(DataFormat * format) format->user_df = NULL; } -inline LPDIOBJECTDATAFORMAT dataformat_to_odf(LPCDIDATAFORMAT df, int idx) +static inline LPDIOBJECTDATAFORMAT dataformat_to_odf(LPCDIDATAFORMAT df, int idx) { if (idx < 0 || idx >= df->dwNumObjs) return NULL; return (LPDIOBJECTDATAFORMAT)((LPBYTE)df->rgodf + idx * df->dwObjSize); } -HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *format) +static HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *format) { DataTransform *dt; unsigned int i, j; @@ -1132,26 +1132,6 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceData( return ret; } -HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo( - LPDIRECTINPUTDEVICE8A iface, - LPDIDEVICEINSTANCEA pdidi) -{ - FIXME("(this=%p,%p): stub!\n", - iface, pdidi); - - return DI_OK; -} - -HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo( - LPDIRECTINPUTDEVICE8W iface, - LPDIDEVICEINSTANCEW pdidi) -{ - FIXME("(this=%p,%p): stub!\n", - iface, pdidi); - - return DI_OK; -} - HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel( LPDIRECTINPUTDEVICE8A iface, HWND hwndOwner, diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 7b62a50f14d..dd06a4b50d3 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -77,7 +77,6 @@ extern DWORD get_config_key(HKEY, HKEY, const char*, char*, DWORD); /* Routines to do DataFormat / WineFormat conversions */ extern void fill_DataFormat(void *out, DWORD size, const void *in, const DataFormat *df) ; -extern HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *format); extern void release_DataFormat(DataFormat *df) ; extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq); /* Helper functions to work with data format */ @@ -120,8 +119,6 @@ extern const GUID DInput_Wine_Keyboard_GUID; extern const GUID DInput_Wine_Mouse_GUID; /* Various debug tools */ -extern void _dump_cooperativelevel_DI(DWORD dwFlags) ; -extern void _dump_EnumObjects_flags(DWORD dwFlags) ; extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) ; extern void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA *ddoi) ; extern void _dump_OBJECTINSTANCEW(const DIDEVICEOBJECTINSTANCEW *ddoi) ; @@ -165,12 +162,6 @@ extern HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE DWORD dwHow); extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceData(LPDIRECTINPUTDEVICE8A iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags); -extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo( - LPDIRECTINPUTDEVICE8A iface, - LPDIDEVICEINSTANCEA pdidi) ; -extern HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo( - LPDIRECTINPUTDEVICE8W iface, - LPDIDEVICEINSTANCEW pdidi) ; extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel( LPDIRECTINPUTDEVICE8A iface, HWND hwndOwner, diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 4146f1da807..00bc3bd7da8 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -1141,7 +1141,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt = XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat, XCAST(SetEventNotification)IDirectInputDevice2AImpl_SetEventNotification, XCAST(SetCooperativeLevel)IDirectInputDevice2AImpl_SetCooperativeLevel, - IDirectInputDevice2WImpl_GetObjectInfo, + JoystickWImpl_GetObjectInfo, JoystickWImpl_GetDeviceInfo, XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel, XCAST(Initialize)IDirectInputDevice2AImpl_Initialize, diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c index 9bafd303e78..b318323343d 100644 --- a/dlls/dinput/tests/joystick.c +++ b/dlls/dinput/tests/joystick.c @@ -384,7 +384,7 @@ static BOOL CALLBACK EnumJoysticks( js.rgbButtons[9]>>7, js.rgbButtons[10]>>7, js.rgbButtons[11]>>7); if (strcmp(oldstate, curstate) != 0) { - trace(curstate); + trace("%s\n", curstate); strcpy(oldstate, curstate); } Sleep(100); diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c index 19cba2b84a2..3cffdd52c4f 100644 --- a/dlls/dmband/dmutils.c +++ b/dlls/dmband/dmutils.c @@ -46,20 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic); WINE_DECLARE_DEBUG_CHANNEL(dmfile); -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -int even_or_odd (DWORD number) { - return (number & 0x1); /* basically, check if bit 0 is set ;) */ -} - -/* figures out whether given FOURCC is valid DirectMusic form ID */ -BOOL IS_VALID_DMFORM (FOURCC chunkID) { - if ((chunkID == DMUS_FOURCC_AUDIOPATH_FORM) || (chunkID == DMUS_FOURCC_BAND_FORM) || (chunkID == DMUS_FOURCC_CHORDMAP_FORM) - || (chunkID == DMUS_FOURCC_CONTAINER_FORM) || (chunkID == FOURCC_DLS) || (chunkID == DMUS_FOURCC_SCRIPT_FORM) - || (chunkID == DMUS_FOURCC_SEGMENT_FORM) || (chunkID == DMUS_FOURCC_STYLE_FORM) || (chunkID == DMUS_FOURCC_TOOLGRAPH_FORM) - || (chunkID == DMUS_FOURCC_TRACK_FORM) || (chunkID == mmioFOURCC('W','A','V','E'))) return TRUE; - else return FALSE; -} - /* generic flag-dumping function */ static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ static char buffer[128] = "", *ptr = &buffer[0]; @@ -337,20 +323,6 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, return S_OK; } -/* translate STREAM_SEEK flag to string */ -const char *resolve_STREAM_SEEK (DWORD flag) { - switch (flag) { - case STREAM_SEEK_SET: - return "STREAM_SEEK_SET"; - case STREAM_SEEK_CUR: - return "STREAM_SEEK_CUR"; - case STREAM_SEEK_END: - return "STREAM_SEEK_END"; - default: - return "()"; - } -} - /* FOURCC to string conversion for debug messages */ const char *debugstr_fourcc (DWORD fourcc) { if (!fourcc) return "'null'"; @@ -543,169 +515,6 @@ const char *debugstr_dmguid (const GUID *id) { return debugstr_guid(id); } -/* returns name of given error code */ -const char *debugstr_dmreturn (DWORD code) { - static const flag_info codes[] = { - FE(S_OK), - FE(S_FALSE), - FE(DMUS_S_PARTIALLOAD), - FE(DMUS_S_PARTIALDOWNLOAD), - FE(DMUS_S_REQUEUE), - FE(DMUS_S_FREE), - FE(DMUS_S_END), - FE(DMUS_S_STRING_TRUNCATED), - FE(DMUS_S_LAST_TOOL), - FE(DMUS_S_OVER_CHORD), - FE(DMUS_S_UP_OCTAVE), - FE(DMUS_S_DOWN_OCTAVE), - FE(DMUS_S_NOBUFFERCONTROL), - FE(DMUS_S_GARBAGE_COLLECTED), - FE(E_NOTIMPL), - FE(E_NOINTERFACE), - FE(E_POINTER), - FE(CLASS_E_NOAGGREGATION), - FE(CLASS_E_CLASSNOTAVAILABLE), - FE(REGDB_E_CLASSNOTREG), - FE(E_OUTOFMEMORY), - FE(E_FAIL), - FE(E_INVALIDARG), - FE(DMUS_E_DRIVER_FAILED), - FE(DMUS_E_PORTS_OPEN), - FE(DMUS_E_DEVICE_IN_USE), - FE(DMUS_E_INSUFFICIENTBUFFER), - FE(DMUS_E_BUFFERNOTSET), - FE(DMUS_E_BUFFERNOTAVAILABLE), - FE(DMUS_E_NOTADLSCOL), - FE(DMUS_E_INVALIDOFFSET), - FE(DMUS_E_ALREADY_LOADED), - FE(DMUS_E_INVALIDPOS), - FE(DMUS_E_INVALIDPATCH), - FE(DMUS_E_CANNOTSEEK), - FE(DMUS_E_CANNOTWRITE), - FE(DMUS_E_CHUNKNOTFOUND), - FE(DMUS_E_INVALID_DOWNLOADID), - FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), - FE(DMUS_E_ALREADY_DOWNLOADED), - FE(DMUS_E_UNKNOWN_PROPERTY), - FE(DMUS_E_SET_UNSUPPORTED), - FE(DMUS_E_GET_UNSUPPORTED), - FE(DMUS_E_NOTMONO), - FE(DMUS_E_BADARTICULATION), - FE(DMUS_E_BADINSTRUMENT), - FE(DMUS_E_BADWAVELINK), - FE(DMUS_E_NOARTICULATION), - FE(DMUS_E_NOTPCM), - FE(DMUS_E_BADWAVE), - FE(DMUS_E_BADOFFSETTABLE), - FE(DMUS_E_UNKNOWNDOWNLOAD), - FE(DMUS_E_NOSYNTHSINK), - FE(DMUS_E_ALREADYOPEN), - FE(DMUS_E_ALREADYCLOSED), - FE(DMUS_E_SYNTHNOTCONFIGURED), - FE(DMUS_E_SYNTHACTIVE), - FE(DMUS_E_CANNOTREAD), - FE(DMUS_E_DMUSIC_RELEASED), - FE(DMUS_E_BUFFER_EMPTY), - FE(DMUS_E_BUFFER_FULL), - FE(DMUS_E_PORT_NOT_CAPTURE), - FE(DMUS_E_PORT_NOT_RENDER), - FE(DMUS_E_DSOUND_NOT_SET), - FE(DMUS_E_ALREADY_ACTIVATED), - FE(DMUS_E_INVALIDBUFFER), - FE(DMUS_E_WAVEFORMATNOTSUPPORTED), - FE(DMUS_E_SYNTHINACTIVE), - FE(DMUS_E_DSOUND_ALREADY_SET), - FE(DMUS_E_INVALID_EVENT), - FE(DMUS_E_UNSUPPORTED_STREAM), - FE(DMUS_E_ALREADY_INITED), - FE(DMUS_E_INVALID_BAND), - FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), - FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), - FE(DMUS_E_INVALID_TRACK_HDR), - FE(DMUS_E_INVALID_TOOL_HDR), - FE(DMUS_E_ALL_TOOLS_FAILED), - FE(DMUS_E_ALL_TRACKS_FAILED), - FE(DMUS_E_NOT_FOUND), - FE(DMUS_E_NOT_INIT), - FE(DMUS_E_TYPE_DISABLED), - FE(DMUS_E_TYPE_UNSUPPORTED), - FE(DMUS_E_TIME_PAST), - FE(DMUS_E_TRACK_NOT_FOUND), - FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), - FE(DMUS_E_NO_MASTER_CLOCK), - FE(DMUS_E_LOADER_NOCLASSID), - FE(DMUS_E_LOADER_BADPATH), - FE(DMUS_E_LOADER_FAILEDOPEN), - FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), - FE(DMUS_E_LOADER_FAILEDCREATE), - FE(DMUS_E_LOADER_OBJECTNOTFOUND), - FE(DMUS_E_LOADER_NOFILENAME), - FE(DMUS_E_INVALIDFILE), - FE(DMUS_E_ALREADY_EXISTS), - FE(DMUS_E_OUT_OF_RANGE), - FE(DMUS_E_SEGMENT_INIT_FAILED), - FE(DMUS_E_ALREADY_SENT), - FE(DMUS_E_CANNOT_FREE), - FE(DMUS_E_CANNOT_OPEN_PORT), - FE(DMUS_E_CANNOT_CONVERT), - FE(DMUS_E_DESCEND_CHUNK_FAIL), - FE(DMUS_E_NOT_LOADED), - FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), - FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), - FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), - FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), - FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), - FE(DMUS_E_SCRIPT_INVALID_FILE), - FE(DMUS_E_INVALID_SCRIPTTRACK), - FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), - FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), - FE(DMUS_E_SCRIPT_CONTENT_READONLY), - FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), - FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), - FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), - FE(DMUS_E_INVALID_LYRICSTRACK), - FE(DMUS_E_INVALID_PARAMCONTROLTRACK), - FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), - FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), - FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), - FE(DMUS_E_AUDIOPATHS_NOT_VALID), - FE(DMUS_E_AUDIOPATHS_IN_USE), - FE(DMUS_E_NO_AUDIOPATH_CONFIG), - FE(DMUS_E_AUDIOPATH_INACTIVE), - FE(DMUS_E_AUDIOPATH_NOBUFFER), - FE(DMUS_E_AUDIOPATH_NOPORT), - FE(DMUS_E_NO_AUDIOPATH), - FE(DMUS_E_INVALIDCHUNK), - FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), - FE(DMUS_E_INVALID_CONTAINER_OBJECT) - }; - - unsigned int i; - for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { - if (code == codes[i].val) - return codes[i].name; - } - - /* if we didn't find it, return value */ - return wine_dbg_sprintf("0x%08X", code); -} - - -/* dump DMUS_CONTAINER flags */ -static const char *debugstr_DMUS_CONTAINER_FLAGS (DWORD flagmask) { - static const flag_info flags[] = { - FE(DMUS_CONTAINER_NOLOADS) - }; - return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); -} - -/* dump DMUS_CONTAINED_OBJF flags */ -static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) { - static const flag_info flags[] = { - FE(DMUS_CONTAINED_OBJF_KEEP) - }; - return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); -} void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { if (pDesc) { @@ -726,32 +535,3 @@ void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { TRACE("(NULL)\n"); } } - -const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) { - if (pHeader) { - char buffer[1024] = "", *ptr = &buffer[0]; - - ptr += sprintf(ptr, "DMUS_IO_CONTAINER_HEADER (%p):\n", pHeader); - ptr += sprintf(ptr, " - dwFlags = %s\n", debugstr_DMUS_CONTAINER_FLAGS(pHeader->dwFlags)); - - return wine_dbg_sprintf("%s", buffer); - } else { - return "(NULL)"; - } -} - -const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader) { - if (pHeader) { - char buffer[1024] = "", *ptr = &buffer[0]; - - ptr += sprintf(ptr, "DMUS_IO_CONTAINED_OBJECT_HEADER (%p):\n", pHeader); - ptr += sprintf(ptr, " - guidClassID = %s\n", debugstr_dmguid(&pHeader->guidClassID)); - ptr += sprintf(ptr, " - dwFlags = %s\n", debugstr_DMUS_CONTAINED_OBJF_FLAGS (pHeader->dwFlags)); - ptr += sprintf(ptr, " - ckid = %s\n", debugstr_fourcc (pHeader->ckid)); - ptr += sprintf(ptr, " - fccType = %s\n", debugstr_fourcc (pHeader->fccType)); - - return wine_dbg_sprintf("%s", buffer); - } else { - return "(NULL)"; - } -} diff --git a/dlls/dmband/dmutils.h b/dlls/dmband/dmutils.h index e0dee4ec860..6195220417f 100644 --- a/dlls/dmband/dmutils.h +++ b/dlls/dmband/dmutils.h @@ -60,21 +60,11 @@ typedef struct { #define FE(x) { x, #x } #define GE(x) { &x, #x } -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -extern int even_or_odd (DWORD number); -/* check whether chunkID is valid dmobject form chunk */ -extern BOOL IS_VALID_DMFORM (FOURCC chunkID); -/* translate STREAM_SEEK flag to string */ -extern const char *resolve_STREAM_SEEK (DWORD flag); /* FOURCC to string conversion for debug messages */ extern const char *debugstr_fourcc (DWORD fourcc); /* returns name of given GUID */ extern const char *debugstr_dmguid (const GUID *id); -/* returns name of given error code */ -extern const char *debugstr_dmreturn (DWORD code); extern void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); -extern const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader); -extern const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader); #endif /* __WINE_DMUTILS_H */ diff --git a/dlls/dmcompos/dmcompos_main.c b/dlls/dmcompos/dmcompos_main.c index a70c292a638..dec8a81064d 100644 --- a/dlls/dmcompos/dmcompos_main.c +++ b/dlls/dmcompos/dmcompos_main.c @@ -349,11 +349,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { * * */ -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -int even_or_odd (DWORD number) { - return (number & 0x1); /* basically, check if bit 0 is set ;) */ -} - /* FOURCC to string conversion for debug messages */ const char *debugstr_fourcc (DWORD fourcc) { if (!fourcc) return "'null'"; @@ -363,7 +358,7 @@ const char *debugstr_fourcc (DWORD fourcc) { } /* DMUS_VERSION struct to string conversion for debug messages */ -const char *debugstr_dmversion (const DMUS_VERSION *version) { +static const char *debugstr_dmversion (const DMUS_VERSION *version) { if (!version) return "'null'"; return wine_dbg_sprintf ("\'%i,%i,%i,%i\'", (int)((version->dwVersionMS & 0xFFFF0000) >> 8), (int)(version->dwVersionMS & 0x0000FFFF), @@ -554,144 +549,8 @@ const char *debugstr_dmguid (const GUID *id) { return debugstr_guid(id); } -/* returns name of given error code */ -const char *debugstr_dmreturn (DWORD code) { - static const flag_info codes[] = { - FE(S_OK), - FE(S_FALSE), - FE(DMUS_S_PARTIALLOAD), - FE(DMUS_S_PARTIALDOWNLOAD), - FE(DMUS_S_REQUEUE), - FE(DMUS_S_FREE), - FE(DMUS_S_END), - FE(DMUS_S_STRING_TRUNCATED), - FE(DMUS_S_LAST_TOOL), - FE(DMUS_S_OVER_CHORD), - FE(DMUS_S_UP_OCTAVE), - FE(DMUS_S_DOWN_OCTAVE), - FE(DMUS_S_NOBUFFERCONTROL), - FE(DMUS_S_GARBAGE_COLLECTED), - FE(DMUS_E_DRIVER_FAILED), - FE(DMUS_E_PORTS_OPEN), - FE(DMUS_E_DEVICE_IN_USE), - FE(DMUS_E_INSUFFICIENTBUFFER), - FE(DMUS_E_BUFFERNOTSET), - FE(DMUS_E_BUFFERNOTAVAILABLE), - FE(DMUS_E_NOTADLSCOL), - FE(DMUS_E_INVALIDOFFSET), - FE(DMUS_E_ALREADY_LOADED), - FE(DMUS_E_INVALIDPOS), - FE(DMUS_E_INVALIDPATCH), - FE(DMUS_E_CANNOTSEEK), - FE(DMUS_E_CANNOTWRITE), - FE(DMUS_E_CHUNKNOTFOUND), - FE(DMUS_E_INVALID_DOWNLOADID), - FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), - FE(DMUS_E_ALREADY_DOWNLOADED), - FE(DMUS_E_UNKNOWN_PROPERTY), - FE(DMUS_E_SET_UNSUPPORTED), - FE(DMUS_E_GET_UNSUPPORTED), - FE(DMUS_E_NOTMONO), - FE(DMUS_E_BADARTICULATION), - FE(DMUS_E_BADINSTRUMENT), - FE(DMUS_E_BADWAVELINK), - FE(DMUS_E_NOARTICULATION), - FE(DMUS_E_NOTPCM), - FE(DMUS_E_BADWAVE), - FE(DMUS_E_BADOFFSETTABLE), - FE(DMUS_E_UNKNOWNDOWNLOAD), - FE(DMUS_E_NOSYNTHSINK), - FE(DMUS_E_ALREADYOPEN), - FE(DMUS_E_ALREADYCLOSED), - FE(DMUS_E_SYNTHNOTCONFIGURED), - FE(DMUS_E_SYNTHACTIVE), - FE(DMUS_E_CANNOTREAD), - FE(DMUS_E_DMUSIC_RELEASED), - FE(DMUS_E_BUFFER_EMPTY), - FE(DMUS_E_BUFFER_FULL), - FE(DMUS_E_PORT_NOT_CAPTURE), - FE(DMUS_E_PORT_NOT_RENDER), - FE(DMUS_E_DSOUND_NOT_SET), - FE(DMUS_E_ALREADY_ACTIVATED), - FE(DMUS_E_INVALIDBUFFER), - FE(DMUS_E_WAVEFORMATNOTSUPPORTED), - FE(DMUS_E_SYNTHINACTIVE), - FE(DMUS_E_DSOUND_ALREADY_SET), - FE(DMUS_E_INVALID_EVENT), - FE(DMUS_E_UNSUPPORTED_STREAM), - FE(DMUS_E_ALREADY_INITED), - FE(DMUS_E_INVALID_BAND), - FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), - FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), - FE(DMUS_E_INVALID_TRACK_HDR), - FE(DMUS_E_INVALID_TOOL_HDR), - FE(DMUS_E_ALL_TOOLS_FAILED), - FE(DMUS_E_ALL_TRACKS_FAILED), - FE(DMUS_E_NOT_FOUND), - FE(DMUS_E_NOT_INIT), - FE(DMUS_E_TYPE_DISABLED), - FE(DMUS_E_TYPE_UNSUPPORTED), - FE(DMUS_E_TIME_PAST), - FE(DMUS_E_TRACK_NOT_FOUND), - FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), - FE(DMUS_E_NO_MASTER_CLOCK), - FE(DMUS_E_LOADER_NOCLASSID), - FE(DMUS_E_LOADER_BADPATH), - FE(DMUS_E_LOADER_FAILEDOPEN), - FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), - FE(DMUS_E_LOADER_FAILEDCREATE), - FE(DMUS_E_LOADER_OBJECTNOTFOUND), - FE(DMUS_E_LOADER_NOFILENAME), - FE(DMUS_E_INVALIDFILE), - FE(DMUS_E_ALREADY_EXISTS), - FE(DMUS_E_OUT_OF_RANGE), - FE(DMUS_E_SEGMENT_INIT_FAILED), - FE(DMUS_E_ALREADY_SENT), - FE(DMUS_E_CANNOT_FREE), - FE(DMUS_E_CANNOT_OPEN_PORT), - FE(DMUS_E_CANNOT_CONVERT), - FE(DMUS_E_DESCEND_CHUNK_FAIL), - FE(DMUS_E_NOT_LOADED), - FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), - FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), - FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), - FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), - FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), - FE(DMUS_E_SCRIPT_INVALID_FILE), - FE(DMUS_E_INVALID_SCRIPTTRACK), - FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), - FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), - FE(DMUS_E_SCRIPT_CONTENT_READONLY), - FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), - FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), - FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), - FE(DMUS_E_INVALID_LYRICSTRACK), - FE(DMUS_E_INVALID_PARAMCONTROLTRACK), - FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), - FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), - FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), - FE(DMUS_E_AUDIOPATHS_NOT_VALID), - FE(DMUS_E_AUDIOPATHS_IN_USE), - FE(DMUS_E_NO_AUDIOPATH_CONFIG), - FE(DMUS_E_AUDIOPATH_INACTIVE), - FE(DMUS_E_AUDIOPATH_NOBUFFER), - FE(DMUS_E_AUDIOPATH_NOPORT), - FE(DMUS_E_NO_AUDIOPATH), - FE(DMUS_E_INVALIDCHUNK), - FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), - FE(DMUS_E_INVALID_CONTAINER_OBJECT) - }; - unsigned int i; - for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { - if (code == codes[i].val) - return codes[i].name; - } - /* if we didn't find it, return value */ - return wine_dbg_sprintf("0x%08x", code); -} - /* generic flag-dumping function */ -const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ +static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ char buffer[128] = "", *ptr = &buffer[0]; unsigned int i; int size = sizeof(buffer); @@ -711,7 +570,7 @@ const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_name } /* dump DMUS_OBJ flags */ -const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { +static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { static const flag_info flags[] = { FE(DMUS_OBJ_OBJECT), FE(DMUS_OBJ_CLASS), diff --git a/dlls/dmcompos/dmcompos_private.h b/dlls/dmcompos/dmcompos_private.h index 68040033492..5048b339155 100644 --- a/dlls/dmcompos/dmcompos_private.h +++ b/dlls/dmcompos/dmcompos_private.h @@ -152,19 +152,10 @@ typedef struct { #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -extern int even_or_odd (DWORD number); /* FOURCC to string conversion for debug messages */ extern const char *debugstr_fourcc (DWORD fourcc); -/* DMUS_VERSION struct to string conversion for debug messages */ -extern const char *debugstr_dmversion (const DMUS_VERSION *version); /* returns name of given GUID */ extern const char *debugstr_dmguid (const GUID *id); -/* returns name of given error code */ -extern const char *debugstr_dmreturn (DWORD code); -/* generic flags-dumping function */ -extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names); -extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask); /* dump whole DMUS_OBJECTDESC struct */ extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); diff --git a/dlls/dmime/dmutils.c b/dlls/dmime/dmutils.c index 87668cb6f5b..ad46303e7df 100644 --- a/dlls/dmime/dmutils.c +++ b/dlls/dmime/dmutils.c @@ -46,20 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic); WINE_DECLARE_DEBUG_CHANNEL(dmfile); -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -int even_or_odd (DWORD number) { - return (number & 0x1); /* basically, check if bit 0 is set ;) */ -} - -/* figures out whether given FOURCC is valid DirectMusic form ID */ -BOOL IS_VALID_DMFORM (FOURCC chunkID) { - if ((chunkID == DMUS_FOURCC_AUDIOPATH_FORM) || (chunkID == DMUS_FOURCC_BAND_FORM) || (chunkID == DMUS_FOURCC_CHORDMAP_FORM) - || (chunkID == DMUS_FOURCC_CONTAINER_FORM) || (chunkID == FOURCC_DLS) || (chunkID == DMUS_FOURCC_SCRIPT_FORM) - || (chunkID == DMUS_FOURCC_SEGMENT_FORM) || (chunkID == DMUS_FOURCC_STYLE_FORM) || (chunkID == DMUS_FOURCC_TOOLGRAPH_FORM) - || (chunkID == DMUS_FOURCC_TRACK_FORM) || (chunkID == mmioFOURCC('W','A','V','E'))) return TRUE; - else return FALSE; -} - HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) { switch (pChunk->fccID) { @@ -466,154 +452,6 @@ const char *debugstr_dmguid (const GUID *id) { return debugstr_guid(id); } -/* returns name of given error code */ -const char *debugstr_dmreturn (DWORD code) { - static const flag_info codes[] = { - FE(S_OK), - FE(S_FALSE), - FE(DMUS_S_PARTIALLOAD), - FE(DMUS_S_PARTIALDOWNLOAD), - FE(DMUS_S_REQUEUE), - FE(DMUS_S_FREE), - FE(DMUS_S_END), - FE(DMUS_S_STRING_TRUNCATED), - FE(DMUS_S_LAST_TOOL), - FE(DMUS_S_OVER_CHORD), - FE(DMUS_S_UP_OCTAVE), - FE(DMUS_S_DOWN_OCTAVE), - FE(DMUS_S_NOBUFFERCONTROL), - FE(DMUS_S_GARBAGE_COLLECTED), - FE(E_NOTIMPL), - FE(E_NOINTERFACE), - FE(E_POINTER), - FE(CLASS_E_NOAGGREGATION), - FE(CLASS_E_CLASSNOTAVAILABLE), - FE(REGDB_E_CLASSNOTREG), - FE(E_OUTOFMEMORY), - FE(E_FAIL), - FE(E_INVALIDARG), - FE(DMUS_E_DRIVER_FAILED), - FE(DMUS_E_PORTS_OPEN), - FE(DMUS_E_DEVICE_IN_USE), - FE(DMUS_E_INSUFFICIENTBUFFER), - FE(DMUS_E_BUFFERNOTSET), - FE(DMUS_E_BUFFERNOTAVAILABLE), - FE(DMUS_E_NOTADLSCOL), - FE(DMUS_E_INVALIDOFFSET), - FE(DMUS_E_ALREADY_LOADED), - FE(DMUS_E_INVALIDPOS), - FE(DMUS_E_INVALIDPATCH), - FE(DMUS_E_CANNOTSEEK), - FE(DMUS_E_CANNOTWRITE), - FE(DMUS_E_CHUNKNOTFOUND), - FE(DMUS_E_INVALID_DOWNLOADID), - FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), - FE(DMUS_E_ALREADY_DOWNLOADED), - FE(DMUS_E_UNKNOWN_PROPERTY), - FE(DMUS_E_SET_UNSUPPORTED), - FE(DMUS_E_GET_UNSUPPORTED), - FE(DMUS_E_NOTMONO), - FE(DMUS_E_BADARTICULATION), - FE(DMUS_E_BADINSTRUMENT), - FE(DMUS_E_BADWAVELINK), - FE(DMUS_E_NOARTICULATION), - FE(DMUS_E_NOTPCM), - FE(DMUS_E_BADWAVE), - FE(DMUS_E_BADOFFSETTABLE), - FE(DMUS_E_UNKNOWNDOWNLOAD), - FE(DMUS_E_NOSYNTHSINK), - FE(DMUS_E_ALREADYOPEN), - FE(DMUS_E_ALREADYCLOSED), - FE(DMUS_E_SYNTHNOTCONFIGURED), - FE(DMUS_E_SYNTHACTIVE), - FE(DMUS_E_CANNOTREAD), - FE(DMUS_E_DMUSIC_RELEASED), - FE(DMUS_E_BUFFER_EMPTY), - FE(DMUS_E_BUFFER_FULL), - FE(DMUS_E_PORT_NOT_CAPTURE), - FE(DMUS_E_PORT_NOT_RENDER), - FE(DMUS_E_DSOUND_NOT_SET), - FE(DMUS_E_ALREADY_ACTIVATED), - FE(DMUS_E_INVALIDBUFFER), - FE(DMUS_E_WAVEFORMATNOTSUPPORTED), - FE(DMUS_E_SYNTHINACTIVE), - FE(DMUS_E_DSOUND_ALREADY_SET), - FE(DMUS_E_INVALID_EVENT), - FE(DMUS_E_UNSUPPORTED_STREAM), - FE(DMUS_E_ALREADY_INITED), - FE(DMUS_E_INVALID_BAND), - FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), - FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), - FE(DMUS_E_INVALID_TRACK_HDR), - FE(DMUS_E_INVALID_TOOL_HDR), - FE(DMUS_E_ALL_TOOLS_FAILED), - FE(DMUS_E_ALL_TRACKS_FAILED), - FE(DMUS_E_NOT_FOUND), - FE(DMUS_E_NOT_INIT), - FE(DMUS_E_TYPE_DISABLED), - FE(DMUS_E_TYPE_UNSUPPORTED), - FE(DMUS_E_TIME_PAST), - FE(DMUS_E_TRACK_NOT_FOUND), - FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), - FE(DMUS_E_NO_MASTER_CLOCK), - FE(DMUS_E_LOADER_NOCLASSID), - FE(DMUS_E_LOADER_BADPATH), - FE(DMUS_E_LOADER_FAILEDOPEN), - FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), - FE(DMUS_E_LOADER_FAILEDCREATE), - FE(DMUS_E_LOADER_OBJECTNOTFOUND), - FE(DMUS_E_LOADER_NOFILENAME), - FE(DMUS_E_INVALIDFILE), - FE(DMUS_E_ALREADY_EXISTS), - FE(DMUS_E_OUT_OF_RANGE), - FE(DMUS_E_SEGMENT_INIT_FAILED), - FE(DMUS_E_ALREADY_SENT), - FE(DMUS_E_CANNOT_FREE), - FE(DMUS_E_CANNOT_OPEN_PORT), - FE(DMUS_E_CANNOT_CONVERT), - FE(DMUS_E_DESCEND_CHUNK_FAIL), - FE(DMUS_E_NOT_LOADED), - FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), - FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), - FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), - FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), - FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), - FE(DMUS_E_SCRIPT_INVALID_FILE), - FE(DMUS_E_INVALID_SCRIPTTRACK), - FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), - FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), - FE(DMUS_E_SCRIPT_CONTENT_READONLY), - FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), - FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), - FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), - FE(DMUS_E_INVALID_LYRICSTRACK), - FE(DMUS_E_INVALID_PARAMCONTROLTRACK), - FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), - FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), - FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), - FE(DMUS_E_AUDIOPATHS_NOT_VALID), - FE(DMUS_E_AUDIOPATHS_IN_USE), - FE(DMUS_E_NO_AUDIOPATH_CONFIG), - FE(DMUS_E_AUDIOPATH_INACTIVE), - FE(DMUS_E_AUDIOPATH_NOBUFFER), - FE(DMUS_E_AUDIOPATH_NOPORT), - FE(DMUS_E_NO_AUDIOPATH), - FE(DMUS_E_INVALIDCHUNK), - FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), - FE(DMUS_E_INVALID_CONTAINER_OBJECT) - }; - - unsigned int i; - for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { - if (code == codes[i].val) - return codes[i].name; - } - - /* if we didn't find it, return value */ - return wine_dbg_sprintf("0x%08X", code); -} - - /* generic flag-dumping function */ static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ static char buffer[128] = "", *ptr = &buffer[0]; @@ -652,22 +490,6 @@ static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); } -/* dump DMUS_CONTAINER flags */ -static const char *debugstr_DMUS_CONTAINER_FLAGS (DWORD flagmask) { - static const flag_info flags[] = { - FE(DMUS_CONTAINER_NOLOADS) - }; - return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); -} - -/* dump DMUS_CONTAINED_OBJF flags */ -static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) { - static const flag_info flags[] = { - FE(DMUS_CONTAINED_OBJF_KEEP) - }; - return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); -} - const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { if (pDesc) { char buffer[1024], *ptr = buffer; @@ -691,52 +513,3 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { return wine_dbg_sprintf("(NULL)"); } } - -void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { - if (pDesc) { - TRACE("DMUS_OBJECTDESC (%p):\n", pDesc); - TRACE(" - dwSize = %d\n", pDesc->dwSize); - TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData)); - if (pDesc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(pDesc->wszName)); - if (pDesc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass)); - if (pDesc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject)); - if (pDesc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = FIXME\n"); - if (pDesc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion)); - if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory)); - if (pDesc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName)); - if (pDesc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s\n - pbMemData = %p\n", - wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData); - if (pDesc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", pDesc->pStream); - } else { - TRACE("(NULL)\n"); - } -} - -const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) { - if (pHeader) { - char buffer[1024], *ptr = buffer; - - ptr += sprintf(ptr, "DMUS_IO_CONTAINER_HEADER (%p):\n", pHeader); - ptr += sprintf(ptr, " - dwFlags = %s\n", debugstr_DMUS_CONTAINER_FLAGS(pHeader->dwFlags)); - - return wine_dbg_sprintf("%s", buffer); - } else { - return wine_dbg_sprintf("(NULL)"); - } -} - -const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader) { - if (pHeader) { - char buffer[1024], *ptr = buffer; - - ptr += sprintf(ptr, "DMUS_IO_CONTAINED_OBJECT_HEADER (%p):\n", pHeader); - ptr += sprintf(ptr, " - guidClassID = %s\n", debugstr_dmguid(&pHeader->guidClassID)); - ptr += sprintf(ptr, " - dwFlags = %s\n", debugstr_DMUS_CONTAINED_OBJF_FLAGS (pHeader->dwFlags)); - ptr += sprintf(ptr, " - ckid = %s\n", debugstr_fourcc (pHeader->ckid)); - ptr += sprintf(ptr, " - fccType = %s\n", debugstr_fourcc (pHeader->fccType)); - - return wine_dbg_sprintf("%s", buffer); - } else { - return wine_dbg_sprintf("(NULL)"); - } -} diff --git a/dlls/dmime/dmutils.h b/dlls/dmime/dmutils.h index ece4e45bf96..8a2b6e6428c 100644 --- a/dlls/dmime/dmutils.h +++ b/dlls/dmime/dmutils.h @@ -60,21 +60,12 @@ typedef struct { #define FE(x) { x, #x } #define GE(x) { &x, #x } -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -extern int even_or_odd (DWORD number); -/* check whether chunkID is valid dmobject form chunk */ -extern BOOL IS_VALID_DMFORM (FOURCC chunkID); /* FOURCC to string conversion for debug messages */ extern const char *debugstr_fourcc (DWORD fourcc); /* returns name of given GUID */ extern const char *debugstr_dmguid (const GUID *id); -/* returns name of given error code */ -extern const char *debugstr_dmreturn (DWORD code); /* dump whole DMUS_OBJECTDESC struct */ extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); -extern void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); -extern const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader); -extern const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader); #endif /* __WINE_DMUTILS_H */ diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c index 10cc1d9b7f6..09e9b0db9fb 100644 --- a/dlls/dmloader/container.c +++ b/dlls/dmloader/container.c @@ -35,6 +35,46 @@ static ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_AddRef (LPPERSISTST * IDirectMusicContainerImpl implementation */ /* IUnknown/IDirectMusicContainer part: */ + +static HRESULT DMUSIC_DestroyDirectMusicContainerImpl (LPDIRECTMUSICCONTAINER iface) { + ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); + LPDIRECTMUSICLOADER pLoader; + LPDIRECTMUSICGETLOADER pGetLoader; + struct list *pEntry; + LPWINE_CONTAINER_ENTRY pContainedObject; + + /* get loader (from stream we loaded from) */ + TRACE(": getting loader\n"); + IStream_QueryInterface (This->pStream, &IID_IDirectMusicGetLoader, (LPVOID*)&pGetLoader); + IDirectMusicGetLoader_GetLoader (pGetLoader, &pLoader); + IDirectMusicGetLoader_Release (pGetLoader); + + /* release objects from loader's cache (if appropriate) */ + TRACE(": releasing objects from loader's cache\n"); + LIST_FOR_EACH (pEntry, This->pContainedObjects) { + pContainedObject = LIST_ENTRY (pEntry, WINE_CONTAINER_ENTRY, entry); + /* my tests indicate that container releases objects *only* + if they were loaded at its load-time (makes sense, it doesn't + have pointers to objects otherwise); BTW: native container seems + to ignore the flags (I won't) */ + if (pContainedObject->pObject && !(pContainedObject->dwFlags & DMUS_CONTAINED_OBJF_KEEP)) { + /* flags say it shouldn't be kept in loader's cache */ + IDirectMusicLoader_ReleaseObject (pLoader, pContainedObject->pObject); + } + } + IDirectMusicLoader_Release (pLoader); + + /* release stream we loaded from */ + IStream_Release (This->pStream); + + /* FIXME: release allocated entries */ + + /* decrease number of instances */ + InterlockedDecrement (&dwDirectMusicContainer); + + return S_OK; +} + static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); @@ -904,42 +944,3 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID* p return IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface ((LPDIRECTMUSICCONTAINER)&obj->ContainerVtbl, lpcGUID, ppobj); } - -HRESULT WINAPI DMUSIC_DestroyDirectMusicContainerImpl (LPDIRECTMUSICCONTAINER iface) { - ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); - LPDIRECTMUSICLOADER pLoader; - LPDIRECTMUSICGETLOADER pGetLoader; - struct list *pEntry; - LPWINE_CONTAINER_ENTRY pContainedObject; - - /* get loader (from stream we loaded from) */ - TRACE(": getting loader\n"); - IStream_QueryInterface (This->pStream, &IID_IDirectMusicGetLoader, (LPVOID*)&pGetLoader); - IDirectMusicGetLoader_GetLoader (pGetLoader, &pLoader); - IDirectMusicGetLoader_Release (pGetLoader); - - /* release objects from loader's cache (if appropriate) */ - TRACE(": releasing objects from loader's cache\n"); - LIST_FOR_EACH (pEntry, This->pContainedObjects) { - pContainedObject = LIST_ENTRY (pEntry, WINE_CONTAINER_ENTRY, entry); - /* my tests indicate that container releases objects *only* - if they were loaded at its load-time (makes sense, it doesn't - have pointers to objects otherwise); BTW: native container seems - to ignore the flags (I won't) */ - if (pContainedObject->pObject && !(pContainedObject->dwFlags & DMUS_CONTAINED_OBJF_KEEP)) { - /* flags say it shouldn't be kept in loader's cache */ - IDirectMusicLoader_ReleaseObject (pLoader, pContainedObject->pObject); - } - } - IDirectMusicLoader_Release (pLoader); - - /* release stream we loaded from */ - IStream_Release (This->pStream); - - /* FIXME: release allocated entries */ - - /* decrease number of instances */ - InterlockedDecrement (&dwDirectMusicContainer); - - return S_OK; -} diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c index db85d76f350..95c5df26ba8 100644 --- a/dlls/dmloader/debug.c +++ b/dlls/dmloader/debug.c @@ -22,11 +22,6 @@ #include "dmloader_private.h" -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -int even_or_odd (DWORD number) { - return (number & 0x1); /* basically, check if bit 0 is set ;) */ -} - /* figures out whether given FOURCC is valid DirectMusic form ID */ BOOL IS_VALID_DMFORM (FOURCC chunkID) { if ((chunkID == DMUS_FOURCC_AUDIOPATH_FORM) || (chunkID == DMUS_FOURCC_BAND_FORM) || (chunkID == DMUS_FOURCC_CHORDMAP_FORM) diff --git a/dlls/dmloader/debug.h b/dlls/dmloader/debug.h index 6831dc4d1ea..56cfb72f405 100644 --- a/dlls/dmloader/debug.h +++ b/dlls/dmloader/debug.h @@ -41,8 +41,6 @@ typedef struct { #define FE(x) { x, #x } #define GE(x) { &x, #x } -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -extern int even_or_odd (DWORD number); /* check whether chunkID is valid dmobject form chunk */ extern BOOL IS_VALID_DMFORM (FOURCC chunkID); /* translate STREAM_SEEK flag to string */ diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h index bb2c5293749..3b099728ce1 100644 --- a/dlls/dmloader/dmloader_private.h +++ b/dlls/dmloader/dmloader_private.h @@ -68,10 +68,7 @@ extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderCF (LPCGUID lpcGUID, LPVOID extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerCF (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderImpl (LPDIRECTMUSICLOADER8 iface); extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DMUSIC_DestroyDirectMusicContainerImpl(LPDIRECTMUSICCONTAINER iface); - extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID *ppobj); extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID *ppobj); extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderGenericStream (LPVOID *ppobj); @@ -174,7 +171,6 @@ struct IDirectMusicLoaderFileStream { /* Custom: */ extern HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFile, LPDIRECTMUSICLOADER8 pLoader); -extern void WINAPI IDirectMusicLoaderFileStream_Detach (LPSTREAM iface); /***************************************************************************** * IDirectMusicLoaderResourceStream implementation structure @@ -196,7 +192,6 @@ struct IDirectMusicLoaderResourceStream { /* Custom: */ extern HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE pbMemData, LONGLONG llMemLength, LONGLONG llPos, LPDIRECTMUSICLOADER8 pLoader); -extern void WINAPI IDirectMusicLoaderResourceStream_Detach (LPSTREAM iface); /***************************************************************************** * IDirectMusicLoaderGenericStream implementation structure @@ -215,7 +210,6 @@ struct IDirectMusicLoaderGenericStream { /* Custom: */ extern HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER8 pLoader); -extern void WINAPI IDirectMusicLoaderGenericStream_Detach (LPSTREAM iface); /***************************************************************************** * Misc. @@ -226,12 +220,6 @@ typedef struct _WINE_CHUNK { DWORD dwSize; /* size of the chunk */ } WINE_CHUNK, *LPWINE_CHUNK; -extern HRESULT WINAPI DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]); -extern HRESULT WINAPI DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache); -extern HRESULT WINAPI DMUSIC_InitLoaderSettings (LPDIRECTMUSICLOADER8 iface); -extern HRESULT WINAPI DMUSIC_CopyDescriptor (LPDMUS_OBJECTDESC pDst, LPDMUS_OBJECTDESC pSrc); -extern BOOL WINAPI DMUSIC_IsValidLoadableClass (REFCLSID pClassID); - #include "debug.h" #endif /* __WINE_DMLOADER_PRIVATE_H */ diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 1a6d0950f94..f97a2308e29 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -21,13 +21,53 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmloader); -static HRESULT WINAPI DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache); +static HRESULT DMUSIC_InitLoaderSettings (LPDIRECTMUSICLOADER8 iface); +static HRESULT DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache); +static HRESULT DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache); + +static HRESULT DMUSIC_CopyDescriptor (LPDMUS_OBJECTDESC pDst, LPDMUS_OBJECTDESC pSrc) { + TRACE(": copy \n%s", debugstr_DMUS_OBJECTDESC(pSrc)); + /* copy field by field */ + if (pSrc->dwValidData & DMUS_OBJ_CLASS) pDst->guidClass = pSrc->guidClass; + if (pSrc->dwValidData & DMUS_OBJ_OBJECT) pDst->guidObject = pSrc->guidObject; + if (pSrc->dwValidData & DMUS_OBJ_DATE) pDst->ftDate = pSrc->ftDate; + if (pSrc->dwValidData & DMUS_OBJ_VERSION) pDst->vVersion = pSrc->vVersion; + if (pSrc->dwValidData & DMUS_OBJ_NAME) strcpyW (pDst->wszName, pSrc->wszName); + if (pSrc->dwValidData & DMUS_OBJ_CATEGORY) strcpyW (pDst->wszCategory, pSrc->wszCategory); + if (pSrc->dwValidData & DMUS_OBJ_FILENAME) strcpyW (pDst->wszFileName, pSrc->wszFileName); + if (pSrc->dwValidData & DMUS_OBJ_STREAM) IStream_Clone (pSrc->pStream, &pDst->pStream); + if (pSrc->dwValidData & DMUS_OBJ_MEMORY) { + pDst->pbMemData = pSrc->pbMemData; + pDst->llMemLength = pSrc->llMemLength; + } + /* set flags */ + pDst->dwValidData |= pSrc->dwValidData; + return S_OK; +} + + +static BOOL DMUSIC_IsValidLoadableClass (REFCLSID pClassID) { + if (IsEqualCLSID(pClassID, &CLSID_DirectMusicAudioPathConfig) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicBand) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicContainer) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicCollection) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicChordMap) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicSegment) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicScript) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicSong) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicStyle) || + IsEqualCLSID(pClassID, &CLSID_DirectMusicGraph) || + IsEqualCLSID(pClassID, &CLSID_DirectSoundWave) || + IsEqualCLSID(pClassID, &GUID_DirectMusicAllTypes)) + return TRUE; + else + return FALSE; +} /***************************************************************************** * IDirectMusicLoaderImpl implementation */ /* IUnknown/IDirectMusicLoader(8) part: */ -static ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_AddRef (LPDIRECTMUSICLOADER8 iface); static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); @@ -36,7 +76,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface ( if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IDirectMusicLoader) || IsEqualIID (riid, &IID_IDirectMusicLoader8)) { - IDirectMusicLoaderImpl_IDirectMusicLoader_AddRef (iface); + IDirectMusicLoader_AddRef (iface); *ppobj = This; return S_OK; } @@ -57,8 +97,16 @@ static ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_Release (LPDIRECTM DWORD dwRef = InterlockedDecrement (&This->dwRef); TRACE("(%p): ReleaseRef to %d\n", This, This->dwRef); if (dwRef == 0) { - DMUSIC_DestroyDirectMusicLoaderImpl (iface); - HeapFree (GetProcessHeap(), 0, This); + /* firstly, release the cache */ + IDirectMusicLoader8_ClearCache (iface, &GUID_DirectMusicAllTypes); + /* FIXME: release all allocated entries */ + /* destroy critical section */ + /*This->CritSect.DebugInfo->Spare[0] = 0; + DeleteCriticalSection (&This->CritSect); */ + HeapFree (GetProcessHeap(), 0, This); + + /* decrease number of instances */ + InterlockedDecrement (&dwDirectMusicLoader); } return dwRef; @@ -788,6 +836,23 @@ static const IDirectMusicLoader8Vtbl DirectMusicLoader_Loader_Vtbl = { IDirectMusicLoaderImpl_IDirectMusicLoader_LoadObjectFromFile }; +/* help function for DMUSIC_SetDefaultDLS */ +static HRESULT DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]) { + HKEY hkDM; + DWORD returnType, sizeOfReturnBuffer = MAX_PATH; + char szPath[MAX_PATH]; + + if ((RegOpenKeyExA (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\DirectMusic" , 0, KEY_READ, &hkDM) != ERROR_SUCCESS) || + (RegQueryValueExA (hkDM, "GMFilePath", NULL, &returnType, (LPBYTE) szPath, &sizeOfReturnBuffer) != ERROR_SUCCESS)) { + WARN(": registry entry missing\n" ); + return E_FAIL; + } + /* FIXME: Check return types to ensure we're interpreting data right */ + MultiByteToWideChar (CP_ACP, 0, szPath, -1, wszPath, MAX_PATH); + + return S_OK; +} + /* for ClassFactory */ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) { IDirectMusicLoaderImpl *obj; @@ -838,43 +903,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppob return IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface ((LPDIRECTMUSICLOADER8)obj, lpcGUID, ppobj); } -HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderImpl (LPDIRECTMUSICLOADER8 iface) { - ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); - - TRACE("(%p)\n", This); - - /* firstly, release the cache */ - IDirectMusicLoader8_ClearCache (iface, &GUID_DirectMusicAllTypes); - /* FIXME: release all allocated entries */ - /* destroy critical section */ - /*This->CritSect.DebugInfo->Spare[0] = 0; - DeleteCriticalSection (&This->CritSect); */ - - /* decrease number of instances */ - InterlockedDecrement (&dwDirectMusicLoader); - - return S_OK; -} - -/* help function for DMUSIC_SetDefaultDLS */ -HRESULT WINAPI DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]) { - HKEY hkDM; - DWORD returnType, sizeOfReturnBuffer = MAX_PATH; - char szPath[MAX_PATH]; - - if ((RegOpenKeyExA (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\DirectMusic" , 0, KEY_READ, &hkDM) != ERROR_SUCCESS) || - (RegQueryValueExA (hkDM, "GMFilePath", NULL, &returnType, (LPBYTE) szPath, &sizeOfReturnBuffer) != ERROR_SUCCESS)) { - WARN(": registry entry missing\n" ); - return E_FAIL; - } - /* FIXME: Check return types to ensure we're interpreting data right */ - MultiByteToWideChar (CP_ACP, 0, szPath, -1, wszPath, MAX_PATH); - - return S_OK; -} - /* help function for retrieval of search path and caching option for certain class */ -HRESULT WINAPI DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache) { +static HRESULT DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); struct list *pEntry; TRACE(": (%p, %s, %p, %p)\n", This, debugstr_dmguid(pClassID), wszSearchPath, pbCache); @@ -893,7 +923,7 @@ HRESULT WINAPI DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pCl } /* help function for setting search path and caching option for certain class */ -static HRESULT WINAPI DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache) { +static HRESULT DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); struct list *pEntry; HRESULT result = S_FALSE; /* in case pClassID != GUID_DirectMusicAllTypes and not a valid CLSID */ @@ -916,7 +946,7 @@ static HRESULT WINAPI DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFG return result; } -HRESULT WINAPI DMUSIC_InitLoaderSettings (LPDIRECTMUSICLOADER8 iface) { +static HRESULT DMUSIC_InitLoaderSettings (LPDIRECTMUSICLOADER8 iface) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); /* hard-coded list of classes */ @@ -950,41 +980,3 @@ HRESULT WINAPI DMUSIC_InitLoaderSettings (LPDIRECTMUSICLOADER8 iface) { return S_OK; } - -HRESULT WINAPI DMUSIC_CopyDescriptor (LPDMUS_OBJECTDESC pDst, LPDMUS_OBJECTDESC pSrc) { - TRACE(": copy \n%s", debugstr_DMUS_OBJECTDESC(pSrc)); - /* copy field by field */ - if (pSrc->dwValidData & DMUS_OBJ_CLASS) pDst->guidClass = pSrc->guidClass; - if (pSrc->dwValidData & DMUS_OBJ_OBJECT) pDst->guidObject = pSrc->guidObject; - if (pSrc->dwValidData & DMUS_OBJ_DATE) pDst->ftDate = pSrc->ftDate; - if (pSrc->dwValidData & DMUS_OBJ_VERSION) pDst->vVersion = pSrc->vVersion; - if (pSrc->dwValidData & DMUS_OBJ_NAME) strcpyW (pDst->wszName, pSrc->wszName); - if (pSrc->dwValidData & DMUS_OBJ_CATEGORY) strcpyW (pDst->wszCategory, pSrc->wszCategory); - if (pSrc->dwValidData & DMUS_OBJ_FILENAME) strcpyW (pDst->wszFileName, pSrc->wszFileName); - if (pSrc->dwValidData & DMUS_OBJ_STREAM) IStream_Clone (pSrc->pStream, &pDst->pStream); - if (pSrc->dwValidData & DMUS_OBJ_MEMORY) { - pDst->pbMemData = pSrc->pbMemData; - pDst->llMemLength = pSrc->llMemLength; - } - /* set flags */ - pDst->dwValidData |= pSrc->dwValidData; - return S_OK; -} - -BOOL WINAPI DMUSIC_IsValidLoadableClass (REFCLSID pClassID) { - if (IsEqualCLSID(pClassID, &CLSID_DirectMusicAudioPathConfig) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicBand) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicContainer) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicCollection) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicChordMap) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicSegment) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicScript) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicSong) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicStyle) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicGraph) || - IsEqualCLSID(pClassID, &CLSID_DirectSoundWave) || - IsEqualCLSID(pClassID, &GUID_DirectMusicAllTypes)) - return TRUE; - else - return FALSE; -} diff --git a/dlls/dmloader/loaderstream.c b/dlls/dmloader/loaderstream.c index fb01cea3d83..da87403eb63 100644 --- a/dlls/dmloader/loaderstream.c +++ b/dlls/dmloader/loaderstream.c @@ -64,6 +64,14 @@ static ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_AddRef * IDirectMusicLoaderFileStream implementation */ /* Custom : */ + +static void IDirectMusicLoaderFileStream_Detach (LPSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); + TRACE("(%p)\n", This); + if (This->hFile != INVALID_HANDLE_VALUE) CloseHandle(This->hFile); + This->wzFileName[0] = '\0'; +} + HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFile, LPDIRECTMUSICLOADER8 pLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); TRACE("(%p, %s, %p)\n", This, debugstr_w(wzFile), pLoader); @@ -80,15 +88,6 @@ HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFi return S_OK; } -void WINAPI IDirectMusicLoaderFileStream_Detach (LPSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); - TRACE("(%p)\n", This); - if (This->hFile != INVALID_HANDLE_VALUE) { - CloseHandle(This->hFile); - } - This->wzFileName[0] = '\0'; -} - /* IUnknown/IStream part: */ static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { @@ -311,6 +310,15 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID* ppobj) { * IDirectMusicLoaderResourceStream implementation */ /* Custom : */ + +static void IDirectMusicLoaderResourceStream_Detach (LPSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); + TRACE("(%p)\n", This); + + This->pbMemData = NULL; + This->llMemLength = 0; +} + HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE pbMemData, LONGLONG llMemLength, LONGLONG llPos, LPDIRECTMUSICLOADER8 pLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); @@ -328,14 +336,6 @@ HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE p return S_OK; } -void WINAPI IDirectMusicLoaderResourceStream_Detach (LPSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); - TRACE("(%p)\n", This); - - This->pbMemData = NULL; - This->llMemLength = 0; -} - /* IUnknown/IStream part: */ static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { @@ -567,6 +567,15 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID* ppobj) { * IDirectMusicLoaderGenericStream implementation */ /* Custom : */ + +static void IDirectMusicLoaderGenericStream_Detach (LPSTREAM iface) { + ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); + + if (This->pStream) + IStream_Release (This->pStream); + This->pStream = NULL; +} + HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER8 pLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); @@ -587,14 +596,6 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM return S_OK; } -void WINAPI IDirectMusicLoaderGenericStream_Detach (LPSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); - - if (This->pStream) - IStream_Release (This->pStream); - This->pStream = NULL; -} - /* IUnknown/IStream part: */ static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { diff --git a/dlls/dmscript/dmscript_main.c b/dlls/dmscript/dmscript_main.c index c211aa7bfae..ae1cdbcc13b 100644 --- a/dlls/dmscript/dmscript_main.c +++ b/dlls/dmscript/dmscript_main.c @@ -633,10 +633,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) * * */ -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -int even_or_odd (DWORD number) { - return (number & 0x1); /* basically, check if bit 0 is set ;) */ -} /* FOURCC to string conversion for debug messages */ const char *debugstr_fourcc (DWORD fourcc) { @@ -647,7 +643,7 @@ const char *debugstr_fourcc (DWORD fourcc) { } /* DMUS_VERSION struct to string conversion for debug messages */ -const char *debugstr_dmversion (const DMUS_VERSION *version) { +static const char *debugstr_dmversion (const DMUS_VERSION *version) { if (!version) return "'null'"; return wine_dbg_sprintf ("\'%i,%i,%i,%i\'", (int)((version->dwVersionMS & 0xFFFF0000) >> 8), (int)(version->dwVersionMS & 0x0000FFFF), @@ -838,144 +834,8 @@ const char *debugstr_dmguid (const GUID *id) { return debugstr_guid(id); } -/* returns name of given error code */ -const char *debugstr_dmreturn (DWORD code) { - static const flag_info codes[] = { - FE(S_OK), - FE(S_FALSE), - FE(DMUS_S_PARTIALLOAD), - FE(DMUS_S_PARTIALDOWNLOAD), - FE(DMUS_S_REQUEUE), - FE(DMUS_S_FREE), - FE(DMUS_S_END), - FE(DMUS_S_STRING_TRUNCATED), - FE(DMUS_S_LAST_TOOL), - FE(DMUS_S_OVER_CHORD), - FE(DMUS_S_UP_OCTAVE), - FE(DMUS_S_DOWN_OCTAVE), - FE(DMUS_S_NOBUFFERCONTROL), - FE(DMUS_S_GARBAGE_COLLECTED), - FE(DMUS_E_DRIVER_FAILED), - FE(DMUS_E_PORTS_OPEN), - FE(DMUS_E_DEVICE_IN_USE), - FE(DMUS_E_INSUFFICIENTBUFFER), - FE(DMUS_E_BUFFERNOTSET), - FE(DMUS_E_BUFFERNOTAVAILABLE), - FE(DMUS_E_NOTADLSCOL), - FE(DMUS_E_INVALIDOFFSET), - FE(DMUS_E_ALREADY_LOADED), - FE(DMUS_E_INVALIDPOS), - FE(DMUS_E_INVALIDPATCH), - FE(DMUS_E_CANNOTSEEK), - FE(DMUS_E_CANNOTWRITE), - FE(DMUS_E_CHUNKNOTFOUND), - FE(DMUS_E_INVALID_DOWNLOADID), - FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), - FE(DMUS_E_ALREADY_DOWNLOADED), - FE(DMUS_E_UNKNOWN_PROPERTY), - FE(DMUS_E_SET_UNSUPPORTED), - FE(DMUS_E_GET_UNSUPPORTED), - FE(DMUS_E_NOTMONO), - FE(DMUS_E_BADARTICULATION), - FE(DMUS_E_BADINSTRUMENT), - FE(DMUS_E_BADWAVELINK), - FE(DMUS_E_NOARTICULATION), - FE(DMUS_E_NOTPCM), - FE(DMUS_E_BADWAVE), - FE(DMUS_E_BADOFFSETTABLE), - FE(DMUS_E_UNKNOWNDOWNLOAD), - FE(DMUS_E_NOSYNTHSINK), - FE(DMUS_E_ALREADYOPEN), - FE(DMUS_E_ALREADYCLOSED), - FE(DMUS_E_SYNTHNOTCONFIGURED), - FE(DMUS_E_SYNTHACTIVE), - FE(DMUS_E_CANNOTREAD), - FE(DMUS_E_DMUSIC_RELEASED), - FE(DMUS_E_BUFFER_EMPTY), - FE(DMUS_E_BUFFER_FULL), - FE(DMUS_E_PORT_NOT_CAPTURE), - FE(DMUS_E_PORT_NOT_RENDER), - FE(DMUS_E_DSOUND_NOT_SET), - FE(DMUS_E_ALREADY_ACTIVATED), - FE(DMUS_E_INVALIDBUFFER), - FE(DMUS_E_WAVEFORMATNOTSUPPORTED), - FE(DMUS_E_SYNTHINACTIVE), - FE(DMUS_E_DSOUND_ALREADY_SET), - FE(DMUS_E_INVALID_EVENT), - FE(DMUS_E_UNSUPPORTED_STREAM), - FE(DMUS_E_ALREADY_INITED), - FE(DMUS_E_INVALID_BAND), - FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), - FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), - FE(DMUS_E_INVALID_TRACK_HDR), - FE(DMUS_E_INVALID_TOOL_HDR), - FE(DMUS_E_ALL_TOOLS_FAILED), - FE(DMUS_E_ALL_TRACKS_FAILED), - FE(DMUS_E_NOT_FOUND), - FE(DMUS_E_NOT_INIT), - FE(DMUS_E_TYPE_DISABLED), - FE(DMUS_E_TYPE_UNSUPPORTED), - FE(DMUS_E_TIME_PAST), - FE(DMUS_E_TRACK_NOT_FOUND), - FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), - FE(DMUS_E_NO_MASTER_CLOCK), - FE(DMUS_E_LOADER_NOCLASSID), - FE(DMUS_E_LOADER_BADPATH), - FE(DMUS_E_LOADER_FAILEDOPEN), - FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), - FE(DMUS_E_LOADER_FAILEDCREATE), - FE(DMUS_E_LOADER_OBJECTNOTFOUND), - FE(DMUS_E_LOADER_NOFILENAME), - FE(DMUS_E_INVALIDFILE), - FE(DMUS_E_ALREADY_EXISTS), - FE(DMUS_E_OUT_OF_RANGE), - FE(DMUS_E_SEGMENT_INIT_FAILED), - FE(DMUS_E_ALREADY_SENT), - FE(DMUS_E_CANNOT_FREE), - FE(DMUS_E_CANNOT_OPEN_PORT), - FE(DMUS_E_CANNOT_CONVERT), - FE(DMUS_E_DESCEND_CHUNK_FAIL), - FE(DMUS_E_NOT_LOADED), - FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), - FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), - FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), - FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), - FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), - FE(DMUS_E_SCRIPT_INVALID_FILE), - FE(DMUS_E_INVALID_SCRIPTTRACK), - FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), - FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), - FE(DMUS_E_SCRIPT_CONTENT_READONLY), - FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), - FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), - FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), - FE(DMUS_E_INVALID_LYRICSTRACK), - FE(DMUS_E_INVALID_PARAMCONTROLTRACK), - FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), - FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), - FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), - FE(DMUS_E_AUDIOPATHS_NOT_VALID), - FE(DMUS_E_AUDIOPATHS_IN_USE), - FE(DMUS_E_NO_AUDIOPATH_CONFIG), - FE(DMUS_E_AUDIOPATH_INACTIVE), - FE(DMUS_E_AUDIOPATH_NOBUFFER), - FE(DMUS_E_AUDIOPATH_NOPORT), - FE(DMUS_E_NO_AUDIOPATH), - FE(DMUS_E_INVALIDCHUNK), - FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), - FE(DMUS_E_INVALID_CONTAINER_OBJECT) - }; - unsigned int i; - for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { - if (code == codes[i].val) - return codes[i].name; - } - /* if we didn't find it, return value */ - return wine_dbg_sprintf("0x%08x", code); -} - /* generic flag-dumping function */ -const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ +static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ char buffer[128] = "", *ptr = &buffer[0]; unsigned int i; int size = sizeof(buffer); @@ -995,7 +855,7 @@ const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_name } /* dump DMUS_OBJ flags */ -const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { +static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { static const flag_info flags[] = { FE(DMUS_OBJ_OBJECT), FE(DMUS_OBJ_CLASS), diff --git a/dlls/dmscript/dmscript_private.h b/dlls/dmscript/dmscript_private.h index 2d4f247d2d9..c152ecc4d75 100644 --- a/dlls/dmscript/dmscript_private.h +++ b/dlls/dmscript/dmscript_private.h @@ -129,19 +129,10 @@ typedef struct { #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -extern int even_or_odd (DWORD number); /* FOURCC to string conversion for debug messages */ extern const char *debugstr_fourcc (DWORD fourcc); -/* DMUS_VERSION struct to string conversion for debug messages */ -extern const char *debugstr_dmversion (const DMUS_VERSION *version); /* returns name of given GUID */ extern const char *debugstr_dmguid (const GUID *id); -/* returns name of given error code */ -extern const char *debugstr_dmreturn (DWORD code); -/* generic flags-dumping function */ -extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names); -extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask); /* dump whole DMUS_OBJECTDESC struct */ extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); diff --git a/dlls/dmstyle/dmutils.c b/dlls/dmstyle/dmutils.c index 7f6d37fe4cc..72014612e98 100644 --- a/dlls/dmstyle/dmutils.c +++ b/dlls/dmstyle/dmutils.c @@ -43,20 +43,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic); WINE_DECLARE_DEBUG_CHANNEL(dmfile); -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -int even_or_odd (DWORD number) { - return (number & 0x1); /* basically, check if bit 0 is set ;) */ -} - -/* figures out whether given FOURCC is valid DirectMusic form ID */ -BOOL IS_VALID_DMFORM (FOURCC chunkID) { - if ((chunkID == DMUS_FOURCC_AUDIOPATH_FORM) || (chunkID == DMUS_FOURCC_BAND_FORM) || (chunkID == DMUS_FOURCC_CHORDMAP_FORM) - || (chunkID == DMUS_FOURCC_CONTAINER_FORM) || (chunkID == FOURCC_DLS) || (chunkID == DMUS_FOURCC_SCRIPT_FORM) - || (chunkID == DMUS_FOURCC_SEGMENT_FORM) || (chunkID == DMUS_FOURCC_STYLE_FORM) || (chunkID == DMUS_FOURCC_TOOLGRAPH_FORM) - || (chunkID == DMUS_FOURCC_TRACK_FORM) || (chunkID == mmioFOURCC('W','A','V','E'))) return TRUE; - else return FALSE; -} - HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) { switch (pChunk->fccID) { @@ -231,20 +217,6 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, return S_OK; } -/* translate STREAM_SEEK flag to string */ -const char *resolve_STREAM_SEEK (DWORD flag) { - switch (flag) { - case STREAM_SEEK_SET: - return wine_dbg_sprintf ("STREAM_SEEK_SET"); - case STREAM_SEEK_CUR: - return wine_dbg_sprintf ("STREAM_SEEK_CUR"); - case STREAM_SEEK_END: - return wine_dbg_sprintf ("STREAM_SEEK_END"); - default: - return wine_dbg_sprintf ("()"); - } -} - /* FOURCC to string conversion for debug messages */ const char *debugstr_fourcc (DWORD fourcc) { if (!fourcc) return "'null'"; @@ -477,156 +449,8 @@ const char *debugstr_dmguid (const GUID *id) { return debugstr_guid(id); } -/* returns name of given error code */ -const char *debugstr_dmreturn (DWORD code) { - static const flag_info codes[] = { - FE(S_OK), - FE(S_FALSE), - FE(DMUS_S_PARTIALLOAD), - FE(DMUS_S_PARTIALDOWNLOAD), - FE(DMUS_S_REQUEUE), - FE(DMUS_S_FREE), - FE(DMUS_S_END), - FE(DMUS_S_STRING_TRUNCATED), - FE(DMUS_S_LAST_TOOL), - FE(DMUS_S_OVER_CHORD), - FE(DMUS_S_UP_OCTAVE), - FE(DMUS_S_DOWN_OCTAVE), - FE(DMUS_S_NOBUFFERCONTROL), - FE(DMUS_S_GARBAGE_COLLECTED), - FE(E_NOTIMPL), - FE(E_NOINTERFACE), - FE(E_POINTER), - FE(CLASS_E_NOAGGREGATION), - FE(CLASS_E_CLASSNOTAVAILABLE), - FE(REGDB_E_CLASSNOTREG), - FE(E_OUTOFMEMORY), - FE(E_FAIL), - FE(E_INVALIDARG), - FE(DMUS_E_DRIVER_FAILED), - FE(DMUS_E_PORTS_OPEN), - FE(DMUS_E_DEVICE_IN_USE), - FE(DMUS_E_INSUFFICIENTBUFFER), - FE(DMUS_E_BUFFERNOTSET), - FE(DMUS_E_BUFFERNOTAVAILABLE), - FE(DMUS_E_NOTADLSCOL), - FE(DMUS_E_INVALIDOFFSET), - FE(DMUS_E_ALREADY_LOADED), - FE(DMUS_E_INVALIDPOS), - FE(DMUS_E_INVALIDPATCH), - FE(DMUS_E_CANNOTSEEK), - FE(DMUS_E_CANNOTWRITE), - FE(DMUS_E_CHUNKNOTFOUND), - FE(DMUS_E_INVALID_DOWNLOADID), - FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), - FE(DMUS_E_ALREADY_DOWNLOADED), - FE(DMUS_E_UNKNOWN_PROPERTY), - FE(DMUS_E_SET_UNSUPPORTED), - FE(DMUS_E_GET_UNSUPPORTED), - FE(DMUS_E_NOTMONO), - FE(DMUS_E_BADARTICULATION), - FE(DMUS_E_BADINSTRUMENT), - FE(DMUS_E_BADWAVELINK), - FE(DMUS_E_NOARTICULATION), - FE(DMUS_E_NOTPCM), - FE(DMUS_E_BADWAVE), - FE(DMUS_E_BADOFFSETTABLE), - FE(DMUS_E_UNKNOWNDOWNLOAD), - FE(DMUS_E_NOSYNTHSINK), - FE(DMUS_E_ALREADYOPEN), - FE(DMUS_E_ALREADYCLOSED), - FE(DMUS_E_SYNTHNOTCONFIGURED), - FE(DMUS_E_SYNTHACTIVE), - FE(DMUS_E_CANNOTREAD), - FE(DMUS_E_DMUSIC_RELEASED), - FE(DMUS_E_BUFFER_EMPTY), - FE(DMUS_E_BUFFER_FULL), - FE(DMUS_E_PORT_NOT_CAPTURE), - FE(DMUS_E_PORT_NOT_RENDER), - FE(DMUS_E_DSOUND_NOT_SET), - FE(DMUS_E_ALREADY_ACTIVATED), - FE(DMUS_E_INVALIDBUFFER), - FE(DMUS_E_WAVEFORMATNOTSUPPORTED), - FE(DMUS_E_SYNTHINACTIVE), - FE(DMUS_E_DSOUND_ALREADY_SET), - FE(DMUS_E_INVALID_EVENT), - FE(DMUS_E_UNSUPPORTED_STREAM), - FE(DMUS_E_ALREADY_INITED), - FE(DMUS_E_INVALID_BAND), - FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), - FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), - FE(DMUS_E_INVALID_TRACK_HDR), - FE(DMUS_E_INVALID_TOOL_HDR), - FE(DMUS_E_ALL_TOOLS_FAILED), - FE(DMUS_E_ALL_TRACKS_FAILED), - FE(DMUS_E_NOT_FOUND), - FE(DMUS_E_NOT_INIT), - FE(DMUS_E_TYPE_DISABLED), - FE(DMUS_E_TYPE_UNSUPPORTED), - FE(DMUS_E_TIME_PAST), - FE(DMUS_E_TRACK_NOT_FOUND), - FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), - FE(DMUS_E_NO_MASTER_CLOCK), - FE(DMUS_E_LOADER_NOCLASSID), - FE(DMUS_E_LOADER_BADPATH), - FE(DMUS_E_LOADER_FAILEDOPEN), - FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), - FE(DMUS_E_LOADER_FAILEDCREATE), - FE(DMUS_E_LOADER_OBJECTNOTFOUND), - FE(DMUS_E_LOADER_NOFILENAME), - FE(DMUS_E_INVALIDFILE), - FE(DMUS_E_ALREADY_EXISTS), - FE(DMUS_E_OUT_OF_RANGE), - FE(DMUS_E_SEGMENT_INIT_FAILED), - FE(DMUS_E_ALREADY_SENT), - FE(DMUS_E_CANNOT_FREE), - FE(DMUS_E_CANNOT_OPEN_PORT), - FE(DMUS_E_CANNOT_CONVERT), - FE(DMUS_E_DESCEND_CHUNK_FAIL), - FE(DMUS_E_NOT_LOADED), - FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), - FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), - FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), - FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), - FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), - FE(DMUS_E_SCRIPT_INVALID_FILE), - FE(DMUS_E_INVALID_SCRIPTTRACK), - FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), - FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), - FE(DMUS_E_SCRIPT_CONTENT_READONLY), - FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), - FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), - FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), - FE(DMUS_E_INVALID_LYRICSTRACK), - FE(DMUS_E_INVALID_PARAMCONTROLTRACK), - FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), - FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), - FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), - FE(DMUS_E_AUDIOPATHS_NOT_VALID), - FE(DMUS_E_AUDIOPATHS_IN_USE), - FE(DMUS_E_NO_AUDIOPATH_CONFIG), - FE(DMUS_E_AUDIOPATH_INACTIVE), - FE(DMUS_E_AUDIOPATH_NOBUFFER), - FE(DMUS_E_AUDIOPATH_NOPORT), - FE(DMUS_E_NO_AUDIOPATH), - FE(DMUS_E_INVALIDCHUNK), - FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), - FE(DMUS_E_INVALID_CONTAINER_OBJECT) - }; - - unsigned int i; - for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { - if (code == codes[i].val) - return codes[i].name; - } - - /* if we didn't find it, return value */ - return wine_dbg_sprintf("0x%08X", code); -} - - /* generic flag-dumping function */ -const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ +static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ static char buffer[128] = "", *ptr = &buffer[0]; unsigned int i; int size = sizeof(buffer); @@ -663,22 +487,6 @@ static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); } -/* dump DMUS_CONTAINER flags */ -static const char *debugstr_DMUS_CONTAINER_FLAGS (DWORD flagmask) { - static const flag_info flags[] = { - FE(DMUS_CONTAINER_NOLOADS) - }; - return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); -} - -/* dump DMUS_CONTAINED_OBJF flags */ -static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) { - static const flag_info flags[] = { - FE(DMUS_CONTAINED_OBJF_KEEP) - }; - return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); -} - const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { if (pDesc) { char buffer[1024], *ptr = buffer; @@ -702,52 +510,3 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { return wine_dbg_sprintf("(NULL)"); } } - -void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { - if (pDesc) { - TRACE("DMUS_OBJECTDESC (%p):\n", pDesc); - TRACE(" - dwSize = %d\n", pDesc->dwSize); - TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData)); - if (pDesc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(pDesc->wszName)); - if (pDesc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass)); - if (pDesc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject)); - if (pDesc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = FIXME\n"); - if (pDesc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion)); - if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory)); - if (pDesc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName)); - if (pDesc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s\n - pbMemData = %p\n", - wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData); - if (pDesc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", pDesc->pStream); - } else { - TRACE("(NULL)\n"); - } -} - -const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) { - if (pHeader) { - char buffer[1024], *ptr = buffer; - - ptr += sprintf(ptr, "DMUS_IO_CONTAINER_HEADER (%p):\n", pHeader); - ptr += sprintf(ptr, " - dwFlags = %s\n", debugstr_DMUS_CONTAINER_FLAGS(pHeader->dwFlags)); - - return wine_dbg_sprintf("%s", buffer); - } else { - return wine_dbg_sprintf("(NULL)"); - } -} - -const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader) { - if (pHeader) { - char buffer[1024], *ptr = buffer; - - ptr += sprintf(ptr, "DMUS_IO_CONTAINED_OBJECT_HEADER (%p):\n", pHeader); - ptr += sprintf(ptr, " - guidClassID = %s\n", debugstr_dmguid(&pHeader->guidClassID)); - ptr += sprintf(ptr, " - dwFlags = %s\n", debugstr_DMUS_CONTAINED_OBJF_FLAGS (pHeader->dwFlags)); - ptr += sprintf(ptr, " - ckid = %s\n", debugstr_fourcc (pHeader->ckid)); - ptr += sprintf(ptr, " - fccType = %s\n", debugstr_fourcc (pHeader->fccType)); - - return wine_dbg_sprintf("%s", buffer); - } else { - return wine_dbg_sprintf("(NULL)"); - } -} diff --git a/dlls/dmstyle/dmutils.h b/dlls/dmstyle/dmutils.h index 3a435dbdc1c..8a2b6e6428c 100644 --- a/dlls/dmstyle/dmutils.h +++ b/dlls/dmstyle/dmutils.h @@ -60,25 +60,12 @@ typedef struct { #define FE(x) { x, #x } #define GE(x) { &x, #x } -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -extern int even_or_odd (DWORD number); -/* check whether chunkID is valid dmobject form chunk */ -extern BOOL IS_VALID_DMFORM (FOURCC chunkID); -/* translate STREAM_SEEK flag to string */ -extern const char *resolve_STREAM_SEEK (DWORD flag); /* FOURCC to string conversion for debug messages */ extern const char *debugstr_fourcc (DWORD fourcc); /* returns name of given GUID */ extern const char *debugstr_dmguid (const GUID *id); -/* returns name of given error code */ -extern const char *debugstr_dmreturn (DWORD code); -/* generic flags-dumping function */ -extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names); /* dump whole DMUS_OBJECTDESC struct */ extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); -extern void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); -extern const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader); -extern const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader); #endif /* __WINE_DMUTILS_H */ diff --git a/dlls/dmsynth/dmsynth_main.c b/dlls/dmsynth/dmsynth_main.c index 0a525446bf3..6967e0c6903 100644 --- a/dlls/dmsynth/dmsynth_main.c +++ b/dlls/dmsynth/dmsynth_main.c @@ -186,22 +186,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) * */ -/* FOURCC to string conversion for debug messages */ -const char *debugstr_fourcc (DWORD fourcc) { - if (!fourcc) return "'null'"; - return wine_dbg_sprintf ("\'%c%c%c%c\'", - (char)(fourcc), (char)(fourcc >> 8), - (char)(fourcc >> 16), (char)(fourcc >> 24)); -} - -/* DMUS_VERSION struct to string conversion for debug messages */ -const char *debugstr_dmversion (LPDMUS_VERSION version) { - if (!version) return "'null'"; - return wine_dbg_sprintf ("\'%i,%i,%i,%i\'", - (int)((version->dwVersionMS & 0xFFFF0000) >> 8), (int)(version->dwVersionMS & 0x0000FFFF), - (int)((version->dwVersionLS & 0xFFFF0000) >> 8), (int)(version->dwVersionLS & 0x0000FFFF)); -} - /* returns name of given GUID */ const char *debugstr_dmguid (const GUID *id) { static const guid_info guids[] = { @@ -385,159 +369,3 @@ const char *debugstr_dmguid (const GUID *id) { /* if we didn't find it, act like standard debugstr_guid */ return debugstr_guid(id); } - -/* returns name of given error code */ -const char *debugstr_dmreturn (DWORD code) { - static const flag_info codes[] = { - FE(S_OK), - FE(S_FALSE), - FE(DMUS_S_PARTIALLOAD), - FE(DMUS_S_PARTIALDOWNLOAD), - FE(DMUS_S_REQUEUE), - FE(DMUS_S_FREE), - FE(DMUS_S_END), - FE(DMUS_S_STRING_TRUNCATED), - FE(DMUS_S_LAST_TOOL), - FE(DMUS_S_OVER_CHORD), - FE(DMUS_S_UP_OCTAVE), - FE(DMUS_S_DOWN_OCTAVE), - FE(DMUS_S_NOBUFFERCONTROL), - FE(DMUS_S_GARBAGE_COLLECTED), - FE(DMUS_E_DRIVER_FAILED), - FE(DMUS_E_PORTS_OPEN), - FE(DMUS_E_DEVICE_IN_USE), - FE(DMUS_E_INSUFFICIENTBUFFER), - FE(DMUS_E_BUFFERNOTSET), - FE(DMUS_E_BUFFERNOTAVAILABLE), - FE(DMUS_E_NOTADLSCOL), - FE(DMUS_E_INVALIDOFFSET), - FE(DMUS_E_ALREADY_LOADED), - FE(DMUS_E_INVALIDPOS), - FE(DMUS_E_INVALIDPATCH), - FE(DMUS_E_CANNOTSEEK), - FE(DMUS_E_CANNOTWRITE), - FE(DMUS_E_CHUNKNOTFOUND), - FE(DMUS_E_INVALID_DOWNLOADID), - FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), - FE(DMUS_E_ALREADY_DOWNLOADED), - FE(DMUS_E_UNKNOWN_PROPERTY), - FE(DMUS_E_SET_UNSUPPORTED), - FE(DMUS_E_GET_UNSUPPORTED), - FE(DMUS_E_NOTMONO), - FE(DMUS_E_BADARTICULATION), - FE(DMUS_E_BADINSTRUMENT), - FE(DMUS_E_BADWAVELINK), - FE(DMUS_E_NOARTICULATION), - FE(DMUS_E_NOTPCM), - FE(DMUS_E_BADWAVE), - FE(DMUS_E_BADOFFSETTABLE), - FE(DMUS_E_UNKNOWNDOWNLOAD), - FE(DMUS_E_NOSYNTHSINK), - FE(DMUS_E_ALREADYOPEN), - FE(DMUS_E_ALREADYCLOSED), - FE(DMUS_E_SYNTHNOTCONFIGURED), - FE(DMUS_E_SYNTHACTIVE), - FE(DMUS_E_CANNOTREAD), - FE(DMUS_E_DMUSIC_RELEASED), - FE(DMUS_E_BUFFER_EMPTY), - FE(DMUS_E_BUFFER_FULL), - FE(DMUS_E_PORT_NOT_CAPTURE), - FE(DMUS_E_PORT_NOT_RENDER), - FE(DMUS_E_DSOUND_NOT_SET), - FE(DMUS_E_ALREADY_ACTIVATED), - FE(DMUS_E_INVALIDBUFFER), - FE(DMUS_E_WAVEFORMATNOTSUPPORTED), - FE(DMUS_E_SYNTHINACTIVE), - FE(DMUS_E_DSOUND_ALREADY_SET), - FE(DMUS_E_INVALID_EVENT), - FE(DMUS_E_UNSUPPORTED_STREAM), - FE(DMUS_E_ALREADY_INITED), - FE(DMUS_E_INVALID_BAND), - FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), - FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), - FE(DMUS_E_INVALID_TRACK_HDR), - FE(DMUS_E_INVALID_TOOL_HDR), - FE(DMUS_E_ALL_TOOLS_FAILED), - FE(DMUS_E_ALL_TRACKS_FAILED), - FE(DMUS_E_NOT_FOUND), - FE(DMUS_E_NOT_INIT), - FE(DMUS_E_TYPE_DISABLED), - FE(DMUS_E_TYPE_UNSUPPORTED), - FE(DMUS_E_TIME_PAST), - FE(DMUS_E_TRACK_NOT_FOUND), - FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), - FE(DMUS_E_NO_MASTER_CLOCK), - FE(DMUS_E_LOADER_NOCLASSID), - FE(DMUS_E_LOADER_BADPATH), - FE(DMUS_E_LOADER_FAILEDOPEN), - FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), - FE(DMUS_E_LOADER_FAILEDCREATE), - FE(DMUS_E_LOADER_OBJECTNOTFOUND), - FE(DMUS_E_LOADER_NOFILENAME), - FE(DMUS_E_INVALIDFILE), - FE(DMUS_E_ALREADY_EXISTS), - FE(DMUS_E_OUT_OF_RANGE), - FE(DMUS_E_SEGMENT_INIT_FAILED), - FE(DMUS_E_ALREADY_SENT), - FE(DMUS_E_CANNOT_FREE), - FE(DMUS_E_CANNOT_OPEN_PORT), - FE(DMUS_E_CANNOT_CONVERT), - FE(DMUS_E_DESCEND_CHUNK_FAIL), - FE(DMUS_E_NOT_LOADED), - FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), - FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), - FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), - FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), - FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), - FE(DMUS_E_SCRIPT_INVALID_FILE), - FE(DMUS_E_INVALID_SCRIPTTRACK), - FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), - FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), - FE(DMUS_E_SCRIPT_CONTENT_READONLY), - FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), - FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), - FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), - FE(DMUS_E_INVALID_LYRICSTRACK), - FE(DMUS_E_INVALID_PARAMCONTROLTRACK), - FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), - FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), - FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), - FE(DMUS_E_AUDIOPATHS_NOT_VALID), - FE(DMUS_E_AUDIOPATHS_IN_USE), - FE(DMUS_E_NO_AUDIOPATH_CONFIG), - FE(DMUS_E_AUDIOPATH_INACTIVE), - FE(DMUS_E_AUDIOPATH_NOBUFFER), - FE(DMUS_E_AUDIOPATH_NOPORT), - FE(DMUS_E_NO_AUDIOPATH), - FE(DMUS_E_INVALIDCHUNK), - FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), - FE(DMUS_E_INVALID_CONTAINER_OBJECT) - }; - unsigned int i; - for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { - if (code == codes[i].val) - return codes[i].name; - } - /* if we didn't find it, return value */ - return wine_dbg_sprintf("0x%08x", code); -} - -/* generic flag-dumping function */ -const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ - char buffer[128] = "", *ptr = &buffer[0]; - unsigned int i; - int size = sizeof(buffer); - - for (i=0; i < num_names; i++) - { - if ((flags & names[i].val) || /* standard flag*/ - ((!flags) && (!names[i].val))) { /* zero value only */ - int cnt = snprintf(ptr, size, "%s ", names[i].name); - if (cnt < 0 || cnt >= size) break; - size -= cnt; - ptr += cnt; - } - } - - return wine_dbg_sprintf("%s", buffer); -} diff --git a/dlls/dmsynth/dmsynth_private.h b/dlls/dmsynth/dmsynth_private.h index 4298388e885..462514186fd 100644 --- a/dlls/dmsynth/dmsynth_private.h +++ b/dlls/dmsynth/dmsynth_private.h @@ -109,16 +109,7 @@ typedef struct { #define FE(x) { x, #x } #define GE(x) { &x, #x } -/* FOURCC to string conversion for debug messages */ -extern const char *debugstr_fourcc (DWORD fourcc); -/* DMUS_VERSION struct to string conversion for debug messages */ -extern const char *debugstr_dmversion (LPDMUS_VERSION version); /* returns name of given GUID */ extern const char *debugstr_dmguid (const GUID *id); -/* returns name of given error code */ -extern const char *debugstr_dmreturn (DWORD code); -/* generic flags-dumping function */ -extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names); - #endif /* __WINE_DMSYNTH_PRIVATE_H */ diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index f37f8f61b07..e2c8d2cd70d 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -230,23 +230,6 @@ static const IDirectMusic8Vtbl DirectMusic8_Vtbl = { IDirectMusic8Impl_SetExternalMasterClock }; -/* helper stuff */ -void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVOID lpContext) { - LPDMUS_PORTCAPS pPortCaps = (LPDMUS_PORTCAPS)lpContext; - - pPortCaps->dwSize = sizeof(DMUS_PORTCAPS); - pPortCaps->dwFlags = DMUS_PC_DLS | DMUS_PC_SOFTWARESYNTH | DMUS_PC_DIRECTSOUND | DMUS_PC_DLS2 | DMUS_PC_AUDIOPATH | DMUS_PC_WAVE; - pPortCaps->guidPort = *lpGUID; - pPortCaps->dwClass = DMUS_PC_OUTPUTCLASS; - pPortCaps->dwType = DMUS_PORT_WINMM_DRIVER; - pPortCaps->dwMemorySize = DMUS_PC_SYSTEMMEMORY; - pPortCaps->dwMaxChannelGroups = 2; - pPortCaps->dwMaxVoices = -1; - pPortCaps->dwMaxAudioChannels = -1; - pPortCaps->dwEffectFlags = DMUS_EFFECT_REVERB | DMUS_EFFECT_CHORUS | DMUS_EFFECT_DELAY; - MultiByteToWideChar (CP_ACP, 0, lpszDesc, -1, pPortCaps->wszDescription, sizeof(pPortCaps->wszDescription)/sizeof(WCHAR)); -} - /* for ClassFactory */ HRESULT WINAPI DMUSIC_CreateDirectMusicImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) { IDirectMusic8Impl *dmusic; diff --git a/dlls/dmusic/dmusic_main.c b/dlls/dmusic/dmusic_main.c index 89f8eb1cc31..5789e8ad028 100644 --- a/dlls/dmusic/dmusic_main.c +++ b/dlls/dmusic/dmusic_main.c @@ -219,7 +219,7 @@ const char *debugstr_fourcc (DWORD fourcc) { } /* DMUS_VERSION struct to string conversion for debug messages */ -const char *debugstr_dmversion (const DMUS_VERSION *version) { +static const char *debugstr_dmversion (const DMUS_VERSION *version) { if (!version) return "'null'"; return wine_dbg_sprintf ("\'%i,%i,%i,%i\'", (int)((version->dwVersionMS & 0xFFFF0000) >> 8), (int)(version->dwVersionMS & 0x0000FFFF), @@ -410,144 +410,8 @@ const char *debugstr_dmguid (const GUID *id) { return debugstr_guid(id); } -/* returns name of given error code */ -const char *debugstr_dmreturn (DWORD code) { - static const flag_info codes[] = { - FE(S_OK), - FE(S_FALSE), - FE(DMUS_S_PARTIALLOAD), - FE(DMUS_S_PARTIALDOWNLOAD), - FE(DMUS_S_REQUEUE), - FE(DMUS_S_FREE), - FE(DMUS_S_END), - FE(DMUS_S_STRING_TRUNCATED), - FE(DMUS_S_LAST_TOOL), - FE(DMUS_S_OVER_CHORD), - FE(DMUS_S_UP_OCTAVE), - FE(DMUS_S_DOWN_OCTAVE), - FE(DMUS_S_NOBUFFERCONTROL), - FE(DMUS_S_GARBAGE_COLLECTED), - FE(DMUS_E_DRIVER_FAILED), - FE(DMUS_E_PORTS_OPEN), - FE(DMUS_E_DEVICE_IN_USE), - FE(DMUS_E_INSUFFICIENTBUFFER), - FE(DMUS_E_BUFFERNOTSET), - FE(DMUS_E_BUFFERNOTAVAILABLE), - FE(DMUS_E_NOTADLSCOL), - FE(DMUS_E_INVALIDOFFSET), - FE(DMUS_E_ALREADY_LOADED), - FE(DMUS_E_INVALIDPOS), - FE(DMUS_E_INVALIDPATCH), - FE(DMUS_E_CANNOTSEEK), - FE(DMUS_E_CANNOTWRITE), - FE(DMUS_E_CHUNKNOTFOUND), - FE(DMUS_E_INVALID_DOWNLOADID), - FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), - FE(DMUS_E_ALREADY_DOWNLOADED), - FE(DMUS_E_UNKNOWN_PROPERTY), - FE(DMUS_E_SET_UNSUPPORTED), - FE(DMUS_E_GET_UNSUPPORTED), - FE(DMUS_E_NOTMONO), - FE(DMUS_E_BADARTICULATION), - FE(DMUS_E_BADINSTRUMENT), - FE(DMUS_E_BADWAVELINK), - FE(DMUS_E_NOARTICULATION), - FE(DMUS_E_NOTPCM), - FE(DMUS_E_BADWAVE), - FE(DMUS_E_BADOFFSETTABLE), - FE(DMUS_E_UNKNOWNDOWNLOAD), - FE(DMUS_E_NOSYNTHSINK), - FE(DMUS_E_ALREADYOPEN), - FE(DMUS_E_ALREADYCLOSED), - FE(DMUS_E_SYNTHNOTCONFIGURED), - FE(DMUS_E_SYNTHACTIVE), - FE(DMUS_E_CANNOTREAD), - FE(DMUS_E_DMUSIC_RELEASED), - FE(DMUS_E_BUFFER_EMPTY), - FE(DMUS_E_BUFFER_FULL), - FE(DMUS_E_PORT_NOT_CAPTURE), - FE(DMUS_E_PORT_NOT_RENDER), - FE(DMUS_E_DSOUND_NOT_SET), - FE(DMUS_E_ALREADY_ACTIVATED), - FE(DMUS_E_INVALIDBUFFER), - FE(DMUS_E_WAVEFORMATNOTSUPPORTED), - FE(DMUS_E_SYNTHINACTIVE), - FE(DMUS_E_DSOUND_ALREADY_SET), - FE(DMUS_E_INVALID_EVENT), - FE(DMUS_E_UNSUPPORTED_STREAM), - FE(DMUS_E_ALREADY_INITED), - FE(DMUS_E_INVALID_BAND), - FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), - FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), - FE(DMUS_E_INVALID_TRACK_HDR), - FE(DMUS_E_INVALID_TOOL_HDR), - FE(DMUS_E_ALL_TOOLS_FAILED), - FE(DMUS_E_ALL_TRACKS_FAILED), - FE(DMUS_E_NOT_FOUND), - FE(DMUS_E_NOT_INIT), - FE(DMUS_E_TYPE_DISABLED), - FE(DMUS_E_TYPE_UNSUPPORTED), - FE(DMUS_E_TIME_PAST), - FE(DMUS_E_TRACK_NOT_FOUND), - FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), - FE(DMUS_E_NO_MASTER_CLOCK), - FE(DMUS_E_LOADER_NOCLASSID), - FE(DMUS_E_LOADER_BADPATH), - FE(DMUS_E_LOADER_FAILEDOPEN), - FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), - FE(DMUS_E_LOADER_FAILEDCREATE), - FE(DMUS_E_LOADER_OBJECTNOTFOUND), - FE(DMUS_E_LOADER_NOFILENAME), - FE(DMUS_E_INVALIDFILE), - FE(DMUS_E_ALREADY_EXISTS), - FE(DMUS_E_OUT_OF_RANGE), - FE(DMUS_E_SEGMENT_INIT_FAILED), - FE(DMUS_E_ALREADY_SENT), - FE(DMUS_E_CANNOT_FREE), - FE(DMUS_E_CANNOT_OPEN_PORT), - FE(DMUS_E_CANNOT_CONVERT), - FE(DMUS_E_DESCEND_CHUNK_FAIL), - FE(DMUS_E_NOT_LOADED), - FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), - FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), - FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), - FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), - FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), - FE(DMUS_E_SCRIPT_INVALID_FILE), - FE(DMUS_E_INVALID_SCRIPTTRACK), - FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), - FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), - FE(DMUS_E_SCRIPT_CONTENT_READONLY), - FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), - FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), - FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), - FE(DMUS_E_INVALID_LYRICSTRACK), - FE(DMUS_E_INVALID_PARAMCONTROLTRACK), - FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), - FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), - FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), - FE(DMUS_E_AUDIOPATHS_NOT_VALID), - FE(DMUS_E_AUDIOPATHS_IN_USE), - FE(DMUS_E_NO_AUDIOPATH_CONFIG), - FE(DMUS_E_AUDIOPATH_INACTIVE), - FE(DMUS_E_AUDIOPATH_NOBUFFER), - FE(DMUS_E_AUDIOPATH_NOPORT), - FE(DMUS_E_NO_AUDIOPATH), - FE(DMUS_E_INVALIDCHUNK), - FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), - FE(DMUS_E_INVALID_CONTAINER_OBJECT) - }; - unsigned int i; - for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { - if (code == codes[i].val) - return codes[i].name; - } - /* if we didn't find it, return value */ - return wine_dbg_sprintf("0x%08x", code); -} - /* generic flag-dumping function */ -const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ +static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ char buffer[128] = "", *ptr = &buffer[0]; unsigned int i; int size = sizeof(buffer); @@ -567,7 +431,7 @@ const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_name } /* dump DMUS_OBJ flags */ -const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { +static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { static const flag_info flags[] = { FE(DMUS_OBJ_OBJECT), FE(DMUS_OBJ_CLASS), diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 541e44909a2..cda8d544db6 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -55,11 +55,6 @@ typedef struct IReferenceClockImpl IReferenceClockImpl; typedef struct IDirectMusicCollectionImpl IDirectMusicCollectionImpl; typedef struct IDirectMusicInstrumentImpl IDirectMusicInstrumentImpl; - -/***************************************************************************** - * Predeclare the interface implementation structures - */ -extern const IDirectMusicPortVtbl DirectMusicPort_Vtbl; /***************************************************************************** * Some stuff to make my life easier :=) @@ -255,11 +250,6 @@ extern LONG DMUSIC_refCount; static inline void DMUSIC_LockModule(void) { InterlockedIncrement( &DMUSIC_refCount ); } static inline void DMUSIC_UnlockModule(void) { InterlockedDecrement( &DMUSIC_refCount ); } -/***************************************************************************** - * Helper Functions - */ -void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVOID lpContext); - /***************************************************************************** * Misc. @@ -304,15 +294,8 @@ extern void Patch2MIDILOCALE (DWORD dwPatch, LPMIDILOCALE pLocale); extern int even_or_odd (DWORD number); /* FOURCC to string conversion for debug messages */ extern const char *debugstr_fourcc (DWORD fourcc); -/* DMUS_VERSION struct to string conversion for debug messages */ -extern const char *debugstr_dmversion (const DMUS_VERSION *version); /* returns name of given GUID */ extern const char *debugstr_dmguid (const GUID *id); -/* returns name of given error code */ -extern const char *debugstr_dmreturn (DWORD code); -/* generic flags-dumping function */ -extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names); -extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask); /* dump whole DMUS_OBJECTDESC struct */ extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index c8cb20ebbc0..6b7f85e3ebf 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -213,7 +213,7 @@ static HRESULT WINAPI IDirectMusicPortImpl_GetFormat (LPDIRECTMUSICPORT iface, L return S_OK; } -const IDirectMusicPortVtbl DirectMusicPort_Vtbl = { +static const IDirectMusicPortVtbl DirectMusicPort_Vtbl = { IDirectMusicPortImpl_QueryInterface, IDirectMusicPortImpl_AddRef, IDirectMusicPortImpl_Release, diff --git a/dlls/dnsapi/ns_parse.c b/dlls/dnsapi/ns_parse.c index cb9aa62cb92..bfb83c249e9 100644 --- a/dlls/dnsapi/ns_parse.c +++ b/dlls/dnsapi/ns_parse.c @@ -136,7 +136,7 @@ dns_ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) { int b; /* Make section right. */ - if (section < 0 || section >= ns_s_max) + if (section >= ns_s_max) RETERR(ENODEV); if (section != handle->_sect) setsection(handle, section); diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 91090cb957e..360e22b0840 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -86,123 +86,123 @@ static const IDirectPlay3Vtbl directPlay3WVT; static const IDirectPlay4Vtbl directPlay4WVT; /* Helper methods for player/group interfaces */ -static HRESULT WINAPI DP_IF_DeletePlayerFromGroup +static HRESULT DP_IF_DeletePlayerFromGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, DPID idPlayer, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_CreatePlayer +static HRESULT DP_IF_CreatePlayer ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, LPDPID lpidPlayer, LPDPNAME lpPlayerName, HANDLE hEvent, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_DestroyGroup +static HRESULT DP_IF_DestroyGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_DestroyPlayer +static HRESULT DP_IF_DestroyPlayer ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idPlayer, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_EnumGroupPlayers +static HRESULT DP_IF_EnumGroupPlayers ( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_EnumGroups +static HRESULT DP_IF_EnumGroups ( IDirectPlay2Impl* This, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_EnumPlayers +static HRESULT DP_IF_EnumPlayers ( IDirectPlay2Impl* This, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_GetGroupData +static HRESULT DP_IF_GetGroupData ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_GetGroupName +static HRESULT DP_IF_GetGroupName ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_GetPlayerData +static HRESULT DP_IF_GetPlayerData ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_GetPlayerName +static HRESULT DP_IF_GetPlayerName ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_SetGroupName +static HRESULT DP_IF_SetGroupName ( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_SetPlayerData +static HRESULT DP_IF_SetPlayerData ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_SetPlayerName +static HRESULT DP_IF_SetPlayerName ( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_AddGroupToGroup +static HRESULT DP_IF_AddGroupToGroup ( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup ); -static HRESULT WINAPI DP_IF_CreateGroup +static HRESULT DP_IF_CreateGroup ( IDirectPlay2AImpl* This, LPVOID lpMsgHdr, LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_CreateGroupInGroup +static HRESULT DP_IF_CreateGroupInGroup ( IDirectPlay3Impl* This, LPVOID lpMsgHdr, DPID idParentGroup, LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_AddPlayerToGroup +static HRESULT DP_IF_AddPlayerToGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, DPID idPlayer, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_DeleteGroupFromGroup +static HRESULT DP_IF_DeleteGroupFromGroup ( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup ); -static HRESULT WINAPI DP_SetSessionDesc +static HRESULT DP_SetSessionDesc ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpSessDesc, DWORD dwFlags, BOOL bInitial, BOOL bAnsi ); -static HRESULT WINAPI DP_SecureOpen +static HRESULT DP_SecureOpen ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags, LPCDPSECURITYDESC lpSecurity, LPCDPCREDENTIALS lpCredentials, BOOL bAnsi ); -static HRESULT WINAPI DP_SendEx +static HRESULT DP_SendEx ( IDirectPlay2Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpContext, LPDWORD lpdwMsgID, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_Receive +static HRESULT DP_IF_Receive ( IDirectPlay2Impl* This, LPDPID lpidFrom, LPDPID lpidTo, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_GetMessageQueue +static HRESULT DP_IF_GetMessageQueue ( IDirectPlay4Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags, LPDWORD lpdwNumMsgs, LPDWORD lpdwNumBytes, BOOL bAnsi ); -static HRESULT WINAPI DP_SP_SendEx +static HRESULT DP_SP_SendEx ( IDirectPlay2Impl* This, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpContext, LPDWORD lpdwMsgID ); -static HRESULT WINAPI DP_IF_SetGroupData +static HRESULT DP_IF_SetGroupData ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_GetPlayerCaps +static HRESULT DP_IF_GetPlayerCaps ( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps, DWORD dwFlags ); -static HRESULT WINAPI DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_CancelMessage +static HRESULT DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi ); +static HRESULT DP_IF_CancelMessage ( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_EnumGroupsInGroup +static HRESULT DP_IF_EnumGroupsInGroup ( IDirectPlay3AImpl* This, DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_GetGroupParent +static HRESULT DP_IF_GetGroupParent ( IDirectPlay3AImpl* This, DPID idGroup, LPDPID lpidGroup, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_GetCaps +static HRESULT DP_IF_GetCaps ( IDirectPlay2Impl* This, LPDPCAPS lpDPCaps, DWORD dwFlags ); -static HRESULT WINAPI DP_IF_EnumSessions +static HRESULT DP_IF_EnumSessions ( IDirectPlay2Impl* This, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); -static HRESULT WINAPI DP_IF_InitializeConnection +static HRESULT DP_IF_InitializeConnection ( IDirectPlay3Impl* This, LPVOID lpConnection, DWORD dwFlags, BOOL bAnsi ); static BOOL CALLBACK cbDPCreateEnumConnections( LPCGUID lpguidSP, LPVOID lpConnection, DWORD dwConnectionSize, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext ); -static BOOL WINAPI DP_BuildSPCompoundAddr( LPGUID lpcSpGuid, LPVOID* lplpAddrBuf, - LPDWORD lpdwBufSize ); +static BOOL DP_BuildSPCompoundAddr( LPGUID lpcSpGuid, LPVOID* lplpAddrBuf, + LPDWORD lpdwBufSize ); static inline DPID DP_NextObjectId(void); static DPID DP_GetRemoteNextObjectId(void); - +static DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi ); static void DP_CopySessionDesc( LPDPSESSIONDESC2 destSessionDesc, LPCDPSESSIONDESC2 srcSessDesc, BOOL bAnsi ); @@ -782,7 +782,7 @@ HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpcMessageBody, } -static HRESULT WINAPI DP_IF_AddPlayerToGroup +static HRESULT DP_IF_AddPlayerToGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, DPID idPlayer, BOOL bAnsi ) { @@ -876,7 +876,7 @@ static HRESULT WINAPI DirectPlay2WImpl_AddPlayerToGroup return DP_IF_AddPlayerToGroup( This, NULL, idGroup, idPlayer, FALSE ); } -static HRESULT WINAPI DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi ) +static HRESULT DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi ) { HRESULT hr = DP_OK; @@ -1010,7 +1010,7 @@ static lpGroupData DP_FindAnyGroup( IDirectPlay2AImpl* This, DPID dpid ) return lpGroups->lpGData; } -static HRESULT WINAPI DP_IF_CreateGroup +static HRESULT DP_IF_CreateGroup ( IDirectPlay2AImpl* This, LPVOID lpMsgHdr, LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) @@ -1399,7 +1399,7 @@ DP_SetPlayerData( lpPlayerData lpPData, DWORD dwFlags, } -static HRESULT WINAPI DP_IF_CreatePlayer +static HRESULT DP_IF_CreatePlayer ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, /* NULL for local creation, non NULL for remote creation */ LPDPID lpidPlayer, @@ -1671,7 +1671,7 @@ static DPID DP_GetRemoteNextObjectId(void) return DP_NextObjectId(); } -static HRESULT WINAPI DP_IF_DeletePlayerFromGroup +static HRESULT DP_IF_DeletePlayerFromGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, DPID idPlayer, BOOL bAnsi ) { @@ -1790,7 +1790,7 @@ cbRemoveGroupOrPlayer( return TRUE; /* Continue enumeration */ } -static HRESULT WINAPI DP_IF_DestroyGroup +static HRESULT DP_IF_DestroyGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, BOOL bAnsi ) { lpGroupData lpGData; @@ -1869,7 +1869,7 @@ typedef struct _DPFAGContext BOOL bAnsi; } DPFAGContext, *lpDPFAGContext; -static HRESULT WINAPI DP_IF_DestroyPlayer +static HRESULT DP_IF_DestroyPlayer ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idPlayer, BOOL bAnsi ) { DPFAGContext cbContext; @@ -1967,7 +1967,7 @@ static HRESULT WINAPI DirectPlay2WImpl_DestroyPlayer return DP_IF_DestroyPlayer( This, NULL, idPlayer, FALSE ); } -static HRESULT WINAPI DP_IF_EnumGroupPlayers +static HRESULT DP_IF_EnumGroupPlayers ( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) @@ -2055,7 +2055,7 @@ static HRESULT WINAPI DirectPlay2WImpl_EnumGroupPlayers } /* NOTE: This only enumerates top level groups (created with CreateGroup) */ -static HRESULT WINAPI DP_IF_EnumGroups +static HRESULT DP_IF_EnumGroups ( IDirectPlay2Impl* This, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) @@ -2086,7 +2086,7 @@ static HRESULT WINAPI DirectPlay2WImpl_EnumGroups lpContext, dwFlags, FALSE ); } -static HRESULT WINAPI DP_IF_EnumPlayers +static HRESULT DP_IF_EnumPlayers ( IDirectPlay2Impl* This, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) @@ -2216,7 +2216,7 @@ static void DP_KillEnumSessionThread( IDirectPlay2Impl* This ) } } -static HRESULT WINAPI DP_IF_EnumSessions +static HRESULT DP_IF_EnumSessions ( IDirectPlay2Impl* This, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) @@ -2400,7 +2400,7 @@ static HRESULT WINAPI DirectPlay2WImpl_EnumSessions lpContext, dwFlags, FALSE ); } -static HRESULT WINAPI DP_IF_GetPlayerCaps +static HRESULT DP_IF_GetPlayerCaps ( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps, DWORD dwFlags ) { @@ -2422,7 +2422,7 @@ static HRESULT WINAPI DP_IF_GetPlayerCaps return (*This->dp2->spData.lpCB->GetCaps)( &data ); } -static HRESULT WINAPI DP_IF_GetCaps +static HRESULT DP_IF_GetCaps ( IDirectPlay2Impl* This, LPDPCAPS lpDPCaps, DWORD dwFlags ) { return DP_IF_GetPlayerCaps( This, DPID_ALLPLAYERS, lpDPCaps, dwFlags ); @@ -2442,7 +2442,7 @@ static HRESULT WINAPI DirectPlay2WImpl_GetCaps return DP_IF_GetCaps( This, lpDPCaps, dwFlags ); } -static HRESULT WINAPI DP_IF_GetGroupData +static HRESULT DP_IF_GetGroupData ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ) { @@ -2502,7 +2502,7 @@ static HRESULT WINAPI DirectPlay2WImpl_GetGroupData dwFlags, FALSE ); } -static HRESULT WINAPI DP_IF_GetGroupName +static HRESULT DP_IF_GetGroupName ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ) { @@ -2580,7 +2580,7 @@ static HRESULT WINAPI DirectPlay2WImpl_GetGroupName return DP_IF_GetGroupName( This, idGroup, lpData, lpdwDataSize, FALSE ); } -static HRESULT WINAPI DP_IF_GetMessageCount +static HRESULT DP_IF_GetMessageCount ( IDirectPlay2Impl* This, DPID idPlayer, LPDWORD lpdwCount, BOOL bAnsi ) { @@ -2636,7 +2636,7 @@ static HRESULT WINAPI DirectPlay2WImpl_GetPlayerCaps return DP_IF_GetPlayerCaps( This, idPlayer, lpPlayerCaps, dwFlags ); } -static HRESULT WINAPI DP_IF_GetPlayerData +static HRESULT DP_IF_GetPlayerData ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ) { @@ -2701,7 +2701,7 @@ static HRESULT WINAPI DirectPlay2WImpl_GetPlayerData dwFlags, FALSE ); } -static HRESULT WINAPI DP_IF_GetPlayerName +static HRESULT DP_IF_GetPlayerName ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ) { @@ -2784,7 +2784,7 @@ static HRESULT WINAPI DirectPlay2WImpl_GetPlayerName return DP_IF_GetPlayerName( This, idPlayer, lpData, lpdwDataSize, FALSE ); } -static HRESULT WINAPI DP_GetSessionDesc +static HRESULT DP_GetSessionDesc ( IDirectPlay2Impl* This, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ) { @@ -2851,7 +2851,7 @@ static HRESULT WINAPI DirectPlay2WImpl_Initialize } -static HRESULT WINAPI DP_SecureOpen +static HRESULT DP_SecureOpen ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags, LPCDPSECURITYDESC lpSecurity, LPCDPCREDENTIALS lpCredentials, BOOL bAnsi ) @@ -2979,7 +2979,7 @@ static HRESULT WINAPI DirectPlay2WImpl_Open return DP_SecureOpen( This, lpsd, dwFlags, NULL, NULL, FALSE ); } -static HRESULT WINAPI DP_IF_Receive +static HRESULT DP_IF_Receive ( IDirectPlay2Impl* This, LPDPID lpidFrom, LPDPID lpidTo, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ) { @@ -3071,7 +3071,7 @@ static HRESULT WINAPI DirectPlay2WImpl_Send 0, 0, NULL, NULL, FALSE ); } -static HRESULT WINAPI DP_IF_SetGroupData +static HRESULT DP_IF_SetGroupData ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) { @@ -3131,7 +3131,7 @@ static HRESULT WINAPI DirectPlay2WImpl_SetGroupData return DP_IF_SetGroupData( This, idGroup, lpData, dwDataSize, dwFlags, FALSE ); } -static HRESULT WINAPI DP_IF_SetGroupName +static HRESULT DP_IF_SetGroupName ( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName, DWORD dwFlags, BOOL bAnsi ) { @@ -3169,7 +3169,7 @@ static HRESULT WINAPI DirectPlay2WImpl_SetGroupName return DP_IF_SetGroupName( This, idGroup, lpGroupName, dwFlags, FALSE ); } -static HRESULT WINAPI DP_IF_SetPlayerData +static HRESULT DP_IF_SetPlayerData ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) { @@ -3233,7 +3233,7 @@ static HRESULT WINAPI DirectPlay2WImpl_SetPlayerData dwFlags, FALSE ); } -static HRESULT WINAPI DP_IF_SetPlayerName +static HRESULT DP_IF_SetPlayerName ( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName, DWORD dwFlags, BOOL bAnsi ) { @@ -3276,7 +3276,7 @@ static HRESULT WINAPI DirectPlay2WImpl_SetPlayerName return DP_IF_SetPlayerName( This, idPlayer, lpPlayerName, dwFlags, FALSE ); } -static HRESULT WINAPI DP_SetSessionDesc +static HRESULT DP_SetSessionDesc ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpSessDesc, DWORD dwFlags, BOOL bInitial, BOOL bAnsi ) { @@ -3349,7 +3349,7 @@ static HRESULT WINAPI DirectPlay2WImpl_SetSessionDesc } /* FIXME: See about merging some of this stuff with dplayx_global.c stuff */ -DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi ) +static DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi ) { DWORD dwSize = 0; @@ -3451,7 +3451,7 @@ static void DP_CopySessionDesc( LPDPSESSIONDESC2 lpSessionDest, } -static HRESULT WINAPI DP_IF_AddGroupToGroup +static HRESULT DP_IF_AddGroupToGroup ( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup ) { lpGroupData lpGData; @@ -3508,7 +3508,7 @@ static HRESULT WINAPI DirectPlay3WImpl_AddGroupToGroup return DP_IF_AddGroupToGroup( This, idParentGroup, idGroup ); } -static HRESULT WINAPI DP_IF_CreateGroupInGroup +static HRESULT DP_IF_CreateGroupInGroup ( IDirectPlay3Impl* This, LPVOID lpMsgHdr, DPID idParentGroup, LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) @@ -3630,7 +3630,7 @@ static HRESULT WINAPI DirectPlay3WImpl_CreateGroupInGroup dwFlags, FALSE ); } -static HRESULT WINAPI DP_IF_DeleteGroupFromGroup +static HRESULT DP_IF_DeleteGroupFromGroup ( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup ) { lpGroupList lpGList; @@ -3678,8 +3678,7 @@ static HRESULT WINAPI DirectPlay3WImpl_DeleteGroupFromGroup return DP_IF_DeleteGroupFromGroup( This, idParentGroup, idGroup ); } -static -BOOL WINAPI DP_BuildSPCompoundAddr( LPGUID lpcSpGuid, LPVOID* lplpAddrBuf, +static BOOL DP_BuildSPCompoundAddr( LPGUID lpcSpGuid, LPVOID* lplpAddrBuf, LPDWORD lpdwBufSize ) { DPCOMPOUNDADDRESSELEMENT dpCompoundAddress; @@ -3957,7 +3956,7 @@ static HRESULT WINAPI DirectPlay3WImpl_EnumConnections return DP_OK; } -static HRESULT WINAPI DP_IF_EnumGroupsInGroup +static HRESULT DP_IF_EnumGroupsInGroup ( IDirectPlay3AImpl* This, DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) @@ -4290,7 +4289,7 @@ HRESULT DP_InitializeDPLSP( IDirectPlay3Impl* This, HMODULE hLobbyProvider ) return hr; } -static HRESULT WINAPI DP_IF_InitializeConnection +static HRESULT DP_IF_InitializeConnection ( IDirectPlay3Impl* This, LPVOID lpConnection, DWORD dwFlags, BOOL bAnsi ) { HMODULE hServiceProvider; @@ -4469,7 +4468,7 @@ static HRESULT WINAPI DirectPlay3WImpl_GetGroupFlags return DP_OK; } -static HRESULT WINAPI DP_IF_GetGroupParent +static HRESULT DP_IF_GetGroupParent ( IDirectPlay3AImpl* This, DPID idGroup, LPDPID lpidGroup, BOOL bAnsi ) { @@ -4564,7 +4563,7 @@ static HRESULT WINAPI DirectPlay4WImpl_SetGroupOwner return DP_OK; } -static HRESULT WINAPI DP_SendEx +static HRESULT DP_SendEx ( IDirectPlay2Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpContext, LPDWORD lpdwMsgID, BOOL bAnsi ) @@ -4703,7 +4702,7 @@ static HRESULT WINAPI DirectPlay4WImpl_SendEx dwPriority, dwTimeout, lpContext, lpdwMsgID, FALSE ); } -static HRESULT WINAPI DP_SP_SendEx +static HRESULT DP_SP_SendEx ( IDirectPlay2Impl* This, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpContext, LPDWORD lpdwMsgID ) @@ -4725,7 +4724,7 @@ static HRESULT WINAPI DP_SP_SendEx return DP_OK; } -static HRESULT WINAPI DP_IF_GetMessageQueue +static HRESULT DP_IF_GetMessageQueue ( IDirectPlay4Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags, LPDWORD lpdwNumMsgs, LPDWORD lpdwNumBytes, BOOL bAnsi ) { @@ -4780,7 +4779,7 @@ static HRESULT WINAPI DirectPlay4WImpl_GetMessageQueue lpdwNumBytes, FALSE ); } -static HRESULT WINAPI DP_IF_CancelMessage +static HRESULT DP_IF_CancelMessage ( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi ) { diff --git a/dlls/dplayx/dplay_global.h b/dlls/dplayx/dplay_global.h index 3537c757052..6c9c61a286d 100644 --- a/dlls/dplayx/dplay_global.h +++ b/dlls/dplayx/dplay_global.h @@ -31,8 +31,6 @@ extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext ); -extern DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi ); - /***************************************************************************** * Predeclare the interface implementation structures */ diff --git a/dlls/dplayx/dplayx_global.c b/dlls/dplayx/dplayx_global.c index fc72dce9140..6bf9f3da084 100644 --- a/dlls/dplayx/dplayx_global.c +++ b/dlls/dplayx/dplayx_global.c @@ -89,8 +89,7 @@ typedef struct static DPLAYX_MEM_SLICE* lpMemArea; -void DPLAYX_PrivHeapFree( LPVOID addr ); -void DPLAYX_PrivHeapFree( LPVOID addr ) +static void DPLAYX_PrivHeapFree( LPVOID addr ) { LPVOID lpAddrStart; DWORD dwBlockUsed; @@ -107,9 +106,7 @@ void DPLAYX_PrivHeapFree( LPVOID addr ) lpMemArea[ dwBlockUsed ].used = 0; } -/* FIXME: This should be static, but is being used for a hack right now */ -LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ); -LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ) +static LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ) { LPVOID lpvArea = NULL; UINT uBlockUsed; @@ -144,27 +141,6 @@ LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ) return lpvArea; } -LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str ); -LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str ) -{ - LPSTR p = DPLAYX_PrivHeapAlloc( flags, strlen(str) + 1 ); - if(p) { - strcpy( p, str ); - } - return p; -} - -LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str ); -LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str ) -{ - INT len = strlenW(str) + 1; - LPWSTR p = DPLAYX_PrivHeapAlloc( flags, len * sizeof(WCHAR) ); - if(p) { - strcpyW( p, str ); - } - return p; -} - enum { numSupportedLobbies = 32, numSupportedSessions = 32 }; typedef struct tagDPLAYX_LOBBYDATA @@ -1062,15 +1038,6 @@ DWORD DPLAYX_SizeOfLobbyDataW( const DPLCONNECTION *lpConn ) -static LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateSessionDesc2A( LPCDPSESSIONDESC2 lpSessionSrc ) -{ - LPDPSESSIONDESC2 lpSessionDest = - HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpSessionSrc ) ); - DPLAYX_CopyIntoSessionDesc2A( lpSessionDest, lpSessionSrc ); - - return lpSessionDest; -} - /* Copy an ANSI session desc structure to the given buffer */ BOOL DPLAYX_CopyIntoSessionDesc2A( LPDPSESSIONDESC2 lpSessionDest, LPCDPSESSIONDESC2 lpSessionSrc ) @@ -1093,38 +1060,6 @@ BOOL DPLAYX_CopyIntoSessionDesc2A( LPDPSESSIONDESC2 lpSessionDest, return TRUE; } -/* Start the index at 0. index will be updated to equal that which should - be passed back into this function for the next element */ -LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateLocalSession( UINT* index ) -{ - for( ; (*index) < numSupportedSessions; (*index)++ ) - { - if( sessionData[(*index)].dwSize != 0 ) - { - return DPLAYX_CopyAndAllocateSessionDesc2A( &sessionData[(*index)++] ); - } - } - - /* No more sessions */ - return NULL; -} - -/* Start the index at 0. index will be updated to equal that which should - be passed back into this function for the next element */ -BOOL DPLAYX_CopyLocalSession( UINT* index, LPDPSESSIONDESC2 lpsd ) -{ - for( ; (*index) < numSupportedSessions; (*index)++ ) - { - if( sessionData[(*index)].dwSize != 0 ) - { - return DPLAYX_CopyIntoSessionDesc2A( lpsd, &sessionData[(*index)++] ); - } - } - - /* No more sessions */ - return FALSE; -} - void DPLAYX_SetLocalSession( LPCDPSESSIONDESC2 lpsd ) { UINT i; diff --git a/dlls/dplayx/dplayx_global.h b/dlls/dplayx/dplayx_global.h index a4d109a9c9b..b9d48f42b30 100644 --- a/dlls/dplayx/dplayx_global.h +++ b/dlls/dplayx/dplayx_global.h @@ -44,7 +44,6 @@ HRESULT DPLAYX_SetConnectionSettingsW ( DWORD dwFlags, const DPLCONNECTION *lpConn ); BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID ); -BOOL DPLAYX_DestroyLobbyApplication( DWORD dwAppID ); BOOL DPLAYX_WaitForConnectionSettings( BOOL bWait ); BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void); @@ -52,20 +51,10 @@ BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void); BOOL DPLAYX_SetLobbyHandles( DWORD dwAppID, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead ); -LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateLocalSession( UINT* index ); -BOOL DPLAYX_CopyLocalSession( UINT* index, LPDPSESSIONDESC2 lpsd ); void DPLAYX_SetLocalSession( LPCDPSESSIONDESC2 lpsd ); BOOL DPLAYX_SetLobbyMsgThreadId( DWORD dwAppId, DWORD dwThreadId ); -/* FIXME: This should not be here */ -LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ); -void DPLAYX_PrivHeapFree( LPVOID addr ); - -LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str ); -LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str ); -/* FIXME: End shared data alloc which should be local */ - /* Convert a DP or DPL HRESULT code into a string for human consumption */ LPCSTR DPLAYX_HresultToString( HRESULT hr ); diff --git a/dlls/dplayx/dplobby.c b/dlls/dplayx/dplobby.c index f78d6573ae8..901c375eabe 100644 --- a/dlls/dplayx/dplobby.c +++ b/dlls/dplayx/dplobby.c @@ -58,9 +58,9 @@ static HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext ); -static HRESULT WINAPI DPL_ConnectEx( IDirectPlayLobbyAImpl* This, - DWORD dwFlags, REFIID riid, - LPVOID* lplpDP, IUnknown* pUnk ); +static HRESULT DPL_ConnectEx( IDirectPlayLobbyAImpl* This, + DWORD dwFlags, REFIID riid, + LPVOID* lplpDP, IUnknown* pUnk ); static BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess, LPHANDLE lphStart, LPHANDLE lphDeath, @@ -469,7 +469,7 @@ static ULONG WINAPI DPL_Release * Returns an IDirectPlay interface. * */ -static HRESULT WINAPI DPL_ConnectEx +static HRESULT DPL_ConnectEx ( IDirectPlayLobbyAImpl* This, DWORD dwFlags, REFIID riid, diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index 35fe3253d41..44372222078 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -273,7 +273,7 @@ static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface) return ref; } -static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingA( +static HRESULT DSPROPERTY_WaveDeviceMappingA( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) @@ -336,7 +336,7 @@ static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingA( return hr; } -static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingW( +static HRESULT DSPROPERTY_WaveDeviceMappingW( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) @@ -399,7 +399,7 @@ static HRESULT WINAPI DSPROPERTY_WaveDeviceMappingW( return hr; } -static HRESULT WINAPI DSPROPERTY_Description1( +static HRESULT DSPROPERTY_Description1( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) @@ -579,7 +579,7 @@ static HRESULT WINAPI DSPROPERTY_Description1( return S_OK; } -static HRESULT WINAPI DSPROPERTY_DescriptionA( +static HRESULT DSPROPERTY_DescriptionA( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) @@ -819,7 +819,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionA( return S_OK; } -static HRESULT WINAPI DSPROPERTY_DescriptionW( +static HRESULT DSPROPERTY_DescriptionW( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) @@ -1060,7 +1060,7 @@ static HRESULT WINAPI DSPROPERTY_DescriptionW( return S_OK; } -static HRESULT WINAPI DSPROPERTY_Enumerate1( +static HRESULT DSPROPERTY_Enumerate1( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) @@ -1142,7 +1142,7 @@ static HRESULT WINAPI DSPROPERTY_Enumerate1( return E_PROP_ID_UNSUPPORTED; } -static HRESULT WINAPI DSPROPERTY_EnumerateA( +static HRESULT DSPROPERTY_EnumerateA( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) @@ -1252,7 +1252,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA( return E_PROP_ID_UNSUPPORTED; } -static HRESULT WINAPI DSPROPERTY_EnumerateW( +static HRESULT DSPROPERTY_EnumerateW( LPVOID pPropData, ULONG cbPropData, PULONG pcbReturned ) diff --git a/dlls/dswave/dswave_main.c b/dlls/dswave/dswave_main.c index a94c504f81d..69671c51c58 100644 --- a/dlls/dswave/dswave_main.c +++ b/dlls/dswave/dswave_main.c @@ -133,11 +133,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) * * */ -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -int even_or_odd (DWORD number) { - return (number & 0x1); /* basically, check if bit 0 is set ;) */ -} - /* FOURCC to string conversion for debug messages */ const char *debugstr_fourcc (DWORD fourcc) { if (!fourcc) return "'null'"; @@ -147,7 +142,7 @@ const char *debugstr_fourcc (DWORD fourcc) { } /* DMUS_VERSION struct to string conversion for debug messages */ -const char *debugstr_dmversion (const DMUS_VERSION *version) { +static const char *debugstr_dmversion (const DMUS_VERSION *version) { if (!version) return "'null'"; return wine_dbg_sprintf ("\'%i,%i,%i,%i\'", (int)((version->dwVersionMS & 0xFFFF0000) >> 8), (int)(version->dwVersionMS & 0x0000FFFF), @@ -338,144 +333,8 @@ const char *debugstr_dmguid (const GUID *id) { return debugstr_guid(id); } -/* returns name of given error code */ -const char *debugstr_dmreturn (DWORD code) { - static const flag_info codes[] = { - FE(S_OK), - FE(S_FALSE), - FE(DMUS_S_PARTIALLOAD), - FE(DMUS_S_PARTIALDOWNLOAD), - FE(DMUS_S_REQUEUE), - FE(DMUS_S_FREE), - FE(DMUS_S_END), - FE(DMUS_S_STRING_TRUNCATED), - FE(DMUS_S_LAST_TOOL), - FE(DMUS_S_OVER_CHORD), - FE(DMUS_S_UP_OCTAVE), - FE(DMUS_S_DOWN_OCTAVE), - FE(DMUS_S_NOBUFFERCONTROL), - FE(DMUS_S_GARBAGE_COLLECTED), - FE(DMUS_E_DRIVER_FAILED), - FE(DMUS_E_PORTS_OPEN), - FE(DMUS_E_DEVICE_IN_USE), - FE(DMUS_E_INSUFFICIENTBUFFER), - FE(DMUS_E_BUFFERNOTSET), - FE(DMUS_E_BUFFERNOTAVAILABLE), - FE(DMUS_E_NOTADLSCOL), - FE(DMUS_E_INVALIDOFFSET), - FE(DMUS_E_ALREADY_LOADED), - FE(DMUS_E_INVALIDPOS), - FE(DMUS_E_INVALIDPATCH), - FE(DMUS_E_CANNOTSEEK), - FE(DMUS_E_CANNOTWRITE), - FE(DMUS_E_CHUNKNOTFOUND), - FE(DMUS_E_INVALID_DOWNLOADID), - FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), - FE(DMUS_E_ALREADY_DOWNLOADED), - FE(DMUS_E_UNKNOWN_PROPERTY), - FE(DMUS_E_SET_UNSUPPORTED), - FE(DMUS_E_GET_UNSUPPORTED), - FE(DMUS_E_NOTMONO), - FE(DMUS_E_BADARTICULATION), - FE(DMUS_E_BADINSTRUMENT), - FE(DMUS_E_BADWAVELINK), - FE(DMUS_E_NOARTICULATION), - FE(DMUS_E_NOTPCM), - FE(DMUS_E_BADWAVE), - FE(DMUS_E_BADOFFSETTABLE), - FE(DMUS_E_UNKNOWNDOWNLOAD), - FE(DMUS_E_NOSYNTHSINK), - FE(DMUS_E_ALREADYOPEN), - FE(DMUS_E_ALREADYCLOSED), - FE(DMUS_E_SYNTHNOTCONFIGURED), - FE(DMUS_E_SYNTHACTIVE), - FE(DMUS_E_CANNOTREAD), - FE(DMUS_E_DMUSIC_RELEASED), - FE(DMUS_E_BUFFER_EMPTY), - FE(DMUS_E_BUFFER_FULL), - FE(DMUS_E_PORT_NOT_CAPTURE), - FE(DMUS_E_PORT_NOT_RENDER), - FE(DMUS_E_DSOUND_NOT_SET), - FE(DMUS_E_ALREADY_ACTIVATED), - FE(DMUS_E_INVALIDBUFFER), - FE(DMUS_E_WAVEFORMATNOTSUPPORTED), - FE(DMUS_E_SYNTHINACTIVE), - FE(DMUS_E_DSOUND_ALREADY_SET), - FE(DMUS_E_INVALID_EVENT), - FE(DMUS_E_UNSUPPORTED_STREAM), - FE(DMUS_E_ALREADY_INITED), - FE(DMUS_E_INVALID_BAND), - FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), - FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), - FE(DMUS_E_INVALID_TRACK_HDR), - FE(DMUS_E_INVALID_TOOL_HDR), - FE(DMUS_E_ALL_TOOLS_FAILED), - FE(DMUS_E_ALL_TRACKS_FAILED), - FE(DMUS_E_NOT_FOUND), - FE(DMUS_E_NOT_INIT), - FE(DMUS_E_TYPE_DISABLED), - FE(DMUS_E_TYPE_UNSUPPORTED), - FE(DMUS_E_TIME_PAST), - FE(DMUS_E_TRACK_NOT_FOUND), - FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), - FE(DMUS_E_NO_MASTER_CLOCK), - FE(DMUS_E_LOADER_NOCLASSID), - FE(DMUS_E_LOADER_BADPATH), - FE(DMUS_E_LOADER_FAILEDOPEN), - FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), - FE(DMUS_E_LOADER_FAILEDCREATE), - FE(DMUS_E_LOADER_OBJECTNOTFOUND), - FE(DMUS_E_LOADER_NOFILENAME), - FE(DMUS_E_INVALIDFILE), - FE(DMUS_E_ALREADY_EXISTS), - FE(DMUS_E_OUT_OF_RANGE), - FE(DMUS_E_SEGMENT_INIT_FAILED), - FE(DMUS_E_ALREADY_SENT), - FE(DMUS_E_CANNOT_FREE), - FE(DMUS_E_CANNOT_OPEN_PORT), - FE(DMUS_E_CANNOT_CONVERT), - FE(DMUS_E_DESCEND_CHUNK_FAIL), - FE(DMUS_E_NOT_LOADED), - FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), - FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), - FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), - FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), - FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), - FE(DMUS_E_SCRIPT_INVALID_FILE), - FE(DMUS_E_INVALID_SCRIPTTRACK), - FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), - FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), - FE(DMUS_E_SCRIPT_CONTENT_READONLY), - FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), - FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), - FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), - FE(DMUS_E_INVALID_LYRICSTRACK), - FE(DMUS_E_INVALID_PARAMCONTROLTRACK), - FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), - FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), - FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), - FE(DMUS_E_AUDIOPATHS_NOT_VALID), - FE(DMUS_E_AUDIOPATHS_IN_USE), - FE(DMUS_E_NO_AUDIOPATH_CONFIG), - FE(DMUS_E_AUDIOPATH_INACTIVE), - FE(DMUS_E_AUDIOPATH_NOBUFFER), - FE(DMUS_E_AUDIOPATH_NOPORT), - FE(DMUS_E_NO_AUDIOPATH), - FE(DMUS_E_INVALIDCHUNK), - FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), - FE(DMUS_E_INVALID_CONTAINER_OBJECT) - }; - unsigned int i; - for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { - if (code == codes[i].val) - return codes[i].name; - } - /* if we didn't find it, return value */ - return wine_dbg_sprintf("0x%08x", code); -} - /* generic flag-dumping function */ -const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ +static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ char buffer[128] = "", *ptr = &buffer[0]; unsigned int i; int size = sizeof(buffer); @@ -495,7 +354,7 @@ const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_name } /* dump DMUS_OBJ flags */ -const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { +static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { static const flag_info flags[] = { FE(DMUS_OBJ_OBJECT), FE(DMUS_OBJ_CLASS), diff --git a/dlls/dswave/dswave_private.h b/dlls/dswave/dswave_private.h index afde45f91e4..c2c1f4b2e17 100644 --- a/dlls/dswave/dswave_private.h +++ b/dlls/dswave/dswave_private.h @@ -106,19 +106,10 @@ typedef struct { #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) -/* check whether the given DWORD is even (return 0) or odd (return 1) */ -extern int even_or_odd (DWORD number); /* FOURCC to string conversion for debug messages */ extern const char *debugstr_fourcc (DWORD fourcc); -/* DMUS_VERSION struct to string conversion for debug messages */ -extern const char *debugstr_dmversion (const DMUS_VERSION *version); /* returns name of given GUID */ extern const char *debugstr_dmguid (const GUID *id); -/* returns name of given error code */ -extern const char *debugstr_dmreturn (DWORD code); -/* generic flags-dumping function */ -extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names); -extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask); /* dump whole DMUS_OBJECTDESC struct */ extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc); diff --git a/dlls/dxdiagn/dxdiag_private.h b/dlls/dxdiagn/dxdiag_private.h index 6449b32341a..4b6288b1d7d 100644 --- a/dlls/dxdiagn/dxdiag_private.h +++ b/dlls/dxdiagn/dxdiag_private.h @@ -97,7 +97,6 @@ extern HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkO /** internal factory */ extern HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, LPVOID *ppobj); -extern HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont); /********************************************************************** * Dll lifetime tracking declaration for dxdiagn.dll diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c index e3bb044db0c..bc4d1a69fc7 100644 --- a/dlls/dxdiagn/provider.c +++ b/dlls/dxdiagn/provider.c @@ -37,6 +37,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(dxdiag); +static HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont); + /* IDxDiagProvider IUnknown parts follow: */ static HRESULT WINAPI IDxDiagProviderImpl_QueryInterface(PDXDIAGPROVIDER iface, REFIID riid, LPVOID *ppobj) { @@ -699,7 +701,7 @@ out_show_filters: return hr; } -HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont) { +static HRESULT DXDiag_InitRootDXDiagContainer(IDxDiagContainer* pRootCont) { HRESULT hr = S_OK; static const WCHAR DxDiag_SystemInfo[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','I','n','f','o',0}; static const WCHAR DxDiag_SystemDevices[] = {'D','x','D','i','a','g','_','S','y','s','t','e','m','D','e','v','i','c','e','s',0}; diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c index 370fcddb6b9..b72c04a16fa 100644 --- a/dlls/dxgi/dxgi_main.c +++ b/dlls/dxgi/dxgi_main.c @@ -97,6 +97,12 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory) EnterCriticalSection(&dxgi_cs); object->wined3d = WineDirect3DCreate(10, (IUnknown *)object); + if(!object->wined3d) + { + hr = DXGI_ERROR_UNSUPPORTED; + LeaveCriticalSection(&dxgi_cs); + goto fail; + } object->adapter_count = IWineD3D_GetAdapterCount(object->wined3d); LeaveCriticalSection(&dxgi_cs); @@ -110,7 +116,7 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory) for (i = 0; i < object->adapter_count; ++i) { - struct dxgi_adapter *adapter = HeapAlloc(GetProcessHeap(), 0, sizeof(**object->adapters)); + struct dxgi_adapter *adapter = HeapAlloc(GetProcessHeap(), 0, sizeof(*adapter)); if (!adapter) { UINT j; diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 7f22bb4bcd5..7603c1405de 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -33,7 +33,6 @@ static IDXGIDevice *create_device(HMODULE d3d10core) HRESULT hr; hr = CreateDXGIFactory(&IID_IDXGIFactory, (void *)&factory); - ok(SUCCEEDED(hr), "CreateDXGIFactory failed, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter); diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 9e3ec0267f1..2894dca2e8f 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3434,7 +3434,8 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont) */ LIST_FOR_EACH_ENTRY(font_link, &system_links, SYSTEM_LINKS, entry) { - if(!strcmpiW(font_link->font_name, FaceName)) + if(!strcmpiW(font_link->font_name, FaceName) || + (psub && !strcmpiW(font_link->font_name,psub->to.name))) { TRACE("found entry in system list\n"); LIST_FOR_EACH_ENTRY(font_link_entry, &font_link->links, CHILD_FONT, entry) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 325c7089a55..ba072171180 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -511,7 +511,6 @@ extern BOOL PATH_Polygon(DC *dc, const POINT *pt, DWORD cbCount) DECLSPEC_HIDDEN extern BOOL PATH_PolyPolyline(DC *dc, const POINT *pt, const DWORD *counts, DWORD polylines) DECLSPEC_HIDDEN; extern BOOL PATH_PolyPolygon(DC *dc, const POINT *pt, const INT *counts, UINT polygons) DECLSPEC_HIDDEN; extern BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height) DECLSPEC_HIDDEN; -extern BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) DECLSPEC_HIDDEN; /* painting.c */ extern POINT *GDI_Bezier( const POINT *Points, INT count, INT *nPtsOut ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 1e953cba9de..8df8a1bb2d6 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -92,6 +92,7 @@ typedef struct tagFLOAT_POINT } FLOAT_POINT; +static BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags); static BOOL PATH_PathToRegion(GdiPath *pPath, INT nPolyFillMode, HRGN *pHrgn); static void PATH_EmptyPath(GdiPath *pPath); @@ -1502,7 +1503,7 @@ static void PATH_EmptyPath(GdiPath *pPath) * or PT_BEZIERTO, optionally ORed with PT_CLOSEFIGURE. Returns TRUE if * successful, FALSE otherwise (e.g. if not enough memory was available). */ -BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) +static BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) { assert(pPath!=NULL); diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index a47dc3898a5..7094f852dc2 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -1956,11 +1956,17 @@ static void test_CreateBitmap(void) bmp.bmPlanes = 1; bmp.bmBitsPixel = i; bmp.bmBits = NULL; + SetLastError(0xdeadbeef); bm = CreateBitmapIndirect(&bmp); if(i > 32) { DWORD error = GetLastError(); - ok(bm == 0, "CreateBitmapIndirect for %d bpp succeeded\n", i); - ok(error == ERROR_INVALID_PARAMETER, "Got error %d, expected ERROR_INVALID_PARAMETER\n", error); + ok(bm == 0 || + broken(bm != 0), /* Win9x and WinMe */ + "CreateBitmapIndirect for %d bpp succeeded\n", i); + ok(error == ERROR_INVALID_PARAMETER || + broken(error == 0xdeadbeef), /* Win9x and WinME */ + "Got error %d, expected ERROR_INVALID_PARAMETER\n", error); + DeleteObject(bm); continue; } ok(bm != 0, "CreateBitmapIndirect error %u\n", GetLastError()); @@ -1978,7 +1984,9 @@ static void test_CreateBitmap(void) } else if(i <= 32) { expect = 32; } - ok(bmp.bmBitsPixel == expect, "CreateBitmapIndirect for a %d bpp bitmap created a %d bpp bitmap, expected %d\n", + ok(bmp.bmBitsPixel == expect || + broken(bmp.bmBitsPixel == i), /* Win9x and WinMe */ + "CreateBitmapIndirect for a %d bpp bitmap created a %d bpp bitmap, expected %d\n", i, bmp.bmBitsPixel, expect); DeleteObject(bm); } @@ -2013,21 +2021,27 @@ static void test_bitmapinfoheadersize(void) SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL || + broken(!hdib), /* Win98, WinMe */ + "CreateDIBSection error %d\n", GetLastError()); DeleteObject(hdib); bmi.bmiHeader.biSize = sizeof(BITMAPINFO); SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL || + broken(!hdib), /* Win98, WinMe */ + "CreateDIBSection error %d\n", GetLastError()); DeleteObject(hdib); bmi.bmiHeader.biSize++; SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL || + broken(!hdib), /* Win98, WinMe */ + "CreateDIBSection error %d\n", GetLastError()); DeleteObject(hdib); bmi.bmiHeader.biSize = sizeof(BITMAPV4HEADER); @@ -2041,7 +2055,9 @@ static void test_bitmapinfoheadersize(void) SetLastError(0xdeadbeef); hdib = CreateDIBSection(hdc, &bmi, 0, NULL, NULL, 0); - ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); + ok(hdib != NULL || + broken(!hdib), /* Win95 */ + "CreateDIBSection error %d\n", GetLastError()); DeleteObject(hdib); memset(&bci, 0, sizeof(BITMAPCOREINFO)); diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index edccb10afac..a24f54ebe2f 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -478,8 +478,7 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, REAL height, GpTexture **texture) { HDC hdc; - OLE_HANDLE hbm; - HBITMAP old = NULL; + HBITMAP hbm, old = NULL; BITMAPINFO *pbmi; BITMAPINFOHEADER *bmih; INT n_x, n_y, n_width, n_height, abs_height, stride, image_stride, i, bytespp; @@ -507,7 +506,7 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, n_y + n_height > ((GpBitmap*)image)->height) return InvalidParameter; - IPicture_get_Handle(image->picture, &hbm); + IPicture_get_Handle(image->picture, (OLE_HANDLE*)&hbm); if(!hbm) return GenericError; IPicture_get_CurDC(image->picture, &hdc); bm_is_selected = (hdc != 0); @@ -520,11 +519,11 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, if(!bm_is_selected){ hdc = CreateCompatibleDC(0); - old = SelectObject(hdc, (HBITMAP)hbm); + old = SelectObject(hdc, hbm); } /* fill out bmi */ - GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); + GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); bytespp = pbmi->bmiHeader.biBitCount / 8; abs_height = abs(pbmi->bmiHeader.biHeight); @@ -538,7 +537,7 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, dibits = GdipAlloc(pbmi->bmiHeader.biSizeImage); if(dibits) /* this is not a good place to error out */ - GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, dibits, pbmi, DIB_RGB_COLORS); + GetDIBits(hdc, hbm, 0, abs_height, dibits, pbmi, DIB_RGB_COLORS); if(!bm_is_selected){ SelectObject(hdc, old); @@ -929,6 +928,20 @@ GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture *brush, GpWrapMode *wrapmod } /****************************************************************************** + * GdipMultiplyTextureTransform [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipMultiplyTextureTransform(GpTexture* brush, + GDIPCONST GpMatrix *matrix, GpMatrixOrder order) +{ + TRACE("(%p, %p, %d)\n", brush, matrix, order); + + if(!brush || !matrix) + return InvalidParameter; + + return GdipMultiplyMatrix(brush->transform, matrix, order); +} + +/****************************************************************************** * GdipResetTextureTransform [GDIPLUS.@] */ GpStatus WINGDIPAPI GdipResetTextureTransform(GpTexture* brush) @@ -941,6 +954,20 @@ GpStatus WINGDIPAPI GdipResetTextureTransform(GpTexture* brush) return GdipSetMatrixElements(brush->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); } +/****************************************************************************** + * GdipScaleTextureTransform [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipScaleTextureTransform(GpTexture* brush, + REAL sx, REAL sy, GpMatrixOrder order) +{ + TRACE("(%p, %.2f, %.2f, %d)\n", brush, sx, sy, order); + + if(!brush) + return InvalidParameter; + + return GdipScaleMatrix(brush->transform, sx, sy, order); +} + GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL* positions, INT count) { @@ -1198,6 +1225,20 @@ GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient *brush, ARGB *colors) return Ok; } +/****************************************************************************** + * GdipRotateTextureTransform [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipRotateTextureTransform(GpTexture* brush, REAL angle, + GpMatrixOrder order) +{ + TRACE("(%p, %.2f, %d)\n", brush, angle, order); + + if(!brush) + return InvalidParameter; + + return GdipRotateMatrix(brush->transform, angle, order); +} + GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus, REAL scale) { @@ -1239,6 +1280,20 @@ GpStatus WINGDIPAPI GdipTranslateLineTransform(GpLineGradient* brush, return NotImplemented; } +/****************************************************************************** + * GdipTranslateTextureTransform [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipTranslateTextureTransform(GpTexture* brush, REAL dx, REAL dy, + GpMatrixOrder order) +{ + TRACE("(%p, %.2f, %.2f, %d)\n", brush, dx, dy, order); + + if(!brush) + return InvalidParameter; + + return GdipTranslateMatrix(brush->transform, dx, dy, order); +} + GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect) { TRACE("(%p, %p)\n", brush, rect); diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index ba2f1d8b986..220409b7a05 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -153,6 +153,8 @@ GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, (*font)->unit = unit; (*font)->emSize = emSize; + (*font)->height = tmw->ntmSizeEM; + (*font)->line_spacing = tmw->tmAscent + tmw->tmDescent + tmw->tmExternalLeading; return Ok; } @@ -194,6 +196,9 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, (*font)->lfw.lfHeight = -textmet.tmHeight; (*font)->lfw.lfWeight = textmet.tmWeight; + (*font)->height = 1; /* FIXME: need NEWTEXTMETRIC.ntmSizeEM here */ + (*font)->line_spacing = textmet.tmAscent + textmet.tmDescent + textmet.tmExternalLeading; + SelectObject(hdc, oldfont); DeleteObject(hfont); @@ -251,7 +256,7 @@ GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC hdc, GpFont **font) if(!font) return InvalidParameter; - hfont = (HFONT)GetCurrentObject(hdc, OBJ_FONT); + hfont = GetCurrentObject(hdc, OBJ_FONT); if(!hfont) return GenericError; @@ -444,15 +449,31 @@ GpStatus WINGDIPAPI GdipGetFontHeight(GDIPCONST GpFont *font, */ GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height) { + REAL font_height; + TRACE("%p (%s), %f, %p\n", font, debugstr_w(font->lfw.lfFaceName), dpi, height); if (!(font && height)) return InvalidParameter; + font_height = font->line_spacing * (font->emSize / font->height); + switch (font->unit) { case UnitPixel: - *height = font->emSize; + *height = font_height; + break; + case UnitPoint: + *height = font_height * dpi * inch_per_point; + break; + case UnitInch: + *height = font_height * dpi; + break; + case UnitDocument: + *height = font_height * (dpi / 300.0); + break; + case UnitMillimeter: + *height = font_height * (dpi / mm_per_inch); break; default: FIXME("Unhandled unit type: %d\n", font->unit); diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 87e9cc359a0..b3d21039ea5 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -240,7 +240,7 @@ @ stdcall GdipGetAdjustableArrowCapHeight(ptr ptr) @ stdcall GdipGetAdjustableArrowCapMiddleInset(ptr ptr) @ stdcall GdipGetAdjustableArrowCapWidth(ptr ptr) -@ stub GdipGetAllPropertyItems +@ stdcall GdipGetAllPropertyItems(ptr long long ptr) @ stdcall GdipGetBrushType(ptr ptr) @ stdcall GdipGetCellAscent(ptr long ptr) @ stdcall GdipGetCellDescent(ptr long ptr) @@ -292,7 +292,7 @@ @ stdcall GdipGetImageHorizontalResolution(ptr ptr) @ stub GdipGetImageItemData @ stub GdipGetImagePalette -@ stub GdipGetImagePaletteSize +@ stdcall GdipGetImagePaletteSize(ptr ptr) @ stdcall GdipGetImagePixelFormat(ptr ptr) @ stdcall GdipGetImageRawFormat(ptr ptr) @ stub GdipGetImageThumbnail @@ -360,7 +360,7 @@ @ stdcall GdipGetPenDashOffset(ptr ptr) @ stdcall GdipGetPenDashStyle(ptr ptr) @ stdcall GdipGetPenEndCap(ptr ptr) -@ stub GdipGetPenFillType +@ stdcall GdipGetPenFillType(ptr ptr) @ stdcall GdipGetPenLineJoin(ptr ptr) @ stdcall GdipGetPenMiterLimit(ptr ptr) @ stdcall GdipGetPenMode(ptr ptr) @@ -446,7 +446,7 @@ @ stdcall GdipMultiplyMatrix(ptr ptr long) @ stub GdipMultiplyPathGradientTransform @ stub GdipMultiplyPenTransform -@ stub GdipMultiplyTextureTransform +@ stdcall GdipMultiplyTextureTransform(ptr ptr long) @ stdcall GdipMultiplyWorldTransform(ptr ptr long) @ stdcall GdipNewInstalledFontCollection(ptr) @ stdcall GdipNewPrivateFontCollection(ptr) @@ -489,7 +489,7 @@ @ stdcall GdipRotateMatrix(ptr long long) @ stub GdipRotatePathGradientTransform @ stub GdipRotatePenTransform -@ stub GdipRotateTextureTransform +@ stdcall GdipRotateTextureTransform(ptr long long) @ stdcall GdipRotateWorldTransform(ptr long long) @ stub GdipSaveAdd @ stub GdipSaveAddImage @@ -500,7 +500,7 @@ @ stdcall GdipScaleMatrix(ptr long long long) @ stub GdipScalePathGradientTransform @ stub GdipScalePenTransform -@ stub GdipScaleTextureTransform +@ stdcall GdipScaleTextureTransform(ptr long long long) @ stdcall GdipScaleWorldTransform(ptr long long long) @ stdcall GdipSetAdjustableArrowCapFillState(ptr long) @ stdcall GdipSetAdjustableArrowCapHeight(ptr long) @@ -564,7 +564,7 @@ @ stdcall GdipSetPathMarker(ptr) @ stdcall GdipSetPenBrushFill(ptr ptr) @ stdcall GdipSetPenColor(ptr long) -@ stub GdipSetPenCompoundArray +@ stdcall GdipSetPenCompoundArray(ptr ptr long) @ stdcall GdipSetPenCustomEndCap(ptr ptr) @ stdcall GdipSetPenCustomStartCap(ptr ptr) @ stdcall GdipSetPenDashArray(ptr ptr long) @@ -617,7 +617,7 @@ @ stub GdipTranslatePenTransform @ stdcall GdipTranslateRegion(ptr long long) @ stdcall GdipTranslateRegionI(ptr long long) -@ stub GdipTranslateTextureTransform +@ stdcall GdipTranslateTextureTransform(ptr long long long) @ stdcall GdipTranslateWorldTransform(ptr long long long) @ stdcall GdipVectorTransformMatrixPoints(ptr ptr long) @ stdcall GdipVectorTransformMatrixPointsI(ptr ptr long) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index a2792681cf4..714739c2b7a 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -209,6 +209,8 @@ struct GpImageAttributes{ struct GpFont{ LOGFONTW lfw; REAL emSize; + UINT height; + LONG line_spacing; Unit unit; }; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 6e0c4686bbb..0c610560e27 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -96,9 +96,8 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, { BOOL bm_is_selected; INT stride, bitspp = PIXELFORMATBPP(format); - OLE_HANDLE hbm; HDC hdc; - HBITMAP old = NULL; + HBITMAP hbm, old = NULL; BITMAPINFO *pbmi; BYTE *buff = NULL; UINT abs_height; @@ -128,7 +127,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, if(bitmap->lockmode) return WrongState; - IPicture_get_Handle(bitmap->image.picture, &hbm); + IPicture_get_Handle(bitmap->image.picture, (OLE_HANDLE*)&hbm); IPicture_get_CurDC(bitmap->image.picture, &hdc); bm_is_selected = (hdc != 0); @@ -140,11 +139,11 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, if(!bm_is_selected){ hdc = CreateCompatibleDC(0); - old = SelectObject(hdc, (HBITMAP)hbm); + old = SelectObject(hdc, hbm); } /* fill out bmi */ - GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); + GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); abs_height = abs(pbmi->bmiHeader.biHeight); stride = pbmi->bmiHeader.biWidth * bitspp / 8; @@ -155,7 +154,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, pbmi->bmiHeader.biBitCount = bitspp; if(buff) - GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, buff, pbmi, DIB_RGB_COLORS); + GetDIBits(hdc, hbm, 0, abs_height, buff, pbmi, DIB_RGB_COLORS); if(!bm_is_selected){ SelectObject(hdc, old); @@ -194,9 +193,8 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, BitmapData* lockeddata) { - OLE_HANDLE hbm; HDC hdc; - HBITMAP old = NULL; + HBITMAP hbm, old = NULL; BOOL bm_is_selected; BITMAPINFO *pbmi; @@ -218,7 +216,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, return Ok; } - IPicture_get_Handle(bitmap->image.picture, &hbm); + IPicture_get_Handle(bitmap->image.picture, (OLE_HANDLE*)&hbm); IPicture_get_CurDC(bitmap->image.picture, &hdc); bm_is_selected = (hdc != 0); @@ -228,12 +226,12 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, if(!bm_is_selected){ hdc = CreateCompatibleDC(0); - old = SelectObject(hdc, (HBITMAP)hbm); + old = SelectObject(hdc, hbm); } - GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); + GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); pbmi->bmiHeader.biBitCount = PIXELFORMATBPP(lockeddata->PixelFormat); - SetDIBits(hdc, (HBITMAP)hbm, 0, abs(pbmi->bmiHeader.biHeight), + SetDIBits(hdc, hbm, 0, abs(pbmi->bmiHeader.biHeight), bitmap->bitmapbits, pbmi, DIB_RGB_COLORS); if(!bm_is_selected){ @@ -372,7 +370,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromResource(HINSTANCE hInstance, return InvalidParameter; /* load DIB */ - hbm = (HBITMAP)LoadImageW(hInstance,lpBitmapName,IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION); + hbm = LoadImageW(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0, + LR_CREATEDIBSECTION); if(hbm){ stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, bitmap); @@ -748,6 +747,16 @@ GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage *image, REAL *res) return NotImplemented; } +GpStatus WINGDIPAPI GdipGetImagePaletteSize(GpImage *image, INT *size) +{ + FIXME("%p %p\n", image, size); + + if(!image || !size) + return InvalidParameter; + + return NotImplemented; +} + /* FIXME: test this function for non-bitmap types */ GpStatus WINGDIPAPI GdipGetImagePixelFormat(GpImage *image, PixelFormat *format) { @@ -1025,7 +1034,7 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image) if(type == PICTYPE_BITMAP){ BITMAPINFO *pbmi; BITMAPCOREHEADER* bmch; - OLE_HANDLE hbm; + HBITMAP hbm; HDC hdc; pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); @@ -1042,7 +1051,7 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image) (*((GpBitmap**) image))->height = ipicture_pixel_height(pic); /* get the pixel format */ - IPicture_get_Handle(pic, &hbm); + IPicture_get_Handle(pic, (OLE_HANDLE*)&hbm); IPicture_get_CurDC(pic, &hdc); bmch = (BITMAPCOREHEADER*) (&pbmi->bmiHeader); @@ -1051,13 +1060,13 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image) if(!hdc){ HBITMAP old; hdc = CreateCompatibleDC(0); - old = SelectObject(hdc, (HBITMAP)hbm); - GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); + old = SelectObject(hdc, hbm); + GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); SelectObject(hdc, old); DeleteDC(hdc); } else - GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); + GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); (*((GpBitmap**) image))->format = (bmch->bcBitCount << 8) | PixelFormatGDI; GdipFree(pbmi); diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index d2e15116d6c..2176da6cbfe 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -221,7 +221,7 @@ GpStatus WINGDIPAPI GdipIsMatrixInvertible(GDIPCONST GpMatrix *matrix, BOOL *res return Ok; } -GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GpMatrix* matrix2, +GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix* matrix2, GpMatrixOrder order) { TRACE("(%p, %p, %d)\n", matrix, matrix2, order); diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 61f18989abd..f41185a6887 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -67,6 +67,24 @@ static DWORD gdip_to_gdi_join(GpLineJoin join) } } +static GpPenType bt_to_pt(GpBrushType bt) +{ + switch(bt){ + case BrushTypeSolidColor: + return PenTypeSolidColor; + case BrushTypeHatchFill: + return PenTypeHatchFill; + case BrushTypeTextureFill: + return PenTypeTextureFill; + case BrushTypePathGradient: + return PenTypePathGradient; + case BrushTypeLinearGradient: + return PenTypeLinearGradient; + default: + return PenTypeUnknown; + } +} + GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) { TRACE("(%p, %p)\n", pen, clonepen); @@ -283,6 +301,18 @@ GpStatus WINGDIPAPI GdipGetPenEndCap(GpPen *pen, GpLineCap *endCap) return Ok; } +GpStatus WINGDIPAPI GdipGetPenFillType(GpPen *pen, GpPenType* type) +{ + TRACE("(%p, %p)\n", pen, type); + + if(!pen || !type) + return InvalidParameter; + + *type = bt_to_pt(pen->brush->bt); + + return Ok; +} + GpStatus WINGDIPAPI GdipGetPenLineJoin(GpPen *pen, GpLineJoin *lineJoin) { TRACE("(%p, %p)\n", pen, lineJoin); @@ -379,6 +409,17 @@ GpStatus WINGDIPAPI GdipSetPenColor(GpPen *pen, ARGB argb) return GdipSetSolidFillColor(((GpSolidFill*)pen->brush), argb); } +GpStatus WINGDIPAPI GdipSetPenCompoundArray(GpPen *pen, GDIPCONST REAL *dash, + INT count) +{ + FIXME("(%p, %p, %i): stub", pen, dash, count); + + if (!pen || !dash || count < 2 || count%2 == 1) + return InvalidParameter; + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen *pen, GpCustomLineCap* customCap) { GpCustomLineCap * cap; diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 509c7ce2b81..d28292c9eea 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -841,6 +841,98 @@ static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *grap return stat; } + case CombineModeIntersect: + case CombineModeUnion: + case CombineModeXor: + case CombineModeExclude: + case CombineModeComplement: + { + HRGN left, right; + GpStatus stat; + int ret; + + stat = get_region_hrgn(element->elementdata.combine.left, graphics, &left); + if (stat != Ok) + { + *hrgn = NULL; + return stat; + } + + if (left == NULL) + { + /* existing region is infinite */ + switch (element->type) + { + case CombineModeIntersect: + return get_region_hrgn(element->elementdata.combine.right, graphics, hrgn); + case CombineModeXor: case CombineModeExclude: + FIXME("cannot exclude from an infinite region\n"); + /* fall-through */ + case CombineModeUnion: case CombineModeComplement: + *hrgn = NULL; + return Ok; + } + } + + stat = get_region_hrgn(element->elementdata.combine.right, graphics, &right); + if (stat != Ok) + { + DeleteObject(left); + *hrgn = NULL; + return stat; + } + + if (right == NULL) + { + /* new region is infinite */ + switch (element->type) + { + case CombineModeIntersect: + *hrgn = left; + return Ok; + case CombineModeXor: case CombineModeComplement: + FIXME("cannot exclude from an infinite region\n"); + /* fall-through */ + case CombineModeUnion: case CombineModeExclude: + DeleteObject(left); + *hrgn = NULL; + return Ok; + } + } + + switch (element->type) + { + case CombineModeIntersect: + ret = CombineRgn(left, left, right, RGN_AND); + break; + case CombineModeUnion: + ret = CombineRgn(left, left, right, RGN_OR); + break; + case CombineModeXor: + ret = CombineRgn(left, left, right, RGN_XOR); + break; + case CombineModeExclude: + ret = CombineRgn(left, left, right, RGN_DIFF); + break; + case CombineModeComplement: + ret = CombineRgn(left, right, left, RGN_DIFF); + break; + default: + ret = ERROR; + } + + DeleteObject(right); + + if (ret == ERROR) + { + DeleteObject(left); + *hrgn = NULL; + return GenericError; + } + + *hrgn = left; + return Ok; + } default: FIXME("GdipGetRegionHRgn unimplemented for region type=%x\n", element->type); *hrgn = NULL; diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 4d93da40265..6000dde0b27 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -42,20 +42,17 @@ static void test_Scan0(void) bm = (GpBitmap*)0xdeadbeef; stat = GdipCreateBitmapFromScan0(10, -10, 10, PixelFormat24bppRGB, NULL, &bm); expect(InvalidParameter, stat); - - expect(NULL, bm); + ok( !bm, "expected null bitmap\n" ); bm = (GpBitmap*)0xdeadbeef; stat = GdipCreateBitmapFromScan0(-10, 10, 10, PixelFormat24bppRGB, NULL, &bm); expect(InvalidParameter, stat); - - expect(NULL, bm); + ok( !bm, "expected null bitmap\n" ); bm = (GpBitmap*)0xdeadbeef; stat = GdipCreateBitmapFromScan0(10, 0, 10, PixelFormat24bppRGB, NULL, &bm); expect(InvalidParameter, stat); - - expect(NULL, bm); + ok( !bm, "expected null bitmap\n" ); bm = NULL; stat = GdipCreateBitmapFromScan0(10, 10, 12, PixelFormat24bppRGB, buff, &bm); @@ -67,12 +64,12 @@ static void test_Scan0(void) bm = (GpBitmap*) 0xdeadbeef; stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, buff, &bm); expect(InvalidParameter, stat); - expect(NULL, bm); + ok( !bm, "expected null bitmap\n" ); bm = (GpBitmap*)0xdeadbeef; stat = GdipCreateBitmapFromScan0(10, 10, 0, PixelFormat24bppRGB, buff, &bm); expect(InvalidParameter, stat); - expect(0xdeadbeef, bm); + ok( bm == (GpBitmap*)0xdeadbeef, "expected deadbeef bitmap\n" ); bm = NULL; stat = GdipCreateBitmapFromScan0(10, 10, -8, PixelFormat24bppRGB, buff, &bm); @@ -86,7 +83,7 @@ static void test_Scan0(void) bm = (GpBitmap*)0xdeadbeef; stat = GdipCreateBitmapFromScan0(10, 10, -10, PixelFormat24bppRGB, buff, &bm); expect(InvalidParameter, stat); - expect(NULL, bm); + ok( !bm, "expected null bitmap\n" ); } static void test_GetImageDimension(void) diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index d75e510f9e4..d2f33f0f4ad 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -275,6 +275,83 @@ static void test_customcap(void) GdipDeletePen(pen); } +static void test_penfilltype(void) +{ + GpPen *pen; + GpSolidFill *solid; + GpLineGradient *line; + GpPointF a, b; + GpStatus status; + GpPenType type; + + /* NULL */ + status = GdipGetPenFillType(NULL, NULL); + expect(InvalidParameter, status); + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + status = GdipGetPenFillType(pen, NULL); + expect(InvalidParameter, status); + + /* created with GdipCreatePen1() */ + status = GdipGetPenFillType(pen, &type); + expect(Ok, status); + expect(PenTypeSolidColor, type); + GdipDeletePen(pen); + + /* based on SolidBrush */ + status = GdipCreateSolidFill((ARGB)0xffff00ff, &solid); + expect(Ok, status); + status = GdipCreatePen2((GpBrush*)solid, 10.0f, UnitPixel, &pen); + expect(Ok, status); + status = GdipGetPenFillType(pen, &type); + expect(Ok, status); + expect(PenTypeSolidColor, type); + GdipDeletePen(pen); + GdipDeleteBrush((GpBrush*)solid); + + /* based on LinearGradientBrush */ + a.X = a.Y = 0.0; + b.X = b.Y = 10.0; + status = GdipCreateLineBrush(&a, &b, (ARGB)0xffff00ff, (ARGB)0xffff0000, + WrapModeTile, &line); + expect(Ok, status); + status = GdipCreatePen2((GpBrush*)line, 10.0f, UnitPixel, &pen); + expect(Ok, status); + status = GdipGetPenFillType(pen, &type); + expect(Ok, status); + expect(PenTypeLinearGradient, type); + GdipDeletePen(pen); + GdipDeleteBrush((GpBrush*)line); +} + +static void test_compoundarray(void) +{ + GpStatus status; + GpPen *pen; + static const REAL testvalues[] = {0.2, 0.4, 0.6, 0.8}; + + status = GdipSetPenCompoundArray(NULL, testvalues, 4); + expect(InvalidParameter, status); + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + + status = GdipSetPenCompoundArray(pen, NULL, 4); + expect(InvalidParameter, status); + status = GdipSetPenCompoundArray(pen, testvalues, 3); + expect(InvalidParameter, status); + status = GdipSetPenCompoundArray(pen, testvalues, 0); + expect(InvalidParameter, status); + status = GdipSetPenCompoundArray(pen, testvalues, -2); + expect(InvalidParameter, status); + + status = GdipSetPenCompoundArray(pen, testvalues, 4); + todo_wine expect(Ok, status); + + GdipDeletePen(pen); +} + START_TEST(pen) { struct GdiplusStartupInput gdiplusStartupInput; @@ -294,6 +371,8 @@ START_TEST(pen) test_brushfill(); test_dasharray(); test_customcap(); + test_penfilltype(); + test_compoundarray(); GdiplusShutdown(gdiplusToken); } diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 34024be7b57..13736343393 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -765,7 +765,7 @@ todo_wine{ } GdipDeleteRegion(region); - DeleteObject((HGDIOBJ)hrgn); + DeleteObject(hrgn); /* ellipse */ hrgn = CreateEllipticRgn(0, 0, 100, 10); @@ -791,7 +791,7 @@ todo_wine{ expect_dword(buf + 8, 0x00006000); /* ?? */ } GdipDeleteRegion(region); - DeleteObject((HGDIOBJ)hrgn); + DeleteObject(hrgn); } static void test_gethrgn(void) @@ -806,6 +806,10 @@ static void test_gethrgn(void) static const RECT test_rect = {10, 11, 20, 21}; static const GpRectF test_rectF = {10.0, 11.0, 10.0, 10.0}; static const RECT scaled_rect = {20, 22, 40, 42}; + static const RECT test_rect2 = {10, 21, 20, 31}; + static const GpRectF test_rect2F = {10.0, 21.0, 10.0, 10.0}; + static const RECT test_rect3 = {10, 11, 20, 31}; + static const GpRectF test_rect3F = {10.0, 11.0, 10.0, 20.0}; status = GdipCreateFromHDC(hdc, &graphics); ok(status == Ok, "status %08x\n", status); @@ -867,6 +871,51 @@ static void test_gethrgn(void) verify_region(hrgn, &scaled_rect); DeleteObject(hrgn); + status = GdipSetInfinite(region); + ok(status == Ok, "status %08x\n", status); + status = GdipCombineRegionRect(region, &test_rectF, CombineModeIntersect); + ok(status == Ok, "status %08x\n", status); + status = GdipGetRegionHRgn(region, NULL, &hrgn); + ok(status == Ok, "status %08x\n", status); + verify_region(hrgn, &test_rect); + DeleteObject(hrgn); + + status = GdipCombineRegionRect(region, &test_rectF, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + status = GdipCombineRegionRect(region, &test_rect2F, CombineModeUnion); + ok(status == Ok, "status %08x\n", status); + status = GdipGetRegionHRgn(region, NULL, &hrgn); + ok(status == Ok, "status %08x\n", status); + verify_region(hrgn, &test_rect3); + DeleteObject(hrgn); + + status = GdipCombineRegionRect(region, &test_rect3F, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + status = GdipCombineRegionRect(region, &test_rect2F, CombineModeXor); + ok(status == Ok, "status %08x\n", status); + status = GdipGetRegionHRgn(region, NULL, &hrgn); + ok(status == Ok, "status %08x\n", status); + verify_region(hrgn, &test_rect); + DeleteObject(hrgn); + + status = GdipCombineRegionRect(region, &test_rect3F, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + status = GdipCombineRegionRect(region, &test_rectF, CombineModeExclude); + ok(status == Ok, "status %08x\n", status); + status = GdipGetRegionHRgn(region, NULL, &hrgn); + ok(status == Ok, "status %08x\n", status); + verify_region(hrgn, &test_rect2); + DeleteObject(hrgn); + + status = GdipCombineRegionRect(region, &test_rectF, CombineModeReplace); + ok(status == Ok, "status %08x\n", status); + status = GdipCombineRegionRect(region, &test_rect3F, CombineModeComplement); + ok(status == Ok, "status %08x\n", status); + status = GdipGetRegionHRgn(region, NULL, &hrgn); + ok(status == Ok, "status %08x\n", status); + verify_region(hrgn, &test_rect2); + DeleteObject(hrgn); + status = GdipDeletePath(path); ok(status == Ok, "status %08x\n", status); status = GdipDeleteRegion(region); diff --git a/dlls/gphoto2.ds/gphoto2_Si.rc b/dlls/gphoto2.ds/gphoto2_Si.rc index 440b0f8fff2..87d969f8e12 100644 --- a/dlls/gphoto2.ds/gphoto2_Si.rc +++ b/dlls/gphoto2.ds/gphoto2_Si.rc @@ -42,7 +42,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTE CAPTION "Prenos" FONT 8, "MS Sans Serif" BEGIN - LTEXT "Prenašam... Prosim, počakajte",IDC_STATIC,5,19,176,8, SS_CENTER + LTEXT "Prenašam ... Prosim, počakajte",IDC_STATIC,5,19,176,8, SS_CENTER END IDD_CONNECTING DIALOG DISCARDABLE 0, 0, 280, 116 @@ -51,7 +51,7 @@ CAPTION "Povezovanje" FONT 8, "MS Sans Serif" BEGIN CONTROL "",IDC_BITMAP,"Static",SS_BITMAP|SS_CENTERIMAGE,4,4,110,110 - LTEXT "Povezujem se s kamero... Prosim, počakajte",IDC_STATIC,128,58, + LTEXT "Povezujem se s kamero ... Prosim, počakajte",IDC_STATIC,128,58, 116,8 END diff --git a/dlls/gphoto2.ds/gphoto2_i.h b/dlls/gphoto2.ds/gphoto2_i.h index 89c4bc08a33..8312815c6e2 100644 --- a/dlls/gphoto2.ds/gphoto2_i.h +++ b/dlls/gphoto2.ds/gphoto2_i.h @@ -103,16 +103,6 @@ struct tagActiveDS /* Helper functions */ extern TW_UINT16 GPHOTO2_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action); -/* */ -extern TW_UINT16 GPHOTO2_ControlGroupHandler ( - pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); -extern TW_UINT16 GPHOTO2_ImageGroupHandler ( - pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); -extern TW_UINT16 GPHOTO2_AudioGroupHandler ( - pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); -extern TW_UINT16 GPHOTO2_SourceManagerHandler ( - pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); - /* Implementation of operation triplets * From Application to Source (Control Information) */ TW_UINT16 GPHOTO2_CapabilityGet (pTW_IDENTITY pOrigin, TW_MEMREF pData); diff --git a/dlls/gphoto2.ds/gphoto2_main.c b/dlls/gphoto2.ds/gphoto2_main.c index f4f454633b2..c0238283303 100644 --- a/dlls/gphoto2.ds/gphoto2_main.c +++ b/dlls/gphoto2.ds/gphoto2_main.c @@ -311,7 +311,7 @@ static TW_UINT16 GPHOTO2_SourceControlHandler ( } -TW_UINT16 GPHOTO2_ImageGroupHandler ( +static TW_UINT16 GPHOTO2_ImageGroupHandler ( pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, diff --git a/dlls/gphoto2.ds/ui.c b/dlls/gphoto2.ds/ui.c index e9d2f874c0f..40afb9e5a32 100644 --- a/dlls/gphoto2.ds/ui.c +++ b/dlls/gphoto2.ds/ui.c @@ -39,8 +39,8 @@ #include "wine/debug.h" #include "resource.h" -LPCSTR settings_key = "Software\\Wine\\Gphoto2"; -LPCSTR settings_value = "SkipUI"; +static const char settings_key[] = "Software\\Wine\\Gphoto2"; +static const char settings_value[] = "SkipUI"; static BOOL disable_dialog; static HBITMAP static_bitmap; diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 0b6480988f9..6390edf42b6 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -62,7 +62,7 @@ KIRQL WINAPI KfAcquireSpinLock(PKSPIN_LOCK SpinLock) { FIXME( "(%p) stub!\n", SpinLock ); - return (KIRQL)0; + return 0; } @@ -86,7 +86,7 @@ KIRQL WINAPI KfRaiseIrql(KIRQL NewIrql) { FIXME( "(%u) stub!\n", NewIrql ); - return (KIRQL)0; + return 0; } diff --git a/dlls/hlink/tests/hlink.c b/dlls/hlink/tests/hlink.c index 89b7c7a954b..5e07359fdf5 100644 --- a/dlls/hlink/tests/hlink.c +++ b/dlls/hlink/tests/hlink.c @@ -351,6 +351,7 @@ static void test_persist_save_data(const char *testname, IHlink *lnk, const unsigned char *data; DWORD i; BOOL same; + unsigned int expected_data_win9x_size = 0; hr = IHlink_QueryInterface(lnk, &IID_IPersistStream, (void **)&ps); ok(hr == S_OK, "IHlink_QueryInterface failed with error 0x%08x\n", hr); @@ -368,8 +369,13 @@ static void test_persist_save_data(const char *testname, IHlink *lnk, data = GlobalLock(hglobal); + if (expected_data_size % 4) + expected_data_win9x_size = 4 * ((expected_data_size / 4) + 1); + /* first check we have the right amount of data */ - ok((data_size == expected_data_size) || (data_size == expected_data_alt_size), + ok((data_size == expected_data_size) || + (data_size == expected_data_alt_size) || + broken(data_size == expected_data_win9x_size), /* Win9x and WinMe */ "%s: Size of saved data differs (expected %d or %d, actual %d)\n", testname, expected_data_size, expected_data_alt_size, data_size); diff --git a/dlls/iccvid/iccvid.c b/dlls/iccvid/iccvid.c index 19faf1db2ee..77328eabcda 100644 --- a/dlls/iccvid/iccvid.c +++ b/dlls/iccvid/iccvid.c @@ -390,13 +390,13 @@ static void decode_cinepak(cinepak_info *cvinfo, unsigned char *buf, int size, unsigned long x, y, y_bottom, frame_flags, strips, cv_width, cv_height, cnum, strip_id, chunk_id, x0, y0, x1, y1, ci, flag, mask; long len, top_size, chunk_size; - unsigned char *frm_ptr, *frm_end; + unsigned char *frm_ptr; unsigned int i, cur_strip; int d0, d1, d2, d3, frm_stride, bpp = 3; fn_cvid_v1 cvid_v1 = cvid_v1_24; fn_cvid_v4 cvid_v4 = cvid_v4_24; - x = y = 0; + y = 0; y_bottom = 0; in_buffer = buf; @@ -431,7 +431,6 @@ static void decode_cinepak(cinepak_info *cvinfo, unsigned char *buf, int size, frm_stride = width * bpp; frm_ptr = frame; - frm_end = frm_ptr + width * height * bpp; if(len != size) { diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 3ed6411ceba..3b7f7a402aa 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -423,7 +423,7 @@ static HIMCC ImmCreateBlankCompStr(void) HIMCC rc; LPCOMPOSITIONSTRING ptr; rc = ImmCreateIMCC(sizeof(COMPOSITIONSTRING)); - ptr = (LPCOMPOSITIONSTRING)ImmLockIMCC(rc); + ptr = ImmLockIMCC(rc); memset(ptr,0,sizeof(COMPOSITIONSTRING)); ptr->dwSize = sizeof(COMPOSITIONSTRING); ImmUnlockIMCC(rc); @@ -451,7 +451,7 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC) if (hWnd) { - old = (HIMC)RemovePropW(hWnd,szwWineIMCProperty); + old = RemovePropW(hWnd,szwWineIMCProperty); if (old == NULL) old = IMM_GetThreadData()->defaultContext; @@ -463,7 +463,7 @@ HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC) if (hIMC == NULL) /* Meaning disable imm for that window*/ SetPropW(hWnd,szwWineIMCProperty,(HANDLE)-1); else - SetPropW(hWnd,szwWineIMCProperty,(HANDLE)hIMC); + SetPropW(hWnd,szwWineIMCProperty,hIMC); } if (old) @@ -626,7 +626,7 @@ HIMC WINAPI ImmCreateContext(void) new_context->immKbd->uSelected++; TRACE("Created context 0x%x\n",(UINT)new_context); - return (HIMC)new_context; + return new_context; } static BOOL IMM_DestroyContext(HIMC hIMC) @@ -1298,7 +1298,7 @@ HIMC WINAPI ImmGetContext(HWND hWnd) if (!IMM_GetThreadData()->defaultContext) IMM_GetThreadData()->defaultContext = ImmCreateContext(); - rc = (HIMC)GetPropW(hWnd,szwWineIMCProperty); + rc = GetPropW(hWnd,szwWineIMCProperty); if (rc == (HIMC)-1) rc = NULL; else if (rc == NULL) @@ -2531,7 +2531,7 @@ HIMCC WINAPI ImmCreateIMCC(DWORD size) return NULL; internal->dwSize = size; - return (HIMCC)internal; + return internal; } /*********************************************************************** @@ -2618,7 +2618,7 @@ BOOL WINAPI ImmGenerateMessage(HIMC hIMC) LPTRANSMSG lpTransMsg; DWORD i; - lpTransMsg = (LPTRANSMSG)ImmLockIMCC(data->IMC.hMsgBuf); + lpTransMsg = ImmLockIMCC(data->IMC.hMsgBuf); for (i = 0; i < data->IMC.dwNumMsgBuf; i++) ImmInternalPostIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam); diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 29ac5530ecf..ce736390bbf 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -182,7 +182,7 @@ static void cleanup(void) { UnregisterClass(wndcls, GetModuleHandle(0)); } -static int test_ImmNotifyIME(void) { +static void test_ImmNotifyIME(void) { static const char string[] = "wine"; char resstr[16] = ""; HIMC imc; @@ -225,11 +225,9 @@ static int test_ImmNotifyIME(void) { msg_spy_flush_msgs(); ImmReleaseContext(hwnd, imc); - - return 0; } -static int test_ImmGetCompositionString(void) +static void test_ImmGetCompositionString(void) { HIMC imc; static const WCHAR string[] = {'w','i','n','e',0x65e5,0x672c,0x8a9e}; @@ -251,10 +249,50 @@ static int test_ImmGetCompositionString(void) ok(len==alen,"GCS_COMPATTR(A) not returning correct count\n"); } ImmReleaseContext(hwnd, imc); - return 0; } -static int test_ImmIME(void) +static void test_ImmSetCompositionString(void) +{ + HIMC imc; + BOOL ret; + + SetLastError(0xdeadbeef); + imc = ImmGetContext(hwnd); + ok(imc != 0, "ImmGetContext() failed. Last error: %u\n", GetLastError()); + if (!imc) + return; + + SetLastError(0xdeadbeef); + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, NULL, 0, NULL, 0); + todo_wine + ok(!ret, "ImmSetCompositionStringW() failed. Last error: %u\n", + GetLastError()); + + SetLastError(0xdeadbeef); + ret = ImmSetCompositionStringW(imc, SCS_SETSTR | SCS_CHANGEATTR, + NULL, 0, NULL, 0); + todo_wine + ok(!ret, "ImmSetCompositionStringW() failed. Last error: %u\n", + GetLastError()); + + SetLastError(0xdeadbeef); + ret = ImmSetCompositionStringW(imc, SCS_SETSTR | SCS_CHANGECLAUSE, + NULL, 0, NULL, 0); + todo_wine + ok(!ret, "ImmSetCompositionStringW() failed. Last error: %u\n", + GetLastError()); + + SetLastError(0xdeadbeef); + ret = ImmSetCompositionStringW(imc, SCS_CHANGEATTR | SCS_CHANGECLAUSE, + NULL, 0, NULL, 0); + todo_wine + ok(!ret, "ImmSetCompositionStringW() failed. Last error: %u\n", + GetLastError()); + + ImmReleaseContext(hwnd, imc); +} + +static void test_ImmIME(void) { HIMC imc; @@ -268,7 +306,6 @@ static int test_ImmIME(void) ok (rc == 0, "ImmConfigureIMEW did not fail\n"); } ImmReleaseContext(hwnd,imc); - return 0; } START_TEST(imm32) { @@ -276,6 +313,7 @@ START_TEST(imm32) { { test_ImmNotifyIME(); test_ImmGetCompositionString(); + test_ImmSetCompositionString(); test_ImmIME(); } cleanup(); diff --git a/dlls/inetcomm/pop3transport.c b/dlls/inetcomm/pop3transport.c index 037716421bf..b0e31df6449 100644 --- a/dlls/inetcomm/pop3transport.c +++ b/dlls/inetcomm/pop3transport.c @@ -460,7 +460,7 @@ static void POP3Transport_CallbackRecvRSETResp(IInternetTransport *iface, char * InternetTransport_ReadLine(&This->InetTransport, POP3Transport_CallbackProcessRSETResp); } -void POP3Transport_CallbackProcessRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer) +static void POP3Transport_CallbackProcessRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer) { POP3Transport *This = (POP3Transport *)iface; POP3RESPONSE response; diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c index a5858ca7008..b868603111f 100644 --- a/dlls/iphlpapi/icmp.c +++ b/dlls/iphlpapi/icmp.c @@ -27,8 +27,6 @@ * - Not all IP options are supported. * - Are ICMP handles real handles, i.e. inheritable and all? There might be some * more work to do here, including server side stuff with synchronization. - * - Is it correct to use malloc for the internal buffer, for allocating the - * handle's structure? * - This API should probably be thread safe. Is it really? * - Using the winsock functions has not been tested. */ diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c index 8251151f871..27393b82a83 100644 --- a/dlls/iphlpapi/tests/iphlpapi.c +++ b/dlls/iphlpapi/tests/iphlpapi.c @@ -225,7 +225,7 @@ static void testGetIpAddrTable(void) "GetIpAddrTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_IPADDRTABLE buf = (PMIB_IPADDRTABLE)malloc(dwSize); + PMIB_IPADDRTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); apiReturn = gGetIpAddrTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, @@ -233,7 +233,7 @@ static void testGetIpAddrTable(void) apiReturn); if (apiReturn == NO_ERROR && buf->dwNumEntries) testGetIfEntry(buf->table[0].dwIndex); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } @@ -257,13 +257,13 @@ static void testGetIfTable(void) "GetIfTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_IFTABLE buf = (PMIB_IFTABLE)malloc(dwSize); + PMIB_IFTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); apiReturn = gGetIfTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetIfTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n\n", apiReturn); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } @@ -287,13 +287,13 @@ static void testGetIpForwardTable(void) "GetIpForwardTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_IPFORWARDTABLE buf = (PMIB_IPFORWARDTABLE)malloc(dwSize); + PMIB_IPFORWARDTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); apiReturn = gGetIpForwardTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetIpForwardTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } @@ -319,13 +319,13 @@ static void testGetIpNetTable(void) if (apiReturn == ERROR_NO_DATA) ; /* empty ARP table's okay */ else if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_IPNETTABLE buf = (PMIB_IPNETTABLE)malloc(dwSize); + PMIB_IPNETTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); apiReturn = gGetIpNetTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetIpNetTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } @@ -437,13 +437,13 @@ static void testGetTcpTable(void) "GetTcpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PMIB_TCPTABLE buf = (PMIB_TCPTABLE)malloc(dwSize); + PMIB_TCPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); apiReturn = gGetTcpTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetTcpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } @@ -467,13 +467,13 @@ static void testGetUdpTable(void) "GetUdpTable(NULL, &dwSize, FALSE) returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn != ERROR_INSUFFICIENT_BUFFER) { - PMIB_UDPTABLE buf = (PMIB_UDPTABLE)malloc(dwSize); + PMIB_UDPTABLE buf = HeapAlloc(GetProcessHeap(), 0, dwSize); apiReturn = gGetUdpTable(buf, &dwSize, FALSE); ok(apiReturn == NO_ERROR, "GetUdpTable(buf, &dwSize, FALSE) returned %d, expected NO_ERROR\n", apiReturn); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } @@ -527,13 +527,13 @@ static void testGetInterfaceInfo(void) "GetInterfaceInfo returned %d, expected ERROR_INSUFFICIENT_BUFFER\n", apiReturn); if (apiReturn == ERROR_INSUFFICIENT_BUFFER) { - PIP_INTERFACE_INFO buf = (PIP_INTERFACE_INFO)malloc(len); + PIP_INTERFACE_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); apiReturn = gGetInterfaceInfo(buf, &len); ok(apiReturn == NO_ERROR, "GetInterfaceInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } @@ -559,13 +559,13 @@ static void testGetAdaptersInfo(void) if (apiReturn == ERROR_NO_DATA) ; /* no adapter's, that's okay */ else if (apiReturn == ERROR_BUFFER_OVERFLOW) { - PIP_ADAPTER_INFO buf = (PIP_ADAPTER_INFO)malloc(len); + PIP_ADAPTER_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); apiReturn = gGetAdaptersInfo(buf, &len); ok(apiReturn == NO_ERROR, "GetAdaptersInfo(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } @@ -589,13 +589,13 @@ static void testGetNetworkParams(void) "GetNetworkParams returned %d, expected ERROR_BUFFER_OVERFLOW\n", apiReturn); if (apiReturn == ERROR_BUFFER_OVERFLOW) { - PFIXED_INFO buf = (PFIXED_INFO)malloc(len); + PFIXED_INFO buf = HeapAlloc(GetProcessHeap(), 0, len); apiReturn = gGetNetworkParams(buf, &len); ok(apiReturn == NO_ERROR, "GetNetworkParams(buf, &dwSize) returned %d, expected NO_ERROR\n", apiReturn); - free(buf); + HeapFree(GetProcessHeap(), 0, buf); } } } diff --git a/dlls/itss/chm_lib.c b/dlls/itss/chm_lib.c index 3b98d5e781e..6b80ef2b92a 100644 --- a/dlls/itss/chm_lib.c +++ b/dlls/itss/chm_lib.c @@ -723,7 +723,7 @@ struct chmFile *chm_openW(const WCHAR *filename) /* read and verify header */ sremain = _CHM_ITSF_V3_LEN; sbufpos = sbuffer; - if (_chm_fetch_bytes(newHandle, sbuffer, (UInt64)0, sremain) != sremain || + if (_chm_fetch_bytes(newHandle, sbuffer, 0, sremain) != sremain || !_unmarshal_itsf_header(&sbufpos, &sremain, &itsfHeader)) { chm_close(newHandle); @@ -1210,7 +1210,7 @@ static Int64 _chm_decompress_block(struct chmFile *h, fprintf(stderr, " (DECOMPRESS FAILED!)\n"); #endif HeapFree(GetProcessHeap(), 0, cbuffer); - return (Int64)0; + return 0; } h->lzx_last_block = (int)curBlockIdx; @@ -1250,7 +1250,7 @@ static Int64 _chm_decompress_block(struct chmFile *h, fprintf(stderr, " (DECOMPRESS FAILED!)\n"); #endif HeapFree(GetProcessHeap(), 0, cbuffer); - return (Int64)0; + return 0; } h->lzx_last_block = (int)block; @@ -1273,7 +1273,7 @@ static Int64 _chm_decompress_region(struct chmFile *h, UChar *ubuffer = NULL; if (len <= 0) - return (Int64)0; + return 0; /* figure out what we need to read */ nBlock = start / h->reset_table.block_len; @@ -1323,11 +1323,11 @@ LONGINT64 chm_retrieve_object(struct chmFile *h, { /* must be valid file handle */ if (h == NULL) - return (Int64)0; + return 0; /* starting address must be in correct range */ if (addr >= ui->length) - return (Int64)0; + return 0; /* clip length */ if (addr + len > ui->length) diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index 5e94f95bf8c..8f0802e8e93 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c @@ -47,7 +47,7 @@ static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; -const WCHAR default_separatorW[] = {',',0}; +static const WCHAR default_separatorW[] = {',',0}; static HRESULT Array_length(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index ecf62aea784..063bd609fc0 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -278,7 +278,7 @@ static HRESULT disp_cmp(IDispatch *disp1, IDispatch *disp2, BOOL *ret) } /* ECMA-262 3rd Edition 11.9.6 */ -HRESULT equal2_values(VARIANT *lval, VARIANT *rval, BOOL *ret) +static HRESULT equal2_values(VARIANT *lval, VARIANT *rval, BOOL *ret) { TRACE("\n"); diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index c96f8a3ebed..9f3b6d4b51e 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -110,8 +110,8 @@ struct statement_list_t { statement_t *tail; }; -statement_list_t *new_statement_list(parser_ctx_t*,statement_t*); -statement_list_t *statement_list_add(statement_list_t*,statement_t*); +static statement_list_t *new_statement_list(parser_ctx_t*,statement_t*); +static statement_list_t *statement_list_add(statement_list_t*,statement_t*); typedef struct _parameter_list_t { parameter_t *head; @@ -1493,7 +1493,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t *sourc return source_elements; } -statement_list_t *new_statement_list(parser_ctx_t *ctx, statement_t *statement) +static 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)); @@ -1502,7 +1502,7 @@ statement_list_t *new_statement_list(parser_ctx_t *ctx, statement_t *statement) return ret; } -statement_list_t *statement_list_add(statement_list_t *list, statement_t *statement) +static statement_list_t *statement_list_add(statement_list_t *list, statement_t *statement) { list->tail = list->tail->next = statement; diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c index 9187b46ef10..c531f26eac2 100644 --- a/dlls/jscript/regexp.c +++ b/dlls/jscript/regexp.c @@ -181,7 +181,7 @@ typedef enum REOp { #define REOP_IS_SIMPLE(op) ((op) <= REOP_NCLASS) -const char *reop_names[] = { +static const char *reop_names[] = { "empty", "bol", "eol", diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 5c074e8bf69..5e93fa275dc 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -123,6 +123,33 @@ static HRESULT String_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR return String_toString(dispex, lcid, flags, dp, retv, ei, sp); } +static HRESULT do_attributeless_tag_format(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, + VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp, const WCHAR *tagname) +{ + static const WCHAR tagfmt[] = {'<','%','s','>','%','s','<','/','%','s','>',0}; + StringInstance *string; + BSTR ret; + + if(!is_class(dispex, JSCLASS_STRING)) { + WARN("this is not a string object\n"); + return E_NOTIMPL; + } + + string = (StringInstance*)dispex; + + if(retv) { + ret = SysAllocStringLen(NULL, string->length + 2*strlenW(tagname) + 5); + if(!ret) + return E_OUTOFMEMORY; + + sprintfW(ret, tagfmt, tagname, string->str, tagname); + + V_VT(retv) = VT_BSTR; + V_BSTR(retv) = ret; + } + return S_OK; +} + static HRESULT String_anchor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -133,22 +160,22 @@ static HRESULT String_anchor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA static HRESULT String_big(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR bigtagW[] = {'B','I','G',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, bigtagW); } static HRESULT String_blink(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR blinktagW[] = {'B','L','I','N','K',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, blinktagW); } static HRESULT String_bold(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR boldtagW[] = {'B',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, boldtagW); } /* ECMA-262 3rd Edition 15.5.4.5 */ @@ -302,8 +329,8 @@ static HRESULT String_concat(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA static HRESULT String_fixed(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR fixedtagW[] = {'T','T',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, fixedtagW); } static HRESULT String_fontcolor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -391,8 +418,8 @@ static HRESULT String_indexOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR static HRESULT String_italics(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR italicstagW[] = {'I',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, italicstagW); } static HRESULT String_lastIndexOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -839,8 +866,8 @@ static HRESULT String_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM static HRESULT String_small(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR smalltagW[] = {'S','M','A','L','L',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, smalltagW); } static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -970,8 +997,8 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM static HRESULT String_strike(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR striketagW[] = {'S','T','R','I','K','E',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, striketagW); } static HRESULT String_sub(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 4f843ec7ad0..1a0a88d213f 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -269,6 +269,69 @@ ok(tmp === "TEST", "''.toUpperCase() = " + tmp); tmp = "tEsT".toUpperCase(3); ok(tmp === "TEST", "''.toUpperCase(3) = " + tmp); +tmp = "".big(); +ok(tmp === "", "''.big() = " + tmp); +tmp = "".big(3); +ok(tmp === "", "''.big(3) = " + tmp); +tmp = "test".big(); +ok(tmp === "test", "'test'.big() = " + tmp); +tmp = "test".big(3); +ok(tmp === "test", "'test'.big(3) = " + tmp); + +tmp = "".blink(); +ok(tmp === "", "''.blink() = " + tmp); +tmp = "".blink(3); +ok(tmp === "", "''.blink(3) = " + tmp); +tmp = "test".blink(); +ok(tmp === "test", "'test'.blink() = " + tmp); +tmp = "test".blink(3); +ok(tmp === "test", "'test'.blink(3) = " + tmp); + +tmp = "".bold(); +ok(tmp === "", "''.bold() = " + tmp); +tmp = "".bold(3); +ok(tmp === "", "''.bold(3) = " + tmp); +tmp = "test".bold(); +ok(tmp === "test", "'test'.bold() = " + tmp); +tmp = "test".bold(3); +ok(tmp === "test", "'test'.bold(3) = " + tmp); + +tmp = "".fixed(); +ok(tmp === "", "''.fixed() = " + tmp); +tmp = "".fixed(3); +ok(tmp === "", "''.fixed(3) = " + tmp); +tmp = "test".fixed(); +ok(tmp === "test", "'test'.fixed() = " + tmp); +tmp = "test".fixed(3); +ok(tmp === "test", "'test'.fixed(3) = " + tmp); + +tmp = "".italics(); +ok(tmp === "", "''.italics() = " + tmp); +tmp = "".italics(3); +ok(tmp === "", "''.italics(3) = " + tmp); +tmp = "test".italics(); +ok(tmp === "test", "'test'.italics() = " + tmp); +tmp = "test".italics(3); +ok(tmp === "test", "'test'.italics(3) = " + tmp); + +tmp = "".small(); +ok(tmp === "", "''.small() = " + tmp); +tmp = "".small(3); +ok(tmp === "", "''.small(3) = " + tmp); +tmp = "test".small(); +ok(tmp === "test", "'test'.small() = " + tmp); +tmp = "test".small(3); +ok(tmp === "test", "'test'.small(3) = " + tmp); + +tmp = "".strike(); +ok(tmp === "", "''.strike() = " + tmp); +tmp = "".strike(3); +ok(tmp === "", "''.strike(3) = " + tmp); +tmp = "test".strike(); +ok(tmp === "test", "'test'.strike() = " + tmp); +tmp = "test".strike(3); +ok(tmp === "test", "'test'.strike(3) = " + tmp); + var arr = new Array(); ok(typeof(arr) === "object", "arr () is not object"); ok((arr.length === 0), "arr.length is not 0"); diff --git a/dlls/kernel32/computername.c b/dlls/kernel32/computername.c index 5e811f87551..7ddbac8ef0f 100644 --- a/dlls/kernel32/computername.c +++ b/dlls/kernel32/computername.c @@ -268,7 +268,7 @@ void COMPUTERNAME_Init (void) dot = strchr ( hbuf, '.' ); if ( dot ) *dot = 0; hlen = strlen ( hbuf ); - len = MultiByteToWideChar( CP_ACP, 0, hbuf, hlen + 1, computer_name, MAX_COMPUTERNAME_LENGTH + 1 ) + len = MultiByteToWideChar( CP_UNIXCP, 0, hbuf, hlen + 1, computer_name, MAX_COMPUTERNAME_LENGTH + 1 ) * sizeof( WCHAR ); if ( NtSetValueKey( hsubkey, &nameW, 0, REG_SZ, computer_name, len ) != STATUS_SUCCESS ) WARN ( "failed to set ComputerName\n" ); diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c index 9931c09b1de..12401042caf 100644 --- a/dlls/kernel32/heap.c +++ b/dlls/kernel32/heap.c @@ -1142,7 +1142,7 @@ void WINAPI __regs_AllocMappedBuffer( CONTEXT86 *context /* [in] EDI register: size of buffer to allocate */ ) { HGLOBAL handle = GlobalAlloc(0, context->Edi + 8); - DWORD *buffer = (DWORD *)GlobalLock(handle); + DWORD *buffer = GlobalLock(handle); DWORD ptr = 0; if (buffer) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 808635dccc6..8100b921a6d 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -920,7 +920,7 @@ @ stdcall ResetWriteWatch(ptr long) @ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error @ stdcall ResumeThread(long) -# @ stub RtlCaptureContext ( -> ntdll.RtlCaptureContext) +@ stdcall -register RtlCaptureContext(ptr) ntdll.RtlCaptureContext # @ stub RtlCaptureStackBackTrace ( -> ntdll.RtlCaptureStackBackTrace) @ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory @ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory diff --git a/dlls/kernel32/ne_module.c b/dlls/kernel32/ne_module.c index 0342a5cf5eb..75de4428569 100644 --- a/dlls/kernel32/ne_module.c +++ b/dlls/kernel32/ne_module.c @@ -706,7 +706,7 @@ static HMODULE16 build_module( const void *mapping, SIZE_T mapping_size, LPCSTR if (!hModule) return ERROR_BAD_FORMAT; FarSetOwner16( hModule, hModule ); - pModule = (NE_MODULE *)GlobalLock16( hModule ); + pModule = GlobalLock16( hModule ); memcpy( pModule, ne_header, sizeof(*ne_header) ); pModule->count = 0; /* check programs for default minimal stack size */ @@ -846,7 +846,7 @@ static BOOL NE_LoadDLLs( NE_MODULE *pModule ) { int i; WORD *pModRef = (WORD *)((char *)pModule + pModule->ne_modtab); - WORD *pDLLs = (WORD *)GlobalLock16( pModule->dlls_to_init ); + WORD *pDLLs = GlobalLock16( pModule->dlls_to_init ); for (i = 0; i < pModule->ne_cmod; i++, pModRef++) { @@ -2014,7 +2014,7 @@ static HMODULE16 create_dummy_module( HMODULE module32 ) if (!hModule) return ERROR_BAD_FORMAT; FarSetOwner16( hModule, hModule ); - pModule = (NE_MODULE *)GlobalLock16( hModule ); + pModule = GlobalLock16( hModule ); /* Set all used entries */ pModule->ne_magic = IMAGE_OS2_SIGNATURE; @@ -2120,11 +2120,11 @@ HMODULE16 WINAPI MapHModuleLS(HMODULE hmod) return TASK_GetCurrent()->hInstance; if (!HIWORD(hmod)) return LOWORD(hmod); /* we already have a 16 bit module handle */ - pModule = (NE_MODULE*)GlobalLock16(hFirstModule); + pModule = GlobalLock16(hFirstModule); while (pModule) { if (pModule->module32 == hmod) return pModule->self; - pModule = (NE_MODULE*)GlobalLock16(pModule->next); + pModule = GlobalLock16(pModule->next); } if ((ret = create_dummy_module( hmod )) < 32) { @@ -2145,7 +2145,7 @@ HMODULE WINAPI MapHModuleSL(HMODULE16 hmod) TDB *pTask = TASK_GetCurrent(); hmod = pTask->hModule; } - pModule = (NE_MODULE*)GlobalLock16(hmod); + pModule = GlobalLock16(hmod); if ((pModule->ne_magic != IMAGE_OS2_SIGNATURE) || !(pModule->ne_flags & NE_FFLAGS_WIN32)) return 0; return pModule->module32; diff --git a/dlls/kernel32/ne_segment.c b/dlls/kernel32/ne_segment.c index 8a3497eb3aa..0ade4b0ae3c 100644 --- a/dlls/kernel32/ne_segment.c +++ b/dlls/kernel32/ne_segment.c @@ -724,7 +724,7 @@ void NE_InitializeDLLs( HMODULE16 hModule ) { HGLOBAL16 to_init = pModule->dlls_to_init; pModule->dlls_to_init = 0; - for (pDLL = (HMODULE16 *)GlobalLock16( to_init ); *pDLL; pDLL++) + for (pDLL = GlobalLock16( to_init ); *pDLL; pDLL++) { NE_InitializeDLLs( *pDLL ); } diff --git a/dlls/kernel32/resource16.c b/dlls/kernel32/resource16.c index b1369a5dbc7..5d745f8e012 100644 --- a/dlls/kernel32/resource16.c +++ b/dlls/kernel32/resource16.c @@ -203,7 +203,7 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, LPCSTR typeId, LPCSTR resId pTypeInfo->type_id, pNameInfo->id ); handle = LoadResource16( pModule->self, (HRSRC16)((char *)pNameInfo - (char *)pModule) ); - for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p)) + for(p = LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p)) { TRACE(" type=%04x '%s' id=%04x '%s'\n", p[1], (char *)(p+3), p[2], diff --git a/dlls/kernel32/snoop16.c b/dlls/kernel32/snoop16.c index 210f74c3c81..b3190886a69 100644 --- a/dlls/kernel32/snoop16.c +++ b/dlls/kernel32/snoop16.c @@ -203,7 +203,7 @@ SNOOP16_GetProcAddress16(HMODULE16 hmod,DWORD ordinal,FARPROC16 origfun) { /* Now search the non-resident names table */ if (!*cpnt && pModule->nrname_handle) { - cpnt = (unsigned char *)GlobalLock16( pModule->nrname_handle ); + cpnt = GlobalLock16( pModule->nrname_handle ); while (*cpnt) { cpnt += *cpnt + 1 + sizeof(WORD); if (*(WORD*)(cpnt+*cpnt+1) == ordinal) { diff --git a/dlls/kernel32/task.c b/dlls/kernel32/task.c index 553d1b338b4..af5fac322b5 100644 --- a/dlls/kernel32/task.c +++ b/dlls/kernel32/task.c @@ -209,7 +209,7 @@ static SEGPTR TASK_AllocThunk(void) TASK_CreateThunks( sel, 0, MIN_THUNKS ); pThunk->next = sel; } - pThunk = (THUNKS *)GlobalLock16( sel ); + pThunk = GlobalLock16( sel ); base = 0; } base += pThunk->free; @@ -236,7 +236,7 @@ static BOOL TASK_FreeThunk( SEGPTR thunk ) while (sel && (sel != HIWORD(thunk))) { sel = pThunk->next; - pThunk = (THUNKS *)GlobalLock16( sel ); + pThunk = GlobalLock16( sel ); base = 0; } if (!sel) return FALSE; @@ -937,7 +937,7 @@ static BOOL TASK_GetCodeSegment( FARPROC16 proc, NE_MODULE **ppModule, int segNr=0; /* Try pair of module handle / segment number */ - pModule = (NE_MODULE *) GlobalLock16( HIWORD( proc ) ); + pModule = GlobalLock16( HIWORD( proc ) ); if ( pModule && pModule->ne_magic == IMAGE_OS2_SIGNATURE ) { segNr = LOWORD( proc ); @@ -1100,7 +1100,7 @@ void WINAPI SwitchStackTo16( WORD seg, WORD ptr, WORD top ) INSTANCEDATA *pData; UINT16 copySize; - if (!(pData = (INSTANCEDATA *)GlobalLock16( seg ))) return; + if (!(pData = GlobalLock16( seg ))) return; TRACE("old=%04x:%04x new=%04x:%04x\n", SELECTOROF( NtCurrentTeb()->WOW32Reserved ), OFFSETOF( NtCurrentTeb()->WOW32Reserved ), seg, ptr ); @@ -1142,7 +1142,7 @@ void WINAPI SwitchStackBack16( CONTEXT86 *context ) STACK16FRAME *oldFrame, *newFrame; INSTANCEDATA *pData; - if (!(pData = (INSTANCEDATA *)GlobalLock16(SELECTOROF(NtCurrentTeb()->WOW32Reserved)))) + if (!(pData = GlobalLock16(SELECTOROF(NtCurrentTeb()->WOW32Reserved)))) return; if (!pData->old_ss_sp) { @@ -1243,7 +1243,7 @@ DWORD WINAPI GetCurPID16( DWORD unused ) */ INT16 WINAPI GetInstanceData16( HINSTANCE16 instance, WORD buffer, INT16 len ) { - char *ptr = (char *)GlobalLock16( instance ); + char *ptr = GlobalLock16( instance ); if (!ptr || !len) return 0; if ((int)buffer + len >= 0x10000) len = 0x10000 - buffer; memcpy( (char *)GlobalLock16(CURRENT_DS) + buffer, ptr + buffer, len ); diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index 0b943f29a0a..014f390be99 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -158,7 +158,11 @@ static void doDebugger(int argc, char** argv) else blackbox.debug_rc=TRUE; - get_events(logfile, &start_event, &done_event); + if (logfile) + { + get_events(logfile, &start_event, &done_event); + } + if (strstr(myARGV[2], "order")) { trace("debugger: waiting for the start signal...\n"); @@ -185,7 +189,10 @@ static void doDebugger(int argc, char** argv) else blackbox.detach_rc=TRUE; - save_blackbox(logfile, &blackbox, sizeof(blackbox)); + if (logfile) + { + save_blackbox(logfile, &blackbox, sizeof(blackbox)); + } trace("debugger: done debugging...\n"); SetEvent(done_event); diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 72976623a06..338ba464ec5 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -20,13 +20,13 @@ * */ +/* ReplaceFile requires Windows 2000 or newer */ +#define _WIN32_WINNT 0x0500 + #include #include #include -/* ReplaceFile requires Windows 2000 or newer */ -#define _WIN32_WINNT 0x0500 - #include "wine/test.h" #include "windef.h" #include "winbase.h" @@ -778,6 +778,16 @@ static void test_CreateFileW(void) OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_NOT_FOUND, "CreateFileW on invalid VxD name returned ret=%p error=%d\n",hFile,GetLastError()); + + ret = CreateDirectoryW(filename, NULL); + ok(ret == TRUE, "couldn't create temporary directory\n"); + hFile = CreateFileW(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, + OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL); + ok(hFile != INVALID_HANDLE_VALUE, + "expected CreateFile to succeed on existing directory, error: %d\n", GetLastError()); + CloseHandle(hFile); + ret = RemoveDirectoryW(filename); + ok(ret, "DeleteFileW: error %d\n", GetLastError()); } static void test_GetTempFileNameA(void) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 59588f81892..5187d882a45 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -523,11 +523,10 @@ static void test_ImportDescriptors(void) * */ for (; import_chunk->FirstThunk; import_chunk++) { - LPCSTR module_name = (LPCSTR) RVAToAddr( - import_chunk->Name, kernel32_module); - PIMAGE_THUNK_DATA name_table = (PIMAGE_THUNK_DATA) RVAToAddr( + LPCSTR module_name = RVAToAddr(import_chunk->Name, kernel32_module); + PIMAGE_THUNK_DATA name_table = RVAToAddr( U(*import_chunk).OriginalFirstThunk, kernel32_module); - PIMAGE_THUNK_DATA iat = (PIMAGE_THUNK_DATA) RVAToAddr( + PIMAGE_THUNK_DATA iat = RVAToAddr( import_chunk->FirstThunk, kernel32_module); ok(module_name != NULL, "Imported module name should not be NULL\n"); ok(name_table != NULL, diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index a68a8134b68..a4b6853317a 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 9f811bca9de..bb9afe35823 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -18,11 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define _WIN32_WINNT 0x500 #include #include #include #include -#define _WIN32_WINNT 0x500 #include #include "wine/test.h" diff --git a/dlls/localspl/localspl_main.c b/dlls/localspl/localspl_main.c index 7cadac3ac5d..4483ac88905 100644 --- a/dlls/localspl/localspl_main.c +++ b/dlls/localspl/localspl_main.c @@ -898,7 +898,7 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo * All Files for the Monitor must already be copied to %winsysdir% ("%SystemRoot%\system32") * */ -BOOL WINAPI fpAddMonitor(LPWSTR pName, DWORD Level, LPBYTE pMonitors) +static BOOL WINAPI fpAddMonitor(LPWSTR pName, DWORD Level, LPBYTE pMonitors) { monitor_t * pm = NULL; LPMONITOR_INFO_2W mi2w; @@ -1034,7 +1034,7 @@ static BOOL WINAPI fpAddPrinterDriverEx(LPWSTR pName, DWORD level, LPBYTE pDrive * */ -BOOL WINAPI fpDeleteMonitor(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMonitorName) +static BOOL WINAPI fpDeleteMonitor(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMonitorName) { HKEY hroot = NULL; LONG lres; @@ -1096,8 +1096,8 @@ BOOL WINAPI fpDeleteMonitor(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMonitorNa * Windows reads the Registry once and cache the Results. * */ -BOOL WINAPI fpEnumMonitors(LPWSTR pName, DWORD Level, LPBYTE pMonitors, DWORD cbBuf, - LPDWORD pcbNeeded, LPDWORD pcReturned) +static BOOL WINAPI fpEnumMonitors(LPWSTR pName, DWORD Level, LPBYTE pMonitors, DWORD cbBuf, + LPDWORD pcbNeeded, LPDWORD pcReturned) { DWORD numentries = 0; DWORD needed = 0; diff --git a/dlls/lz32/tests/lzexpand_main.c b/dlls/lz32/tests/lzexpand_main.c index 4d35ba37c71..187aa803c7a 100644 --- a/dlls/lz32/tests/lzexpand_main.c +++ b/dlls/lz32/tests/lzexpand_main.c @@ -371,7 +371,7 @@ static void test_LZOpenFileA(void) ok(test.cBytes == sizeof(OFSTRUCT), "LZOpenFileA set test.cBytes to %d\n", test.cBytes); ok(test.nErrCode == ERROR_SUCCESS || - test.nErrCode == ERROR_FILE_NOT_FOUND, /* win9x */ + broken(test.nErrCode != ERROR_SUCCESS), /* win9x */ "LZOpenFileA set test.nErrCode to %d\n", test.nErrCode); ok(lstrcmpA(test.szPathName, expected) == 0, "LZOpenFileA returned '%s', but was expected to return '%s'\n", diff --git a/dlls/mciavi32/info.c b/dlls/mciavi32/info.c index 0b5752a7548..247b37a95f6 100644 --- a/dlls/mciavi32/info.c +++ b/dlls/mciavi32/info.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mciavi); /************************************************************************** * MCIAVI_ConvertFrameToTimeFormat [internal] */ -DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet) +static DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet) { DWORD ret = 0; diff --git a/dlls/mciavi32/private_mciavi.h b/dlls/mciavi32/private_mciavi.h index 66003d761f4..548254c5a4f 100644 --- a/dlls/mciavi32/private_mciavi.h +++ b/dlls/mciavi32/private_mciavi.h @@ -85,7 +85,6 @@ typedef struct { extern HINSTANCE MCIAVI_hInstance; /* info.c */ -DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet); DWORD MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val); DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms); DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms); diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c index 5dc9051b177..00112b9ad26 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -283,7 +283,7 @@ static NTSTATUS query_unix_drive( const void *in_buff, SIZE_T insize, const char *device, *mount_point; int letter = tolowerW( input->letter ); NTSTATUS status; - DWORD size, type; + DWORD size, type = DEVICE_UNKNOWN; enum device_type device_type; char *ptr; diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 6bc27bc122b..526fdea952b 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -119,7 +119,7 @@ static REFIID tid_ids[] = { &IID_IOmNavigator }; -HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) +static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) { HRESULT hres; diff --git a/dlls/mshtml/htmlcomment.c b/dlls/mshtml/htmlcomment.c index 722cb14966e..4578361a6b1 100644 --- a/dlls/mshtml/htmlcomment.c +++ b/dlls/mshtml/htmlcomment.c @@ -66,16 +66,14 @@ static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface) static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo) { HTMLCommentElement *This = HTMLCOMMENT_THIS(iface); - FIXME("(%p)->(%p)\n", This, pctinfo); - return E_NOTIMPL; + return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo); } static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLCommentElement *This = HTMLCOMMENT_THIS(iface); - FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); - return E_NOTIMPL; + return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo); } static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *iface, REFIID riid, @@ -83,9 +81,7 @@ static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *ifac LCID lcid, DISPID *rgDispId) { HTMLCommentElement *This = HTMLCOMMENT_THIS(iface); - FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, - lcid, rgDispId); - return E_NOTIMPL; + return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId); } static HRESULT WINAPI HTMLCommentElement_Invoke(IHTMLCommentElement *iface, DISPID dispIdMember, @@ -93,9 +89,8 @@ static HRESULT WINAPI HTMLCommentElement_Invoke(IHTMLCommentElement *iface, DISP VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLCommentElement *This = HTMLCOMMENT_THIS(iface); - FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), - lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); - return E_NOTIMPL; + return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, + wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); } static HRESULT WINAPI HTMLCommentElement_put_text(IHTMLCommentElement *iface, BSTR v) @@ -144,7 +139,7 @@ static const IHTMLCommentElementVtbl HTMLCommentElementVtbl = { #define HTMLCOMMENT_NODE_THIS(iface) DEFINE_THIS2(HTMLCommentElement, element.node, iface) -HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) +static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) { HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface); @@ -161,7 +156,7 @@ HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) return S_OK; } -void HTMLCommentElement_destructor(HTMLDOMNode *iface) +static void HTMLCommentElement_destructor(HTMLDOMNode *iface) { HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface); diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index b88437d6c2a..d81fdb5a34b 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -73,6 +73,8 @@ static const WCHAR attrMarginLeft[] = {'m','a','r','g','i','n','-','l','e','f','t',0}; static const WCHAR attrMarginRight[] = {'m','a','r','g','i','n','-','r','i','g','h','t',0}; +static const WCHAR attrOverflow[] = + {'o','v','e','r','f','l','o','w',0}; static const WCHAR attrPaddingLeft[] = {'p','a','d','d','i','n','g','-','l','e','f','t',0}; static const WCHAR attrPosition[] = @@ -115,6 +117,7 @@ static const struct{ {attrMargin, DISPID_IHTMLSTYLE_MARGIN}, {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT}, {attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT}, + {attrOverflow, DISPID_IHTMLSTYLE_OVERFLOW}, {attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT}, {attrPosition, DISPID_IHTMLSTYLE2_POSITION}, {attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN}, @@ -281,7 +284,7 @@ HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, BSTR return S_OK; } -HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags) +static HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags) { nsAString str_value; const PRUnichar *value; @@ -366,7 +369,7 @@ static inline HRESULT set_style_pos(HTMLStyle *This, styleid_t sid, float value) return set_style_attr(This, sid, szValue, 0); } -HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p) +static HRESULT get_nsstyle_pos(HTMLStyle *This, styleid_t sid, float *p) { nsAString str_value; HRESULT hres; @@ -1733,15 +1736,34 @@ static HRESULT WINAPI HTMLStyle_get_zIndex(IHTMLStyle *iface, VARIANT *p) static HRESULT WINAPI HTMLStyle_put_overflow(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + static const WCHAR szVisible[] = {'v','i','s','i','b','l','e',0}; + static const WCHAR szScroll[] = {'s','c','r','o','l','l',0}; + static const WCHAR szHidden[] = {'h','i','d','d','e','n',0}; + static const WCHAR szAuto[] = {'a','u','t','o',0}; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + /* overflow can only be one of the follow values. */ + if(!v || strcmpiW(szVisible, v) == 0 || strcmpiW(szScroll, v) == 0 || + strcmpiW(szHidden, v) == 0 || strcmpiW(szAuto, v) == 0) + { + return set_nsstyle_attr(This->nsstyle, STYLEID_OVERFLOW, v, 0); + } + + return E_INVALIDARG; } + static HRESULT WINAPI HTMLStyle_get_overflow(IHTMLStyle *iface, BSTR *p) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_INVALIDARG; + + return get_style_attr(This, STYLEID_OVERFLOW, p); } static HRESULT WINAPI HTMLStyle_put_pageBreakBefore(IHTMLStyle *iface, BSTR v) diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index a6cc5e85fa6..6c4555335d9 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -50,6 +50,7 @@ typedef enum { STYLEID_MARGIN, STYLEID_MARGIN_LEFT, STYLEID_MARGIN_RIGHT, + STYLEID_OVERFLOW, STYLEID_PADDING_LEFT, STYLEID_POSITION, STYLEID_TEXT_ALIGN, diff --git a/dlls/mshtml/htmltextnode.c b/dlls/mshtml/htmltextnode.c index d0a08664baa..d6453b1d9e4 100644 --- a/dlls/mshtml/htmltextnode.c +++ b/dlls/mshtml/htmltextnode.c @@ -149,7 +149,7 @@ static const IHTMLDOMTextNodeVtbl HTMLDOMTextNodeVtbl = { #define HTMLTEXT_NODE_THIS(iface) DEFINE_THIS2(HTMLDOMTextNode, node, iface) -HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) +static HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) { HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface); @@ -166,7 +166,7 @@ HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) return S_OK; } -void HTMLDOMTextNode_destructor(HTMLDOMNode *iface) +static void HTMLDOMTextNode_destructor(HTMLDOMNode *iface) { HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 6c6ab3386ed..a6e878360e5 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -655,7 +655,6 @@ void remove_doc_tasks(const HTMLDocument*); DWORD set_task_timer(HTMLDocument*,DWORD,BOOL,IDispatch*); HRESULT clear_task_timer(HTMLDocument*,BOOL,DWORD); -HRESULT get_typeinfo(tid_t,ITypeInfo**); void release_typelib(void); void call_disp_func(HTMLDocument*,IDispatch*,IDispatch*); diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 2cddbdfea50..923604d05df 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -94,7 +94,7 @@ static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP This = *(NSContainer**)lParam; SetPropW(hwnd, wszTHIS, This); }else { - This = (NSContainer*)GetPropW(hwnd, wszTHIS); + This = GetPropW(hwnd, wszTHIS); } switch(msg) { diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 49b21ad37ff..c7fcc7403cb 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2293,6 +2293,7 @@ static void test_default_style(IHTMLStyle *style) BSTR str; HRESULT hres; float f; + BSTR sOverflowDefault; test_disp((IUnknown*)style, &DIID_DispHTMLStyle); test_ifaces((IUnknown*)style, style_iids); @@ -2601,6 +2602,48 @@ static void test_default_style(IHTMLStyle *style) ok(V_I4(&v) == 1, "V_I4(v) = %d\n", V_I4(&v)); VariantClear(&v); + /* overflow */ + hres = IHTMLStyle_get_overflow(style, NULL); + ok(hres == E_INVALIDARG, "get_overflow failed: %08x\n", hres); + + hres = IHTMLStyle_get_overflow(style, &sOverflowDefault); + ok(hres == S_OK, "get_overflow failed: %08x\n", hres); + + str = a2bstr("test"); + hres = IHTMLStyle_put_overflow(style, str); + ok(hres == E_INVALIDARG, "put_overflow failed: %08x\n", hres); + SysFreeString(str); + + str = a2bstr("visible"); + hres = IHTMLStyle_put_overflow(style, str); + ok(hres == S_OK, "put_overflow failed: %08x\n", hres); + SysFreeString(str); + + str = a2bstr("scroll"); + hres = IHTMLStyle_put_overflow(style, str); + ok(hres == S_OK, "put_overflow failed: %08x\n", hres); + SysFreeString(str); + + str = a2bstr("hidden"); + hres = IHTMLStyle_put_overflow(style, str); + ok(hres == S_OK, "put_overflow failed: %08x\n", hres); + SysFreeString(str); + + str = a2bstr("auto"); + hres = IHTMLStyle_put_overflow(style, str); + ok(hres == S_OK, "put_overflow failed: %08x\n", hres); + SysFreeString(str); + + hres = IHTMLStyle_get_overflow(style, &str); + ok(hres == S_OK, "get_overflow failed: %08x\n", hres); + ok(!strcmp_wa(str, "auto"), "str=%s\n", dbgstr_w(str)); + SysFreeString(str); + + /* restore overflow default */ + hres = IHTMLStyle_put_overflow(style, sOverflowDefault); + ok(hres == S_OK, "put_overflow failed: %08x\n", hres); + SysFreeString(sOverflowDefault); + hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2); ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres); if(SUCCEEDED(hres)) { diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index 6bc5e929ca6..72a4a4005f2 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -189,7 +189,7 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM This = *(HTMLDocument**)lParam; SetPropW(hwnd, wszTHIS, This); }else { - This = (HTMLDocument*)GetPropW(hwnd, wszTHIS); + This = GetPropW(hwnd, wszTHIS); } switch(msg) { diff --git a/dlls/msrle32/msrle32.c b/dlls/msrle32/msrle32.c index 41ad22eb732..6fa8e878f5c 100644 --- a/dlls/msrle32/msrle32.c +++ b/dlls/msrle32/msrle32.c @@ -1136,7 +1136,7 @@ static CodecInfo* Open(LPICOPEN icinfo) return NULL; } - pi = (CodecInfo*)LocalAlloc(LPTR, sizeof(CodecInfo)); + pi = LocalAlloc(LPTR, sizeof(CodecInfo)); if (pi != NULL) { pi->fccHandler = icinfo->fccHandler; @@ -1165,7 +1165,7 @@ static LRESULT Close(CodecInfo *pi) if (pi->pPrevFrame != NULL || pi->pCurFrame != NULL) CompressEnd(pi); - LocalFree((HLOCAL)pi); + LocalFree(pi); return 1; } @@ -1419,7 +1419,7 @@ static LRESULT CompressBegin(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, switch (lpbiOut->biBitCount) { case 4: case 8: - pi->palette_map = (LPBYTE)LocalAlloc(LPTR, lpbiIn->biClrUsed); + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed); if (pi->palette_map == NULL) { CompressEnd(pi); return ICERR_MEMORY; @@ -1669,7 +1669,7 @@ static LRESULT DecompressBegin(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, switch (lpbiOut->biBitCount) { case 4: case 8: - pi->palette_map = (LPBYTE)LocalAlloc(LPTR, lpbiIn->biClrUsed); + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed); if (pi->palette_map == NULL) return ICERR_MEMORY; @@ -1679,7 +1679,7 @@ static LRESULT DecompressBegin(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, break; case 15: case 16: - pi->palette_map = (LPBYTE)LocalAlloc(LPTR, lpbiIn->biClrUsed * 2); + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2); if (pi->palette_map == NULL) return ICERR_MEMORY; @@ -1699,7 +1699,7 @@ static LRESULT DecompressBegin(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn, break; case 24: case 32: - pi->palette_map = (LPBYTE)LocalAlloc(LPTR, lpbiIn->biClrUsed * sizeof(RGBQUAD)); + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * sizeof(RGBQUAD)); if (pi->palette_map == NULL) return ICERR_MEMORY; memcpy(pi->palette_map, rgbIn, lpbiIn->biClrUsed * sizeof(RGBQUAD)); @@ -1753,7 +1753,7 @@ static LRESULT DecompressEnd(CodecInfo *pi) pi->bDecompress = FALSE; if (pi->palette_map != NULL) { - LocalFree((HLOCAL)pi->palette_map); + LocalFree(pi->palette_map); pi->palette_map = NULL; } diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 658c7753fe3..3104069c8da 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -570,7 +570,7 @@ @ cdecl _wspawnve(long wstr ptr ptr) @ cdecl _wspawnvp(long wstr ptr) @ cdecl _wspawnvpe(long wstr ptr ptr) -@ cdecl _wsplitpath(wstr wstr wstr wstr wstr) +@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) @ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) _wsplitpath_s @ cdecl _wstat(wstr ptr) MSVCRT__wstat @ cdecl _wstati64(wstr ptr) MSVCRT__wstati64 diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index b152eacfbfd..cb005f99cbb 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -51,7 +51,7 @@ static void test_sscanf( void ) ok( ptr == (void *)0x46F172,"sscanf reads %p instead of %x\n", ptr, 0x46F172 ); ok( sscanf("0x46F173", "%p", &ptr) == 1, "sscanf failed\n" ); - ok( ptr == (void *)0,"sscanf reads %p instead of %x\n", ptr, 0 ); + ok( ptr == NULL,"sscanf reads %p instead of %x\n", ptr, 0 ); ok( sscanf("-46F174", "%p", &ptr) == 1, "sscanf failed\n" ); ok( ptr == (void *)0xFFB90E8C,"sscanf reads %p instead of %x\n", ptr, 0xFFB90E8C ); diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index ba4e95c7e3d..b53cbcd7b0f 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -340,7 +340,7 @@ void CDECL MSVCRT__tzset(void) struct tm *tmp; long zone_january, zone_july; - t = (time((time_t *)0) / seconds_in_year) * seconds_in_year; + t = (time(NULL) / seconds_in_year) * seconds_in_year; tmp = localtime(&t); zone_january = -tmp->tm_gmtoff; t += seconds_in_year / 2; diff --git a/dlls/mswsock/mswsock.spec b/dlls/mswsock/mswsock.spec index 521b3a49117..1f2bd7824af 100644 --- a/dlls/mswsock/mswsock.spec +++ b/dlls/mswsock/mswsock.spec @@ -20,7 +20,7 @@ @ stub StopWsdpService @ stub SvchostPushServiceGlobals @ stdcall TransmitFile(long long long long ptr ptr long) -@ stub WSARecvEx +@ stdcall WSARecvEx(long ptr long ptr) @ stub WSPStartup @ stub dn_expand @ stub getnetbyname diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c index 2681a76fab0..92cafad5367 100644 --- a/dlls/msxml3/attribute.c +++ b/dlls/msxml3/attribute.c @@ -482,16 +482,16 @@ static HRESULT WINAPI domattr_get_value( IXMLDOMAttribute *iface, VARIANT *var1) { - FIXME("\n"); - return E_NOTIMPL; + domattr *This = impl_from_IXMLDOMAttribute( iface ); + return IXMLDOMNode_get_nodeValue( This->node, var1 ); } static HRESULT WINAPI domattr_put_value( IXMLDOMAttribute *iface, VARIANT var1) { - FIXME("\n"); - return E_NOTIMPL; + domattr *This = impl_from_IXMLDOMAttribute( iface ); + return IXMLDOMNode_put_nodeValue( This->node, var1 ); } static const struct IXMLDOMAttributeVtbl domattr_vtbl = diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index aa59ec39138..dc7399bf980 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -69,6 +69,12 @@ static HRESULT WINAPI domcdata_QueryInterface( { return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); } + else if ( IsEqualGUID( riid, &IID_IXMLDOMText ) || + IsEqualGUID( riid, &IID_IXMLDOMElement ) ) + { + TRACE("Unsupported interface\n"); + return E_NOINTERFACE; + } else { FIXME("Unsupported interface %s\n", debugstr_guid(riid)); diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index c685889a953..f71b1344ac6 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -209,6 +209,20 @@ HRESULT xmldoc_remove_orphan(xmlDocPtr doc, xmlNodePtr node) return S_FALSE; } +static HRESULT attach_xmldoc( IXMLDOMNode *node, xmlDocPtr xml ) +{ + xmlnode *This = impl_from_IXMLDOMNode( node ); + + if(This->node) + xmldoc_release(This->node->doc); + + This->node = (xmlNodePtr) xml; + if(This->node) + xmldoc_add_ref(This->node->doc); + + return S_OK; +} + static inline domdoc *impl_from_IXMLDOMDocument2( IXMLDOMDocument2 *iface ) { return (domdoc *)((char*)iface - FIELD_OFFSET(domdoc, lpVtbl)); @@ -331,9 +345,8 @@ static HRESULT WINAPI xmldoc_IPersistStream_Load( } xmldoc->_private = create_priv(); - attach_xmlnode( This->node, (xmlNodePtr)xmldoc ); - return S_OK; + return attach_xmldoc( This->node, xmldoc ); } static HRESULT WINAPI xmldoc_IPersistStream_Save( @@ -1310,7 +1323,7 @@ static HRESULT domdoc_onDataAvailable(void *obj, char *ptr, DWORD len) xmldoc = doparse( ptr, len ); if(xmldoc) { xmldoc->_private = create_priv(); - attach_xmlnode(This->node, (xmlNodePtr) xmldoc); + return attach_xmldoc(This->node, xmldoc); } return S_OK; @@ -1350,8 +1363,6 @@ static HRESULT WINAPI domdoc_load( assert( This->node ); - attach_xmlnode(This->node, NULL); - switch( V_VT(&xmlSource) ) { case VT_BSTR: @@ -1365,11 +1376,12 @@ static HRESULT WINAPI domdoc_load( { domdoc *newDoc = impl_from_IXMLDOMDocument2( pNewDoc ); xmldoc = xmlCopyDoc(get_doc(newDoc), 1); - attach_xmlnode(This->node, (xmlNodePtr) xmldoc); + hr = attach_xmldoc(This->node, xmldoc); - *isSuccessful = VARIANT_TRUE; + if(SUCCEEDED(hr)) + *isSuccessful = VARIANT_TRUE; - return S_OK; + return hr; } } hr = IUnknown_QueryInterface(V_UNKNOWN(&xmlSource), &IID_IStream, (void**)&pStream); @@ -1426,8 +1438,9 @@ static HRESULT WINAPI domdoc_load( if(!filename || FAILED(hr)) { xmldoc = xmlNewDoc(NULL); xmldoc->_private = create_priv(); - attach_xmlnode(This->node, (xmlNodePtr) xmldoc); - hr = S_FALSE; + hr = attach_xmldoc(This->node, xmldoc); + if(SUCCEEDED(hr)) + hr = S_FALSE; } TRACE("ret (%d)\n", hr); @@ -1529,14 +1542,12 @@ static HRESULT WINAPI domdoc_loadXML( xmlDocPtr xmldoc = NULL; char *str; int len; - HRESULT hr = S_FALSE; + HRESULT hr = S_FALSE, hr2; TRACE("%p %s %p\n", This, debugstr_w( bstrXML ), isSuccessful ); assert ( This->node ); - attach_xmlnode( This->node, NULL ); - if ( isSuccessful ) { *isSuccessful = VARIANT_FALSE; @@ -1558,7 +1569,9 @@ static HRESULT WINAPI domdoc_loadXML( xmldoc = xmlNewDoc(NULL); xmldoc->_private = create_priv(); - attach_xmlnode( This->node, (xmlNodePtr) xmldoc ); + hr2 = attach_xmldoc( This->node, xmldoc ); + if( FAILED(hr2) ) + hr = hr2; return hr; } diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 4b9bf6cae04..a31f80ef799 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -478,7 +478,7 @@ static HRESULT WINAPI domelem_get_tagName( len = MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) element->name, -1, NULL, 0 ); if (element->ns) len += MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) element->ns->prefix, -1, NULL, 0 ); - str = (LPWSTR) HeapAlloc( GetProcessHeap(), 0, len * sizeof (WCHAR) ); + str = HeapAlloc( GetProcessHeap(), 0, len * sizeof (WCHAR) ); if ( !str ) return E_OUTOFMEMORY; if (element->ns) diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index aa14b9b6a70..e33b994d512 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -54,8 +54,6 @@ extern IUnknown *create_doc_entity_ref( xmlNodePtr entity ); extern HRESULT queryresult_create( xmlNodePtr, LPWSTR, IXMLDOMNodeList ** ); -extern void attach_xmlnode( IXMLDOMNode *node, xmlNodePtr xmlnode ); - /* data accessors */ xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type ); diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 19cee8f3f86..3169f351fe2 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -85,20 +85,6 @@ xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type ) return This->node; } -void attach_xmlnode( IXMLDOMNode *node, xmlNodePtr xml ) -{ - xmlnode *This = impl_from_IXMLDOMNode( node ); - - if(This->node) - xmldoc_release(This->node->doc); - - This->node = xml; - if(This->node) - xmldoc_add_ref(This->node->doc); - - return; -} - static HRESULT WINAPI xmlnode_QueryInterface( IXMLDOMNode *iface, REFIID riid, @@ -271,7 +257,7 @@ BSTR bstr_from_xmlChar( const xmlChar *buf ) return NULL; len = MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) buf, -1, NULL, 0 ); - str = (LPWSTR) HeapAlloc( GetProcessHeap(), 0, len * sizeof (WCHAR) ); + str = HeapAlloc( GetProcessHeap(), 0, len * sizeof (WCHAR) ); if ( !str ) return NULL; MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) buf, -1, str, len ); @@ -920,7 +906,7 @@ static HRESULT WINAPI xmlnode_put_text( BSTR text) { xmlnode *This = impl_from_IXMLDOMNode( iface ); - xmlChar *str, *str2, *str3; + xmlChar *str, *str2; TRACE("%p\n", This); @@ -937,11 +923,9 @@ static HRESULT WINAPI xmlnode_put_text( /* Escape the string. */ str2 = xmlEncodeEntitiesReentrant(This->node->doc, str); HeapFree(GetProcessHeap(), 0, str); - str3 = xmlEncodeSpecialChars(This->node->doc, str2); - xmlFree(str2); - xmlNodeSetContent(This->node, str3); - xmlFree(str3); + xmlNodeSetContent(This->node, str2); + xmlFree(str2); return S_OK; } diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index 8370af0c19e..17a333419f3 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -161,7 +161,7 @@ static BSTR bstr_from_xmlCharN(const xmlChar *buf, int len) dLen = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, NULL, 0); if(len != -1) dLen++; - str = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dLen * sizeof (WCHAR)); + str = HeapAlloc(GetProcessHeap(), 0, dLen * sizeof (WCHAR)); if (!str) return NULL; MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, str, dLen); diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index e27c5064fd8..bac7e3fa7a7 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -176,6 +176,8 @@ static WCHAR szElementXML[] = {'<','E','l','e','T','e','s','t','/','>',0 }; static WCHAR szElementXML2[] = {'<','E','l','e','T','e','s','t',' ','A','t','t','r','=','"','"','/','>',0 }; static WCHAR szElementXML3[] = {'<','E','l','e','T','e','s','t',' ','A','t','t','r','=','"','"','>', 'T','e','s','t','i','n','g','N','o','d','e','<','/','E','l','e','T','e','s','t','>',0 }; +static WCHAR szElementXML4[] = {'<','E','l','e','T','e','s','t',' ','A','t','t','r','=','"','"','>', + '&','a','m','p',';','x',' ',0x2103,'<','/','E','l','e','T','e','s','t','>',0 }; static WCHAR szAttribute[] = {'A','t','t','r',0 }; static WCHAR szAttributeXML[] = {'A','t','t','r','=','"','"',0 }; @@ -190,6 +192,7 @@ static WCHAR szDocFragmentText[] = {'#','d','o','c','u','m','e','n','t','-','f', static WCHAR szEntityRef[] = {'e','n','t','i','t','y','r','e','f',0 }; static WCHAR szEntityRefXML[] = {'&','e','n','t','i','t','y','r','e','f',';',0 }; +static WCHAR szStrangeChars[] = {'&','x',' ',0x2103, 0}; #define expect_bstr_eq_and_free(bstr, expect) { \ BSTR bstrExp = alloc_str_from_narrow(expect); \ @@ -2893,6 +2896,22 @@ static void test_xmlTypes(void) ok( !lstrcmpW( str, szElementXML3 ), "incorrect element xml\n"); SysFreeString(str); + /* Test for reversible escaping */ + str = SysAllocString( szStrangeChars ); + hr = IXMLDOMElement_put_text(pElement, str); + ok(hr == S_OK, "ret %08x\n", hr ); + SysFreeString( str ); + + hr = IXMLDOMElement_get_xml(pElement, &str); + ok(hr == S_OK, "ret %08x\n", hr ); + ok( !lstrcmpW( str, szElementXML4 ), "incorrect element xml\n"); + SysFreeString(str); + + hr = IXMLDOMElement_get_text(pElement, &str); + ok(hr == S_OK, "ret %08x\n", hr ); + ok( !lstrcmpW( str, szStrangeChars ), "incorrect element text\n"); + SysFreeString(str); + IXMLDOMElement_Release(pElement); } @@ -3837,6 +3856,7 @@ static void test_NodeTypeValue(void) hr = IXMLDOMNode_get_nodeTypedValue(pNode, &v); ok(hr == S_OK, "ret %08x\n", hr ); ok(!lstrcmpW( V_BSTR(&v), _bstr_("Wine") ), "incorrect value\n"); + VariantClear( &v ); IXMLDOMNode_Release(pNode); } diff --git a/dlls/msxml3/tests/xmldoc.c b/dlls/msxml3/tests/xmldoc.c index 2058d7dee0d..5c1c4f87f5b 100644 --- a/dlls/msxml3/tests/xmldoc.c +++ b/dlls/msxml3/tests/xmldoc.c @@ -31,27 +31,20 @@ /* Deprecated Error Code */ #define XML_E_INVALIDATROOTLEVEL 0xc00ce556 -static void append_str(char **str, const char *data) -{ - sprintf(*str, data); - *str += strlen(*str); -} - static void create_xml_file(LPCSTR filename) { - char data[1024]; - char *ptr = data; DWORD dwNumberOfBytesWritten; HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - append_str(&ptr, "\n"); - append_str(&ptr, "\n"); - append_str(&ptr, " 1234\n"); - append_str(&ptr, " Captain Ahab\n"); - append_str(&ptr, ""); + static const char data[] = + "\n" + "\n" + " 1234\n" + " Captain Ahab\n" + ""; - WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL); + WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL); CloseHandle(hf); } diff --git a/dlls/msxml3/tests/xmlelem.c b/dlls/msxml3/tests/xmlelem.c index 27c09c7471a..f0b195da485 100644 --- a/dlls/msxml3/tests/xmlelem.c +++ b/dlls/msxml3/tests/xmlelem.c @@ -228,27 +228,20 @@ static void test_xmlelem(void) IXMLDocument_Release(doc); } -static void append_str(char **str, const char *data) -{ - sprintf(*str, data); - *str += strlen(*str); -} - static void create_xml_file(LPCSTR filename) { - char data[1024]; - char *ptr = data; DWORD dwNumberOfBytesWritten; HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - append_str(&ptr, "\n"); - append_str(&ptr, "\n"); - append_str(&ptr, " 1234\n"); - append_str(&ptr, " Captain Ahab\n"); - append_str(&ptr, "\n"); + static const char data[] = + "\n" + "\n" + " 1234\n" + " Captain Ahab\n" + "\n"; - WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL); + WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL); CloseHandle(hf); } diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index f8e1fc473d3..c39fd07dcff 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -70,6 +70,13 @@ static HRESULT WINAPI domtext_QueryInterface( { return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); } + else if ( IsEqualGUID( riid, &IID_IXMLDOMElement ) || + IsEqualGUID( riid, &IID_IXMLDOMCDATASection ) ) + { + /* IXMLDOMText is known to be correct in not implementing these */ + TRACE("Unsupported interface\n"); + return E_NOINTERFACE; + } else { FIXME("Unsupported interface %s\n", debugstr_guid(riid)); diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 8aa906e3172..0c8ecda0450 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -381,6 +381,26 @@ NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL } /*********************************************************************** + * RtlCaptureContext (NTDLL.@) + */ +void WINAPI __regs_RtlCaptureContext( CONTEXT *context_out, CONTEXT *context_in ) +{ + *context_out = *context_in; +} + +/**********************************************************************/ + +#ifdef DEFINE_REGS_ENTRYPOINT +DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 4, 4 ) +#else +void WINAPI RtlCaptureContext( CONTEXT *context_out ) +{ + memset( context_out, 0, sizeof(*context_out) ); +} +#endif + + +/*********************************************************************** * RtlRaiseException (NTDLL.@) */ void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context ) @@ -405,7 +425,7 @@ DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 4, 4 ) void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec ) { CONTEXT context; - memset( &context, 0, sizeof(context) ); + RtlCaptureContext( &context ); __regs_RtlRaiseException( rec, &context ); } #endif @@ -498,7 +518,7 @@ void WINAPI RtlUnwind( PVOID pEndFrame, PVOID unusedEip, PEXCEPTION_RECORD pRecord, PVOID returnEax ) { CONTEXT context; - memset( &context, 0, sizeof(context) ); + RtlCaptureContext( &context ); __regs_RtlUnwind( pEndFrame, unusedEip, pRecord, returnEax, &context ); } #endif diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 52db956144e..c94f2fb15ae 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -195,7 +195,7 @@ # @ stub NtLockRegistryKey @ stdcall NtLockVirtualMemory(long ptr ptr long) # @ stub NtMakePermanentObject -@ stub NtMakeTemporaryObject +@ stdcall NtMakeTemporaryObject(long) # @ stub NtMapUserPhysicalPages # @ stub NtMapUserPhysicalPagesScatter @ stdcall NtMapViewOfSection(long long ptr long long ptr ptr long long long) @@ -433,7 +433,7 @@ # @ stub RtlAssert2 @ stdcall RtlAssert(ptr ptr long long) # @ stub RtlCancelTimer -# @ stub RtlCaptureContext +@ stdcall -register RtlCaptureContext(ptr) @ stub RtlCaptureStackBackTrace # @ stub RtlCaptureStackContext @ stdcall RtlCharToInteger(ptr long ptr) @@ -1039,7 +1039,7 @@ # @ stub ZwLockRegistryKey @ stdcall ZwLockVirtualMemory(long ptr ptr long) NtLockVirtualMemory # @ stub ZwMakePermanentObject -@ stub ZwMakeTemporaryObject +@ stdcall ZwMakeTemporaryObject(long) NtMakeTemporaryObject # @ stub ZwMapUserPhysicalPages # @ stub ZwMapUserPhysicalPagesScatter @ stdcall ZwMapViewOfSection(long long ptr long long ptr ptr long long long) NtMapViewOfSection diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c index aba2301627d..a299a4509e5 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -616,3 +616,22 @@ NTSTATUS WINAPI NtAllocateUuids( FIXME("(%p,%p,%p), stub.\n", Time, Range, Sequence); return 0; } + +/************************************************************************** + * NtMakeTemporaryObject [NTDLL.@] + * ZwMakeTemporaryObject [NTDLL.@] + * + * Make a permanent object temporary. + * + * PARAMS + * Handle [I] handle to permanent object + * + * RETURNS + * Success: STATUS_SUCCESS. + * Failure: An NTSTATUS error code. + */ +NTSTATUS WINAPI NtMakeTemporaryObject( HANDLE Handle ) +{ + FIXME("(%p), stub.\n", Handle); + return STATUS_SUCCESS; +} diff --git a/dlls/ntdll/tests/atom.c b/dlls/ntdll/tests/atom.c index e86f3cda819..7526654fcb8 100644 --- a/dlls/ntdll/tests/atom.c +++ b/dlls/ntdll/tests/atom.c @@ -307,7 +307,7 @@ static void test_NtIntAtom(void) { /* According to the kernel32 functions, integer atoms are only allowed from * 0x0001 to 0xbfff and not 0xc000 to 0xffff, which is correct */ - res = pRtlAddAtomToAtomTable(AtomTable, (PWSTR)0, &testAtom); + res = pRtlAddAtomToAtomTable(AtomTable, NULL, &testAtom); ok(res == STATUS_INVALID_PARAMETER, "Didn't get expected result from adding 0 int atom, retval: %x\n", res); for (i = 1; i <= 0xbfff; i++) { diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index 1525bb1839f..0e25c0639ec 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -134,11 +134,11 @@ static NTSTATUS (WINAPI * pNtSetValueKey)( PHKEY, const PUNICODE_STRING, ULONG, ULONG, const PVOID, ULONG ); static NTSTATUS (WINAPI * pRtlFormatCurrentUserKeyPath)(PUNICODE_STRING); static NTSTATUS (WINAPI * pRtlCreateUnicodeString)( PUNICODE_STRING, LPCWSTR); -static NTSTATUS (WINAPI * pRtlReAllocateHeap)(IN PVOID, IN ULONG, IN PVOID, IN ULONG); +static LPVOID (WINAPI * pRtlReAllocateHeap)(IN PVOID, IN ULONG, IN PVOID, IN ULONG); static NTSTATUS (WINAPI * pRtlAppendUnicodeToString)(PUNICODE_STRING, PCWSTR); static NTSTATUS (WINAPI * pRtlUnicodeStringToAnsiString)(PSTRING, PUNICODE_STRING, BOOL); static NTSTATUS (WINAPI * pRtlFreeHeap)(PVOID, ULONG, PVOID); -static NTSTATUS (WINAPI * pRtlAllocateHeap)(PVOID,ULONG,ULONG); +static LPVOID (WINAPI * pRtlAllocateHeap)(PVOID,ULONG,ULONG); static NTSTATUS (WINAPI * pRtlZeroMemory)(PVOID, ULONG); static NTSTATUS (WINAPI * pRtlpNtQueryValueKey)(HANDLE,ULONG*,PBYTE,DWORD*); @@ -200,7 +200,7 @@ static NTSTATUS WINAPI QueryRoutine (IN PCWSTR ValueName, IN ULONG ValueType, IN { ValueNameLength = lstrlenW(ValueName); - ValName = (LPSTR)pRtlAllocateHeap(GetProcessHeap(), 0, ValueNameLength); + ValName = pRtlAllocateHeap(GetProcessHeap(), 0, ValueNameLength); WideCharToMultiByte(0, 0, ValueName, ValueNameLength+1,ValName, ValueNameLength, 0, 0); @@ -213,12 +213,12 @@ static NTSTATUS WINAPI QueryRoutine (IN PCWSTR ValueName, IN ULONG ValueType, IN { case REG_NONE: trace("ValueType: REG_NONE\n"); - trace("ValueData: %d\n", (int)ValueData); + trace("ValueData: %p\n", ValueData); break; case REG_BINARY: trace("ValueType: REG_BINARY\n"); - trace("ValueData: %d\n", (int)ValueData); + trace("ValueData: %p\n", ValueData); break; case REG_SZ: @@ -238,7 +238,7 @@ static NTSTATUS WINAPI QueryRoutine (IN PCWSTR ValueName, IN ULONG ValueType, IN case REG_DWORD: trace("ValueType: REG_DWORD\n"); - trace("ValueData: %d\n", (int)ValueData); + trace("ValueData: %p\n", ValueData); break; }; trace("ValueLength: %d\n", (int)ValueLength); @@ -295,7 +295,7 @@ static void test_RtlQueryRegistryValues(void) PRTL_QUERY_REGISTRY_TABLE QueryTable = NULL; RelativeTo = RTL_REGISTRY_ABSOLUTE;/*Only using absolute - no need to test all relativeto variables*/ - QueryTable = (PRTL_QUERY_REGISTRY_TABLE)pRtlAllocateHeap(GetProcessHeap(), 0, sizeof(RTL_QUERY_REGISTRY_TABLE)*26); + QueryTable = pRtlAllocateHeap(GetProcessHeap(), 0, sizeof(RTL_QUERY_REGISTRY_TABLE)*26); pRtlZeroMemory( QueryTable, sizeof(RTL_QUERY_REGISTRY_TABLE) * 26); @@ -601,7 +601,7 @@ START_TEST(reg) if(!InitFunctionPtrs()) return; pRtlFormatCurrentUserKeyPath(&winetestpath); - winetestpath.Buffer = (PWSTR)pRtlReAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, winetestpath.Buffer, + winetestpath.Buffer = pRtlReAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, winetestpath.Buffer, winetestpath.MaximumLength + sizeof(winetest)*sizeof(WCHAR)); winetestpath.MaximumLength = winetestpath.MaximumLength + sizeof(winetest)*sizeof(WCHAR); diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 415f0dbbf17..bcf63b4db48 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -49,6 +49,7 @@ typedef struct _RTL_HANDLE_TABLE static HMODULE hntdll = 0; static SIZE_T (WINAPI *pRtlCompareMemory)(LPCVOID,LPCVOID,SIZE_T); static SIZE_T (WINAPI *pRtlCompareMemoryUlong)(PULONG, SIZE_T, ULONG); +static NTSTATUS (WINAPI *pRtlDeleteTimer)(HANDLE, HANDLE, HANDLE); static VOID (WINAPI *pRtlMoveMemory)(LPVOID,LPCVOID,SIZE_T); static VOID (WINAPI *pRtlFillMemory)(LPVOID,SIZE_T,BYTE); static VOID (WINAPI *pRtlFillMemoryUlong)(LPVOID,SIZE_T,ULONG); @@ -80,6 +81,7 @@ static void InitFunctionPtrs(void) if (hntdll) { pRtlCompareMemory = (void *)GetProcAddress(hntdll, "RtlCompareMemory"); pRtlCompareMemoryUlong = (void *)GetProcAddress(hntdll, "RtlCompareMemoryUlong"); + pRtlDeleteTimer = (void *)GetProcAddress(hntdll, "RtlDeleteTimer"); pRtlMoveMemory = (void *)GetProcAddress(hntdll, "RtlMoveMemory"); pRtlFillMemory = (void *)GetProcAddress(hntdll, "RtlFillMemory"); pRtlFillMemoryUlong = (void *)GetProcAddress(hntdll, "RtlFillMemoryUlong"); @@ -930,6 +932,15 @@ static void test_RtlAllocateAndInitializeSid(void) ok(ret == STATUS_INVALID_SID, "wrong error %08x\n", ret); } +static void test_RtlDeleteTimer(void) +{ + NTSTATUS ret; + ret = pRtlDeleteTimer(NULL, NULL, NULL); + ok(ret == STATUS_INVALID_PARAMETER_1 || + ret == STATUS_INVALID_PARAMETER, /* W2K */ + "expected STATUS_INVALID_PARAMETER_1 or STATUS_INVALID_PARAMETER, got %x\n", ret); +} + START_TEST(rtl) { InitFunctionPtrs(); @@ -962,4 +973,6 @@ START_TEST(rtl) test_HandleTables(); if (pRtlAllocateAndInitializeSid) test_RtlAllocateAndInitializeSid(); + if (pRtlDeleteTimer) + test_RtlDeleteTimer(); } diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c index 9c0dafe3ff4..af42b307f38 100644 --- a/dlls/ntdll/threadpool.c +++ b/dlls/ntdll/threadpool.c @@ -1005,10 +1005,13 @@ NTSTATUS WINAPI RtlDeleteTimer(HANDLE TimerQueue, HANDLE Timer, HANDLE CompletionEvent) { struct queue_timer *t = Timer; - struct timer_queue *q = t->q; + struct timer_queue *q; NTSTATUS status = STATUS_PENDING; HANDLE event = NULL; + if (!Timer) + return STATUS_INVALID_PARAMETER_1; + q = t->q; if (CompletionEvent == INVALID_HANDLE_VALUE) status = NtCreateEvent(&event, EVENT_ALL_ACCESS, NULL, FALSE, FALSE); else if (CompletionEvent) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index c41d289ab42..6cf83832e34 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -999,7 +999,12 @@ NTSTATUS WINAPI ObReferenceObjectByHandle( HANDLE obj, ACCESS_MASK access, /*********************************************************************** * ObfDereferenceObject (NTOSKRNL.EXE.@) */ +#ifdef DEFINE_FASTCALL1_ENTRYPOINT +DEFINE_FASTCALL1_ENTRYPOINT( ObfDereferenceObject ) +void WINAPI __regs_ObfDereferenceObject( VOID *obj ) +#else void WINAPI ObfDereferenceObject( VOID *obj ) +#endif { FIXME( "stub: %p\n", obj ); } diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 9303d03b9e6..cf4c86e5368 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -48,7 +48,7 @@ @ stub KefReleaseSpinLockFromDpcLevel @ stub KiAcquireSpinLock @ stub KiReleaseSpinLock -@ stdcall ObfDereferenceObject(ptr) +@ stdcall -norelay ObfDereferenceObject(ptr) @ stub ObfReferenceObject @ stub RtlPrefetchMemoryNonTemporal @ cdecl -i386 -norelay RtlUlongByteSwap() ntdll.RtlUlongByteSwap @@ -1316,7 +1316,7 @@ @ stub ZwIsProcessInJob @ stdcall ZwLoadDriver(ptr) ntdll.ZwLoadDriver @ stdcall ZwLoadKey(ptr ptr) ntdll.ZwLoadKey -@ stub ZwMakeTemporaryObject +@ stdcall ZwMakeTemporaryObject(long) ntdll.ZwMakeTemporaryObject @ stdcall ZwMapViewOfSection(long long ptr long long ptr ptr long long long) ntdll.ZwMapViewOfSection @ stdcall ZwNotifyChangeKey(long long ptr ptr ptr long long ptr long long) ntdll.ZwNotifyChangeKey @ stdcall ZwOpenDirectoryObject(long long long) ntdll.ZwOpenDirectoryObject diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in index e82b2ad29f5..f8d74818234 100644 --- a/dlls/ole32/Makefile.in +++ b/dlls/ole32/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -D_OLE32_ -DCOM_NO_WINDOWS_H TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ @@ -6,6 +5,8 @@ VPATH = @srcdir@ MODULE = ole32.dll IMPORTLIB = ole32 IMPORTS = uuid advapi32 user32 gdi32 rpcrt4 kernel32 ntdll +EXTRADEFS = -D_OLE32_ -DCOM_NO_WINDOWS_H \ + -DENTRY_PREFIX=OLE32_ -DPROXY_CLSID=CLSID_PSFactoryBuffer -DREGISTER_PROXY_DLL C_SRCS = \ antimoniker.c \ @@ -74,6 +75,8 @@ IDL_P_SRCS = \ ole32_oleidl.idl \ ole32_unknwn.idl +EXTRA_OBJS = dlldata.o + @MAKE_DLL_RULES@ ole2nls.spec.o: ole2nls.spec version16.res diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index a920b9c09c5..d77847853f5 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -63,8 +63,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); -HINSTANCE OLE32_hInstance = 0; - #define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0])) /**************************************************************************** @@ -209,14 +207,14 @@ static void COMPOBJ_InitProcess( void ) */ memset(&wclass, 0, sizeof(wclass)); wclass.lpfnWndProc = apartment_wndproc; - wclass.hInstance = OLE32_hInstance; + wclass.hInstance = hProxyDll; wclass.lpszClassName = wszAptWinClass; RegisterClassW(&wclass); } static void COMPOBJ_UninitProcess( void ) { - UnregisterClassW(wszAptWinClass, OLE32_hInstance); + UnregisterClassW(wszAptWinClass, hProxyDll); } static void COM_TlsDestroy(void) @@ -729,7 +727,7 @@ HRESULT apartment_createwindowifneeded(struct apartment *apt) { HWND hwnd = CreateWindowW(wszAptWinClass, NULL, 0, 0, 0, 0, 0, - HWND_MESSAGE, 0, OLE32_hInstance, NULL); + HWND_MESSAGE, 0, hProxyDll, NULL); if (!hwnd) { ERR("CreateWindow failed with error %d\n", GetLastError()); @@ -3861,7 +3859,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) switch(fdwReason) { case DLL_PROCESS_ATTACH: - OLE32_hInstance = hinstDLL; + hProxyDll = hinstDLL; COMPOBJ_InitProcess(); if (TRACE_ON(ole)) CoRegisterMallocSpy((LPVOID)-1); break; @@ -3872,7 +3870,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) COMPOBJ_UninitProcess(); RPC_UnregisterAllChannelHooks(); COMPOBJ_DllList_Free(); - OLE32_hInstance = 0; break; case DLL_THREAD_DETACH: diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index 4b88ad2f627..3c3e96d94e9 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -212,7 +212,6 @@ struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, void *object); BOOL stub_manager_notify_unmarshal(struct stub_manager *m, const IPID *ipid); BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid); void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs, const IPID *ipid, BOOL tableweak); -HRESULT ipid_to_stub_manager(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **stubmgr_ret); HRESULT ipid_get_dispatch_params(const IPID *ipid, APARTMENT **stub_apt, IRpcStubBuffer **stub, IRpcChannelBuffer **chan, IID *iid, IUnknown **iface); HRESULT start_apartment_remote_unknown(void); @@ -303,12 +302,16 @@ static inline GUID COM_CurrentCausalityId(void) # define DEBUG_SET_CRITSEC_NAME(cs, name) (cs)->DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": " name) # define DEBUG_CLEAR_CRITSEC_NAME(cs) (cs)->DebugInfo->Spare[0] = 0 -extern HINSTANCE OLE32_hInstance; /* FIXME: make static */ - #define CHARS_IN_GUID 39 /* including NULL */ #define WINE_CLSCTX_DONT_HOST 0x80000000 +/* from dlldata.c */ +extern HINSTANCE hProxyDll DECLSPEC_HIDDEN; +extern HRESULT WINAPI OLE32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) DECLSPEC_HIDDEN; +extern HRESULT WINAPI OLE32_DllRegisterServer(void) DECLSPEC_HIDDEN; +extern HRESULT WINAPI OLE32_DllUnregisterServer(void) DECLSPEC_HIDDEN; + /* Exported non-interface Data Advise Holder functions */ HRESULT DataAdviseHolder_OnConnect(IDataAdviseHolder *iface, IDataObject *pDelegate); void DataAdviseHolder_OnDisconnect(IDataAdviseHolder *iface); diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index 4be2eb8e3ca..a2ff9b791ba 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -2119,19 +2119,19 @@ static void OLEDD_TrackMouseMove(TrackerWindowInfo* trackerInfo) { if (*trackerInfo->pdwEffect & DROPEFFECT_MOVE) { - SetCursor(LoadCursorA(OLE32_hInstance, MAKEINTRESOURCEA(1))); + SetCursor(LoadCursorA(hProxyDll, MAKEINTRESOURCEA(1))); } else if (*trackerInfo->pdwEffect & DROPEFFECT_COPY) { - SetCursor(LoadCursorA(OLE32_hInstance, MAKEINTRESOURCEA(2))); + SetCursor(LoadCursorA(hProxyDll, MAKEINTRESOURCEA(2))); } else if (*trackerInfo->pdwEffect & DROPEFFECT_LINK) { - SetCursor(LoadCursorA(OLE32_hInstance, MAKEINTRESOURCEA(3))); + SetCursor(LoadCursorA(hProxyDll, MAKEINTRESOURCEA(3))); } else { - SetCursor(LoadCursorA(OLE32_hInstance, MAKEINTRESOURCEA(0))); + SetCursor(LoadCursorA(hProxyDll, MAKEINTRESOURCEA(0))); } } } diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c index 99a86f009e3..dfc3bc1970c 100644 --- a/dlls/ole32/oleproxy.c +++ b/dlls/ole32/oleproxy.c @@ -36,7 +36,6 @@ #include "objbase.h" #include "ole2.h" #include "rpc.h" -#include "rpcproxy.h" #include "compobj_private.h" #include "moniker.h" @@ -46,23 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); -static CStdPSFactoryBuffer PSFactoryBuffer; - -CSTDSTUBBUFFERRELEASE(&PSFactoryBuffer) - -extern const ExtendedProxyFileInfo dcom_ProxyFileInfo; -extern const ExtendedProxyFileInfo ole32_objidl_ProxyFileInfo; -extern const ExtendedProxyFileInfo ole32_oleidl_ProxyFileInfo; -extern const ExtendedProxyFileInfo ole32_unknwn_ProxyFileInfo; - -static const ProxyFileInfo *OLE32_ProxyFileList[] = { - &dcom_ProxyFileInfo, - &ole32_objidl_ProxyFileInfo, - &ole32_oleidl_ProxyFileInfo, - &ole32_unknwn_ProxyFileInfo, - NULL -}; - /*********************************************************************** * DllGetClassObject [OLE32.@] */ @@ -92,6 +74,5 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr)) return ComCatCF_Create(iid, ppv); - return NdrDllGetClassObject(rclsid, iid, ppv, OLE32_ProxyFileList, - &CLSID_PSFactoryBuffer, &PSFactoryBuffer); + return OLE32_DllGetClassObject(rclsid, iid, ppv); } diff --git a/dlls/ole32/regsvr.c b/dlls/ole32/regsvr.c index 07ddde01661..2abd63671dc 100644 --- a/dlls/ole32/regsvr.c +++ b/dlls/ole32/regsvr.c @@ -509,69 +509,38 @@ static struct regsvr_coclass const coclass_list[] = { * interface list */ -#define INTERFACE_ENTRY(interface, base, clsid32, clsid16) { &IID_##interface, #interface, base, sizeof(interface##Vtbl)/sizeof(void*), clsid16, clsid32 } -#define BAS_INTERFACE_ENTRY(interface, base) INTERFACE_ENTRY(interface, &IID_##base, &CLSID_PSFactoryBuffer, NULL) -#define STD_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, &CLSID_PSFactoryBuffer, NULL) -#define ACTX_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, &CLSID_PSFactoryBuffer_actxprxy, NULL) -#define LCL_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, NULL, NULL) +#define INTERFACE_ENTRY(interface, base, clsid32) { &IID_##interface, #interface, base, sizeof(interface##Vtbl)/sizeof(void*), NULL, clsid32 } +#define BAS_INTERFACE_ENTRY(interface, base) INTERFACE_ENTRY(interface, &IID_##base, NULL) +#define ACTX_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, &CLSID_PSFactoryBuffer_actxprxy) +#define LCL_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, NULL) static const struct regsvr_interface interface_list[] = { LCL_INTERFACE_ENTRY(IUnknown), - STD_INTERFACE_ENTRY(IClassFactory), LCL_INTERFACE_ENTRY(IMalloc), LCL_INTERFACE_ENTRY(IMarshal), - STD_INTERFACE_ENTRY(ILockBytes), - STD_INTERFACE_ENTRY(IStorage), - STD_INTERFACE_ENTRY(IStream), - STD_INTERFACE_ENTRY(IEnumSTATSTG), - STD_INTERFACE_ENTRY(IBindCtx), BAS_INTERFACE_ENTRY(IMoniker, IPersistStream), - STD_INTERFACE_ENTRY(IRunningObjectTable), - STD_INTERFACE_ENTRY(IRootStorage), LCL_INTERFACE_ENTRY(IMessageFilter), LCL_INTERFACE_ENTRY(IStdMarshalInfo), LCL_INTERFACE_ENTRY(IExternalConnection), LCL_INTERFACE_ENTRY(IMallocSpy), LCL_INTERFACE_ENTRY(IMultiQI), - STD_INTERFACE_ENTRY(IEnumUnknown), - STD_INTERFACE_ENTRY(IEnumString), - STD_INTERFACE_ENTRY(IEnumMoniker), - STD_INTERFACE_ENTRY(IEnumFORMATETC), - STD_INTERFACE_ENTRY(IEnumOLEVERB), - STD_INTERFACE_ENTRY(IEnumSTATDATA), BAS_INTERFACE_ENTRY(IPersistStream, IPersist), BAS_INTERFACE_ENTRY(IPersistStorage, IPersist), BAS_INTERFACE_ENTRY(IPersistFile, IPersist), - STD_INTERFACE_ENTRY(IPersist), - STD_INTERFACE_ENTRY(IViewObject), - STD_INTERFACE_ENTRY(IDataObject), - STD_INTERFACE_ENTRY(IAdviseSink), LCL_INTERFACE_ENTRY(IDataAdviseHolder), LCL_INTERFACE_ENTRY(IOleAdviseHolder), - STD_INTERFACE_ENTRY(IOleObject), BAS_INTERFACE_ENTRY(IOleInPlaceObject, IOleWindow), - STD_INTERFACE_ENTRY(IOleWindow), BAS_INTERFACE_ENTRY(IOleInPlaceUIWindow, IOleWindow), - STD_INTERFACE_ENTRY(IOleInPlaceFrame), BAS_INTERFACE_ENTRY(IOleInPlaceActiveObject, IOleWindow), - STD_INTERFACE_ENTRY(IOleClientSite), BAS_INTERFACE_ENTRY(IOleInPlaceSite, IOleWindow), - STD_INTERFACE_ENTRY(IParseDisplayName), BAS_INTERFACE_ENTRY(IOleContainer, IParseDisplayName), BAS_INTERFACE_ENTRY(IOleItemContainer, IOleContainer), - STD_INTERFACE_ENTRY(IOleLink), - STD_INTERFACE_ENTRY(IOleCache), LCL_INTERFACE_ENTRY(IDropSource), - STD_INTERFACE_ENTRY(IDropTarget), BAS_INTERFACE_ENTRY(IAdviseSink2, IAdviseSink), - STD_INTERFACE_ENTRY(IRunnableObject), BAS_INTERFACE_ENTRY(IViewObject2, IViewObject), BAS_INTERFACE_ENTRY(IOleCache2, IOleCache), - STD_INTERFACE_ENTRY(IOleCacheControl), - STD_INTERFACE_ENTRY(IRemUnknown), LCL_INTERFACE_ENTRY(IClientSecurity), LCL_INTERFACE_ENTRY(IServerSecurity), - STD_INTERFACE_ENTRY(ISequentialStream), ACTX_INTERFACE_ENTRY(IEnumGUID), ACTX_INTERFACE_ENTRY(IEnumCATEGORYINFO), ACTX_INTERFACE_ENTRY(ICatRegister), @@ -588,7 +557,9 @@ HRESULT WINAPI DllRegisterServer(void) TRACE("\n"); - hr = register_coclasses(coclass_list); + hr = OLE32_DllRegisterServer(); + if (SUCCEEDED(hr)) + hr = register_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = register_interfaces(interface_list); return hr; @@ -606,5 +577,7 @@ HRESULT WINAPI DllUnregisterServer(void) hr = unregister_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = unregister_interfaces(interface_list); + if (SUCCEEDED(hr)) + hr = OLE32_DllUnregisterServer(); return hr; } diff --git a/dlls/ole32/storage.c b/dlls/ole32/storage.c index d356c676220..2e5203f689a 100644 --- a/dlls/ole32/storage.c +++ b/dlls/ole32/storage.c @@ -1623,46 +1623,6 @@ typedef struct ULARGE_INTEGER offset; } IStream32Impl; -/***************************************************************************** - * IStream32_QueryInterface [VTABLE] - */ -HRESULT WINAPI IStream_fnQueryInterface( - IStream* iface,REFIID refiid,LPVOID *obj -) { - IStream32Impl *This = (IStream32Impl *)iface; - - TRACE_(relay)("(%p)->(%s,%p)\n",This,debugstr_guid(refiid),obj); - if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { - *obj = This; - return 0; - } - return OLE_E_ENUM_NOMORE; - -} - -/****************************************************************************** - * IStream32_AddRef [VTABLE] - */ -ULONG WINAPI IStream_fnAddRef(IStream* iface) { - IStream32Impl *This = (IStream32Impl *)iface; - return InterlockedIncrement(&This->ref); -} - -/****************************************************************************** - * IStream32_Release [VTABLE] - */ -ULONG WINAPI IStream_fnRelease(IStream* iface) { - IStream32Impl *This = (IStream32Impl *)iface; - ULONG ref; - FlushFileBuffers(This->hf); - ref = InterlockedDecrement(&This->ref); - if (!ref) { - CloseHandle(This->hf); - HeapFree( GetProcessHeap(), 0, This ); - } - return ref; -} - /****************************************************************************** * IStorage16_QueryInterface [STORAGE.500] */ diff --git a/dlls/ole32/stubmanager.c b/dlls/ole32/stubmanager.c index 9918fbc94bd..61bb0cfee06 100644 --- a/dlls/ole32/stubmanager.c +++ b/dlls/ole32/stubmanager.c @@ -367,7 +367,7 @@ static struct stub_manager *get_stub_manager_from_ipid(APARTMENT *apt, const IPI return result; } -HRESULT ipid_to_stub_manager(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **stubmgr_ret) +static HRESULT ipid_to_stub_manager(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **stubmgr_ret) { /* FIXME: hack for IRemUnknown */ if (ipid->Data2 == 0xffff) diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c index 269c2f919d7..db7ee9e5dfb 100644 --- a/dlls/oleacc/tests/main.c +++ b/dlls/oleacc/tests/main.c @@ -33,7 +33,9 @@ static void test_getroletext(void) buf[0] = '*'; ret = GetRoleTextA(-1, buf, 2); ok(ret == 0, "GetRoleTextA doesn't return zero on wrong role number, got %d\n", ret); - ok(buf[0] == '*', "GetRoleTextA modified buffer on wrong role number\n"); + ok(buf[0] == '*' || + broken(buf[0] == 0), /* Win98 and WinMe */ + "GetRoleTextA modified buffer on wrong role number\n"); buf[0] = '*'; ret = GetRoleTextA(-1, buf, 0); ok(ret == 0, "GetRoleTextA doesn't return zero on wrong role number, got %d\n", ret); @@ -44,7 +46,9 @@ static void test_getroletext(void) bufW[0] = '*'; ret = GetRoleTextW(-1, bufW, 2); ok(ret == 0, "GetRoleTextW doesn't return zero on wrong role number, got %d\n", ret); - ok(bufW[0] == '\0', "GetRoleTextW doesn't return NULL char on wrong role number\n"); + ok(bufW[0] == '\0' || + broken(bufW[0] == '*'), /* Win98 and WinMe */ + "GetRoleTextW doesn't return NULL char on wrong role number\n"); bufW[0] = '*'; ret = GetRoleTextW(-1, bufW, 0); ok(ret == 0, "GetRoleTextW doesn't return zero on wrong role number, got %d\n", ret); @@ -72,8 +76,11 @@ static void test_getroletext(void) ok(buf[0] == '\0', "GetRoleTextA returned not zero-length buffer\n"); buf[1] = '*'; ret = GetRoleTextA(ROLE_SYSTEM_TITLEBAR, buf, 2); - ok(ret == 1, "GetRoleTextA returned wrong length, got %d, expected 1\n", ret); - ok(buf[1] == '\0', "GetRoleTextA returned not zero-length buffer\n"); + ok(ret == 1 || + ret == 0, /* Vista and W2K8 */ + "GetRoleTextA returned wrong length, got %d, expected 0 or 1\n", ret); + if (ret == 1) + ok(buf[1] == '\0', "GetRoleTextA returned not zero-length buffer : (%c)\n", buf[1]); bufW[0] = '*'; ret = GetRoleTextW(ROLE_SYSTEM_TITLEBAR, bufW, 1); diff --git a/dlls/oleaut32/Makefile.in b/dlls/oleaut32/Makefile.in index 93b19d1328c..56b96beb78e 100644 --- a/dlls/oleaut32/Makefile.in +++ b/dlls/oleaut32/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -D_OLEAUT32_ -DCOM_NO_WINDOWS_H TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ @@ -7,6 +6,8 @@ MODULE = oleaut32.dll IMPORTLIB = oleaut32 IMPORTS = uuid ole32 rpcrt4 user32 gdi32 advapi32 kernel32 ntdll DELAYIMPORTS = comctl32 urlmon +EXTRADEFS = -D_OLEAUT32_ -DCOM_NO_WINDOWS_H \ + -DENTRY_PREFIX=OLEAUTPS_ -DPROXY_CLSID=CLSID_PSDispatch -DPROXY_DELEGATION -DREGISTER_PROXY_DLL C_SRCS = \ connpt.c \ @@ -42,6 +43,8 @@ IDL_P_SRCS = \ oleaut32_oaidl.idl \ oleaut32_ocidl.idl +EXTRA_OBJS = dlldata.o + @MAKE_DLL_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c index 4e636e32cf6..40cfae36d2a 100644 --- a/dlls/oleaut32/oleaut.c +++ b/dlls/oleaut32/oleaut.c @@ -41,8 +41,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); static BOOL BSTR_bCache = TRUE; /* Cache allocations to minimise alloc calls? */ -HMODULE OLEAUT32_hModule = NULL; - /****************************************************************************** * BSTR {OLEAUT32} * @@ -696,7 +694,8 @@ HRESULT WINAPI OleTranslateColor( return S_OK; } -extern HRESULT OLEAUTPS_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv); +extern HRESULT WINAPI OLEAUTPS_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN; +extern BOOL WINAPI OLEAUTPS_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN; extern void _get_STDFONT_CF(LPVOID *); extern void _get_STDPIC_CF(LPVOID *); @@ -830,18 +829,7 @@ HRESULT WINAPI DllCanUnloadNow(void) */ BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved) { - TRACE("(%p,%d,%p)\n", hInstDll, fdwReason, lpvReserved); - - switch (fdwReason) { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hInstDll); - OLEAUT32_hModule = hInstDll; - break; - case DLL_PROCESS_DETACH: - break; - }; - - return TRUE; + return OLEAUTPS_DllMain( hInstDll, fdwReason, lpvReserved ); } /*********************************************************************** diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 1a30621714e..da622a10818 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -328,7 +328,7 @@ static void OLEFont_SendNotify(OLEFontImpl* this, DISPID dispID) * * See Windows documentation for more details on IUnknown methods. */ -HRESULT WINAPI OLEFontImpl_QueryInterface( +static HRESULT WINAPI OLEFontImpl_QueryInterface( IFont* iface, REFIID riid, void** ppvObject) @@ -384,7 +384,7 @@ HRESULT WINAPI OLEFontImpl_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -ULONG WINAPI OLEFontImpl_AddRef( +static ULONG WINAPI OLEFontImpl_AddRef( IFont* iface) { OLEFontImpl *this = (OLEFontImpl *)iface; @@ -397,7 +397,7 @@ ULONG WINAPI OLEFontImpl_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -ULONG WINAPI OLEFontImpl_Release( +static ULONG WINAPI OLEFontImpl_Release( IFont* iface) { OLEFontImpl *this = (OLEFontImpl *)iface; diff --git a/dlls/oleaut32/regsvr.c b/dlls/oleaut32/regsvr.c index 093e5c7fa65..a9e34a1024f 100644 --- a/dlls/oleaut32/regsvr.c +++ b/dlls/oleaut32/regsvr.c @@ -466,353 +466,62 @@ static struct regsvr_coclass const coclass_list[] = { /*********************************************************************** * interface list */ +#define INTERFACE_ENTRY(interface, clsid16, clsid32) { &IID_##interface, #interface, NULL, sizeof(interface##Vtbl)/sizeof(void*), clsid16, clsid32 } +#define LCL_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, NULL) +#define PSFAC_INTERFACE_ENTRY(interface) INTERFACE_ENTRY(interface, NULL, &CLSID_PSFactoryBuffer) +#define CLSID_INTERFACE_ENTRY(interface,clsid) INTERFACE_ENTRY(interface, clsid, clsid) + static struct regsvr_interface const interface_list[] = { - { &IID_IDispatch, - "IDispatch", - NULL, - 7, - &CLSID_PSDispatch, - &CLSID_PSDispatch - }, - { &IID_ITypeInfo, - "ITypeInfo", - NULL, - 22, - &CLSID_PSTypeInfo, - &CLSID_PSTypeInfo - }, - { &IID_ITypeLib, - "ITypeLib", - NULL, - 13, - &CLSID_PSTypeLib, - &CLSID_PSTypeLib - }, - { &IID_ITypeComp, - "ITypeComp", - NULL, - 5, - &CLSID_PSTypeComp, - &CLSID_PSTypeComp - }, - { &IID_IEnumVARIANT, - "IEnumVARIANT", - NULL, - 15, - &CLSID_PSEnumVariant, - &CLSID_PSEnumVariant - }, - { &IID_ICreateTypeInfo, - "ICreateTypeInfo", - NULL, - 26, - NULL, - NULL - }, - { &IID_ICreateTypeLib, - "ICreateTypeLib", - NULL, - 13, - NULL, - NULL - }, - { &IID_ITypeInfo2, - "ITypeInfo2", - NULL, - 32, - NULL, - &CLSID_PSDispatch - }, - { &IID_ITypeLib2, - "ITypeLib2", - NULL, - 16, - NULL, - &CLSID_PSDispatch - }, - { &IID_IPropertyPage2, - "IPropertyPage2", - NULL, - 15, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IErrorInfo, - "IErrorInfo", - NULL, - 8, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_ICreateErrorInfo, - "ICreateErrorInfo", - NULL, - 8, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPersistPropertyBag2, - "IPersistPropertyBag2", - NULL, - 8, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPropertyBag2, - "IPropertyBag2", - NULL, - 8, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IErrorLog, - "IErrorLog", - NULL, - 4, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPerPropertyBrowsing, - "IPerPropertyBrowsing", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPersistPropertyBag, - "IPersistPropertyBag", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IAdviseSinkEx, - "IAdviseSinkEx", - NULL, - 9, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IFontEventsDisp, - "FontEvents", - NULL, - 7, - NULL, - &CLSID_PSDispatch - }, - { &IID_IPropertyBag, - "IPropertyBag", - NULL, - 5, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPointerInactive, - "IPointerInactive", - NULL, - 6, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_ISimpleFrameSite, - "ISimpleFrameSite", - NULL, - 5, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPicture, - "IPicture", - NULL, - 17, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPictureDisp, - "Picture", - NULL, - 7, - NULL, - &CLSID_PSDispatch - }, - { &IID_IPersistStreamInit, - "IPersistStreamInit", - NULL, - 9, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IOleUndoUnit, - "IOleUndoUnit", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPropertyNotifySink, - "IPropertyNotifySink", - NULL, - 5, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IOleInPlaceSiteEx, - "IOleInPlaceSiteEx", - NULL, - 18, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IOleParentUndoUnit, - "IOleParentUndoUnit", - NULL, - 12, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IProvideClassInfo2, - "IProvideClassInfo2", - NULL, - 5, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IProvideMultipleClassInfo, - "IProvideMultipleClassInfo", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IProvideClassInfo, - "IProvideClassInfo", - NULL, - 4, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IConnectionPointContainer, - "IConnectionPointContainer", - NULL, - 5, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IEnumConnectionPoints, - "IEnumConnectionPoints", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IConnectionPoint, - "IConnectionPoint", - NULL, - 8, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IEnumConnections, - "IEnumConnections", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IOleControl, - "IOleControl", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IOleControlSite, - "IOleControlSite", - NULL, - 10, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_ISpecifyPropertyPages, - "ISpecifyPropertyPages", - NULL, - 4, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPropertyPageSite, - "IPropertyPageSite", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPropertyPage, - "IPropertyPage", - NULL, - 14, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IClassFactory2, - "IClassFactory2", - NULL, - 8, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IEnumOleUndoUnits, - "IEnumOleUndoUnits", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IPersistMemory, - "IPersistMemory", - NULL, - 9, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IFont, - "IFont", - NULL, - 27, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IFontDisp, - "Font", - NULL, - 7, - NULL, - &CLSID_PSDispatch - }, - { &IID_IQuickActivate, - "IQuickActivate", - NULL, - 6, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IOleUndoManager, - "IOleUndoManager", - NULL, - 15, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IObjectWithSite, - "IObjectWithSite", - NULL, - 5, - NULL, - &CLSID_PSFactoryBuffer - }, + LCL_INTERFACE_ENTRY(ICreateTypeInfo), + LCL_INTERFACE_ENTRY(ICreateTypeLib), + CLSID_INTERFACE_ENTRY(IDispatch,&CLSID_PSDispatch), + CLSID_INTERFACE_ENTRY(IEnumVARIANT,&CLSID_PSEnumVariant), + CLSID_INTERFACE_ENTRY(ITypeComp,&CLSID_PSTypeComp), + CLSID_INTERFACE_ENTRY(ITypeInfo,&CLSID_PSTypeInfo), + CLSID_INTERFACE_ENTRY(ITypeLib,&CLSID_PSTypeLib), + PSFAC_INTERFACE_ENTRY(IAdviseSinkEx), + PSFAC_INTERFACE_ENTRY(IClassFactory2), + PSFAC_INTERFACE_ENTRY(IConnectionPoint), + PSFAC_INTERFACE_ENTRY(IConnectionPointContainer), + PSFAC_INTERFACE_ENTRY(ICreateErrorInfo), + PSFAC_INTERFACE_ENTRY(IEnumConnectionPoints), + PSFAC_INTERFACE_ENTRY(IEnumConnections), + PSFAC_INTERFACE_ENTRY(IEnumOleUndoUnits), + PSFAC_INTERFACE_ENTRY(IErrorInfo), + PSFAC_INTERFACE_ENTRY(IErrorLog), + PSFAC_INTERFACE_ENTRY(IFont), + PSFAC_INTERFACE_ENTRY(IObjectWithSite), + PSFAC_INTERFACE_ENTRY(IOleControl), + PSFAC_INTERFACE_ENTRY(IOleControlSite), + PSFAC_INTERFACE_ENTRY(IOleInPlaceSiteEx), + PSFAC_INTERFACE_ENTRY(IOleParentUndoUnit), + PSFAC_INTERFACE_ENTRY(IOleUndoManager), + PSFAC_INTERFACE_ENTRY(IOleUndoUnit), + PSFAC_INTERFACE_ENTRY(IPerPropertyBrowsing), + PSFAC_INTERFACE_ENTRY(IPersistMemory), + PSFAC_INTERFACE_ENTRY(IPersistPropertyBag), + PSFAC_INTERFACE_ENTRY(IPersistPropertyBag2), + PSFAC_INTERFACE_ENTRY(IPersistStreamInit), + PSFAC_INTERFACE_ENTRY(IPicture), + PSFAC_INTERFACE_ENTRY(IPointerInactive), + PSFAC_INTERFACE_ENTRY(IPropertyBag), + PSFAC_INTERFACE_ENTRY(IPropertyBag2), + PSFAC_INTERFACE_ENTRY(IPropertyNotifySink), + PSFAC_INTERFACE_ENTRY(IPropertyPage), + PSFAC_INTERFACE_ENTRY(IPropertyPage2), + PSFAC_INTERFACE_ENTRY(IPropertyPageSite), + PSFAC_INTERFACE_ENTRY(IProvideClassInfo), + PSFAC_INTERFACE_ENTRY(IProvideClassInfo2), + PSFAC_INTERFACE_ENTRY(IProvideMultipleClassInfo), + PSFAC_INTERFACE_ENTRY(IQuickActivate), + PSFAC_INTERFACE_ENTRY(ISimpleFrameSite), + PSFAC_INTERFACE_ENTRY(ISpecifyPropertyPages), { NULL } /* list terminator */ }; +extern HRESULT WINAPI OLEAUTPS_DllRegisterServer(void) DECLSPEC_HIDDEN; +extern HRESULT WINAPI OLEAUTPS_DllUnregisterServer(void) DECLSPEC_HIDDEN; + /*********************************************************************** * DllRegisterServer (OLEAUT32.@) */ @@ -822,7 +531,9 @@ HRESULT WINAPI DllRegisterServer(void) TRACE("\n"); - hr = register_coclasses(coclass_list); + hr = OLEAUTPS_DllRegisterServer(); + if (SUCCEEDED(hr)) + hr = register_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = register_interfaces(interface_list); return hr; @@ -840,5 +551,7 @@ HRESULT WINAPI DllUnregisterServer(void) hr = unregister_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = unregister_interfaces(interface_list); + if (SUCCEEDED(hr)) + hr = OLEAUTPS_DllUnregisterServer(); return hr; } diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c index 6b98768f7eb..cce17777f4a 100644 --- a/dlls/oleaut32/tests/olefont.c +++ b/dlls/oleaut32/tests/olefont.c @@ -24,7 +24,6 @@ #include #include #include -#include #define COBJMACROS diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index 3f44696f5a2..f81c419b1e6 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -23,7 +23,6 @@ #include #include #include -#include #define COBJMACROS diff --git a/dlls/oleaut32/tests/safearray.c b/dlls/oleaut32/tests/safearray.c index 969d6961fed..0a031415a02 100644 --- a/dlls/oleaut32/tests/safearray.c +++ b/dlls/oleaut32/tests/safearray.c @@ -23,7 +23,6 @@ #include #include #include -#include #define COBJMACROS #include "wine/test.h" diff --git a/dlls/oleaut32/tests/varformat.c b/dlls/oleaut32/tests/varformat.c index 12d65b66a09..b8de8e26c3a 100644 --- a/dlls/oleaut32/tests/varformat.c +++ b/dlls/oleaut32/tests/varformat.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "windef.h" #include "winbase.h" diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 21eeb3fbd90..61225e41442 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "windef.h" #include "winbase.h" diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 8e4745b0c60..9bc601ec42f 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -5685,7 +5685,7 @@ _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args) { /* The size of the argument on the stack in DWORD units (in all x86 call * convetions the arguments on the stack are DWORD-aligned) */ -int _dispargsize(VARTYPE vt) +static int _dispargsize(VARTYPE vt) { switch (vt) { case VT_I8: diff --git a/dlls/oleaut32/usrmarshal.c b/dlls/oleaut32/usrmarshal.c index b31eb39d529..85faac46460 100644 --- a/dlls/oleaut32/usrmarshal.c +++ b/dlls/oleaut32/usrmarshal.c @@ -25,7 +25,6 @@ #define COBJMACROS #define NONAMELESSUNION #define NONAMELESSSTRUCT -#define PROXY_DELEGATION #include "windef.h" #include "winbase.h" @@ -35,7 +34,6 @@ #include "ole2.h" #include "oleauto.h" -#include "rpcproxy.h" #include "typelib.h" #include "ocidl.h" #include "wine/debug.h" @@ -47,26 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); #define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align) #define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align) -static CStdPSFactoryBuffer PSFactoryBuffer; - -CSTDSTUBBUFFERRELEASE(&PSFactoryBuffer) -CSTDSTUBBUFFER2RELEASE(&PSFactoryBuffer) - -extern const ExtendedProxyFileInfo oleaut32_oaidl_ProxyFileInfo; -extern const ExtendedProxyFileInfo oleaut32_ocidl_ProxyFileInfo; - -static const ProxyFileInfo *OLEAUT32_ProxyFileList[] = { - &oleaut32_oaidl_ProxyFileInfo, - &oleaut32_ocidl_ProxyFileInfo, - NULL -}; - -HRESULT OLEAUTPS_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) -{ - return NdrDllGetClassObject(rclsid, riid, ppv, OLEAUT32_ProxyFileList, - &CLSID_PSDispatch, &PSFactoryBuffer); -} - static void dump_user_flags(const ULONG *pFlags) { if (HIWORD(*pFlags) == NDR_LOCAL_DATA_REPRESENTATION) diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c index 52d939e511d..78abd3f10c8 100644 --- a/dlls/oleaut32/vartype.c +++ b/dlls/oleaut32/vartype.c @@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(variant); -extern HMODULE OLEAUT32_hModule; +extern HMODULE hProxyDll DECLSPEC_HIDDEN; #define CY_MULTIPLIER 10000 /* 4 dp of precision */ #define CY_MULTIPLIER_F 10000.0 @@ -5949,11 +5949,11 @@ static BOOL VARIANT_GetLocalisedText(LANGID langId, DWORD dwId, WCHAR *lpszDest) { HRSRC hrsrc; - hrsrc = FindResourceExW( OLEAUT32_hModule, (LPWSTR)RT_STRING, + hrsrc = FindResourceExW( hProxyDll, (LPWSTR)RT_STRING, MAKEINTRESOURCEW((dwId >> 4) + 1), langId ); if (hrsrc) { - HGLOBAL hmem = LoadResource( OLEAUT32_hModule, hrsrc ); + HGLOBAL hmem = LoadResource( hProxyDll, hrsrc ); if (hmem) { diff --git a/dlls/oledlg/insobjdlg.c b/dlls/oledlg/insobjdlg.c index 07c8a812615..5db79f61109 100644 --- a/dlls/oledlg/insobjdlg.c +++ b/dlls/oledlg/insobjdlg.c @@ -124,7 +124,7 @@ UINT WINAPI OleUIInsertObjectA(LPOLEUIINSERTOBJECTA lpOleUIInsertObject) */ INT_PTR CALLBACK UIInsertObjectDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - InsertObjectDlgInfo* pdlgInfo = (InsertObjectDlgInfo*) GetPropA(hwnd,OleUIInsertObjectInfoStr); + InsertObjectDlgInfo* pdlgInfo = GetPropA(hwnd,OleUIInsertObjectInfoStr); switch(uMsg) { @@ -134,7 +134,7 @@ INT_PTR CALLBACK UIInsertObjectDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPAR pdlgInfo->hwndSelf = hwnd; - SetPropA(hwnd, OleUIInsertObjectInfoStr, (HANDLE) pdlgInfo); + SetPropA(hwnd, OleUIInsertObjectInfoStr, pdlgInfo); UIINSERTOBJECTDLG_InitDialog(pdlgInfo); @@ -165,7 +165,7 @@ static LRESULT UIINSOBJDLG_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) { WORD wNotifyCode = HIWORD(wParam); WORD wID = LOWORD(wParam); - InsertObjectDlgInfo* pdlgInfo = (InsertObjectDlgInfo*) GetPropA(hwnd,OleUIInsertObjectInfoStr); + InsertObjectDlgInfo* pdlgInfo = GetPropA(hwnd,OleUIInsertObjectInfoStr); switch(wID) { @@ -399,12 +399,12 @@ static void UIINSERTOBJECTDLG_FreeObjectTypes(InsertObjectDlgInfo* pdlgInfo) { UINT i, count; - count = SendMessageA(pdlgInfo->hwndObjTypeLB, LB_GETCOUNT, (WPARAM)0, (LPARAM)0); + count = SendMessageA(pdlgInfo->hwndObjTypeLB, LB_GETCOUNT, 0, 0); for (i = 0; i < count; i++) { CLSID* lpclsid = (CLSID*) SendMessageA(pdlgInfo->hwndObjTypeLB, - LB_GETITEMDATA, (WPARAM)i, (LPARAM)0); + LB_GETITEMDATA, i, 0); HeapFree(GetProcessHeap(), 0, lpclsid); } } @@ -546,7 +546,7 @@ static void UIINSERTOBJECTDLG_BrowseFile(InsertObjectDlgInfo* pdlgInfo) fn.lpTemplateName = NULL; if (GetOpenFileNameA(&fn)) - SendMessageA(pdlgInfo->hwndFileTB, WM_SETTEXT, (WPARAM)0, (LPARAM)fn.lpstrFile); + SendMessageA(pdlgInfo->hwndFileTB, WM_SETTEXT, 0, (LPARAM)fn.lpstrFile); } diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 35eb8ae83cf..a3ac3af7e6d 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -555,7 +555,12 @@ START_TEST(opengl) hdc = GetDC(hwnd); iPixelFormat = ChoosePixelFormat(hdc, &pfd); - ok(iPixelFormat > 0, "No pixelformat found!\n"); /* This should never happen as ChoosePixelFormat always returns a closest match */ + if(iPixelFormat == 0) + { + /* This should never happen as ChoosePixelFormat always returns a closest match, but currently this fails in Wine if we don't have glX */ + win_skip("Unable to find pixel format.\n"); + goto cleanup; + } /* We shouldn't be able to create a context from a hdc which doesn't have a pixel format set */ hglrc = wglCreateContext(hdc); @@ -615,6 +620,8 @@ START_TEST(opengl) else trace("WGL_ARB_pbuffer not supported, skipping pbuffer test\n"); +cleanup: + ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); } } diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index ff185cefcbc..8480d25c3e2 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -867,8 +867,8 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, { ICOM_THIS_MULTI(IFilterGraphImpl, IFilterGraph2_vtbl, iface); HRESULT hr; - AM_MEDIA_TYPE* mt; - IEnumMediaTypes* penummt; + AM_MEDIA_TYPE* mt = NULL; + IEnumMediaTypes* penummt = NULL; ULONG nbmt; IEnumPins* penumpins; IEnumMoniker* pEnumMoniker; @@ -1095,10 +1095,11 @@ error: } } - IEnumMediaTypes_Release(penummt); - DeleteMediaType(mt); - out: + if (penummt) + IEnumMediaTypes_Release(penummt); + if (mt) + DeleteMediaType(mt); --This->recursioncount; LeaveCriticalSection(&This->cs); TRACE("--> %08x\n", hr); diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index 57327552149..ce296ea0821 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -81,7 +81,7 @@ struct IAMFilterData { const IAMFilterDataVtbl *lpVtbl; }; -const GUID IID_IAMFilterData = { +static const GUID IID_IAMFilterData = { 0x97f7c4d4, 0x547b, 0x4a5f, { 0x83,0x32, 0x53,0x64,0x30,0xad,0x2e,0x4d } }; diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 5eece594060..6b4c135d234 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -241,26 +241,6 @@ const char * qzdebugstr_guid( const GUID * id ) return debugstr_guid(id); } -/*********************************************************************** - * qzdebugstr_State (internal) - * - * Gives a text version of the FILTER_STATE enumeration - */ -const char * qzdebugstr_State(FILTER_STATE state) -{ - switch (state) - { - case State_Stopped: - return "State_Stopped"; - case State_Running: - return "State_Running"; - case State_Paused: - return "State_Paused"; - default: - return "State_Unknown"; - } -} - LONG WINAPI AmpFactorToDB(LONG ampfactor) { FIXME("(%d) Stub!\n", ampfactor); diff --git a/dlls/quartz/memallocator.c b/dlls/quartz/memallocator.c index 1718d197d8c..58c9b6c0810 100644 --- a/dlls/quartz/memallocator.c +++ b/dlls/quartz/memallocator.c @@ -31,40 +31,42 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); -void dump_AM_SAMPLE2_PROPERTIES(const AM_SAMPLE2_PROPERTIES * pProps) -{ - if (!pProps) - { - TRACE("AM_SAMPLE2_PROPERTIES: (null)\n"); - return; - } - TRACE("\tcbData: %d\n", pProps->cbData); - TRACE("\tdwTypeSpecificFlags: 0x%8x\n", pProps->dwTypeSpecificFlags); - TRACE("\tdwSampleFlags: 0x%8x\n", pProps->dwSampleFlags); - TRACE("\tlActual: %d\n", pProps->lActual); - TRACE("\ttStart: %x%08x%s\n", (LONG)(pProps->tStart >> 32), (LONG)pProps->tStart, pProps->dwSampleFlags & AM_SAMPLE_TIMEVALID ? "" : " (not valid)"); - TRACE("\ttStop: %x%08x%s\n", (LONG)(pProps->tStop >> 32), (LONG)pProps->tStop, pProps->dwSampleFlags & AM_SAMPLE_STOPVALID ? "" : " (not valid)"); - TRACE("\tdwStreamId: 0x%x\n", pProps->dwStreamId); - TRACE("\tpMediaType: %p\n", pProps->pMediaType); - TRACE("\tpbBuffer: %p\n", pProps->pbBuffer); - TRACE("\tcbBuffer: %d\n", pProps->cbBuffer); -} +typedef struct BaseMemAllocator +{ + const IMemAllocatorVtbl * lpVtbl; + + LONG ref; + ALLOCATOR_PROPERTIES props; + HRESULT (* fnAlloc) (IMemAllocator *); + HRESULT (* fnFree)(IMemAllocator *); + HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *); + HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD flags); + HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *); + void (* fnDestroyed)(IMemAllocator *); + HANDLE hSemWaiting; + BOOL bDecommitQueued; + BOOL bCommitted; + LONG lWaiting; + struct list free_list; + struct list used_list; + CRITICAL_SECTION *pCritSect; +} BaseMemAllocator; static const IMemAllocatorVtbl BaseMemAllocator_VTable; static const IMediaSample2Vtbl StdMediaSample2_VTable; -#define AM_SAMPLE2_PROP_SIZE_WRITABLE (unsigned int)(&((AM_SAMPLE2_PROPERTIES *)0)->pbBuffer) +#define AM_SAMPLE2_PROP_SIZE_WRITABLE FIELD_OFFSET(AM_SAMPLE2_PROPERTIES, pbBuffer) #define INVALID_MEDIA_TIME (((ULONGLONG)0x7fffffff << 32) | 0xffffffff) -HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), - HRESULT (* fnFree)(IMemAllocator *), - HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *), - HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD), - HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *), - void (* fnDestroyed)(IMemAllocator *), - CRITICAL_SECTION *pCritSect, - BaseMemAllocator * pMemAlloc) +static HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), + HRESULT (* fnFree)(IMemAllocator *), + HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *), + HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD), + HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *), + void (* fnDestroyed)(IMemAllocator *), + CRITICAL_SECTION *pCritSect, + BaseMemAllocator * pMemAlloc) { assert(fnAlloc && fnFree && fnDestroyed); @@ -399,7 +401,7 @@ static const IMemAllocatorVtbl BaseMemAllocator_VTable = BaseMemAllocator_ReleaseBuffer }; -HRESULT StdMediaSample2_Construct(BYTE * pbBuffer, LONG cbBuffer, IMemAllocator * pParent, StdMediaSample2 ** ppSample) +static HRESULT StdMediaSample2_Construct(BYTE * pbBuffer, LONG cbBuffer, IMemAllocator * pParent, StdMediaSample2 ** ppSample) { assert(pbBuffer && pParent && (cbBuffer > 0)); @@ -423,7 +425,7 @@ HRESULT StdMediaSample2_Construct(BYTE * pbBuffer, LONG cbBuffer, IMemAllocator return S_OK; } -void StdMediaSample2_Delete(StdMediaSample2 * This) +static void StdMediaSample2_Delete(StdMediaSample2 * This) { /* NOTE: does not remove itself from the list it belongs to */ CoTaskMemFree(This); diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 59ff42706c4..147ae884017 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -747,7 +747,7 @@ static HRESULT WINAPI Parser_PullPin_Disconnect(IPin * iface) return hr; } -HRESULT WINAPI Parser_PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) +static HRESULT WINAPI Parser_PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) { HRESULT hr; diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index e025078b9ab..3e0dfe1ae5e 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -76,7 +76,6 @@ HRESULT IEnumRegFiltersImpl_Construct(REGFILTER * pInRegFilters, const ULONG siz HRESULT IEnumFiltersImpl_Construct(IBaseFilter ** ppFilters, ULONG nFilters, IEnumFilters ** ppEnum); extern const char * qzdebugstr_guid(const GUID * id); -extern const char * qzdebugstr_State(FILTER_STATE state); HRESULT CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc); void FreeMediaType(AM_MEDIA_TYPE * pmt); @@ -97,37 +96,4 @@ typedef struct StdMediaSample2 LONGLONG tMediaEnd; } StdMediaSample2; -typedef struct BaseMemAllocator -{ - const IMemAllocatorVtbl * lpVtbl; - - LONG ref; - ALLOCATOR_PROPERTIES props; - HRESULT (* fnAlloc) (IMemAllocator *); - HRESULT (* fnFree)(IMemAllocator *); - HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *); - HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD flags); - HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *); - void (* fnDestroyed)(IMemAllocator *); - HANDLE hSemWaiting; - BOOL bDecommitQueued; - BOOL bCommitted; - LONG lWaiting; - struct list free_list; - struct list used_list; - CRITICAL_SECTION *pCritSect; -} BaseMemAllocator; - -HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), - HRESULT (* fnFree)(IMemAllocator *), - HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *), - HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD), - HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *), - void (* fnDestroyed)(IMemAllocator *), - CRITICAL_SECTION *pCritSect, - BaseMemAllocator * pMemAlloc); - -HRESULT StdMediaSample2_Construct(BYTE * pbBuffer, LONG cbBuffer, IMemAllocator * pParent, StdMediaSample2 ** ppSample); -void StdMediaSample2_Delete(StdMediaSample2 * This); - #endif /* __QUARTZ_PRIVATE_INCLUDED__ */ diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index 88ac7adeb02..a97199389c3 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -260,7 +260,7 @@ static HRESULT WINAPI SystemClockImpl_AdviseTime(IReferenceClock* iface, REFEREN TRACE("(%p, 0x%s, 0x%s, %ld, %p)\n", This, wine_dbgstr_longlong(rtBaseTime), wine_dbgstr_longlong(rtStreamTime), hEvent, pdwAdviseCookie); - if ((HEVENT) 0 == hEvent) { + if (!hEvent) { return E_INVALIDARG; } if (0 >= rtBaseTime + rtStreamTime) { @@ -296,7 +296,7 @@ static HRESULT WINAPI SystemClockImpl_AdvisePeriodic(IReferenceClock* iface, REF TRACE("(%p, 0x%s, 0x%s, %ld, %p)\n", This, wine_dbgstr_longlong(rtStartTime), wine_dbgstr_longlong(rtPeriodTime), hSemaphore, pdwAdviseCookie); - if ((HSEMAPHORE) 0 == hSemaphore) { + if (!hSemaphore) { return E_INVALIDARG; } if (0 >= rtStartTime || 0 >= rtPeriodTime) { diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index acd0ba2a3da..437779c5468 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -355,9 +355,14 @@ static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample) long cbSrcStream = 0; REFERENCE_TIME tStart, tStop; HRESULT hr; + EnterCriticalSection(&This->csFilter); + if (This->pInputPin->flushing || This->pInputPin->end_of_stream) - hr = S_FALSE; + { + LeaveCriticalSection(&This->csFilter); + return S_FALSE; + } if (This->state == State_Stopped) { diff --git a/dlls/rpcrt4/cpsf.c b/dlls/rpcrt4/cpsf.c index 22537fde13a..bece899d964 100644 --- a/dlls/rpcrt4/cpsf.c +++ b/dlls/rpcrt4/cpsf.c @@ -36,12 +36,25 @@ #include "rpcproxy.h" +#include "wine/unicode.h" #include "wine/debug.h" #include "cpsf.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); +static void format_clsid( WCHAR *buffer, const CLSID *clsid ) +{ + static const WCHAR clsid_formatW[] = {'{','%','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}; + + sprintfW( buffer, clsid_formatW, clsid->Data1, clsid->Data2, clsid->Data3, + clsid->Data4[0], clsid->Data4[1], clsid->Data4[2], clsid->Data4[3], + clsid->Data4[4], clsid->Data4[5], clsid->Data4[6], clsid->Data4[7] ); + +} + static BOOL FindProxyInfo(const ProxyFileInfo **pProxyFileList, REFIID riid, const ProxyFileInfo **pProxyInfo, int *pIndex) { while (*pProxyFileList) { @@ -197,6 +210,7 @@ HRESULT WINAPI NdrDllCanUnloadNow(CStdPSFactoryBuffer *pPSFactoryBuffer) return !(pPSFactoryBuffer->RefCount); } + /*********************************************************************** * NdrDllRegisterProxy [RPCRT4.@] */ @@ -204,13 +218,21 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid) { - LPSTR clsid; - char keyname[120], module[MAX_PATH]; + static const WCHAR bothW[] = {'B','o','t','h',0}; + static const WCHAR clsidW[] = {'C','L','S','I','D','\\',0}; + static const WCHAR clsid32W[] = {'P','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0}; + static const WCHAR interfaceW[] = {'I','n','t','e','r','f','a','c','e','\\',0}; + static const WCHAR psfactoryW[] = {'P','S','F','a','c','t','o','r','y','B','u','f','f','e','r',0}; + static const WCHAR numformatW[] = {'%','u',0}; + static const WCHAR nummethodsW[] = {'N','u','m','M','e','t','h','o','d','s',0}; + static const WCHAR inprocserverW[] = {'I','n','P','r','o','c','S','e','r','v','e','r','3','2',0}; + static const WCHAR threadingmodelW[] = {'T','h','r','e','a','d','i','n','g','M','o','d','e','l',0}; + WCHAR clsid[39], keyname[50], module[MAX_PATH]; HKEY key, subkey; DWORD len; TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); - UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid); + format_clsid( clsid, pclsid ); /* register interfaces to point to clsid */ while (*pProxyFileList) { @@ -218,23 +240,19 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, for (u=0; u<(*pProxyFileList)->TableSize; u++) { CInterfaceStubVtbl *proxy = (*pProxyFileList)->pStubVtblList[u]; PCInterfaceName name = (*pProxyFileList)->pNamesArray[u]; - LPSTR iid; - TRACE("registering %s %s => %s\n", name, debugstr_guid(proxy->header.piid), clsid); + TRACE("registering %s %s => %s\n", + debugstr_a(name), debugstr_guid(proxy->header.piid), debugstr_w(clsid)); - UuidToStringA((UUID*)proxy->header.piid, (unsigned char**)&iid); - snprintf(keyname, sizeof(keyname), "Interface\\{%s}", iid); - RpcStringFreeA((unsigned char**)&iid); - if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, - KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { + strcpyW( keyname, interfaceW ); + format_clsid( keyname + strlenW(keyname), proxy->header.piid ); + if (RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key) == ERROR_SUCCESS) { + WCHAR num[10]; if (name) - RegSetValueExA(key, NULL, 0, REG_SZ, (const BYTE *)name, strlen(name)); - if (RegCreateKeyExA(key, "ProxyStubClsid32", 0, NULL, 0, - KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) { - snprintf(module, sizeof(module), "{%s}", clsid); - RegSetValueExA(subkey, NULL, 0, REG_SZ, (LPBYTE)module, strlen(module)); - RegCloseKey(subkey); - } + RegSetValueExA(key, NULL, 0, REG_SZ, (const BYTE *)name, strlen(name)+1); + RegSetValueW( key, clsid32W, REG_SZ, clsid, 0 ); + sprintfW(num, numformatW, proxy->header.DispatchTableCount); + RegSetValueW( key, nummethodsW, REG_SZ, num, 0 ); RegCloseKey(key); } } @@ -242,25 +260,22 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, } /* register clsid to point to module */ - snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid); - len = GetModuleFileNameA(hDll, module, sizeof(module)); + strcpyW( keyname, clsidW ); + strcatW( keyname, clsid ); + len = GetModuleFileNameW(hDll, module, sizeof(module)/sizeof(WCHAR)); if (len && len < sizeof(module)) { - TRACE("registering CLSID %s => %s\n", clsid, module); - if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0, - KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { - RegSetValueExA(subkey, NULL, 0, REG_SZ, (const BYTE *)"PSFactoryBuffer", strlen("PSFactoryBuffer")); - if (RegCreateKeyExA(key, "InProcServer32", 0, NULL, 0, - KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) { - RegSetValueExA(subkey, NULL, 0, REG_SZ, (LPBYTE)module, strlen(module)); - RegSetValueExA(subkey, "ThreadingModel", 0, REG_SZ, (const BYTE *)"Both", strlen("Both")); - RegCloseKey(subkey); + TRACE("registering CLSID %s => %s\n", debugstr_w(clsid), debugstr_w(module)); + if (RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key) == ERROR_SUCCESS) { + RegSetValueExW(subkey, NULL, 0, REG_SZ, (const BYTE *)psfactoryW, sizeof(psfactoryW)); + if (RegCreateKeyW(key, inprocserverW, &subkey) == ERROR_SUCCESS) { + RegSetValueExW(subkey, NULL, 0, REG_SZ, (LPBYTE)module, (strlenW(module)+1)*sizeof(WCHAR)); + RegSetValueExW(subkey, threadingmodelW, 0, REG_SZ, (const BYTE *)bothW, sizeof(bothW)); + RegCloseKey(subkey); + } + RegCloseKey(key); } - RegCloseKey(key); - } } - /* done */ - RpcStringFreeA((unsigned char**)&clsid); return S_OK; } @@ -271,12 +286,11 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid) { - LPSTR clsid; - char keyname[120], module[MAX_PATH]; - DWORD len; + static const WCHAR clsidW[] = {'C','L','S','I','D','\\',0}; + static const WCHAR interfaceW[] = {'I','n','t','e','r','f','a','c','e','\\',0}; + WCHAR keyname[50]; TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid)); - UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid); /* unregister interfaces */ while (*pProxyFileList) { @@ -284,27 +298,20 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, for (u=0; u<(*pProxyFileList)->TableSize; u++) { CInterfaceStubVtbl *proxy = (*pProxyFileList)->pStubVtblList[u]; PCInterfaceName name = (*pProxyFileList)->pNamesArray[u]; - LPSTR iid; - TRACE("unregistering %s %s <= %s\n", name, debugstr_guid(proxy->header.piid), clsid); + TRACE("unregistering %s %s\n", debugstr_a(name), debugstr_guid(proxy->header.piid)); - UuidToStringA((UUID*)proxy->header.piid, (unsigned char**)&iid); - snprintf(keyname, sizeof(keyname), "Interface\\{%s}", iid); - RpcStringFreeA((unsigned char**)&iid); - RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); + strcpyW( keyname, interfaceW ); + format_clsid( keyname + strlenW(keyname), proxy->header.piid ); + RegDeleteTreeW(HKEY_CLASSES_ROOT, keyname); } pProxyFileList++; } /* unregister clsid */ - snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid); - len = GetModuleFileNameA(hDll, module, sizeof(module)); - if (len && len < sizeof(module)) { - TRACE("unregistering CLSID %s <= %s\n", clsid, module); - RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname); - } + strcpyW( keyname, clsidW ); + format_clsid( keyname + strlenW(keyname), pclsid ); + RegDeleteTreeW(HKEY_CLASSES_ROOT, keyname); - /* done */ - RpcStringFreeA((unsigned char**)&clsid); return S_OK; } diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c index 1f0b1bbd615..177c82caadb 100644 --- a/dlls/rpcrt4/rpcrt4_main.c +++ b/dlls/rpcrt4/rpcrt4_main.c @@ -78,7 +78,7 @@ static CRITICAL_SECTION_DEBUG threaddata_cs_debug = }; static CRITICAL_SECTION threaddata_cs = { &threaddata_cs_debug, -1, 0, 0, 0, 0 }; -struct list threaddata_list = LIST_INIT(threaddata_list); +static struct list threaddata_list = LIST_INIT(threaddata_list); struct context_handle_list { diff --git a/dlls/sane.ds/capability.c b/dlls/sane.ds/capability.c index 6b6867e02a6..615e4cb0b5f 100644 --- a/dlls/sane.ds/capability.c +++ b/dlls/sane.ds/capability.c @@ -31,6 +31,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(twain); +static TW_UINT16 SANE_ICAPXferMech (pTW_CAPABILITY pCapability, TW_UINT16 action); + TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action) { TW_UINT16 twCC = TWCC_SUCCESS; @@ -205,7 +207,7 @@ static TW_BOOL TWAIN_OneValueGet (pTW_CAPABILITY pCapability, TW_UINT32 *pValue) } /* ICAP_XFERMECH */ -TW_UINT16 SANE_ICAPXferMech (pTW_CAPABILITY pCapability, TW_UINT16 action) +static TW_UINT16 SANE_ICAPXferMech (pTW_CAPABILITY pCapability, TW_UINT16 action) { TRACE("ICAP_XFERMECH\n"); diff --git a/dlls/sane.ds/sane_Si.rc b/dlls/sane.ds/sane_Si.rc index 4a3470c44b0..ad6b8757176 100644 --- a/dlls/sane.ds/sane_Si.rc +++ b/dlls/sane.ds/sane_Si.rc @@ -27,7 +27,7 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTE CAPTION "Skeniranje" FONT 8, "MS Sans Serif" BEGIN - LTEXT "Skeniram... Prosim, počakajte",IDC_STATIC,5,19,176,8, SS_CENTER + LTEXT "Skeniram ... Prosim, počakajte",IDC_STATIC,5,19,176,8, SS_CENTER END STRINGTABLE DISCARDABLE diff --git a/dlls/sane.ds/sane_i.h b/dlls/sane.ds/sane_i.h index c1f0bee1be6..badb4db980d 100644 --- a/dlls/sane.ds/sane_i.h +++ b/dlls/sane.ds/sane_i.h @@ -77,14 +77,6 @@ struct tagActiveDS /* Helper functions */ extern TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action); -/* */ -extern TW_UINT16 SANE_ControlGroupHandler ( - pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); -extern TW_UINT16 SANE_ImageGroupHandler ( - pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); -extern TW_UINT16 SANE_SourceManagerHandler ( - pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); - /* Implementation of operation triplets * From Application to Source (Control Information) */ TW_UINT16 SANE_CapabilityGet (pTW_IDENTITY pOrigin, TW_MEMREF pData); @@ -214,9 +206,6 @@ TW_UINT16 SANE_RGBResponseReset TW_UINT16 SANE_RGBResponseSet (pTW_IDENTITY pOrigin, TW_MEMREF pData); -/* Implementation of TWAIN capabilities */ -TW_UINT16 SANE_ICAPXferMech (pTW_CAPABILITY pCapability, TW_UINT16 action); - /* UI function */ BOOL DoScannerUI(void); HWND ScanningDialogBox(HWND dialog, LONG progress); diff --git a/dlls/sane.ds/sane_main.c b/dlls/sane.ds/sane_main.c index 8c0e39feb37..ea1af0ea15e 100644 --- a/dlls/sane.ds/sane_main.c +++ b/dlls/sane.ds/sane_main.c @@ -372,7 +372,7 @@ static TW_UINT16 SANE_SourceControlHandler ( } -TW_UINT16 SANE_ImageGroupHandler ( +static TW_UINT16 SANE_ImageGroupHandler ( pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index ca37474a4cb..860a6a32f9e 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -459,8 +459,8 @@ @ stdcall SetupOpenInfFileW(wstr wstr long ptr) @ stdcall SetupOpenLog(long) @ stdcall SetupOpenMasterInf() -@ stub SetupPromptForDiskA -@ stub SetupPromptForDiskW +@ stdcall SetupPromptForDiskA(ptr str str str str str long ptr long ptr) +@ stdcall SetupPromptForDiskW(ptr wstr wstr wstr wstr wstr long ptr long ptr) @ stdcall SetupPromptReboot(ptr ptr long) @ stub SetupQueryDrivesInDiskSpaceListA @ stub SetupQueryDrivesInDiskSpaceListW diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c index a6f7a5b789c..33240ce1f12 100644 --- a/dlls/setupapi/stubs.c +++ b/dlls/setupapi/stubs.c @@ -200,3 +200,31 @@ BOOL WINAPI SetupDiGetINFClassW(PCWSTR inf, LPGUID class_guid, PWSTR class_name, FIXME("%s %p %p %d %p\n", debugstr_w(inf), class_guid, class_name, size, required_size); return FALSE; } + +/*********************************************************************** + * SetupPromptForDiskA (SETUPAPI.@) + */ +UINT WINAPI SetupPromptForDiskA(HWND hwndParent, PCSTR DialogTitle, PCSTR DiskName, + PCSTR PathToSource, PCSTR FileSought, PCSTR TagFile, DWORD DiskPromptStyle, + PSTR PathBuffer, DWORD PathBufferSize, PDWORD PathRequiredSize) +{ + FIXME("%p %s %s %s %s %s %d %p %d %p: stub\n", hwndParent, debugstr_a(DialogTitle), + debugstr_a(DiskName), debugstr_a(PathToSource), debugstr_a(FileSought), + debugstr_a(TagFile), DiskPromptStyle, PathBuffer, PathBufferSize, + PathRequiredSize); + return 0; +} + +/*********************************************************************** + * SetupPromptForDiskW (SETUPAPI.@) + */ +UINT WINAPI SetupPromptForDiskW(HWND hwndParent, PCWSTR DialogTitle, PCWSTR DiskName, + PCWSTR PathToSource, PCWSTR FileSought, PCWSTR TagFile, DWORD DiskPromptStyle, + PWSTR PathBuffer, DWORD PathBufferSize, PDWORD PathRequiredSize) +{ + FIXME("%p %s %s %s %s %s %d %p %d %p: stub\n", hwndParent, debugstr_w(DialogTitle), + debugstr_w(DiskName), debugstr_w(PathToSource), debugstr_w(FileSought), + debugstr_w(TagFile), DiskPromptStyle, PathBuffer, PathBufferSize, + PathRequiredSize); + return 0; +} diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 4e11bc0aba2..37c3acda84d 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -320,30 +320,23 @@ static void test_SetupDiOpenClassRegKeyExA(void) trace("failed to open classes key\n"); } -static void append_str(char **str, const char *data) -{ - sprintf(*str, data); - *str += strlen(*str); -} - static void create_inf_file(LPCSTR filename) { - char data[1024]; - char *ptr = data; DWORD dwNumberOfBytesWritten; HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - append_str(&ptr, "[Version]\n"); - append_str(&ptr, "Signature=\"$Chicago$\"\n"); - append_str(&ptr, "Class=Bogus\n"); - append_str(&ptr, "ClassGUID={6a55b5a4-3f65-11db-b704-0011955c2bdb}\n"); - append_str(&ptr, "[ClassInstall32]\n"); - append_str(&ptr, "AddReg=BogusClass.NT.AddReg\n"); - append_str(&ptr, "[BogusClass.NT.AddReg]\n"); - append_str(&ptr, "HKR,,,,\"Wine test devices\"\n"); - - WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL); + static const char data[] = + "[Version]\n" + "Signature=\"$Chicago$\"\n" + "Class=Bogus\n" + "ClassGUID={6a55b5a4-3f65-11db-b704-0011955c2bdb}\n" + "[ClassInstall32]\n" + "AddReg=BogusClass.NT.AddReg\n" + "[BogusClass.NT.AddReg]\n" + "HKR,,,,\"Wine test devices\"\n"; + + WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL); CloseHandle(hf); } diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c index 7164e7dfbf4..7d0d2ea885b 100644 --- a/dlls/setupapi/tests/misc.c +++ b/dlls/setupapi/tests/misc.c @@ -47,29 +47,22 @@ static BOOL (WINAPI *pSetupGetFileCompressionInfoExA)(PCSTR, PSTR, DWORD, PDWORD static BOOL (WINAPI *pSetupCopyOEMInfA)(PCSTR, PCSTR, DWORD, DWORD, PSTR, DWORD, PDWORD, PSTR *); static BOOL (WINAPI *pSetupQueryInfOriginalFileInformationA)(PSP_INF_INFORMATION, UINT, PSP_ALTPLATFORM_INFO, PSP_ORIGINAL_FILE_INFO_A); -static void append_str(char **str, const char *data) -{ - sprintf(*str, data); - *str += strlen(*str); -} - static void create_inf_file(LPCSTR filename) { - char data[1024]; - char *ptr = data; DWORD dwNumberOfBytesWritten; HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - append_str(&ptr, "[Version]\n"); - append_str(&ptr, "Signature=\"$Chicago$\"\n"); - append_str(&ptr, "AdvancedINF=2.5\n"); - append_str(&ptr, "[DefaultInstall]\n"); - append_str(&ptr, "RegisterOCXs=RegisterOCXsSection\n"); - append_str(&ptr, "[RegisterOCXsSection]\n"); - append_str(&ptr, "%%11%%\\ole32.dll\n"); + static const char data[] = + "[Version]\n" + "Signature=\"$Chicago$\"\n" + "AdvancedINF=2.5\n" + "[DefaultInstall]\n" + "RegisterOCXs=RegisterOCXsSection\n" + "[RegisterOCXsSection]\n" + "%%11%%\\ole32.dll\n"; - WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL); + WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL); CloseHandle(hf); } diff --git a/dlls/setupapi/tests/query.c b/dlls/setupapi/tests/query.c index 167727a9978..a1b7bd5cbf8 100644 --- a/dlls/setupapi/tests/query.c +++ b/dlls/setupapi/tests/query.c @@ -43,56 +43,48 @@ static void get_directories(void) WIN_DIR[len-1] = 0; } -static void append_str(char **str, const char *data) -{ - sprintf(*str, data); - *str += strlen(*str); -} - static void create_inf_file(LPSTR filename) { - char data[1024]; - char *ptr = data; DWORD dwNumberOfBytesWritten; HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - append_str(&ptr, "[Version]\n"); - append_str(&ptr, "Signature=\"$Chicago$\"\n"); - append_str(&ptr, "AdvancedINF=2.5\n"); - append_str(&ptr, "[SourceDisksNames]\n"); - append_str(&ptr, "2 = %%SrcDiskName%%, LANCOM\\LANtools\\lanconf.cab\n"); - append_str(&ptr, "[SourceDisksFiles]\n"); - append_str(&ptr, "lanconf.exe = 2\n"); - append_str(&ptr, "[DestinationDirs]\n"); - append_str(&ptr, "DefaultDestDir = 24, %%DefaultDest%%\n"); - append_str(&ptr, "[Strings]\n"); - append_str(&ptr, "LangDir = english\n"); - append_str(&ptr, "DefaultDest = LANCOM\n"); - append_str(&ptr, "SrcDiskName = \"LANCOM Software CD\"\n"); - - WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL); + static const char data[] = + "[Version]\n" + "Signature=\"$Chicago$\"\n" + "AdvancedINF=2.5\n" + "[SourceDisksNames]\n" + "2 = %SrcDiskName%, LANCOM\\LANtools\\lanconf.cab\n" + "[SourceDisksFiles]\n" + "lanconf.exe = 2\n" + "[DestinationDirs]\n" + "DefaultDestDir = 24, %DefaultDest%\n" + "[Strings]\n" + "LangDir = english\n" + "DefaultDest = LANCOM\n" + "SrcDiskName = \"LANCOM Software CD\"\n"; + + WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL); CloseHandle(hf); } static void create_inf_file2(LPSTR filename) { - char data[1024]; - char *ptr = data; DWORD dwNumberOfBytesWritten; HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - append_str(&ptr, "[SourceFileInfo]\n"); - append_str(&ptr, "sp1qfe\\bitsinst.exe=250B3702C7CCD7C2F9E4DAA1555C933E,000600060A28062C,27136,SP1QFE\n"); - append_str(&ptr, "sp1qfe\\bitsprx2.dll=4EBEA67F4BB4EB402E725CA7CA2857AE,000600060A280621,7680,SP1QFE\n"); - append_str(&ptr, "sp1qfe\\bitsprx3.dll=C788A1D9330DA011EF25E95D3BC7BDE5,000600060A280621,7168,SP1QFE\n"); - append_str(&ptr, "sp1qfe\\qmgr.dll=696AC82FB290A03F205901442E0E9589,000600060A280621,361984,SP1QFE\n"); - append_str(&ptr, "sp1qfe\\qmgrprxy.dll=8B5848144829E1BC985EA4C3D8CA7E3F,000600060A280621,17408,SP1QFE\n"); - append_str(&ptr, "sp1qfe\\winhttp.dll=3EC6F518114606CA59D4160322077437,000500010A280615,331776,SP1QFE\n"); - append_str(&ptr, "sp1qfe\\xpob2res.dll=DB83156B9F496F20D1EA70E4ABEC0166,000500010A280622,158720,SP1QFE\n"); - - WriteFile(hf, data, ptr - data, &dwNumberOfBytesWritten, NULL); + static const char data[] = + "[SourceFileInfo]\n" + "sp1qfe\\bitsinst.exe=250B3702C7CCD7C2F9E4DAA1555C933E,000600060A28062C,27136,SP1QFE\n" + "sp1qfe\\bitsprx2.dll=4EBEA67F4BB4EB402E725CA7CA2857AE,000600060A280621,7680,SP1QFE\n" + "sp1qfe\\bitsprx3.dll=C788A1D9330DA011EF25E95D3BC7BDE5,000600060A280621,7168,SP1QFE\n" + "sp1qfe\\qmgr.dll=696AC82FB290A03F205901442E0E9589,000600060A280621,361984,SP1QFE\n" + "sp1qfe\\qmgrprxy.dll=8B5848144829E1BC985EA4C3D8CA7E3F,000600060A280621,17408,SP1QFE\n" + "sp1qfe\\winhttp.dll=3EC6F518114606CA59D4160322077437,000500010A280615,331776,SP1QFE\n" + "sp1qfe\\xpob2res.dll=DB83156B9F496F20D1EA70E4ABEC0166,000500010A280622,158720,SP1QFE\n"; + + WriteFile(hf, data, sizeof(data) - 1, &dwNumberOfBytesWritten, NULL); CloseHandle(hf); } diff --git a/dlls/shdoclc/Si.rc b/dlls/shdoclc/Si.rc index 0fdc1f62e1a..ccc79002144 100644 --- a/dlls/shdoclc/Si.rc +++ b/dlls/shdoclc/Si.rc @@ -39,7 +39,7 @@ IDR_BROWSE_CONTEXT_MENU MENU MENUITEM "&Naprej", IDM_GOBACKWARD MENUITEM "Na&zaj", IDM_GOFORWARD MENUITEM SEPARATOR - MENUITEM "&Shrani ozadje kot...", IDM_SAVEBACKGROUND + MENUITEM "&Shrani ozadje kot ...", IDM_SAVEBACKGROUND MENUITEM "Nastavi kot oza&dje", IDM_SETWALLPAPER MENUITEM "&Kopiraj ozadje", IDM_COPYBACKGROUND MENUITEM "Nastavi kot p&redmet Namizja", IDM_SETDESKTOPITEM @@ -64,23 +64,23 @@ IDR_BROWSE_CONTEXT_MENU MENU { MENUITEM "&Odpri povezavo", IDM_FOLLOWLINKC MENUITEM "Odpri povezavo v &novem oknu", IDM_FOLLOWLINKN - MENUITEM "Shrani cilj &kot...", IDM_SAVETARGET + MENUITEM "Shrani cilj &kot ...", IDM_SAVETARGET MENUITEM "Na&tisni cilj", IDM_PRINTTARGET MENUITEM SEPARATOR MENUITEM "P&okaži sliko", IDM_SHOWPICTURE - MENUITEM "&Shrani sliko kot...", IDM_SAVEPICTURE - MENUITEM "Po&šlji sliko...", IDM_MP_EMAILPICTURE - MENUITEM "Natisni s&liko...", IDM_MP_PRINTPICTURE + MENUITEM "&Shrani sliko kot ...", IDM_SAVEPICTURE + MENUITEM "Po&šlji sliko ...", IDM_MP_EMAILPICTURE + MENUITEM "Natisni s&liko ...", IDM_MP_PRINTPICTURE MENUITEM "Po&jdi v mapo Slike", IDM_MP_MYPICS MENUITEM "Nastavi kot oza&dje", IDM_SETWALLPAPER - MENUITEM "Nastavi kot p&redmet Namizja...", IDM_SETDESKTOPITEM + MENUITEM "Nastavi kot p&redmet Namizja ...", IDM_SETDESKTOPITEM MENUITEM SEPARATOR MENUITEM "&Izreži", IDM_CUT MENUITEM "&Kopiraj", IDM_COPY MENUITEM "Kopiraj &bližnjico", IDM_COPYSHORTCUT MENUITEM "&Prilepi", IDM_PASTE MENUITEM SEPARATOR - MENUITEM "Dodaj med Pri&ljubljene...", IDM_ADDFAVORITES + MENUITEM "Dodaj med Pri&ljubljene ...", IDM_ADDFAVORITES MENUITEM SEPARATOR MENUITEM SEPARATOR MENUITEM "Lastnost&i", IDM_PROPERTIES @@ -128,7 +128,7 @@ IDR_BROWSE_CONTEXT_MENU MENU { MENUITEM "&Odpri", IDM_FOLLOWLINKC MENUITEM "Odpri v &novem oknu", IDM_FOLLOWLINKN - MENUITEM "Shrani colj &kot...", IDM_SAVETARGET + MENUITEM "Shrani colj &kot ...", IDM_SAVETARGET MENUITEM "Na&tisni cilj", IDM_PRINTTARGET MENUITEM SEPARATOR MENUITEM "Izreži", IDM_CUT @@ -136,7 +136,7 @@ IDR_BROWSE_CONTEXT_MENU MENU MENUITEM "Kopiraj &bližnjico", IDM_COPYSHORTCUT MENUITEM "&Prilepi", IDM_PASTE MENUITEM SEPARATOR - MENUITEM "Dodaj med Pri&ljubljene...", IDM_ADDFAVORITES + MENUITEM "Dodaj med Pri&ljubljene ...", IDM_ADDFAVORITES MENUITEM SEPARATOR MENUITEM SEPARATOR MENUITEM "Lastnost&i", IDM_PROPERTIES @@ -151,20 +151,20 @@ IDR_BROWSE_CONTEXT_MENU MENU { MENUITEM "&Odpri povezavo", IDM_FOLLOWLINKC MENUITEM "Odpri povezavo v &novem oknu", IDM_FOLLOWLINKN - MENUITEM "Shrani cilj &kot...", IDM_SAVETARGET + MENUITEM "Shrani cilj &kot ...", IDM_SAVETARGET MENUITEM "Na&tisni cilj", IDM_PRINTTARGET MENUITEM SEPARATOR MENUITEM "&Pokaži sliko", IDM_SHOWPICTURE - MENUITEM "Shrani &video kot...", IDM_SAVEPICTURE + MENUITEM "Shrani &video kot ...", IDM_SAVEPICTURE MENUITEM "Nastavi kot oza&dje", IDM_SETWALLPAPER - MENUITEM "Nastavi kot p&redmet Namizja...", IDM_SETDESKTOPITEM + MENUITEM "Nastavi kot p&redmet Namizja ...", IDM_SETDESKTOPITEM MENUITEM SEPARATOR MENUITEM "&Izreži", IDM_CUT MENUITEM "&Kopiraj", IDM_COPY MENUITEM "Kopiraj &bližnjico", IDM_COPYSHORTCUT MENUITEM "&Prilepi", IDM_PASTE MENUITEM SEPARATOR - MENUITEM "Dodaj med Pri&ljubljene...", IDM_ADDFAVORITES + MENUITEM "Dodaj med Pri&ljubljene ...", IDM_ADDFAVORITES MENUITEM SEPARATOR MENUITEM SEPARATOR MENUITEM "Predvajaj", IDM_DYNSRCPLAY @@ -176,11 +176,11 @@ IDR_BROWSE_CONTEXT_MENU MENU { MENUITEM "&Odpri povezavo", IDM_FOLLOWLINKC MENUITEM "Odpri povezavo v &novem oknu", IDM_FOLLOWLINKN - MENUITEM "Shrani cilj &kot...", IDM_SAVETARGET + MENUITEM "Shrani cilj &kot ...", IDM_SAVETARGET MENUITEM "Na&tisni cilj", IDM_PRINTTARGET MENUITEM SEPARATOR MENUITEM "&Pokaži sliko", IDM_SHOWPICTURE - MENUITEM "Shrani &sliko kot...", IDM_SAVEPICTURE + MENUITEM "Shrani &sliko kot ...", IDM_SAVEPICTURE MENUITEM "Nastavi kot oza&dje", IDM_SETWALLPAPER MENUITEM "Nastavi kot p&redmet Namizja", IDM_SETDESKTOPITEM MENUITEM SEPARATOR @@ -189,7 +189,7 @@ IDR_BROWSE_CONTEXT_MENU MENU MENUITEM "Kopiraj &bližnjico", IDM_COPYSHORTCUT MENUITEM "&Prilepi", IDM_PASTE MENUITEM SEPARATOR - MENUITEM "Dodaj med Pri&ljubljene...", IDM_ADDFAVORITES + MENUITEM "Dodaj med Pri&ljubljene ...", IDM_ADDFAVORITES MENUITEM SEPARATOR MENUITEM "Predvajaj", IDM_IMGARTPLAY MENUITEM "Ustavi", IDM_IMGARTSTOP diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index fd1f1dd8162..2057b25d900 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -481,7 +481,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, { ShowWindow(This->hwndListBox, SW_HIDE); } - break; + return CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam); case WM_KEYUP: GetWindowTextW( hwnd, (LPWSTR)hwndText, 255); diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index d71f852fca0..844b8f48311 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -79,7 +79,7 @@ BOOL WINAPI PickIconDlg( * SEE ALSO * RunFileDlgAW */ -void WINAPI RunFileDlgW( +static void RunFileDlgW( HWND hwndOwner, HICON hIcon, LPCWSTR lpstrDirectory, @@ -440,7 +440,7 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault) * SEE ALSO * RunFileDlgAW */ -void WINAPI RunFileDlgA( +static void RunFileDlgA( HWND hwndOwner, HICON hIcon, LPCSTR lpstrDirectory, diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index 6fb209c364a..efd25a1fc07 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -632,7 +632,7 @@ HRESULT WINAPI SHMapIDListToImageListIndexAsync(IUnknown *pts, IShellFolder *psf * Shell_GetCachedImageIndex [SHELL32.72] * */ -INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateDoc) +static INT Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateDoc) { INT ret, len; LPWSTR szTemp; @@ -650,7 +650,7 @@ INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateD return ret; } -INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulateDoc) +static INT Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulateDoc) { WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_w(szPath), nIndex, bSimulateDoc); diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 12e148cfea9..54ecc5a21de 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -1322,7 +1322,14 @@ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCI * ************************************************************************* */ -LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size) + +/* Basic PIDL constructor. Allocates size + 5 bytes, where: + * - two bytes are SHITEMID.cb + * - one byte is PIDLDATA.type + * - two bytes are the NULL PIDL terminator + * Sets type of the returned PIDL to type. + */ +static LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size) { LPITEMIDLIST pidlOut = NULL; diff --git a/dlls/shell32/pidl.h b/dlls/shell32/pidl.h index 18adb7df460..65105efad77 100644 --- a/dlls/shell32/pidl.h +++ b/dlls/shell32/pidl.h @@ -223,14 +223,6 @@ BOOL _ILIsEmpty (LPCITEMIDLIST pidl) { return _ILIsDesktop(pidl) * simple pidls */ -/* Basic PIDL constructor. Allocates size + 5 bytes, where: - * - two bytes are SHITEMID.cb - * - one byte is PIDLDATA.type - * - two bytes are the NULL PIDL terminator - * Sets type of the returned PIDL to type. - */ -LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size); - /* Creates a PIDL with guid format and type type, which must be one of PT_GUID, * PT_SHELLEXT, or PT_YAGUID. */ diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index ec8bfac5926..1ad4d6e75ea 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -156,7 +156,6 @@ void FreeChangeNotifications(void); #define ASK_CANT_TRASH_ITEM 10 #define ASK_OVERWRITE_FOLDER 11 -BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI); BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir); /* 16-bit functions */ @@ -222,9 +221,6 @@ typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc); -UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, - LPWSTR lpResult, int resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args); - extern WCHAR swShell32Name[MAX_PATH]; BOOL UNIXFS_is_rooted_at_desktop(void); diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index eae8bc3d8c0..e67556f57c4 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -47,7 +47,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -extern HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); +extern INT WINAPI SHStringFromGUIDW(REFGUID guid, LPWSTR lpszDest, INT cchMax); /* shlwapi.24 */ /************************************************************************** * Default ClassFactory types @@ -77,23 +77,6 @@ static const struct { }; -/* FIXME: this should be SHLWAPI.24 since we can't yet import by ordinal */ - -DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str) -{ - WCHAR sFormat[52] = {'{','%','0','8','l','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'}; - - return wsprintfW ( str, sFormat, - 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] ); - -} /************************************************************************* * SHCoCreateInstance [SHELL32.102] @@ -153,7 +136,7 @@ HRESULT WINAPI SHCoCreateInstance( } /* we look up the dll path in the registry */ - __SHGUIDToStringW(myclsid, sClassID); + SHStringFromGUIDW(myclsid, sClassID, sizeof(sClassID)/sizeof(WCHAR)); lstrcpyW(sKeyName, sCLSID); lstrcatW(sKeyName, sClassID); lstrcatW(sKeyName, sInProcServer32); diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 09254f83fc6..d9fd6dddaaf 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -483,7 +483,7 @@ BOOL WINAPI IsLFNDriveAW(LPCVOID lpszPath) /************************************************************************* * PathMakeUniqueNameA [internal] */ -BOOL WINAPI PathMakeUniqueNameA( +static BOOL PathMakeUniqueNameA( LPSTR lpszBuffer, DWORD dwBuffSize, LPCSTR lpszShortName, @@ -499,7 +499,7 @@ BOOL WINAPI PathMakeUniqueNameA( /************************************************************************* * PathMakeUniqueNameW [internal] */ -BOOL WINAPI PathMakeUniqueNameW( +static BOOL PathMakeUniqueNameW( LPWSTR lpszBuffer, DWORD dwBuffSize, LPCWSTR lpszShortName, @@ -636,7 +636,7 @@ int WINAPI PathCleanupSpec( LPCWSTR lpszPathW, LPWSTR lpszFileW ) /************************************************************************* * PathQualifyA [SHELL32] */ -BOOL WINAPI PathQualifyA(LPCSTR pszPath) +static BOOL PathQualifyA(LPCSTR pszPath) { FIXME("%s\n",pszPath); return 0; @@ -645,7 +645,7 @@ BOOL WINAPI PathQualifyA(LPCSTR pszPath) /************************************************************************* * PathQualifyW [SHELL32] */ -BOOL WINAPI PathQualifyW(LPCWSTR pszPath) +static BOOL PathQualifyW(LPCWSTR pszPath) { FIXME("%s\n",debugstr_w(pszPath)); return 0; @@ -661,7 +661,7 @@ BOOL WINAPI PathQualifyAW(LPCVOID pszPath) return PathQualifyA(pszPath); } -BOOL WINAPI PathResolveA( +static BOOL PathResolveA( LPSTR lpszPath, LPCSTR *alpszPaths, DWORD dwFlags) @@ -671,7 +671,7 @@ BOOL WINAPI PathResolveA( return 0; } -BOOL WINAPI PathResolveW( +static BOOL PathResolveW( LPWSTR lpszPath, LPCWSTR *alpszPaths, DWORD dwFlags) @@ -695,9 +695,9 @@ BOOL WINAPI PathResolveAW( } /************************************************************************* -* PathProcessCommandA [SHELL32.653] +* PathProcessCommandA */ -LONG WINAPI PathProcessCommandA ( +static LONG PathProcessCommandA ( LPCSTR lpszPath, LPSTR lpszBuff, DWORD dwBuffSize, @@ -713,7 +713,7 @@ LONG WINAPI PathProcessCommandA ( /************************************************************************* * PathProcessCommandW */ -LONG WINAPI PathProcessCommandW ( +static LONG PathProcessCommandW ( LPCWSTR lpszPath, LPWSTR lpszBuff, DWORD dwBuffSize, diff --git a/dlls/shell32/shellreg.c b/dlls/shell32/shellreg.c index 9ed8f9a6c07..fe87e9619ca 100644 --- a/dlls/shell32/shellreg.c +++ b/dlls/shell32/shellreg.c @@ -129,17 +129,6 @@ HRESULT WINAPI SHRegQueryValueExW ( } /************************************************************************* - * SHRegDeleteKeyA [SHELL32.?] - */ -HRESULT WINAPI SHRegDeleteKeyA( - HKEY hkey, - LPCSTR pszSubKey) -{ - FIXME("hkey=%p, %s\n", hkey, debugstr_a(pszSubKey)); - return 0; -} - -/************************************************************************* * SHRegDeleteKeyW [SHELL32.512] */ HRESULT WINAPI SHRegDeleteKeyW( diff --git a/dlls/shell32/shellstring.c b/dlls/shell32/shellstring.c index 435b37bb69a..596192029ea 100644 --- a/dlls/shell32/shellstring.c +++ b/dlls/shell32/shellstring.c @@ -140,7 +140,7 @@ BOOL WINAPI StrRetToStrNAW(LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIS * StrToOleStr [SHELL32.163] * */ -int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString) +static int StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString) { TRACE("(%p, %p %s)\n", lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString)); @@ -148,7 +148,7 @@ int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString) return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH); } -int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString) +static int StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString) { TRACE("(%p, %p %s)\n", lpWideCharStr, lpWString, debugstr_w(lpWString)); @@ -169,12 +169,12 @@ BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString) * lpMulti, nMulti, nWide [IN] * lpWide [OUT] */ -BOOL WINAPI StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr) +static BOOL StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr) { TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr); return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide); } -BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) +static BOOL StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) { TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr); @@ -194,13 +194,13 @@ BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr) /************************************************************************* * OleStrToStrN [SHELL32.78] */ -BOOL WINAPI OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle) +static BOOL OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle) { TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle); return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL); } -BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) +static BOOL OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) { TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle); diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index e95bad10007..e8c6e7be966 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -534,7 +534,7 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW * command (it'll be used afterwards for more information * on the operation) */ -UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, +static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, LPWSTR lpResult, int resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args) { static const WCHAR wWindows[] = {'w','i','n','d','o','w','s',0}; diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index 77402caf478..9176420da55 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -346,7 +346,7 @@ HRESULT WINAPI SHIsFileAvailableOffline(LPCWSTR path, LPDWORD status) * Asks for confirmation when bShowUI is true and deletes the directory and * all its subdirectories and files if necessary. */ -BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI) +static BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI) { BOOL ret = TRUE; HANDLE hFind; diff --git a/dlls/shell32/shlfsbind.c b/dlls/shell32/shlfsbind.c index aa4ce97d82a..8dbfc45ef8a 100644 --- a/dlls/shell32/shlfsbind.c +++ b/dlls/shell32/shlfsbind.c @@ -103,53 +103,6 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC return ret; } -HRESULT WINAPI FileSystemBindData_GetFindData(LPBC pbc, WIN32_FIND_DATAW *pfd) -{ - LPUNKNOWN pUnk; - IFileSystemBindData *pfsbd = NULL; - HRESULT ret; - - TRACE("%p, %p\n", pbc, pfd); - - if (!pfd) - return E_INVALIDARG; - - ret = IBindCtx_GetObjectParam(pbc, (LPOLESTR)wFileSystemBindData, &pUnk); - if (SUCCEEDED(ret)) - { - ret = IUnknown_QueryInterface(pUnk, &IID_IFileSystemBindData, (LPVOID *)&pfsbd); - if (SUCCEEDED(ret)) - { - ret = IFileSystemBindData_GetFindData(pfsbd, pfd); - IFileSystemBindData_Release(pfsbd); - } - IUnknown_Release(pUnk); - } - return ret; -} - -HRESULT WINAPI FileSystemBindData_SetFindData(LPBC pbc, const WIN32_FIND_DATAW *pfd) -{ - LPUNKNOWN pUnk; - IFileSystemBindData *pfsbd = NULL; - HRESULT ret; - - TRACE("%p, %p\n", pbc, pfd); - - ret = IBindCtx_GetObjectParam(pbc, (LPOLESTR)wFileSystemBindData, &pUnk); - if (SUCCEEDED(ret)) - { - ret = IUnknown_QueryInterface(pUnk, &IID_IFileSystemBindData, (LPVOID *)&pfsbd); - if (SUCCEEDED(ret)) - { - ret = IFileSystemBindData_SetFindData(pfsbd, pfd); - IFileSystemBindData_Release(pfsbd); - } - IUnknown_Release(pUnk); - } - return ret; -} - static HRESULT WINAPI IFileSystemBindData_fnQueryInterface( IFileSystemBindData *iface, REFIID riid, LPVOID *ppV) { diff --git a/dlls/shell32/tests/Makefile.in b/dlls/shell32/tests/Makefile.in index 4b1a1403589..dd0587cf103 100644 --- a/dlls/shell32/tests/Makefile.in +++ b/dlls/shell32/tests/Makefile.in @@ -7,6 +7,7 @@ IMPORTS = shell32 ole32 oleaut32 user32 advapi32 kernel32 CTESTS = \ appbar.c \ + autocomplete.c \ generated.c \ shelllink.c \ shellpath.c \ @@ -17,6 +18,8 @@ CTESTS = \ string.c \ systray.c +RC_SRCS = rsrc.rc + @MAKE_TEST_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c new file mode 100644 index 00000000000..782fc3592f6 --- /dev/null +++ b/dlls/shell32/tests/autocomplete.c @@ -0,0 +1,122 @@ +/* + * Tests for autocomplete + * + * Copyright 2008 Jan de Mooij + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include +#include + +#include "windows.h" +#include "shobjidl.h" +#include "shlguid.h" +#include "initguid.h" +#include "shldisp.h" + +static HWND hMainWnd, hEdit; +static HINSTANCE hinst; +static int killfocus_count; + +static void test_init(void) { + HRESULT r; + IAutoComplete* ac; + IUnknown *acSource; + + /* AutoComplete instance */ + r = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, + &IID_IAutoComplete, (LPVOID*)&ac); + ok(SUCCEEDED(r), "no IID_IAutoComplete (0x%08x)\n", r); + + /* AutoComplete source */ + r = CoCreateInstance(&CLSID_ACLMulti, NULL, CLSCTX_INPROC_SERVER, + &IID_IACList, (LPVOID*)&acSource); + ok(SUCCEEDED(r), "no IID_IACList (0x%08x)\n", r); + + /* bind to edit control */ + r = IAutoComplete_Init(ac, hEdit, acSource, NULL, NULL); + ok(SUCCEEDED(r), "Init failed (0x%08x)\n", r); +} +static void test_killfocus(void) { + /* Test if WM_KILLFOCUS messages are handled properly by checking if + * the parent receives an EN_KILLFOCUS message. */ + SetFocus(hEdit); + killfocus_count = 0; + SetFocus(0); + ok(killfocus_count == 1, "Expected one EN_KILLFOCUS message, got: %d\n", killfocus_count); +} +static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { + switch(msg) { + case WM_CREATE: + /* create edit control */ + hEdit = CreateWindowEx(0, "EDIT", "Some text", 0, 10, 10, 300, 300, + hWnd, NULL, hinst, NULL); + ok(hEdit != NULL, "Can't create edit control\n"); + break; + case WM_COMMAND: + if(HIWORD(wParam) == EN_KILLFOCUS) + killfocus_count++; + break; + } + return DefWindowProcA(hWnd, msg, wParam, lParam); +} +static void createMainWnd(void) { + WNDCLASSA wc; + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandleA(NULL); + wc.hIcon = NULL; + wc.hCursor = LoadCursorA(NULL, IDC_IBEAM); + wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); + wc.lpszMenuName = NULL; + wc.lpszClassName = "MyTestWnd"; + wc.lpfnWndProc = MyWndProc; + RegisterClassA(&wc); + + hMainWnd = CreateWindowExA(0, "MyTestWnd", "Blah", WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, 130, 105, NULL, NULL, GetModuleHandleA(NULL), 0); +} +START_TEST(autocomplete) { + HRESULT r; + MSG msg; + + r = CoInitialize(NULL); + ok(SUCCEEDED(r), "CoInitialize failed (0x%08x). Tests aborted.\n", r); + if (FAILED(r)) + return; + + createMainWnd(); + + if(!ok(hMainWnd != NULL, "Failed to create parent window. Tests aborted.\n")) + return; + + test_init(); + test_killfocus(); + + PostQuitMessage(0); + while(GetMessageA(&msg,0,0,0)) { + TranslateMessage(&msg); + DispatchMessageA(&msg); + } + + DestroyWindow(hEdit); + DestroyWindow(hMainWnd); + + CoUninitialize(); +} diff --git a/programs/rpcss/rpcss.h b/dlls/shell32/tests/rsrc.rc similarity index 78% rename from programs/rpcss/rpcss.h rename to dlls/shell32/tests/rsrc.rc index 9c2f04f7b86..00c949bcae7 100644 --- a/programs/rpcss/rpcss.h +++ b/dlls/shell32/tests/rsrc.rc @@ -1,7 +1,6 @@ -/* - * RPCSS definitions +/* String resource for shlfolder test. * - * Copyright (C) 2002 Greg Turner + * Copyright 2008 Vincent Povirk 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,9 +17,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __WINE_RPCSS_H -#define __WINE_RPCSS_H +#include "windef.h" +#include "winuser.h" -#include "windows.h" +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#endif /* __WINE_RPCSS_H */ +STRINGTABLE +{ + 1 "Folder Name Resource" +} diff --git a/dlls/shell32/tests/shfldr_special.c b/dlls/shell32/tests/shfldr_special.c index ef2f0fd7df2..8c14e517d4b 100644 --- a/dlls/shell32/tests/shfldr_special.c +++ b/dlls/shell32/tests/shfldr_special.c @@ -33,7 +33,10 @@ /* Tests for My Network Places */ static void test_parse_for_entire_network(void) { - static const WCHAR entire_network_path[] = { + static WCHAR my_network_places_path[] = { + ':',':','{','2','0','8','D','2','C','6','0','-','3','A','E','A','-', + '1','0','6','9','-','A','2','D','7','-','0','8','0','0','2','B','3','0','3','0','9','D','}', 0 }; + static WCHAR entire_network_path[] = { ':',':','{','2','0','8','D','2','C','6','0','-','3','A','E','A','-', '1','0','6','9','-','A','2','D','7','-','0','8','0','0','2','B','3','0','3','0','9','D', '}','\\','E','n','t','i','r','e','N','e','t','w','o','r','k',0 }; @@ -48,7 +51,30 @@ static void test_parse_for_entire_network(void) hr = SHGetDesktopFolder(&psfDesktop); ok(hr == S_OK, "SHGetDesktopFolder failed with error 0x%x\n", hr); - hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, (LPWSTR)entire_network_path, &eaten, &pidl, &attr); + hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, my_network_places_path, &eaten, &pidl, &attr); + ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%x\n", hr); + todo_wine + ok(eaten == 0xdeadbeef, "eaten should not have been set to %u\n", eaten); + expected_attr = SFGAO_HASSUBFOLDER|SFGAO_FOLDER|SFGAO_FILESYSANCESTOR|SFGAO_DROPTARGET|SFGAO_HASPROPSHEET|SFGAO_CANRENAME|SFGAO_CANLINK; + todo_wine + ok((attr == expected_attr) || /* Win9x, NT4 */ + (attr == (expected_attr | SFGAO_STREAM)) || /* W2K */ + (attr == (expected_attr | SFGAO_CANDELETE)) || /* XP, W2K3 */ + (attr == (expected_attr | SFGAO_CANDELETE | SFGAO_NONENUMERATED)), /* Vista */ + "Unexpected attributes : %08x\n", attr); + + ILFree(pidl); + + /* Start clean again */ + eaten = 0xdeadbeef; + attr = ~0; + + hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, entire_network_path, &eaten, &pidl, &attr); + if (hr == HRESULT_FROM_WIN32(ERROR_BAD_NET_NAME) || hr == HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)) + { + win_skip("'EntireNetwork' is not available on Win9x, NT4 and Vista\n"); + return; + } ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%x\n", hr); todo_wine ok(eaten == 0xdeadbeef, "eaten should not have been set to %u\n", eaten); @@ -66,7 +92,7 @@ static void test_parse_for_entire_network(void) static void test_parse_for_control_panel(void) { /* path of My Computer\Control Panel */ - static const WCHAR control_panel_path[] = { + static WCHAR control_panel_path[] = { ':',':','{','2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','8','-','0','8','0','0','2','B','3','0','3','0','9','D','}','\\', ':',':','{','2','1','E','C','2','0','2','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','D','-','0','8','0','0','2','B','3','0','3','0','9','D','}', 0 }; IShellFolder *psfDesktop; @@ -74,17 +100,20 @@ static void test_parse_for_control_panel(void) DWORD eaten = 0xdeadbeef; LPITEMIDLIST pidl; DWORD attr = ~0; - DWORD expected_attr; hr = SHGetDesktopFolder(&psfDesktop); ok(hr == S_OK, "SHGetDesktopFolder failed with error 0x%x\n", hr); - hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, (LPWSTR)control_panel_path, &eaten, &pidl, &attr); + hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, control_panel_path, &eaten, &pidl, &attr); ok(hr == S_OK, "IShellFolder_ParseDisplayName failed with error 0x%x\n", hr); todo_wine ok(eaten == 0xdeadbeef, "eaten should not have been set to %u\n", eaten); - - expected_attr = SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER; - todo_wine ok(attr == expected_attr, "attr should be 0x%x, not 0x%x\n", expected_attr, attr); + todo_wine + ok((attr == (SFGAO_CANLINK | SFGAO_FOLDER)) || /* Win9x, NT4 */ + (attr == (SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_STREAM)) || /* W2K */ + (attr == (SFGAO_CANLINK | SFGAO_FOLDER | SFGAO_HASSUBFOLDER)) || /* W2K, XP, W2K3 */ + (attr == (SFGAO_CANLINK | SFGAO_NONENUMERATED)) || /* Vista */ + (attr == SFGAO_CANLINK), /* Vista, W2K8 */ + "Unexpected attributes : %08x\n", attr); ILFree(pidl); } diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index ac7915a590c..80ccdf7c3ad 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -32,14 +32,14 @@ * we could check */ -#include -#include - /* Needed to get SEE_MASK_NOZONECHECKS with the PSDK */ #define NTDDI_WINXPSP1 0x05010100 #define NTDDI_VERSION NTDDI_WINXPSP1 #define _WIN32_WINNT 0x0501 +#include +#include + #include "wtypes.h" #include "winbase.h" #include "windef.h" diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index efe6507ec52..df460d78676 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -650,9 +650,12 @@ static void test_rename(void) shfo.pFrom = "test1.txt\0test2.txt\0"; shfo.pTo = "a.txt\0"; retval = SHFileOperationA(&shfo); - ok(retval == ERROR_GEN_FAILURE, "Expected ERROR_GEN_FAILURE, got %d\n", retval); + ok(retval == ERROR_GEN_FAILURE || + broken(!retval), /* Win9x */ + "Expected ERROR_GEN_FAILURE, got %d\n", retval); ok(file_exists("test1.txt"), "Expected test1.txt to exist\n"); ok(file_exists("test2.txt"), "Expected test2.txt to exist\n"); + ok(!file_exists("a.txt"), "Expected a.txt to not exist\n"); /* pFrom doesn't exist */ shfo.pFrom = "idontexist\0"; diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 30768b035df..6a06fb7b078 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -1488,6 +1488,129 @@ static void testSHGetFolderPathAndSubDirA(void) RemoveDirectoryA(testpath); } +static const char *wine_dbgstr_w(LPCWSTR str) +{ + static char buf[512]; + if (!str) + return "(null)"; + WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL); + return buf; +} + +static void test_LocalizedNames(void) +{ + static char cCurrDirA[MAX_PATH]; + WCHAR cCurrDirW[MAX_PATH], tempbufW[25]; + IShellFolder *IDesktopFolder, *testIShellFolder; + ITEMIDLIST *newPIDL; + int len; + HRESULT hr; + static char resourcefile[MAX_PATH]; + DWORD res; + HANDLE file; + STRRET strret; + + static const char desktopini_contents1[] = + "[.ShellClassInfo]\r\n" + "LocalizedResourceName=@"; + static const char desktopini_contents2[] = + ",-1\r\n"; + static WCHAR foldernameW[] = {'t','e','s','t','f','o','l','d','e','r',0}; + static const WCHAR folderdisplayW[] = {'F','o','l','d','e','r',' ','N','a','m','e',' ','R','e','s','o','u','r','c','e',0}; + + /* create folder with desktop.ini and localized name in GetModuleFileNameA(NULL) */ + CreateDirectoryA(".\\testfolder", NULL); + + SetFileAttributesA(".\\testfolder", GetFileAttributesA(".\\testfolder")|FILE_ATTRIBUTE_SYSTEM); + + GetModuleFileNameA(NULL, resourcefile, MAX_PATH); + + file = CreateFileA(".\\testfolder\\desktop.ini", GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %i\n", GetLastError()); + ok(WriteFile(file, desktopini_contents1, strlen(desktopini_contents1), &res, NULL) && + WriteFile(file, resourcefile, strlen(resourcefile), &res, NULL) && + WriteFile(file, desktopini_contents2, strlen(desktopini_contents2), &res, NULL), + "WriteFile failed %i\n", GetLastError()); + CloseHandle(file); + + /* get IShellFolder for parent */ + GetCurrentDirectoryA(MAX_PATH, cCurrDirA); + len = lstrlenA(cCurrDirA); + + if (len == 0) { + trace("GetCurrentDirectoryA returned empty string. Skipping test_LocalizedNames\n"); + goto cleanup; + } + if(cCurrDirA[len-1] == '\\') + cCurrDirA[len-1] = 0; + + MultiByteToWideChar(CP_ACP, 0, cCurrDirA, -1, cCurrDirW, MAX_PATH); + + hr = SHGetDesktopFolder(&IDesktopFolder); + ok(hr == S_OK, "SHGetDesktopfolder failed %08x\n", hr); + + hr = IShellFolder_ParseDisplayName(IDesktopFolder, NULL, NULL, cCurrDirW, NULL, &newPIDL, 0); + ok(hr == S_OK, "ParseDisplayName failed %08x\n", hr); + + hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL, NULL, (REFIID)&IID_IShellFolder, (LPVOID *)&testIShellFolder); + ok(hr == S_OK, "BindToObject failed %08x\n", hr); + + IMalloc_Free(ppM, newPIDL); + + /* windows reads the display name from the resource */ + hr = IShellFolder_ParseDisplayName(testIShellFolder, NULL, NULL, foldernameW, NULL, &newPIDL, 0); + ok(hr == S_OK, "ParseDisplayName failed %08x\n", hr); + + hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER, &strret); + ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr); + + if (SUCCEEDED(hr) && pStrRetToBufW) + { + hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR)); + ok (SUCCEEDED(hr), "StrRetToBufW failed! hr = %08x\n", hr); + todo_wine + ok (!lstrcmpiW(tempbufW, folderdisplayW) || + broken(!lstrcmpiW(tempbufW, foldernameW)), /* W2K */ + "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW)); + } + + /* editing name is also read from the resource */ + hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER|SHGDN_FOREDITING, &strret); + ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr); + + if (SUCCEEDED(hr) && pStrRetToBufW) + { + hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR)); + ok (SUCCEEDED(hr), "StrRetToBufW failed! hr = %08x\n", hr); + todo_wine + ok (!lstrcmpiW(tempbufW, folderdisplayW) || + broken(!lstrcmpiW(tempbufW, foldernameW)), /* W2K */ + "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW)); + } + + /* parsing name is unchanged */ + hr = IShellFolder_GetDisplayNameOf(testIShellFolder, newPIDL, SHGDN_INFOLDER|SHGDN_FORPARSING, &strret); + ok(hr == S_OK, "GetDisplayNameOf failed %08x\n", hr); + + if (SUCCEEDED(hr) && pStrRetToBufW) + { + hr = pStrRetToBufW(&strret, newPIDL, tempbufW, sizeof(tempbufW)/sizeof(WCHAR)); + ok (SUCCEEDED(hr), "StrRetToBufW failed! hr = %08x\n", hr); + ok (!lstrcmpiW(tempbufW, foldernameW), "GetDisplayNameOf returned %s\n", wine_dbgstr_w(tempbufW)); + } + + IShellFolder_Release(IDesktopFolder); + IShellFolder_Release(testIShellFolder); + + IMalloc_Free(ppM, newPIDL); + +cleanup: + DeleteFileA(".\\testfolder\\desktop.ini"); + SetFileAttributesA(".\\testfolder", GetFileAttributesA(".\\testfolder")&~FILE_ATTRIBUTE_SYSTEM); + RemoveDirectoryA(".\\testfolder"); +} + START_TEST(shlfolder) { @@ -1509,6 +1632,7 @@ START_TEST(shlfolder) testSHGetFolderPathAndSubDirA(); else skip("SHGetFolderPathAndSubDirA not present\n"); + test_LocalizedNames(); OleUninitialize(); } diff --git a/dlls/shell32/undocshell.h b/dlls/shell32/undocshell.h index 941e7b37988..de7414ecec0 100644 --- a/dlls/shell32/undocshell.h +++ b/dlls/shell32/undocshell.h @@ -412,12 +412,8 @@ BOOL WINAPI PathMakeUniqueNameAW( LPCVOID lpszPathName); -BOOL WINAPI PathQualifyA(LPCSTR path); -BOOL WINAPI PathQualifyW(LPCWSTR path); -#define PathQualify WINELIB_NAME_AW(PathQualify) BOOL WINAPI PathQualifyAW(LPCVOID path); - BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags); VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath); diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 7ae79bcb4f9..80aee98c55a 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -746,7 +746,7 @@ static void test_UrlCanonicalizeW(void) BOOL choped; int pos; - MultiByteToWideChar(CP_UTF8, 0, "http://www.winehq.org/X", -1, szUrl, 128); + MultiByteToWideChar(CP_ACP, 0, "http://www.winehq.org/X", -1, szUrl, 128); pos = lstrlenW(szUrl) - 1; szUrl[pos] = i; urllen = INTERNET_MAX_URL_LENGTH; diff --git a/dlls/twain_32/twain32_main.c b/dlls/twain_32/twain32_main.c index c04e9cf8456..3239ec57e68 100644 --- a/dlls/twain_32/twain32_main.c +++ b/dlls/twain_32/twain32_main.c @@ -62,7 +62,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } -TW_UINT16 TWAIN_SourceManagerHandler ( +static TW_UINT16 TWAIN_SourceManagerHandler ( pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, diff --git a/dlls/twain_32/twain_i.h b/dlls/twain_32/twain_i.h index 23c355ec2d9..ff777b6d13c 100644 --- a/dlls/twain_32/twain_i.h +++ b/dlls/twain_32/twain_i.h @@ -44,23 +44,9 @@ TW_UINT16 DSM_currentState; /* current state of Source Manager */ TW_UINT16 DSM_twCC; /* current condition code of Source Manager */ TW_UINT32 DSM_sourceId; /* source id generator */ TW_UINT16 DSM_currentDevice; /* keep track of device during enumeration */ -HINSTANCE DSM_instance; activeDS *activeSources; /* list of active data sources */ -/* Device Source Manager Control handlers */ -extern TW_UINT16 TWAIN_ControlGroupHandler ( - pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, - TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); -extern TW_UINT16 TWAIN_ImageGroupHandler ( - pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, - TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); -extern TW_UINT16 TWAIN_AudioGroupHandler ( - pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, - TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); -extern TW_UINT16 TWAIN_SourceManagerHandler ( - pTW_IDENTITY pOrigin, TW_UINT16 DAT, TW_UINT16 MSG, TW_MEMREF pData); - /* Implementation of operation triplets (From Application to Source Manager) */ extern TW_UINT16 TWAIN_CloseDS (pTW_IDENTITY pOrigin, TW_MEMREF pData); diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index a16d166bf38..974cf5b890a 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -150,7 +150,7 @@ typedef struct extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL ) DECLSPEC_HIDDEN; /* Dialog info structure */ -typedef struct +typedef struct tagDIALOGINFO { HWND hwndFocus; /* Current control with focus */ HFONT hUserFont; /* Dialog font */ @@ -165,9 +165,6 @@ typedef struct #define DF_END 0x0001 #define DF_OWNERENABLED 0x0002 -/* offset of DIALOGINFO ptr in dialog extra bytes */ -#define DWLP_WINE_DIALOGINFO (DWLP_USER+sizeof(ULONG_PTR)) - extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN; extern void DIALOG_EnableOwner( HWND hOwner ) DECLSPEC_HIDDEN; extern BOOL DIALOG_DisableOwner( HWND hOwner ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 655a74ab119..8049a67242c 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -544,8 +544,8 @@ static BOOL CURSORICON_GetResIconEntry( LPVOID dir, int n, * CURSORICON_FindBestCursor * * Find the cursor closest to the requested size. - * FIXME: parameter 'color' ignored and entries with more than 1 bpp - * ignored too + * + * FIXME: parameter 'color' ignored. */ static int CURSORICON_FindBestCursor( LPVOID dir, fnGetCIEntry get_entry, int width, int height, int color ) @@ -562,8 +562,7 @@ static int CURSORICON_FindBestCursor( LPVOID dir, fnGetCIEntry get_entry, for ( i = 0; get_entry( dir, i, &cx, &cy, &bits ); i++ ) { if ((cx <= width) && (cy <= height) && - (cx > maxwidth) && (cy > maxheight) && - (bits == 1)) + (cx > maxwidth) && (cy > maxheight)) { bestEntry = i; maxwidth = cx; @@ -577,8 +576,7 @@ static int CURSORICON_FindBestCursor( LPVOID dir, fnGetCIEntry get_entry, maxwidth = maxheight = 255; for ( i = 0; get_entry( dir, i, &cx, &cy, &bits ); i++ ) { - if (((cx < maxwidth) && (cy < maxheight) && (bits == 1)) || - (bestEntry==-1)) + if (((cx < maxwidth) && (cy < maxheight)) || (bestEntry == -1)) { bestEntry = i; maxwidth = cx; @@ -958,7 +956,7 @@ static void riff_find_chunk( DWORD chunk_id, DWORD chunk_type, const riff_chunk_ * \- CHUNK:icon */ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size, - INT width, INT height ) + INT width, INT height, INT colors ) { HCURSOR cursor; ani_header header = {0}; @@ -1010,8 +1008,8 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size, FIXME("Loading all frames for .ani cursors not implemented.\n"); icon_data = fram_chunk.data + (2 * sizeof(DWORD)); - entry = CURSORICON_FindBestCursorFile( (CURSORICONFILEDIR *) icon_data, - width, height, 1 ); + entry = CURSORICON_FindBestIconFile( (CURSORICONFILEDIR *) icon_data, + width, height, colors ); frame_bits = HeapAlloc( GetProcessHeap(), 0, entry->dwDIBSize ); memcpy( frame_bits, icon_data + entry->dwDIBOffset, entry->dwDIBSize ); @@ -1099,7 +1097,8 @@ static HICON CURSORICON_LoadFromFile( LPCWSTR filename, /* Check for .ani. */ if (memcmp( bits, "RIFF", 4 ) == 0) { - hIcon = CURSORICON_CreateIconFromANI( bits, filesize, width, height ); + hIcon = CURSORICON_CreateIconFromANI( bits, filesize, width, height, + colors ); goto end; } @@ -1187,7 +1186,7 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name, if (!(handle = LoadResource( hInstance, hRsrc ))) return 0; if (!(dir = LockResource( handle ))) return 0; if (fCursor) - dirEntry = CURSORICON_FindBestCursorRes( dir, width, height, 1); + dirEntry = CURSORICON_FindBestCursorRes( dir, width, height, colors ); else dirEntry = CURSORICON_FindBestIconRes( dir, width, height, colors ); if (!dirEntry) return 0; @@ -1799,7 +1798,7 @@ INT WINAPI LookupIconIdFromDirectoryEx( LPBYTE xdir, BOOL bIcon, if( bIcon ) entry = CURSORICON_FindBestIconRes( dir, width, height, colors ); else - entry = CURSORICON_FindBestCursorRes( dir, width, height, 1); + entry = CURSORICON_FindBestCursorRes( dir, width, height, colors ); if( entry ) retVal = entry->wResId; } diff --git a/dlls/user32/defdlg.c b/dlls/user32/defdlg.c index d2305e02498..ee1b58ec461 100644 --- a/dlls/user32/defdlg.c +++ b/dlls/user32/defdlg.c @@ -230,8 +230,10 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam, return 1; } case WM_NCDESTROY: - if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO, 0 ))) + if (dlgInfo) { + WND *wndPtr; + /* Free dialog heap (if created) */ if (dlgInfo->hDialogHeap) { @@ -241,6 +243,10 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam, if (dlgInfo->hUserFont) DeleteObject( dlgInfo->hUserFont ); if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu ); HeapFree( GetProcessHeap(), 0, dlgInfo ); + + wndPtr = WIN_GetPtr( hwnd ); + wndPtr->dlgInfo = NULL; + WIN_ReleasePtr( wndPtr ); } /* Window clean-up */ return DefWindowProcA( hwnd, msg, wParam, lParam ); @@ -335,11 +341,18 @@ static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, BOOL fResult) DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) { WND* wndPtr; - DIALOGINFO* dlgInfo = (DIALOGINFO *)GetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO ); + DIALOGINFO* dlgInfo; - if(!dlgInfo && create) + wndPtr = WIN_GetPtr( hwnd ); + if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) + return NULL; + + dlgInfo = wndPtr->dlgInfo; + + if (!dlgInfo && create) { - if (!(dlgInfo = HeapAlloc( GetProcessHeap(), 0, sizeof(*dlgInfo) ))) return NULL; + if (!(dlgInfo = HeapAlloc( GetProcessHeap(), 0, sizeof(*dlgInfo) ))) + goto out; dlgInfo->hwndFocus = 0; dlgInfo->hUserFont = 0; dlgInfo->hMenu = 0; @@ -348,19 +361,12 @@ DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) dlgInfo->idResult = 0; dlgInfo->flags = 0; dlgInfo->hDialogHeap = 0; - wndPtr = WIN_GetPtr( hwnd ); - if (wndPtr && wndPtr != WND_OTHER_PROCESS && wndPtr != WND_DESKTOP) - { - wndPtr->flags |= WIN_ISDIALOG; - WIN_ReleasePtr( wndPtr ); - SetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO, (ULONG_PTR)dlgInfo ); - } - else - { - HeapFree( GetProcessHeap(), 0, dlgInfo ); - return NULL; - } + wndPtr->dlgInfo = dlgInfo; + wndPtr->flags |= WIN_ISDIALOG; } + +out: + WIN_ReleasePtr( wndPtr ); return dlgInfo; } diff --git a/dlls/user32/dialog16.c b/dlls/user32/dialog16.c index 6850d35b0d0..4fcbef41a30 100644 --- a/dlls/user32/dialog16.c +++ b/dlls/user32/dialog16.c @@ -434,9 +434,9 @@ static HWND DIALOG_CreateIndirect16( HINSTANCE16 hInst, LPCVOID dlgTemplate, } wndPtr = WIN_GetPtr( hwnd ); wndPtr->flags |= WIN_ISDIALOG; + wndPtr->dlgInfo = dlgInfo; WIN_ReleasePtr( wndPtr ); - SetWindowLongPtrW( hwnd, DWLP_WINE_DIALOGINFO, (LONG_PTR)dlgInfo ); SetWindowLong16( HWND_16(hwnd), DWLP_DLGPROC, (LONG)dlgProc ); if (dlgInfo->hUserFont) diff --git a/dlls/user32/resources/user32_Si.rc b/dlls/user32/resources/user32_Si.rc index 74c3ef0c4bf..1410cb206f9 100644 --- a/dlls/user32/resources/user32_Si.rc +++ b/dlls/user32/resources/user32_Si.rc @@ -30,9 +30,9 @@ SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE MENUITEM SEPARATOR MENUITEM "&Zapri\tAlt-F4", 61536 MENUITEM SEPARATOR - MENUITEM "&Preklopi na...\tCtrl-Esc", 61744 + MENUITEM "&Preklopi na ...\tCtrl-Esc", 61744 MENUITEM SEPARATOR - MENUITEM "&O Wine...", 61761 + MENUITEM "&O Wine ...", 61761 } EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE @@ -81,7 +81,7 @@ END STRINGTABLE DISCARDABLE { IDS_ERROR "Napaka" - IDS_MDI_MOREWINDOWS "&Več oken..." + IDS_MDI_MOREWINDOWS "&Več oken ..." } #pragma code_page(default) diff --git a/dlls/user32/tests/broadcast.c b/dlls/user32/tests/broadcast.c index ae9cd29ee65..b0990e37fa9 100644 --- a/dlls/user32/tests/broadcast.c +++ b/dlls/user32/tests/broadcast.c @@ -18,12 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define _WIN32_WINNT 0x0501 + #include #include #include -#define _WIN32_WINNT 0x0501 - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff --git a/dlls/user32/tests/dde.c b/dlls/user32/tests/dde.c index a3b73a53e55..dafb68c00ff 100644 --- a/dlls/user32/tests/dde.c +++ b/dlls/user32/tests/dde.c @@ -1313,7 +1313,7 @@ static void test_dde_aw_transaction(void) dde_inst = 0; ret = DdeInitializeA(&dde_inst, client_dde_callback, APPCMD_CLIENTONLY, 0); - ok(ret == DMLERR_NO_ERROR, "DdeInitializeW failed with error %04x (%x)\n", + ok(ret == DMLERR_NO_ERROR, "DdeInitializeA failed with error %04x (%x)\n", ret, DdeGetLastError(dde_inst)); hsz_server = DdeCreateStringHandleW(dde_inst, TEST_DDE_SERVICE, CP_WINUNICODE); @@ -1701,7 +1701,7 @@ static void test_DdeCreateStringHandle(void) ret = DdeInitializeW(&dde_inst, client_ddeml_callback, APPCMD_CLIENTONLY, 0); if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { - skip("DdeInitialize is unimplemented\n"); + win_skip("DdeInitializeW is unimplemented\n"); return; } diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 2c3dea5e7ba..f4496a7dc4e 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -20,12 +20,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define _WIN32_WINNT 0x0501 /* For WM_CHANGEUISTATE,QS_RAWINPUT */ + #include #include #include -#define _WIN32_WINNT 0x0501 /* For WM_CHANGEUISTATE,QS_RAWINPUT */ - #include "windef.h" #include "winbase.h" #include "wingdi.h" diff --git a/dlls/user32/win.h b/dlls/user32/win.h index bc024f4547f..447f4fd24d2 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -31,6 +31,7 @@ #define WND_MAGIC 0x444e4957 /* 'WIND' */ struct tagCLASS; +struct tagDIALOGINFO; typedef struct tagWND { @@ -60,6 +61,7 @@ typedef struct tagWND HMENU hSysMenu; /* window's copy of System Menu */ HICON hIcon; /* window's icon */ HICON hIconSmall; /* window's small icon */ + struct tagDIALOGINFO *dlgInfo;/* Dialog additional info (dialogs only) */ int cbWndExtra; /* class cbWndExtra at window creation */ DWORD_PTR userdata; /* User private data */ DWORD wExtra[1]; /* Window extra bytes */ diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index 8aa67fd86a1..1ca4d26b6f2 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -43,9 +43,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(uxtheme); * Defines and global variables */ -BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value); -BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize); -void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics); +static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value); +static BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize); +static void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics); static HRESULT MSSTYLES_GetFont (LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LOGFONTW* logfont); extern HINSTANCE hDllInst; @@ -852,7 +852,7 @@ static void parse_apply_nonclient (struct PARSENONCLIENTSTATE* state) * PARAMS * tf Theme to parse */ -void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics) +static void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics) { static const WCHAR szSysMetrics[] = {'S','y','s','M','e','t','r','i','c','s','\0'}; static const WCHAR szGlobals[] = {'g','l','o','b','a','l','s','\0'}; @@ -1139,7 +1139,7 @@ HBITMAP MSSTYLES_LoadBitmap (PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha return img->image; } -BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value) +static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, int *value) { LPCWSTR cur = lpStringStart; int total = 0; @@ -1163,7 +1163,7 @@ BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR return TRUE; } -BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize) { +static BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize) { LPCWSTR cur = lpStringStart; LPCWSTR start; LPCWSTR end; diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c index 0623244fdfd..dea77220a50 100644 --- a/dlls/winealsa.drv/alsa.c +++ b/dlls/winealsa.drv/alsa.c @@ -124,7 +124,7 @@ void ALSA_WaitRingMessage(ALSA_MSG_RING* omr, DWORD sleep) * * Inserts a new message into the ring (should be called from DriverProc derived routines) */ -int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD param, BOOL wait) +int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR param, BOOL wait) { HANDLE hEvent = INVALID_HANDLE_VALUE; @@ -192,8 +192,8 @@ int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD param * * Get a message from the ring. Should be called by the playback/record thread. */ -int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr, - enum win_wm_message *msg, DWORD *param, HANDLE *hEvent) +int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, + DWORD_PTR *param, HANDLE *hEvent) { EnterCriticalSection(&omr->msg_crst); @@ -220,15 +220,15 @@ int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr, * Should be called by the playback/record thread. */ int ALSA_PeekRingMessage(ALSA_MSG_RING* omr, - enum win_wm_message *msg, - DWORD *param, HANDLE *hEvent) + enum win_wm_message *msg, + DWORD_PTR *param, HANDLE *hEvent) { EnterCriticalSection(&omr->msg_crst); if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */ { - LeaveCriticalSection(&omr->msg_crst); - return 0; + LeaveCriticalSection(&omr->msg_crst); + return 0; } *msg = omr->messages[omr->msg_toget].msg; @@ -389,7 +389,7 @@ void ALSA_copyFormat(LPWAVEFORMATEX wf1, LPWAVEFORMATPCMEX wf2) else iLength = sizeof(WAVEFORMATEX) + wf1->cbSize; if (iLength > sizeof(WAVEFORMATPCMEX)) { - ERR("calculated %u bytes, capping to %u bytes\n", iLength, sizeof(WAVEFORMATPCMEX)); + ERR("calculated %u bytes, capping\n", iLength); iLength = sizeof(WAVEFORMATPCMEX); } memcpy(wf2, wf1, iLength); diff --git a/dlls/winealsa.drv/alsa.h b/dlls/winealsa.drv/alsa.h index 4cd2cf5480b..b6c1e0e0fe7 100644 --- a/dlls/winealsa.drv/alsa.h +++ b/dlls/winealsa.drv/alsa.h @@ -81,9 +81,9 @@ enum win_wm_message { }; typedef struct { - enum win_wm_message msg; /* message identifier */ - DWORD param; /* parameter for this message */ - HANDLE hEvent; /* if message is synchronous, handle of event for synchro */ + enum win_wm_message msg; /* message identifier */ + DWORD_PTR param; /* parameter for this message */ + HANDLE hEvent; /* if message is synchronous, handle of event for synchro */ } ALSA_MSG; /* implement an in-process message ring for better performance @@ -178,9 +178,9 @@ int ALSA_InitRingMessage(ALSA_MSG_RING* omr); int ALSA_DestroyRingMessage(ALSA_MSG_RING* omr); void ALSA_ResetRingMessage(ALSA_MSG_RING* omr); void ALSA_WaitRingMessage(ALSA_MSG_RING* omr, DWORD sleep); -int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD param, BOOL wait); -int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, DWORD *param, HANDLE *hEvent); -int ALSA_PeekRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, DWORD *param, HANDLE *hEvent); +int ALSA_AddRingMessage(ALSA_MSG_RING* omr, enum win_wm_message msg, DWORD_PTR param, BOOL wait); +int ALSA_RetrieveRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, DWORD_PTR *param, HANDLE *hEvent); +int ALSA_PeekRingMessage(ALSA_MSG_RING* omr, enum win_wm_message *msg, DWORD_PTR *param, HANDLE *hEvent); int ALSA_CheckSetVolume(snd_hctl_t *hctl, int *out_left, int *out_right, int *out_min, int *out_max, int *out_step, int *new_left, int *new_right); const char * ALSA_getCmdString(enum win_wm_message msg); diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index c9710a2dfc4..9c004ae8dc2 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -173,14 +173,14 @@ static int MIDI_AlsaToWindowsDeviceType(int type) * MIDI_NotifyClient [internal] */ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, - DWORD dwParam1, DWORD dwParam2) + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { DWORD dwCallBack; UINT uFlags; HANDLE hDev; DWORD dwInstance; - TRACE("wDevID = %04X wMsg = %d dwParm1 = %04X dwParam2 = %04X\n", + TRACE("wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n", wDevID, wMsg, dwParam1, dwParam2); switch (wMsg) { @@ -388,7 +388,7 @@ static DWORD WINAPI midRecThread(LPVOID arg) lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags |= MHDR_DONE; MidiInDev[wDevID].lpQueueHdr = (LPMIDIHDR)lpMidiHdr->lpNext; - if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD)lpMidiHdr, dwTime) != MMSYSERR_NOERROR) + if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD_PTR)lpMidiHdr, dwTime) != MMSYSERR_NOERROR) WARN("Couldn't notify client\n"); } } else @@ -653,7 +653,7 @@ static DWORD midReset(WORD wDevID) MidiInDev[wDevID].lpQueueHdr->dwFlags |= MHDR_DONE; /* FIXME: when called from 16 bit, lpQueueHdr needs to be a segmented ptr */ if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, - (DWORD)MidiInDev[wDevID].lpQueueHdr, dwTime) != MMSYSERR_NOERROR) { + (DWORD_PTR)MidiInDev[wDevID].lpQueueHdr, dwTime) != MMSYSERR_NOERROR) { WARN("Couldn't notify client\n"); } MidiInDev[wDevID].lpQueueHdr = (LPMIDIHDR)MidiInDev[wDevID].lpQueueHdr->lpNext; @@ -1024,7 +1024,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags |= MHDR_DONE; - if (MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD)lpMidiHdr, 0L) != MMSYSERR_NOERROR) { + if (MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD_PTR)lpMidiHdr, 0L) != MMSYSERR_NOERROR) { WARN("can't notify client !\n"); return MMSYSERR_INVALPARAM; } @@ -1050,8 +1050,8 @@ static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || lpMidiHdr->lpData == 0 || (lpMidiHdr->dwFlags & MHDR_INQUEUE) != 0 || lpMidiHdr->dwBufferLength >= 0x10000ul) { - WARN("%p %p %08x %d/%d\n", lpMidiHdr, lpMidiHdr ? lpMidiHdr->lpData : NULL, - lpMidiHdr ? lpMidiHdr->dwFlags : 0, sizeof(MIDIHDR), dwSize); + WARN("%p %p %08x %d\n", lpMidiHdr, lpMidiHdr ? lpMidiHdr->lpData : NULL, + lpMidiHdr ? lpMidiHdr->dwFlags : 0, dwSize); return MMSYSERR_INVALPARAM; } @@ -1313,10 +1313,10 @@ LONG ALSA_MidiInit(void) /************************************************************************** * midMessage (WINEOSS.4) */ -DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%04X, %04X, %08X, %08X, %08X);\n", + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch (wMsg) { #ifdef HAVE_ALSA @@ -1356,10 +1356,10 @@ DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, /************************************************************************** * modMessage (WINEOSS.5) */ -DWORD WINAPI ALSA_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI ALSA_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%04X, %04X, %08X, %08X, %08X);\n", + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch (wMsg) { diff --git a/dlls/winealsa.drv/wavein.c b/dlls/winealsa.drv/wavein.c index 603d62ce4ad..89ad9df60c2 100644 --- a/dlls/winealsa.drv/wavein.c +++ b/dlls/winealsa.drv/wavein.c @@ -68,9 +68,9 @@ DWORD ALSA_WidNumDevs; /************************************************************************** * widNotifyClient [internal] */ -static DWORD widNotifyClient(WINE_WAVEDEV* wwi, WORD wMsg, DWORD dwParam1, DWORD dwParam2) +static DWORD widNotifyClient(WINE_WAVEDEV* wwi, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("wMsg = 0x%04x dwParm1 = %04X dwParam2 = %04X\n", wMsg, dwParam1, dwParam2); + TRACE("wMsg = 0x%04x dwParm1 = %04lX dwParam2 = %04lX\n", wMsg, dwParam1, dwParam2); switch (wMsg) { case WIM_OPEN: @@ -114,7 +114,7 @@ static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPSW lpCaps, DWORD dwSize) static void widRecorder_ReadHeaders(WINE_WAVEDEV * wwi) { enum win_wm_message tmp_msg; - DWORD tmp_param; + DWORD_PTR tmp_param; HANDLE tmp_ev; WAVEHDR* lpWaveHdr; @@ -141,13 +141,13 @@ static void widRecorder_ReadHeaders(WINE_WAVEDEV * wwi) */ static DWORD CALLBACK widRecorder(LPVOID pmt) { - WORD uDevID = (DWORD)pmt; + WORD uDevID = (DWORD_PTR)pmt; WINE_WAVEDEV* wwi = (WINE_WAVEDEV*)&WInDev[uDevID]; WAVEHDR* lpWaveHdr; DWORD dwSleepTime; DWORD bytesRead; enum win_wm_message msg; - DWORD param; + DWORD_PTR param; HANDLE ev; DWORD frames_per_period; @@ -219,7 +219,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) lpWaveHdr->dwFlags |= WHDR_DONE; wwi->lpQueuePtr = lpNext; - widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); + widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0); lpWaveHdr = lpNext; } } else { @@ -234,7 +234,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) while (ALSA_RetrieveRingMessage(&wwi->msgRing, &msg, ¶m, &ev)) { - TRACE("msg=%s param=0x%x\n", ALSA_getCmdString(msg), param); + TRACE("msg=%s param=0x%lx\n", ALSA_getCmdString(msg), param); switch (msg) { case WINE_WM_PAUSING: wwi->state = WINE_WS_PAUSED; @@ -274,7 +274,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags |= WHDR_DONE; wwi->lpQueuePtr = lpNext; - widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); + widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0); } } wwi->state = WINE_WS_STOPPED; @@ -297,7 +297,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags |= WHDR_DONE; wwi->lpQueuePtr = lpWaveHdr->lpNext; - widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); + widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0); } wwi->lpQueuePtr = NULL; @@ -512,7 +512,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) wwi->format.Format.nBlockAlign); wwi->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)(DWORD)wDevID, 0, &(wwi->dwThreadID)); + wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwi->dwThreadID)); if (wwi->hThread) SetThreadPriority(wwi->hThread, THREAD_PRIORITY_TIME_CRITICAL); WaitForSingleObject(wwi->hStartUpEvent, INFINITE); @@ -603,7 +603,7 @@ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->dwBytesRecorded = 0; lpWaveHdr->lpNext = 0; - ALSA_AddRingMessage(&WInDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE); + ALSA_AddRingMessage(&WInDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD_PTR)lpWaveHdr, FALSE); return MMSYSERR_NOERROR; } @@ -742,10 +742,10 @@ static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2) /************************************************************************** * widMessage (WINEALSA.@) */ -DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%u, %s, %08X, %08X, %08X);\n", + TRACE("(%u, %s, %08lX, %08lX, %08lX);\n", wDevID, ALSA_getMessage(wMsg), dwUser, dwParam1, dwParam2); switch (wMsg) { @@ -781,10 +781,10 @@ DWORD WINAPI ALSA_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser, /************************************************************************** * widMessage (WINEALSA.@) */ -DWORD WINAPI ALSA_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI ALSA_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - FIXME("(%u, %04X, %08X, %08X, %08X):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); + FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); return MMSYSERR_NOTENABLED; } diff --git a/dlls/winealsa.drv/waveout.c b/dlls/winealsa.drv/waveout.c index 90c23b33db7..c0119d8f3e2 100644 --- a/dlls/winealsa.drv/waveout.c +++ b/dlls/winealsa.drv/waveout.c @@ -69,9 +69,9 @@ DWORD ALSA_WodNumDevs; /************************************************************************** * wodNotifyClient [internal] */ -static DWORD wodNotifyClient(WINE_WAVEDEV* wwo, WORD wMsg, DWORD dwParam1, DWORD dwParam2) +static DWORD wodNotifyClient(WINE_WAVEDEV* wwo, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("wMsg = 0x%04x dwParm1 = %04X dwParam2 = %04X\n", wMsg, dwParam1, dwParam2); + TRACE("wMsg = 0x%04x dwParm1 = %lx dwParam2 = %lx\n", wMsg, dwParam1, dwParam2); switch (wMsg) { case WOM_OPEN: @@ -306,7 +306,7 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEDEV* wwo, BOOL force) lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags |= WHDR_DONE; - wodNotifyClient(wwo, WOM_DONE, (DWORD)lpWaveHdr, 0); + wodNotifyClient(wwo, WOM_DONE, (DWORD_PTR)lpWaveHdr, 0); } return (lpWaveHdr && lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr) ? wodPlayer_NotifyWait(wwo, lpWaveHdr) : INFINITE; @@ -341,7 +341,7 @@ static void wodPlayer_Reset(WINE_WAVEDEV* wwo, BOOL reset) if (reset) { enum win_wm_message msg; - DWORD param; + DWORD_PTR param; HANDLE ev; /* remove any buffer */ @@ -404,12 +404,12 @@ static void wodPlayer_ProcessMessages(WINE_WAVEDEV* wwo) { LPWAVEHDR lpWaveHdr; enum win_wm_message msg; - DWORD param; + DWORD_PTR param; HANDLE ev; int err; while (ALSA_RetrieveRingMessage(&wwo->msgRing, &msg, ¶m, &ev)) { - TRACE("Received %s %x\n", ALSA_getCmdString(msg), param); + TRACE("Received %s %lx\n", ALSA_getCmdString(msg), param); switch (msg) { case WINE_WM_PAUSING: @@ -520,7 +520,7 @@ static DWORD wodPlayer_FeedDSP(WINE_WAVEDEV* wwo) */ static DWORD CALLBACK wodPlayer(LPVOID pmt) { - WORD uDevID = (DWORD)pmt; + WORD uDevID = (DWORD_PTR)pmt; WINE_WAVEDEV* wwo = (WINE_WAVEDEV*)&WOutDev[uDevID]; DWORD dwNextFeedTime = INFINITE; /* Time before DSP needs feeding */ DWORD dwNextNotifyTime = INFINITE; /* Time before next wave completion */ @@ -588,7 +588,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) snd_pcm_format_t format = -1; unsigned int rate; unsigned int buffer_time = 120000; - unsigned int period_time = 20000; + unsigned int period_time = 22000; snd_pcm_uframes_t buffer_size; snd_pcm_uframes_t period_size; int flags; @@ -796,7 +796,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) ALSA_InitRingMessage(&wwo->msgRing); wwo->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - wwo->hThread = CreateThread(NULL, 0, wodPlayer, (LPVOID)(DWORD)wDevID, 0, &(wwo->dwThreadID)); + wwo->hThread = CreateThread(NULL, 0, wodPlayer, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwo->dwThreadID)); if (wwo->hThread) SetThreadPriority(wwo->hThread, THREAD_PRIORITY_TIME_CRITICAL); else @@ -926,7 +926,7 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->dwFlags |= WHDR_INQUEUE; lpWaveHdr->lpNext = 0; - ALSA_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE); + ALSA_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD_PTR)lpWaveHdr, FALSE); return MMSYSERR_NOERROR; } @@ -1167,10 +1167,10 @@ static DWORD wodDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2) /************************************************************************** * wodMessage (WINEALSA.@) */ -DWORD WINAPI ALSA_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI ALSA_wodMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%u, %s, %08X, %08X, %08X);\n", + TRACE("(%u, %s, %08lX, %08lX, %08lX);\n", wDevID, ALSA_getMessage(wMsg), dwUser, dwParam1, dwParam2); switch (wMsg) { diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 9194673ed14..9d5125042f3 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -36,6 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); WINE_DECLARE_DEBUG_CHANNEL(d3d_constants); WINE_DECLARE_DEBUG_CHANNEL(d3d_caps); +WINE_DECLARE_DEBUG_CHANNEL(d3d); #define GLINFO_LOCATION (*gl_info) @@ -595,230 +596,81 @@ static void shader_hw_sample(const SHADER_OPCODE_ARG *arg, DWORD sampler_idx, co } } -static void gen_color_correction(SHADER_BUFFER *buffer, const char *reg, const char *writemask, - const char *one, const char *two, WINED3DFORMAT fmt, - const WineD3D_GL_Info *gl_info) +static const char *shader_arb_get_fixup_swizzle(enum fixup_channel_source channel_source) { - switch(fmt) { - case WINED3DFMT_V8U8: - case WINED3DFMT_V16U16: - if(GL_SUPPORT(NV_TEXTURE_SHADER) && fmt == WINED3DFMT_V8U8) { - /* The 3rd channel returns 1.0 in d3d, but 0.0 in gl. Fix this while we're at it :-) - * The dx7 sdk BumpEarth demo needs it because it uses BUMPENVMAPLUMINANCE with V8U8. - * With the luminance(b) value = 1.0, BUMPENVMAPLUMINANCE == BUMPENVMAP, but if b is - * 0.0(without this fixup), the rendering breaks. - */ - if(strlen(writemask) >= 4) { - shader_addline(buffer, "MOV %s.%c, %s;\n", reg, writemask[3], one); - } - } else { - /* Correct the sign, but leave the blue as it is - it was loaded correctly already - * ARB shaders are a bit picky wrt writemasks and swizzles. If we're free to scale - * all registers, do so, this saves an instruction. - */ - if(strlen(writemask) >= 5) { - shader_addline(buffer, "MAD %s, %s, %s, -%s;\n", reg, reg, two, one); - } else if(strlen(writemask) >= 3) { - shader_addline(buffer, "MAD %s.%c, %s.%c, %s, -%s;\n", - reg, writemask[1], - reg, writemask[1], - two, one); - shader_addline(buffer, "MAD %s.%c, %s.%c, %s, -%s;\n", - reg, writemask[2], - reg, writemask[2], - two, one); - } else if(strlen(writemask) == 2) { - shader_addline(buffer, "MAD %s.%c, %s.%c, %s, -%s;\n", reg, writemask[1], - reg, writemask[1], two, one); - } - } - break; - - case WINED3DFMT_X8L8V8U8: - if(!GL_SUPPORT(NV_TEXTURE_SHADER)) { - /* Red and blue are the signed channels, fix them up; Blue(=L) is correct already, - * and a(X) is always 1.0. Cannot do a full conversion due to L(blue) - */ - if(strlen(writemask) >= 3) { - shader_addline(buffer, "MAD %s.%c, %s.%c, %s, -%s;\n", - reg, writemask[1], - reg, writemask[1], - two, one); - shader_addline(buffer, "MAD %s.%c, %s.%c, %s, -%s;\n", - reg, writemask[2], - reg, writemask[2], - two, one); - } else if(strlen(writemask) == 2) { - shader_addline(buffer, "MAD %s.%c, %s.%c, %s, -%s;\n", - reg, writemask[1], - reg, writemask[1], - two, one); - } - } - break; - - case WINED3DFMT_L6V5U5: - if(!GL_SUPPORT(NV_TEXTURE_SHADER)) { - if(strlen(writemask) >= 4) { - /* Swap y and z (U and L), and do a sign conversion on x and the new y(V and U) */ - shader_addline(buffer, "MOV TMP.g, %s.%c;\n", - reg, writemask[2]); - shader_addline(buffer, "MAD %s.%c%c, %s.%c%c%c%c, %s, -%s;\n", - reg, writemask[1], writemask[2], - reg, writemask[3], writemask[1], writemask[3], writemask[1], - two, one); - shader_addline(buffer, "MOV %s.%c, TMP.g;\n", reg, - writemask[3]); - } else if(strlen(writemask) == 3) { - /* This is bad: We have VL, but we need VU */ - FIXME("2 components sampled from a converted L6V5U5 texture\n"); - } else { - shader_addline(buffer, "MAD %s.%c, %s.%c, %s, -%s;\n", - reg, writemask[1], - reg, writemask[1], - two, one); - } - } - break; - - case WINED3DFMT_Q8W8V8U8: - if(!GL_SUPPORT(NV_TEXTURE_SHADER)) { - /* Correct the sign in all channels */ - switch(strlen(writemask)) { - case 4: - shader_addline(buffer, "MAD %s.%c, %s.%c, coefmul.x, -one;\n", - reg, writemask[3], - reg, writemask[3]); - /* drop through */ - case 3: - shader_addline(buffer, "MAD %s.%c, %s.%c, coefmul.x, -one;\n", - reg, writemask[2], - reg, writemask[2]); - /* drop through */ - case 2: - shader_addline(buffer, "MAD %s.%c, %s.%c, coefmul.x, -one;\n", - reg, writemask[1], - reg, writemask[1]); - break; - - /* Should not occur, since it's at minimum '.' and a letter */ - case 1: - ERR("Unexpected writemask: \"%s\"\n", writemask); - break; - - case 5: - default: - shader_addline(buffer, "MAD %s, %s, coefmul.x, -one;\n", reg, reg); - } - } - break; - - case WINED3DFMT_ATI2N: - /* GL_ATI_texture_compression_3dc returns the two channels as luminance-alpha, - * which means the first one is replicated across .rgb, and the 2nd one is in - * .a. We need the 2nd in .g - * - * GL_EXT_texture_compression_rgtc returns the values in .rg, however, they - * are swapped compared to d3d. So swap red and green. - */ - if(GL_SUPPORT(EXT_TEXTURE_COMPRESSION_RGTC)) { - shader_addline(buffer, "SWZ %s, %s, %c, %c, 1, 0;\n", - reg, reg, writemask[2], writemask[1]); - } else { - if(strlen(writemask) == 5) { - shader_addline(buffer, "MOV %s.%c, %s.%c;\n", - reg, writemask[2], reg, writemask[4]); - } else if(strlen(writemask) == 2) { - /* Nothing to do */ - } else { - /* This is bad: We have VL, but we need VU */ - FIXME("2 or 3 components sampled from a converted ATI2N texture\n"); - } - } - break; - - /* stupid compiler */ + switch(channel_source) + { + case CHANNEL_SOURCE_ZERO: return "0"; + case CHANNEL_SOURCE_ONE: return "1"; + case CHANNEL_SOURCE_X: return "x"; + case CHANNEL_SOURCE_Y: return "y"; + case CHANNEL_SOURCE_Z: return "z"; + case CHANNEL_SOURCE_W: return "w"; default: - break; + FIXME("Unhandled channel source %#x\n", channel_source); + return "undefined"; } } -static void shader_arb_color_correction(const SHADER_OPCODE_ARG* arg) +static void gen_color_correction(SHADER_BUFFER *buffer, const char *reg, DWORD dst_mask, + const char *one, const char *two, struct color_fixup_desc fixup) { - IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader; - IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) shader->baseShader.device; - const WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; - WINED3DFORMAT fmt; - WINED3DFORMAT conversion_group; - IWineD3DBaseTextureImpl *texture; - UINT i; - BOOL recorded = FALSE; - DWORD sampler_idx; - DWORD hex_version = shader->baseShader.hex_version; - char reg[256]; - char writemask[6]; + DWORD mask; - switch(arg->opcode->opcode) { - case WINED3DSIO_TEX: - if (hex_version < WINED3DPS_VERSION(2,0)) { - sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK; - } else { - sampler_idx = arg->src[1] & WINED3DSP_REGNUM_MASK; - } - break; + if (is_yuv_fixup(fixup)) + { + enum yuv_fixup yuv_fixup = get_yuv_fixup(fixup); + FIXME("YUV fixup (%#x) not supported\n", yuv_fixup); + return; + } - case WINED3DSIO_TEXLDL: - FIXME("Add color fixup for vertex texture WINED3DSIO_TEXLDL\n"); - return; + mask = 0; + if (fixup.x_source != CHANNEL_SOURCE_X) mask |= WINED3DSP_WRITEMASK_0; + if (fixup.y_source != CHANNEL_SOURCE_Y) mask |= WINED3DSP_WRITEMASK_1; + if (fixup.z_source != CHANNEL_SOURCE_Z) mask |= WINED3DSP_WRITEMASK_2; + if (fixup.w_source != CHANNEL_SOURCE_W) mask |= WINED3DSP_WRITEMASK_3; + mask &= dst_mask; - case WINED3DSIO_TEXDP3TEX: - case WINED3DSIO_TEXM3x3TEX: - case WINED3DSIO_TEXM3x3SPEC: - case WINED3DSIO_TEXM3x3VSPEC: - case WINED3DSIO_TEXBEM: - case WINED3DSIO_TEXREG2AR: - case WINED3DSIO_TEXREG2GB: - case WINED3DSIO_TEXREG2RGB: - sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK; - break; + if (mask) + { + shader_addline(buffer, "SWZ %s, %s, %s, %s, %s, %s;\n", reg, reg, + shader_arb_get_fixup_swizzle(fixup.x_source), shader_arb_get_fixup_swizzle(fixup.y_source), + shader_arb_get_fixup_swizzle(fixup.z_source), shader_arb_get_fixup_swizzle(fixup.w_source)); + } - default: - /* Not a texture sampling instruction, nothing to do */ - return; - }; + mask = 0; + if (fixup.x_sign_fixup) mask |= WINED3DSP_WRITEMASK_0; + if (fixup.y_sign_fixup) mask |= WINED3DSP_WRITEMASK_1; + if (fixup.z_sign_fixup) mask |= WINED3DSP_WRITEMASK_2; + if (fixup.w_sign_fixup) mask |= WINED3DSP_WRITEMASK_3; + mask &= dst_mask; - texture = (IWineD3DBaseTextureImpl *) deviceImpl->stateBlock->textures[sampler_idx]; - if(texture) { - fmt = texture->resource.format; - conversion_group = texture->baseTexture.shader_conversion_group; - } else { - fmt = WINED3DFMT_UNKNOWN; - conversion_group = WINED3DFMT_UNKNOWN; - } + if (mask) + { + char reg_mask[6]; + char *ptr = reg_mask; - /* before doing anything, record the sampler with the format in the format conversion list, - * but check if it's not there already - */ - for(i = 0; i < shader->baseShader.num_sampled_samplers; i++) { - if(shader->baseShader.sampled_samplers[i] == sampler_idx) { - recorded = TRUE; + if (mask != WINED3DSP_WRITEMASK_ALL) + { + *ptr++ = '.'; + if (mask & WINED3DSP_WRITEMASK_0) *ptr++ = 'x'; + if (mask & WINED3DSP_WRITEMASK_1) *ptr++ = 'y'; + if (mask & WINED3DSP_WRITEMASK_2) *ptr++ = 'z'; + if (mask & WINED3DSP_WRITEMASK_3) *ptr++ = 'w'; } + *ptr = '\0'; + + shader_addline(buffer, "MAD %s%s, %s, %s, -%s;\n", reg, reg_mask, reg, two, one); } - if(!recorded) { - shader->baseShader.sampled_samplers[shader->baseShader.num_sampled_samplers] = sampler_idx; - shader->baseShader.num_sampled_samplers++; - shader->baseShader.sampled_format[sampler_idx] = conversion_group; - } +} +static void shader_arb_color_correction(const struct SHADER_OPCODE_ARG* arg, struct color_fixup_desc fixup) +{ + char reg[256]; pshader_get_register_name(arg->shader, arg->dst, reg); - shader_arb_get_write_mask(arg, arg->dst, writemask); - if(strlen(writemask) == 0) strcpy(writemask, ".xyzw"); - - gen_color_correction(arg->buffer, reg, writemask, "one", "coefmul.x", fmt, gl_info); - + gen_color_correction(arg->buffer, reg, arg->dst & WINED3DSP_WRITEMASK_ALL, "one", "coefmul.x", fixup); } - static void pshader_gen_input_modifier_line ( IWineD3DBaseShader *iface, SHADER_BUFFER* buffer, @@ -1633,6 +1485,9 @@ static void shader_hw_mnxn(const SHADER_OPCODE_ARG *arg) int i; int nComponents = 0; SHADER_OPCODE_ARG tmpArg; + IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)arg->shader; + const SHADER_OPCODE *opcode_table = shader->baseShader.shader_ins; + DWORD shader_version = shader->baseShader.hex_version; memset(&tmpArg, 0, sizeof(SHADER_OPCODE_ARG)); @@ -1647,23 +1502,23 @@ static void shader_hw_mnxn(const SHADER_OPCODE_ARG *arg) switch(arg->opcode->opcode) { case WINED3DSIO_M4x4: nComponents = 4; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP4); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP4); break; case WINED3DSIO_M4x3: nComponents = 3; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP4); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP4); break; case WINED3DSIO_M3x4: nComponents = 4; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP3); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3); break; case WINED3DSIO_M3x3: nComponents = 3; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP3); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3); break; case WINED3DSIO_M3x2: nComponents = 2; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP3); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3); break; default: break; @@ -2219,21 +2074,23 @@ static void shader_arb_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *g } } -static BOOL shader_arb_conv_supported(WINED3DFORMAT fmt) { - TRACE("Checking shader format support for format %s:", debug_d3dformat(fmt)); - switch(fmt) { - case WINED3DFMT_V8U8: - case WINED3DFMT_V16U16: - case WINED3DFMT_X8L8V8U8: - case WINED3DFMT_L6V5U5: - case WINED3DFMT_Q8W8V8U8: - case WINED3DFMT_ATI2N: - TRACE("[OK]\n"); - return TRUE; - default: - TRACE("[FAILED\n"); - return FALSE; +static BOOL shader_arb_color_fixup_supported(struct color_fixup_desc fixup) +{ + if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) + { + TRACE("Checking support for color_fixup:\n"); + dump_color_fixup_desc(fixup); } + + /* We support everything except YUV conversions. */ + if (!is_yuv_fixup(fixup)) + { + TRACE("[OK]\n"); + return TRUE; + } + + TRACE("[FAILED]\n"); + return FALSE; } static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABLE_SIZE] = @@ -2338,7 +2195,7 @@ const shader_backend_t arb_program_shader_backend = { shader_arb_generate_pshader, shader_arb_generate_vshader, shader_arb_get_caps, - shader_arb_conv_supported, + shader_arb_color_fixup_supported, }; /* ARB_fragment_program fixed function pipeline replacement definitions */ @@ -2956,8 +2813,8 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi } sprintf(colorcor_dst, "tex%u", stage); - gen_color_correction(&buffer, colorcor_dst, ".rgba", "const.x", "const.y", - settings->op[stage].color_correction, &GLINFO_LOCATION); + gen_color_correction(&buffer, colorcor_dst, WINED3DSP_WRITEMASK_ALL, "const.x", "const.y", + settings->op[stage].color_correction); } /* Generate the main shader */ @@ -3291,7 +3148,7 @@ const struct fragment_pipeline arbfp_fragment_pipeline = { arbfp_get_caps, arbfp_alloc, arbfp_free, - shader_arb_conv_supported, + shader_arb_color_fixup_supported, arbfp_fragmentstate_template, TRUE /* We can disable projected textures */ }; @@ -3328,11 +3185,12 @@ static void arbfp_blit_free(IWineD3DDevice *iface) { LEAVE_GL(); } -static BOOL gen_planar_yuv_read(SHADER_BUFFER *buffer, WINED3DFORMAT fmt, GLenum textype, char *luminance) { +static BOOL gen_planar_yuv_read(SHADER_BUFFER *buffer, enum yuv_fixup yuv_fixup, GLenum textype, char *luminance) +{ char chroma; const char *tex, *texinstr; - if(fmt == WINED3DFMT_UYVY) { + if (yuv_fixup == YUV_FIXUP_UYVY) { chroma = 'r'; *luminance = 'a'; } else { @@ -3414,7 +3272,8 @@ static BOOL gen_planar_yuv_read(SHADER_BUFFER *buffer, WINED3DFORMAT fmt, GLenum return TRUE; } -static BOOL gen_yv12_read(SHADER_BUFFER *buffer, WINED3DFORMAT fmt, GLenum textype, char *luminance) { +static BOOL gen_yv12_read(SHADER_BUFFER *buffer, GLenum textype, char *luminance) +{ const char *tex; switch(textype) { @@ -3559,7 +3418,8 @@ static BOOL gen_yv12_read(SHADER_BUFFER *buffer, WINED3DFORMAT fmt, GLenum texty return TRUE; } -static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, WINED3DFORMAT fmt, GLenum textype) { +static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixup, GLenum textype) +{ GLenum shader; SHADER_BUFFER buffer; char luminance_component; @@ -3627,16 +3487,29 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, WINED3DFORMAT fmt, GLen shader_addline(&buffer, "PARAM yuv_coef = {1.403, 0.344, 0.714, 1.770};\n"); shader_addline(&buffer, "PARAM size = program.local[0];\n"); - if(fmt == WINED3DFMT_UYVY || fmt ==WINED3DFMT_YUY2) { - if(gen_planar_yuv_read(&buffer, fmt, textype, &luminance_component) == FALSE) { - HeapFree(GetProcessHeap(), 0, buffer.buffer); - return 0; - } - } else { - if(gen_yv12_read(&buffer, fmt, textype, &luminance_component) == FALSE) { + switch (yuv_fixup) + { + case YUV_FIXUP_UYVY: + case YUV_FIXUP_YUY2: + if (!gen_planar_yuv_read(&buffer, yuv_fixup, textype, &luminance_component)) + { + HeapFree(GetProcessHeap(), 0, buffer.buffer); + return 0; + } + break; + + case YUV_FIXUP_YV12: + if (!gen_yv12_read(&buffer, textype, &luminance_component)) + { + HeapFree(GetProcessHeap(), 0, buffer.buffer); + return 0; + } + break; + + default: + FIXME("Unsupported YUV fixup %#x\n", yuv_fixup); HeapFree(GetProcessHeap(), 0, buffer.buffer); return 0; - } } /* Calculate the final result. Formula is taken from @@ -3663,25 +3536,24 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, WINED3DFORMAT fmt, GLen HeapFree(GetProcessHeap(), 0, buffer.buffer); LEAVE_GL(); - if(fmt == WINED3DFMT_YUY2) { - if(textype == GL_TEXTURE_RECTANGLE_ARB) { - priv->yuy2_rect_shader = shader; - } else { - priv->yuy2_2d_shader = shader; - } - } else if(fmt == WINED3DFMT_UYVY) { - if(textype == GL_TEXTURE_RECTANGLE_ARB) { - priv->uyvy_rect_shader = shader; - } else { - priv->uyvy_2d_shader = shader; - } - } else { - if(textype == GL_TEXTURE_RECTANGLE_ARB) { - priv->yv12_rect_shader = shader; - } else { - priv->yv12_2d_shader = shader; - } + switch (yuv_fixup) + { + case YUV_FIXUP_YUY2: + if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->yuy2_rect_shader = shader; + else priv->yuy2_2d_shader = shader; + break; + + case YUV_FIXUP_UYVY: + if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->uyvy_rect_shader = shader; + else priv->uyvy_2d_shader = shader; + break; + + case YUV_FIXUP_YV12: + if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->yv12_rect_shader = shader; + else priv->yv12_2d_shader = shader; + break; } + return shader; } @@ -3690,13 +3562,15 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum t IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface; float size[4] = {width, height, 1, 1}; struct arbfp_blit_priv *priv = (struct arbfp_blit_priv *) device->blit_priv; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; + enum yuv_fixup yuv_fixup; getFormatDescEntry(fmt, &GLINFO_LOCATION, &glDesc); - if(glDesc->conversion_group != WINED3DFMT_YUY2 && glDesc->conversion_group != WINED3DFMT_UYVY && - glDesc->conversion_group != WINED3DFMT_YV12) { - TRACE("Format: %s\n", debug_d3dformat(glDesc->conversion_group)); + if (!is_yuv_fixup(glDesc->color_fixup)) + { + TRACE("Fixup:\n"); + dump_color_fixup_desc(glDesc->color_fixup); /* Don't bother setting up a shader for unconverted formats */ ENTER_GL(); glEnable(textype); @@ -3705,30 +3579,33 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum t return WINED3D_OK; } - if(glDesc->conversion_group == WINED3DFMT_YUY2) { - if(textype == GL_TEXTURE_RECTANGLE_ARB) { - shader = priv->yuy2_rect_shader; - } else { - shader = priv->yuy2_2d_shader; - } - } else if(glDesc->conversion_group == WINED3DFMT_UYVY) { - if(textype == GL_TEXTURE_RECTANGLE_ARB) { - shader = priv->uyvy_rect_shader; - } else { - shader = priv->uyvy_2d_shader; - } - } else { - if(textype == GL_TEXTURE_RECTANGLE_ARB) { - shader = priv->yv12_rect_shader; - } else { - shader = priv->yv12_2d_shader; - } - } + yuv_fixup = get_yuv_fixup(glDesc->color_fixup); - if(!shader) { - shader = gen_yuv_shader(device, glDesc->conversion_group, textype); + switch(yuv_fixup) + { + case YUV_FIXUP_YUY2: + shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->yuy2_rect_shader : priv->yuy2_2d_shader; + break; + + case YUV_FIXUP_UYVY: + shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->uyvy_rect_shader : priv->uyvy_2d_shader; + break; + + case YUV_FIXUP_YV12: + shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->yv12_rect_shader : priv->yv12_2d_shader; + break; + + default: + FIXME("Unsupported YUV fixup %#x, not setting a shader\n", yuv_fixup); + ENTER_GL(); + glEnable(textype); + checkGLcall("glEnable(textype)"); + LEAVE_GL(); + return E_NOTIMPL; } + if (!shader) shader = gen_yuv_shader(device, yuv_fixup, textype); + ENTER_GL(); glEnable(GL_FRAGMENT_PROGRAM_ARB); checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB)"); @@ -3760,15 +3637,40 @@ static void arbfp_blit_unset(IWineD3DDevice *iface) { LEAVE_GL(); } -static BOOL arbfp_blit_conv_supported(WINED3DFORMAT fmt) { - TRACE("Checking blit format support for format %s:", debug_d3dformat(fmt)); - switch(fmt) { - case WINED3DFMT_YUY2: - case WINED3DFMT_UYVY: - case WINED3DFMT_YV12: +static BOOL arbfp_blit_color_fixup_supported(struct color_fixup_desc fixup) +{ + enum yuv_fixup yuv_fixup; + + if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) + { + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(fixup); + } + + if (is_identity_fixup(fixup)) + { + TRACE("[OK]\n"); + return TRUE; + } + + /* We only support YUV conversions. */ + if (!is_yuv_fixup(fixup)) + { + TRACE("[FAILED]\n"); + return FALSE; + } + + yuv_fixup = get_yuv_fixup(fixup); + switch(yuv_fixup) + { + case YUV_FIXUP_YUY2: + case YUV_FIXUP_UYVY: + case YUV_FIXUP_YV12: TRACE("[OK]\n"); return TRUE; + default: + FIXME("Unsupported YUV fixup %#x\n", yuv_fixup); TRACE("[FAILED]\n"); return FALSE; } @@ -3779,7 +3681,7 @@ const struct blit_shader arbfp_blit = { arbfp_blit_free, arbfp_blit_set, arbfp_blit_unset, - arbfp_blit_conv_supported + arbfp_blit_color_fixup_supported, }; #undef GLINFO_LOCATION diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index b2fb23b7352..90ca192881b 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -26,6 +26,7 @@ #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); +WINE_DECLARE_DEBUG_CHANNEL(d3d); /* Some private defines, Constant associations, etc. * Env bump matrix and per stage constant should be independent, @@ -343,21 +344,30 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], con /* Pass 2: Generate perturbation calculations */ for(stage = 0; stage < GL_LIMITS(textures); stage++) { + GLuint argmodextra_x, argmodextra_y; + struct color_fixup_desc fixup; + if(op[stage].cop == WINED3DTOP_DISABLE) break; if(op[stage].cop != WINED3DTOP_BUMPENVMAP && op[stage].cop != WINED3DTOP_BUMPENVMAPLUMINANCE) continue; - /* Nice thing, we get the color correction for free :-) */ - if(op[stage].color_correction == WINED3DFMT_V8U8) { - argmodextra = GL_2X_BIT_ATI | GL_BIAS_BIT_ATI; - } else { - argmodextra = 0; + if (fixup.x_source != CHANNEL_SOURCE_X || fixup.y_source != CHANNEL_SOURCE_Y) + { + FIXME("Swizzles not implemented\n"); + argmodextra_x = GL_NONE; + argmodextra_y = GL_NONE; + } + else + { + /* Nice thing, we get the color correction for free :-) */ + argmodextra_x = fixup.x_sign_fixup ? GL_2X_BIT_ATI | GL_BIAS_BIT_ATI : GL_NONE; + argmodextra_y = fixup.y_sign_fixup ? GL_2X_BIT_ATI | GL_BIAS_BIT_ATI : GL_NONE; } TRACE("glColorFragmentOp3ATI(GL_DOT2_ADD_ATI, GL_REG_%d_ATI, GL_RED_BIT_ATI, GL_NONE, GL_REG_%d_ATI, GL_NONE, %s, ATI_FFP_CONST_BUMPMAT(%d), GL_NONE, GL_NONE, GL_REG_%d_ATI, GL_RED, GL_NONE)\n", - stage + 1, stage, debug_argmod(argmodextra), stage, stage + 1); + stage + 1, stage, debug_argmod(argmodextra_x), stage, stage + 1); GL_EXTCALL(glColorFragmentOp3ATI(GL_DOT2_ADD_ATI, GL_REG_0_ATI + stage + 1, GL_RED_BIT_ATI, GL_NONE, - GL_REG_0_ATI + stage, GL_NONE, argmodextra, + GL_REG_0_ATI + stage, GL_NONE, argmodextra_x, ATI_FFP_CONST_BUMPMAT(stage), GL_NONE, GL_2X_BIT_ATI | GL_BIAS_BIT_ATI, GL_REG_0_ATI + stage + 1, GL_RED, GL_NONE)); @@ -376,9 +386,9 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], con GL_EXTCALL(glColorFragmentOp1ATI(GL_MOV_ATI, GL_REG_5_ATI, GL_GREEN_BIT_ATI, GL_NONE, ATI_FFP_CONST_BUMPMAT(stage), GL_ALPHA, GL_NONE)); TRACE("glColorFragmentOp3ATI(GL_DOT2_ADD_ATI, GL_REG_%d_ATI, GL_GREEN_BIT_ATI, GL_NONE, GL_REG_%d_ATI, GL_NONE, %s, GL_REG_5_ATI, GL_NONE, GL_NONE, GL_REG_%d_ATI, GL_GREEN, GL_NONE)\n", - stage + 1, stage, debug_argmod(argmodextra), stage + 1); + stage + 1, stage, debug_argmod(argmodextra_y), stage + 1); GL_EXTCALL(glColorFragmentOp3ATI(GL_DOT2_ADD_ATI, GL_REG_0_ATI + stage + 1, GL_GREEN_BIT_ATI, GL_NONE, - GL_REG_0_ATI + stage, GL_NONE, argmodextra, + GL_REG_0_ATI + stage, GL_NONE, argmodextra_y, GL_REG_5_ATI, GL_NONE, GL_2X_BIT_ATI | GL_BIAS_BIT_ATI, GL_REG_0_ATI + stage + 1, GL_GREEN, GL_NONE)); } @@ -1108,17 +1118,25 @@ static void atifs_free(IWineD3DDevice *iface) { } #undef GLINFO_LOCATION -static BOOL atifs_conv_supported(WINED3DFORMAT fmt) { - TRACE("Checking shader format support for format %s:", debug_d3dformat(fmt)); - switch(fmt) { - case WINED3DFMT_V8U8: - case WINED3DFMT_V16U16: - TRACE("[OK]\n"); - return TRUE; - default: - TRACE("[FAILED\n"); - return FALSE; +static BOOL atifs_color_fixup_supported(struct color_fixup_desc fixup) +{ + if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) + { + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(fixup); + } + + /* We only support sign fixup of the first two channels. */ + if (fixup.x_source == CHANNEL_SOURCE_X && fixup.y_source == CHANNEL_SOURCE_Y + && fixup.z_source == CHANNEL_SOURCE_Z && fixup.w_source == CHANNEL_SOURCE_W + && !fixup.z_sign_fixup && !fixup.w_sign_fixup) + { + TRACE("[OK]\n"); + return TRUE; } + + TRACE("[FAILED]\n"); + return FALSE; } const struct fragment_pipeline atifs_fragment_pipeline = { @@ -1126,7 +1144,7 @@ const struct fragment_pipeline atifs_fragment_pipeline = { atifs_get_caps, atifs_alloc, atifs_free, - atifs_conv_supported, + atifs_color_fixup_supported, atifs_fragmentstate_template, TRUE /* We can disable projected textures */ }; diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index 1427faa6cc2..fd5aadf98da 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -29,9 +29,12 @@ #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); +WINE_DECLARE_DEBUG_CHANNEL(d3d); #define GLNAME_REQUIRE_GLSL ((const char *)1) +static void shader_dump_param(const DWORD param, const DWORD addr_token, int input, DWORD shader_version); + static inline BOOL shader_is_version_token(DWORD token) { return shader_is_pshader_version(token) || shader_is_vshader_version(token); @@ -73,38 +76,33 @@ int shader_addline( return 0; } -const SHADER_OPCODE* shader_get_opcode( - IWineD3DBaseShader *iface, const DWORD code) { - - IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl*) iface; - +const SHADER_OPCODE *shader_get_opcode(const SHADER_OPCODE *opcode_table, DWORD shader_version, DWORD code) +{ DWORD i = 0; - DWORD hex_version = This->baseShader.hex_version; - const SHADER_OPCODE *shader_ins = This->baseShader.shader_ins; /** TODO: use dichotomic search */ - while (NULL != shader_ins[i].name) { - if (((code & WINED3DSI_OPCODE_MASK) == shader_ins[i].opcode) && - (((hex_version >= shader_ins[i].min_version) && (hex_version <= shader_ins[i].max_version)) || - ((shader_ins[i].min_version == 0) && (shader_ins[i].max_version == 0)))) { - return &shader_ins[i]; + while (opcode_table[i].name) + { + if ((code & WINED3DSI_OPCODE_MASK) == opcode_table[i].opcode + && shader_version >= opcode_table[i].min_version + && (!opcode_table[i].max_version || shader_version <= opcode_table[i].max_version)) + { + return &opcode_table[i]; } ++i; } - FIXME("Unsupported opcode %#x(%d) masked %#x, shader version %#x\n", - code, code, code & WINED3DSI_OPCODE_MASK, hex_version); + + FIXME("Unsupported opcode %#x(%d) masked %#x, shader version %#x\n", + code, code, code & WINED3DSI_OPCODE_MASK, shader_version); + return NULL; } /* Read a parameter opcode from the input stream, * and possibly a relative addressing token. * Return the number of tokens read */ -int shader_get_param( - IWineD3DBaseShader* iface, - const DWORD* pToken, - DWORD* param, - DWORD* addr_token) { - +static int shader_get_param(IWineD3DBaseShader *iface, const DWORD *pToken, DWORD *param, DWORD *addr_token) +{ /* PS >= 3.0 have relative addressing (with token) * VS >= 2.0 have relative addressing (with token) * VS >= 1.0 < 2.0 have relative addressing (without token) @@ -139,11 +137,9 @@ static inline int shader_skip_opcode( * Note: This function assumes source or destination token format. * It will not work with specially-formatted tokens like DEF or DCL, * but hopefully those would be recognized */ - -int shader_skip_unrecognized( - IWineD3DBaseShader* iface, - const DWORD* pToken) { - +static int shader_skip_unrecognized(IWineD3DBaseShader *iface, const DWORD *pToken) +{ + DWORD shader_version = ((IWineD3DBaseShaderImpl *)iface)->baseShader.hex_version; int tokens_read = 0; int i = 0; @@ -156,7 +152,7 @@ int shader_skip_unrecognized( FIXME("Unrecognized opcode param: token=0x%08x " "addr_token=0x%08x name=", param, addr_token); - shader_dump_param(iface, param, addr_token, i); + shader_dump_param(param, addr_token, i, shader_version); FIXME("\n"); ++i; } @@ -165,9 +161,8 @@ int shader_skip_unrecognized( /* Convert floating point offset relative * to a register file to an absolute offset for float constants */ - -unsigned int shader_get_float_offset(const DWORD reg) { - +static unsigned int shader_get_float_offset(const DWORD reg) +{ unsigned int regnum = reg & WINED3DSP_REGNUM_MASK; int regtype = shader_get_regtype(reg); @@ -208,6 +203,8 @@ HRESULT shader_get_registers_used( IWineD3DStateBlockImpl *stateBlock) { IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; + const SHADER_OPCODE *shader_ins = This->baseShader.shader_ins; + DWORD shader_version = This->baseShader.hex_version; unsigned int cur_loop_depth = 0, max_loop_depth = 0; /* There are some minor differences between pixel and vertex shaders */ @@ -245,7 +242,7 @@ HRESULT shader_get_registers_used( /* Fetch opcode */ opcode_token = *pToken++; - curOpcode = shader_get_opcode(iface, opcode_token); + curOpcode = shader_get_opcode(shader_ins, shader_version, opcode_token); /* Unhandled opcode, and its parameters */ if (NULL == curOpcode) { @@ -495,11 +492,8 @@ HRESULT shader_get_registers_used( return WINED3D_OK; } -static void shader_dump_decl_usage( - IWineD3DBaseShaderImpl* This, - DWORD decl, - DWORD param) { - +static void shader_dump_decl_usage(DWORD decl, DWORD param, DWORD shader_version) +{ DWORD regtype = shader_get_regtype(param); TRACE("dcl"); @@ -520,8 +514,7 @@ static void shader_dump_decl_usage( DWORD idx = (decl & WINED3DSP_DCL_USAGEINDEX_MASK) >> WINED3DSP_DCL_USAGEINDEX_SHIFT; /* Pixel shaders 3.0 don't have usage semantics */ - char pshader = shader_is_pshader_version(This->baseShader.hex_version); - if (pshader && This->baseShader.hex_version < WINED3DPS_VERSION(3,0)) + if (shader_is_pshader_version(shader_version) && shader_version < WINED3DPS_VERSION(3,0)) return; else TRACE("_"); @@ -579,20 +572,16 @@ static void shader_dump_decl_usage( } } -static void shader_dump_arr_entry( - IWineD3DBaseShader *iface, - const DWORD param, - const DWORD addr_token, - unsigned int reg, - int input) { - +static void shader_dump_arr_entry(const DWORD param, const DWORD addr_token, + unsigned int reg, int input, DWORD shader_version) +{ char relative = ((param & WINED3DSHADER_ADDRESSMODE_MASK) == WINED3DSHADER_ADDRMODE_RELATIVE); if (relative) { TRACE("["); if (addr_token) - shader_dump_param(iface, addr_token, 0, input); + shader_dump_param(addr_token, 0, input, shader_version); else TRACE("a0.x"); TRACE(" + "); @@ -602,13 +591,8 @@ static void shader_dump_arr_entry( TRACE("]"); } -void shader_dump_param( - IWineD3DBaseShader *iface, - const DWORD param, - const DWORD addr_token, - int input) { - - IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; +static void shader_dump_param(const DWORD param, const DWORD addr_token, int input, DWORD shader_version) +{ static const char * const rastout_reg_names[] = { "oPos", "oFog", "oPts" }; static const char * const misctype_reg_names[] = { "vPos", "vFace"}; char swizzle_reg_chars[4]; @@ -618,7 +602,7 @@ void shader_dump_param( DWORD modifier = param & WINED3DSP_SRCMOD_MASK; /* There are some minor differences between pixel and vertex shaders */ - char pshader = shader_is_pshader_version(This->baseShader.hex_version); + char pshader = shader_is_pshader_version(shader_version); /* For one, we'd prefer color components to be shown for pshaders. * FIXME: use the swizzle function for this */ @@ -650,14 +634,14 @@ void shader_dump_param( break; case WINED3DSPR_INPUT: TRACE("v"); - shader_dump_arr_entry(iface, param, addr_token, reg, input); + shader_dump_arr_entry(param, addr_token, reg, input, shader_version); break; case WINED3DSPR_CONST: case WINED3DSPR_CONST2: case WINED3DSPR_CONST3: case WINED3DSPR_CONST4: TRACE("c"); - shader_dump_arr_entry(iface, param, addr_token, shader_get_float_offset(param), input); + shader_dump_arr_entry(param, addr_token, shader_get_float_offset(param), input, shader_version); break; case WINED3DSPR_TEXTURE: /* vs: case D3DSPR_ADDR */ TRACE("%c%u", (pshader? 't':'a'), reg); @@ -679,20 +663,20 @@ void shader_dump_param( /* Vertex shaders >= 3.0 use general purpose output registers * (WINED3DSPR_OUTPUT), which can include an address token */ - if (WINED3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) >= 3) { + if (WINED3DSHADER_VERSION_MAJOR(shader_version) >= 3) { TRACE("o"); - shader_dump_arr_entry(iface, param, addr_token, reg, input); + shader_dump_arr_entry(param, addr_token, reg, input, shader_version); } else TRACE("oT%u", reg); break; case WINED3DSPR_CONSTINT: TRACE("i"); - shader_dump_arr_entry(iface, param, addr_token, reg, input); + shader_dump_arr_entry(param, addr_token, reg, input, shader_version); break; case WINED3DSPR_CONSTBOOL: TRACE("b"); - shader_dump_arr_entry(iface, param, addr_token, reg, input); + shader_dump_arr_entry(param, addr_token, reg, input, shader_version); break; case WINED3DSPR_LABEL: TRACE("l%u", reg); @@ -778,6 +762,67 @@ void shader_dump_param( } } +static void shader_color_correction(IWineD3DBaseShaderImpl *shader, + IWineD3DDeviceImpl *device, const struct SHADER_OPCODE_ARG *arg) +{ + DWORD hex_version = shader->baseShader.hex_version; + IWineD3DBaseTextureImpl *texture; + struct color_fixup_desc fixup; + BOOL recorded = FALSE; + DWORD sampler_idx; + UINT i; + + switch(arg->opcode->opcode) + { + case WINED3DSIO_TEX: + if (hex_version < WINED3DPS_VERSION(2,0)) sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK; + else sampler_idx = arg->src[1] & WINED3DSP_REGNUM_MASK; + break; + + case WINED3DSIO_TEXLDL: + FIXME("Add color fixup for vertex texture WINED3DSIO_TEXLDL\n"); + return; + + case WINED3DSIO_TEXDP3TEX: + case WINED3DSIO_TEXM3x3TEX: + case WINED3DSIO_TEXM3x3SPEC: + case WINED3DSIO_TEXM3x3VSPEC: + case WINED3DSIO_TEXBEM: + case WINED3DSIO_TEXREG2AR: + case WINED3DSIO_TEXREG2GB: + case WINED3DSIO_TEXREG2RGB: + sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK; + break; + + default: + /* Not a texture sampling instruction, nothing to do */ + return; + }; + + texture = (IWineD3DBaseTextureImpl *)device->stateBlock->textures[sampler_idx]; + if (texture) fixup = texture->baseTexture.shader_color_fixup; + else fixup = COLOR_FIXUP_IDENTITY; + + /* before doing anything, record the sampler with the format in the format conversion list, + * but check if it's not there already */ + for (i = 0; i < shader->baseShader.num_sampled_samplers; ++i) + { + if (shader->baseShader.sampled_samplers[i] == sampler_idx) + { + recorded = TRUE; + break; + } + } + + if (!recorded) + { + shader->baseShader.sampled_samplers[shader->baseShader.num_sampled_samplers] = sampler_idx; + ++shader->baseShader.num_sampled_samplers; + } + + device->shader_backend->shader_color_correction(arg, fixup); +} + /** Shared code in order to generate the bulk of the shader string. Use the shader_header_fct & shader_footer_fct to add strings that are specific to pixel or vertex functions @@ -787,7 +832,9 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer, { IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->baseShader.device; /* To access shader backend callbacks */ + const SHADER_OPCODE *opcode_table = This->baseShader.shader_ins; const SHADER_HANDLER *handler_table = device->shader_backend->shader_instruction_handler_table; + DWORD shader_version = This->baseShader.hex_version; const DWORD *pToken = pFunction; const SHADER_OPCODE *curOpcode = NULL; SHADER_HANDLER hw_fct = NULL; @@ -821,7 +868,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer, /* Read opcode */ hw_arg.opcode_token = *pToken++; - curOpcode = shader_get_opcode(iface, hw_arg.opcode_token); + curOpcode = shader_get_opcode(opcode_table, shader_version, hw_arg.opcode_token); /* Select handler */ if (curOpcode == NULL) @@ -876,7 +923,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer, hw_fct(&hw_arg); /* Add color correction if needed */ - device->shader_backend->shader_color_correction(&hw_arg); + shader_color_correction(This, device, &hw_arg); /* Process instruction modifiers for GLSL apps ( _sat, etc. ) */ /* FIXME: This should be internal to the shader backend. @@ -896,8 +943,8 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer, } } -void shader_dump_ins_modifiers(const DWORD output) { - +static void shader_dump_ins_modifiers(const DWORD output) +{ DWORD shift = (output & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT; DWORD mmask = output & WINED3DSP_DSTMOD_MASK; @@ -956,7 +1003,7 @@ void shader_trace_init( continue; } opcode_token = *pToken++; - curOpcode = shader_get_opcode(iface, opcode_token); + curOpcode = shader_get_opcode(This->baseShader.shader_ins, This->baseShader.hex_version, opcode_token); len++; if (NULL == curOpcode) { @@ -972,10 +1019,10 @@ void shader_trace_init( DWORD usage = *pToken; DWORD param = *(pToken + 1); - shader_dump_decl_usage(This, usage, param); + shader_dump_decl_usage(usage, param, This->baseShader.hex_version); shader_dump_ins_modifiers(param); TRACE(" "); - shader_dump_param(iface, param, 0, 0); + shader_dump_param(param, 0, 0, This->baseShader.hex_version); pToken += 2; len += 2; @@ -1019,7 +1066,7 @@ void shader_trace_init( * the destination token. */ if (opcode_token & WINED3DSHADER_INSTRUCTION_PREDICATED) { TRACE("("); - shader_dump_param(iface, *(pToken + 2), 0, 1); + shader_dump_param(*(pToken + 2), 0, 1, This->baseShader.hex_version); TRACE(") "); } if (opcode_token & WINED3DSI_COISSUE) { @@ -1058,7 +1105,7 @@ void shader_trace_init( shader_dump_ins_modifiers(param); TRACE(" "); - shader_dump_param(iface, param, addr_token, 0); + shader_dump_param(param, addr_token, 0, This->baseShader.hex_version); } /* Predication token - already printed out, just skip it */ @@ -1075,7 +1122,7 @@ void shader_trace_init( len += tokens_read; TRACE((i == 0)? " " : ", "); - shader_dump_param(iface, param, addr_token, 1); + shader_dump_param(param, addr_token, 1, This->baseShader.hex_version); } } TRACE("\n"); @@ -1093,7 +1140,7 @@ static void shader_none_select_depth_blt(IWineD3DDevice *iface, enum tex_types t static void shader_none_deselect_depth_blt(IWineD3DDevice *iface) {} static void shader_none_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {} static void shader_none_cleanup(IWineD3DDevice *iface) {} -static void shader_none_color_correction(const SHADER_OPCODE_ARG *arg) {} +static void shader_none_color_correction(const struct SHADER_OPCODE_ARG *arg, struct color_fixup_desc fixup) {} static void shader_none_destroy(IWineD3DBaseShader *iface) {} static HRESULT shader_none_alloc(IWineD3DDevice *iface) {return WINED3D_OK;} static void shader_none_free(IWineD3DDevice *iface) {} @@ -1115,21 +1162,23 @@ static void shader_none_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info * pCaps->PixelShader1xMaxValue = 0.0; } #undef GLINFO_LOCATION -static BOOL shader_none_conv_supported(WINED3DFORMAT fmt) { - TRACE("Checking shader format support for format %s", debug_d3dformat(fmt)); - switch(fmt) { - /* Faked to make some apps happy. */ - case WINED3DFMT_V8U8: - case WINED3DFMT_V16U16: - case WINED3DFMT_L6V5U5: - case WINED3DFMT_X8L8V8U8: - case WINED3DFMT_Q8W8V8U8: - TRACE("[OK]\n"); - return TRUE; - default: - TRACE("[FAILED]\n"); - return FALSE; +static BOOL shader_none_color_fixup_supported(struct color_fixup_desc fixup) +{ + if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) + { + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(fixup); } + + /* Faked to make some apps happy. */ + if (!is_yuv_fixup(fixup)) + { + TRACE("[OK]\n"); + return TRUE; + } + + TRACE("[FAILED]\n"); + return FALSE; } const shader_backend_t none_shader_backend = { @@ -1147,7 +1196,7 @@ const shader_backend_t none_shader_backend = { shader_none_generate_pshader, shader_none_generate_vshader, shader_none_get_caps, - shader_none_conv_supported + shader_none_color_fixup_supported, }; /* ******************************************* diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 98d9de4104a..158650e2142 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -27,47 +27,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); #define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info -/* ******************************************* - IWineD3DBaseTexture IUnknown parts follow - ******************************************* */ -HRESULT WINAPI IWineD3DBaseTextureImpl_QueryInterface(IWineD3DBaseTexture *iface, REFIID riid, LPVOID *ppobj) +void basetexture_cleanup(IWineD3DBaseTexture *iface) { IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; - TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj); - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IWineD3DBase) - || IsEqualGUID(riid, &IID_IWineD3DResource) - || IsEqualGUID(riid, &IID_IWineD3DBaseTexture)) { - IUnknown_AddRef(iface); - *ppobj = This; - return S_OK; - } - *ppobj = NULL; - return E_NOINTERFACE; -} - -ULONG WINAPI IWineD3DBaseTextureImpl_AddRef(IWineD3DBaseTexture *iface) { - IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; - ULONG ref = InterlockedIncrement(&This->resource.ref); - - TRACE("(%p) : AddRef increasing from %d\n", This,ref - 1); - return ref; -} - -ULONG WINAPI IWineD3DBaseTextureImpl_Release(IWineD3DBaseTexture *iface) { - IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; - ULONG ref = InterlockedDecrement(&This->resource.ref); - TRACE("(%p) : Releasing from %d\n", This, ref + 1); - if (ref == 0) { - IWineD3DBaseTextureImpl_CleanUp(iface); - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* class static */ -void IWineD3DBaseTextureImpl_CleanUp(IWineD3DBaseTexture *iface) { - IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; TRACE("(%p) : textureName(%d)\n", This, This->baseTexture.textureName); @@ -78,41 +40,12 @@ void IWineD3DBaseTextureImpl_CleanUp(IWineD3DBaseTexture *iface) { glDeleteTextures(1, &This->baseTexture.textureName); LEAVE_GL(); } - IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface); -} -/* **************************************************** - IWineD3DBaseTexture IWineD3DResource parts follow - **************************************************** */ -HRESULT WINAPI IWineD3DBaseTextureImpl_GetDevice(IWineD3DBaseTexture *iface, IWineD3DDevice** ppDevice) { - return IWineD3DResourceImpl_GetDevice((IWineD3DResource *)iface, ppDevice); + resource_cleanup((IWineD3DResource *)iface); } -HRESULT WINAPI IWineD3DBaseTextureImpl_SetPrivateData(IWineD3DBaseTexture *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { - return IWineD3DResourceImpl_SetPrivateData((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); -} - -HRESULT WINAPI IWineD3DBaseTextureImpl_GetPrivateData(IWineD3DBaseTexture *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { - return IWineD3DResourceImpl_GetPrivateData((IWineD3DResource *)iface, refguid, pData, pSizeOfData); -} - -HRESULT WINAPI IWineD3DBaseTextureImpl_FreePrivateData(IWineD3DBaseTexture *iface, REFGUID refguid) { - return IWineD3DResourceImpl_FreePrivateData((IWineD3DResource *)iface, refguid); -} - -DWORD WINAPI IWineD3DBaseTextureImpl_SetPriority(IWineD3DBaseTexture *iface, DWORD PriorityNew) { - return IWineD3DResourceImpl_SetPriority((IWineD3DResource *)iface, PriorityNew); -} - -DWORD WINAPI IWineD3DBaseTextureImpl_GetPriority(IWineD3DBaseTexture *iface) { - return IWineD3DResourceImpl_GetPriority((IWineD3DResource *)iface); -} - -void WINAPI IWineD3DBaseTextureImpl_PreLoad(IWineD3DBaseTexture *iface) { - IWineD3DResourceImpl_PreLoad((IWineD3DResource *)iface); -} - -void WINAPI IWineD3DBaseTextureImpl_UnLoad(IWineD3DBaseTexture *iface) { +void basetexture_unload(IWineD3DBaseTexture *iface) +{ IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface; IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; @@ -126,21 +59,10 @@ void WINAPI IWineD3DBaseTextureImpl_UnLoad(IWineD3DBaseTexture *iface This->baseTexture.dirty = TRUE; } -WINED3DRESOURCETYPE WINAPI IWineD3DBaseTextureImpl_GetType(IWineD3DBaseTexture *iface) { - return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); -} - -HRESULT WINAPI IWineD3DBaseTextureImpl_GetParent(IWineD3DBaseTexture *iface, IUnknown **pParent) { - return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); -} - -/* ****************************************************** - IWineD3DBaseTexture IWineD3DBaseTexture parts follow - ****************************************************** */ - /* There is no OpenGL equivalent of setLOD, getLOD. All they do anyway is prioritize texture loading * so just pretend that they work unless something really needs a failure. */ -DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew) { +DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; if (This->resource.pool != WINED3DPOOL_MANAGED) { @@ -156,7 +78,8 @@ DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LO return This->baseTexture.LOD; } -DWORD WINAPI IWineD3DBaseTextureImpl_GetLOD(IWineD3DBaseTexture *iface) { +DWORD basetexture_get_lod(IWineD3DBaseTexture *iface) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; if (This->resource.pool != WINED3DPOOL_MANAGED) { @@ -168,13 +91,15 @@ DWORD WINAPI IWineD3DBaseTextureImpl_GetLOD(IWineD3DBaseTexture *iface) { return This->baseTexture.LOD; } -DWORD WINAPI IWineD3DBaseTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface) { +DWORD basetexture_get_level_count(IWineD3DBaseTexture *iface) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; TRACE("(%p) : returning %d\n", This, This->baseTexture.levels); return This->baseTexture.levels; } -HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) { +HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; UINT textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface); @@ -216,7 +141,8 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture return WINED3D_OK; } -WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface) { +WINED3DTEXTUREFILTERTYPE basetexture_get_autogen_filter_type(IWineD3DBaseTexture *iface) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; FIXME("(%p) : stub\n", This); if (!(This->resource.usage & WINED3DUSAGE_AUTOGENMIPMAP)) { @@ -225,15 +151,16 @@ WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWi return This->baseTexture.filterType; } -void WINAPI IWineD3DBaseTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface) { +void basetexture_generate_mipmaps(IWineD3DBaseTexture *iface) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; /* TODO: implement filters using GL_SGI_generate_mipmaps http://oss.sgi.com/projects/ogl-sample/registry/SGIS/generate_mipmap.txt */ FIXME("(%p) : stub\n", This); return ; } -/* Internal function, No d3d mapping */ -BOOL WINAPI IWineD3DBaseTextureImpl_SetDirty(IWineD3DBaseTexture *iface, BOOL dirty) { +BOOL basetexture_set_dirty(IWineD3DBaseTexture *iface, BOOL dirty) +{ BOOL old; IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; old = This->baseTexture.dirty; @@ -241,12 +168,14 @@ BOOL WINAPI IWineD3DBaseTextureImpl_SetDirty(IWineD3DBaseTexture *iface, BOOL di return old; } -BOOL WINAPI IWineD3DBaseTextureImpl_GetDirty(IWineD3DBaseTexture *iface) { +BOOL basetexture_get_dirty(IWineD3DBaseTexture *iface) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; return This->baseTexture.dirty; } -HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) { +HRESULT basetexture_bind(IWineD3DBaseTexture *iface) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; HRESULT hr = WINED3D_OK; UINT textureDimensions; @@ -330,32 +259,6 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) { return hr; } -UINT WINAPI IWineD3DBaseTextureImpl_GetTextureDimensions(IWineD3DBaseTexture *iface){ - IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; - FIXME("(%p) : This shouldn't be called\n", This); - return WINED3D_OK; -} - -BOOL WINAPI IWineD3DBaseTextureImpl_IsCondNP2(IWineD3DBaseTexture *iface){ - IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; - FIXME("(%p) : This shouldn't be called\n", This); - return FALSE; -} - -static inline GLenum warpLookupType(WINED3DSAMPLERSTATETYPE Type) { - switch(Type) { - case WINED3DSAMP_ADDRESSU: - return GL_TEXTURE_WRAP_S; - case WINED3DSAMP_ADDRESSV: - return GL_TEXTURE_WRAP_T; - case WINED3DSAMP_ADDRESSW: - return GL_TEXTURE_WRAP_R; - default: - FIXME("Unexpected warp type %d\n", Type); - return 0; - } -} - static inline void apply_wrap(const GLint textureDimensions, const DWORD state, const GLint type, BOOL cond_np2) { GLint wrapParm; @@ -381,9 +284,10 @@ static inline void apply_wrap(const GLint textureDimensions, const DWORD state, } } -void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface, - const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], - const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) { +void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, + const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], + const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) +{ IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; DWORD state; GLint textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface); @@ -487,38 +391,3 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface This->baseTexture.states[WINED3DTEXSTA_MAXANISOTROPY] = samplerStates[WINED3DSAMP_MAXANISOTROPY]; } } - - -static const IWineD3DBaseTextureVtbl IWineD3DBaseTexture_Vtbl = -{ - /* IUnknown */ - IWineD3DBaseTextureImpl_QueryInterface, - IWineD3DBaseTextureImpl_AddRef, - IWineD3DBaseTextureImpl_Release, - /* IWineD3DResource */ - IWineD3DBaseTextureImpl_GetParent, - IWineD3DBaseTextureImpl_GetDevice, - IWineD3DBaseTextureImpl_SetPrivateData, - IWineD3DBaseTextureImpl_GetPrivateData, - IWineD3DBaseTextureImpl_FreePrivateData, - IWineD3DBaseTextureImpl_SetPriority, - IWineD3DBaseTextureImpl_GetPriority, - IWineD3DBaseTextureImpl_PreLoad, - IWineD3DBaseTextureImpl_UnLoad, - IWineD3DBaseTextureImpl_GetType, - /*IWineD3DBaseTexture*/ - IWineD3DBaseTextureImpl_SetLOD, - IWineD3DBaseTextureImpl_GetLOD, - IWineD3DBaseTextureImpl_GetLevelCount, - IWineD3DBaseTextureImpl_SetAutoGenFilterType, - IWineD3DBaseTextureImpl_GetAutoGenFilterType, - IWineD3DBaseTextureImpl_GenerateMipSubLevels, - IWineD3DBaseTextureImpl_SetDirty, - IWineD3DBaseTextureImpl_GetDirty, - /* internal */ - IWineD3DBaseTextureImpl_BindTexture, - IWineD3DBaseTextureImpl_GetTextureDimensions, - IWineD3DBaseTextureImpl_IsCondNP2, - IWineD3DBaseTextureImpl_ApplyStateChanges - -}; diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index acfe36b7b35..05afe5d4d26 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1253,7 +1253,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf * the alpha blend state changes with different render target formats */ if(oldFmt != newFmt) { - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; const StaticPixelFormatDesc *old = getFormatDescEntry(oldFmt, NULL, NULL); const StaticPixelFormatDesc *new = getFormatDescEntry(newFmt, &GLINFO_LOCATION, &glDesc); diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 9ccb2d19992..90b122128aa 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -68,27 +68,27 @@ static ULONG WINAPI IWineD3DCubeTextureImpl_Release(IWineD3DCubeTexture *iface) IWineD3DCubeTexture IWineD3DResource parts follow **************************************************** */ static HRESULT WINAPI IWineD3DCubeTextureImpl_GetDevice(IWineD3DCubeTexture *iface, IWineD3DDevice** ppDevice) { - return IWineD3DResourceImpl_GetDevice((IWineD3DResource *)iface, ppDevice); + return resource_get_device((IWineD3DResource *)iface, ppDevice); } static HRESULT WINAPI IWineD3DCubeTextureImpl_SetPrivateData(IWineD3DCubeTexture *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { - return IWineD3DResourceImpl_SetPrivateData((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); + return resource_set_private_data((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); } static HRESULT WINAPI IWineD3DCubeTextureImpl_GetPrivateData(IWineD3DCubeTexture *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { - return IWineD3DResourceImpl_GetPrivateData((IWineD3DResource *)iface, refguid, pData, pSizeOfData); + return resource_get_private_data((IWineD3DResource *)iface, refguid, pData, pSizeOfData); } static HRESULT WINAPI IWineD3DCubeTextureImpl_FreePrivateData(IWineD3DCubeTexture *iface, REFGUID refguid) { - return IWineD3DResourceImpl_FreePrivateData((IWineD3DResource *)iface, refguid); + return resource_free_private_data((IWineD3DResource *)iface, refguid); } static DWORD WINAPI IWineD3DCubeTextureImpl_SetPriority(IWineD3DCubeTexture *iface, DWORD PriorityNew) { - return IWineD3DResourceImpl_SetPriority((IWineD3DResource *)iface, PriorityNew); + return resource_set_priority((IWineD3DResource *)iface, PriorityNew); } static DWORD WINAPI IWineD3DCubeTextureImpl_GetPriority(IWineD3DCubeTexture *iface) { - return IWineD3DResourceImpl_GetPriority((IWineD3DResource *)iface); + return resource_get_priority((IWineD3DResource *)iface); } static void WINAPI IWineD3DCubeTextureImpl_PreLoad(IWineD3DCubeTexture *iface) { @@ -176,52 +176,52 @@ static void WINAPI IWineD3DCubeTextureImpl_UnLoad(IWineD3DCubeTexture *iface) { } } - IWineD3DBaseTextureImpl_UnLoad((IWineD3DBaseTexture *) iface); + basetexture_unload((IWineD3DBaseTexture *)iface); } static WINED3DRESOURCETYPE WINAPI IWineD3DCubeTextureImpl_GetType(IWineD3DCubeTexture *iface) { - return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); + return resource_get_type((IWineD3DResource *)iface); } static HRESULT WINAPI IWineD3DCubeTextureImpl_GetParent(IWineD3DCubeTexture *iface, IUnknown **pParent) { - return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); + return resource_get_parent((IWineD3DResource *)iface, pParent); } /* ****************************************************** IWineD3DCubeTexture IWineD3DBaseTexture parts follow ****************************************************** */ static DWORD WINAPI IWineD3DCubeTextureImpl_SetLOD(IWineD3DCubeTexture *iface, DWORD LODNew) { - return IWineD3DBaseTextureImpl_SetLOD((IWineD3DBaseTexture *)iface, LODNew); + return basetexture_set_lod((IWineD3DBaseTexture *)iface, LODNew); } static DWORD WINAPI IWineD3DCubeTextureImpl_GetLOD(IWineD3DCubeTexture *iface) { - return IWineD3DBaseTextureImpl_GetLOD((IWineD3DBaseTexture *)iface); + return basetexture_get_lod((IWineD3DBaseTexture *)iface); } static DWORD WINAPI IWineD3DCubeTextureImpl_GetLevelCount(IWineD3DCubeTexture *iface) { - return IWineD3DBaseTextureImpl_GetLevelCount((IWineD3DBaseTexture *)iface); + return basetexture_get_level_count((IWineD3DBaseTexture *)iface); } static HRESULT WINAPI IWineD3DCubeTextureImpl_SetAutoGenFilterType(IWineD3DCubeTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) { - return IWineD3DBaseTextureImpl_SetAutoGenFilterType((IWineD3DBaseTexture *)iface, FilterType); + return basetexture_set_autogen_filter_type((IWineD3DBaseTexture *)iface, FilterType); } static WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DCubeTextureImpl_GetAutoGenFilterType(IWineD3DCubeTexture *iface) { - return IWineD3DBaseTextureImpl_GetAutoGenFilterType((IWineD3DBaseTexture *)iface); + return basetexture_get_autogen_filter_type((IWineD3DBaseTexture *)iface); } static void WINAPI IWineD3DCubeTextureImpl_GenerateMipSubLevels(IWineD3DCubeTexture *iface) { - IWineD3DBaseTextureImpl_GenerateMipSubLevels((IWineD3DBaseTexture *)iface); + basetexture_generate_mipmaps((IWineD3DBaseTexture *)iface); } /* Internal function, No d3d mapping */ static BOOL WINAPI IWineD3DCubeTextureImpl_SetDirty(IWineD3DCubeTexture *iface, BOOL dirty) { - return IWineD3DBaseTextureImpl_SetDirty((IWineD3DBaseTexture *)iface, dirty); + return basetexture_set_dirty((IWineD3DBaseTexture *)iface, dirty); } /* Internal function, No d3d mapping */ static BOOL WINAPI IWineD3DCubeTextureImpl_GetDirty(IWineD3DCubeTexture *iface) { - return IWineD3DBaseTextureImpl_GetDirty((IWineD3DBaseTexture *)iface); + return basetexture_get_dirty((IWineD3DBaseTexture *)iface); } static HRESULT WINAPI IWineD3DCubeTextureImpl_BindTexture(IWineD3DCubeTexture *iface) { @@ -231,7 +231,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_BindTexture(IWineD3DCubeTexture *i TRACE("(%p) : relay to BaseTexture\n", This); - hr = IWineD3DBaseTextureImpl_BindTexture((IWineD3DBaseTexture *)iface); + hr = basetexture_bind((IWineD3DBaseTexture *)iface); if (set_gl_texture_desc && SUCCEEDED(hr)) { UINT i, j; for (i = 0; i < This->baseTexture.levels; ++i) { @@ -262,7 +262,7 @@ static void WINAPI IWineD3DCubeTextureImpl_ApplyStateChanges(IWineD3DCubeTexture const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) { TRACE("(%p) : relay to BaseTexture\n", iface); - IWineD3DBaseTextureImpl_ApplyStateChanges((IWineD3DBaseTexture *)iface, textureStates, samplerStates); + basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates); } @@ -286,7 +286,7 @@ static void WINAPI IWineD3DCubeTextureImpl_Destroy(IWineD3DCubeTexture *iface, D } } } - IWineD3DBaseTextureImpl_CleanUp((IWineD3DBaseTexture *) iface); + basetexture_cleanup((IWineD3DBaseTexture *)iface); /* finally delete the object */ HeapFree(GetProcessHeap(), 0, This); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 855bea536c4..836ad3bee4c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -457,12 +457,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, object->num_contained_ps_consts_f = GL_LIMITS(pshader_constantsF); for (i = 0; i < MAX_CONST_B; ++i) { object->contained_ps_consts_b[i] = i; - object->changed.pixelShaderConstantsB[i] = TRUE; + object->changed.pixelShaderConstantsB |= (1 << i); } object->num_contained_ps_consts_b = MAX_CONST_B; for (i = 0; i < MAX_CONST_I; ++i) { object->contained_ps_consts_i[i] = i; - object->changed.pixelShaderConstantsI[i] = TRUE; + object->changed.pixelShaderConstantsI |= (1 << i); } object->num_contained_ps_consts_i = MAX_CONST_I; @@ -514,13 +514,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, } object->num_contained_vs_consts_f = GL_LIMITS(vshader_constantsF); for (i = 0; i < MAX_CONST_B; ++i) { - object->changed.vertexShaderConstantsB[i] = TRUE; object->contained_vs_consts_b[i] = i; + object->changed.vertexShaderConstantsB |= (1 << i); } object->num_contained_vs_consts_b = MAX_CONST_B; for (i = 0; i < MAX_CONST_I; ++i) { - object->changed.vertexShaderConstantsI[i] = TRUE; object->contained_vs_consts_i[i] = i; + object->changed.vertexShaderConstantsI |= (1 << i); } object->num_contained_vs_consts_i = MAX_CONST_I; for (i = 0; i < NUM_SAVEDVERTEXSTATES_R; i++) { @@ -587,7 +587,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DSurfaceImpl *object; /*NOTE: impl ref allowed since this is a create function */ unsigned int Size = 1; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; const StaticPixelFormatDesc *tableEntry = getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc); UINT mul_4w, mul_4h; TRACE("(%p) Create surface\n",This); @@ -759,7 +759,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U HRESULT hr; unsigned int pow2Width; unsigned int pow2Height; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc); TRACE("(%p) : Width %d, Height %d, Levels %d, Usage %#x\n", This, Width, Height, Levels, Usage); @@ -891,7 +891,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U tmpW = max(1, tmpW >> 1); tmpH = max(1, tmpH >> 1); } - object->baseTexture.shader_conversion_group = glDesc->conversion_group; + object->baseTexture.shader_color_fixup = glDesc->color_fixup; TRACE("(%p) : Created texture %p\n", This, object); return WINED3D_OK; @@ -911,7 +911,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa UINT tmpW; UINT tmpH; UINT tmpD; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc); @@ -932,10 +932,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa TRACE("(%p) : W(%d) H(%d) D(%d), Lvl(%d) Usage(%d), Fmt(%u,%s), Pool(%s)\n", This, Width, Height, Depth, Levels, Usage, Format, debug_d3dformat(Format), debug_d3dpool(Pool)); - object->width = Width; - object->height = Height; - object->depth = Depth; - /* Is NP2 support for volumes needed? */ object->baseTexture.pow2Matrix[ 0] = 1.0; object->baseTexture.pow2Matrix[ 5] = 1.0; @@ -1002,7 +998,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa tmpH = max(1, tmpH >> 1); tmpD = max(1, tmpD >> 1); } - object->baseTexture.shader_conversion_group = glDesc->conversion_group; + object->baseTexture.shader_color_fixup = glDesc->color_fixup; *ppVolumeTexture = (IWineD3DVolumeTexture *) object; TRACE("(%p) : Created volume texture %p\n", This, object); @@ -1057,7 +1053,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface UINT tmpW; HRESULT hr; unsigned int pow2EdgeLength; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; getFormatDescEntry(Format, &GLINFO_LOCATION, &glDesc); /* TODO: It should only be possible to create textures for formats @@ -1081,8 +1077,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface pow2EdgeLength = 1; while (pow2EdgeLength < EdgeLength) pow2EdgeLength <<= 1; - object->edgeLength = EdgeLength; - if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO)) { /* Precalculated scaling for 'faked' non power of two texture coords */ object->baseTexture.pow2Matrix[ 0] = 1.0; @@ -1174,7 +1168,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface } tmpW = max(1, tmpW >> 1); } - object->baseTexture.shader_conversion_group = glDesc->conversion_group; + object->baseTexture.shader_color_fixup = glDesc->color_fixup; TRACE("(%p) : Created Cube Texture %p\n", This, object); *ppCubeTexture = (IWineD3DCubeTexture *) object; @@ -1243,13 +1237,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE if(GL_SUPPORT(ARB_OCCLUSION_QUERY)) { TRACE("(%p) Allocating data for an occlusion query\n", This); + + ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); + ENTER_GL(); GL_EXTCALL(glGenQueriesARB(1, &((WineQueryOcclusionData *)(object->extendedData))->queryId)); + LEAVE_GL(); break; } case WINED3DQUERYTYPE_EVENT: object->extendedData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WineQueryEventData)); ((WineQueryEventData *)(object->extendedData))->ctx = This->activeContext; + ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); + ENTER_GL(); if(GL_SUPPORT(APPLE_FENCE)) { GL_EXTCALL(glGenFencesAPPLE(1, &((WineQueryEventData *)(object->extendedData))->fenceId)); checkGLcall("glGenFencesAPPLE"); @@ -1257,6 +1257,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE GL_EXTCALL(glGenFencesNV(1, &((WineQueryEventData *)(object->extendedData))->fenceId)); checkGLcall("glGenFencesNV"); } + LEAVE_GL(); break; case WINED3DQUERYTYPE_VCACHE: @@ -3544,7 +3545,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantB( TRACE("Set BOOL constant %u to %s\n", start + i, srcData[i]? "true":"false"); for (i = start; i < cnt + start; ++i) { - This->updateStateBlock->changed.vertexShaderConstantsB[i] = TRUE; + This->updateStateBlock->changed.vertexShaderConstantsB |= (1 << i); } IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VERTEXSHADERCONSTANT); @@ -3592,7 +3593,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantI( srcData[i*4], srcData[i*4+1], srcData[i*4+2], srcData[i*4+3]); for (i = start; i < cnt + start; ++i) { - This->updateStateBlock->changed.vertexShaderConstantsI[i] = TRUE; + This->updateStateBlock->changed.vertexShaderConstantsI |= (1 << i); } IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VERTEXSHADERCONSTANT); @@ -3977,7 +3978,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantB( TRACE("Set BOOL constant %u to %s\n", start + i, srcData[i]? "true":"false"); for (i = start; i < cnt + start; ++i) { - This->updateStateBlock->changed.pixelShaderConstantsB[i] = TRUE; + This->updateStateBlock->changed.pixelShaderConstantsB |= (1 << i); } IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADERCONSTANT); @@ -4025,7 +4026,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantI( srcData[i*4], srcData[i*4+1], srcData[i*4+2], srcData[i*4+3]); for (i = start; i < cnt + start; ++i) { - This->updateStateBlock->changed.pixelShaderConstantsI[i] = TRUE; + This->updateStateBlock->changed.pixelShaderConstantsI |= (1 << i); } IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADERCONSTANT); @@ -4909,25 +4910,29 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndStateBlock(IWineD3DDevice *iface, IW } } for(i = 0; i < MAX_CONST_I; i++) { - if(object->changed.vertexShaderConstantsI[i]) { + if (object->changed.vertexShaderConstantsI & (1 << i)) + { object->contained_vs_consts_i[object->num_contained_vs_consts_i] = i; object->num_contained_vs_consts_i++; } } for(i = 0; i < MAX_CONST_B; i++) { - if(object->changed.vertexShaderConstantsB[i]) { + if (object->changed.vertexShaderConstantsB & (1 << i)) + { object->contained_vs_consts_b[object->num_contained_vs_consts_b] = i; object->num_contained_vs_consts_b++; } } for(i = 0; i < MAX_CONST_I; i++) { - if(object->changed.pixelShaderConstantsI[i]) { + if (object->changed.pixelShaderConstantsI & (1 << i)) + { object->contained_ps_consts_i[object->num_contained_ps_consts_i] = i; object->num_contained_ps_consts_i++; } } for(i = 0; i < MAX_CONST_B; i++) { - if(object->changed.pixelShaderConstantsB[i]) { + if (object->changed.pixelShaderConstantsB & (1 << i)) + { object->contained_ps_consts_b[object->num_contained_ps_consts_b] = i; object->num_contained_ps_consts_b++; } @@ -5407,7 +5412,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice * return WINED3D_OK; } -static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveStrided (IWineD3DDevice *iface, WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData) { +static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveStrided(IWineD3DDevice *iface, + WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, + const WineDirect3DVertexStridedData *DrawPrimStrideData) +{ IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; /* Mark the state dirty until we have nicer tracking @@ -5423,7 +5431,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveStrided (IWineD3DDevice *i return WINED3D_OK; } -static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveStrided(IWineD3DDevice *iface, WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, WineDirect3DVertexStridedData *DrawPrimStrideData, UINT NumVertices, CONST void *pIndexData, WINED3DFORMAT IndexDataFormat) { +static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveStrided(IWineD3DDevice *iface, + WINED3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, + const WineDirect3DVertexStridedData *DrawPrimStrideData, UINT NumVertices, const void *pIndexData, + WINED3DFORMAT IndexDataFormat) +{ IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; DWORD idxSize = (IndexDataFormat == WINED3DFMT_INDEX32 ? 4 : 2); @@ -5615,7 +5627,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *if static HRESULT WINAPI IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface, DWORD* pNumPasses) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DBaseTextureImpl *texture; - const GlPixelFormatDesc *gl_info; + const struct GlPixelFormatDesc *gl_info; DWORD i; TRACE("(%p) : %p\n", This, pNumPasses); @@ -5767,10 +5779,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetCurrentTexturePalette(IWineD3DDevi static HRESULT WINAPI IWineD3DDeviceImpl_SetSoftwareVertexProcessing(IWineD3DDevice *iface, BOOL bSoftware) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - static BOOL showFixmes = TRUE; - if (showFixmes) { + static BOOL warned; + if (!warned) + { FIXME("(%p) : stub\n", This); - showFixmes = FALSE; + warned = TRUE; } This->softwareVertexProcessing = bSoftware; @@ -5780,10 +5793,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSoftwareVertexProcessing(IWineD3DD static BOOL WINAPI IWineD3DDeviceImpl_GetSoftwareVertexProcessing(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - static BOOL showFixmes = TRUE; - if (showFixmes) { + static BOOL warned; + if (!warned) + { FIXME("(%p) : stub\n", This); - showFixmes = FALSE; + warned = TRUE; } return This->softwareVertexProcessing; } @@ -5809,11 +5823,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetRasterStatus(IWineD3DDevice *iface static HRESULT WINAPI IWineD3DDeviceImpl_SetNPatchMode(IWineD3DDevice *iface, float nSegments) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - static BOOL showfixmes = TRUE; + static BOOL warned; if(nSegments != 0.0f) { - if( showfixmes) { + if (!warned) + { FIXME("(%p) : stub nSegments(%f)\n", This, nSegments); - showfixmes = FALSE; + warned = TRUE; } } return WINED3D_OK; @@ -5821,10 +5836,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetNPatchMode(IWineD3DDevice *iface, static float WINAPI IWineD3DDeviceImpl_GetNPatchMode(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - static BOOL showfixmes = TRUE; - if( showfixmes) { + static BOOL warned; + if (!warned) + { FIXME("(%p) : stub returning(%f)\n", This, 0.0f); - showfixmes = FALSE; + warned = TRUE; } return 0.0f; } @@ -6746,7 +6762,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* i This->cursorHeight = pSur->currentDesc.Height; if (SUCCEEDED(IWineD3DSurface_LockRect(pCursorBitmap, &rect, NULL, WINED3DLOCK_READONLY))) { - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; const StaticPixelFormatDesc *tableEntry = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &GLINFO_LOCATION, &glDesc); char *mem, *bits = (char *)rect.pBits; GLint intfmt = glDesc->glInternal; diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 31d71be72de..cb66128fa7a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -154,8 +154,16 @@ static const shader_backend_t *select_shader_backend(UINT Adapter, WINED3DDEVTYP static const struct blit_shader *select_blit_implementation(UINT Adapter, WINED3DDEVTYPE DeviceType); /* lookup tables */ -int minLookup[MAX_LOOKUPS]; -int maxLookup[MAX_LOOKUPS]; +const int minLookup[MAX_LOOKUPS] = +{ + WINED3DTADDRESS_WRAP, /* WINELOOKUP_WARPPARAM */ +}; + +const int maxLookup[MAX_LOOKUPS] = +{ + WINED3DTADDRESS_MIRRORONCE, /* WINELOOKUP_WARPPARAM */ +}; + DWORD *stateLookup[MAX_LOOKUPS]; struct min_lookup minMipLookup[WINED3DTEXF_ANISOTROPIC + 1]; @@ -368,12 +376,8 @@ static ULONG WINAPI IWineD3DImpl_Release(IWineD3D *iface) { /* Set the shader type for this device, depending on the given capabilities, * the device type, and the user preferences in wined3d_settings */ -void select_shader_mode( - WineD3D_GL_Info *gl_info, - WINED3DDEVTYPE DeviceType, - int* ps_selected, - int* vs_selected) { - +static void select_shader_mode(const WineD3D_GL_Info *gl_info, WINED3DDEVTYPE DeviceType, int *ps_selected, int *vs_selected) +{ if (wined3d_settings.vs_mode == VS_NONE) { *vs_selected = SHADER_NONE; } else if (gl_info->supported[ARB_VERTEX_SHADER] && wined3d_settings.glslRequested) { @@ -451,7 +455,8 @@ static void select_shader_max_constants( **********************************************************/ #define GLINFO_LOCATION (*gl_info) -static inline BOOL test_arb_vs_offset_limit(WineD3D_GL_Info *gl_info) { +static inline BOOL test_arb_vs_offset_limit(const WineD3D_GL_Info *gl_info) +{ GLuint prog; BOOL ret = FALSE; const char *testcode = @@ -495,7 +500,7 @@ static DWORD ver_for_ext(GL_SupportedExt ext) return 0; } -BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { +static BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { const char *GL_Extensions = NULL; const char *WGL_Extensions = NULL; const char *gl_string = NULL; @@ -1342,11 +1347,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { else gl_info->vidmem = WINE_DEFAULT_VIDMEM; - /* Load all the lookup tables - TODO: It may be a good idea to make minLookup and maxLookup const and populate them in wined3d_private.h where they are declared */ - minLookup[WINELOOKUP_WARPPARAM] = WINED3DTADDRESS_WRAP; - maxLookup[WINELOOKUP_WARPPARAM] = WINED3DTADDRESS_MIRRORONCE; - + /* Load all the lookup tables */ for (i = 0; i < MAX_LOOKUPS; i++) { stateLookup[i] = HeapAlloc(GetProcessHeap(), 0, sizeof(*stateLookup[i]) * (1 + maxLookup[i] - minLookup[i]) ); } @@ -1775,7 +1776,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDepthStencilMatch(IWineD3D *iface, UINT WINED3DFORMAT DepthStencilFormat) { IWineD3DImpl *This = (IWineD3DImpl *)iface; int nCfgs; - WineD3D_PixelFormat *cfgs; + const WineD3D_PixelFormat *cfgs; int it; WARN_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, DevType:(%x,%s), AdptFmt:(%x,%s), RendrTgtFmt:(%x,%s), DepthStencilFmt:(%x,%s))\n", @@ -1810,7 +1811,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, U BOOL Windowed, WINED3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) { IWineD3DImpl *This = (IWineD3DImpl *)iface; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; const StaticPixelFormatDesc *desc; TRACE_(d3d_caps)("(%p)-> (Adptr:%d, DevType:(%x,%s), SurfFmt:(%x,%s), Win?%d, MultiSamp:%x, pQual:%p)\n", @@ -1843,7 +1844,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, U if(glDesc->Flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) { int i, nCfgs; - WineD3D_PixelFormat *cfgs; + const WineD3D_PixelFormat *cfgs; cfgs = Adapters[Adapter].cfgs; nCfgs = Adapters[Adapter].nCfgs; @@ -1864,7 +1865,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, U else if(glDesc->Flags & WINED3DFMT_FLAG_RENDERTARGET) { short redSize, greenSize, blueSize, alphaSize, colorBits; int i, nCfgs; - WineD3D_PixelFormat *cfgs; + const WineD3D_PixelFormat *cfgs; if(!getColorBits(SurfaceFormat, &redSize, &greenSize, &blueSize, &alphaSize, &colorBits)) { ERR("Unable to color bits for format %#x, can't check multisampling capability!\n", SurfaceFormat); @@ -1985,7 +1986,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter static BOOL CheckBumpMapCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINED3DFORMAT CheckFormat) { const struct fragment_pipeline *fp; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; switch(CheckFormat) { case WINED3DFMT_V8U8: @@ -1993,24 +1994,18 @@ static BOOL CheckBumpMapCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE case WINED3DFMT_L6V5U5: case WINED3DFMT_X8L8V8U8: case WINED3DFMT_Q8W8V8U8: + /* Ask the fixed function pipeline implementation if it can deal + * with the conversion. If we've got a GL extension giving native + * support this will be an identity conversion. */ getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc); - if(glDesc->conversion_group == WINED3DFMT_UNKNOWN) { - /* We have a GL extension giving native support */ - TRACE_(d3d_caps)("[OK]\n"); - return TRUE; - } - - /* No native support: Ask the fixed function pipeline implementation if it - * can deal with the conversion - */ fp = select_fragment_implementation(Adapter, DeviceType); - if(fp->conv_supported(CheckFormat)) { + if (fp->color_fixup_supported(glDesc->color_fixup)) + { TRACE_(d3d_caps)("[OK]\n"); return TRUE; - } else { - TRACE_(d3d_caps)("[FAILED]\n"); - return FALSE; } + TRACE_(d3d_caps)("[FAILED]\n"); + return FALSE; default: TRACE_(d3d_caps)("[FAILED]\n"); @@ -2022,7 +2017,7 @@ static BOOL CheckBumpMapCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE static BOOL CheckDepthStencilCapability(UINT Adapter, WINED3DFORMAT DisplayFormat, WINED3DFORMAT DepthStencilFormat) { int it=0; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; const StaticPixelFormatDesc *desc = getFormatDescEntry(DepthStencilFormat, &GLINFO_LOCATION, &glDesc); /* Fail if we weren't able to get a description of the format */ @@ -2048,7 +2043,7 @@ static BOOL CheckDepthStencilCapability(UINT Adapter, WINED3DFORMAT DisplayForma static BOOL CheckFilterCapability(UINT Adapter, WINED3DFORMAT CheckFormat) { - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; const StaticPixelFormatDesc *desc = getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc); /* Fail if we weren't able to get a description of the format */ @@ -2066,7 +2061,7 @@ static BOOL CheckFilterCapability(UINT Adapter, WINED3DFORMAT CheckFormat) static BOOL CheckRenderTargetCapability(WINED3DFORMAT AdapterFormat, WINED3DFORMAT CheckFormat) { UINT Adapter = 0; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; const StaticPixelFormatDesc *desc = getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc); /* Fail if we weren't able to get a description of the format */ @@ -2173,7 +2168,7 @@ static BOOL CheckSrgbWriteCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WI /* Check if a format support blending in combination with pixel shaders */ static BOOL CheckPostPixelShaderBlendingCapability(UINT Adapter, WINED3DFORMAT CheckFormat) { - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; const StaticPixelFormatDesc *desc = getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc); /* Fail if we weren't able to get a description of the format */ @@ -2205,7 +2200,7 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE { const shader_backend_t *shader_backend; const struct fragment_pipeline *fp; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; switch (CheckFormat) { @@ -2280,25 +2275,18 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE case WINED3DFMT_L6V5U5: case WINED3DFMT_Q8W8V8U8: case WINED3DFMT_V16U16: - case WINED3DFMT_W11V11U10: + /* Ask the shader backend if it can deal with the conversion. If + * we've got a GL extension giving native support this will be an + * identity conversion. */ getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc); - if(glDesc->conversion_group == WINED3DFMT_UNKNOWN) { - /* We have a GL extension giving native support */ - TRACE_(d3d_caps)("[OK]\n"); - return TRUE; - } - - /* No native support: Ask the fixed function pipeline implementation if it - * can deal with the conversion - */ shader_backend = select_shader_backend(Adapter, DeviceType); - if(shader_backend->shader_conv_supported(CheckFormat)) { + if (shader_backend->shader_color_fixup_supported(glDesc->color_fixup)) + { TRACE_(d3d_caps)("[OK]\n"); return TRUE; - } else { - TRACE_(d3d_caps)("[FAILED]\n"); - return FALSE; } + TRACE_(d3d_caps)("[FAILED]\n"); + return FALSE; case WINED3DFMT_DXT1: case WINED3DFMT_DXT2: @@ -2321,6 +2309,7 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE case WINED3DFMT_INDEX32: case WINED3DFMT_Q16W16V16U16: case WINED3DFMT_A2W10V10U10: + case WINED3DFMT_W11V11U10: TRACE_(d3d_caps)("[FAILED]\n"); /* Enable when implemented */ return FALSE; @@ -2403,10 +2392,12 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE /* Vendor specific formats */ case WINED3DFMT_ATI2N: if(GL_SUPPORT(ATI_TEXTURE_COMPRESSION_3DC) || GL_SUPPORT(EXT_TEXTURE_COMPRESSION_RGTC)) { + getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &glDesc); shader_backend = select_shader_backend(Adapter, DeviceType); fp = select_fragment_implementation(Adapter, DeviceType); - if(shader_backend->shader_conv_supported(CheckFormat) && - fp->conv_supported(CheckFormat)) { + if (shader_backend->shader_color_fixup_supported(glDesc->color_fixup) + && fp->color_fixup_supported(glDesc->color_fixup)) + { TRACE_(d3d_caps)("[OK]\n"); return TRUE; } @@ -2439,6 +2430,7 @@ static BOOL CheckTextureCapability(UINT Adapter, WINED3DDEVTYPE DeviceType, WINE } static BOOL CheckSurfaceCapability(UINT Adapter, WINED3DFORMAT AdapterFormat, WINED3DDEVTYPE DeviceType, WINED3DFORMAT CheckFormat, WINED3DSURFTYPE SurfaceType) { + const struct GlPixelFormatDesc *format_desc; const struct blit_shader *blitter; if(SurfaceType == SURFACE_GDI) { @@ -2475,8 +2467,10 @@ static BOOL CheckSurfaceCapability(UINT Adapter, WINED3DFORMAT AdapterFormat, WI if(CheckDepthStencilCapability(Adapter, AdapterFormat, CheckFormat)) return TRUE; /* If opengl can't process the format natively, the blitter may be able to convert it */ + getFormatDescEntry(CheckFormat, &GLINFO_LOCATION, &format_desc); blitter = select_blit_implementation(Adapter, DeviceType); - if(blitter->conv_supported(CheckFormat)) { + if (blitter->color_fixup_supported(format_desc->color_fixup)) + { TRACE_(d3d_caps)("[OK]\n"); return TRUE; } @@ -3746,7 +3740,8 @@ ULONG WINAPI D3DCB_DefaultDestroyVolume(IWineD3DVolume *pVolume) { return IUnknown_Release(volumeParent); } -static BOOL implementation_is_apple(WineD3D_GL_Info *gl_info) { +static BOOL implementation_is_apple(const WineD3D_GL_Info *gl_info) +{ /* MacOS has various specialities in the extensions it advertises. Some have to be loaded from * the opengl 1.2+ core, while other extensions are advertised, but software emulated. So try to * detect the Apple OpenGL implementation to apply some extension fixups afterwards. @@ -3985,12 +3980,14 @@ static void fixup_extensions(WineD3D_GL_Info *gl_info) { } } -static void WINE_GLAPI invalid_func(void *data) { +static void WINE_GLAPI invalid_func(const void *data) +{ ERR("Invalid vertex attribute function called\n"); DebugBreak(); } -static void WINE_GLAPI invalid_texcoord_func(GLenum unit, void * data) { +static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data) +{ ERR("Invalid texcoord function called\n"); DebugBreak(); } @@ -4000,8 +3997,9 @@ static void WINE_GLAPI invalid_texcoord_func(GLenum unit, void * data) { /* Helper functions for providing vertex data to opengl. The arrays are initialized based on * the extension detection and are used in drawStridedSlow */ -static void WINE_GLAPI position_d3dcolor(void *data) { - DWORD pos = *((DWORD *) data); +static void WINE_GLAPI position_d3dcolor(const void *data) +{ + DWORD pos = *((const DWORD *)data); FIXME("Add a test for fixed function position from d3dcolor type\n"); glVertex4s(D3DCOLOR_B_R(pos), @@ -4009,8 +4007,10 @@ static void WINE_GLAPI position_d3dcolor(void *data) { D3DCOLOR_B_B(pos), D3DCOLOR_B_A(pos)); } -static void WINE_GLAPI position_float4(void *data) { - GLfloat *pos = (float *) data; + +static void WINE_GLAPI position_float4(const void *data) +{ + const GLfloat *pos = data; if (pos[3] < eps && pos[3] > -eps) glVertex3fv(pos); @@ -4021,8 +4021,9 @@ static void WINE_GLAPI position_float4(void *data) { } } -static void WINE_GLAPI diffuse_d3dcolor(void *data) { - DWORD diffuseColor = *((DWORD *) data); +static void WINE_GLAPI diffuse_d3dcolor(const void *data) +{ + DWORD diffuseColor = *((const DWORD *)data); glColor4ub(D3DCOLOR_B_R(diffuseColor), D3DCOLOR_B_G(diffuseColor), @@ -4030,148 +4031,152 @@ static void WINE_GLAPI diffuse_d3dcolor(void *data) { D3DCOLOR_B_A(diffuseColor)); } -static void WINE_GLAPI specular_d3dcolor(void *data) { - DWORD specularColor = *((DWORD *) data); +static void WINE_GLAPI specular_d3dcolor(const void *data) +{ + DWORD specularColor = *((const DWORD *)data); GL_EXTCALL(glSecondaryColor3ubEXT)(D3DCOLOR_B_R(specularColor), D3DCOLOR_B_G(specularColor), D3DCOLOR_B_B(specularColor)); } -static void WINE_GLAPI warn_no_specular_func(void *data) { + +static void WINE_GLAPI warn_no_specular_func(const void *data) +{ WARN("GL_EXT_secondary_color not supported\n"); } -void fillGLAttribFuncs(WineD3D_GL_Info *gl_info) { - position_funcs[WINED3DDECLTYPE_FLOAT1] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_FLOAT2] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_FLOAT3] = (void *) glVertex3fv; - position_funcs[WINED3DDECLTYPE_FLOAT4] = (void *) position_float4; - position_funcs[WINED3DDECLTYPE_D3DCOLOR] = (void *) position_d3dcolor; - position_funcs[WINED3DDECLTYPE_UBYTE4] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_SHORT2] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_SHORT4] = (void *) glVertex2sv; - position_funcs[WINED3DDECLTYPE_UBYTE4N] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_SHORT2N] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_SHORT4N] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_USHORT2N] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_USHORT4N] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_UDEC3] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_DEC3N] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_FLOAT16_2] = (void *) invalid_func; - position_funcs[WINED3DDECLTYPE_FLOAT16_4] = (void *) invalid_func; - - diffuse_funcs[WINED3DDECLTYPE_FLOAT1] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_FLOAT2] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_FLOAT3] = (void *) glColor3fv; - diffuse_funcs[WINED3DDECLTYPE_FLOAT4] = (void *) glColor4fv; - diffuse_funcs[WINED3DDECLTYPE_D3DCOLOR] = (void *) diffuse_d3dcolor; - diffuse_funcs[WINED3DDECLTYPE_UBYTE4] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_SHORT2] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_SHORT4] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_UBYTE4N] = (void *) glColor4ubv; - diffuse_funcs[WINED3DDECLTYPE_SHORT2N] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_SHORT4N] = (void *) glColor4sv; - diffuse_funcs[WINED3DDECLTYPE_USHORT2N] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_USHORT4N] = (void *) glColor4usv; - diffuse_funcs[WINED3DDECLTYPE_UDEC3] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_DEC3N] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_FLOAT16_2] = (void *) invalid_func; - diffuse_funcs[WINED3DDECLTYPE_FLOAT16_4] = (void *) invalid_func; +static void fillGLAttribFuncs(const WineD3D_GL_Info *gl_info) +{ + position_funcs[WINED3DDECLTYPE_FLOAT1] = invalid_func; + position_funcs[WINED3DDECLTYPE_FLOAT2] = invalid_func; + position_funcs[WINED3DDECLTYPE_FLOAT3] = (glAttribFunc)glVertex3fv; + position_funcs[WINED3DDECLTYPE_FLOAT4] = position_float4; + position_funcs[WINED3DDECLTYPE_D3DCOLOR] = position_d3dcolor; + position_funcs[WINED3DDECLTYPE_UBYTE4] = invalid_func; + position_funcs[WINED3DDECLTYPE_SHORT2] = invalid_func; + position_funcs[WINED3DDECLTYPE_SHORT4] = (glAttribFunc)glVertex2sv; + position_funcs[WINED3DDECLTYPE_UBYTE4N] = invalid_func; + position_funcs[WINED3DDECLTYPE_SHORT2N] = invalid_func; + position_funcs[WINED3DDECLTYPE_SHORT4N] = invalid_func; + position_funcs[WINED3DDECLTYPE_USHORT2N] = invalid_func; + position_funcs[WINED3DDECLTYPE_USHORT4N] = invalid_func; + position_funcs[WINED3DDECLTYPE_UDEC3] = invalid_func; + position_funcs[WINED3DDECLTYPE_DEC3N] = invalid_func; + position_funcs[WINED3DDECLTYPE_FLOAT16_2] = invalid_func; + position_funcs[WINED3DDECLTYPE_FLOAT16_4] = invalid_func; + + diffuse_funcs[WINED3DDECLTYPE_FLOAT1] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_FLOAT2] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_FLOAT3] = (glAttribFunc)glColor3fv; + diffuse_funcs[WINED3DDECLTYPE_FLOAT4] = (glAttribFunc)glColor4fv; + diffuse_funcs[WINED3DDECLTYPE_D3DCOLOR] = diffuse_d3dcolor; + diffuse_funcs[WINED3DDECLTYPE_UBYTE4] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_SHORT2] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_SHORT4] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_UBYTE4N] = (glAttribFunc)glColor4ubv; + diffuse_funcs[WINED3DDECLTYPE_SHORT2N] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_SHORT4N] = (glAttribFunc)glColor4sv; + diffuse_funcs[WINED3DDECLTYPE_USHORT2N] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_USHORT4N] = (glAttribFunc)glColor4usv; + diffuse_funcs[WINED3DDECLTYPE_UDEC3] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_DEC3N] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_FLOAT16_2] = invalid_func; + diffuse_funcs[WINED3DDECLTYPE_FLOAT16_4] = invalid_func; /* No 4 component entry points here */ - specular_funcs[WINED3DDECLTYPE_FLOAT1] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_FLOAT2] = (void *) invalid_func; + specular_funcs[WINED3DDECLTYPE_FLOAT1] = invalid_func; + specular_funcs[WINED3DDECLTYPE_FLOAT2] = invalid_func; if(GL_SUPPORT(EXT_SECONDARY_COLOR)) { - specular_funcs[WINED3DDECLTYPE_FLOAT3] = (void *) GL_EXTCALL(glSecondaryColor3fvEXT); + specular_funcs[WINED3DDECLTYPE_FLOAT3] = (glAttribFunc)GL_EXTCALL(glSecondaryColor3fvEXT); } else { - specular_funcs[WINED3DDECLTYPE_FLOAT3] = (void *) warn_no_specular_func; + specular_funcs[WINED3DDECLTYPE_FLOAT3] = warn_no_specular_func; } - specular_funcs[WINED3DDECLTYPE_FLOAT4] = (void *) invalid_func; + specular_funcs[WINED3DDECLTYPE_FLOAT4] = invalid_func; if(GL_SUPPORT(EXT_SECONDARY_COLOR)) { - specular_funcs[WINED3DDECLTYPE_D3DCOLOR] = (void *) specular_d3dcolor; + specular_funcs[WINED3DDECLTYPE_D3DCOLOR] = specular_d3dcolor; } else { - specular_funcs[WINED3DDECLTYPE_D3DCOLOR] = (void *) warn_no_specular_func; + specular_funcs[WINED3DDECLTYPE_D3DCOLOR] = warn_no_specular_func; } - specular_funcs[WINED3DDECLTYPE_UBYTE4] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_SHORT2] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_SHORT4] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_UBYTE4N] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_SHORT2N] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_SHORT4N] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_USHORT2N] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_USHORT4N] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_UDEC3] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_DEC3N] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_FLOAT16_2] = (void *) invalid_func; - specular_funcs[WINED3DDECLTYPE_FLOAT16_4] = (void *) invalid_func; + specular_funcs[WINED3DDECLTYPE_UBYTE4] = invalid_func; + specular_funcs[WINED3DDECLTYPE_SHORT2] = invalid_func; + specular_funcs[WINED3DDECLTYPE_SHORT4] = invalid_func; + specular_funcs[WINED3DDECLTYPE_UBYTE4N] = invalid_func; + specular_funcs[WINED3DDECLTYPE_SHORT2N] = invalid_func; + specular_funcs[WINED3DDECLTYPE_SHORT4N] = invalid_func; + specular_funcs[WINED3DDECLTYPE_USHORT2N] = invalid_func; + specular_funcs[WINED3DDECLTYPE_USHORT4N] = invalid_func; + specular_funcs[WINED3DDECLTYPE_UDEC3] = invalid_func; + specular_funcs[WINED3DDECLTYPE_DEC3N] = invalid_func; + specular_funcs[WINED3DDECLTYPE_FLOAT16_2] = invalid_func; + specular_funcs[WINED3DDECLTYPE_FLOAT16_4] = invalid_func; /* Only 3 component entry points here. Test how others behave. Float4 normals are used * by one of our tests, trying to pass it to the pixel shader, which fails on Windows. */ - normal_funcs[WINED3DDECLTYPE_FLOAT1] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_FLOAT2] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_FLOAT3] = (void *) glNormal3fv; - normal_funcs[WINED3DDECLTYPE_FLOAT4] = (void *) glNormal3fv; /* Just ignore the 4th value */ - normal_funcs[WINED3DDECLTYPE_D3DCOLOR] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_UBYTE4] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_SHORT2] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_SHORT4] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_UBYTE4N] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_SHORT2N] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_SHORT4N] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_USHORT2N] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_USHORT4N] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_UDEC3] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_DEC3N] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_FLOAT16_2] = (void *) invalid_func; - normal_funcs[WINED3DDECLTYPE_FLOAT16_4] = (void *) invalid_func; - - multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT1] = (void *) GL_EXTCALL(glMultiTexCoord1fvARB); - multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT2] = (void *) GL_EXTCALL(glMultiTexCoord2fvARB); - multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT3] = (void *) GL_EXTCALL(glMultiTexCoord3fvARB); - multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT4] = (void *) GL_EXTCALL(glMultiTexCoord4fvARB); - multi_texcoord_funcs[WINED3DDECLTYPE_D3DCOLOR] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_UBYTE4] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_SHORT2] = (void *) GL_EXTCALL(glMultiTexCoord2svARB); - multi_texcoord_funcs[WINED3DDECLTYPE_SHORT4] = (void *) GL_EXTCALL(glMultiTexCoord4svARB); - multi_texcoord_funcs[WINED3DDECLTYPE_UBYTE4N] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_SHORT2N] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_SHORT4N] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_USHORT2N] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_USHORT4N] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_UDEC3] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_DEC3N] = (void *) invalid_texcoord_func; + normal_funcs[WINED3DDECLTYPE_FLOAT1] = invalid_func; + normal_funcs[WINED3DDECLTYPE_FLOAT2] = invalid_func; + normal_funcs[WINED3DDECLTYPE_FLOAT3] = (glAttribFunc)glNormal3fv; + normal_funcs[WINED3DDECLTYPE_FLOAT4] = (glAttribFunc)glNormal3fv; /* Just ignore the 4th value */ + normal_funcs[WINED3DDECLTYPE_D3DCOLOR] = invalid_func; + normal_funcs[WINED3DDECLTYPE_UBYTE4] = invalid_func; + normal_funcs[WINED3DDECLTYPE_SHORT2] = invalid_func; + normal_funcs[WINED3DDECLTYPE_SHORT4] = invalid_func; + normal_funcs[WINED3DDECLTYPE_UBYTE4N] = invalid_func; + normal_funcs[WINED3DDECLTYPE_SHORT2N] = invalid_func; + normal_funcs[WINED3DDECLTYPE_SHORT4N] = invalid_func; + normal_funcs[WINED3DDECLTYPE_USHORT2N] = invalid_func; + normal_funcs[WINED3DDECLTYPE_USHORT4N] = invalid_func; + normal_funcs[WINED3DDECLTYPE_UDEC3] = invalid_func; + normal_funcs[WINED3DDECLTYPE_DEC3N] = invalid_func; + normal_funcs[WINED3DDECLTYPE_FLOAT16_2] = invalid_func; + normal_funcs[WINED3DDECLTYPE_FLOAT16_4] = invalid_func; + + multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT1] = (glMultiTexCoordFunc)GL_EXTCALL(glMultiTexCoord1fvARB); + multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT2] = (glMultiTexCoordFunc)GL_EXTCALL(glMultiTexCoord2fvARB); + multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT3] = (glMultiTexCoordFunc)GL_EXTCALL(glMultiTexCoord3fvARB); + multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT4] = (glMultiTexCoordFunc)GL_EXTCALL(glMultiTexCoord4fvARB); + multi_texcoord_funcs[WINED3DDECLTYPE_D3DCOLOR] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_UBYTE4] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_SHORT2] = (glMultiTexCoordFunc)GL_EXTCALL(glMultiTexCoord2svARB); + multi_texcoord_funcs[WINED3DDECLTYPE_SHORT4] = (glMultiTexCoordFunc)GL_EXTCALL(glMultiTexCoord4svARB); + multi_texcoord_funcs[WINED3DDECLTYPE_UBYTE4N] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_SHORT2N] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_SHORT4N] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_USHORT2N] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_USHORT4N] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_UDEC3] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_DEC3N] = invalid_texcoord_func; if (GL_SUPPORT(NV_HALF_FLOAT)) { - multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT16_2] = (void *) GL_EXTCALL(glMultiTexCoord2hvNV); - multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT16_4] = (void *) GL_EXTCALL(glMultiTexCoord4hvNV); + multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT16_2] = (glMultiTexCoordFunc)GL_EXTCALL(glMultiTexCoord2hvNV); + multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT16_4] = (glMultiTexCoordFunc)GL_EXTCALL(glMultiTexCoord4hvNV); } else { - multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT16_2] = (void *) invalid_texcoord_func; - multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT16_4] = (void *) invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT16_2] = invalid_texcoord_func; + multi_texcoord_funcs[WINED3DDECLTYPE_FLOAT16_4] = invalid_texcoord_func; } - texcoord_funcs[WINED3DDECLTYPE_FLOAT1] = (void *) glTexCoord1fv; - texcoord_funcs[WINED3DDECLTYPE_FLOAT2] = (void *) glTexCoord2fv; - texcoord_funcs[WINED3DDECLTYPE_FLOAT3] = (void *) glTexCoord3fv; - texcoord_funcs[WINED3DDECLTYPE_FLOAT4] = (void *) glTexCoord4fv; - texcoord_funcs[WINED3DDECLTYPE_D3DCOLOR] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_UBYTE4] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_SHORT2] = (void *) glTexCoord2sv; - texcoord_funcs[WINED3DDECLTYPE_SHORT4] = (void *) glTexCoord4sv; - texcoord_funcs[WINED3DDECLTYPE_UBYTE4N] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_SHORT2N] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_SHORT4N] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_USHORT2N] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_USHORT4N] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_UDEC3] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_DEC3N] = (void *) invalid_func; + texcoord_funcs[WINED3DDECLTYPE_FLOAT1] = (glAttribFunc)glTexCoord1fv; + texcoord_funcs[WINED3DDECLTYPE_FLOAT2] = (glAttribFunc)glTexCoord2fv; + texcoord_funcs[WINED3DDECLTYPE_FLOAT3] = (glAttribFunc)glTexCoord3fv; + texcoord_funcs[WINED3DDECLTYPE_FLOAT4] = (glAttribFunc)glTexCoord4fv; + texcoord_funcs[WINED3DDECLTYPE_D3DCOLOR] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_UBYTE4] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_SHORT2] = (glAttribFunc)glTexCoord2sv; + texcoord_funcs[WINED3DDECLTYPE_SHORT4] = (glAttribFunc)glTexCoord4sv; + texcoord_funcs[WINED3DDECLTYPE_UBYTE4N] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_SHORT2N] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_SHORT4N] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_USHORT2N] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_USHORT4N] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_UDEC3] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_DEC3N] = invalid_func; if (GL_SUPPORT(NV_HALF_FLOAT)) { - texcoord_funcs[WINED3DDECLTYPE_FLOAT16_2] = (void *) GL_EXTCALL(glTexCoord2hvNV); - texcoord_funcs[WINED3DDECLTYPE_FLOAT16_4] = (void *) GL_EXTCALL(glTexCoord4hvNV); + texcoord_funcs[WINED3DDECLTYPE_FLOAT16_2] = (glAttribFunc)GL_EXTCALL(glTexCoord2hvNV); + texcoord_funcs[WINED3DDECLTYPE_FLOAT16_4] = (glAttribFunc)GL_EXTCALL(glTexCoord4hvNV); } else { - texcoord_funcs[WINED3DDECLTYPE_FLOAT16_2] = (void *) invalid_func; - texcoord_funcs[WINED3DDECLTYPE_FLOAT16_4] = (void *) invalid_func; + texcoord_funcs[WINED3DDECLTYPE_FLOAT16_2] = invalid_func; + texcoord_funcs[WINED3DDECLTYPE_FLOAT16_4] = invalid_func; } } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index d996bc6c032..28b6c307666 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -142,14 +142,14 @@ void primitiveDeclarationConvertToStridedData( /* We need to deal with frequency data!*/ - BYTE *data = NULL; + const BYTE *data = NULL; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DVertexDeclarationImpl* vertexDeclaration = (IWineD3DVertexDeclarationImpl *)This->stateBlock->vertexDecl; unsigned int i; - WINED3DVERTEXELEMENT *element; + const WINED3DVERTEXELEMENT *element; DWORD stride; DWORD numPreloadStreams = This->stateBlock->streamIsUP ? 0 : vertexDeclaration->num_streams; - DWORD *streams = vertexDeclaration->streams; + const DWORD *streams = vertexDeclaration->streams; /* Check for transformed vertices, disable vertex shader if present */ strided->u.s.position_transformed = vertexDeclaration->position_transformed; @@ -286,21 +286,22 @@ static void drawStridedFast(IWineD3DDevice *iface,UINT numberOfVertices, GLenum * Slower GL version which extracts info about each vertex in turn */ -static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData *sd, - UINT NumVertexes, GLenum glPrimType, - const void *idxData, short idxSize, ULONG minIndex, ULONG startIdx, ULONG startVertex) { - +static void drawStridedSlow(IWineD3DDevice *iface, const WineDirect3DVertexStridedData *sd, UINT NumVertexes, + GLenum glPrimType, const void *idxData, short idxSize, ULONG minIndex, ULONG startIdx, ULONG startVertex) +{ unsigned int textureNo = 0; const WORD *pIdxBufS = NULL; const DWORD *pIdxBufL = NULL; ULONG vx_index; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - UINT *streamOffset = This->stateBlock->streamOffset; + const UINT *streamOffset = This->stateBlock->streamOffset; long SkipnStrides = startVertex + This->stateBlock->loadBaseVertexIndex; BOOL pixelShader = use_ps(This); - - BYTE *texCoords[WINED3DDP_MAXTEXCOORD]; - BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL; + BOOL specular_fog = FALSE; + UINT texture_stages = GL_LIMITS(texture_stages); + const BYTE *texCoords[WINED3DDP_MAXTEXCOORD]; + const BYTE *diffuse = NULL, *specular = NULL, *normal = NULL, *position = NULL; + DWORD tex_mask = 0; TRACE("Using slow vertex array code\n"); @@ -321,56 +322,92 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData return; } - /* Adding the stream offset once is cheaper than doing it every iteration. Do not modify the strided data, it is a pointer - * to the strided Data in the device and might be needed intact on the next draw - */ - for (textureNo = 0; textureNo < GL_LIMITS(texture_stages); ++textureNo) { - if(sd->u.s.texCoords[textureNo].lpData) { - texCoords[textureNo] = sd->u.s.texCoords[textureNo].lpData + streamOffset[sd->u.s.texCoords[textureNo].streamNo]; - } else { - texCoords[textureNo] = NULL; - } - } - if(sd->u.s.diffuse.lpData) { - diffuse = sd->u.s.diffuse.lpData + streamOffset[sd->u.s.diffuse.streamNo]; - } - if(sd->u.s.specular.lpData) { + /* Start drawing in GL */ + VTRACE(("glBegin(%x)\n", glPrimType)); + glBegin(glPrimType); + + if (sd->u.s.position.lpData) position = sd->u.s.position.lpData + streamOffset[sd->u.s.position.streamNo]; + + if (sd->u.s.normal.lpData) normal = sd->u.s.normal.lpData + streamOffset[sd->u.s.normal.streamNo]; + else glNormal3f(0, 0, 0); + + if (sd->u.s.diffuse.lpData) diffuse = sd->u.s.diffuse.lpData + streamOffset[sd->u.s.diffuse.streamNo]; + else glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + if (This->activeContext->num_untracked_materials && sd->u.s.diffuse.dwType != WINED3DDECLTYPE_D3DCOLOR) + FIXME("Implement diffuse color tracking from %s\n", debug_d3ddecltype(sd->u.s.diffuse.dwType)); + + if (sd->u.s.specular.lpData) + { specular = sd->u.s.specular.lpData + streamOffset[sd->u.s.specular.streamNo]; - } - if(sd->u.s.normal.lpData) { - normal = sd->u.s.normal.lpData + streamOffset[sd->u.s.normal.streamNo]; - } - if(sd->u.s.position.lpData) { - position = sd->u.s.position.lpData + streamOffset[sd->u.s.position.streamNo]; - } - if(FIXME_ON(d3d_draw)) { - if(specular && This->stateBlock->renderState[WINED3DRS_FOGENABLE] && - (This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE || sd->u.s.position_transformed )&& - This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) { - if(GL_SUPPORT(EXT_FOG_COORD) && sd->u.s.specular.dwType != WINED3DDECLTYPE_D3DCOLOR) { - FIXME("Implement fog coordinates from %s\n", debug_d3ddecltype(sd->u.s.specular.dwType)); + /* special case where the fog density is stored in the specular alpha channel */ + if (This->stateBlock->renderState[WINED3DRS_FOGENABLE] + && (This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE + || sd->u.s.position.dwType == WINED3DDECLTYPE_FLOAT4) + && This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) + { + if (GL_SUPPORT(EXT_FOG_COORD)) + { + if (sd->u.s.specular.dwType == WINED3DDECLTYPE_D3DCOLOR) specular_fog = TRUE; + else FIXME("Implement fog coordinates from %s\n", debug_d3ddecltype(sd->u.s.specular.dwType)); + } + else + { + static BOOL warned; + + if (!warned) + { + /* TODO: Use the fog table code from old ddraw */ + FIXME("Implement fog for transformed vertices in software\n"); + warned = TRUE; + } } } - if(This->activeContext->num_untracked_materials && sd->u.s.diffuse.dwType != WINED3DDECLTYPE_D3DCOLOR) { - FIXME("Implement diffuse color tracking from %s\n", debug_d3ddecltype(sd->u.s.diffuse.dwType)); - } + } + else if (GL_SUPPORT(EXT_SECONDARY_COLOR)) + { + GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0); } - /* Start drawing in GL */ - VTRACE(("glBegin(%x)\n", glPrimType)); - glBegin(glPrimType); + for (textureNo = 0; textureNo < texture_stages; ++textureNo) + { + int coordIdx = This->stateBlock->textureState[textureNo][WINED3DTSS_TEXCOORDINDEX]; + int texture_idx = This->texUnitMap[textureNo]; - /* Default settings for data that is not passed */ - if (sd->u.s.normal.lpData == NULL) { - glNormal3f(0, 0, 0); - } - if(sd->u.s.diffuse.lpData == NULL) { - glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - } - if(sd->u.s.specular.lpData == NULL) { - if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { - GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0); + if (!GL_SUPPORT(ARB_MULTITEXTURE) && textureNo > 0) + { + FIXME("Program using multiple concurrent textures which this opengl implementation doesn't support\n"); + continue; + } + + if (!pixelShader && !This->stateBlock->textures[textureNo]) continue; + + if (texture_idx == -1) continue; + + if (coordIdx > 7) + { + TRACE("tex: %d - Skip tex coords, as being system generated\n", textureNo); + continue; + } + else if (coordIdx < 0) + { + FIXME("tex: %d - Coord index %d is less than zero, expect a crash.\n", textureNo, coordIdx); + continue; + } + + if(sd->u.s.texCoords[textureNo].lpData) + { + texCoords[textureNo] = + sd->u.s.texCoords[textureNo].lpData + streamOffset[sd->u.s.texCoords[textureNo].streamNo]; + tex_mask |= (1 << textureNo); + } + else + { + TRACE("tex: %d - Skipping tex coords, as no data supplied\n", textureNo); + if (GL_SUPPORT(ARB_MULTITEXTURE)) + GL_EXTCALL(glMultiTexCoord4fARB(GL_TEXTURE0_ARB + texture_idx, 0, 0, 0, 1)); + else + glTexCoord4f(0, 0, 0, 1); } } @@ -380,6 +417,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData /* For each primitive */ for (vx_index = 0; vx_index < NumVertexes; ++vx_index) { + UINT texture, tmp_tex_mask; /* Blending data and Point sizes are not supported by this function. They are not supported by the fixed * function pipeline at all. A Fixme for them is printed after decoding the vertex declaration */ @@ -397,55 +435,35 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData } } - /* Texture coords --------------------------- */ - for (textureNo = 0; textureNo < GL_LIMITS(texture_stages); ++textureNo) { - - if (!GL_SUPPORT(ARB_MULTITEXTURE) && textureNo > 0) { - FIXME("Program using multiple concurrent textures which this opengl implementation doesn't support\n"); - continue ; - } - - /* Query tex coords */ - if (This->stateBlock->textures[textureNo] != NULL || pixelShader) { - int coordIdx = This->stateBlock->textureState[textureNo][WINED3DTSS_TEXCOORDINDEX]; - int texture_idx = This->texUnitMap[textureNo]; - void *ptrToCoords; - - if (coordIdx > 7) { - VTRACE(("tex: %d - Skip tex coords, as being system generated\n", textureNo)); - continue; - } else if (coordIdx < 0) { - FIXME("tex: %d - Coord index %d is less than zero, expect a crash.\n", textureNo, coordIdx); - continue; - } + tmp_tex_mask = tex_mask; + for (texture = 0; tmp_tex_mask; tmp_tex_mask >>= 1, ++texture) + { + int coord_idx; + const void *ptr; - if (texture_idx == -1) continue; + if (!(tmp_tex_mask & 1)) continue; - if (texCoords[coordIdx] == NULL) { - TRACE("tex: %d - Skipping tex coords, as no data supplied\n", textureNo); - if (GL_SUPPORT(ARB_MULTITEXTURE)) { - GL_EXTCALL(glMultiTexCoord4fARB(GL_TEXTURE0_ARB + texture_idx, 0, 0, 0, 1)); - } else { - glTexCoord4f(0, 0, 0, 1); - } - continue; - } + coord_idx = This->stateBlock->textureState[texture][WINED3DTSS_TEXCOORDINDEX]; + ptr = texCoords[coord_idx] + (SkipnStrides * sd->u.s.texCoords[coord_idx].dwStride); - ptrToCoords = texCoords[coordIdx] + (SkipnStrides * sd->u.s.texCoords[coordIdx].dwStride); - if (GL_SUPPORT(ARB_MULTITEXTURE)) - multi_texcoord_funcs[sd->u.s.texCoords[coordIdx].dwType](GL_TEXTURE0_ARB + texture_idx, ptrToCoords); - else - texcoord_funcs[sd->u.s.texCoords[coordIdx].dwType](ptrToCoords); + if (GL_SUPPORT(ARB_MULTITEXTURE)) + { + int texture_idx = This->texUnitMap[texture]; + multi_texcoord_funcs[sd->u.s.texCoords[coord_idx].dwType](GL_TEXTURE0_ARB + texture_idx, ptr); } - } /* End of textures */ + else + { + texcoord_funcs[sd->u.s.texCoords[coord_idx].dwType](ptr); + } + } /* Diffuse -------------------------------- */ if (diffuse) { - DWORD *ptrToCoords = (DWORD *)(diffuse + (SkipnStrides * sd->u.s.diffuse.dwStride)); + const void *ptrToCoords = diffuse + SkipnStrides * sd->u.s.diffuse.dwStride; - diffuse_funcs[sd->u.s.diffuse.dwType]((void *) ptrToCoords); + diffuse_funcs[sd->u.s.diffuse.dwType](ptrToCoords); if(This->activeContext->num_untracked_materials) { - DWORD diffuseColor = ptrToCoords[0]; + DWORD diffuseColor = ((const DWORD *)ptrToCoords)[0]; unsigned char i; float color[4]; @@ -462,37 +480,26 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData /* Specular ------------------------------- */ if (specular) { - DWORD *ptrToCoords = (DWORD *)(specular + (SkipnStrides * sd->u.s.specular.dwStride)); - - /* special case where the fog density is stored in the specular alpha channel */ - if(This->stateBlock->renderState[WINED3DRS_FOGENABLE] && - (This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE || sd->u.s.position.dwType == WINED3DDECLTYPE_FLOAT4 )&& - This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) { - if(GL_SUPPORT(EXT_FOG_COORD)) { - DWORD specularColor = ptrToCoords[0]; - GL_EXTCALL(glFogCoordfEXT(specularColor >> 24)); - } else { - static BOOL warned = FALSE; - if(!warned) { - /* TODO: Use the fog table code from old ddraw */ - FIXME("Implement fog for transformed vertices in software\n"); - warned = TRUE; - } - } - } + const void *ptrToCoords = specular + SkipnStrides * sd->u.s.specular.dwStride; + + specular_funcs[sd->u.s.specular.dwType](ptrToCoords); - specular_funcs[sd->u.s.specular.dwType]((void *) ptrToCoords); + if (specular_fog) + { + DWORD specularColor = *(const DWORD *)ptrToCoords; + GL_EXTCALL(glFogCoordfEXT(specularColor >> 24)); + } } /* Normal -------------------------------- */ if (normal != NULL) { - float *ptrToCoords = (float *)(normal + (SkipnStrides * sd->u.s.normal.dwStride)); + const void *ptrToCoords = normal + SkipnStrides * sd->u.s.normal.dwStride; normal_funcs[sd->u.s.normal.dwType](ptrToCoords); } /* Position -------------------------------- */ if (position) { - float *ptrToCoords = (float *)(position + (SkipnStrides * sd->u.s.position.dwStride)); + const void *ptrToCoords = position + SkipnStrides * sd->u.s.position.dwStride; position_funcs[sd->u.s.position.dwType](ptrToCoords); } @@ -595,10 +602,9 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, const DWORD type, co } } -static void drawStridedSlowVs(IWineD3DDevice *iface, WineDirect3DVertexStridedData *sd, UINT numberOfVertices, - GLenum glPrimitiveType, const void *idxData, short idxSize, ULONG minIndex, ULONG startIdx, - ULONG startVertex) { - +static void drawStridedSlowVs(IWineD3DDevice *iface, const WineDirect3DVertexStridedData *sd, UINT numberOfVertices, + GLenum glPrimitiveType, const void *idxData, short idxSize, ULONG minIndex, ULONG startIdx, ULONG startVertex) +{ IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; long SkipnStrides = startVertex + This->stateBlock->loadBaseVertexIndex; const WORD *pIdxBufS = NULL; @@ -606,7 +612,7 @@ static void drawStridedSlowVs(IWineD3DDevice *iface, WineDirect3DVertexStridedDa ULONG vx_index; int i; IWineD3DStateBlockImpl *stateblock = This->stateBlock; - BYTE *ptr; + const BYTE *ptr; if (idxSize != 0) { /* Immediate mode drawing can't make use of indices in a vbo - get the data from the index buffer. @@ -656,9 +662,10 @@ static void drawStridedSlowVs(IWineD3DDevice *iface, WineDirect3DVertexStridedDa glEnd(); } -static inline void drawStridedInstanced(IWineD3DDevice *iface, WineDirect3DVertexStridedData *sd, UINT numberOfVertices, - GLenum glPrimitiveType, const void *idxData, short idxSize, ULONG minIndex, - ULONG startIdx, ULONG startVertex) { +static inline void drawStridedInstanced(IWineD3DDevice *iface, const WineDirect3DVertexStridedData *sd, + UINT numberOfVertices, GLenum glPrimitiveType, const void *idxData, short idxSize, ULONG minIndex, + ULONG startIdx, ULONG startVertex) +{ UINT numInstances = 0, i; int numInstancedAttribs = 0, j; UINT instancedData[sizeof(sd->u.input) / sizeof(sd->u.input[0]) /* 16 */]; @@ -704,7 +711,7 @@ static inline void drawStridedInstanced(IWineD3DDevice *iface, WineDirect3DVerte for(i = 0; i < numInstances; i++) { /* Specify the instanced attributes using immediate mode calls */ for(j = 0; j < numInstancedAttribs; j++) { - BYTE *ptr = sd->u.input[instancedData[j]].lpData + + const BYTE *ptr = sd->u.input[instancedData[j]].lpData + sd->u.input[instancedData[j]].dwStride * i + stateblock->streamOffset[sd->u.input[instancedData[j]].streamNo]; if(sd->u.input[instancedData[j]].VBO) { @@ -854,7 +861,7 @@ void drawPrimitive(IWineD3DDevice *iface, { GLenum glPrimType; BOOL emulation = FALSE; - WineDirect3DVertexStridedData *strided = &This->strided_streams; + const WineDirect3DVertexStridedData *strided = &This->strided_streams; WineDirect3DVertexStridedData stridedlcl; /* Ok, Work out which primitive is requested and how many vertexes that will be */ @@ -865,10 +872,10 @@ void drawPrimitive(IWineD3DDevice *iface, if(!use_vs(This)) { if(!This->strided_streams.u.s.position_transformed && This->activeContext->num_untracked_materials && This->stateBlock->renderState[WINED3DRS_LIGHTING]) { - static BOOL first = TRUE; - if(first) { + static BOOL warned; + if (!warned) { FIXME("Using software emulation because not all material properties could be tracked\n"); - first = FALSE; + warned = TRUE; } else { TRACE("Using software emulation because not all material properties could be tracked\n"); } @@ -878,10 +885,10 @@ void drawPrimitive(IWineD3DDevice *iface, /* Either write a pipeline replacement shader or convert the specular alpha from unsigned byte * to a float in the vertex buffer */ - static BOOL first = TRUE; - if(first) { + static BOOL warned; + if (!warned) { FIXME("Using software emulation because manual fog coordinates are provided\n"); - first = FALSE; + warned = TRUE; } else { TRACE("Using software emulation because manual fog coordinates are provided\n"); } @@ -898,10 +905,10 @@ void drawPrimitive(IWineD3DDevice *iface, if (This->useDrawStridedSlow || emulation) { /* Immediate mode drawing */ if(use_vs(This)) { - static BOOL first = TRUE; - if(first) { + static BOOL warned; + if (!warned) { FIXME("Using immediate mode with vertex shaders for half float emulation\n"); - first = FALSE; + warned = TRUE; } else { TRACE("Using immediate mode with vertex shaders for half float emulation\n"); } @@ -1005,8 +1012,8 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This, unsigned int i, j, num_quads, out_vertex_size, buffer_size, d3d_out_vertex_size; float max_x = 0.0, max_y = 0.0, max_z = 0.0, neg_z = 0.0; WineDirect3DVertexStridedData strided; - BYTE *data; - WINED3DRECTPATCH_INFO *info = &patch->RectPatchInfo; + const BYTE *data; + const WINED3DRECTPATCH_INFO *info = &patch->RectPatchInfo; DWORD vtxStride; GLenum feedback_type; GLfloat *feedbuffer; @@ -1048,7 +1055,7 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This, /* First, get the boundary cube of the input data */ for(j = 0; j < info->Height; j++) { for(i = 0; i < info->Width; i++) { - float *v = (float *) (data + vtxStride * i + vtxStride * info->Stride * j); + const float *v = (const float *)(data + vtxStride * i + vtxStride * info->Stride * j); if(fabs(v[0]) > max_x) max_x = fabs(v[0]); if(fabs(v[1]) > max_y) max_y = fabs(v[1]); if(fabs(v[2]) > max_z) max_z = fabs(v[2]); @@ -1085,11 +1092,11 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This, checkGLcall("glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)"); IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_FILLMODE)); if(patch->has_normals) { - float black[4] = {0, 0, 0, 0}; - float red[4] = {1, 0, 0, 0}; - float green[4] = {0, 1, 0, 0}; - float blue[4] = {0, 0, 1, 0}; - float white[4] = {1, 1, 1, 1}; + const GLfloat black[4] = {0, 0, 0, 0}; + const GLfloat red[4] = {1, 0, 0, 0}; + const GLfloat green[4] = {0, 1, 0, 0}; + const GLfloat blue[4] = {0, 0, 1, 0}; + const GLfloat white[4] = {1, 1, 1, 1}; glEnable(GL_LIGHTING); checkGLcall("glEnable(GL_LIGHTING)"); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, black); @@ -1172,13 +1179,13 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This, glMap2f(GL_MAP2_VERTEX_3, 0, 1, vtxStride / sizeof(float), info->Width, 0, 1, info->Stride * vtxStride / sizeof(float), info->Height, - (float *) data); + (const GLfloat *)data); checkGLcall("glMap2f"); if(patch->has_texcoords) { glMap2f(GL_MAP2_TEXTURE_COORD_4, 0, 1, vtxStride / sizeof(float), info->Width, 0, 1, info->Stride * vtxStride / sizeof(float), info->Height, - (float *) data); + (const GLfloat *)data); checkGLcall("glMap2f"); } glMapGrid2f(ceilf(patch->numSegs[0]), 0.0, 1.0, ceilf(patch->numSegs[1]), 0.0, 1.0); @@ -1256,9 +1263,9 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This, if(patch->has_normals) { /* Now do the same with reverse light directions */ - float x[4] = {-1, 0, 0, 0}; - float y[4] = { 0, -1, 0, 0}; - float z[4] = { 0, 0, -1, 0}; + const GLfloat x[4] = {-1, 0, 0, 0}; + const GLfloat y[4] = { 0, -1, 0, 0}; + const GLfloat z[4] = { 0, 0, -1, 0}; glLightfv(GL_LIGHT0, GL_POSITION, x); glLightfv(GL_LIGHT1, GL_POSITION, y); glLightfv(GL_LIGHT2, GL_POSITION, z); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 6784b96d9ff..4c1d2239a61 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -35,6 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); WINE_DECLARE_DEBUG_CHANNEL(d3d_constants); WINE_DECLARE_DEBUG_CHANNEL(d3d_caps); +WINE_DECLARE_DEBUG_CHANNEL(d3d); #define GLINFO_LOCATION (*gl_info) @@ -92,7 +93,7 @@ static void print_glsl_info_log(const WineD3D_GL_Info *gl_info, GLhandleARB obj) { int infologLength = 0; char *infoLog; - int i; + unsigned int i; BOOL is_spam; const char *spam[] = { @@ -291,27 +292,23 @@ static void shader_glsl_load_constantsF(IWineD3DBaseShaderImpl *This, const Wine checkGLcall("glUniform4fvARB()"); } -/** - * Loads integer constants (aka uniforms) into the currently set GLSL program. - * When @constants_set == NULL, it will load all the constants. - */ +/* Loads integer constants (aka uniforms) into the currently set GLSL program. */ static void shader_glsl_load_constantsI(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info, - GLhandleARB programId, const GLhandleARB locations[MAX_CONST_I], unsigned int max_constants, - const int *constants, const BOOL *constants_set) + const GLhandleARB locations[MAX_CONST_I], const int *constants, WORD constants_set) { - int i; + unsigned int i; struct list* ptr; - for (i=0; i>= 1, ++i) + { + if (!(constants_set & 1)) continue; - TRACE_(d3d_constants)("Loading constants %i: %i, %i, %i, %i\n", - i, constants[i*4], constants[i*4+1], constants[i*4+2], constants[i*4+3]); + TRACE_(d3d_constants)("Loading constants %u: %i, %i, %i, %i\n", + i, constants[i*4], constants[i*4+1], constants[i*4+2], constants[i*4+3]); - /* We found this uniform name in the program - go ahead and send the data */ - GL_EXTCALL(glUniform4ivARB(locations[i], 1, &constants[i*4])); - checkGLcall("glUniform4ivARB"); - } + /* We found this uniform name in the program - go ahead and send the data */ + GL_EXTCALL(glUniform4ivARB(locations[i], 1, &constants[i*4])); + checkGLcall("glUniform4ivARB"); } /* Load immediate constants */ @@ -331,34 +328,34 @@ static void shader_glsl_load_constantsI(IWineD3DBaseShaderImpl *This, const Wine } } -/** - * Loads boolean constants (aka uniforms) into the currently set GLSL program. - * When @constants_set == NULL, it will load all the constants. - */ +/* Loads boolean constants (aka uniforms) into the currently set GLSL program. */ static void shader_glsl_load_constantsB(IWineD3DBaseShaderImpl *This, const WineD3D_GL_Info *gl_info, - GLhandleARB programId, unsigned int max_constants, const BOOL *constants, const BOOL *constants_set) + GLhandleARB programId, const BOOL *constants, WORD constants_set) { GLhandleARB tmp_loc; - int i; + unsigned int i; char tmp_name[8]; char is_pshader = shader_is_pshader_version(This->baseShader.hex_version); const char* prefix = is_pshader? "PB":"VB"; struct list* ptr; - for (i=0; i>= 1, ++i) + { + if (!(constants_set & 1)) continue; - TRACE_(d3d_constants)("Loading constants %i: %i;\n", i, constants[i]); + TRACE_(d3d_constants)("Loading constants %i: %i;\n", i, constants[i]); - /* TODO: Benchmark and see if it would be beneficial to store the - * locations of the constants to avoid looking up each time */ - snprintf(tmp_name, sizeof(tmp_name), "%s[%i]", prefix, i); - tmp_loc = GL_EXTCALL(glGetUniformLocationARB(programId, tmp_name)); - if (tmp_loc != -1) { - /* We found this uniform name in the program - go ahead and send the data */ - GL_EXTCALL(glUniform1ivARB(tmp_loc, 1, &constants[i])); - checkGLcall("glUniform1ivARB"); - } + /* TODO: Benchmark and see if it would be beneficial to store the + * locations of the constants to avoid looking up each time */ + snprintf(tmp_name, sizeof(tmp_name), "%s[%i]", prefix, i); + tmp_loc = GL_EXTCALL(glGetUniformLocationARB(programId, tmp_name)); + if (tmp_loc != -1) + { + /* We found this uniform name in the program - go ahead and send the data */ + GL_EXTCALL(glUniform1ivARB(tmp_loc, 1, &constants[i])); + checkGLcall("glUniform1ivARB"); } } @@ -401,7 +398,7 @@ static void shader_glsl_load_constants( const struct list *constant_list; GLhandleARB programId; const struct glsl_shader_prog_link *prog = priv->glsl_program; - unsigned int i; + int i; if (!prog) { /* No GLSL program set - nothing to do. */ @@ -420,15 +417,12 @@ static void shader_glsl_load_constants( stateBlock->vertexShaderConstantF, constant_locations, constant_list); /* Load DirectX 9 integer constants/uniforms for vertex shader */ - shader_glsl_load_constantsI(vshader, gl_info, programId, - prog->vuniformI_locations, MAX_CONST_I, - stateBlock->vertexShaderConstantI, - stateBlock->changed.vertexShaderConstantsI); + shader_glsl_load_constantsI(vshader, gl_info, prog->vuniformI_locations, + stateBlock->vertexShaderConstantI, stateBlock->changed.vertexShaderConstantsI); /* Load DirectX 9 boolean constants/uniforms for vertex shader */ - shader_glsl_load_constantsB(vshader, gl_info, programId, MAX_CONST_B, - stateBlock->vertexShaderConstantB, - stateBlock->changed.vertexShaderConstantsB); + shader_glsl_load_constantsB(vshader, gl_info, programId, + stateBlock->vertexShaderConstantB, stateBlock->changed.vertexShaderConstantsB); /* Upload the position fixup params */ GL_EXTCALL(glUniform4fvARB(prog->posFixup_location, 1, &deviceImpl->posFixup[0])); @@ -447,15 +441,12 @@ static void shader_glsl_load_constants( stateBlock->pixelShaderConstantF, constant_locations, constant_list); /* Load DirectX 9 integer constants/uniforms for pixel shader */ - shader_glsl_load_constantsI(pshader, gl_info, programId, - prog->puniformI_locations, MAX_CONST_I, - stateBlock->pixelShaderConstantI, - stateBlock->changed.pixelShaderConstantsI); + shader_glsl_load_constantsI(pshader, gl_info, prog->puniformI_locations, + stateBlock->pixelShaderConstantI, stateBlock->changed.pixelShaderConstantsI); /* Load DirectX 9 boolean constants/uniforms for pixel shader */ - shader_glsl_load_constantsB(pshader, gl_info, programId, MAX_CONST_B, - stateBlock->pixelShaderConstantB, - stateBlock->changed.pixelShaderConstantsB); + shader_glsl_load_constantsB(pshader, gl_info, programId, + stateBlock->pixelShaderConstantB, stateBlock->changed.pixelShaderConstantsB); /* Upload the environment bump map matrix if needed. The needsbumpmat member specifies the texture stage to load the matrix from. * It can't be 0 for a valid texbem instruction. @@ -503,8 +494,7 @@ static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const s { IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->baseShader.device; - int i; - unsigned int extra_constants_needed = 0; + unsigned int i, extra_constants_needed = 0; const local_constant *lconst; /* There are some minor differences between pixel and vertex shaders */ @@ -1173,199 +1163,112 @@ static void shader_glsl_get_sample_function(DWORD sampler_type, BOOL projected, } } -static void shader_glsl_color_correction(const SHADER_OPCODE_ARG *arg) +static void shader_glsl_append_fixup_arg(char *arguments, const char *reg_name, + BOOL sign_fixup, enum fixup_channel_source channel_source) { - IWineD3DBaseShaderImpl* shader = (IWineD3DBaseShaderImpl*) arg->shader; - IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) shader->baseShader.device; - const WineD3D_GL_Info *gl_info = &deviceImpl->adapter->gl_info; - glsl_dst_param_t dst_param; - glsl_dst_param_t dst_param2; - WINED3DFORMAT fmt; - WINED3DFORMAT conversion_group; - IWineD3DBaseTextureImpl *texture; - DWORD mask, mask_size; - UINT i; - BOOL recorded = FALSE; - DWORD sampler_idx; - DWORD hex_version = shader->baseShader.hex_version; - - switch(arg->opcode->opcode) { - case WINED3DSIO_TEX: - if (hex_version < WINED3DPS_VERSION(2,0)) { - sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK; - } else { - sampler_idx = arg->src[1] & WINED3DSP_REGNUM_MASK; - } - break; - - case WINED3DSIO_TEXLDL: - FIXME("Add color fixup for vertex texture WINED3DSIO_TEXLDL\n"); - return; - - case WINED3DSIO_TEXDP3TEX: - case WINED3DSIO_TEXM3x3TEX: - case WINED3DSIO_TEXM3x3SPEC: - case WINED3DSIO_TEXM3x3VSPEC: - case WINED3DSIO_TEXBEM: - case WINED3DSIO_TEXREG2AR: - case WINED3DSIO_TEXREG2GB: - case WINED3DSIO_TEXREG2RGB: - sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK; + switch(channel_source) + { + case CHANNEL_SOURCE_ZERO: + strcat(arguments, "0.0"); break; - default: - /* Not a texture sampling instruction, nothing to do */ - return; - }; - - texture = (IWineD3DBaseTextureImpl *) deviceImpl->stateBlock->textures[sampler_idx]; - if(texture) { - fmt = texture->resource.format; - conversion_group = texture->baseTexture.shader_conversion_group; - } else { - fmt = WINED3DFMT_UNKNOWN; - conversion_group = WINED3DFMT_UNKNOWN; - } - - /* before doing anything, record the sampler with the format in the format conversion list, - * but check if it's not there already - */ - for(i = 0; i < shader->baseShader.num_sampled_samplers; i++) { - if(shader->baseShader.sampled_samplers[i] == sampler_idx) { - recorded = TRUE; - break; - } - } - if(!recorded) { - shader->baseShader.sampled_samplers[shader->baseShader.num_sampled_samplers] = sampler_idx; - shader->baseShader.num_sampled_samplers++; - shader->baseShader.sampled_format[sampler_idx] = conversion_group; - } - - switch(fmt) { - case WINED3DFMT_V8U8: - case WINED3DFMT_V16U16: - if(GL_SUPPORT(NV_TEXTURE_SHADER) && fmt == WINED3DFMT_V8U8) { - /* The 3rd channel returns 1.0 in d3d, but 0.0 in gl. Fix this while we're at it :-) */ - mask = shader_glsl_add_dst_param(arg, arg->dst, WINED3DSP_WRITEMASK_2, &dst_param); - mask_size = shader_glsl_get_write_mask_size(mask); - if(mask_size >= 3) { - shader_addline(arg->buffer, "%s.%c = 1.0;\n", dst_param.reg_name, dst_param.mask_str[3]); - } - } else { - /* Correct the sign, but leave the blue as it is - it was loaded correctly already */ - mask = shader_glsl_add_dst_param(arg, arg->dst, - WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1, - &dst_param); - mask_size = shader_glsl_get_write_mask_size(mask); - if(mask_size >= 2) { - shader_addline(arg->buffer, "%s.%c%c = %s.%c%c * 2.0 - 1.0;\n", - dst_param.reg_name, dst_param.mask_str[1], dst_param.mask_str[2], - dst_param.reg_name, dst_param.mask_str[1], dst_param.mask_str[2]); - } else if(mask_size == 1) { - shader_addline(arg->buffer, "%s.%c = %s.%c * 2.0 - 1.0;\n", dst_param.reg_name, dst_param.mask_str[1], - dst_param.reg_name, dst_param.mask_str[1]); - } - } + case CHANNEL_SOURCE_ONE: + strcat(arguments, "1.0"); break; - case WINED3DFMT_X8L8V8U8: - if(!GL_SUPPORT(NV_TEXTURE_SHADER)) { - /* Red and blue are the signed channels, fix them up; Blue(=L) is correct already, - * and a(X) is always 1.0 - */ - mask = shader_glsl_add_dst_param(arg, arg->dst, WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1, &dst_param); - mask_size = shader_glsl_get_write_mask_size(mask); - if(mask_size >= 2) { - shader_addline(arg->buffer, "%s.%c%c = %s.%c%c * 2.0 - 1.0;\n", - dst_param.reg_name, dst_param.mask_str[1], dst_param.mask_str[2], - dst_param.reg_name, dst_param.mask_str[1], dst_param.mask_str[2]); - } else if(mask_size == 1) { - shader_addline(arg->buffer, "%s.%c = %s.%c * 2.0 - 1.0;\n", - dst_param.reg_name, dst_param.mask_str[1], - dst_param.reg_name, dst_param.mask_str[1]); - } - } + case CHANNEL_SOURCE_X: + strcat(arguments, reg_name); + strcat(arguments, ".x"); break; - case WINED3DFMT_L6V5U5: - if(!GL_SUPPORT(NV_TEXTURE_SHADER)) { - mask = shader_glsl_add_dst_param(arg, arg->dst, WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1, &dst_param); - mask_size = shader_glsl_get_write_mask_size(mask); - shader_glsl_add_dst_param(arg, arg->dst, WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_2, &dst_param2); - if(mask_size >= 3) { - /* Swap y and z (U and L), and do a sign conversion on x and the new y(V and U) */ - shader_addline(arg->buffer, "tmp0.g = %s.%c;\n", - dst_param.reg_name, dst_param.mask_str[2]); - shader_addline(arg->buffer, "%s.%c%c = %s.%c%c * 2.0 - 1.0;\n", - dst_param.reg_name, dst_param.mask_str[2], dst_param.mask_str[1], - dst_param2.reg_name, dst_param.mask_str[1], dst_param.mask_str[3]); - shader_addline(arg->buffer, "%s.%c = tmp0.g;\n", dst_param.reg_name, - dst_param.mask_str[3]); - } else if(mask_size == 2) { - /* This is bad: We have VL, but we need VU */ - FIXME("2 components sampled from a converted L6V5U5 texture\n"); - } else { - shader_addline(arg->buffer, "%s.%c = %s.%c * 2.0 - 1.0;\n", - dst_param.reg_name, dst_param.mask_str[1], - dst_param2.reg_name, dst_param.mask_str[1]); - } - } + case CHANNEL_SOURCE_Y: + strcat(arguments, reg_name); + strcat(arguments, ".y"); break; - case WINED3DFMT_Q8W8V8U8: - if(!GL_SUPPORT(NV_TEXTURE_SHADER)) { - /* Correct the sign in all channels. The writemask just applies as-is, no - * need for checking the mask size - */ - shader_glsl_add_dst_param(arg, arg->dst, - WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | - WINED3DSP_WRITEMASK_2 | WINED3DSP_WRITEMASK_3, - &dst_param); - shader_addline(arg->buffer, "%s%s = %s%s * 2.0 - 1.0;\n", dst_param.reg_name, dst_param.mask_str, - dst_param.reg_name, dst_param.mask_str); - } + case CHANNEL_SOURCE_Z: + strcat(arguments, reg_name); + strcat(arguments, ".z"); break; - case WINED3DFMT_ATI2N: - /* GL_ATI_texture_compression_3dc returns the two channels as luminance-alpha, - * which means the first one is replicated across .rgb, and the 2nd one is in - * .a. We need the 2nd in .g - * - * GL_EXT_texture_compression_rgtc returns the values in .rg, however, they - * are swapped compared to d3d. So swap red and green. - */ - mask = shader_glsl_add_dst_param(arg, arg->dst, WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1, &dst_param); - mask_size = shader_glsl_get_write_mask_size(mask); - if(GL_SUPPORT(EXT_TEXTURE_COMPRESSION_RGTC)) { - if(mask_size >= 2) { - shader_addline(arg->buffer, "%s.%c%c = %s.%c%c;\n", - dst_param.reg_name, dst_param.mask_str[1], - dst_param.mask_str[2], - dst_param.reg_name, dst_param.mask_str[2], - dst_param.mask_str[1]); - } else { - FIXME("%u components sampled from a converted ATI2N texture\n", mask_size); - } - } else { - if(mask_size == 4) { - /* Swap y and z (U and L), and do a sign conversion on x and the new y(V and U) */ - shader_addline(arg->buffer, "%s.%c = %s.%c;\n", - dst_param.reg_name, dst_param.mask_str[2], - dst_param.reg_name, dst_param.mask_str[4]); - } else if(mask_size == 1) { - /* Nothing to do */ - } else { - FIXME("%u components sampled from a converted ATI2N texture\n", mask_size); - /* This is bad: We have .r[gb], but we need .ra */ - } - } + case CHANNEL_SOURCE_W: + strcat(arguments, reg_name); + strcat(arguments, ".w"); break; - /* stupid compiler */ default: + FIXME("Unhandled channel source %#x\n", channel_source); + strcat(arguments, "undefined"); break; } + + if (sign_fixup) strcat(arguments, " * 2.0 - 1.0"); +} + +static void shader_glsl_color_correction(const struct SHADER_OPCODE_ARG *arg, struct color_fixup_desc fixup) +{ + unsigned int mask_size, remaining; + glsl_dst_param_t dst_param; + char arguments[256]; + DWORD mask; + BOOL dummy; + + mask = 0; + if (fixup.x_sign_fixup || fixup.x_source != CHANNEL_SOURCE_X) mask |= WINED3DSP_WRITEMASK_0; + if (fixup.y_sign_fixup || fixup.y_source != CHANNEL_SOURCE_Y) mask |= WINED3DSP_WRITEMASK_1; + if (fixup.z_sign_fixup || fixup.z_source != CHANNEL_SOURCE_Z) mask |= WINED3DSP_WRITEMASK_2; + if (fixup.w_sign_fixup || fixup.w_source != CHANNEL_SOURCE_W) mask |= WINED3DSP_WRITEMASK_3; + mask &= arg->dst; + + if (!mask) return; /* Nothing to do */ + + if (is_yuv_fixup(fixup)) + { + enum yuv_fixup yuv_fixup = get_yuv_fixup(fixup); + FIXME("YUV fixup (%#x) not supported\n", yuv_fixup); + return; + } + + mask_size = shader_glsl_get_write_mask_size(mask); + + dst_param.mask_str[0] = '\0'; + shader_glsl_get_write_mask(mask, dst_param.mask_str); + + dst_param.reg_name[0] = '\0'; + shader_glsl_get_register_name(arg->dst, arg->dst_addr, dst_param.reg_name, &dummy, arg); + + arguments[0] = '\0'; + remaining = mask_size; + if (mask & WINED3DSP_WRITEMASK_0) + { + shader_glsl_append_fixup_arg(arguments, dst_param.reg_name, fixup.x_sign_fixup, fixup.x_source); + if (--remaining) strcat(arguments, ", "); + } + if (mask & WINED3DSP_WRITEMASK_1) + { + shader_glsl_append_fixup_arg(arguments, dst_param.reg_name, fixup.y_sign_fixup, fixup.y_source); + if (--remaining) strcat(arguments, ", "); + } + if (mask & WINED3DSP_WRITEMASK_2) + { + shader_glsl_append_fixup_arg(arguments, dst_param.reg_name, fixup.z_sign_fixup, fixup.z_source); + if (--remaining) strcat(arguments, ", "); + } + if (mask & WINED3DSP_WRITEMASK_3) + { + shader_glsl_append_fixup_arg(arguments, dst_param.reg_name, fixup.w_sign_fixup, fixup.w_source); + if (--remaining) strcat(arguments, ", "); + } + + if (mask_size > 1) + { + shader_addline(arg->buffer, "%s%s = vec%u(%s);\n", + dst_param.reg_name, dst_param.mask_str, mask_size, arguments); + } + else + { + shader_addline(arg->buffer, "%s%s = %s;\n", dst_param.reg_name, dst_param.mask_str, arguments); + } } /***************************************************************************** @@ -1844,6 +1747,9 @@ static void shader_glsl_mad(const SHADER_OPCODE_ARG *arg) Vertex shaders to GLSL codes */ static void shader_glsl_mnxn(const SHADER_OPCODE_ARG *arg) { + IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)arg->shader; + const SHADER_OPCODE *opcode_table = shader->baseShader.shader_ins; + DWORD shader_version = shader->baseShader.hex_version; int i; int nComponents = 0; SHADER_OPCODE_ARG tmpArg; @@ -1861,23 +1767,23 @@ static void shader_glsl_mnxn(const SHADER_OPCODE_ARG *arg) switch(arg->opcode->opcode) { case WINED3DSIO_M4x4: nComponents = 4; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP4); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP4); break; case WINED3DSIO_M4x3: nComponents = 3; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP4); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP4); break; case WINED3DSIO_M3x4: nComponents = 4; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP3); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3); break; case WINED3DSIO_M3x3: nComponents = 3; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP3); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3); break; case WINED3DSIO_M3x2: nComponents = 2; - tmpArg.opcode = shader_get_opcode(arg->shader, WINED3DSIO_DP3); + tmpArg.opcode = shader_get_opcode(opcode_table, shader_version, WINED3DSIO_DP3); break; default: break; @@ -3846,21 +3752,23 @@ static void shader_glsl_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info * TRACE_(d3d_caps)("Hardware pixel shader version %d.%d enabled (GLSL)\n", (pCaps->PixelShaderVersion >> 8) & 0xff, pCaps->PixelShaderVersion & 0xff); } -static BOOL shader_glsl_conv_supported(WINED3DFORMAT fmt) { - TRACE("Checking shader format support for format %s:", debug_d3dformat(fmt)); - switch(fmt) { - case WINED3DFMT_V8U8: - case WINED3DFMT_V16U16: - case WINED3DFMT_X8L8V8U8: - case WINED3DFMT_L6V5U5: - case WINED3DFMT_Q8W8V8U8: - case WINED3DFMT_ATI2N: - TRACE("[OK]\n"); - return TRUE; - default: - TRACE("[FAILED\n"); - return FALSE; +static BOOL shader_glsl_color_fixup_supported(struct color_fixup_desc fixup) +{ + if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) + { + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(fixup); + } + + /* We support everything except YUV conversions. */ + if (!is_yuv_fixup(fixup)) + { + TRACE("[OK]\n"); + return TRUE; } + + TRACE("[FAILED]\n"); + return FALSE; } static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TABLE_SIZE] = @@ -3965,5 +3873,5 @@ const shader_backend_t glsl_shader_backend = { shader_glsl_generate_pshader, shader_glsl_generate_vshader, shader_glsl_get_caps, - shader_glsl_conv_supported, + shader_glsl_color_fixup_supported, }; diff --git a/dlls/wined3d/indexbuffer.c b/dlls/wined3d/indexbuffer.c index 79423a197e0..0737892d1df 100644 --- a/dlls/wined3d/indexbuffer.c +++ b/dlls/wined3d/indexbuffer.c @@ -74,7 +74,7 @@ static ULONG WINAPI IWineD3DIndexBufferImpl_Release(IWineD3DIndexBuffer *iface) LEAVE_GL(); } - IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface); + resource_cleanup((IWineD3DResource *)iface); HeapFree(GetProcessHeap(), 0, This); } return ref; @@ -84,31 +84,31 @@ static ULONG WINAPI IWineD3DIndexBufferImpl_Release(IWineD3DIndexBuffer *iface) IWineD3DIndexBuffer IWineD3DResource parts follow **************************************************** */ static HRESULT WINAPI IWineD3DIndexBufferImpl_GetDevice(IWineD3DIndexBuffer *iface, IWineD3DDevice** ppDevice) { - return IWineD3DResourceImpl_GetDevice((IWineD3DResource *)iface, ppDevice); + return resource_get_device((IWineD3DResource *)iface, ppDevice); } static HRESULT WINAPI IWineD3DIndexBufferImpl_SetPrivateData(IWineD3DIndexBuffer *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { - return IWineD3DResourceImpl_SetPrivateData((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); + return resource_set_private_data((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); } static HRESULT WINAPI IWineD3DIndexBufferImpl_GetPrivateData(IWineD3DIndexBuffer *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { - return IWineD3DResourceImpl_GetPrivateData((IWineD3DResource *)iface, refguid, pData, pSizeOfData); + return resource_get_private_data((IWineD3DResource *)iface, refguid, pData, pSizeOfData); } static HRESULT WINAPI IWineD3DIndexBufferImpl_FreePrivateData(IWineD3DIndexBuffer *iface, REFGUID refguid) { - return IWineD3DResourceImpl_FreePrivateData((IWineD3DResource *)iface, refguid); + return resource_free_private_data((IWineD3DResource *)iface, refguid); } static DWORD WINAPI IWineD3DIndexBufferImpl_SetPriority(IWineD3DIndexBuffer *iface, DWORD PriorityNew) { - return IWineD3DResourceImpl_SetPriority((IWineD3DResource *)iface, PriorityNew); + return resource_set_priority((IWineD3DResource *)iface, PriorityNew); } static DWORD WINAPI IWineD3DIndexBufferImpl_GetPriority(IWineD3DIndexBuffer *iface) { - return IWineD3DResourceImpl_GetPriority((IWineD3DResource *)iface); + return resource_get_priority((IWineD3DResource *)iface); } static void WINAPI IWineD3DIndexBufferImpl_PreLoad(IWineD3DIndexBuffer *iface) { - IWineD3DResourceImpl_PreLoad((IWineD3DResource *)iface); + FIXME("iface %p stub!\n", iface); } static void WINAPI IWineD3DIndexBufferImpl_UnLoad(IWineD3DIndexBuffer *iface) { @@ -133,11 +133,11 @@ static void WINAPI IWineD3DIndexBufferImpl_UnLoad(IWineD3DIndexBuffer *iface) { } static WINED3DRESOURCETYPE WINAPI IWineD3DIndexBufferImpl_GetType(IWineD3DIndexBuffer *iface) { - return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); + return resource_get_type((IWineD3DResource *)iface); } static HRESULT WINAPI IWineD3DIndexBufferImpl_GetParent(IWineD3DIndexBuffer *iface, IUnknown **pParent) { - return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); + return resource_get_parent((IWineD3DResource *)iface, pParent); } /* ****************************************************** diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index 9fe69f00823..77f53655211 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); #define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info -void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { +static void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { BOOL bumpmap = FALSE; if(stage > 0 && (stateblock->textureState[stage - 1][WINED3DTSS_COLOROP] == WINED3DTOP_BUMPENVMAPLUMINANCE || @@ -548,7 +548,7 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3 } } -void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { +static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { DWORD sampler = state - STATE_SAMPLER(0); DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler]; @@ -673,12 +673,26 @@ static void nvrc_fragment_free(IWineD3DDevice *iface) {} * register combiners extension(Pre-GF3). */ -static BOOL nvts_conv_supported(WINED3DFORMAT fmt) { - TRACE("Checking shader format support for format %s: [FAILED]\n", debug_d3dformat(fmt)); +static BOOL nvts_color_fixup_supported(struct color_fixup_desc fixup) +{ + if (TRACE_ON(d3d)) + { + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(fixup); + } + + /* We only support identity conversions. */ + if (is_identity_fixup(fixup)) + { + TRACE("[OK]\n"); + return TRUE; + } + + TRACE("[FAILED]\n"); return FALSE; } -const struct StateEntryTemplate nvrc_fragmentstate_template[] = { +static const struct StateEntryTemplate nvrc_fragmentstate_template[] = { { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), nvrc_colorop }, 0 }, { STATE_TEXTURESTAGE(0, WINED3DTSS_COLORARG1), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), nvrc_colorop }, 0 }, { STATE_TEXTURESTAGE(0, WINED3DTSS_COLORARG2), { STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), nvrc_colorop }, 0 }, @@ -810,7 +824,7 @@ const struct fragment_pipeline nvts_fragment_pipeline = { nvrc_fragment_get_caps, nvrc_fragment_alloc, nvrc_fragment_free, - nvts_conv_supported, + nvts_color_fixup_supported, nvrc_fragmentstate_template, FALSE /* we cannot disable projected textures. The vertex pipe has to do it */ }; @@ -820,7 +834,7 @@ const struct fragment_pipeline nvrc_fragment_pipeline = { nvrc_fragment_get_caps, nvrc_fragment_alloc, nvrc_fragment_free, - nvts_conv_supported, + nvts_color_fixup_supported, nvrc_fragmentstate_template, FALSE /* we cannot disable projected textures. The vertex pipe has to do it */ }; diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index 7b2f639d42a..0557d86f1bb 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -368,7 +368,8 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i return WINED3D_OK; } -GLuint pixelshader_compile(IWineD3DPixelShaderImpl *This, struct ps_compile_args *args) { +static GLuint pixelshader_compile(IWineD3DPixelShaderImpl *This, const struct ps_compile_args *args) +{ CONST DWORD *function = This->baseShader.function; HRESULT hr; GLuint retval; @@ -434,15 +435,15 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp args->srgb_correction = stateblock->renderState[WINED3DRS_SRGBWRITEENABLE] ? 1 : 0; - memset(args->format_conversion, 0, sizeof(args->format_conversion)); + memset(args->color_fixup, 0, sizeof(args->color_fixup)); for(i = 0; i < shader->baseShader.num_sampled_samplers; i++) { sampler = shader->baseShader.sampled_samplers[i]; tex = (IWineD3DBaseTextureImpl *) stateblock->textures[sampler]; if(!tex) { - args->format_conversion[sampler] = WINED3DFMT_UNKNOWN; + args->color_fixup[sampler] = COLOR_FIXUP_IDENTITY; continue; } - args->format_conversion[sampler] = tex->baseTexture.shader_conversion_group; + args->color_fixup[sampler] = tex->baseTexture.shader_color_fixup; } if(shader->baseShader.hex_version >= WINED3DPS_VERSION(3,0)) { if(((IWineD3DDeviceImpl *) shader->baseShader.device)->strided_streams.u.s.position_transformed) { @@ -457,7 +458,8 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp } } -GLuint find_gl_pshader(IWineD3DPixelShaderImpl *shader, struct ps_compile_args *args) { +GLuint find_gl_pshader(IWineD3DPixelShaderImpl *shader, const struct ps_compile_args *args) +{ UINT i; struct ps_compiled_shader *old_array; diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index c75e09dcb6f..efcac7b2a7f 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -27,43 +27,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); #define GLINFO_LOCATION ((IWineD3DImpl *)(((IWineD3DDeviceImpl *)This->resource.wineD3DDevice)->wineD3D))->gl_info -/* IWineD3DResource IUnknown parts follow: */ -HRESULT WINAPI IWineD3DResourceImpl_QueryInterface(IWineD3DResource *iface, REFIID riid, LPVOID *ppobj) +void resource_cleanup(IWineD3DResource *iface) { IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; - TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj); - if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IWineD3DBase) - || IsEqualGUID(riid, &IID_IWineD3DResource)) { - IUnknown_AddRef(iface); - *ppobj = This; - return S_OK; - } - *ppobj = NULL; - return E_NOINTERFACE; -} - -ULONG WINAPI IWineD3DResourceImpl_AddRef(IWineD3DResource *iface) { - IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; - ULONG ref = InterlockedIncrement(&This->resource.ref); - TRACE("(%p) : AddRef increasing from %d\n", This, ref - 1); - return ref; -} - -ULONG WINAPI IWineD3DResourceImpl_Release(IWineD3DResource *iface) { - IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; - ULONG ref = InterlockedDecrement(&This->resource.ref); - TRACE("(%p) : Releasing from %d\n", This, ref + 1); - if (ref == 0) { - IWineD3DResourceImpl_CleanUp(iface); - HeapFree(GetProcessHeap(), 0, This); - } - return ref; -} - -/* class static (not in vtable) */ -void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){ - IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; struct list *e1, *e2; PrivateData *data; HRESULT hr; @@ -76,7 +42,7 @@ void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){ LIST_FOR_EACH_SAFE(e1, e2, &This->resource.privateData) { data = LIST_ENTRY(e1, PrivateData, entry); - hr = IWineD3DResourceImpl_FreePrivateData(iface, &data->tag); + hr = resource_free_private_data(iface, &data->tag); if(hr != WINED3D_OK) { ERR("Failed to free private data when destroying resource %p, hr = %08x\n", This, hr); } @@ -92,8 +58,8 @@ void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){ return; } -/* IWineD3DResource Interface follows: */ -HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DDevice** ppDevice) { +HRESULT resource_get_device(IWineD3DResource *iface, IWineD3DDevice** ppDevice) +{ IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; TRACE("(%p) : returning %p\n", This, This->resource.wineD3DDevice); *ppDevice = (IWineD3DDevice *) This->resource.wineD3DDevice; @@ -101,8 +67,7 @@ HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DD return WINED3D_OK; } -static PrivateData* IWineD3DResourceImpl_FindPrivateData(IWineD3DResourceImpl *This, - REFGUID tag) +static PrivateData* resource_find_private_data(IWineD3DResourceImpl *This, REFGUID tag) { PrivateData *data; struct list *entry; @@ -120,21 +85,21 @@ static PrivateData* IWineD3DResourceImpl_FindPrivateData(IWineD3DResourceImpl *T return NULL; } -HRESULT WINAPI IWineD3DResourceImpl_SetPrivateData(IWineD3DResource *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { +HRESULT resource_set_private_data(IWineD3DResource *iface, REFGUID refguid, + const void *pData, DWORD SizeOfData, DWORD Flags) +{ IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; PrivateData *data; TRACE("(%p) : %s %p %d %d\n", This, debugstr_guid(refguid), pData, SizeOfData, Flags); - IWineD3DResourceImpl_FreePrivateData(iface, refguid); + resource_free_private_data(iface, refguid); data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data)); if (NULL == data) return E_OUTOFMEMORY; data->tag = *refguid; data->flags = Flags; -#if 0 - (*data)->uniquenessValue = This->uniquenessValue; -#endif + if (Flags & WINED3DSPD_IUNKNOWN) { if(SizeOfData != sizeof(IUnknown *)) { WARN("IUnknown data with size %d, returning WINED3DERR_INVALIDCALL\n", SizeOfData); @@ -160,20 +125,15 @@ HRESULT WINAPI IWineD3DResourceImpl_SetPrivateData(IWineD3DResource *iface, REFG return WINED3D_OK; } -HRESULT WINAPI IWineD3DResourceImpl_GetPrivateData(IWineD3DResource *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { +HRESULT resource_get_private_data(IWineD3DResource *iface, REFGUID refguid, void *pData, DWORD *pSizeOfData) +{ IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; PrivateData *data; TRACE("(%p) : %p %p %p\n", This, refguid, pData, pSizeOfData); - data = IWineD3DResourceImpl_FindPrivateData(This, refguid); + data = resource_find_private_data(This, refguid); if (data == NULL) return WINED3DERR_NOTFOUND; - -#if 0 /* This may not be right. */ - if (((*data)->flags & WINED3DSPD_VOLATILE) - && (*data)->uniquenessValue != This->uniquenessValue) - return DDERR_EXPIRED; -#endif if (*pSizeOfData < data->size) { *pSizeOfData = data->size; return WINED3DERR_MOREDATA; @@ -195,12 +155,13 @@ HRESULT WINAPI IWineD3DResourceImpl_GetPrivateData(IWineD3DResource *iface, REFG return WINED3D_OK; } -HRESULT WINAPI IWineD3DResourceImpl_FreePrivateData(IWineD3DResource *iface, REFGUID refguid) { +HRESULT resource_free_private_data(IWineD3DResource *iface, REFGUID refguid) +{ IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; PrivateData *data; TRACE("(%p) : %s\n", This, debugstr_guid(refguid)); - data = IWineD3DResourceImpl_FindPrivateData(This, refguid); + data = resource_find_private_data(This, refguid); if (data == NULL) return WINED3DERR_NOTFOUND; if (data->flags & WINED3DSPD_IUNKNOWN) @@ -217,7 +178,8 @@ HRESULT WINAPI IWineD3DResourceImpl_FreePrivateData(IWineD3DResource *iface, REF return WINED3D_OK; } -DWORD WINAPI IWineD3DResourceImpl_SetPriority(IWineD3DResource *iface, DWORD PriorityNew) { +DWORD resource_set_priority(IWineD3DResource *iface, DWORD PriorityNew) +{ IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; DWORD PriorityOld = This->resource.priority; This->resource.priority = PriorityNew; @@ -225,30 +187,22 @@ DWORD WINAPI IWineD3DResourceImpl_SetPriority(IWineD3DResource *iface, return PriorityOld; } -DWORD WINAPI IWineD3DResourceImpl_GetPriority(IWineD3DResource *iface) { +DWORD resource_get_priority(IWineD3DResource *iface) +{ IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; TRACE("(%p) : returning %d\n", This, This->resource.priority ); return This->resource.priority; } -/* Preloading of resources is not supported yet */ -void WINAPI IWineD3DResourceImpl_PreLoad(IWineD3DResource *iface) { - IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; - FIXME("(%p) : stub\n", This); -} - -void WINAPI IWineD3DResourceImpl_UnLoad(IWineD3DResource *iface) { - IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; - FIXME("(%p) : stub\n", This); -} - -WINED3DRESOURCETYPE WINAPI IWineD3DResourceImpl_GetType(IWineD3DResource *iface) { +WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface) +{ IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; TRACE("(%p) : returning %d\n", This, This->resource.resourceType); return This->resource.resourceType; } -HRESULT WINAPI IWineD3DResourceImpl_GetParent(IWineD3DResource *iface, IUnknown **pParent) { +HRESULT resource_get_parent(IWineD3DResource *iface, IUnknown **pParent) +{ IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; IUnknown_AddRef(This->resource.parent); *pParent = This->resource.parent; @@ -262,22 +216,3 @@ void dumpResources(struct list *list) { FIXME("Leftover resource %p with type %d,%s\n", resource, IWineD3DResource_GetType((IWineD3DResource *) resource), debug_d3dresourcetype(IWineD3DResource_GetType((IWineD3DResource *) resource))); } } - -static const IWineD3DResourceVtbl IWineD3DResource_Vtbl = -{ - /* IUnknown */ - IWineD3DResourceImpl_QueryInterface, - IWineD3DResourceImpl_AddRef, - IWineD3DResourceImpl_Release, - /* IWineD3DResource */ - IWineD3DResourceImpl_GetParent, - IWineD3DResourceImpl_GetDevice, - IWineD3DResourceImpl_SetPrivateData, - IWineD3DResourceImpl_GetPrivateData, - IWineD3DResourceImpl_FreePrivateData, - IWineD3DResourceImpl_SetPriority, - IWineD3DResourceImpl_GetPriority, - IWineD3DResourceImpl_PreLoad, - IWineD3DResourceImpl_UnLoad, - IWineD3DResourceImpl_GetType -}; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 540691099d5..87eeb33dd72 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -244,7 +244,7 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D if (stateblock->renderState[WINED3DRS_ALPHABLENDENABLE] || stateblock->renderState[WINED3DRS_EDGEANTIALIAS] || stateblock->renderState[WINED3DRS_ANTIALIASEDLINEENABLE]) { - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; getFormatDescEntry(target->resource.format, &GLINFO_LOCATION, &glDesc); /* Disable blending in all cases even without pixelshaders. With blending on we could face a big performance penalty. @@ -702,7 +702,7 @@ state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCon checkGLcall("glFinalCombinerInputNV()"); } } else { - float black[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + const GLfloat black[4] = {0.0f, 0.0f, 0.0f, 0.0f}; /* for the case of enabled lighting: */ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &black[0]); @@ -1224,7 +1224,7 @@ static void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; GLenum Parm = 0; - WineDirect3DStridedData *diffuse = &device->strided_streams.u.s.diffuse; + const WineDirect3DStridedData *diffuse = &device->strided_streams.u.s.diffuse; BOOL isDiffuseSupplied; /* Depends on the decoded vertex declaration to read the existence of diffuse data. @@ -1323,7 +1323,7 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float*)&device->updateStateBlock->material.Specular); checkGLcall("glMaterialfv"); } else { - float black[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + const GLfloat black[4] = {0.0f, 0.0f, 0.0f, 0.0f}; glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, &black[0]); checkGLcall("glMaterialfv"); } @@ -1566,10 +1566,10 @@ static void state_lastpixel(DWORD state, IWineD3DStateBlockImpl *stateblock, Win if(stateblock->renderState[WINED3DRS_LASTPIXEL]) { TRACE("Last Pixel Drawing Enabled\n"); } else { - static BOOL first = TRUE; - if(first) { + static BOOL warned; + if (!warned) { FIXME("Last Pixel Drawing Disabled, not handled yet\n"); - first = FALSE; + warned = TRUE; } else { TRACE("Last Pixel Drawing Disabled, not handled yet\n"); } @@ -3119,8 +3119,9 @@ static void unloadTexCoords(IWineD3DStateBlockImpl *stateblock) { } } -static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, WineDirect3DVertexStridedData *sd, GLint *curVBO) { - UINT *offset = stateblock->streamOffset; +static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, const WineDirect3DVertexStridedData *sd, GLint *curVBO) +{ + const UINT *offset = stateblock->streamOffset; unsigned int mapped_stage = 0; unsigned int textureNo = 0; @@ -3174,6 +3175,10 @@ static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, WineDirect3DVertex static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / WINED3D_HIGHEST_TEXTURE_STATE; DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage]; + const GLfloat s_plane[] = { 1.0, 0.0, 0.0, 0.0 }; + const GLfloat t_plane[] = { 0.0, 1.0, 0.0, 0.0 }; + const GLfloat r_plane[] = { 0.0, 0.0, 1.0, 0.0 }; + const GLfloat q_plane[] = { 0.0, 0.0, 0.0, 1.0 }; if (mapped_stage == -1) { TRACE("No texture unit mapped to stage %d. Skipping texture coordinates.\n", stage); @@ -3223,10 +3228,6 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine * equates roughly to EYE_LINEAR */ { - float s_plane[] = { 1.0, 0.0, 0.0, 0.0 }; - float t_plane[] = { 0.0, 1.0, 0.0, 0.0 }; - float r_plane[] = { 0.0, 0.0, 1.0, 0.0 }; - float q_plane[] = { 0.0, 0.0, 0.0, 1.0 }; TRACE("WINED3DTSS_TCI_CAMERASPACEPOSITION - Set eye plane\n"); glMatrixMode(GL_MODELVIEW); @@ -3257,10 +3258,6 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine case WINED3DTSS_TCI_CAMERASPACENORMAL: { if (GL_SUPPORT(NV_TEXGEN_REFLECTION)) { - float s_plane[] = { 1.0, 0.0, 0.0, 0.0 }; - float t_plane[] = { 0.0, 1.0, 0.0, 0.0 }; - float r_plane[] = { 0.0, 0.0, 1.0, 0.0 }; - float q_plane[] = { 0.0, 0.0, 0.0, 1.0 }; TRACE("WINED3DTSS_TCI_CAMERASPACENORMAL - Set eye plane\n"); glMatrixMode(GL_MODELVIEW); @@ -3291,10 +3288,6 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine case WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR: { if (GL_SUPPORT(NV_TEXGEN_REFLECTION)) { - float s_plane[] = { 1.0, 0.0, 0.0, 0.0 }; - float t_plane[] = { 0.0, 1.0, 0.0, 0.0 }; - float r_plane[] = { 0.0, 0.0, 1.0, 0.0 }; - float q_plane[] = { 0.0, 0.0, 0.0, 1.0 }; TRACE("WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR - Set eye plane\n"); glMatrixMode(GL_MODELVIEW); @@ -3480,7 +3473,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont } } -void apply_pshader_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { +static void apply_pshader_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; if (use_ps(device)) { @@ -3634,12 +3627,12 @@ static void transform_worldex(DWORD state, IWineD3DStateBlockImpl *stateblock, W */ if(stateblock->wineD3DDevice->view_ident) { glLoadMatrixf(&stateblock->transforms[WINED3DTS_WORLDMATRIX(matrix)].u.m[0][0]); - checkGLcall("glLoadMatrixf") + checkGLcall("glLoadMatrixf"); } else { glLoadMatrixf(&stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); - checkGLcall("glLoadMatrixf") + checkGLcall("glLoadMatrixf"); glMultMatrixf(&stateblock->transforms[WINED3DTS_WORLDMATRIX(matrix)].u.m[0][0]); - checkGLcall("glMultMatrixf") + checkGLcall("glMultMatrixf"); } } @@ -3713,7 +3706,7 @@ static void transform_view(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine * NOTE2: Apparently texture transforms do NOT need reapplying */ - PLIGHTINFOEL *light = NULL; + const PLIGHTINFOEL *light = NULL; glMatrixMode(GL_MODELVIEW); checkGLcall("glMatrixMode(GL_MODELVIEW)"); @@ -3931,10 +3924,11 @@ static inline void unloadNumberedArrays(IWineD3DStateBlockImpl *stateblock) { } } -static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, WineDirect3DVertexStridedData *strided) { +static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, const WineDirect3DVertexStridedData *strided) +{ GLint curVBO = GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT) ? -1 : 0; int i; - UINT *offset = stateblock->streamOffset; + const UINT *offset = stateblock->streamOffset; IWineD3DVertexBufferImpl *vb; DWORD_PTR shift_index; @@ -3999,7 +3993,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, WineDi /* Stride = 0 means always the same values. glVertexAttribPointerARB doesn't do that. Instead disable the pointer and * set up the attribute statically. But we have to figure out the system memory address. */ - BYTE *ptr = strided->u.input[i].lpData + offset[strided->u.input[i].streamNo]; + const BYTE *ptr = strided->u.input[i].lpData + offset[strided->u.input[i].streamNo]; if(strided->u.input[i].VBO) { vb = (IWineD3DVertexBufferImpl *) stateblock->streamSource[strided->u.input[i].streamNo]; ptr += (long) vb->resource.allocatedMemory; @@ -4008,16 +4002,16 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, WineDi switch(strided->u.input[i].dwType) { case WINED3DDECLTYPE_FLOAT1: - GL_EXTCALL(glVertexAttrib1fvARB(i, (float *) ptr)); + GL_EXTCALL(glVertexAttrib1fvARB(i, (const GLfloat *)ptr)); break; case WINED3DDECLTYPE_FLOAT2: - GL_EXTCALL(glVertexAttrib2fvARB(i, (float *) ptr)); + GL_EXTCALL(glVertexAttrib2fvARB(i, (const GLfloat *)ptr)); break; case WINED3DDECLTYPE_FLOAT3: - GL_EXTCALL(glVertexAttrib3fvARB(i, (float *) ptr)); + GL_EXTCALL(glVertexAttrib3fvARB(i, (const GLfloat *)ptr)); break; case WINED3DDECLTYPE_FLOAT4: - GL_EXTCALL(glVertexAttrib4fvARB(i, (float *) ptr)); + GL_EXTCALL(glVertexAttrib4fvARB(i, (const GLfloat *)ptr)); break; case WINED3DDECLTYPE_UBYTE4: @@ -4029,38 +4023,38 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, WineDi break; case WINED3DDECLTYPE_SHORT2: - GL_EXTCALL(glVertexAttrib4svARB(i, (GLshort *) ptr)); + GL_EXTCALL(glVertexAttrib4svARB(i, (const GLshort *)ptr)); break; case WINED3DDECLTYPE_SHORT4: - GL_EXTCALL(glVertexAttrib4svARB(i, (GLshort *) ptr)); + GL_EXTCALL(glVertexAttrib4svARB(i, (const GLshort *)ptr)); break; case WINED3DDECLTYPE_SHORT2N: { - GLshort s[4] = {((short *) ptr)[0], ((short *) ptr)[1], 0, 1}; + const GLshort s[4] = {((const GLshort *)ptr)[0], ((const GLshort *)ptr)[1], 0, 1}; GL_EXTCALL(glVertexAttrib4NsvARB(i, s)); break; } case WINED3DDECLTYPE_USHORT2N: { - GLushort s[4] = {((unsigned short *) ptr)[0], ((unsigned short *) ptr)[1], 0, 1}; + const GLushort s[4] = {((const GLushort *)ptr)[0], ((const GLushort *)ptr)[1], 0, 1}; GL_EXTCALL(glVertexAttrib4NusvARB(i, s)); break; } case WINED3DDECLTYPE_SHORT4N: - GL_EXTCALL(glVertexAttrib4NsvARB(i, (GLshort *) ptr)); + GL_EXTCALL(glVertexAttrib4NsvARB(i, (const GLshort *)ptr)); break; case WINED3DDECLTYPE_USHORT4N: - GL_EXTCALL(glVertexAttrib4NusvARB(i, (GLushort *) ptr)); + GL_EXTCALL(glVertexAttrib4NusvARB(i, (const GLushort *)ptr)); break; case WINED3DDECLTYPE_UDEC3: FIXME("Unsure about WINED3DDECLTYPE_UDEC3\n"); - /*glVertexAttrib3usvARB(i, (GLushort *) ptr); Does not exist */ + /*glVertexAttrib3usvARB(i, (const GLushort *)ptr); Does not exist */ break; case WINED3DDECLTYPE_DEC3N: FIXME("Unsure about WINED3DDECLTYPE_DEC3N\n"); - /*glVertexAttrib3NusvARB(i, (GLushort *) ptr); Does not exist */ + /*glVertexAttrib3NusvARB(i, (const GLushort *)ptr); Does not exist */ break; case WINED3DDECLTYPE_FLOAT16_2: @@ -4085,8 +4079,9 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock, WineDi } /* Used from 2 different functions, and too big to justify making it inlined */ -static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVertexStridedData *sd) { - UINT *offset = stateblock->streamOffset; +static void loadVertexData(IWineD3DStateBlockImpl *stateblock, const WineDirect3DVertexStridedData *sd) +{ + const UINT *offset = stateblock->streamOffset; GLint curVBO = GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT) ? -1 : 0; TRACE("Using fast vertex array code\n"); @@ -4127,10 +4122,11 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte checkGLcall("glWeightPointerARB"); if((sd->u.s.blendMatrixIndices.lpData) || (sd->u.s.blendMatrixIndices.VBO)){ - static BOOL showfixme = TRUE; - if(showfixme){ + static BOOL warned; + if (!warned) + { FIXME("blendMatrixIndices support\n"); - showfixme = FALSE; + warned = TRUE; } } } else { @@ -4268,9 +4264,9 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte WINED3D_ATR_GLTYPE(sd->u.s.specular.dwType), sd->u.s.specular.dwStride, sd->u.s.specular.lpData + stateblock->loadBaseVertexIndex * sd->u.s.specular.dwStride + offset[sd->u.s.specular.streamNo]); - vcheckGLcall("glSecondaryColorPointerEXT(4, GL_UNSIGNED_BYTE, ...)"); + checkGLcall("glSecondaryColorPointerEXT(4, GL_UNSIGNED_BYTE, ...)"); glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT); - vcheckGLcall("glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT)"); + checkGLcall("glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT)"); } else { /* Missing specular color is not critical, no warnings */ @@ -4292,9 +4288,8 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte loadTexCoords(stateblock, sd, &curVBO); } -static inline void drawPrimitiveTraceDataLocations( - WineDirect3DVertexStridedData *dataLocations) { - +static inline void drawPrimitiveTraceDataLocations(const WineDirect3DVertexStridedData *dataLocations) +{ /* Dump out what parts we have supplied */ TRACE("Strided Data:\n"); TRACE_STRIDED((dataLocations), position); @@ -4602,7 +4597,7 @@ static void viewport_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock, static void light(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { UINT Index = state - STATE_ACTIVELIGHT(0); - PLIGHTINFOEL *lightInfo = stateblock->activeLights[Index]; + const PLIGHTINFOEL *lightInfo = stateblock->activeLights[Index]; if(!lightInfo) { glDisable(GL_LIGHT0 + Index); @@ -5476,8 +5471,22 @@ static void ffp_fragment_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info static HRESULT ffp_fragment_alloc(IWineD3DDevice *iface) { return WINED3D_OK; } static void ffp_fragment_free(IWineD3DDevice *iface) {} -static BOOL ffp_conv_supported(WINED3DFORMAT fmt) { - TRACE("Checking shader format support for format %s: [FAILED]\n", debug_d3dformat(fmt)); +static BOOL ffp_color_fixup_supported(struct color_fixup_desc fixup) +{ + if (TRACE_ON(d3d)) + { + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(fixup); + } + + /* We only support identity conversions. */ + if (is_identity_fixup(fixup)) + { + TRACE("[OK]\n"); + return TRUE; + } + + TRACE("[FAILED]\n"); return FALSE; } @@ -5486,12 +5495,13 @@ const struct fragment_pipeline ffp_fragment_pipeline = { ffp_fragment_get_caps, ffp_fragment_alloc, ffp_fragment_free, - ffp_conv_supported, + ffp_color_fixup_supported, ffp_fragmentstate_template, FALSE /* we cannot disable projected textures. The vertex pipe has to do it */ }; -static int num_handlers(APPLYSTATEFUNC *funcs) { +static unsigned int num_handlers(const APPLYSTATEFUNC *funcs) +{ unsigned int i; for(i = 0; funcs[i]; i++); return i; @@ -5508,12 +5518,10 @@ static void multistate_apply_3(DWORD state, IWineD3DStateBlockImpl *stateblock, stateblock->wineD3DDevice->multistate_funcs[state][2](state, stateblock, context); } -void compile_state_table(struct StateEntry *StateTable, - APPLYSTATEFUNC **dev_multistate_funcs, - WineD3D_GL_Info *gl_info, - const struct StateEntryTemplate *vertex, - const struct fragment_pipeline *fragment, - const struct StateEntryTemplate *misc) { +void compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, + const WineD3D_GL_Info *gl_info, const struct StateEntryTemplate *vertex, + const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc) +{ unsigned int i, type, handlers; APPLYSTATEFUNC multistate_funcs[STATE_HIGHEST + 1][3]; const struct StateEntryTemplate *cur; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 0d9913439ef..3faa5a0411f 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -63,11 +63,8 @@ HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object) { } /** Copy all members of one stateblock to another */ -void stateblock_savedstates_copy( - IWineD3DStateBlock* iface, - SAVEDSTATES* dest, - SAVEDSTATES* source) { - +static void stateblock_savedstates_copy(IWineD3DStateBlock* iface, SAVEDSTATES *dest, const SAVEDSTATES *source) +{ IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; unsigned bsize = sizeof(BOOL); @@ -90,10 +87,10 @@ void stateblock_savedstates_copy( memcpy(dest->textureState, source->textureState, bsize * MAX_TEXTURES * (WINED3D_HIGHEST_TEXTURE_STATE + 1)); memcpy(dest->samplerState, source->samplerState, bsize * MAX_COMBINED_SAMPLERS * (WINED3D_HIGHEST_SAMPLER_STATE + 1)); memcpy(dest->clipplane, source->clipplane, bsize * MAX_CLIPPLANES); - memcpy(dest->pixelShaderConstantsB, source->pixelShaderConstantsB, bsize * MAX_CONST_B); - memcpy(dest->pixelShaderConstantsI, source->pixelShaderConstantsI, bsize * MAX_CONST_I); - memcpy(dest->vertexShaderConstantsB, source->vertexShaderConstantsB, bsize * MAX_CONST_B); - memcpy(dest->vertexShaderConstantsI, source->vertexShaderConstantsI, bsize * MAX_CONST_I); + dest->pixelShaderConstantsB = source->pixelShaderConstantsB; + dest->pixelShaderConstantsI = source->pixelShaderConstantsI; + dest->vertexShaderConstantsB = source->vertexShaderConstantsB; + dest->vertexShaderConstantsI = source->vertexShaderConstantsI; /* Dynamically sized arrays */ memcpy(dest->pixelShaderConstantsF, source->pixelShaderConstantsF, bsize * GL_LIMITS(pshader_constantsF)); @@ -128,10 +125,10 @@ void stateblock_savedstates_set( memset(states->textureState, value, bsize * MAX_TEXTURES * (WINED3D_HIGHEST_TEXTURE_STATE + 1)); memset(states->samplerState, value, bsize * MAX_COMBINED_SAMPLERS * (WINED3D_HIGHEST_SAMPLER_STATE + 1)); memset(states->clipplane, value, bsize * MAX_CLIPPLANES); - memset(states->pixelShaderConstantsB, value, bsize * MAX_CONST_B); - memset(states->pixelShaderConstantsI, value, bsize * MAX_CONST_I); - memset(states->vertexShaderConstantsB, value, bsize * MAX_CONST_B); - memset(states->vertexShaderConstantsI, value, bsize * MAX_CONST_I); + states->pixelShaderConstantsB = value ? 0xffff : 0; + states->pixelShaderConstantsI = value ? 0xffff : 0; + states->vertexShaderConstantsB = value ? 0xffff : 0; + states->vertexShaderConstantsI = value ? 0xffff : 0; /* Dynamically sized arrays */ memset(states->pixelShaderConstantsF, value, bsize * GL_LIMITS(pshader_constantsF)); @@ -710,7 +707,7 @@ static inline void apply_lights(IWineD3DDevice *pDevice, IWineD3DStateBlockImpl struct list *e; LIST_FOR_EACH(e, &This->lightMap[i]) { - PLIGHTINFOEL *light = LIST_ENTRY(e, PLIGHTINFOEL, entry); + const PLIGHTINFOEL *light = LIST_ENTRY(e, PLIGHTINFOEL, entry); if(light->changed) { IWineD3DDevice_SetLight(pDevice, light->OriginalIndex, &light->OriginalParms); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index dffd92eef54..01914030911 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -31,11 +31,11 @@ #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); +WINE_DECLARE_DEBUG_CHANNEL(d3d); #define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4], BOOL colorkey); static void d3dfmt_p8_upload_palette(IWineD3DSurface *iface, CONVERT_TYPES convert); -static inline void clear_unused_channels(IWineD3DSurfaceImpl *This); static void surface_remove_pbo(IWineD3DSurfaceImpl *This); void surface_force_reload(IWineD3DSurface *iface) @@ -211,7 +211,7 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) { if (This->Flags & SFLAG_NONPOW2) { const BYTE *src_data; BYTE *dst_data; - int y; + UINT y; /* * Some games (e.g. warhammer 40k) don't work properly with the odd pitches, preventing * the surface pitch from being used to box non-power2 textures. Instead we have to use a hack to @@ -443,7 +443,7 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi } if (!renderbuffer) { - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; getFormatDescEntry(This->resource.format, &GLINFO_LOCATION, &glDesc); GL_EXTCALL(glGenRenderbuffersEXT(1, &renderbuffer)); @@ -528,7 +528,7 @@ static ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) HeapFree(GetProcessHeap(), 0, This->palette9); - IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface); + resource_cleanup((IWineD3DResource *)iface); if(This->overlay_dest) { list_remove(&This->overlay_entry); @@ -796,7 +796,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v local_rect.right - local_rect.left, local_rect.bottom - local_rect.top, fmt, type, mem); - vcheckGLcall("glReadPixels"); + checkGLcall("glReadPixels"); if(This->Flags & SFLAG_PBO) { GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0)); @@ -944,8 +944,6 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This) This->pow2Height, format, type); } - clear_unused_channels(This); - ENTER_GL(); /* If !SrcIsUpsideDown we should flip the surface. * This can be done using glCopyTexSubImage2D but this @@ -961,7 +959,7 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This) checkGLcall("glCopyTexSubImage2D"); glReadBuffer(prevRead); - vcheckGLcall("glReadBuffer"); + checkGLcall("glReadBuffer"); LEAVE_GL(); TRACE("Updated target %d\n", This->glDescription.target); @@ -1209,18 +1207,18 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm } glGetIntegerv(GL_PACK_SWAP_BYTES, &prev_store); - vcheckGLcall("glIntegerv"); + checkGLcall("glIntegerv"); glGetIntegerv(GL_CURRENT_RASTER_POSITION, &prev_rasterpos[0]); - vcheckGLcall("glIntegerv"); + checkGLcall("glIntegerv"); glPixelZoom(1.0, -1.0); - vcheckGLcall("glPixelZoom"); + checkGLcall("glPixelZoom"); /* If not fullscreen, we need to skip a number of bytes to find the next row of data */ glGetIntegerv(GL_UNPACK_ROW_LENGTH, &skipBytes); glPixelStorei(GL_UNPACK_ROW_LENGTH, This->currentDesc.Width); glRasterPos3i(This->lockedRect.left, This->lockedRect.top, 1); - vcheckGLcall("glRasterPos2f"); + checkGLcall("glRasterPos2f"); /* Some drivers(radeon dri, others?) don't like exceptions during * glDrawPixels. If the surface is a DIB section, it might be in GDIMode @@ -1263,14 +1261,14 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm } glPixelZoom(1.0,1.0); - vcheckGLcall("glPixelZoom"); + checkGLcall("glPixelZoom"); glRasterPos3iv(&prev_rasterpos[0]); - vcheckGLcall("glRasterPos3iv"); + checkGLcall("glRasterPos3iv"); /* Reset to previous pack row length */ glPixelStorei(GL_UNPACK_ROW_LENGTH, skipBytes); - vcheckGLcall("glPixelStorei GL_UNPACK_ROW_LENGTH"); + checkGLcall("glPixelStorei GL_UNPACK_ROW_LENGTH"); if(!swapchain) { glDrawBuffer(myDevice->offscreenBuffer); @@ -1528,7 +1526,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode) { BOOL colorkey_active = need_alpha_ck && (This->CKeyFlags & WINEDDSD_CKSRCBLT); - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; getFormatDescEntry(This->resource.format, &GLINFO_LOCATION, &glDesc); @@ -1702,38 +1700,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_ *target_bpp = 2; break; - case WINED3DFMT_R32F: - /* Can be loaded in theory with fmt=GL_RED, type=GL_FLOAT, but this fails. The reason - * is that D3D expects the undefined green, blue and alpha channels to return 1.0 - * when sampling, but OpenGL sets green and blue to 0.0 instead. Thus we have to inject - * 1.0 instead. - * - * The alpha channel defaults to 1.0 in opengl, so nothing has to be done about it. - */ - *convert = CONVERT_R32F; - *format = GL_RGB; - *internal = GL_RGB32F_ARB; - *type = GL_FLOAT; - *target_bpp = 12; - break; - - case WINED3DFMT_R16F: - /* Similar to R32F */ - *convert = CONVERT_R16F; - *format = GL_RGB; - *internal = GL_RGB16F_ARB; - *type = GL_HALF_FLOAT_ARB; - *target_bpp = 6; - break; - - case WINED3DFMT_G16R16: - *convert = CONVERT_G16R16; - *format = GL_RGB; - *internal = GL_RGB16_EXT; - *type = GL_UNSIGNED_SHORT; - *target_bpp = 6; - break; - default: break; } @@ -2061,66 +2027,6 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI break; } - case CONVERT_R32F: - { - unsigned int x, y; - const float *Source; - float *Dest; - for(y = 0; y < height; y++) { - Source = (const float *)(src + y * pitch); - Dest = (float *) (dst + y * outpitch); - for (x = 0; x < width; x++ ) { - float color = (*Source++); - Dest[0] = color; - Dest[1] = 1.0; - Dest[2] = 1.0; - Dest += 3; - } - } - break; - } - - case CONVERT_R16F: - { - unsigned int x, y; - const WORD *Source; - WORD *Dest; - const WORD one = 0x3c00; - for(y = 0; y < height; y++) { - Source = (const WORD *)(src + y * pitch); - Dest = (WORD *) (dst + y * outpitch); - for (x = 0; x < width; x++ ) { - WORD color = (*Source++); - Dest[0] = color; - Dest[1] = one; - Dest[2] = one; - Dest += 3; - } - } - break; - } - - case CONVERT_G16R16: - { - unsigned int x, y; - const WORD *Source; - WORD *Dest; - - for(y = 0; y < height; y++) { - Source = (const WORD *)(src + y * pitch); - Dest = (WORD *) (dst + y * outpitch); - for (x = 0; x < width; x++ ) { - WORD green = (*Source++); - WORD red = (*Source++); - Dest[0] = green; - Dest[1] = red; - Dest[2] = 0xffff; - Dest += 3; - } - } - break; - } - default: ERR("Unsupported conversation type %d\n", convert); } @@ -2132,7 +2038,7 @@ static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4] IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; BOOL index_in_alpha = FALSE; int dxVersion = ( (IWineD3DImpl *) device->wineD3D)->dxVersion; - int i; + unsigned int i; /* Old games like StarCraft, C&C, Red Alert and others use P8 render targets. * Reading back the RGB output each lockrect (each frame as they lock the whole screen) @@ -2272,41 +2178,6 @@ BOOL palette9_changed(IWineD3DSurfaceImpl *This) { return TRUE; } -static inline void clear_unused_channels(IWineD3DSurfaceImpl *This) { - GLboolean oldwrite[4]; - - /* Some formats have only some color channels, and the others are 1.0. - * since our rendering renders to all channels, and those pixel formats - * are emulated by using a full texture with the other channels set to 1.0 - * manually, clear the unused channels. - * - * This could be done with hacking colorwriteenable to mask the colors, - * but before drawing the buffer would have to be cleared too, so there's - * no gain in that - */ - switch(This->resource.format) { - case WINED3DFMT_R16F: - case WINED3DFMT_R32F: - TRACE("R16F or R32F format, clearing green, blue and alpha to 1.0\n"); - /* Do not activate a context, the correct drawable is active already - * though just the read buffer is set, make sure to have the correct draw - * buffer too - */ - glDrawBuffer(This->resource.wineD3DDevice->offscreenBuffer); - glDisable(GL_SCISSOR_TEST); - glGetBooleanv(GL_COLOR_WRITEMASK, oldwrite); - glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE); - glClearColor(0.0, 1.0, 1.0, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - glColorMask(oldwrite[0], oldwrite[1], oldwrite[2], oldwrite[3]); - if(!This->resource.wineD3DDevice->render_offscreen) glDrawBuffer(GL_BACK); - checkGLcall("Unused channel clear\n"); - break; - - default: break; - } -} - static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, BOOL srgb_mode) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; @@ -2435,12 +2306,11 @@ static void WINAPI IWineD3DSurfaceImpl_BindTexture(IWineD3DSurface *iface) { static HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const char* filename) { FILE* f = NULL; - UINT i, y; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; char *allocatedMemory; const char *textureRow; IWineD3DSwapChain *swapChain = NULL; - int width, height; + int width, height, i, y; GLuint tmpTexture = 0; DWORD color; /*FIXME: @@ -2484,9 +2354,9 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, c NULL); glGetIntegerv(GL_READ_BUFFER, &prevRead); - vcheckGLcall("glGetIntegerv"); + checkGLcall("glGetIntegerv"); glReadBuffer(swapChain ? GL_BACK : This->resource.wineD3DDevice->offscreenBuffer); - vcheckGLcall("glReadBuffer"); + checkGLcall("glReadBuffer"); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, @@ -2610,10 +2480,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, C return WINED3D_OK; } -HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) { +static HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; HRESULT hr; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; getFormatDescEntry(format, &GLINFO_LOCATION, &glDesc); TRACE("(%p) : Calling base function first\n", This); @@ -2631,7 +2501,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM return hr; } -HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) { +static HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; if(This->Flags & (SFLAG_LOCKED | SFLAG_DCINUSE)) { @@ -2905,7 +2775,7 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D } } } - vcheckGLcall("glCopyTexSubImage2D"); + checkGLcall("glCopyTexSubImage2D"); LEAVE_GL(); } @@ -3890,7 +3760,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) { /** Check against the maximum texture sizes supported by the video card **/ IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; unsigned int pow2Width, pow2Height; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; getFormatDescEntry(This->resource.format, &GLINFO_LOCATION, &glDesc); /* Setup some glformat defaults */ @@ -4848,8 +4718,22 @@ static void ffp_blit_unset(IWineD3DDevice *iface) { } } -static BOOL ffp_blit_conv_supported(WINED3DFORMAT fmt) { - TRACE("Checking blit format support for format %s: [FAILED]\n", debug_d3dformat(fmt)); +static BOOL ffp_blit_color_fixup_supported(struct color_fixup_desc fixup) +{ + if (TRACE_ON(d3d_surface) && TRACE_ON(d3d)) + { + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(fixup); + } + + /* We only support identity conversions. */ + if (is_identity_fixup(fixup)) + { + TRACE("[OK]\n"); + return TRUE; + } + + TRACE("[FAILED]\n"); return FALSE; } @@ -4858,5 +4742,5 @@ const struct blit_shader ffp_blit = { ffp_blit_free, ffp_blit_set, ffp_blit_unset, - ffp_blit_conv_supported + ffp_blit_color_fixup_supported }; diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c index 41668ae5029..9ee5c75d986 100644 --- a/dlls/wined3d/surface_base.c +++ b/dlls/wined3d/surface_base.c @@ -119,37 +119,37 @@ ULONG WINAPI IWineD3DBaseSurfaceImpl_AddRef(IWineD3DSurface *iface) { IWineD3DSurface IWineD3DResource parts follow **************************************************** */ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetDevice(IWineD3DSurface *iface, IWineD3DDevice** ppDevice) { - return IWineD3DResourceImpl_GetDevice((IWineD3DResource *)iface, ppDevice); + return resource_get_device((IWineD3DResource *)iface, ppDevice); } HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPrivateData(IWineD3DSurface *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { - return IWineD3DResourceImpl_SetPrivateData((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); + return resource_set_private_data((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); } HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPrivateData(IWineD3DSurface *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { - return IWineD3DResourceImpl_GetPrivateData((IWineD3DResource *)iface, refguid, pData, pSizeOfData); + return resource_get_private_data((IWineD3DResource *)iface, refguid, pData, pSizeOfData); } HRESULT WINAPI IWineD3DBaseSurfaceImpl_FreePrivateData(IWineD3DSurface *iface, REFGUID refguid) { - return IWineD3DResourceImpl_FreePrivateData((IWineD3DResource *)iface, refguid); + return resource_free_private_data((IWineD3DResource *)iface, refguid); } DWORD WINAPI IWineD3DBaseSurfaceImpl_SetPriority(IWineD3DSurface *iface, DWORD PriorityNew) { - return IWineD3DResourceImpl_SetPriority((IWineD3DResource *)iface, PriorityNew); + return resource_set_priority((IWineD3DResource *)iface, PriorityNew); } DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPriority(IWineD3DSurface *iface) { - return IWineD3DResourceImpl_GetPriority((IWineD3DResource *)iface); + return resource_get_priority((IWineD3DResource *)iface); } WINED3DRESOURCETYPE WINAPI IWineD3DBaseSurfaceImpl_GetType(IWineD3DSurface *iface) { TRACE("(%p) : calling resourceimpl_GetType\n", iface); - return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); + return resource_get_type((IWineD3DResource *)iface); } HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent) { TRACE("(%p) : calling resourceimpl_GetParent\n", iface); - return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); + return resource_get_parent((IWineD3DResource *)iface, pParent); } /* ****************************************************** @@ -685,7 +685,8 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface) { return WINED3D_OK; } -void convert_r32f_r16f(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) +static void convert_r32f_r16f(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, + unsigned int w, unsigned int h) { unsigned int x, y; const float *src_f; @@ -706,7 +707,7 @@ struct d3dfmt_convertor_desc { void (*convert)(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h); }; -const struct d3dfmt_convertor_desc convertors[] = +static const struct d3dfmt_convertor_desc convertors[] = { {WINED3DFMT_R32F, WINED3DFMT_R16F, convert_r32f_r16f}, }; @@ -733,7 +734,7 @@ static inline const struct d3dfmt_convertor_desc *find_convertor(WINED3DFORMAT f * fmt: Requested destination format * *****************************************************************************/ -IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source, WINED3DFORMAT to_fmt) { +static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source, WINED3DFORMAT to_fmt) { IWineD3DSurface *ret = NULL; const struct d3dfmt_convertor_desc *conv; WINED3DLOCKED_RECT lock_src, lock_dst; diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 6266366b100..d06245866d0 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -42,7 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); * to destroy all the GL things. * *****************************************************************************/ -ULONG WINAPI IWineGDISurfaceImpl_Release(IWineD3DSurface *iface) { +static ULONG WINAPI IWineGDISurfaceImpl_Release(IWineD3DSurface *iface) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; ULONG ref = InterlockedDecrement(&This->resource.ref); TRACE("(%p) : Releasing from %d\n", This, ref + 1); @@ -62,7 +62,7 @@ ULONG WINAPI IWineGDISurfaceImpl_Release(IWineD3DSurface *iface) { HeapFree(GetProcessHeap(), 0, This->palette9); - IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface); + resource_cleanup((IWineD3DResource *)iface); if(This->overlay_dest) { list_remove(&This->overlay_entry); @@ -245,7 +245,7 @@ IWineGDISurfaceImpl_Flip(IWineD3DSurface *iface, * D3DERR_INVALIDCALL * *****************************************************************************/ -HRESULT WINAPI +static HRESULT WINAPI IWineGDISurfaceImpl_LoadTexture(IWineD3DSurface *iface, BOOL srgb_mode) { ERR("Unsupported on X11 surfaces\n"); @@ -280,7 +280,7 @@ static int get_shift(DWORD color_mask) { } -HRESULT WINAPI +static HRESULT WINAPI IWineGDISurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const char* filename) { @@ -288,7 +288,7 @@ const char* filename) UINT y = 0, x = 0; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; static char *output = NULL; - static int size = 0; + static UINT size = 0; const StaticPixelFormatDesc *formatEntry = getFormatDescEntry(This->resource.format, NULL, NULL); if (This->pow2Width > size) { @@ -340,7 +340,7 @@ const char* filename) alpha_shift = get_shift(formatEntry->alphaMask); for (y = 0; y < This->pow2Height; y++) { - unsigned char *src = This->resource.allocatedMemory + (y * 1 * IWineD3DSurface_GetPitch(iface)); + const unsigned char *src = This->resource.allocatedMemory + (y * 1 * IWineD3DSurface_GetPitch(iface)); for (x = 0; x < This->pow2Width; x++) { unsigned int color; unsigned int comp; @@ -366,7 +366,7 @@ const char* filename) return WINED3D_OK; } -HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) { +static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; WINED3DLOCKED_RECT lock; HRESULT hr; @@ -405,7 +405,7 @@ HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) { if(This->resource.format == WINED3DFMT_P8 || This->resource.format == WINED3DFMT_A8P8) { unsigned int n; - PALETTEENTRY *pal = NULL; + const PALETTEENTRY *pal = NULL; if(This->palette) { pal = This->palette->palents; @@ -436,7 +436,7 @@ HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) { return WINED3D_OK; } -HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC) { +static HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; TRACE("(%p)->(%p)\n",This,hDC); @@ -457,7 +457,7 @@ HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC hDC) { return WINED3D_OK; } -HRESULT WINAPI IWineGDISurfaceImpl_RealizePalette(IWineD3DSurface *iface) { +static HRESULT WINAPI IWineGDISurfaceImpl_RealizePalette(IWineD3DSurface *iface) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; RGBQUAD col[256]; IWineD3DPaletteImpl *pal = This->palette; @@ -507,7 +507,7 @@ HRESULT WINAPI IWineGDISurfaceImpl_RealizePalette(IWineD3DSurface *iface) { * The return values of called methods on failure * *****************************************************************************/ -HRESULT WINAPI +static HRESULT WINAPI IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; @@ -534,13 +534,13 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface) return WINED3D_OK; } -void WINAPI IWineGDISurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription) { +static void WINAPI IWineGDISurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; FIXME("(%p) : Should not be called on a GDI surface\n", This); *glDescription = NULL; } -HRESULT WINAPI IWineGDISurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect) { +static HRESULT WINAPI IWineGDISurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RECT* pDirtyRect) { /* GDI surface data can only be in one location, the system memory dib section. So they are * always clean by definition. */ @@ -548,7 +548,7 @@ HRESULT WINAPI IWineGDISurfaceImpl_AddDirtyRect(IWineD3DSurface *iface, CONST RE return WINED3D_OK; } -HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) { +static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; /* Render targets depend on their hdc, and we can't create an hdc on a user pointer */ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 6f4393ae0c6..d1a6520f633 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -39,7 +39,7 @@ WINE_DECLARE_DEBUG_CHANNEL(fps); static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB_DESTROYSURFACEFN D3DCB_DestroyRenderTarget) { IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; WINED3DDISPLAYMODE mode; - int i; + unsigned int i; TRACE("Destroying swapchain %p\n", iface); @@ -54,7 +54,7 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB } if(This->backBuffer) { - int i; + UINT i; for(i = 0; i < This->presentParms.BackBufferCount; i++) { IWineD3DSurface_SetContainer(This->backBuffer[i], 0); if(D3DCB_DestroyRenderTarget(This->backBuffer[i]) > 0) { @@ -138,7 +138,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO IWineD3DSurface_BltFast(This->backBuffer[0], 0, 0, This->wineD3DDevice->logo_surface, NULL, WINEDDBLTFAST_SRCCOLORKEY); } - if (pSourceRect || pDestRect) FIXME("Unhandled present options %p/%p\n", pSourceRect, pDestRect); + if (pSourceRect || pDestRect) FIXME("Unhandled present rects %s/%s\n", wine_dbgstr_rect(pSourceRect), wine_dbgstr_rect(pDestRect)); /* TODO: If only source rect or dest rect are supplied then clip the window to match */ TRACE("presetting HDC %p\n", This->context[0]->hdc); diff --git a/dlls/wined3d/swapchain_base.c b/dlls/wined3d/swapchain_base.c index 363331c9d7b..7272c9575fe 100644 --- a/dlls/wined3d/swapchain_base.c +++ b/dlls/wined3d/swapchain_base.c @@ -122,13 +122,14 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetBackBuffer(IWineD3DSwapChain *iface, HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetRasterStatus(IWineD3DSwapChain *iface, WINED3DRASTER_STATUS *pRasterStatus) { IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; - static BOOL showFixmes = TRUE; + static BOOL warned; pRasterStatus->InVBlank = TRUE; pRasterStatus->ScanLine = 0; /* No openGL equivalent */ - if(showFixmes) { + if (!warned) + { FIXME("(%p) : stub (once)\n", This); - showFixmes = FALSE; + warned = TRUE; } return WINED3D_OK; } diff --git a/dlls/wined3d/swapchain_gdi.c b/dlls/wined3d/swapchain_gdi.c index f634e50c146..596820157ee 100644 --- a/dlls/wined3d/swapchain_gdi.c +++ b/dlls/wined3d/swapchain_gdi.c @@ -44,7 +44,7 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB } if(This->backBuffer) { - int i; + UINT i; for(i = 0; i < This->presentParms.BackBufferCount; i++) { IWineD3DSurface_SetContainer(This->backBuffer[i], 0); if(D3DCB_DestroyRenderback(This->backBuffer[i]) > 0) { @@ -80,7 +80,8 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB * rc: Rectangle to copy * *****************************************************************************/ -void x11_copy_to_screen(IWineD3DSwapChainImpl *This, LPRECT rc) { +void x11_copy_to_screen(IWineD3DSwapChainImpl *This, const RECT *rc) +{ IWineD3DSurfaceImpl *front = (IWineD3DSurfaceImpl *) This->frontBuffer; if(front->resource.usage & WINED3DUSAGE_RENDERTARGET) { @@ -238,18 +239,6 @@ static HRESULT WINAPI IWineGDISwapChainImpl_Present(IWineD3DSwapChain *iface, CO return WINED3D_OK; } -/* FIXME: This should not be needed, the base version is OK */ -HRESULT WINAPI IWineGDIBaseSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *iface, WINED3DDISPLAYMODE*pMode) { - IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; - IWineD3DDeviceImpl *device = This->wineD3DDevice; - - pMode->Width = device->ddraw_width; - pMode->Height = device->ddraw_height; - pMode->Format = device->ddraw_format; - pMode->RefreshRate = 0; - return WINED3D_OK; -} - const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl = { /* IUnknown */ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 98aea922dff..71fb455a35c 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -69,27 +69,27 @@ static ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DTexture *iface) { IWineD3DTexture IWineD3DResource parts follow **************************************************** */ static HRESULT WINAPI IWineD3DTextureImpl_GetDevice(IWineD3DTexture *iface, IWineD3DDevice** ppDevice) { - return IWineD3DResourceImpl_GetDevice((IWineD3DResource *)iface, ppDevice); + return resource_get_device((IWineD3DResource *)iface, ppDevice); } static HRESULT WINAPI IWineD3DTextureImpl_SetPrivateData(IWineD3DTexture *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { - return IWineD3DResourceImpl_SetPrivateData((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); + return resource_set_private_data((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); } static HRESULT WINAPI IWineD3DTextureImpl_GetPrivateData(IWineD3DTexture *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { - return IWineD3DResourceImpl_GetPrivateData((IWineD3DResource *)iface, refguid, pData, pSizeOfData); + return resource_get_private_data((IWineD3DResource *)iface, refguid, pData, pSizeOfData); } static HRESULT WINAPI IWineD3DTextureImpl_FreePrivateData(IWineD3DTexture *iface, REFGUID refguid) { - return IWineD3DResourceImpl_FreePrivateData((IWineD3DResource *)iface, refguid); + return resource_free_private_data((IWineD3DResource *)iface, refguid); } static DWORD WINAPI IWineD3DTextureImpl_SetPriority(IWineD3DTexture *iface, DWORD PriorityNew) { - return IWineD3DResourceImpl_SetPriority((IWineD3DResource *)iface, PriorityNew); + return resource_set_priority((IWineD3DResource *)iface, PriorityNew); } static DWORD WINAPI IWineD3DTextureImpl_GetPriority(IWineD3DTexture *iface) { - return IWineD3DResourceImpl_GetPriority((IWineD3DResource *)iface); + return resource_get_priority((IWineD3DResource *)iface); } static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface) { @@ -165,51 +165,51 @@ static void WINAPI IWineD3DTextureImpl_UnLoad(IWineD3DTexture *iface) { surface_set_texture_name(This->surfaces[i], 0); } - IWineD3DBaseTextureImpl_UnLoad((IWineD3DBaseTexture *) iface); + basetexture_unload((IWineD3DBaseTexture *)iface); } static WINED3DRESOURCETYPE WINAPI IWineD3DTextureImpl_GetType(IWineD3DTexture *iface) { - return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); + return resource_get_type((IWineD3DResource *)iface); } static HRESULT WINAPI IWineD3DTextureImpl_GetParent(IWineD3DTexture *iface, IUnknown **pParent) { - return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); + return resource_get_parent((IWineD3DResource *)iface, pParent); } /* ****************************************************** IWineD3DTexture IWineD3DBaseTexture parts follow ****************************************************** */ static DWORD WINAPI IWineD3DTextureImpl_SetLOD(IWineD3DTexture *iface, DWORD LODNew) { - return IWineD3DBaseTextureImpl_SetLOD((IWineD3DBaseTexture *)iface, LODNew); + return basetexture_set_lod((IWineD3DBaseTexture *)iface, LODNew); } static DWORD WINAPI IWineD3DTextureImpl_GetLOD(IWineD3DTexture *iface) { - return IWineD3DBaseTextureImpl_GetLOD((IWineD3DBaseTexture *)iface); + return basetexture_get_lod((IWineD3DBaseTexture *)iface); } static DWORD WINAPI IWineD3DTextureImpl_GetLevelCount(IWineD3DTexture *iface) { - return IWineD3DBaseTextureImpl_GetLevelCount((IWineD3DBaseTexture *)iface); + return basetexture_get_level_count((IWineD3DBaseTexture *)iface); } static HRESULT WINAPI IWineD3DTextureImpl_SetAutoGenFilterType(IWineD3DTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) { - return IWineD3DBaseTextureImpl_SetAutoGenFilterType((IWineD3DBaseTexture *)iface, FilterType); + return basetexture_set_autogen_filter_type((IWineD3DBaseTexture *)iface, FilterType); } static WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DTextureImpl_GetAutoGenFilterType(IWineD3DTexture *iface) { - return IWineD3DBaseTextureImpl_GetAutoGenFilterType((IWineD3DBaseTexture *)iface); + return basetexture_get_autogen_filter_type((IWineD3DBaseTexture *)iface); } static void WINAPI IWineD3DTextureImpl_GenerateMipSubLevels(IWineD3DTexture *iface) { - IWineD3DBaseTextureImpl_GenerateMipSubLevels((IWineD3DBaseTexture *)iface); + basetexture_generate_mipmaps((IWineD3DBaseTexture *)iface); } /* Internal function, No d3d mapping */ static BOOL WINAPI IWineD3DTextureImpl_SetDirty(IWineD3DTexture *iface, BOOL dirty) { - return IWineD3DBaseTextureImpl_SetDirty((IWineD3DBaseTexture *)iface, dirty); + return basetexture_set_dirty((IWineD3DBaseTexture *)iface, dirty); } static BOOL WINAPI IWineD3DTextureImpl_GetDirty(IWineD3DTexture *iface) { - return IWineD3DBaseTextureImpl_GetDirty((IWineD3DBaseTexture *)iface); + return basetexture_get_dirty((IWineD3DBaseTexture *)iface); } static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface) { @@ -219,7 +219,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface) { TRACE("(%p) : relay to BaseTexture\n", This); - hr = IWineD3DBaseTextureImpl_BindTexture((IWineD3DBaseTexture *)iface); + hr = basetexture_bind((IWineD3DBaseTexture *)iface); if (set_gl_texture_desc && SUCCEEDED(hr)) { UINT i; for (i = 0; i < This->baseTexture.levels; ++i) { @@ -270,7 +270,7 @@ static void WINAPI IWineD3DTextureImpl_ApplyStateChanges(IWineD3DTexture *iface, const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) { TRACE("(%p) : relay to BaseTexture\n", iface); - IWineD3DBaseTextureImpl_ApplyStateChanges((IWineD3DBaseTexture *)iface, textureStates, samplerStates); + basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates); } /* ******************************************* @@ -291,7 +291,7 @@ static void WINAPI IWineD3DTextureImpl_Destroy(IWineD3DTexture *iface, D3DCB_DES } } TRACE("(%p) : cleaning up base texture\n", This); - IWineD3DBaseTextureImpl_CleanUp((IWineD3DBaseTexture *)iface); + basetexture_cleanup((IWineD3DBaseTexture *)iface); /* free the object */ HeapFree(GetProcessHeap(), 0, This); } diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 151e5ba11a1..fd4f4ee1987 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -318,7 +318,7 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info) gl_info->gl_formats[dst].glGammaInternal = gl_formats_template[src].glGammaInternal; gl_info->gl_formats[dst].glFormat = gl_formats_template[src].glFormat; gl_info->gl_formats[dst].glType = gl_formats_template[src].glType; - gl_info->gl_formats[dst].conversion_group= WINED3DFMT_UNKNOWN; + gl_info->gl_formats[dst].color_fixup = COLOR_FIXUP_IDENTITY; gl_info->gl_formats[dst].Flags = gl_formats_template[src].Flags; gl_info->gl_formats[dst].heightscale = 1.0; @@ -363,6 +363,26 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info) } } + dst = getFmtIdx(WINED3DFMT_R16F); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_W); + + dst = getFmtIdx(WINED3DFMT_R32F); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_W); + + dst = getFmtIdx(WINED3DFMT_G16R16); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_W); + + dst = getFmtIdx(WINED3DFMT_G16R16F); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_W); + + dst = getFmtIdx(WINED3DFMT_G32R32F); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_W); + /* V8U8 is supported natively by GL_ATI_envmap_bumpmap and GL_NV_texture_shader. * V16U16 is only supported by GL_NV_texture_shader. The formats need fixup if * their extensions are not available. GL_ATI_envmap_bumpmap is not used because @@ -372,21 +392,38 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info) * returns 0.0 when sampling from it, DirectX 1.0. So we always have in-shader * conversion for this format. */ - dst = getFmtIdx(WINED3DFMT_V8U8); - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8; - dst = getFmtIdx(WINED3DFMT_V16U16); - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_V8U8; + if (!GL_SUPPORT(NV_TEXTURE_SHADER)) + { + dst = getFmtIdx(WINED3DFMT_V8U8); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE); + dst = getFmtIdx(WINED3DFMT_V16U16); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE); + } + else + { + dst = getFmtIdx(WINED3DFMT_V8U8); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE); + dst = getFmtIdx(WINED3DFMT_V16U16); + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE); + } if(!GL_SUPPORT(NV_TEXTURE_SHADER)) { /* If GL_NV_texture_shader is not supported, those formats are converted, incompatibly * with each other */ dst = getFmtIdx(WINED3DFMT_L6V5U5); - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_L6V5U5; + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE); dst = getFmtIdx(WINED3DFMT_X8L8V8U8); - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_X8L8V8U8; + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_W); dst = getFmtIdx(WINED3DFMT_Q8W8V8U8); - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_Q8W8V8U8; + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 1, CHANNEL_SOURCE_Z, 1, CHANNEL_SOURCE_W); } else { /* If GL_NV_texture_shader is supported, WINED3DFMT_L6V5U5 and WINED3DFMT_X8L8V8U8 * are converted at surface loading time, but they do not need any modification in @@ -399,12 +436,14 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info) dst = getFmtIdx(WINED3DFMT_ATI2N); gl_info->gl_formats[dst].glInternal = GL_COMPRESSED_RED_GREEN_RGTC2_EXT; gl_info->gl_formats[dst].glGammaInternal = GL_COMPRESSED_RED_GREEN_RGTC2_EXT; - gl_info->gl_formats[dst].conversion_group= WINED3DFMT_ATI2N; + gl_info->gl_formats[dst].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE); } else if(GL_SUPPORT(ATI_TEXTURE_COMPRESSION_3DC)) { dst = getFmtIdx(WINED3DFMT_ATI2N); gl_info->gl_formats[dst].glInternal = GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI; gl_info->gl_formats[dst].glGammaInternal = GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI; - gl_info->gl_formats[dst].conversion_group= WINED3DFMT_ATI2N; + gl_info->gl_formats[dst].color_fixup= create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_W, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE); } if(!GL_SUPPORT(APPLE_YCBCR_422)) { @@ -413,19 +452,19 @@ BOOL initPixelFormats(WineD3D_GL_Info *gl_info) gl_info->gl_formats[dst].glGammaInternal = GL_LUMINANCE_ALPHA; /* not srgb */ gl_info->gl_formats[dst].glFormat = GL_LUMINANCE_ALPHA; gl_info->gl_formats[dst].glType = GL_UNSIGNED_BYTE; - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_YUY2; + gl_info->gl_formats[dst].color_fixup = create_yuv_fixup_desc(YUV_FIXUP_YUY2); dst = getFmtIdx(WINED3DFMT_UYVY); gl_info->gl_formats[dst].glInternal = GL_LUMINANCE_ALPHA; gl_info->gl_formats[dst].glGammaInternal = GL_LUMINANCE_ALPHA; /* not srgb */ gl_info->gl_formats[dst].glFormat = GL_LUMINANCE_ALPHA; gl_info->gl_formats[dst].glType = GL_UNSIGNED_BYTE; - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_UYVY; + gl_info->gl_formats[dst].color_fixup = create_yuv_fixup_desc(YUV_FIXUP_UYVY); } dst = getFmtIdx(WINED3DFMT_YV12); gl_info->gl_formats[dst].heightscale = 1.5; - gl_info->gl_formats[dst].conversion_group = WINED3DFMT_YV12; + gl_info->gl_formats[dst].color_fixup = create_yuv_fixup_desc(YUV_FIXUP_YV12); return TRUE; } @@ -466,7 +505,7 @@ void init_type_lookup(WineD3D_GL_Info *gl_info) { #define GLINFO_LOCATION This->adapter->gl_info const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const WineD3D_GL_Info *gl_info, - const GlPixelFormatDesc **glDesc) + const struct GlPixelFormatDesc **glDesc) { int idx = getFmtIdx(fmt); @@ -481,7 +520,7 @@ const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, const WineD3D * all gl caps check return "unsupported" than catching the lack of gl all over the code. ANSI C requires * static variables to be initialized to 0. */ - static const GlPixelFormatDesc dummyFmt; + static const struct GlPixelFormatDesc dummyFmt; *glDesc = &dummyFmt; } else { *glDesc = &gl_info->gl_formats[idx]; @@ -1115,6 +1154,55 @@ const char *debug_d3ddegree(WINED3DDEGREETYPE degree) { } } +const char *debug_fixup_channel_source(enum fixup_channel_source source) +{ + switch(source) + { +#define WINED3D_TO_STR(x) case x: return #x + WINED3D_TO_STR(CHANNEL_SOURCE_ZERO); + WINED3D_TO_STR(CHANNEL_SOURCE_ONE); + WINED3D_TO_STR(CHANNEL_SOURCE_X); + WINED3D_TO_STR(CHANNEL_SOURCE_Y); + WINED3D_TO_STR(CHANNEL_SOURCE_Z); + WINED3D_TO_STR(CHANNEL_SOURCE_W); + WINED3D_TO_STR(CHANNEL_SOURCE_YUV0); + WINED3D_TO_STR(CHANNEL_SOURCE_YUV1); +#undef WINED3D_TO_STR + default: + FIXME("Unrecognized fixup_channel_source %#x\n", source); + return "unrecognized"; + } +} + +const char *debug_yuv_fixup(enum yuv_fixup yuv_fixup) +{ + switch(yuv_fixup) + { +#define WINED3D_TO_STR(x) case x: return #x + WINED3D_TO_STR(YUV_FIXUP_YUY2); + WINED3D_TO_STR(YUV_FIXUP_UYVY); + WINED3D_TO_STR(YUV_FIXUP_YV12); +#undef WINED3D_TO_STR + default: + FIXME("Unrecognized YUV fixup %#x\n", yuv_fixup); + return "unrecognized"; + } +} + +void dump_color_fixup_desc(struct color_fixup_desc fixup) +{ + if (is_yuv_fixup(fixup)) + { + TRACE("\tYUV: %s\n", debug_yuv_fixup(get_yuv_fixup(fixup))); + return; + } + + TRACE("\tX: %s%s\n", debug_fixup_channel_source(fixup.x_source), fixup.x_sign_fixup ? ", SIGN_FIXUP" : ""); + TRACE("\tY: %s%s\n", debug_fixup_channel_source(fixup.y_source), fixup.y_sign_fixup ? ", SIGN_FIXUP" : ""); + TRACE("\tZ: %s%s\n", debug_fixup_channel_source(fixup.z_source), fixup.z_sign_fixup ? ", SIGN_FIXUP" : ""); + TRACE("\tW: %s%s\n", debug_fixup_channel_source(fixup.w_source), fixup.w_sign_fixup ? ", SIGN_FIXUP" : ""); +} + /***************************************************************************** * Useful functions mapping GL <-> D3D values */ @@ -1623,7 +1711,7 @@ void hash_table_destroy(struct hash_table_t *table, void (*free_value)(void *val HeapFree(GetProcessHeap(), 0, table); } -static inline struct hash_table_entry_t *hash_table_get_by_idx(struct hash_table_t *table, const void *key, +static inline struct hash_table_entry_t *hash_table_get_by_idx(const struct hash_table_t *table, const void *key, unsigned int idx) { struct hash_table_entry_t *entry; @@ -1772,7 +1860,7 @@ void hash_table_remove(struct hash_table_t *table, void *key) hash_table_put(table, key, NULL); } -void *hash_table_get(struct hash_table_t *table, const void *key) +void *hash_table_get(const struct hash_table_t *table, const void *key) { unsigned int idx; struct hash_table_entry_t *entry; @@ -1829,7 +1917,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting settings->op[i].aop = WINED3DTOP_DISABLE; settings->op[i].carg0 = settings->op[i].carg1 = settings->op[i].carg2 = ARG_UNUSED; settings->op[i].aarg0 = settings->op[i].aarg1 = settings->op[i].aarg2 = ARG_UNUSED; - settings->op[i].color_correction = WINED3DFMT_UNKNOWN; + settings->op[i].color_correction = COLOR_FIXUP_IDENTITY; settings->op[i].dst = resultreg; settings->op[i].tex_type = tex_1d; settings->op[i].projected = proj_none; @@ -1839,7 +1927,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting texture = (IWineD3DBaseTextureImpl *) stateblock->textures[i]; if(texture) { - settings->op[i].color_correction = texture->baseTexture.shader_conversion_group; + settings->op[i].color_correction = texture->baseTexture.shader_color_fixup; if(ignore_textype) { settings->op[i].tex_type = tex_1d; } else { @@ -1862,7 +1950,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting } } } else { - settings->op[i].color_correction = WINED3DFMT_UNKNOWN; + settings->op[i].color_correction = COLOR_FIXUP_IDENTITY; settings->op[i].tex_type = tex_1d; } @@ -2004,7 +2092,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting } #undef GLINFO_LOCATION -const struct ffp_frag_desc *find_ffp_frag_shader(struct hash_table_t *fragment_shaders, +const struct ffp_frag_desc *find_ffp_frag_shader(const struct hash_table_t *fragment_shaders, const struct ffp_frag_settings *settings) { return (const struct ffp_frag_desc *)hash_table_get(fragment_shaders, settings); diff --git a/dlls/wined3d/vertexbuffer.c b/dlls/wined3d/vertexbuffer.c index 5f687ff0bfc..59640335ba7 100644 --- a/dlls/wined3d/vertexbuffer.c +++ b/dlls/wined3d/vertexbuffer.c @@ -72,7 +72,7 @@ static ULONG WINAPI IWineD3DVertexBufferImpl_Release(IWineD3DVertexBuffer *iface LEAVE_GL(); } - IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface); + resource_cleanup((IWineD3DResource *)iface); HeapFree(GetProcessHeap(), 0, This); } return ref; @@ -82,27 +82,27 @@ static ULONG WINAPI IWineD3DVertexBufferImpl_Release(IWineD3DVertexBuffer *iface IWineD3DVertexBuffer IWineD3DResource parts follow **************************************************** */ static HRESULT WINAPI IWineD3DVertexBufferImpl_GetDevice(IWineD3DVertexBuffer *iface, IWineD3DDevice** ppDevice) { - return IWineD3DResourceImpl_GetDevice((IWineD3DResource *)iface, ppDevice); + return resource_get_device((IWineD3DResource *)iface, ppDevice); } static HRESULT WINAPI IWineD3DVertexBufferImpl_SetPrivateData(IWineD3DVertexBuffer *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { - return IWineD3DResourceImpl_SetPrivateData((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); + return resource_set_private_data((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); } static HRESULT WINAPI IWineD3DVertexBufferImpl_GetPrivateData(IWineD3DVertexBuffer *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { - return IWineD3DResourceImpl_GetPrivateData((IWineD3DResource *)iface, refguid, pData, pSizeOfData); + return resource_get_private_data((IWineD3DResource *)iface, refguid, pData, pSizeOfData); } static HRESULT WINAPI IWineD3DVertexBufferImpl_FreePrivateData(IWineD3DVertexBuffer *iface, REFGUID refguid) { - return IWineD3DResourceImpl_FreePrivateData((IWineD3DResource *)iface, refguid); + return resource_free_private_data((IWineD3DResource *)iface, refguid); } static DWORD WINAPI IWineD3DVertexBufferImpl_SetPriority(IWineD3DVertexBuffer *iface, DWORD PriorityNew) { - return IWineD3DResourceImpl_SetPriority((IWineD3DResource *)iface, PriorityNew); + return resource_set_priority((IWineD3DResource *)iface, PriorityNew); } static DWORD WINAPI IWineD3DVertexBufferImpl_GetPriority(IWineD3DVertexBuffer *iface) { - return IWineD3DResourceImpl_GetPriority((IWineD3DResource *)iface); + return resource_get_priority((IWineD3DResource *)iface); } static inline void fixup_d3dcolor(DWORD *pos) { @@ -143,7 +143,8 @@ static inline void fixup_transformed_pos(float *p) { p[3] = w; } -DWORD *find_conversion_shift(IWineD3DVertexBufferImpl *This, WineDirect3DVertexStridedData *strided, DWORD stride) { +static DWORD *find_conversion_shift(IWineD3DVertexBufferImpl *This, const WineDirect3DVertexStridedData *strided, DWORD stride) +{ DWORD *ret, i, shift, j, type; DWORD orig_type_size; @@ -279,7 +280,7 @@ static inline BOOL check_attribute(IWineD3DVertexBufferImpl *This, const WineDir return ret; } -inline BOOL WINAPI IWineD3DVertexBufferImpl_FindDecl(IWineD3DVertexBufferImpl *This) +static inline BOOL IWineD3DVertexBufferImpl_FindDecl(IWineD3DVertexBufferImpl *This) { IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; BOOL ret = FALSE; @@ -622,7 +623,7 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if case CONV_FLOAT16_2: { float *out = (float *) (&data[This->conv_stride * i + j + This->conv_shift[j]]); - WORD *in = (WORD *) (&This->resource.allocatedMemory[i * This->stride + j]); + const WORD *in = (WORD *) (&This->resource.allocatedMemory[i * This->stride + j]); out[1] = float_16_to_32(in + 1); out[0] = float_16_to_32(in + 0); @@ -703,11 +704,11 @@ static void WINAPI IWineD3DVertexBufferImpl_UnLoad(IWineD3DVertexBuffer *iface) } static WINED3DRESOURCETYPE WINAPI IWineD3DVertexBufferImpl_GetType(IWineD3DVertexBuffer *iface) { - return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); + return resource_get_type((IWineD3DResource *)iface); } static HRESULT WINAPI IWineD3DVertexBufferImpl_GetParent(IWineD3DVertexBuffer *iface, IUnknown **pParent) { - return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); + return resource_get_parent((IWineD3DResource *)iface, pParent); } /* ****************************************************** @@ -743,7 +744,7 @@ static HRESULT WINAPI IWineD3DVertexBufferImpl_Lock(IWineD3DVertexBuffer *iface /* TODO: check Flags compatibility with This->currentDesc.Usage (see MSDN) */ return WINED3D_OK; } -HRESULT WINAPI IWineD3DVertexBufferImpl_Unlock(IWineD3DVertexBuffer *iface) { +static HRESULT WINAPI IWineD3DVertexBufferImpl_Unlock(IWineD3DVertexBuffer *iface) { IWineD3DVertexBufferImpl *This = (IWineD3DVertexBufferImpl *) iface; LONG lockcount; TRACE("(%p)\n", This); @@ -796,7 +797,8 @@ const IWineD3DVertexBufferVtbl IWineD3DVertexBuffer_Vtbl = IWineD3DVertexBufferImpl_GetDesc }; -BYTE* WINAPI IWineD3DVertexBufferImpl_GetMemory(IWineD3DVertexBuffer* iface, DWORD iOffset, GLint *vbo) { +const BYTE* IWineD3DVertexBufferImpl_GetMemory(IWineD3DVertexBuffer* iface, DWORD iOffset, GLint *vbo) +{ IWineD3DVertexBufferImpl *This = (IWineD3DVertexBufferImpl *)iface; *vbo = This->vbo; @@ -806,15 +808,11 @@ BYTE* WINAPI IWineD3DVertexBufferImpl_GetMemory(IWineD3DVertexBuffer* iface, DWO This->Flags &= ~VBFLAG_CREATEVBO; if(This->vbo) { *vbo = This->vbo; - return (BYTE *) iOffset; + return (const BYTE *)iOffset; } } return This->resource.allocatedMemory + iOffset; } else { - return (BYTE *) iOffset; + return (const BYTE *)iOffset; } } - -HRESULT WINAPI IWineD3DVertexBufferImpl_ReleaseMemory(IWineD3DVertexBuffer* iface) { - return WINED3D_OK; -} diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c index 10986614e54..0f246f95867 100644 --- a/dlls/wined3d/vertexshader.c +++ b/dlls/wined3d/vertexshader.c @@ -316,11 +316,9 @@ static inline void find_swizzled_attribs(IWineD3DVertexDeclaration *declaration, } /** Generate a vertex shader string using either GL_VERTEX_PROGRAM_ARB or GLSL and send it to the card */ -static VOID IWineD3DVertexShaderImpl_GenerateShader( - IWineD3DVertexShader *iface, - shader_reg_maps* reg_maps, - CONST DWORD *pFunction) { - +static void IWineD3DVertexShaderImpl_GenerateShader(IWineD3DVertexShader *iface, + const struct shader_reg_maps* reg_maps, const DWORD *pFunction) +{ IWineD3DVertexShaderImpl *This = (IWineD3DVertexShaderImpl *)iface; IWineD3DVertexDeclaration *decl = ((IWineD3DDeviceImpl *) This->baseShader.device)->stateBlock->vertexDecl; SHADER_BUFFER buffer; @@ -485,7 +483,7 @@ static void WINAPI IWineD3DVertexShaderImpl_FakeSemantics(IWineD3DVertexShader * int i; for (i = 0; i < vdecl->declarationWNumElements - 1; ++i) { - WINED3DVERTEXELEMENT* element = vdecl->pDeclarationWine + i; + const WINED3DVERTEXELEMENT *element = vdecl->pDeclarationWine + i; vshader_set_input(This, element->Reg, element->Usage, element->UsageIndex); } } diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index 8faef0ca8fb..6700bb4a051 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -94,7 +94,7 @@ static ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) { TRACE("(%p) : Releasing from %d\n", This, This->resource.ref); ref = InterlockedDecrement(&This->resource.ref); if (ref == 0) { - IWineD3DResourceImpl_CleanUp((IWineD3DResource *)iface); + resource_cleanup((IWineD3DResource *)iface); HeapFree(GetProcessHeap(), 0, This); } return ref; @@ -104,35 +104,35 @@ static ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) { IWineD3DVolume IWineD3DResource parts follow **************************************************** */ static HRESULT WINAPI IWineD3DVolumeImpl_GetParent(IWineD3DVolume *iface, IUnknown **pParent) { - return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); + return resource_get_parent((IWineD3DResource *)iface, pParent); } static HRESULT WINAPI IWineD3DVolumeImpl_GetDevice(IWineD3DVolume *iface, IWineD3DDevice** ppDevice) { - return IWineD3DResourceImpl_GetDevice((IWineD3DResource *)iface, ppDevice); + return resource_get_device((IWineD3DResource *)iface, ppDevice); } static HRESULT WINAPI IWineD3DVolumeImpl_SetPrivateData(IWineD3DVolume *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { - return IWineD3DResourceImpl_SetPrivateData((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); + return resource_set_private_data((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); } static HRESULT WINAPI IWineD3DVolumeImpl_GetPrivateData(IWineD3DVolume *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { - return IWineD3DResourceImpl_GetPrivateData((IWineD3DResource *)iface, refguid, pData, pSizeOfData); + return resource_get_private_data((IWineD3DResource *)iface, refguid, pData, pSizeOfData); } static HRESULT WINAPI IWineD3DVolumeImpl_FreePrivateData(IWineD3DVolume *iface, REFGUID refguid) { - return IWineD3DResourceImpl_FreePrivateData((IWineD3DResource *)iface, refguid); + return resource_free_private_data((IWineD3DResource *)iface, refguid); } static DWORD WINAPI IWineD3DVolumeImpl_SetPriority(IWineD3DVolume *iface, DWORD PriorityNew) { - return IWineD3DResourceImpl_SetPriority((IWineD3DResource *)iface, PriorityNew); + return resource_set_priority((IWineD3DResource *)iface, PriorityNew); } static DWORD WINAPI IWineD3DVolumeImpl_GetPriority(IWineD3DVolume *iface) { - return IWineD3DResourceImpl_GetPriority((IWineD3DResource *)iface); + return resource_get_priority((IWineD3DResource *)iface); } static void WINAPI IWineD3DVolumeImpl_PreLoad(IWineD3DVolume *iface) { - IWineD3DResourceImpl_PreLoad((IWineD3DResource *)iface); + FIXME("iface %p stub!\n", iface); } static void WINAPI IWineD3DVolumeImpl_UnLoad(IWineD3DVolume *iface) { @@ -143,7 +143,7 @@ static void WINAPI IWineD3DVolumeImpl_UnLoad(IWineD3DVolume *iface) { } static WINED3DRESOURCETYPE WINAPI IWineD3DVolumeImpl_GetType(IWineD3DVolume *iface) { - return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); + return resource_get_type((IWineD3DResource *)iface); } /* ******************************************* @@ -310,7 +310,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWi static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int gl_level, BOOL srgb_mode) { IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; WINED3DFORMAT format = This->resource.format; - const GlPixelFormatDesc *glDesc; + const struct GlPixelFormatDesc *glDesc; getFormatDescEntry(format, &GLINFO_LOCATION, &glDesc); TRACE("(%p) : level %u, format %s (0x%08x)\n", This, gl_level, debug_d3dformat(format), format); diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index 53275e17ca7..9da4c95f20d 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -67,27 +67,27 @@ static ULONG WINAPI IWineD3DVolumeTextureImpl_Release(IWineD3DVolumeTexture *ifa IWineD3DVolumeTexture IWineD3DResource parts follow **************************************************** */ static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetDevice(IWineD3DVolumeTexture *iface, IWineD3DDevice** ppDevice) { - return IWineD3DResourceImpl_GetDevice((IWineD3DResource *)iface, ppDevice); + return resource_get_device((IWineD3DResource *)iface, ppDevice); } static HRESULT WINAPI IWineD3DVolumeTextureImpl_SetPrivateData(IWineD3DVolumeTexture *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) { - return IWineD3DResourceImpl_SetPrivateData((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); + return resource_set_private_data((IWineD3DResource *)iface, refguid, pData, SizeOfData, Flags); } static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetPrivateData(IWineD3DVolumeTexture *iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) { - return IWineD3DResourceImpl_GetPrivateData((IWineD3DResource *)iface, refguid, pData, pSizeOfData); + return resource_get_private_data((IWineD3DResource *)iface, refguid, pData, pSizeOfData); } static HRESULT WINAPI IWineD3DVolumeTextureImpl_FreePrivateData(IWineD3DVolumeTexture *iface, REFGUID refguid) { - return IWineD3DResourceImpl_FreePrivateData((IWineD3DResource *)iface, refguid); + return resource_free_private_data((IWineD3DResource *)iface, refguid); } static DWORD WINAPI IWineD3DVolumeTextureImpl_SetPriority(IWineD3DVolumeTexture *iface, DWORD PriorityNew) { - return IWineD3DResourceImpl_SetPriority((IWineD3DResource *)iface, PriorityNew); + return resource_set_priority((IWineD3DResource *)iface, PriorityNew); } static DWORD WINAPI IWineD3DVolumeTextureImpl_GetPriority(IWineD3DVolumeTexture *iface) { - return IWineD3DResourceImpl_GetPriority((IWineD3DResource *)iface); + return resource_get_priority((IWineD3DResource *)iface); } static void WINAPI IWineD3DVolumeTextureImpl_PreLoad(IWineD3DVolumeTexture *iface) { @@ -145,57 +145,57 @@ static void WINAPI IWineD3DVolumeTextureImpl_UnLoad(IWineD3DVolumeTexture *iface IWineD3DVolume_UnLoad(This->volumes[i]); } - IWineD3DBaseTextureImpl_UnLoad((IWineD3DBaseTexture *) iface); + basetexture_unload((IWineD3DBaseTexture *)iface); } static WINED3DRESOURCETYPE WINAPI IWineD3DVolumeTextureImpl_GetType(IWineD3DVolumeTexture *iface) { - return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); + return resource_get_type((IWineD3DResource *)iface); } static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetParent(IWineD3DVolumeTexture *iface, IUnknown **pParent) { - return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); + return resource_get_parent((IWineD3DResource *)iface, pParent); } /* ****************************************************** IWineD3DVolumeTexture IWineD3DBaseTexture parts follow ****************************************************** */ static DWORD WINAPI IWineD3DVolumeTextureImpl_SetLOD(IWineD3DVolumeTexture *iface, DWORD LODNew) { - return IWineD3DBaseTextureImpl_SetLOD((IWineD3DBaseTexture *)iface, LODNew); + return basetexture_set_lod((IWineD3DBaseTexture *)iface, LODNew); } static DWORD WINAPI IWineD3DVolumeTextureImpl_GetLOD(IWineD3DVolumeTexture *iface) { - return IWineD3DBaseTextureImpl_GetLOD((IWineD3DBaseTexture *)iface); + return basetexture_get_lod((IWineD3DBaseTexture *)iface); } static DWORD WINAPI IWineD3DVolumeTextureImpl_GetLevelCount(IWineD3DVolumeTexture *iface) { - return IWineD3DBaseTextureImpl_GetLevelCount((IWineD3DBaseTexture *)iface); + return basetexture_get_level_count((IWineD3DBaseTexture *)iface); } static HRESULT WINAPI IWineD3DVolumeTextureImpl_SetAutoGenFilterType(IWineD3DVolumeTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) { - return IWineD3DBaseTextureImpl_SetAutoGenFilterType((IWineD3DBaseTexture *)iface, FilterType); + return basetexture_set_autogen_filter_type((IWineD3DBaseTexture *)iface, FilterType); } static WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DVolumeTextureImpl_GetAutoGenFilterType(IWineD3DVolumeTexture *iface) { - return IWineD3DBaseTextureImpl_GetAutoGenFilterType((IWineD3DBaseTexture *)iface); + return basetexture_get_autogen_filter_type((IWineD3DBaseTexture *)iface); } static void WINAPI IWineD3DVolumeTextureImpl_GenerateMipSubLevels(IWineD3DVolumeTexture *iface) { - IWineD3DBaseTextureImpl_GenerateMipSubLevels((IWineD3DBaseTexture *)iface); + basetexture_generate_mipmaps((IWineD3DBaseTexture *)iface); } /* Internal function, No d3d mapping */ static BOOL WINAPI IWineD3DVolumeTextureImpl_SetDirty(IWineD3DVolumeTexture *iface, BOOL dirty) { - return IWineD3DBaseTextureImpl_SetDirty((IWineD3DBaseTexture *)iface, dirty); + return basetexture_set_dirty((IWineD3DBaseTexture *)iface, dirty); } static BOOL WINAPI IWineD3DVolumeTextureImpl_GetDirty(IWineD3DVolumeTexture *iface) { - return IWineD3DBaseTextureImpl_GetDirty((IWineD3DBaseTexture *)iface); + return basetexture_get_dirty((IWineD3DBaseTexture *)iface); } static HRESULT WINAPI IWineD3DVolumeTextureImpl_BindTexture(IWineD3DVolumeTexture *iface) { IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; TRACE("(%p) : relay to BaseTexture\n", This); - return IWineD3DBaseTextureImpl_BindTexture((IWineD3DBaseTexture *)iface); + return basetexture_bind((IWineD3DBaseTexture *)iface); } static UINT WINAPI IWineD3DVolumeTextureImpl_GetTextureDimensions(IWineD3DVolumeTexture *iface) { @@ -216,7 +216,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_ApplyStateChanges(IWineD3DVolumeTex const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) { IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; TRACE("(%p) : nothing to do, passing to base texture\n", This); - IWineD3DBaseTextureImpl_ApplyStateChanges((IWineD3DBaseTexture *)iface, textureStates, samplerStates); + basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates); } @@ -234,7 +234,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_Destroy(IWineD3DVolumeTexture *ifac D3DCB_DestroyVolume(This->volumes[i]); } } - IWineD3DBaseTextureImpl_CleanUp((IWineD3DBaseTexture *) iface); + basetexture_cleanup((IWineD3DBaseTexture *)iface); HeapFree(GetProcessHeap(), 0, This); } diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 0dababca29e..f92adc6a730 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -1754,7 +1754,7 @@ typedef void (WINE_GLAPI * PGLFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const #define GL_MODELVIEW30_ARB 0x873E #define GL_MODELVIEW31_ARB 0x873F #endif -typedef void (WINE_GLAPI * PGLFNGLWEIGHTPOINTERARB) (GLint size, GLenum type, GLsizei stride, GLvoid* pointer); +typedef void (WINE_GLAPI * PGLFNGLWEIGHTPOINTERARB) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (WINE_GLAPI * PGLFNGLWEIGHTBV) (GLint size, const GLbyte *weights); typedef void (WINE_GLAPI * PGLFNGLWEIGHTSV) (GLint size, const GLshort *weights); typedef void (WINE_GLAPI * PGLFNGLWEIGHTIV) (GLint size, const GLint *weights); @@ -3813,13 +3813,6 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLSETPIXELFORMATWINE) (HDC hdc, int iPixelFor * Structures ****************************************************/ -typedef struct { - GLint glInternal, glGammaInternal, rtInternal, glFormat, glType; - WINED3DFORMAT conversion_group; - unsigned int Flags; - float heightscale; -} GlPixelFormatDesc; - typedef struct _WINED3DGLTYPE { int d3dType; GLint size; @@ -3889,7 +3882,7 @@ typedef struct _WineD3D_GL_Info { /** OpenGL WGL functions ptr */ WGL_EXT_FUNCS_GEN - GlPixelFormatDesc *gl_formats; + struct GlPixelFormatDesc *gl_formats; /* Vertex data types */ WINED3DGLTYPE glTypeLookup[WINED3DDECLTYPE_UNUSED]; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6ea6663c668..db19c193043 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -43,6 +43,90 @@ #include "wined3d_gl.h" #include "wine/list.h" +/* Texture format fixups */ + +enum fixup_channel_source +{ + CHANNEL_SOURCE_ZERO = 0, + CHANNEL_SOURCE_ONE = 1, + CHANNEL_SOURCE_X = 2, + CHANNEL_SOURCE_Y = 3, + CHANNEL_SOURCE_Z = 4, + CHANNEL_SOURCE_W = 5, + CHANNEL_SOURCE_YUV0 = 6, + CHANNEL_SOURCE_YUV1 = 7, +}; + +enum yuv_fixup +{ + YUV_FIXUP_YUY2 = 0, + YUV_FIXUP_UYVY = 1, + YUV_FIXUP_YV12 = 2, +}; + +#include +struct color_fixup_desc +{ + unsigned x_sign_fixup : 1; + unsigned x_source : 3; + unsigned y_sign_fixup : 1; + unsigned y_source : 3; + unsigned z_sign_fixup : 1; + unsigned z_source : 3; + unsigned w_sign_fixup : 1; + unsigned w_source : 3; +}; +#include + +static const struct color_fixup_desc COLOR_FIXUP_IDENTITY = + {0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_W}; + +static inline struct color_fixup_desc create_color_fixup_desc( + int sign0, enum fixup_channel_source src0, int sign1, enum fixup_channel_source src1, + int sign2, enum fixup_channel_source src2, int sign3, enum fixup_channel_source src3) +{ + struct color_fixup_desc fixup = + { + sign0, src0, + sign1, src1, + sign2, src2, + sign3, src3, + }; + return fixup; +} + +static inline struct color_fixup_desc create_yuv_fixup_desc(enum yuv_fixup yuv_fixup) +{ + struct color_fixup_desc fixup = + { + 0, yuv_fixup & (1 << 0) ? CHANNEL_SOURCE_YUV1 : CHANNEL_SOURCE_YUV0, + 0, yuv_fixup & (1 << 1) ? CHANNEL_SOURCE_YUV1 : CHANNEL_SOURCE_YUV0, + 0, yuv_fixup & (1 << 2) ? CHANNEL_SOURCE_YUV1 : CHANNEL_SOURCE_YUV0, + 0, yuv_fixup & (1 << 3) ? CHANNEL_SOURCE_YUV1 : CHANNEL_SOURCE_YUV0, + }; + return fixup; +} + +static inline BOOL is_identity_fixup(struct color_fixup_desc fixup) +{ + return !memcmp(&fixup, &COLOR_FIXUP_IDENTITY, sizeof(fixup)); +} + +static inline BOOL is_yuv_fixup(struct color_fixup_desc fixup) +{ + return fixup.x_source == CHANNEL_SOURCE_YUV0 || fixup.x_source == CHANNEL_SOURCE_YUV1; +} + +static inline enum yuv_fixup get_yuv_fixup(struct color_fixup_desc fixup) +{ + enum yuv_fixup yuv_fixup = 0; + if (fixup.x_source == CHANNEL_SOURCE_YUV1) yuv_fixup |= (1 << 0); + if (fixup.y_source == CHANNEL_SOURCE_YUV1) yuv_fixup |= (1 << 1); + if (fixup.z_source == CHANNEL_SOURCE_YUV1) yuv_fixup |= (1 << 2); + if (fixup.w_source == CHANNEL_SOURCE_YUV1) yuv_fixup |= (1 << 3); + return yuv_fixup; +} + /* Hash table functions */ typedef unsigned int (hash_function_t)(const void *key); typedef BOOL (compare_function_t)(const void *keya, const void *keyb); @@ -69,7 +153,7 @@ struct hash_table_t { struct hash_table_t *hash_table_create(hash_function_t *hash_function, compare_function_t *compare_function); void hash_table_destroy(struct hash_table_t *table, void (*free_value)(void *value, void *cb), void *cb); -void *hash_table_get(struct hash_table_t *table, const void *key); +void *hash_table_get(const struct hash_table_t *table, const void *key); void hash_table_put(struct hash_table_t *table, void *key, void *value); void hash_table_remove(struct hash_table_t *table, void *key); @@ -107,8 +191,8 @@ typedef enum _WINELOOKUP { MAX_LOOKUPS = 1 } WINELOOKUP; -extern int minLookup[MAX_LOOKUPS]; -extern int maxLookup[MAX_LOOKUPS]; +extern const int minLookup[MAX_LOOKUPS]; +extern const int maxLookup[MAX_LOOKUPS]; extern DWORD *stateLookup[MAX_LOOKUPS]; struct min_lookup @@ -350,7 +434,7 @@ typedef struct { void (*shader_deselect_depth_blt)(IWineD3DDevice *iface); void (*shader_load_constants)(IWineD3DDevice *iface, char usePS, char useVS); void (*shader_cleanup)(IWineD3DDevice *iface); - void (*shader_color_correction)(const struct SHADER_OPCODE_ARG *arg); + void (*shader_color_correction)(const struct SHADER_OPCODE_ARG *arg, struct color_fixup_desc fixup); void (*shader_destroy)(IWineD3DBaseShader *iface); HRESULT (*shader_alloc_private)(IWineD3DDevice *iface); void (*shader_free_private)(IWineD3DDevice *iface); @@ -358,7 +442,7 @@ typedef struct { GLuint (*shader_generate_pshader)(IWineD3DPixelShader *iface, SHADER_BUFFER *buffer); void (*shader_generate_vshader)(IWineD3DVertexShader *iface, SHADER_BUFFER *buffer); void (*shader_get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *caps); - BOOL (*shader_conv_supported)(WINED3DFORMAT conv); + BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup); } shader_backend_t; extern const shader_backend_t glsl_shader_backend; @@ -402,11 +486,12 @@ extern int num_lock; #define D3DCOLOR_B(dw) (((float) (((dw) >> 0) & 0xFF)) / 255.0f) #define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f) -#define D3DCOLORTOGLFLOAT4(dw, vec) \ +#define D3DCOLORTOGLFLOAT4(dw, vec) do { \ (vec)[0] = D3DCOLOR_R(dw); \ (vec)[1] = D3DCOLOR_G(dw); \ (vec)[2] = D3DCOLOR_B(dw); \ - (vec)[3] = D3DCOLOR_A(dw); + (vec)[3] = D3DCOLOR_A(dw); \ +} while(0) /* DirectX Device Limits */ /* --------------------- */ @@ -420,8 +505,9 @@ extern int num_lock; /* Checking of API calls */ /* --------------------- */ +#ifndef WINE_NO_DEBUG_MSGS #define checkGLcall(A) \ -{ \ +do { \ GLint err = glGetError(); \ if (err == GL_NO_ERROR) { \ TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \ @@ -431,7 +517,10 @@ extern int num_lock; debug_glerror(err), err, A, __FILE__, __LINE__); \ err = glGetError(); \ } while (err != GL_NO_ERROR); \ -} +} while(0) +#else +#define checkGLcall(A) do {} while(0) +#endif /* Trace routines / diagnostics */ /* ---------------------------- */ @@ -448,13 +537,13 @@ do { /* Macro to dump out the current state of the light chain */ #define DUMP_LIGHT_CHAIN() \ -{ \ +do { \ PLIGHTINFOEL *el = This->stateBlock->lights;\ while (el) { \ TRACE("Light %p (glIndex %ld, d3dIndex %ld, enabled %d)\n", el, el->glIndex, el->OriginalIndex, el->lightEnabled);\ el = el->next; \ } \ -} +} while(0) /* Trace vector and strided data information */ #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w); @@ -487,21 +576,6 @@ extern const float identity[16]; # define VTRACE(A) #endif -/* Checking of per-vertex related GL calls */ -/* --------------------- */ -#define vcheckGLcall(A) \ -{ \ - GLint err = glGetError(); \ - if (err == GL_NO_ERROR) { \ - VTRACE(("%s call ok %s / %d\n", A, __FILE__, __LINE__)); \ - \ - } else do { \ - FIXME(">>>>>>>>>>>>>>>>> %s (%#x) from %s @ %s / %d\n", \ - debug_glerror(err), err, A, __FILE__, __LINE__); \ - err = glGetError(); \ - } while (err != GL_NO_ERROR); \ -} - /* TODO: Confirm each of these works when wined3d move completed */ #if 0 /* NOTE: Must be 0 in cvs */ /* To avoid having to get gigabytes of trace, the following can be compiled in, and at the start @@ -556,8 +630,8 @@ void primitiveDeclarationConvertToStridedData( DWORD get_flexible_vertex_size(DWORD d3dvtVertexType); -typedef void (WINE_GLAPI *glAttribFunc)(void *data); -typedef void (WINE_GLAPI *glMultiTexCoordFunc)(GLenum unit, void *data); +typedef void (WINE_GLAPI *glAttribFunc)(const void *data); +typedef void (WINE_GLAPI *glMultiTexCoordFunc)(GLenum unit, const void *data); extern glAttribFunc position_funcs[WINED3DDECLTYPE_UNUSED]; extern glAttribFunc diffuse_funcs[WINED3DDECLTYPE_UNUSED]; extern glAttribFunc specular_funcs[WINED3DDECLTYPE_UNUSED]; @@ -650,7 +724,7 @@ struct fragment_pipeline { void (*get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct fragment_caps *caps); HRESULT (*alloc_private)(IWineD3DDevice *iface); void (*free_private)(IWineD3DDevice *iface); - BOOL (*conv_supported)(WINED3DFORMAT conv); + BOOL (*color_fixup_supported)(struct color_fixup_desc fixup); const struct StateEntryTemplate *states; BOOL ffp_proj_control; }; @@ -664,12 +738,9 @@ extern const struct fragment_pipeline nvts_fragment_pipeline; extern const struct fragment_pipeline nvrc_fragment_pipeline; /* "Base" state table */ -void compile_state_table(struct StateEntry *StateTable, - APPLYSTATEFUNC **dev_multistate_funcs, - WineD3D_GL_Info *gl_info, - const struct StateEntryTemplate *vertex, - const struct fragment_pipeline *fragment, - const struct StateEntryTemplate *misc); +void compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, + const WineD3D_GL_Info *gl_info, const struct StateEntryTemplate *vertex, + const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc); /* Shaders for color conversions in blits */ struct blit_shader { @@ -677,7 +748,7 @@ struct blit_shader { void (*free_private)(IWineD3DDevice *iface); HRESULT (*set_shader)(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum textype, UINT width, UINT height); void (*unset_shader)(IWineD3DDevice *iface); - BOOL (*conv_supported)(WINED3DFORMAT conv); + BOOL (*color_fixup_supported)(struct color_fixup_desc fixup); }; extern const struct blit_shader ffp_blit; @@ -850,17 +921,24 @@ enum dst_arg /***************************************************************************** * Fixed function pipeline replacements */ +#define ARG_UNUSED 0x3f struct texture_stage_op { - unsigned cop : 5, aop : 5; -#define ARG_UNUSED 0x3f - unsigned carg1 : 6, carg2 : 6, carg0 : 6; + unsigned cop : 8; + unsigned carg1 : 8; + unsigned carg2 : 8; + unsigned carg0 : 8; + + unsigned aop : 8; + unsigned aarg1 : 8; + unsigned aarg2 : 8; + unsigned aarg0 : 8; + + struct color_fixup_desc color_correction; unsigned tex_type : 3; - unsigned dst : 1; /* Total of 32 bits */ - unsigned aarg1 : 6, aarg2 : 6, aarg0 : 6; + unsigned dst : 1; unsigned projected : 2; - unsigned padding : 12; /* Total of 64 bits */ - WINED3DFORMAT color_correction; + unsigned padding : 10; }; struct ffp_frag_settings { @@ -881,7 +959,7 @@ struct ffp_frag_desc }; void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_settings *settings, BOOL ignore_textype); -const struct ffp_frag_desc *find_ffp_frag_shader(struct hash_table_t *fragment_shaders, +const struct ffp_frag_desc *find_ffp_frag_shader(const struct hash_table_t *fragment_shaders, const struct ffp_frag_settings *settings); void add_ffp_frag_shader(struct hash_table_t *shaders, struct ffp_frag_desc *desc); BOOL ffp_frag_program_key_compare(const void *keya, const void *keyb); @@ -1042,7 +1120,7 @@ struct IWineD3DDeviceImpl /* Stream source management */ WineDirect3DVertexStridedData strided_streams; - WineDirect3DVertexStridedData *up_strided; + const WineDirect3DVertexStridedData *up_strided; BOOL useDrawStridedSlow; BOOL instancedDraw; @@ -1081,7 +1159,6 @@ typedef struct PrivateData GUID tag; DWORD flags; /* DDSPD_* */ - DWORD uniqueness_value; union { @@ -1123,6 +1200,18 @@ typedef struct IWineD3DResourceImpl IWineD3DResourceClass resource; } IWineD3DResourceImpl; +void resource_cleanup(IWineD3DResource *iface); +HRESULT resource_free_private_data(IWineD3DResource *iface, REFGUID guid); +HRESULT resource_get_device(IWineD3DResource *iface, IWineD3DDevice **device); +HRESULT resource_get_parent(IWineD3DResource *iface, IUnknown **parent); +DWORD resource_get_priority(IWineD3DResource *iface); +HRESULT resource_get_private_data(IWineD3DResource *iface, REFGUID guid, + void *data, DWORD *data_size); +WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface); +DWORD resource_set_priority(IWineD3DResource *iface, DWORD new_priority); +HRESULT resource_set_private_data(IWineD3DResource *iface, REFGUID guid, + const void *data, DWORD data_size, DWORD flags); + /* Tests show that the start address of resources is 32 byte aligned */ #define RESOURCE_ALIGNMENT 32 @@ -1222,20 +1311,20 @@ typedef enum winetexturestates { */ typedef struct IWineD3DBaseTextureClass { + DWORD states[MAX_WINETEXTURESTATES]; UINT levels; BOOL dirty; UINT textureName; + float pow2Matrix[16]; UINT LOD; WINED3DTEXTUREFILTERTYPE filterType; - DWORD states[MAX_WINETEXTURESTATES]; LONG bindCount; DWORD sampler; BOOL is_srgb; UINT srgb_mode_change_count; - WINED3DFORMAT shader_conversion_group; - float pow2Matrix[16]; const struct min_lookup *minMipLookup; const GLenum *magLookup; + struct color_fixup_desc shader_color_fixup; } IWineD3DBaseTextureClass; typedef struct IWineD3DBaseTextureImpl @@ -1247,6 +1336,21 @@ typedef struct IWineD3DBaseTextureImpl } IWineD3DBaseTextureImpl; +void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, + const DWORD texture_states[WINED3D_HIGHEST_TEXTURE_STATE + 1], + const DWORD sampler_states[WINED3D_HIGHEST_SAMPLER_STATE + 1]); +HRESULT basetexture_bind(IWineD3DBaseTexture *iface); +void basetexture_cleanup(IWineD3DBaseTexture *iface); +void basetexture_generate_mipmaps(IWineD3DBaseTexture *iface); +WINED3DTEXTUREFILTERTYPE basetexture_get_autogen_filter_type(IWineD3DBaseTexture *iface); +BOOL basetexture_get_dirty(IWineD3DBaseTexture *iface); +DWORD basetexture_get_level_count(IWineD3DBaseTexture *iface); +DWORD basetexture_get_lod(IWineD3DBaseTexture *iface); +HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE filter_type); +BOOL basetexture_set_dirty(IWineD3DBaseTexture *iface, BOOL dirty); +DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD new_lod); +void basetexture_unload(IWineD3DBaseTexture *iface); + /***************************************************************************** * IWineD3DTexture implementation structure (extends IWineD3DBaseTextureImpl) */ @@ -1281,8 +1385,6 @@ typedef struct IWineD3DCubeTextureImpl /* IWineD3DCubeTexture */ IWineD3DSurface *surfaces[6][MAX_LEVELS]; - - UINT edgeLength; } IWineD3DCubeTextureImpl; extern const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl; @@ -1331,10 +1433,6 @@ typedef struct IWineD3DVolumeTextureImpl /* IWineD3DVolumeTexture */ IWineD3DVolume *volumes[MAX_LEVELS]; - - UINT width; - UINT height; - UINT depth; } IWineD3DVolumeTextureImpl; extern const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl; @@ -1580,9 +1678,6 @@ typedef enum { CONVERT_Q8W8V8U8, CONVERT_V16U16, CONVERT_A4L4, - CONVERT_R32F, - CONVERT_R16F, - CONVERT_G16R16, } CONVERT_TYPES; HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, GLenum *format, GLenum *internal, GLenum *type, CONVERT_TYPES *convert, int *target_bpp, BOOL srgb_mode); @@ -1645,12 +1740,12 @@ typedef struct SAVEDSTATES { BOOL clipplane[MAX_CLIPPLANES]; BOOL vertexDecl; BOOL pixelShader; - BOOL pixelShaderConstantsB[MAX_CONST_B]; - BOOL pixelShaderConstantsI[MAX_CONST_I]; + WORD pixelShaderConstantsB; + WORD pixelShaderConstantsI; BOOL *pixelShaderConstantsF; BOOL vertexShader; - BOOL vertexShaderConstantsB[MAX_CONST_B]; - BOOL vertexShaderConstantsI[MAX_CONST_I]; + WORD vertexShaderConstantsB; + WORD vertexShaderConstantsI; BOOL *vertexShaderConstantsF; BOOL scissorRect; } SAVEDSTATES; @@ -1778,11 +1873,6 @@ extern void stateblock_savedstates_set( SAVEDSTATES* states, BOOL value); -extern void stateblock_savedstates_copy( - IWineD3DStateBlock* iface, - SAVEDSTATES* dest, - SAVEDSTATES* source); - extern void stateblock_copy( IWineD3DStateBlock* destination, IWineD3DStateBlock* source); @@ -1870,7 +1960,7 @@ typedef struct IWineD3DSwapChainImpl extern const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl; const IWineD3DSwapChainVtbl IWineGDISwapChain_Vtbl; -void x11_copy_to_screen(IWineD3DSwapChainImpl *This, LPRECT rc); +void x11_copy_to_screen(IWineD3DSwapChainImpl *This, const RECT *rc); HRESULT WINAPI IWineD3DBaseSwapChainImpl_QueryInterface(IWineD3DSwapChain *iface, REFIID riid, LPVOID *ppobj); ULONG WINAPI IWineD3DBaseSwapChainImpl_AddRef(IWineD3DSwapChain *iface); @@ -1912,6 +2002,9 @@ const char *debug_glerror(GLenum error); const char *debug_d3dbasis(WINED3DBASISTYPE basis); const char *debug_d3ddegree(WINED3DDEGREETYPE order); const char* debug_d3dtop(WINED3DTEXTUREOP d3dtop); +const char *debug_fixup_channel_source(enum fixup_channel_source source); +const char *debug_yuv_fixup(enum yuv_fixup yuv_fixup); +void dump_color_fixup_desc(struct color_fixup_desc fixup); /* Routines for GL <-> D3D values */ GLenum StencilOp(DWORD op); @@ -1944,56 +2037,9 @@ unsigned int count_bits(unsigned int mask); * * Note: Only require classes which are subclassed, ie resource, basetexture, */ - /*** IUnknown methods ***/ - extern HRESULT WINAPI IWineD3DResourceImpl_QueryInterface(IWineD3DResource *iface, REFIID riid, void** ppvObject); - extern ULONG WINAPI IWineD3DResourceImpl_AddRef(IWineD3DResource *iface); - extern ULONG WINAPI IWineD3DResourceImpl_Release(IWineD3DResource *iface); - /*** IWineD3DResource methods ***/ - extern HRESULT WINAPI IWineD3DResourceImpl_GetParent(IWineD3DResource *iface, IUnknown **pParent); - extern HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DDevice ** ppDevice); - extern HRESULT WINAPI IWineD3DResourceImpl_SetPrivateData(IWineD3DResource *iface, REFGUID refguid, CONST void * pData, DWORD SizeOfData, DWORD Flags); - extern HRESULT WINAPI IWineD3DResourceImpl_GetPrivateData(IWineD3DResource *iface, REFGUID refguid, void * pData, DWORD * pSizeOfData); - extern HRESULT WINAPI IWineD3DResourceImpl_FreePrivateData(IWineD3DResource *iface, REFGUID refguid); - extern DWORD WINAPI IWineD3DResourceImpl_SetPriority(IWineD3DResource *iface, DWORD PriorityNew); - extern DWORD WINAPI IWineD3DResourceImpl_GetPriority(IWineD3DResource *iface); - extern void WINAPI IWineD3DResourceImpl_PreLoad(IWineD3DResource *iface); - extern void WINAPI IWineD3DResourceImpl_UnLoad(IWineD3DResource *iface); - extern WINED3DRESOURCETYPE WINAPI IWineD3DResourceImpl_GetType(IWineD3DResource *iface); - /*** class static members ***/ - void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface); - - /*** IUnknown methods ***/ - extern HRESULT WINAPI IWineD3DBaseTextureImpl_QueryInterface(IWineD3DBaseTexture *iface, REFIID riid, void** ppvObject); - extern ULONG WINAPI IWineD3DBaseTextureImpl_AddRef(IWineD3DBaseTexture *iface); - extern ULONG WINAPI IWineD3DBaseTextureImpl_Release(IWineD3DBaseTexture *iface); - /*** IWineD3DResource methods ***/ - extern HRESULT WINAPI IWineD3DBaseTextureImpl_GetParent(IWineD3DBaseTexture *iface, IUnknown **pParent); - extern HRESULT WINAPI IWineD3DBaseTextureImpl_GetDevice(IWineD3DBaseTexture *iface, IWineD3DDevice ** ppDevice); - extern HRESULT WINAPI IWineD3DBaseTextureImpl_SetPrivateData(IWineD3DBaseTexture *iface, REFGUID refguid, CONST void * pData, DWORD SizeOfData, DWORD Flags); - extern HRESULT WINAPI IWineD3DBaseTextureImpl_GetPrivateData(IWineD3DBaseTexture *iface, REFGUID refguid, void * pData, DWORD * pSizeOfData); - extern HRESULT WINAPI IWineD3DBaseTextureImpl_FreePrivateData(IWineD3DBaseTexture *iface, REFGUID refguid); - extern DWORD WINAPI IWineD3DBaseTextureImpl_SetPriority(IWineD3DBaseTexture *iface, DWORD PriorityNew); - extern DWORD WINAPI IWineD3DBaseTextureImpl_GetPriority(IWineD3DBaseTexture *iface); - extern void WINAPI IWineD3DBaseTextureImpl_PreLoad(IWineD3DBaseTexture *iface); - extern void WINAPI IWineD3DBaseTextureImpl_UnLoad(IWineD3DBaseTexture *iface); - extern WINED3DRESOURCETYPE WINAPI IWineD3DBaseTextureImpl_GetType(IWineD3DBaseTexture *iface); - /*** IWineD3DBaseTexture methods ***/ - extern DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew); - extern DWORD WINAPI IWineD3DBaseTextureImpl_GetLOD(IWineD3DBaseTexture *iface); - extern DWORD WINAPI IWineD3DBaseTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface); - extern HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType); - extern WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface); - extern void WINAPI IWineD3DBaseTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface); - extern BOOL WINAPI IWineD3DBaseTextureImpl_SetDirty(IWineD3DBaseTexture *iface, BOOL); - extern BOOL WINAPI IWineD3DBaseTextureImpl_GetDirty(IWineD3DBaseTexture *iface); - - extern BYTE* WINAPI IWineD3DVertexBufferImpl_GetMemory(IWineD3DVertexBuffer* iface, DWORD iOffset, GLint *vbo); - extern HRESULT WINAPI IWineD3DVertexBufferImpl_ReleaseMemory(IWineD3DVertexBuffer* iface); - extern HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface); - extern void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface, const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]); - /*** class static members ***/ - void IWineD3DBaseTextureImpl_CleanUp(IWineD3DBaseTexture *iface); + /* IWineD3DVertexBuffer */ + extern const BYTE *IWineD3DVertexBufferImpl_GetMemory(IWineD3DVertexBuffer* iface, DWORD iOffset, GLint *vbo); /* TODO: Make this dynamic, based on shader limits ? */ #define MAX_REG_ADDR 1 @@ -2115,9 +2161,7 @@ extern int shader_addline( SHADER_BUFFER* buffer, const char* fmt, ...) PRINTF_ATTR(2,3); -extern const SHADER_OPCODE* shader_get_opcode( - IWineD3DBaseShader *iface, - const DWORD code); +const SHADER_OPCODE *shader_get_opcode(const SHADER_OPCODE *shader_ins, DWORD shader_version, DWORD code); /* Vertex shader utility functions */ extern BOOL vshader_get_input( @@ -2162,12 +2206,6 @@ typedef struct IWineD3DBaseShaderClass struct list constantsI; shader_reg_maps reg_maps; - /* Pixel formats of sampled textures, for format conversion. This - * represents the formats found during compilation, it is not initialized - * on the first parser pass. It is needed to check if the shader - * needs recompilation to adjust the format conversion - */ - WINED3DFORMAT sampled_format[MAX_COMBINED_SAMPLERS]; UINT sampled_samplers[MAX_COMBINED_SAMPLERS]; UINT num_sampled_samplers; @@ -2202,29 +2240,10 @@ extern HRESULT shader_get_registers_used( extern void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER *buffer, const shader_reg_maps *reg_maps, const DWORD *pFunction); -extern void shader_dump_ins_modifiers( - const DWORD output); - -extern void shader_dump_param( - IWineD3DBaseShader *iface, - const DWORD param, - const DWORD addr_token, - int input); - extern void shader_trace_init( IWineD3DBaseShader *iface, const DWORD* pFunction); -extern int shader_get_param( - IWineD3DBaseShader* iface, - const DWORD* pToken, - DWORD* param, - DWORD* addr_token); - -extern int shader_skip_unrecognized( - IWineD3DBaseShader* iface, - const DWORD* pToken); - static inline int shader_get_regtype(const DWORD param) { return (((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT) | ((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2)); @@ -2234,8 +2253,6 @@ static inline int shader_get_writemask(const DWORD param) { return param & WINED3DSP_WRITEMASK_ALL; } -extern unsigned int shader_get_float_offset(const DWORD reg); - static inline BOOL shader_is_pshader_version(DWORD token) { return 0xFFFF0000 == (token & 0xFFFF0000); } @@ -2348,8 +2365,8 @@ struct stb_const_desc { * into the shader code */ struct ps_compile_args { + struct color_fixup_desc color_fixup[MAX_FRAGMENT_SAMPLERS]; BOOL srgb_correction; - WINED3DFORMAT format_conversion[MAX_FRAGMENT_SAMPLERS]; enum vertexprocessing_mode vp_mode; /* Projected textures(ps 1.0-1.3) */ /* Texture types(2D, Cube, 3D) in ps 1.x */ @@ -2389,7 +2406,7 @@ typedef struct IWineD3DPixelShaderImpl { extern const SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[]; extern const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl; -GLuint find_gl_pshader(IWineD3DPixelShaderImpl *shader, struct ps_compile_args *args); +GLuint find_gl_pshader(IWineD3DPixelShaderImpl *shader, const struct ps_compile_args *args); void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImpl *stateblock, struct ps_compile_args *args); /* sRGB correction constants */ @@ -2429,6 +2446,19 @@ extern WINED3DFORMAT pixelformat_for_depth(DWORD depth); /***************************************************************************** * Pixel format management */ + +struct GlPixelFormatDesc +{ + GLint glInternal; + GLint glGammaInternal; + GLint rtInternal; + GLint glFormat; + GLint glType; + unsigned int Flags; + float heightscale; + struct color_fixup_desc color_fixup; +}; + typedef struct { WINED3DFORMAT format; DWORD alphaMask, redMask, greenMask, blueMask; @@ -2438,7 +2468,7 @@ typedef struct { } StaticPixelFormatDesc; const StaticPixelFormatDesc *getFormatDescEntry(WINED3DFORMAT fmt, - const WineD3D_GL_Info *gl_info, const GlPixelFormatDesc **glDesc); + const WineD3D_GL_Info *gl_info, const struct GlPixelFormatDesc **glDesc); static inline BOOL use_vs(IWineD3DDeviceImpl *device) { return (device->vs_selected_mode != SHADER_NONE diff --git a/dlls/winedos/timer.c b/dlls/winedos/timer.c index 74e41b57589..0a504af03e1 100644 --- a/dlls/winedos/timer.c +++ b/dlls/winedos/timer.c @@ -99,7 +99,7 @@ static void CALLBACK TIMER_TimerProc( HWND hwnd, } else { - int i; + DWORD i; /* Calculate the number of valid timer interrupts we can generate */ DWORD count = delta / TIMER_millis; diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c index 5d4dcca6174..12062deb3a2 100644 --- a/dlls/winedos/vga.c +++ b/dlls/winedos/vga.c @@ -1090,7 +1090,7 @@ void VGA_SetBright(BOOL bright) * Select if output is enabled or disabled * This is a property of the CGA controller */ -void VGA_SetEnabled(BOOL enabled) +static void VGA_SetEnabled(BOOL enabled) { TRACE("%i\n", enabled); diff --git a/dlls/winemp3.acm/common.c b/dlls/winemp3.acm/common.c index 2943fd857dc..91ba51acc47 100644 --- a/dlls/winemp3.acm/common.c +++ b/dlls/winemp3.acm/common.c @@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mpeg3); -const struct parameter param = { 1 , 1 , 0 , 0 }; +static const struct parameter param = { 1 , 1 , 0 , 0 }; static const int tabsel_123[2][3][16] = { { {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,}, @@ -44,7 +44,7 @@ static const int tabsel_123[2][3][16] = { {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,} } }; -const long freqs[9] = { 44100, 48000, 32000, +static const long freqs[9] = { 44100, 48000, 32000, 22050, 24000, 16000 , 11025 , 12000 , 8000 }; @@ -56,7 +56,7 @@ int pcm_point = 0; #define HDRCMPMASK 0xfffffd00 -int head_check(unsigned long head) +static int head_check(unsigned long head) { if( (head & 0xffe00000) != 0xffe00000) return FALSE; diff --git a/dlls/winemp3.acm/layer3.c b/dlls/winemp3.acm/layer3.c index 963fc96df7f..4e8e42c2efd 100644 --- a/dlls/winemp3.acm/layer3.c +++ b/dlls/winemp3.acm/layer3.c @@ -1837,7 +1837,7 @@ static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT],real tsOut[SSLIMIT][SBLIMIT], int *blc = mp->hybrid_blc; real *rawout1,*rawout2; int bt; - int sb = 0; + unsigned int sb = 0; { int b = blc[ch]; @@ -1986,7 +1986,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point) switch(single) { case 3: { - register int i; + register unsigned int i; register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1]; for(i=0;imaxb;i++,in0++) *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */ @@ -1994,7 +1994,7 @@ int do_layer3(struct frame *fr,unsigned char *pcm_sample,int *pcm_point) break; case 1: { - register int i; + register unsigned int i; register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1]; for(i=0;imaxb;i++) *in0++ = *in1++; diff --git a/dlls/winemp3.acm/mpg123.h b/dlls/winemp3.acm/mpg123.h index 1648408eaf4..a798eb759e8 100644 --- a/dlls/winemp3.acm/mpg123.h +++ b/dlls/winemp3.acm/mpg123.h @@ -161,9 +161,6 @@ extern void make_decode_tables(long scale); extern void dct64(real *,real *,real *); extern unsigned char *conv16to8; -extern const long freqs[9]; extern real muls[27][64]; extern real decwin[512+32]; extern real *pnts[5]; - -extern const struct parameter param; diff --git a/dlls/wineoss.drv/audio.c b/dlls/wineoss.drv/audio.c index 460c1f5372c..a008236520a 100644 --- a/dlls/wineoss.drv/audio.c +++ b/dlls/wineoss.drv/audio.c @@ -701,7 +701,8 @@ static void OSS_Info(int fd) static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev) { int rc,arg; - int f,c,r; + int f,c; + unsigned int r; BOOL has_mixer = FALSE; TRACE("(%p) %s\n", ossdev, ossdev->dev_name); @@ -876,7 +877,8 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev) static BOOL OSS_WaveInInit(OSS_DEVICE* ossdev) { int rc,arg; - int f,c,r; + int f,c; + unsigned int r; TRACE("(%p) %s\n", ossdev, ossdev->dev_name); if (OSS_OpenDevice(ossdev, O_RDONLY, NULL, 0,-1,-1,-1) != 0) @@ -1004,7 +1006,8 @@ static BOOL OSS_WaveInInit(OSS_DEVICE* ossdev) static void OSS_WaveFullDuplexInit(OSS_DEVICE* ossdev) { int rc,arg; - int f,c,r; + int f,c; + unsigned int r; int caps; BOOL has_mixer = FALSE; TRACE("(%p) %s\n", ossdev, ossdev->dev_name); @@ -1149,7 +1152,7 @@ static char* StrDup(const char* str, const char* def) LRESULT OSS_WaveInit(void) { char* str; - int i; + unsigned int i; /* FIXME: Remove unneeded members of WOutDev and WInDev */ TRACE("()\n"); @@ -1172,9 +1175,9 @@ LRESULT OSS_WaveInit(void) for (i = 1; i < MAX_WAVEDRV; ++i) { WOutDev[i].ossdev.dev_name = WInDev[i].ossdev.dev_name = HeapAlloc(GetProcessHeap(),0,11); - sprintf(WOutDev[i].ossdev.dev_name, "/dev/dsp%d", i); + sprintf(WOutDev[i].ossdev.dev_name, "/dev/dsp%u", i); WOutDev[i].ossdev.mixer_name = WInDev[i].ossdev.mixer_name = HeapAlloc(GetProcessHeap(),0,13); - sprintf(WOutDev[i].ossdev.mixer_name, "/dev/mixer%d", i); + sprintf(WOutDev[i].ossdev.mixer_name, "/dev/mixer%u", i); } } @@ -1213,13 +1216,13 @@ LRESULT OSS_WaveInit(void) TRACE("%d wave out devices\n", numOutDev); for (i = 0; i < numOutDev; i++) { - TRACE("%d: %s, %s, %s\n", i, WOutDev[i].ossdev.dev_name, + TRACE("%u: %s, %s, %s\n", i, WOutDev[i].ossdev.dev_name, WOutDev[i].ossdev.mixer_name, WOutDev[i].ossdev.interface_name); } TRACE("%d wave in devices\n", numInDev); for (i = 0; i < numInDev; i++) { - TRACE("%d: %s, %s, %s\n", i, WInDev[i].ossdev.dev_name, + TRACE("%u: %s, %s, %s\n", i, WInDev[i].ossdev.dev_name, WInDev[i].ossdev.mixer_name, WInDev[i].ossdev.interface_name); } @@ -1370,7 +1373,7 @@ static int OSS_AddRingMessage(OSS_MSG_RING* omr, enum win_wm_message msg, DWORD * Get a message from the ring. Should be called by the playback/record thread. */ static int OSS_RetrieveRingMessage(OSS_MSG_RING* omr, - enum win_wm_message *msg, DWORD *param, HANDLE *hEvent) + enum win_wm_message *msg, DWORD_PTR *param, HANDLE *hEvent) { EnterCriticalSection(&omr->msg_crst); @@ -1398,7 +1401,7 @@ static int OSS_RetrieveRingMessage(OSS_MSG_RING* omr, */ static int OSS_PeekRingMessage(OSS_MSG_RING* omr, enum win_wm_message *msg, - DWORD *param, HANDLE *hEvent) + DWORD_PTR *param, HANDLE *hEvent) { EnterCriticalSection(&omr->msg_crst); @@ -1422,9 +1425,9 @@ static int OSS_PeekRingMessage(OSS_MSG_RING* omr, /************************************************************************** * wodNotifyClient [internal] */ -static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD dwParam1, DWORD dwParam2) +static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("wMsg = 0x%04x (%s) dwParm1 = %04X dwParam2 = %04X\n", wMsg, + TRACE("wMsg = 0x%04x (%s) dwParm1 = %04lx dwParam2 = %04lx\n", wMsg, wMsg == WOM_OPEN ? "WOM_OPEN" : wMsg == WOM_CLOSE ? "WOM_CLOSE" : wMsg == WOM_DONE ? "WOM_DONE" : "Unknown", dwParam1, dwParam2); @@ -1678,7 +1681,7 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force) lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags |= WHDR_DONE; - wodNotifyClient(wwo, WOM_DONE, (DWORD)lpWaveHdr, 0); + wodNotifyClient(wwo, WOM_DONE, (DWORD_PTR)lpWaveHdr, 0); } #endif return (lpWaveHdr && lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr) ? @@ -1706,7 +1709,7 @@ static void wodPlayer_Reset(WINE_WAVEOUT* wwo, BOOL reset) if (reset) { enum win_wm_message msg; - DWORD param; + DWORD_PTR param; HANDLE ev; /* remove any buffer */ @@ -1769,11 +1772,11 @@ static void wodPlayer_ProcessMessages(WINE_WAVEOUT* wwo) { LPWAVEHDR lpWaveHdr; enum win_wm_message msg; - DWORD param; + DWORD_PTR param; HANDLE ev; while (OSS_RetrieveRingMessage(&wwo->msgRing, &msg, ¶m, &ev)) { - TRACE("Received %s %x\n", getCmdString(msg), param); + TRACE("Received %s %lx\n", getCmdString(msg), param); switch (msg) { case WINE_WM_PAUSING: wodPlayer_Reset(wwo, FALSE); @@ -1880,7 +1883,7 @@ static DWORD wodPlayer_FeedDSP(WINE_WAVEOUT* wwo) */ static DWORD CALLBACK wodPlayer(LPVOID pmt) { - WORD uDevID = (DWORD)pmt; + WORD uDevID = (DWORD_PTR)pmt; WINE_WAVEOUT* wwo = &WOutDev[uDevID]; DWORD dwNextFeedTime = INFINITE; /* Time before DSP needs feeding */ DWORD dwNextNotifyTime = INFINITE; /* Time before next wave completion */ @@ -2108,7 +2111,7 @@ DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) OSS_InitRingMessage(&wwo->msgRing); wwo->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - wwo->hThread = CreateThread(NULL, 0, wodPlayer, (LPVOID)(DWORD)wDevID, 0, &(wwo->dwThreadID)); + wwo->hThread = CreateThread(NULL, 0, wodPlayer, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwo->dwThreadID)); if (wwo->hThread) SetThreadPriority(wwo->hThread, THREAD_PRIORITY_TIME_CRITICAL); WaitForSingleObject(wwo->hStartUpEvent, INFINITE); @@ -2187,7 +2190,7 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->dwBufferLength &= ~(WOutDev[wDevID].waveFormat.Format.nBlockAlign - 1); } - OSS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE); + OSS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD_PTR)lpWaveHdr, FALSE); return MMSYSERR_NOERROR; } @@ -2405,10 +2408,10 @@ DWORD wodSetVolume(WORD wDevID, DWORD dwParam) /************************************************************************** * wodMessage (WINEOSS.7) */ -DWORD WINAPI OSS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI OSS_wodMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%u, %s, %08X, %08X, %08X);\n", + TRACE("(%u, %s, %08lX, %08lX, %08lX);\n", wDevID, getMessage(wMsg), dwUser, dwParam1, dwParam2); switch (wMsg) { @@ -2454,9 +2457,9 @@ DWORD WINAPI OSS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, /************************************************************************** * widNotifyClient [internal] */ -static DWORD widNotifyClient(WINE_WAVEIN* wwi, WORD wMsg, DWORD dwParam1, DWORD dwParam2) +static DWORD widNotifyClient(WINE_WAVEIN* wwi, WORD wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("wMsg = 0x%04x (%s) dwParm1 = %04X dwParam2 = %04X\n", wMsg, + TRACE("wMsg = 0x%04x (%s) dwParm1 = %04lx dwParam2 = %04lx\n", wMsg, wMsg == WIM_OPEN ? "WIM_OPEN" : wMsg == WIM_CLOSE ? "WIM_CLOSE" : wMsg == WIM_DATA ? "WIM_DATA" : "Unknown", dwParam1, dwParam2); @@ -2503,7 +2506,7 @@ static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPSW lpCaps, DWORD dwSize) static void widRecorder_ReadHeaders(WINE_WAVEIN * wwi) { enum win_wm_message tmp_msg; - DWORD tmp_param; + DWORD_PTR tmp_param; HANDLE tmp_ev; WAVEHDR* lpWaveHdr; @@ -2530,7 +2533,7 @@ static void widRecorder_ReadHeaders(WINE_WAVEIN * wwi) */ static DWORD CALLBACK widRecorder(LPVOID pmt) { - WORD uDevID = (DWORD)pmt; + WORD uDevID = (DWORD_PTR)pmt; WINE_WAVEIN* wwi = &WInDev[uDevID]; WAVEHDR* lpWaveHdr; DWORD dwSleepTime; @@ -2540,7 +2543,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) audio_buf_info info; int xs; enum win_wm_message msg; - DWORD param; + DWORD_PTR param; HANDLE ev; int enable; @@ -2611,7 +2614,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) lpWaveHdr->dwFlags |= WHDR_DONE; wwi->lpQueuePtr = lpNext; - widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); + widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0); lpWaveHdr = lpNext; } } else { @@ -2663,7 +2666,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) lpWaveHdr->dwFlags |= WHDR_DONE; wwi->lpQueuePtr = lpNext; - widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); + widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0); lpWaveHdr = lpNext; if (!lpNext && bytesRead) { @@ -2708,7 +2711,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) while (OSS_RetrieveRingMessage(&wwi->msgRing, &msg, ¶m, &ev)) { - TRACE("msg=%s param=0x%x\n", getCmdString(msg), param); + TRACE("msg=%s param=0x%lx\n", getCmdString(msg), param); switch (msg) { case WINE_WM_PAUSING: wwi->state = WINE_WS_PAUSED; @@ -2774,7 +2777,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags |= WHDR_DONE; wwi->lpQueuePtr = lpNext; - widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); + widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0); } } wwi->state = WINE_WS_STOPPED; @@ -2807,7 +2810,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags |= WHDR_DONE; wwi->lpQueuePtr = lpWaveHdr->lpNext; - widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); + widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0); } wwi->lpQueuePtr = NULL; @@ -2979,7 +2982,7 @@ DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) OSS_InitRingMessage(&wwi->msgRing); wwi->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)(DWORD)wDevID, 0, &(wwi->dwThreadID)); + wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwi->dwThreadID)); if (wwi->hThread) SetThreadPriority(wwi->hThread, THREAD_PRIORITY_TIME_CRITICAL); WaitForSingleObject(wwi->hStartUpEvent, INFINITE); @@ -3042,7 +3045,7 @@ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->dwBytesRecorded = 0; lpWaveHdr->lpNext = NULL; - OSS_AddRingMessage(&WInDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE); + OSS_AddRingMessage(&WInDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD_PTR)lpWaveHdr, FALSE); return MMSYSERR_NOERROR; } @@ -3122,10 +3125,10 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) /************************************************************************** * widMessage (WINEOSS.6) */ -DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%u, %s, %08X, %08X, %08X);\n", + TRACE("(%u, %s, %08lX, %08lX, %08lX);\n", wDevID, getMessage(wMsg), dwUser, dwParam1, dwParam2); switch (wMsg) { @@ -3161,20 +3164,20 @@ DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, /************************************************************************** * wodMessage (WINEOSS.7) */ -DWORD WINAPI OSS_wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI OSS_wodMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - FIXME("(%u, %04X, %08X, %08X, %08X):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); + FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); return MMSYSERR_NOTENABLED; } /************************************************************************** * widMessage (WINEOSS.6) */ -DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - FIXME("(%u, %04X, %08X, %08X, %08X):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); + FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); return MMSYSERR_NOTENABLED; } diff --git a/dlls/wineoss.drv/audio.h b/dlls/wineoss.drv/audio.h index d90719b620b..f0390841326 100644 --- a/dlls/wineoss.drv/audio.h +++ b/dlls/wineoss.drv/audio.h @@ -62,7 +62,7 @@ enum win_wm_message { typedef struct { enum win_wm_message msg; /* message identifier */ - DWORD param; /* parameter for this message */ + DWORD_PTR param; /* parameter for this message */ HANDLE hEvent; /* if message is synchronous, handle of event for synchro */ } OSS_MSG; diff --git a/dlls/wineoss.drv/dscapture.c b/dlls/wineoss.drv/dscapture.c index e058c26ad16..88496449c1c 100644 --- a/dlls/wineoss.drv/dscapture.c +++ b/dlls/wineoss.drv/dscapture.c @@ -317,10 +317,10 @@ static HRESULT WINAPI IDsCaptureDriverNotifyImpl_SetNotificationPositions( } if (TRACE_ON(dscapture)) { - int i; + DWORD i; for (i=0;idwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags |= MHDR_DONE; MidiInDev[wDevID].lpQueueHdr = lpMidiHdr->lpNext; - if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD)lpMidiHdr, dwTime) != MMSYSERR_NOERROR) { + if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD_PTR)lpMidiHdr, dwTime) != MMSYSERR_NOERROR) { WARN("Couldn't notify client\n"); } } @@ -923,7 +923,7 @@ static DWORD midReset(WORD wDevID) MidiInDev[wDevID].lpQueueHdr->dwFlags |= MHDR_DONE; /* FIXME: when called from 16 bit, lpQueueHdr needs to be a segmented ptr */ if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, - (DWORD)MidiInDev[wDevID].lpQueueHdr, dwTime) != MMSYSERR_NOERROR) { + (DWORD_PTR)MidiInDev[wDevID].lpQueueHdr, dwTime) != MMSYSERR_NOERROR) { WARN("Couldn't notify client\n"); } MidiInDev[wDevID].lpQueueHdr = MidiInDev[wDevID].lpQueueHdr->lpNext; @@ -1594,7 +1594,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags |= MHDR_DONE; - if (MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD)lpMidiHdr, 0L) != MMSYSERR_NOERROR) { + if (MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD_PTR)lpMidiHdr, 0L) != MMSYSERR_NOERROR) { WARN("can't notify client !\n"); return MMSYSERR_INVALPARAM; } @@ -1620,8 +1620,8 @@ static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || lpMidiHdr->lpData == 0 || (lpMidiHdr->dwFlags & MHDR_INQUEUE) != 0 || lpMidiHdr->dwBufferLength >= 0x10000ul) { - WARN("%p %p %08x %d/%d\n", lpMidiHdr, lpMidiHdr ? lpMidiHdr->lpData : NULL, - lpMidiHdr ? lpMidiHdr->dwFlags : 0, sizeof(MIDIHDR), dwSize); + WARN("%p %p %08x %d\n", lpMidiHdr, lpMidiHdr ? lpMidiHdr->lpData : NULL, + lpMidiHdr ? lpMidiHdr->dwFlags : 0, dwSize); return MMSYSERR_INVALPARAM; } @@ -1701,10 +1701,10 @@ LRESULT OSS_MidiExit(void) /************************************************************************** * midMessage (WINEOSS.4) */ -DWORD WINAPI OSS_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI OSS_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%04X, %04X, %08X, %08X, %08X);\n", + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch (wMsg) { #ifdef HAVE_OSS_MIDI @@ -1744,10 +1744,10 @@ DWORD WINAPI OSS_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, /************************************************************************** * modMessage (WINEOSS.5) */ -DWORD WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%04X, %04X, %08X, %08X, %08X);\n", + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch (wMsg) { diff --git a/dlls/wineoss.drv/mixer.c b/dlls/wineoss.drv/mixer.c index 34588f9d6ec..241aa0c2cd7 100644 --- a/dlls/wineoss.drv/mixer.c +++ b/dlls/wineoss.drv/mixer.c @@ -787,8 +787,8 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINEW lpMl, DWORD fdwInfo) } if (lpMl->cbStruct != sizeof(*lpMl)) { - WARN("invalid parameter: lpMl->cbStruct = %d != %d\n", - lpMl->cbStruct, sizeof(*lpMl)); + WARN("invalid parameter: lpMl->cbStruct = %d\n", + lpMl->cbStruct); return MMSYSERR_INVALPARAM; } @@ -963,14 +963,14 @@ static DWORD MIX_GetLineControls(WORD wDevID, LPMIXERLINECONTROLSW lpMlc, } if (lpMlc->cbStruct < sizeof(*lpMlc)) { - WARN("invalid parameter: lpMlc->cbStruct = %d < %d\n", - lpMlc->cbStruct, sizeof(*lpMlc)); + WARN("invalid parameter: lpMlc->cbStruct = %d\n", + lpMlc->cbStruct); return MMSYSERR_INVALPARAM; } if (lpMlc->cbmxctrl < sizeof(MIXERCONTROLW)) { - WARN("invalid parameter: lpMlc->cbmxctrl = %d < %d\n", - lpMlc->cbmxctrl, sizeof(MIXERCONTROLW)); + WARN("invalid parameter: lpMlc->cbmxctrl = %d\n", + lpMlc->cbmxctrl); return MMSYSERR_INVALPARAM; } @@ -1098,8 +1098,8 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, if (lpmcd->cbDetails != sizeof(MIXERCONTROLDETAILS_UNSIGNED)) { - WARN("invalid parameter: cbDetails != %d\n", - sizeof(MIXERCONTROLDETAILS_UNSIGNED)); + WARN("invalid parameter: cbDetails = %d\n", + lpmcd->cbDetails); return MMSYSERR_INVALPARAM; } @@ -1145,8 +1145,8 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, if (lpmcd->cbDetails != sizeof(MIXERCONTROLDETAILS_BOOLEAN)) { - WARN("invalid parameter: cbDetails != %d\n", - sizeof(MIXERCONTROLDETAILS_BOOLEAN)); + WARN("invalid parameter: cbDetails = %d\n", + lpmcd->cbDetails); return MMSYSERR_INVALPARAM; } @@ -1167,8 +1167,8 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, if (lpmcd->cbDetails != sizeof(MIXERCONTROLDETAILS_BOOLEAN)) { - WARN("invalid parameter: cbDetails != %d\n", - sizeof(MIXERCONTROLDETAILS_BOOLEAN)); + WARN("invalid parameter: cbDetails = %d\n", + lpmcd->cbDetails); return MMSYSERR_INVALPARAM; } @@ -1299,8 +1299,8 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, if (lpmcd->cbDetails != sizeof(MIXERCONTROLDETAILS_UNSIGNED)) { - WARN("invalid parameter: cbDetails != %d\n", - sizeof(MIXERCONTROLDETAILS_UNSIGNED)); + WARN("invalid parameter: cbDetails = %d\n", + lpmcd->cbDetails); return MMSYSERR_INVALPARAM; } @@ -1351,8 +1351,8 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, if (lpmcd->cbDetails != sizeof(MIXERCONTROLDETAILS_BOOLEAN)) { - WARN("invalid parameter: cbDetails != %d\n", - sizeof(MIXERCONTROLDETAILS_BOOLEAN)); + WARN("invalid parameter: cbDetails = %d\n", + lpmcd->cbDetails); return MMSYSERR_INVALPARAM; } @@ -1395,8 +1395,8 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, if (lpmcd->cbDetails != sizeof(MIXERCONTROLDETAILS_BOOLEAN)) { - WARN("invalid parameter: cbDetails != %d\n", - sizeof(MIXERCONTROLDETAILS_BOOLEAN)); + WARN("invalid parameter: cbDetails = %d\n", + lpmcd->cbDetails); return MMSYSERR_INVALPARAM; } @@ -1524,11 +1524,11 @@ static DWORD MIX_GetNumDevs(void) /************************************************************************** * mxdMessage (WINEOSS.3) */ -DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { #ifdef HAVE_OSS - TRACE("(%04X, %s, %08X, %08X, %08X);\n", wDevID, getMessage(wMsg), + TRACE("(%04X, %s, %08lX, %08lX, %08lX);\n", wDevID, getMessage(wMsg), dwUser, dwParam1, dwParam2); switch (wMsg) @@ -1540,7 +1540,7 @@ DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD dwUser, /* FIXME: Pretend this is supported */ return 0; case MXDM_GETDEVCAPS: - return MIX_GetDevCaps(wDevID, (LPMIXERCAPSW)dwParam1, dwParam2); + return MIX_GetDevCaps(wDevID, (LPMIXERCAPSW)dwParam1, dwParam2); case MXDM_GETLINEINFO: return MIX_GetLineInfo(wDevID, (LPMIXERLINEW)dwParam1, dwParam2); case MXDM_GETNUMDEVS: @@ -1561,7 +1561,7 @@ DWORD WINAPI OSS_mxdMessage(UINT wDevID, UINT wMsg, DWORD dwUser, return MMSYSERR_NOTSUPPORTED; } #else - TRACE("(%04X, %04X, %08X, %08X, %08X);\n", wDevID, wMsg, + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); return MMSYSERR_NOTENABLED; diff --git a/dlls/wineoss.drv/mmaux.c b/dlls/wineoss.drv/mmaux.c index b48ea6b6818..c41c1daab20 100644 --- a/dlls/wineoss.drv/mmaux.c +++ b/dlls/wineoss.drv/mmaux.c @@ -219,10 +219,10 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam) /************************************************************************** * auxMessage (WINEOSS.2) */ -DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD dwUser, - DWORD dwParam1, DWORD dwParam2) +DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) { - TRACE("(%04X, %04X, %08X, %08X, %08X);\n", + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); #ifdef HAVE_OSS diff --git a/dlls/wineps.drv/type1.c b/dlls/wineps.drv/type1.c index 9fe3b39da0d..fe8c8bac913 100644 --- a/dlls/wineps.drv/type1.c +++ b/dlls/wineps.drv/type1.c @@ -193,12 +193,12 @@ BOOL T1_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index, LOGFONTW lf; RECT rc; - char glyph_def_begin[] = + static const char glyph_def_begin[] = "/%s findfont dup\n" "/Private get begin\n" "/CharStrings get begin\n" "/%s %d RD\n"; - char glyph_def_end[] = + static const char glyph_def_end[] = "ND\n" "end end\n"; diff --git a/dlls/winex11.drv/brush.c b/dlls/winex11.drv/brush.c index 41e45cdc255..5e5187705bd 100644 --- a/dlls/winex11.drv/brush.c +++ b/dlls/winex11.drv/brush.c @@ -300,7 +300,7 @@ HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) case BS_DIBPATTERN: TRACE("BS_DIBPATTERN\n"); - if ((bmpInfo = (BITMAPINFO *) GlobalLock16( (HGLOBAL16)logbrush.lbHatch ))) + if ((bmpInfo = GlobalLock16( logbrush.lbHatch ))) { int size = bitmap_info_size( bmpInfo, logbrush.lbColor ); hBitmap = CreateDIBitmap( physDev->hdc, &bmpInfo->bmiHeader, @@ -309,7 +309,7 @@ HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) (WORD)logbrush.lbColor ); BRUSH_SelectPatternBrush( physDev, hBitmap ); DeleteObject( hBitmap ); - GlobalUnlock16( (HGLOBAL16)logbrush.lbHatch ); + GlobalUnlock16( logbrush.lbHatch ); } break; diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index ec7d5ab1417..5577867cd6c 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -705,7 +705,7 @@ static void X11DRV_CLIPBOARD_FreeData(LPWINE_CLIPDATA lpData) if (lpData->hData16) { - METAFILEPICT16* lpMetaPict = (METAFILEPICT16 *) GlobalLock16(lpData->hData16); + METAFILEPICT16* lpMetaPict = GlobalLock16(lpData->hData16); if (lpMetaPict) { @@ -970,11 +970,11 @@ static BOOL X11DRV_CLIPBOARD_RenderSynthesizedText(Display *display, UINT wForma if (lpSource->hData32) { - lpstrS = (LPSTR)GlobalLock(lpSource->hData32); + lpstrS = GlobalLock(lpSource->hData32); } else { - lpstrS = (LPSTR)GlobalLock16(lpSource->hData16); + lpstrS = GlobalLock16(lpSource->hData16); } if (!lpstrS) @@ -1005,7 +1005,7 @@ static BOOL X11DRV_CLIPBOARD_RenderSynthesizedText(Display *display, UINT wForma hData32 = GlobalAlloc(GMEM_ZEROINIT | GMEM_MOVEABLE | GMEM_DDESHARE, alloc_size); - lpstrT = (LPSTR)GlobalLock(hData32); + lpstrT = GlobalLock(hData32); if (lpstrT) { @@ -1095,7 +1095,7 @@ static BOOL X11DRV_CLIPBOARD_RenderSynthesizedBitmap(Display *display) LPBITMAPINFOHEADER lpbmih; hdc = GetDC(NULL); - lpbmih = (LPBITMAPINFOHEADER) GlobalLock(lpSource->hData32); + lpbmih = GlobalLock(lpSource->hData32); offset = sizeof(BITMAPINFOHEADER) + ((lpbmih->biBitCount <= 8) ? (sizeof(RGBQUAD) * @@ -1224,7 +1224,7 @@ HANDLE X11DRV_CLIPBOARD_ImportUTF8(Display *display, Window w, Atom prop) */ static HANDLE X11DRV_CLIPBOARD_ImportCompoundText(Display *display, Window w, Atom prop) { - int i, j; + int i, j, ret; char** srcstr; int count, lcount; int srclen, destlen; @@ -1239,9 +1239,10 @@ static HANDLE X11DRV_CLIPBOARD_ImportCompoundText(Display *display, Window w, At txtprop.encoding = x11drv_atom(COMPOUND_TEXT); txtprop.format = 8; wine_tsx11_lock(); - XmbTextPropertyToTextList(display, &txtprop, &srcstr, &count); + ret = XmbTextPropertyToTextList(display, &txtprop, &srcstr, &count); wine_tsx11_unlock(); HeapFree(GetProcessHeap(), 0, txtprop.value); + if (ret != Success || !count) return 0; TRACE("Importing %d line(s)\n", count); @@ -1330,7 +1331,7 @@ HANDLE X11DRV_CLIPBOARD_ImportMetaFilePict(Display *display, Window w, Atom prop if (X11DRV_CLIPBOARD_ReadProperty(display, w, prop, &lpdata, &cbytes)) { if (cbytes) - hClipData = X11DRV_CLIPBOARD_SerializeMetafile(CF_METAFILEPICT, (HANDLE)lpdata, (LPDWORD)&cbytes, FALSE); + hClipData = X11DRV_CLIPBOARD_SerializeMetafile(CF_METAFILEPICT, lpdata, (LPDWORD)&cbytes, FALSE); /* Free the retrieved property data */ HeapFree(GetProcessHeap(), 0, lpdata); @@ -1354,7 +1355,7 @@ HANDLE X11DRV_CLIPBOARD_ImportEnhMetaFile(Display *display, Window w, Atom prop) if (X11DRV_CLIPBOARD_ReadProperty(display, w, prop, &lpdata, &cbytes)) { if (cbytes) - hClipData = X11DRV_CLIPBOARD_SerializeMetafile(CF_ENHMETAFILE, (HANDLE)lpdata, (LPDWORD)&cbytes, FALSE); + hClipData = X11DRV_CLIPBOARD_SerializeMetafile(CF_ENHMETAFILE, lpdata, (LPDWORD)&cbytes, FALSE); /* Free the retrieved property data */ HeapFree(GetProcessHeap(), 0, lpdata); @@ -2170,7 +2171,7 @@ static HANDLE X11DRV_CLIPBOARD_SerializeMetafile(INT wformat, HANDLE hdata, LPDW if (wformat == CF_METAFILEPICT) { - LPMETAFILEPICT lpmfp = (LPMETAFILEPICT) GlobalLock(hdata); + LPMETAFILEPICT lpmfp = GlobalLock(hdata); unsigned int size = GetMetaFileBitsEx(lpmfp->hMF, 0, NULL); h = GlobalAlloc(0, size + sizeof(METAFILEPICT)); @@ -2212,7 +2213,7 @@ static HANDLE X11DRV_CLIPBOARD_SerializeMetafile(INT wformat, HANDLE hdata, LPDW if (h) { unsigned int wiresize, size; - LPMETAFILEPICT lpmfp = (LPMETAFILEPICT) GlobalLock(h); + LPMETAFILEPICT lpmfp = GlobalLock(h); memcpy(lpmfp, hdata, sizeof(METAFILEPICT)); wiresize = *lpcbytes - sizeof(METAFILEPICT); diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 9b92a0ec14a..c8b202c822b 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -45,7 +45,7 @@ static const unsigned int heights[] = {200, 300, 384, 480, 600, 768, 864, 1024 /* create the mode structures */ static void make_modes(void) { - int i; + unsigned int i; /* original specified desktop size */ X11DRV_Settings_AddOneMode(screen_width, screen_height, 0, 60); for (i=0; ihWnd,msg,wParam,lParam); - - UnlockRealIMC(FROM_X11); - return rc; -} - INT IME_GetCursorPos(void) { LPINPUTCONTEXT lpIMC; diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index b4845ad53c4..add95693c65 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2360,7 +2360,7 @@ static HPBUFFERARB WINAPI X11DRV_wglCreatePbufferARB(HDC hdc, int iPixelFormat, goto create_failed; /* unexpected error */ } TRACE("->(%p)\n", object); - return (HPBUFFERARB) object; + return object; create_failed: HeapFree(GetProcessHeap(), 0, object); diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c index c6545e75734..c997c7c0c90 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -359,7 +359,7 @@ static void trace_axes(XValuatorInfoPtr val) TRACE(" Axis %d: [resolution %d|min_value %d|max_value %d]\n", i, axis->resolution, axis->min_value, axis->max_value); } -BOOL match_token(const char *haystack, const char *needle) +static BOOL match_token(const char *haystack, const char *needle) { const char *p, *q; for (p = haystack; *p; ) diff --git a/dlls/winex11.drv/x11ddraw.c b/dlls/winex11.drv/x11ddraw.c index 492d6783445..223659f652a 100644 --- a/dlls/winex11.drv/x11ddraw.c +++ b/dlls/winex11.drv/x11ddraw.c @@ -141,7 +141,7 @@ static DWORD PASCAL X11DRV_DDHAL_CreateSurface(LPDDHAL_CREATESURFACEDATA data) { if (data->lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) { X11DRV_DD_Primary = *data->lplpSList; - X11DRV_DD_PrimaryWnd = (HWND)X11DRV_DD_Primary->lpSurfMore->lpDDRAWReserved; + X11DRV_DD_PrimaryWnd = X11DRV_DD_Primary->lpSurfMore->lpDDRAWReserved; X11DRV_DD_PrimaryGbl = X11DRV_DD_Primary->lpGbl; SetPrimaryDIB((HBITMAP)GET_LPDDRAWSURFACE_GBL_MORE(X11DRV_DD_PrimaryGbl)->hKernelSurface); X11DRV_DD_UserClass = GlobalFindAtomA("WINE_DDRAW"); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 8a5a4b531c3..e5a0fe0fef8 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -278,7 +278,6 @@ extern BOOL destroy_glxpixmap(Display *display, XID glxpixmap); /* IME support */ extern void IME_UnregisterClasses(void); extern void IME_SetOpenStatus(BOOL fOpen); -extern LRESULT IME_SendMessageToSelectedHWND(UINT msg, WPARAM wParam, LPARAM lParam); extern INT IME_GetCursorPos(); extern void IME_SetCursorPos(DWORD pos); extern void IME_UpdateAssociation(HWND focus); diff --git a/dlls/winex11.drv/x11font.h b/dlls/winex11.drv/x11font.h index 27eb82e6779..dd36313c5a7 100644 --- a/dlls/winex11.drv/x11font.h +++ b/dlls/winex11.drv/x11font.h @@ -221,7 +221,6 @@ typedef struct extern fontObject* XFONT_GetFontObject( X_PHYSFONT pFont ); extern XFontStruct* XFONT_GetFontStruct( X_PHYSFONT pFont ); -extern LPIFONTINFO16 XFONT_GetFontInfo( X_PHYSFONT pFont ); /* internal charset(hibyte must be set) */ /* lobyte is DEFAULT_CHARSET(=0). */ diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c index 6d8ff78938f..9fcb9930858 100644 --- a/dlls/winex11.drv/xfont.c +++ b/dlls/winex11.drv/xfont.c @@ -3117,7 +3117,7 @@ static X_PHYSFONT XFONT_RealizeFont( LPLOGFONT16 plf, lfSub.lfCharSet = (BYTE)(charset_sub & 0xff); lfSub.lfFaceName[0] = '\0'; /* FIXME? */ /* this font has sub font */ - if ( i == 0 ) pfo->prefobjs[0] = (X_PHYSFONT)0; + if ( i == 0 ) pfo->prefobjs[0] = 0; pfo->prefobjs[i] = XFONT_RealizeFont( &lfSub, &faceMatchedSub, TRUE, charset_sub, @@ -3180,15 +3180,6 @@ XFontStruct* XFONT_GetFontStruct( X_PHYSFONT pFont ) return NULL; } -/*********************************************************************** - * XFONT_GetFontInfo - */ -LPIFONTINFO16 XFONT_GetFontInfo( X_PHYSFONT pFont ) -{ - if( CHECK_PFONT(pFont) ) return &(__PFONT(pFont)->fi->df); - return NULL; -} - /* X11DRV Interface **************************************************** diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 08bb71fa76d..3bad0a3bc99 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -746,8 +746,7 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) for(j = 0; j < pitch * 8; j++) { strcat(output, (line[j / 8] & (1 << (7 - (j % 8)))) ? "#" : " "); } - strcat(output, "\n"); - TRACE(output); + TRACE("%s\n", output); } } else { static const char blks[] = " .:;!o*#"; @@ -762,8 +761,7 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) str[0] = blks[line[j] >> 5]; strcat(output, str); } - strcat(output, "\n"); - TRACE(output); + TRACE("%s\n", output); } } } diff --git a/dlls/winex11.drv/xvidmode.c b/dlls/winex11.drv/xvidmode.c index a97a9db96e3..4ffbdc98e27 100644 --- a/dlls/winex11.drv/xvidmode.c +++ b/dlls/winex11.drv/xvidmode.c @@ -57,7 +57,7 @@ static unsigned int dd_mode_count; static XF86VidModeModeInfo** real_xf86vm_modes; static unsigned int real_xf86vm_mode_count; -#define MAKE_FUNCPTR(f) typeof(f) * p##f; +#define MAKE_FUNCPTR(f) static typeof(f) * p##f; MAKE_FUNCPTR(XF86VidModeGetAllModeLines) MAKE_FUNCPTR(XF86VidModeGetModeLine) MAKE_FUNCPTR(XF86VidModeLockModeSwitch) @@ -356,7 +356,7 @@ static BOOL ComputeGammaFromRamp(WORD ramp[256], float *gamma) /* Hmm... should gamma control be available in desktop mode or not? * I'll assume that it should */ -BOOL X11DRV_XF86VM_GetGammaRamp(LPDDGAMMARAMP ramp) +static BOOL X11DRV_XF86VM_GetGammaRamp(LPDDGAMMARAMP ramp) { #ifdef X_XF86VidModeSetGamma XF86VidModeGamma gamma; @@ -390,7 +390,7 @@ BOOL X11DRV_XF86VM_GetGammaRamp(LPDDGAMMARAMP ramp) return FALSE; } -BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp) +static BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp) { #ifdef X_XF86VidModeSetGamma XF86VidModeGamma gamma; diff --git a/dlls/winex11.drv/xvidmode.h b/dlls/winex11.drv/xvidmode.h index c6b7d17bf94..9d68ff11821 100644 --- a/dlls/winex11.drv/xvidmode.h +++ b/dlls/winex11.drv/xvidmode.h @@ -33,10 +33,6 @@ void X11DRV_XF86VM_Init(void); void X11DRV_XF86VM_Cleanup(void); -void X11DRV_XF86VM_SetExclusiveMode(int lock); - -BOOL X11DRV_XF86VM_GetGammaRamp(LPDDGAMMARAMP ramp); -BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp); #endif /* SONAME_LIBXXF86VM */ #endif /* __WINE_XVIDMODE_H */ diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index f351a02770e..396f1ef2c7b 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -2737,7 +2737,7 @@ static BOOL FTP_InitListenSocket(LPWININETFTPSESSIONW lpwfs) lpwfs->lstnSocketAddress = lpwfs->socketAddress; /* and get the system to assign us a port */ - lpwfs->lstnSocketAddress.sin_port = htons((u_short) 0); + lpwfs->lstnSocketAddress.sin_port = htons(0); if (bind(lpwfs->lstnSocket,(struct sockaddr *) &lpwfs->lstnSocketAddress, sizeof(struct sockaddr_in)) == -1) { diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index d43c9bb53d6..fad2e41526f 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -773,8 +773,8 @@ BOOL WINAPI HttpEndRequestA(HINTERNET hRequest, ptr = lpBuffersOut; if (ptr) - lpBuffersOutW = (LPINTERNET_BUFFERSW)HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, sizeof(INTERNET_BUFFERSW)); + lpBuffersOutW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(INTERNET_BUFFERSW)); else lpBuffersOutW = NULL; @@ -1617,6 +1617,16 @@ static DWORD HTTPREQ_SetOption(WININETHANDLEHEADER *hdr, DWORD option, void *buf return NETCON_set_timeout(&req->netConnection, option == INTERNET_OPTION_SEND_TIMEOUT, *(DWORD*)buffer); + + case INTERNET_OPTION_USERNAME: + HeapFree(GetProcessHeap(), 0, req->lpHttpSession->lpszUserName); + if (!(req->lpHttpSession->lpszUserName = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY; + return ERROR_SUCCESS; + + case INTERNET_OPTION_PASSWORD: + HeapFree(GetProcessHeap(), 0, req->lpHttpSession->lpszPassword); + if (!(req->lpHttpSession->lpszPassword = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY; + return ERROR_SUCCESS; } return ERROR_INTERNET_INVALID_OPTION; @@ -2334,8 +2344,7 @@ static BOOL HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD dwInfoLevel, return bSuccess; } - if (lpdwIndex) - (*lpdwIndex)++; + if (lpdwIndex && level != HTTP_QUERY_STATUS_CODE) (*lpdwIndex)++; /* coalesce value to requested type */ if (dwInfoLevel & HTTP_QUERY_FLAG_NUMBER && lpBuffer) @@ -3509,12 +3518,14 @@ static DWORD HTTPSESSION_SetOption(WININETHANDLEHEADER *hdr, DWORD option, void switch(option) { case INTERNET_OPTION_USERNAME: { - if (!(ses->lpszUserName = WININET_strdupW(buffer))) break; + HeapFree(GetProcessHeap(), 0, ses->lpszUserName); + if (!(ses->lpszUserName = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY; return ERROR_SUCCESS; } case INTERNET_OPTION_PASSWORD: { - if (!(ses->lpszPassword = WININET_strdupW(buffer))) break; + HeapFree(GetProcessHeap(), 0, ses->lpszPassword); + if (!(ses->lpszPassword = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY; return ERROR_SUCCESS; } default: break; diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 492ce89d63d..ed92536c20e 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -786,7 +786,7 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, BOOL WINAPI InternetGetLastResponseInfoA(LPDWORD lpdwError, LPSTR lpszBuffer, LPDWORD lpdwBufferLength) { - LPWITHREADERROR lpwite = (LPWITHREADERROR)TlsGetValue(g_dwTlsErrIndex); + LPWITHREADERROR lpwite = TlsGetValue(g_dwTlsErrIndex); TRACE("\n"); @@ -823,7 +823,7 @@ BOOL WINAPI InternetGetLastResponseInfoA(LPDWORD lpdwError, BOOL WINAPI InternetGetLastResponseInfoW(LPDWORD lpdwError, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength) { - LPWITHREADERROR lpwite = (LPWITHREADERROR)TlsGetValue(g_dwTlsErrIndex); + LPWITHREADERROR lpwite = TlsGetValue(g_dwTlsErrIndex); TRACE("\n"); @@ -3049,7 +3049,7 @@ static LPWITHREADERROR INTERNET_AllocThreadError(void) */ void INTERNET_SetLastError(DWORD dwError) { - LPWITHREADERROR lpwite = (LPWITHREADERROR)TlsGetValue(g_dwTlsErrIndex); + LPWITHREADERROR lpwite = TlsGetValue(g_dwTlsErrIndex); if (!lpwite) lpwite = INTERNET_AllocThreadError(); @@ -3070,7 +3070,7 @@ void INTERNET_SetLastError(DWORD dwError) */ DWORD INTERNET_GetLastError(void) { - LPWITHREADERROR lpwite = (LPWITHREADERROR)TlsGetValue(g_dwTlsErrIndex); + LPWITHREADERROR lpwite = TlsGetValue(g_dwTlsErrIndex); if (!lpwite) return 0; /* TlsGetValue clears last error, so set it again here */ SetLastError(lpwite->dwError); @@ -3143,7 +3143,7 @@ BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest) */ LPSTR INTERNET_GetResponseBuffer(void) { - LPWITHREADERROR lpwite = (LPWITHREADERROR)TlsGetValue(g_dwTlsErrIndex); + LPWITHREADERROR lpwite = TlsGetValue(g_dwTlsErrIndex); if (!lpwite) lpwite = INTERNET_AllocThreadError(); TRACE("\n"); @@ -3487,6 +3487,9 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents, if (lpUrlComponents->lpszUrlPath) *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath); + if (lpUrlComponents->lpszExtraInfo) + *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, ExtraInfo); + return TRUE; } @@ -3735,7 +3738,6 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags, } } - if (lpUrlComponents->lpszUrlPath) { dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath); @@ -3743,6 +3745,13 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags, lpszUrl += dwLen; } + if (lpUrlComponents->lpszExtraInfo) + { + dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, ExtraInfo); + memcpy(lpszUrl, lpUrlComponents->lpszExtraInfo, dwLen * sizeof(WCHAR)); + lpszUrl += dwLen; + } + *lpszUrl = '\0'; return TRUE; diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 01471acda60..bc9ad33a3a6 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -1279,6 +1279,15 @@ static const char okmsg[] = "Server: winetest\r\n" "\r\n"; +static const char okmsg2[] = +"HTTP/1.1 200 OK\r\n" +"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" +"Server: winetest\r\n" +"Content-Length: 0\r\n" +"Set-Cookie: one\r\n" +"Set-Cookie: two\r\n" +"\r\n"; + static const char notokmsg[] = "HTTP/1.1 400 Bad Request\r\n" "Server: winetest\r\n" @@ -1468,6 +1477,10 @@ static DWORD CALLBACK server_thread(LPVOID param) else send(c, notokmsg, sizeof notokmsg-1, 0); } + if (strstr(buffer, "/testD")) + { + send(c, okmsg2, sizeof okmsg2-1, 0); + } if (strstr(buffer, "GET /quit")) { send(c, okmsg, sizeof okmsg-1, 0); @@ -1869,6 +1882,110 @@ static void test_basic_authentication(int port) InternetCloseHandle(session); } +static void test_HttpQueryInfo(int port) +{ + HINTERNET hi, hc, hr; + DWORD size, index; + char buffer[1024]; + BOOL ret; + + hi = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(hi != NULL, "InternetOpen failed\n"); + + hc = InternetConnect(hi, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(hc != NULL, "InternetConnect failed\n"); + + hr = HttpOpenRequest(hc, NULL, "/testD", NULL, NULL, NULL, 0, 0); + ok(hr != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequest(hr, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + index = 0; + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 1, "expected 1 got %u\n", index); + + index = 0; + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_DATE | HTTP_QUERY_FLAG_SYSTEMTIME, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 1, "expected 1 got %u\n", index); + + index = 0; + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_RAW_HEADERS, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 0, "expected 0 got %u\n", index); + + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_RAW_HEADERS, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 0, "expected 0 got %u\n", index); + + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_RAW_HEADERS_CRLF, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 0, "expected 0 got %u\n", index); + + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_STATUS_TEXT, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 0, "expected 0 got %u\n", index); + + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_VERSION, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 0, "expected 0 got %u\n", index); + + index = 0; + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 0, "expected 0 got %u\n", index); + + index = 0; + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 0, "expected 0 got %u\n", index); + + index = 0xdeadbeef; + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_FORWARDED, buffer, &size, &index); + ok(!ret, "HttpQueryInfo succeeded\n"); + ok(index == 0xdeadbeef, "expected 0xdeadbeef got %u\n", index); + + index = 0; + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_SERVER, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 1, "expected 1 got %u\n", index); + + index = 0; + size = sizeof(buffer); + strcpy(buffer, "Server"); + ret = HttpQueryInfo(hr, HTTP_QUERY_CUSTOM, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 1, "expected 1 got %u\n", index); + + index = 0; + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_SET_COOKIE, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 1, "expected 1 got %u\n", index); + + size = sizeof(buffer); + ret = HttpQueryInfo(hr, HTTP_QUERY_SET_COOKIE, buffer, &size, &index); + ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); + ok(index == 2, "expected 2 got %u\n", index); + + InternetCloseHandle(hr); + InternetCloseHandle(hc); + InternetCloseHandle(hi); +} + static void test_http_connection(void) { struct server_info si; @@ -1896,6 +2013,7 @@ static void test_http_connection(void) test_http1_1(si.port); test_cookie_header(si.port); test_basic_authentication(si.port); + test_HttpQueryInfo(si.port); /* send the basic request again to shutdown the server thread */ test_basic_request(si.port, "GET", "/quit"); diff --git a/dlls/wininet/tests/url.c b/dlls/wininet/tests/url.c index e9f2439e781..c848f6bc90d 100644 --- a/dlls/wininet/tests/url.c +++ b/dlls/wininet/tests/url.c @@ -52,6 +52,7 @@ #define CREATE_URL10 "about://host/blank" #define CREATE_URL11 "about:" #define CREATE_URL12 "http://www.winehq.org:65535" +#define CREATE_URL13 "http://localhost/?test=123" static void copy_compsA( URL_COMPONENTSA *src, @@ -455,9 +456,12 @@ static void InternetCreateUrlA_test(void) http[] = "http", https[] = "https", winehq[] = "www.winehq.org", + localhost[] = "localhost", username[] = "username", password[] = "password", + root[] = "/", site_about[] = "/site/about", + extra_info[] = "?test=123", about[] = "about", blank[] = "blank", host[] = "host"; @@ -771,6 +775,26 @@ static void InternetCreateUrlA_test(void) ok(!strcmp(szUrl, CREATE_URL12), "Expected %s, got %s\n", CREATE_URL12, szUrl); HeapFree(GetProcessHeap(), 0, szUrl); + + memset(&urlComp, 0, sizeof(urlComp)); + urlComp.dwStructSize = sizeof(URL_COMPONENTS); + urlComp.lpszScheme = http; + urlComp.dwSchemeLength = strlen(urlComp.lpszScheme); + urlComp.lpszHostName = localhost; + urlComp.dwHostNameLength = strlen(urlComp.lpszHostName); + urlComp.nPort = 80; + urlComp.lpszUrlPath = root; + urlComp.dwUrlPathLength = strlen(urlComp.lpszUrlPath); + urlComp.lpszExtraInfo = extra_info; + urlComp.dwExtraInfoLength = strlen(urlComp.lpszExtraInfo); + len = 256; + szUrl = HeapAlloc(GetProcessHeap(), 0, len); + InternetCreateUrlA(&urlComp, ICU_ESCAPE, szUrl, &len); + ok(ret, "Expected success\n"); + ok(len == strlen(CREATE_URL13), "Got len %u\n", len); + ok(!strcmp(szUrl, CREATE_URL13), "Expected \"%s\", got \"%s\"\n", CREATE_URL13, szUrl); + + HeapFree(GetProcessHeap(), 0, szUrl); } START_TEST(url) diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index b353302872f..fe3bc5bafe4 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -2794,7 +2794,7 @@ HANDLE WINAPI RetrieveUrlCacheEntryStreamA( pStream->hFile = hFile; strcpy(pStream->lpszUrl, lpszUrlName); - return (HANDLE)pStream; + return pStream; } /*********************************************************************** diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 179ad049f5b..052ecc1f209 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -7603,24 +7603,24 @@ static BOOL schedule_cups(LPCWSTR printer_name, LPCWSTR filename, LPCWSTR docume #ifdef SONAME_LIBCUPS if(pcupsPrintFile) { - char *unixname, *queue, *doc_titleA; + char *unixname, *queue, *unix_doc_title; DWORD len; BOOL ret; if(!(unixname = wine_get_unix_file_name(filename))) return FALSE; - len = WideCharToMultiByte(CP_ACP, 0, printer_name, -1, NULL, 0, NULL, NULL); + len = WideCharToMultiByte(CP_UNIXCP, 0, printer_name, -1, NULL, 0, NULL, NULL); queue = HeapAlloc(GetProcessHeap(), 0, len); - WideCharToMultiByte(CP_ACP, 0, printer_name, -1, queue, len, NULL, NULL); + WideCharToMultiByte(CP_UNIXCP, 0, printer_name, -1, queue, len, NULL, NULL); - len = WideCharToMultiByte(CP_ACP, 0, document_title, -1, NULL, 0, NULL, NULL); - doc_titleA = HeapAlloc(GetProcessHeap(), 0, len); - WideCharToMultiByte(CP_ACP, 0, document_title, -1, doc_titleA, len, NULL, NULL); + len = WideCharToMultiByte(CP_UNIXCP, 0, document_title, -1, NULL, 0, NULL, NULL); + unix_doc_title = HeapAlloc(GetProcessHeap(), 0, len); + WideCharToMultiByte(CP_UNIXCP, 0, document_title, -1, unix_doc_title, len, NULL, NULL); TRACE("printing via cups\n"); - ret = pcupsPrintFile(queue, unixname, doc_titleA, 0, NULL); - HeapFree(GetProcessHeap(), 0, doc_titleA); + ret = pcupsPrintFile(queue, unixname, unix_doc_title, 0, NULL); + HeapFree(GetProcessHeap(), 0, unix_doc_title); HeapFree(GetProcessHeap(), 0, queue); HeapFree(GetProcessHeap(), 0, unixname); return ret; @@ -7632,7 +7632,7 @@ static BOOL schedule_cups(LPCWSTR printer_name, LPCWSTR filename, LPCWSTR docume } } -INT_PTR CALLBACK file_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +static INT_PTR CALLBACK file_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { LPWSTR filename; @@ -7739,9 +7739,9 @@ static BOOL schedule_pipe(LPCWSTR cmd, LPCWSTR filename) if(!(unixname = wine_get_unix_file_name(filename))) return FALSE; - len = WideCharToMultiByte(CP_ACP, 0, cmd, -1, NULL, 0, NULL, NULL); + len = WideCharToMultiByte(CP_UNIXCP, 0, cmd, -1, NULL, 0, NULL, NULL); cmdA = HeapAlloc(GetProcessHeap(), 0, len); - WideCharToMultiByte(CP_ACP, 0, cmd, -1, cmdA, len, NULL, NULL); + WideCharToMultiByte(CP_UNIXCP, 0, cmd, -1, cmdA, len, NULL, NULL); TRACE("printing with: %s\n", cmdA); @@ -7800,9 +7800,9 @@ static BOOL schedule_unixfile(LPCWSTR output, LPCWSTR filename) if(!(unixname = wine_get_unix_file_name(filename))) return FALSE; - len = WideCharToMultiByte(CP_ACP, 0, output, -1, NULL, 0, NULL, NULL); + len = WideCharToMultiByte(CP_UNIXCP, 0, output, -1, NULL, 0, NULL, NULL); outputA = HeapAlloc(GetProcessHeap(), 0, len); - WideCharToMultiByte(CP_ACP, 0, output, -1, outputA, len, NULL, NULL); + WideCharToMultiByte(CP_UNIXCP, 0, output, -1, outputA, len, NULL, NULL); out_fd = open(outputA, O_CREAT | O_TRUNC | O_WRONLY, 0666); in_fd = open(unixname, O_RDONLY); diff --git a/dlls/winspool.drv/wspool.c b/dlls/winspool.drv/wspool.c index 1685573a35a..54f921da0c9 100644 --- a/dlls/winspool.drv/wspool.c +++ b/dlls/winspool.drv/wspool.c @@ -108,7 +108,7 @@ BOOL load_backend(void) * unload_backend [internal] * */ -void unload_backend(void) +static void unload_backend(void) { EnterCriticalSection(&backend_cs); backend = NULL; diff --git a/dlls/wintab32/context.c b/dlls/wintab32/context.c index 33c780c9ddb..f52d8d2c879 100644 --- a/dlls/wintab32/context.c +++ b/dlls/wintab32/context.c @@ -361,7 +361,7 @@ static VOID TABLET_BlankPacketData(LPOPENCONTEXT context, LPVOID lpPkt, INT n) } -UINT WINAPI WTInfoT(UINT wCategory, UINT nIndex, LPVOID lpOutput, BOOL bUnicode) +static UINT WTInfoT(UINT wCategory, UINT nIndex, LPVOID lpOutput, BOOL bUnicode) { UINT result; diff --git a/dlls/wnaspi32/winaspi16.c b/dlls/wnaspi32/winaspi16.c index 4209082b955..17d6a6c948f 100644 --- a/dlls/wnaspi32/winaspi16.c +++ b/dlls/wnaspi32/winaspi16.c @@ -252,7 +252,7 @@ ASPI_ExecScsiCmd(DWORD ptrPRB, UINT16 mode) if (HOST_TO_TARGET(lpPRB)) { /* send header, command, and then data */ in_len = SCSI_OFF + lpPRB->SRB_CDBLen + lpPRB->SRB_BufLen; - sg_hd = (struct sg_header *) malloc(in_len); + sg_hd = HeapAlloc(GetProcessHeap(), 0, in_len); memset(sg_hd, 0, SCSI_OFF); memcpy(sg_hd + 1, &lpPRB->CDBByte[0], lpPRB->SRB_CDBLen); if (lpPRB->SRB_BufLen) { @@ -262,20 +262,20 @@ ASPI_ExecScsiCmd(DWORD ptrPRB, UINT16 mode) else { /* send header and command - no data */ in_len = SCSI_OFF + lpPRB->SRB_CDBLen; - sg_hd = (struct sg_header *) malloc(in_len); + sg_hd = HeapAlloc(GetProcessHeap(), 0, in_len); memset(sg_hd, 0, SCSI_OFF); memcpy(sg_hd + 1, &lpPRB->CDBByte[0], lpPRB->SRB_CDBLen); } if (TARGET_TO_HOST(lpPRB)) { out_len = SCSI_OFF + lpPRB->SRB_BufLen; - sg_reply_hdr = (struct sg_header *) malloc(out_len); + sg_reply_hdr = HeapAlloc(GetProcessHeap(), 0, out_len); memset(sg_reply_hdr, 0, SCSI_OFF); sg_hd->reply_len = out_len; } else { out_len = SCSI_OFF; - sg_reply_hdr = (struct sg_header *) malloc(out_len); + sg_reply_hdr = HeapAlloc(GetProcessHeap(), 0, out_len); memset(sg_reply_hdr, 0, SCSI_OFF); sg_hd->reply_len = out_len; } @@ -343,8 +343,8 @@ ASPI_ExecScsiCmd(DWORD ptrPRB, UINT16 mode) } } - free(sg_reply_hdr); - free(sg_hd); + HeapFree(GetProcessHeap(), 0, sg_reply_hdr); + HeapFree(GetProcessHeap(), 0, sg_hd); ASPI_DebugPrintResult(lpPRB, mode); return SS_COMP; @@ -362,8 +362,8 @@ error_exit: * We probably should set lpPRB->SRB_TargStat, SRB_HaStat ? */ WARN("error_exit\n"); - free(sg_reply_hdr); - free(sg_hd); + HeapFree(GetProcessHeap(), 0, sg_reply_hdr); + HeapFree(GetProcessHeap(), 0, sg_hd); return lpPRB->SRB_Status; } #endif diff --git a/dlls/wnaspi32/winaspi32.c b/dlls/wnaspi32/winaspi32.c index 94ed418d7b6..45b352cb5ef 100644 --- a/dlls/wnaspi32/winaspi32.c +++ b/dlls/wnaspi32/winaspi32.c @@ -292,8 +292,8 @@ WNASPI32_DoPosting( SRB_ExecSCSICmd *lpPRB, DWORD status ) (*SRB_PostProc)(lpPRB); } else if (SRB_Flags & SRB_EVENT_NOTIFY) { - TRACE("Setting event %p\n", (HANDLE)SRB_PostProc); - SetEvent((HANDLE)SRB_PostProc); + TRACE("Setting event %p\n", SRB_PostProc); + SetEvent(SRB_PostProc); } } return SS_PENDING; @@ -598,7 +598,7 @@ DWORD __cdecl GetASPI32DLLVersion(void) return (DWORD)1; #else FIXME("Please add SCSI support for your operating system, returning 0\n"); - return (DWORD)0; + return 0; #endif } diff --git a/dlls/ws2_32/async.c b/dlls/ws2_32/async.c index 0929b71200c..8651141d052 100644 --- a/dlls/ws2_32/async.c +++ b/dlls/ws2_32/async.c @@ -203,15 +203,15 @@ static int WS_copy_he(char *p_to,char *p_base,int t_size,struct hostent* p_he, i struct WS_hostent *p_to32 = (struct WS_hostent*)p_to; int size = hostent_size(p_he) + ( - (flag & AQ_WIN16) ? sizeof(struct ws_hostent16) : sizeof(struct WS_hostent) + (flag & AQ_WIN32) ? sizeof(struct WS_hostent) : sizeof(struct ws_hostent16) - sizeof(struct hostent) ); if (t_size < size) return -size; p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_hostent16) : sizeof(struct WS_hostent); + p += (flag & AQ_WIN32) ? + sizeof(struct WS_hostent) : sizeof(struct ws_hostent16); p_name = p; strcpy(p, p_he->h_name); p += strlen(p) + 1; p_aliases = p; @@ -219,15 +219,7 @@ static int WS_copy_he(char *p_to,char *p_base,int t_size,struct hostent* p_he, i p_addr = p; list_dup(p_he->h_addr_list, p, p_base + (p - p_to), p_he->h_length); - if (flag & AQ_WIN16) - { - p_to16->h_addrtype = (INT16)p_he->h_addrtype; - p_to16->h_length = (INT16)p_he->h_length; - p_to16->h_name = (SEGPTR)(p_base + (p_name - p_to)); - p_to16->h_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); - p_to16->h_addr_list = (SEGPTR)(p_base + (p_addr - p_to)); - } - else + if (flag & AQ_WIN32) { p_to32->h_addrtype = p_he->h_addrtype; p_to32->h_length = p_he->h_length; @@ -235,6 +227,14 @@ static int WS_copy_he(char *p_to,char *p_base,int t_size,struct hostent* p_he, i p_to32->h_aliases = (char **)(p_base + (p_aliases - p_to)); p_to32->h_addr_list = (char **)(p_base + (p_addr - p_to)); } + else + { + p_to16->h_addrtype = (INT16)p_he->h_addrtype; + p_to16->h_length = (INT16)p_he->h_length; + p_to16->h_name = (SEGPTR)(p_base + (p_name - p_to)); + p_to16->h_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); + p_to16->h_addr_list = (SEGPTR)(p_base + (p_addr - p_to)); + } return size; } @@ -261,32 +261,31 @@ static int WS_copy_pe(char *p_to,char *p_base,int t_size,struct protoent* p_pe, struct WS_protoent *p_to32 = (struct WS_protoent*)p_to; int size = protoent_size(p_pe) + ( - (flag & AQ_WIN16) ? sizeof(struct ws_protoent16) : sizeof(struct WS_protoent) + (flag & AQ_WIN32) ? sizeof(struct WS_protoent) : sizeof(struct ws_protoent16) - sizeof(struct protoent) ); if (t_size < size) return -size; p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_protoent16) : sizeof(struct WS_protoent); + p += (flag & AQ_WIN32) ? sizeof(struct WS_protoent) : sizeof(struct ws_protoent16); p_name = p; strcpy(p, p_pe->p_name); p += strlen(p) + 1; p_aliases = p; list_dup(p_pe->p_aliases, p, p_base + (p - p_to), 0); - if (flag & AQ_WIN16) - { - p_to16->p_proto = (INT16)p_pe->p_proto; - p_to16->p_name = (SEGPTR)(p_base) + (p_name - p_to); - p_to16->p_aliases = (SEGPTR)((p_base) + (p_aliases - p_to)); - } - else + if (flag & AQ_WIN32) { p_to32->p_proto = p_pe->p_proto; p_to32->p_name = (p_base) + (p_name - p_to); p_to32->p_aliases = (char **)((p_base) + (p_aliases - p_to)); } + else + { + p_to16->p_proto = (INT16)p_pe->p_proto; + p_to16->p_name = (SEGPTR)(p_base) + (p_name - p_to); + p_to16->p_aliases = (SEGPTR)((p_base) + (p_aliases - p_to)); + } return size; } @@ -315,15 +314,14 @@ static int WS_copy_se(char *p_to,char *p_base,int t_size,struct servent* p_se, i struct WS_servent *p_to32 = (struct WS_servent*)p_to; int size = servent_size(p_se) + ( - (flag & AQ_WIN16) ? sizeof(struct ws_servent16) : sizeof(struct WS_servent) + (flag & AQ_WIN32) ? sizeof(struct WS_servent) : sizeof(struct ws_servent16) - sizeof(struct servent) ); if (t_size < size) return -size; p = p_to; - p += (flag & AQ_WIN16) ? - sizeof(struct ws_servent16) : sizeof(struct WS_servent); + p += (flag & AQ_WIN32) ? sizeof(struct WS_servent) : sizeof(struct ws_servent16); p_name = p; strcpy(p, p_se->s_name); p += strlen(p) + 1; p_proto = p; @@ -331,20 +329,20 @@ static int WS_copy_se(char *p_to,char *p_base,int t_size,struct servent* p_se, i p_aliases = p; list_dup(p_se->s_aliases, p, p_base + (p - p_to), 0); - if (flag & AQ_WIN16) - { - p_to16->s_port = (INT16)p_se->s_port; - p_to16->s_name = (SEGPTR)(p_base + (p_name - p_to)); - p_to16->s_proto = (SEGPTR)(p_base + (p_proto - p_to)); - p_to16->s_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); - } - else + if (flag & AQ_WIN32) { p_to32->s_port = p_se->s_port; p_to32->s_name = (p_base + (p_name - p_to)); p_to32->s_proto = (p_base + (p_proto - p_to)); p_to32->s_aliases = (char **)(p_base + (p_aliases - p_to)); } + else + { + p_to16->s_port = (INT16)p_se->s_port; + p_to16->s_name = (SEGPTR)(p_base + (p_name - p_to)); + p_to16->s_proto = (SEGPTR)(p_base + (p_proto - p_to)); + p_to16->s_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); + } return size; } diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index ceb9281c0cc..5250ccc4f08 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -317,7 +317,7 @@ static void server_start ( server_params *par ) { int i; test_params *gen = par->general; - server_memory *mem = (LPVOID) LocalAlloc ( LPTR, sizeof (server_memory)); + server_memory *mem = LocalAlloc ( LPTR, sizeof ( server_memory ) ); TlsSetValue ( tls, mem ); mem->s = WSASocketA ( AF_INET, gen->sock_type, gen->sock_prot, @@ -331,7 +331,7 @@ static void server_start ( server_params *par ) for (i = 0; i < MAX_CLIENTS; i++) { mem->sock[i].s = INVALID_SOCKET; - mem->sock[i].buf = (LPVOID) LocalAlloc ( LPTR, gen->n_chunks * gen->chunk_size ); + mem->sock[i].buf = LocalAlloc ( LPTR, gen->n_chunks * gen->chunk_size ); mem->sock[i].n_recvd = 0; mem->sock[i].n_sent = 0; } @@ -347,12 +347,12 @@ static void server_stop (void) for (i = 0; i < MAX_CLIENTS; i++ ) { - LocalFree ( (HANDLE) mem->sock[i].buf ); + LocalFree ( mem->sock[i].buf ); if ( mem->sock[i].s != INVALID_SOCKET ) closesocket ( mem->sock[i].s ); } ok ( closesocket ( mem->s ) == 0, "closesocket failed\n" ); - LocalFree ( (HANDLE) mem ); + LocalFree ( mem ); ExitThread ( GetCurrentThreadId () ); } @@ -361,7 +361,7 @@ static void server_stop (void) static void client_start ( client_params *par ) { test_params *gen = par->general; - client_memory *mem = (LPVOID) LocalAlloc (LPTR, sizeof (client_memory)); + client_memory *mem = LocalAlloc (LPTR, sizeof (client_memory)); TlsSetValue ( tls, mem ); @@ -376,7 +376,7 @@ static void client_start ( client_params *par ) ok ( mem->s != INVALID_SOCKET, "Client: WSASocket failed\n" ); - mem->send_buf = (LPVOID) LocalAlloc ( LPTR, 2 * gen->n_chunks * gen->chunk_size ); + mem->send_buf = LocalAlloc ( LPTR, 2 * gen->n_chunks * gen->chunk_size ); mem->recv_buf = mem->send_buf + gen->n_chunks * gen->chunk_size; fill_buffer ( mem->send_buf, gen->chunk_size, gen->n_chunks ); @@ -389,8 +389,8 @@ static void client_stop (void) { client_memory *mem = TlsGetValue ( tls ); wsa_ok ( closesocket ( mem->s ), 0 ==, "closesocket error (%x): %d\n" ); - LocalFree ( (HANDLE) mem->send_buf ); - LocalFree ( (HANDLE) mem ); + LocalFree ( mem->send_buf ); + LocalFree ( mem ); ExitThread(0); } diff --git a/include/activdbg.idl b/include/activdbg.idl index b41ae0906b7..c046ad33a95 100644 --- a/include/activdbg.idl +++ b/include/activdbg.idl @@ -334,6 +334,85 @@ interface IDebugApplication32 : IRemoteDebugApplication } /************************************************************ + * interface IDebugApplication64 + */ +[ + object, + uuid(4dedc754-04c7-4f10-9e60-16a390fe6e62), + pointer_default(unique), + local +] +interface IDebugApplication64 : IRemoteDebugApplication +{ + HRESULT SetName( + [in] LPCOLESTR pstrName); + + HRESULT StepOutComplete(); + + HRESULT DebugOutput( + [in] LPCOLESTR pstr); + + HRESULT StartDebugSession(); + + HRESULT HandleBreakPoint( + [in] BREAKREASON br, + [out] BREAKRESUMEACTION *pbra); + + HRESULT Close(); + + HRESULT GetBreakFlags( + [out] APPBREAKFLAGS *pabf, + [out] IRemoteDebugApplicationThread **pprdatSteppingThread); + + HRESULT GetCurrentThread( + [out] IDebugApplicationThread **pat); + + HRESULT CreateAsyncDebugOperation( + [in] IDebugSyncOperation *psdo, + [out] IDebugAsyncOperation **ppado); + + HRESULT AddStackFrameSniffer( + [in] IDebugStackFrameSniffer *pdsfs, + [out] DWORD *pdwCookie); + + HRESULT RemoveStackFrameSniffer( + [in] DWORD dwCookie); + + HRESULT QueryCurrentThreadIsDebuggerThread(); + + HRESULT SynchronousCallInDebuggerThread( + [in] IDebugThreadCall32 *pptc, + [in] DWORDLONG dwParam1, + [in] DWORDLONG dwParam2, + [in] DWORDLONG dwParam3); + + HRESULT CreateApplicationNode( + [out] IDebugApplicationNode **ppdanNew); + + HRESULT FireDebuggerEvent( + [in] REFGUID riid, + [in] IUnknown *punk); + + HRESULT HandleRuntimeError( + [in] IActiveScriptErrorDebug *pErrorDebug, + [in] IActiveScriptSite *pScriptSite, + [out] BREAKRESUMEACTION *pbra, + [out] ERRORRESUMEACTION *perra, + [out] BOOL *pfCallOnScriptError); + + BOOL FCanJitDebug(); + + BOOL FIsAutoJitDebugEnabled(); + + HRESULT AddGlobalExpressionContextProvider( + [in] IProvideExpressionContexts *pdsfs, + [out] DWORDLONG *pdwCookie); + + HRESULT RemoveGlobalExpressionContextProvider( + [in] DWORDLONG dwCookie); +} + +/************************************************************ * interface IActiveScriptSiteDebug32 */ [ @@ -362,6 +441,35 @@ interface IActiveScriptSiteDebug32 : IUnknown [out] BOOL *pfCallOnScriptErrorWhenContinuing); } +/************************************************************ + * interface IActiveScriptSiteDebug64 + */ +[ + object, + uuid(d6b96b0a-7463-402c-92ac-89984226942f), + pointer_default(unique), + local +] +interface IActiveScriptSiteDebug64 : IUnknown +{ + HRESULT GetDocumentContextFromPosition( + [in] DWORDLONG dwSourceContext, + [in] ULONG uCharacterOffset, + [in] ULONG uNumChars, + [out] IDebugDocumentContext **ppsc); + + HRESULT GetApplication( + [out] IDebugApplication64 **ppda); + + HRESULT GetRootApplicationNode( + [out] IDebugApplicationNode **ppdanRoot); + + HRESULT OnScriptErrorDebug( + [in] IActiveScriptErrorDebug *pErrorDebug, + [out] BOOL *pfEnterDebugger, + [out] BOOL *pfCallOnScriptErrorWhenContinuing); +} + cpp_quote("#ifndef DISABLE_ACTIVDBG_INTERFACE_WRAPPERS") cpp_quote("#ifdef _WIN64") diff --git a/include/cvconst.h b/include/cvconst.h index 2b1cdf5cc29..86dd3f1ba16 100644 --- a/include/cvconst.h +++ b/include/cvconst.h @@ -528,7 +528,7 @@ enum CV_HREG_e CV_AMD64_R13 = 341, CV_AMD64_R14 = 342, CV_AMD64_R15 = 343, -} CV_HREG_e; +}; typedef enum { diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h index 3138b8cecad..8f7470d5dbe 100644 --- a/include/gdiplusenums.h +++ b/include/gdiplusenums.h @@ -76,6 +76,16 @@ enum PathPointType{ PathPointTypeBezier3 = 3 }; +enum PenType +{ + PenTypeSolidColor = BrushTypeSolidColor, + PenTypeHatchFill = BrushTypeHatchFill, + PenTypeTextureFill = BrushTypeTextureFill, + PenTypePathGradient = BrushTypePathGradient, + PenTypeLinearGradient = BrushTypeLinearGradient, + PenTypeUnknown = -1 +}; + enum LineJoin { LineJoinMiter = 0, @@ -384,6 +394,7 @@ typedef enum FlushIntention FlushIntention; typedef enum CoordinateSpace CoordinateSpace; typedef enum GpTestControlEnum GpTestControlEnum; typedef enum MetafileFrameUnit MetafileFrameUnit; +typedef enum PenType PenType; #endif /* end of c typedefs */ diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index ea4bec5940e..1f93258fe29 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -388,7 +388,7 @@ GpStatus WINGDIPAPI GdipInvertMatrix(GpMatrix*); GpStatus WINGDIPAPI GdipIsMatrixEqual(GDIPCONST GpMatrix*, GDIPCONST GpMatrix*, BOOL*); GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix*, BOOL*); GpStatus WINGDIPAPI GdipIsMatrixInvertible(GDIPCONST GpMatrix*, BOOL*); -GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix*,GpMatrix*,GpMatrixOrder); +GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix*,GDIPCONST GpMatrix*,GpMatrixOrder); GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix*,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipShearMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder); @@ -480,6 +480,7 @@ GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*); GpStatus WINGDIPAPI GdipGetPenMode(GpPen*,GpPenAlignment*); GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*); GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB); +GpStatus WINGDIPAPI GdipSetPenCompoundArray(GpPen*,GDIPCONST REAL*,INT); GpStatus WINGDIPAPI GdipSetPenCustomEndCap(GpPen*,GpCustomLineCap*); GpStatus WINGDIPAPI GdipSetPenCustomStartCap(GpPen*,GpCustomLineCap*); GpStatus WINGDIPAPI GdipSetPenDashArray(GpPen*,GDIPCONST REAL*,INT); @@ -487,6 +488,7 @@ GpStatus WINGDIPAPI GdipSetPenDashCap197819(GpPen*,GpDashCap); GpStatus WINGDIPAPI GdipSetPenDashOffset(GpPen*,REAL); GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen*,GpDashStyle); GpStatus WINGDIPAPI GdipSetPenEndCap(GpPen*,GpLineCap); +GpStatus WINGDIPAPI GdipGetPenFillType(GpPen*,GpPenType*); GpStatus WINGDIPAPI GdipSetPenLineCap197819(GpPen*,GpLineCap,GpLineCap,GpDashCap); GpStatus WINGDIPAPI GdipSetPenLineJoin(GpPen*,GpLineJoin); GpStatus WINGDIPAPI GdipSetPenMode(GpPen*,GpPenAlignment); diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index e1d1706edb0..a768638e0ad 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -90,5 +90,6 @@ typedef WrapMode GpWrapMode; typedef Color GpColor; typedef FlushIntention GpFlushIntention; typedef CoordinateSpace GpCoordinateSpace; +typedef PenType GpPenType; #endif diff --git a/include/mshtml.idl b/include/mshtml.idl index 680748b84e7..8bf3efa2f99 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -1,5 +1,6 @@ /* * Copyright 2004-2007 Jacek Caban for CodeWeavers + * Copyright 2008 Konstantin Kondratyuk (Etersoft) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,6 +33,61 @@ cpp_quote("DEFINE_GUID(SID_SHTMLEditServices, 0x3050f7f9,0x98b5,0x11cf,0xbb,0x cpp_quote("#define SID_SHTMLWindow IID_IHTMLWindow2") cpp_quote("#define SID_SElementBehaviorFactory IID_IElementBehaviorFactory") +typedef enum { + POINTER_GRAVITY_Left, + POINTER_GRAVITY_Right, + POINTER_GRAVITY_Max = 2147483647 +} POINTER_GRAVITY; + +typedef enum { + CONTEXT_TYPE_None, + CONTEXT_TYPE_Text, + CONTEXT_TYPE_EnterScope, + CONTEXT_TYPE_ExitScope, + CONTEXT_TYPE_NoScope, + MARKUP_CONTEXT_TYPE_Max = 2147483647 +} MARKUP_CONTEXT_TYPE; + +typedef enum { + ELEM_ADJ_BeforeBegin, + ELEM_ADJ_AfterBegin, + ELEM_ADJ_BeforeEnd, + ELEM_ADJ_AfterEnd, + ELEMENT_ADJACENCY_Max = 2147483647 +} ELEMENT_ADJACENCY; + +typedef enum { + MOVEUNIT_PREVCHAR, + MOVEUNIT_NEXTCHAR, + MOVEUNIT_PREVCLUSTERBEG, + MOVEUNIT_NEXTCLUSTERBEG, + MOVEUNIT_PREVCLUSTEREND, + MOVEUNIT_NEXTCLUSTEREND, + MOVEUNIT_PREVWORDBEG, + MOVEUNIT_NEXTWORDBEG, + MOVEUNIT_PREVWORDEND, + MOVEUNIT_NEXTWORDEND, + MOVEUNIT_PREVPROOFWORD, + MOVEUNIT_NEXTPROOFWORD, + MOVEUNIT_NEXTURLBEG, + MOVEUNIT_PREVURLBEG, + MOVEUNIT_NEXTURLEND, + MOVEUNIT_PREVURLEND, + MOVEUNIT_PREVSENTENCE, + MOVEUNIT_NEXTSENTENCE, + MOVEUNIT_PREVBLOCK, + MOVEUNIT_NEXTBLOCK, + MOVEUNIT_ACTION_Max = 2147483647 +} MOVEUNIT_ACTION; + +typedef enum _SELECTION_TYPE { + SELECTION_TYPE_None, + SELECTION_TYPE_Caret, + SELECTION_TYPE_Text, + SELECTION_TYPE_Control, + SELECTION_TYPE_Max = 2147483647 +} SELECTION_TYPE; + interface IHTMLDocument2; interface IHTMLStyleSheetsCollection; interface IHTMLFrameBase; @@ -20032,4 +20088,242 @@ methods: VARIANT width(); } +/***************************************************************************** + * IMarkupContainer interface + */ +[ + object, + pointer_default(unique), + uuid(3050f5f9-98b5-11cf-bb82-00aa00bdce0B) +] +interface IMarkupContainer : IUnknown +{ + HRESULT OwningDoc([out] IHTMLDocument2 **ppDoc); +} + +/***************************************************************************** + * IMarkupPointer interface + */ +[ + object, + pointer_default(unique), + uuid(3050f49f-98b5-11cf-bb82-00aa00bdce0b) +] +interface IMarkupPointer : IUnknown +{ + HRESULT OwningDoc([out] IHTMLDocument2 **ppDoc); + + HRESULT Gravity([out] POINTER_GRAVITY *pGravity); + + HRESULT SetGravity([in] POINTER_GRAVITY Gravity); + + HRESULT Cling([out] BOOL *pfCling); + + HRESULT SetCling([in] BOOL fCLing); + + HRESULT UnPosition(); + + HRESULT IsPositioned([out] BOOL *pfPositioned); + + HRESULT GetContainer([out] IMarkupContainer **ppContainer); + + HRESULT MoveAdjacentToElement( + [in] IHTMLElement *pElement, + [in] ELEMENT_ADJACENCY eAdj); + + HRESULT MoveToPointer([in] IMarkupPointer *pPointer); + + HRESULT MoveToContainer( + [in] IMarkupContainer *pContainer, + [in] BOOL fAtStart); + + HRESULT Left( + [in] BOOL fMove, + [out] MARKUP_CONTEXT_TYPE *pContext, + [out] IHTMLElement **ppElement, + [in, out] long *pcch, + [out, size_is(*pcch)] OLECHAR *pchText); + + HRESULT Right( + [in] BOOL fMove, + [out] MARKUP_CONTEXT_TYPE *pContext, + [out] IHTMLElement **ppElement, + [in, out] long *pcch, + [out, size_is(*pcch)] OLECHAR *pchText); + + HRESULT CurrentScope([out] IHTMLElement **ppElemCurrent); + + HRESULT IsLeftOf( + [in] IMarkupPointer *pPointerThat, + [out] BOOL *pfResult); + + HRESULT IsLeftOfOrEqualTo( + [in] IMarkupPointer *pPointerThat, + [out] BOOL *pfResult); + + HRESULT IsRightOf( + [in] IMarkupPointer *pPointerThat, + [out] BOOL *pfResult); + + HRESULT IsRightOfOrEqualTo( + [in] IMarkupPointer *pPointerThat, + [out] BOOL *pfResult); + + HRESULT IsEqualTo( + [in] IMarkupPointer *pPointerThat, + [out] BOOL *pfAreEqual); + + HRESULT MoveUnit([in] MOVEUNIT_ACTION muAction); + + HRESULT FindText( + [in] OLECHAR *pchFindText, + [in] DWORD dwFlags, + [in] IMarkupPointer *pIEndMatch, + [in] IMarkupPointer *pIEndSearch); +} + +/***************************************************************************** + * ISegment interface + */ +[ + object, + pointer_default(unique), + uuid(83f65030-b598-cf11-bb82-00aa00bdce0b) +] +interface ISegment : IUnknown +{ + HRESULT GetPointers( + [in] IMarkupPointer *pIStart, + [in] IMarkupPointer *pIEnd); +} + +/***************************************************************************** + * IElementSegment interface + */ +[ + object, + pointer_default(unique), + uuid(3050f68f-98b5-11cf-bb82-00aa00bdce0b) +] +interface IElementSegment : ISegment +{ + HRESULT GetElement([out] IHTMLElement **ppIElement); + + HRESULT SetPrimary([in] BOOL fPrimary); + + HRESULT IsPrimary([out] BOOL *pfPrimary); +} + +/***************************************************************************** + * ISelectionServicesListener interface + */ +[ + object, + pointer_default(unique), + uuid(99f65030-b598-cf11-bb82-00aa00bdce0b) +] +interface ISelectionServicesListener : IUnknown +{ + HRESULT BeginSelectionUndo(); + + HRESULT EndSelectionUndo(); + + HRESULT OnSelectedElementExit( + [in] IMarkupPointer *pIElementStart, + [in] IMarkupPointer *pIElementEnd, + [in] IMarkupPointer *pIElementContentStart, + [in] IMarkupPointer *pIElementContentEnd); + + HRESULT OnChangeType( + [in] SELECTION_TYPE eType, + [in] ISelectionServicesListener *pIListener); + + HRESULT GetTypeDetail([out] BSTR *pTypeDetail); +} + +/***************************************************************************** + * ISelectionServices interface + */ +[ + object, + pointer_default(unique), + uuid(3050f684-98b5-11cf-bb82-00aa00bdce0b) +] +interface ISelectionServices : IUnknown +{ + HRESULT SetSelectionType( + [in] SELECTION_TYPE eType, + [in] ISelectionServicesListener *pIListener); + + HRESULT GetMarkupContainer([out] IMarkupContainer **ppIContainer); + + HRESULT AddSegment( + [in] IMarkupPointer *pIStart, + [in] IMarkupPointer *pIEnd, + [out] ISegment **ppISegmentAdded); + + HRESULT AddElementSegment( + [in] IHTMLElement *pIElement, + [out] IElementSegment **ppISegmentAdded); + + HRESULT RemoveSegment([in] ISegment *pISegment); + + HRESULT GetSelectionServicesListener([out] ISelectionServicesListener **ppISelectionServicesListener); +} + +/***************************************************************************** + * IHTMLEditDesigner interface + */ +[ + object, + pointer_default(unique), + uuid(3050f662-98b5-11cf-bb82-00aa00bdce0b) +] +interface IHTMLEditDesigner : IUnknown +{ + HRESULT PreHandleEvent( + [in] DISPID inEvtDispId, + [in] IHTMLEventObj *pIEventObj); + + HRESULT PostHandleEvent( + [in] DISPID inEvtDispId, + [in] IHTMLEventObj *pIEventObj); + + HRESULT TranslateAccelerator( + [in] DISPID inEvtDispId, + [in] IHTMLEventObj *pIEventObj); + + HRESULT PostEditorEventNotify( + [in] DISPID inEvtDispId, + [in] IHTMLEventObj *pIEventObj); +} + +/***************************************************************************** + * IHTMLEditServices interface + */ +[ + object, + pointer_default(unique), + uuid(3050f663-98b5-11cf-bb82-00aa00bdce0b) +] +interface IHTMLEditServices : IUnknown +{ + HRESULT AddDesigner([in] IHTMLEditDesigner *pIDesigner); + + HRESULT RemoveDesigner([in] IHTMLEditDesigner *pIDesigner); + + HRESULT GetSelectionServices( + [in] IMarkupContainer *pIContainer, + [out] ISelectionServices **ppSelSvc); + + HRESULT MoveToSelectionAnchor([in] IMarkupPointer *pIStartAnchor); + + HRESULT MoveToSelectionEnd([in] IMarkupPointer *pIEndAnchor); + + HRESULT SelectRange( + [in] IMarkupPointer* pStart, + [in] IMarkupPointer* pEnd, + [in] SELECTION_TYPE eType); +} + } /* library MSHTML */ diff --git a/include/rpcproxy.h b/include/rpcproxy.h index acddc729b36..76a88128d83 100644 --- a/include/rpcproxy.h +++ b/include/rpcproxy.h @@ -125,7 +125,7 @@ typedef struct tagCStdPSFactoryBuffer #define STUB_FORWARDING_FUNCTION NdrStubForwardingFunction -ULONG STDMETHODCALLTYPE CStdStubBuffer2_Release(IRpcStubBuffer *This); +ULONG STDMETHODCALLTYPE CStdStubBuffer2_Release(IRpcStubBuffer *This) DECLSPEC_HIDDEN; ULONG STDMETHODCALLTYPE NdrCStdStubBuffer2_Release(IRpcStubBuffer *This, IPSFactoryBuffer *pPSF); #define CStdStubBuffer_DELEGATING_METHODS 0, 0, CStdStubBuffer2_Release, 0, 0, 0, 0, 0, 0, 0 @@ -136,7 +136,7 @@ HRESULT WINAPI ULONG WINAPI CStdStubBuffer_AddRef( IRpcStubBuffer *This ); ULONG WINAPI - CStdStubBuffer_Release( IRpcStubBuffer *This ); + CStdStubBuffer_Release( IRpcStubBuffer *This ) DECLSPEC_HIDDEN; ULONG WINAPI NdrCStdStubBuffer_Release( IRpcStubBuffer *This, IPSFactoryBuffer *pPSF ); HRESULT WINAPI @@ -233,10 +233,10 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ /* macros used in dlldata.c files */ #define EXTERN_PROXY_FILE(proxy) \ - EXTERN_C const ProxyFileInfo proxy##_ProxyFileInfo; + EXTERN_C const ProxyFileInfo proxy##_ProxyFileInfo DECLSPEC_HIDDEN; #define PROXYFILE_LIST_START \ - const ProxyFileInfo *aProxyFileList[] = \ + const ProxyFileInfo * aProxyFileList[] DECLSPEC_HIDDEN = \ { #define REFERENCE_PROXY_FILE(proxy) \ @@ -251,11 +251,11 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ /* define PROXY_CLSID_IS to specify the CLSID data of the PSFactoryBuffer */ /* define neither to use the GUID of the first interface */ #ifdef PROXY_CLSID -# define CLSID_PSFACTORYBUFFER extern CLSID PROXY_CLSID; +# define CLSID_PSFACTORYBUFFER extern CLSID PROXY_CLSID DECLSPEC_HIDDEN; #else # ifdef PROXY_CLSID_IS -# define CLSID_PSFACTORYBUFFER const CLSID CLSID_PSFactoryBuffer = \ - PROXY_CLSID_IS; +# define CLSID_PSFACTORYBUFFER const CLSID CLSID_PSFactoryBuffer DECLSPEC_HIDDEN; \ + const CLSID CLSID_PSFactoryBuffer = PROXY_CLSID_IS; # define PROXY_CLSID CLSID_PSFactoryBuffer # else # define CLSID_PSFACTORYBUFFER @@ -287,6 +287,8 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ #define DLLDATA_GETPROXYDLLINFO(pfl, rclsid) \ void RPC_ENTRY GetProxyDllInfo(const ProxyFileInfo ***ppProxyFileInfo, \ + const CLSID **ppClsid) DECLSPEC_HIDDEN; \ + void RPC_ENTRY GetProxyDllInfo(const ProxyFileInfo ***ppProxyFileInfo, \ const CLSID **ppClsid) \ { \ *ppProxyFileInfo = (pfl); \ @@ -294,6 +296,7 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ } #define DLLGETCLASSOBJECTROUTINE(pfl, factory_clsid, factory) \ + HRESULT WINAPI DLLGETCLASSOBJECT_ENTRY(REFCLSID rclsid, REFIID riid, void **ppv) DECLSPEC_HIDDEN; \ HRESULT WINAPI DLLGETCLASSOBJECT_ENTRY(REFCLSID rclsid, REFIID riid, \ void **ppv) \ { \ @@ -302,14 +305,16 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ } #define DLLCANUNLOADNOW(factory) \ + HRESULT WINAPI DLLCANUNLOADNOW_ENTRY(void) DECLSPEC_HIDDEN; \ HRESULT WINAPI DLLCANUNLOADNOW_ENTRY(void) \ { \ return NdrDllCanUnloadNow((factory)); \ } #define REGISTER_PROXY_DLL_ROUTINES(pfl, factory_clsid) \ - HINSTANCE hProxyDll = NULL; \ + HINSTANCE hProxyDll DECLSPEC_HIDDEN = NULL; \ \ + BOOL WINAPI DLLMAIN_ENTRY(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) DECLSPEC_HIDDEN; \ BOOL WINAPI DLLMAIN_ENTRY(HINSTANCE hinstDLL, DWORD fdwReason, \ LPVOID lpvReserved) \ { \ @@ -321,11 +326,13 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ return TRUE; \ } \ \ + HRESULT WINAPI DLLREGISTERSERVER_ENTRY(void) DECLSPEC_HIDDEN; \ HRESULT WINAPI DLLREGISTERSERVER_ENTRY(void) \ { \ return NdrDllRegisterProxy(hProxyDll, (pfl), (factory_clsid)); \ } \ \ + HRESULT WINAPI DLLUNREGISTERSERVER_ENTRY(void) DECLSPEC_HIDDEN; \ HRESULT WINAPI DLLUNREGISTERSERVER_ENTRY(void) \ { \ return NdrDllUnregisterProxy(hProxyDll, (pfl), (factory_clsid)); \ @@ -340,7 +347,7 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ #define DLLDATA_ROUTINES(pfl, factory_clsid) \ CLSID_PSFACTORYBUFFER \ - CStdPSFactoryBuffer gPFactory = { NULL, 0, NULL, 0 }; \ + CStdPSFactoryBuffer DECLSPEC_HIDDEN gPFactory = { NULL, 0, NULL, 0 }; \ DLLDATA_GETPROXYDLLINFO(pfl, factory_clsid) \ DLLGETCLASSOBJECTROUTINE(pfl, factory_clsid, &gPFactory) \ DLLCANUNLOADNOW(&gPFactory) \ diff --git a/include/wine/library.h b/include/wine/library.h index 2411ae1bd96..84d0a60d26f 100644 --- a/include/wine/library.h +++ b/include/wine/library.h @@ -93,7 +93,7 @@ extern void *wine_ldt_get_ptr( unsigned short sel, unsigned long offset ); extern unsigned short wine_ldt_alloc_entries( int count ); extern unsigned short wine_ldt_realloc_entries( unsigned short sel, int oldcount, int newcount ); extern void wine_ldt_free_entries( unsigned short sel, int count ); -#ifdef __i386__ +#if defined(__i386__) && !defined(__MINGW32__) && !defined(_MSC_VER) extern unsigned short wine_ldt_alloc_fs(void); extern void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry ); extern void wine_ldt_free_fs( unsigned short sel ); @@ -178,7 +178,15 @@ static inline int wine_ldt_is_empty( const LDT_ENTRY *ent ) /* segment register access */ #ifdef __i386__ -# ifdef __GNUC__ +# ifdef __MINGW32__ +# define __DEFINE_GET_SEG(seg) \ + static inline unsigned short wine_get_##seg(void); \ + static inline unsigned short wine_get_##seg(void) \ + { unsigned short res; __asm__ __volatile__("movw %%" #seg ",%w0" : "=r"(res)); return res; } +# define __DEFINE_SET_SEG(seg) \ + static inline void wine_set_##seg(int val); \ + static inline void wine_set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); } +# elif defined(__GNUC__) # define __DEFINE_GET_SEG(seg) \ extern inline unsigned short wine_get_##seg(void); \ extern inline unsigned short wine_get_##seg(void) \ diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index bd2826cdf29..abb0d3b13ef 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -1850,11 +1850,11 @@ typedef struct glDescriptor typedef struct WineDirect3DStridedData { - BYTE *lpData; /* Pointer to start of data */ - DWORD dwStride; /* Stride between occurrences of this data */ - DWORD dwType; /* Type (as in D3DVSDT_TYPE) */ - int VBO; /* Vertex buffer object this data is in */ - UINT streamNo; /* D3D stream number */ + const BYTE *lpData; /* Pointer to start of data */ + DWORD dwStride; /* Stride between occurrences of this data */ + DWORD dwType; /* Type (as in D3DVSDT_TYPE) */ + int VBO; /* Vertex buffer object this data is in */ + UINT streamNo; /* D3D stream number */ } WineDirect3DStridedData; typedef struct WineDirect3DVertexStridedData @@ -3374,12 +3374,12 @@ interface IWineD3DDevice : IWineD3DBase HRESULT DrawPrimitiveStrided( [in] WINED3DPRIMITIVETYPE primitive_type, [in] UINT primitive_count, - [in] WineDirect3DVertexStridedData *strided_data + [in] const WineDirect3DVertexStridedData *strided_data ); HRESULT DrawIndexedPrimitiveStrided( [in] WINED3DPRIMITIVETYPE primitive_type, [in] UINT primitive_count, - [in] WineDirect3DVertexStridedData *strided_data, + [in] const WineDirect3DVertexStridedData *strided_data, [in] UINT vertex_count, [in] const void *index_data, [in] WINED3DFORMAT index_data_format diff --git a/include/winnt.h b/include/winnt.h index a1e9fe02767..d8a501966bf 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -1454,6 +1454,8 @@ typedef struct _CONTEXT typedef CONTEXT *PCONTEXT; +NTSYSAPI void WINAPI RtlCaptureContext(CONTEXT*); + /* * Language IDs */ @@ -2007,6 +2009,21 @@ extern inline struct _TEB * WINAPI NtCurrentTeb(void) __asm mov teb, eax; return teb; } +#elif defined(__x86_64__) && defined(__GNUC__) +extern inline struct _TEB * WINAPI NtCurrentTeb(void) +{ + struct _TEB *teb; + __asm__(".byte 0x65\n\tmovq (0x30),%0" : "=r" (teb)); + return teb; +} +#elif defined(__x86_64__) && defined (_MSC_VER) +extern inline struct _TEB * WINAPI NtCurrentTeb(void) +{ + struct _TEB *teb; + __asm mov rax, gs:[0x30]; + __asm mov teb, rax; + return teb; +} #else extern struct _TEB * WINAPI NtCurrentTeb(void); #endif diff --git a/libs/wine/ldt.c b/libs/wine/ldt.c index c46ff6f72f7..80ceba85db7 100644 --- a/libs/wine/ldt.c +++ b/libs/wine/ldt.c @@ -385,7 +385,7 @@ void wine_ldt_free_entries( unsigned short sel, int count ) } -#ifdef __i386__ +#if defined(__i386__) && !defined(__MINGW32__) && !defined(_MSC_VER) static int global_fs_sel = -1; /* global selector for %fs shared among all threads */ @@ -477,8 +477,6 @@ void wine_ldt_free_fs( unsigned short sel ) /*********************************************************************** * selector access functions */ -# ifndef _MSC_VER -/* Nothing needs to be done for MS C, it will do with inline versions from the winnt.h */ __ASM_GLOBAL_FUNC( wine_get_cs, "movw %cs,%ax\n\tret" ) __ASM_GLOBAL_FUNC( wine_get_ds, "movw %ds,%ax\n\tret" ) __ASM_GLOBAL_FUNC( wine_get_es, "movw %es,%ax\n\tret" ) @@ -487,6 +485,5 @@ __ASM_GLOBAL_FUNC( wine_get_gs, "movw %gs,%ax\n\tret" ) __ASM_GLOBAL_FUNC( wine_get_ss, "movw %ss,%ax\n\tret" ) __ASM_GLOBAL_FUNC( wine_set_fs, "movl 4(%esp),%eax\n\tmovw %ax,%fs\n\tret" ) __ASM_GLOBAL_FUNC( wine_set_gs, "movl 4(%esp),%eax\n\tmovw %ax,%gs\n\tret" ) -# endif /* defined(_MSC_VER) */ #endif /* __i386__ */ diff --git a/libs/wine/wine.def b/libs/wine/wine.def index b641c9476b9..a13ab638658 100644 --- a/libs/wine/wine.def +++ b/libs/wine/wine.def @@ -80,28 +80,19 @@ EXPORTS wine_get_build_dir wine_get_build_id wine_get_config_dir - wine_get_cs wine_get_data_dir - wine_get_ds - wine_get_es - wine_get_fs - wine_get_gs wine_get_server_dir wine_get_sortkey - wine_get_ss wine_get_user_name wine_get_version wine_init wine_init_argv0_path wine_is_dbcs_leadbyte wine_ldt_alloc_entries - wine_ldt_alloc_fs wine_ldt_copy wine_ldt_free_entries - wine_ldt_free_fs wine_ldt_get_entry wine_ldt_get_ptr - wine_ldt_init_fs wine_ldt_init_locking wine_ldt_is_system wine_ldt_realloc_entries @@ -112,8 +103,6 @@ EXPORTS wine_mmap_remove_reserved_area wine_pthread_get_functions wine_pthread_set_functions - wine_set_fs - wine_set_gs wine_switch_to_stack wine_utf8_mbstowcs wine_utf8_wcstombs diff --git a/loader/pthread.c b/loader/pthread.c index 4951d9706f4..4c0c8924a32 100644 --- a/loader/pthread.c +++ b/loader/pthread.c @@ -48,10 +48,15 @@ static int init_done; static int nb_threads = 1; -#ifndef __i386__ +#if !defined(__i386__) && !defined(__x86_64__) static pthread_key_t teb_key; #endif +#if defined(__x86_64__) && defined(__linux__) +#include +extern int arch_prctl(int func, void *ptr); +#endif + /*********************************************************************** * init_process * @@ -141,6 +146,13 @@ static void init_current_teb( struct wine_pthread_thread_info *info ) wine_ldt_set_limit( &fs_entry, info->teb_size - 1 ); wine_ldt_set_flags( &fs_entry, WINE_LDT_FLAGS_DATA|WINE_LDT_FLAGS_32BIT ); wine_ldt_init_fs( info->teb_sel, &fs_entry ); +#elif defined(__x86_64__) + /* On x86_64, it's in %gs */ +# ifdef __linux__ + arch_prctl(ARCH_SET_GS, info->teb_base); +# else +# error Please define setting %gs for your architecture +# endif #else if (!init_done) /* first thread */ pthread_key_create( &teb_key, NULL ); @@ -174,6 +186,10 @@ static void *get_current_teb(void) void *ret; __asm__( ".byte 0x64\n\tmovl 0x18,%0" : "=r" (ret) ); return ret; +#elif defined(__x86_64__) + void *ret; + __asm__( ".byte 0x65\n\tmovq 0x30,%0" : "=r" (ret) ); + return ret; #else return pthread_getspecific( teb_key ); #endif diff --git a/programs/clock/Si.rc b/programs/clock/Si.rc index 06da6055479..0df817285e0 100644 --- a/programs/clock/Si.rc +++ b/programs/clock/Si.rc @@ -40,7 +40,7 @@ MAIN_MENU MENU POPUP "Inf&ormacije" { MENUITEM "&Licenčna pogodba ...", IDM_LICENSE MENUITEM "&BREZ GARANCIJE ...", IDM_NOWARRANTY - MENUITEM "&O Uri...", IDM_ABOUT + MENUITEM "&O Uri ...", IDM_ABOUT } } diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 3748f219465..0044f70dcf0 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -89,7 +89,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN */ prev_context = context; - context = (BATCH_CONTEXT *)LocalAlloc (LMEM_FIXED, sizeof (BATCH_CONTEXT)); + context = LocalAlloc (LMEM_FIXED, sizeof (BATCH_CONTEXT)); context -> h = h; context -> command = command; memset(context -> shift_count, 0x00, sizeof(context -> shift_count)); @@ -122,7 +122,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN * to the caller's caller. */ - LocalFree ((HANDLE)context); + LocalFree (context); if ((prev_context != NULL) && (!called)) { prev_context -> skip_rest = TRUE; context = prev_context; diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c index 2082d6e7af3..c70fca5304b 100644 --- a/programs/cmd/directory.c +++ b/programs/cmd/directory.c @@ -938,7 +938,7 @@ void WCMD_getfileowner(WCHAR *filename, WCHAR *owner, int ownerlen) { ULONG domainLen = MAXSTRING; SID_NAME_USE nameuse; - secBuffer = (LPBYTE) HeapAlloc(GetProcessHeap(),0,sizeNeeded * sizeof(BYTE)); + secBuffer = HeapAlloc(GetProcessHeap(),0,sizeNeeded * sizeof(BYTE)); if(!secBuffer) return; /* Get the owners security descriptor */ diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 454bd3ccc9d..0771e2ef6d6 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1348,7 +1348,7 @@ void WCMD_print_error (void) { WCMD_output_asis_len(lpMsgBuf, lstrlen(lpMsgBuf), GetStdHandle(STD_ERROR_HANDLE)); - LocalFree ((HLOCAL)lpMsgBuf); + LocalFree (lpMsgBuf); WCMD_output_asis_len (newline, lstrlen(newline), GetStdHandle(STD_ERROR_HANDLE)); return; diff --git a/programs/cmdlgtst/Cs.rc b/programs/cmdlgtst/Cs.rc index 88f2bc85c0b..d6bb383ee0c 100644 --- a/programs/cmdlgtst/Cs.rc +++ b/programs/cmdlgtst/Cs.rc @@ -218,7 +218,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, version 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -234,7 +234,7 @@ FONT 8, "MS Shell Dlg" LTEXT "Dialog Barvy zmìní barvu pozadí.", -1, 12, 120, 168, 12 LTEXT "Dialog Font zmìní všechny fonty a barvu fontu, je-li nastaven pøíznak CF_EFFECTS.", -1, 12, 144, 168, 24 LTEXT "Levý horní roh ukazuje plnou cestu a jméno bezchybnì dokonèené akce otevøít/uložit.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/De.rc b/programs/cmdlgtst/De.rc index 814b4ae68af..323b6f8d8bd 100644 --- a/programs/cmdlgtst/De.rc +++ b/programs/cmdlgtst/De.rc @@ -242,7 +242,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, Version 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -258,7 +258,7 @@ FONT 8, "MS Shell Dlg" LTEXT "Farbdialog ändert die Hintergrundfarbe.", -1, 12, 120, 168, 12 LTEXT "Schriftdialog ändert alle Schriften und die Schriftfarbe, wenn CF_EFFECTS ausgewählt ist.", -1, 12, 144, 168, 24 LTEXT "Die linke, obere Ecke weist auf den vollständen Verzeichnisnamen und die Bezeichnung des letzten erfolgreichen Öffnens oder Sicherns hin.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/En.rc b/programs/cmdlgtst/En.rc index 707b1f51005..5d73c575b34 100644 --- a/programs/cmdlgtst/En.rc +++ b/programs/cmdlgtst/En.rc @@ -242,7 +242,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, version 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -258,7 +258,7 @@ FONT 8, "MS Shell Dlg" LTEXT "Color dialog changes background color.", -1, 12, 120, 168, 12 LTEXT "Font dialog changes all fonts, and font color if CF_EFFECTS is selected.", -1, 12, 144, 168, 24 LTEXT "Upper left hand corner indicate full pathname and title of the last successful Open or Save.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/Es.rc b/programs/cmdlgtst/Es.rc index aaf91effa91..04ef2bb9287 100644 --- a/programs/cmdlgtst/Es.rc +++ b/programs/cmdlgtst/Es.rc @@ -242,7 +242,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "Aceptar", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, versión 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -258,7 +258,7 @@ FONT 8, "MS Shell Dlg" LTEXT "El diálogo de color cambia el color de fondo.", -1, 12, 120, 168, 12 LTEXT "El diálogo de fuentes cambia todas las fuentes, y el color de la fuente si se selecciona CF_EFFECTS.", -1, 12, 144, 168, 24 LTEXT "La esquina superior izquierda indica la ruta completa y el título del último Abrir o Guardar satisfactorio.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/It.rc b/programs/cmdlgtst/It.rc index f7fee7e624c..069045e2e0d 100644 --- a/programs/cmdlgtst/It.rc +++ b/programs/cmdlgtst/It.rc @@ -220,7 +220,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, versione 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. I diritti sono concessi sotto la licenza di WINE. Non nascondere i sorgenti...condividili!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. I diritti sono concessi sotto la licenza di WINE. Non nascondere i sorgenti... condividili!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -236,7 +236,7 @@ FONT 8, "MS Shell Dlg" LTEXT "La finestra di dialogo dei colori modifica il colore dello sfondo.", -1, 12, 120, 168, 12 LTEXT "La finestra di dialogo dei Font modifica tutti i Font, e il loro colore se CF_EFFECTS e selezionato.", -1, 12, 144, 168, 24 LTEXT "L'angolo in alto a sinistra indica il percorso completo e il titolo dell'ultima operazione di apertura o salvataggio conclusa con successo.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. I diritti sono concessi sotto la licenza di WINE. Non nascondere i sorgenti...condividili!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. I diritti sono concessi sotto la licenza di WINE. Non nascondere i sorgenti... condividili!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/Ja.rc b/programs/cmdlgtst/Ja.rc index 6f97f1999ed..fb73bfa94c1 100644 --- a/programs/cmdlgtst/Ja.rc +++ b/programs/cmdlgtst/Ja.rc @@ -245,7 +245,7 @@ FONT 9, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, version 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -261,7 +261,7 @@ FONT 9, "MS Shell Dlg" LTEXT "色ダイアログは背景色を変えます。", -1, 12, 120, 168, 12 LTEXT "フォントダイアログはすべてのフォントと、CF_EFFECTS が選択されていればフォント色を変えます。", -1, 12, 144, 168, 24 LTEXT "左上の角には最後に成功した 開く や 保存 のフルパス名やタイトルを表示します。", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/Ko.rc b/programs/cmdlgtst/Ko.rc index a210956cd33..61a80e583c1 100644 --- a/programs/cmdlgtst/Ko.rc +++ b/programs/cmdlgtst/Ko.rc @@ -244,7 +244,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "È®ÀÎ", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, version 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -260,7 +260,7 @@ FONT 8, "MS Shell Dlg" LTEXT "Color dialog changes background color.", -1, 12, 120, 168, 12 LTEXT "Font dialog changes all fonts, and font color if CF_EFFECTS is selected.", -1, 12, 144, 168, 24 LTEXT "Upper left hand corner indicate full pathname and title of the last successful Open or Save.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/Nl.rc b/programs/cmdlgtst/Nl.rc index 2787320679f..0b9d1353dbf 100644 --- a/programs/cmdlgtst/Nl.rc +++ b/programs/cmdlgtst/Nl.rc @@ -241,7 +241,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, versie 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. De rechten voor dit programma zijn gelijk aan die verleend onder de WINE licentie. Hamster geen code...deel het!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. De rechten voor dit programma zijn gelijk aan die verleend onder de WINE licentie. Hamster geen code... deel het!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -257,7 +257,7 @@ FONT 8, "MS Shell Dlg" LTEXT "De kleurkeuze-dialoog verandert de achtergrondkleur.", -1, 12, 120, 168, 12 LTEXT "De lettertype-dialoog verandert alle lettertypen, en de kleur van het lettertype als CF_EFFECTS is gezet.", -1, 12, 144, 168, 24 LTEXT "De linker bovenhoek geeft de lange en de korte bestandsnaam weer van het laatste successvol geopende of opgeslagen bestand.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. De rechten voor dit programma zijn gelijk aan die verleend onder de WINE licentie. Hamster geen code...deel het!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. De rechten voor dit programma zijn gelijk aan die verleend onder de WINE licentie. Hamster geen code... deel het!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/Pt.rc b/programs/cmdlgtst/Pt.rc index 836f210b521..38e783ef0b9 100644 --- a/programs/cmdlgtst/Pt.rc +++ b/programs/cmdlgtst/Pt.rc @@ -430,7 +430,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, versão 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Direitos garantidos pelo licença do WINE. Don't hoard code...share it", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Direitos garantidos pelo licença do WINE. Don't hoard code... share it", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -443,7 +443,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "OK", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, versão 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Direitos garantidos pela licença WINE. Não guarde o código...partilhe-o", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Direitos garantidos pela licença WINE. Não guarde o código... partilhe-o", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -462,7 +462,7 @@ FONT 8, "MS Shell Dlg" LTEXT "Diálogo de cores muda a cor de fundo.", -1, 12, 120, 168, 12 LTEXT "Diálogo de fontes muda todas as fontes, cores das fontes se CF_EFFECTS está selecionado.", -1, 12, 144, 168, 24 LTEXT "O canto superior esquerdo indica o caminho completo e o título dos último sucesso de Abrir ou Salvar.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Direitos garantidos pelo licença do WINE. Don't hoard code...share it", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Direitos garantidos pelo licença do WINE. Don't hoard code... share it", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } @@ -481,7 +481,7 @@ FONT 8, "MS Shell Dlg" LTEXT "O diálogo de cores muda a cor de fundo.", -1, 12, 120, 168, 12 LTEXT "O diálogo de tipos de letra muda todas as letras, cores das letras se CF_EFFECTS estiver seleccionado.", -1, 12, 144, 168, 24 LTEXT "O canto superior esquerdo indica a localização completo e o título dos últimos sucessos de Abrir ou Gravar", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Direitos garantidos pela licença WINE. Não guarde o código...partilhe-o", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Direitos garantidos pela licença WINE. Não guarde o código... partilhe-o", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/Si.rc b/programs/cmdlgtst/Si.rc index 95c5145745a..11ae7530794 100644 --- a/programs/cmdlgtst/Si.rc +++ b/programs/cmdlgtst/Si.rc @@ -244,7 +244,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "V redu", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, različica 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -260,7 +260,7 @@ FONT 8, "MS Shell Dlg" LTEXT "Dialog Barva spremeni barvo ozadja.", -1, 12, 120, 168, 12 LTEXT "Dialog Pisava spremeni vse pisave in njihovo barvo, če je omogočena zastavica CF_EFFECTS.", -1, 12, 144, 168, 24 LTEXT "V zgornjem levem kotu se izpiše polna pot do zadnje uspešno odprte oz. shranjene datoteke.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/cmdlgtst/Tr.rc b/programs/cmdlgtst/Tr.rc index e6fd0374cc7..94b6d50fe9e 100644 --- a/programs/cmdlgtst/Tr.rc +++ b/programs/cmdlgtst/Tr.rc @@ -216,7 +216,7 @@ FONT 8, "MS Shell Dlg" { DEFPUSHBUTTON "Tamam", IDOK, 72, 96, 50, 14 LTEXT "Common Dialog Test Jig Exerciser, version 1.20", -1, 13, 36, 168, 12 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 18, 60, 157, 24 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 18, 60, 157, 24 ICON "AboutIcon", -1, 84, 12, 18, 20 } @@ -232,7 +232,7 @@ FONT 8, "MS Shell Dlg" LTEXT "Color dialog changes background color.", -1, 12, 120, 168, 12 LTEXT "Font dialog changes all fonts, and font color if CF_EFFECTS is selected.", -1, 12, 144, 168, 24 LTEXT "Upper left hand corner indicate full pathname and title of the last successful Open or Save.", -1, 12, 180, 168, 24 - LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code...share it!", -1, 12, 228, 168, 36 + LTEXT "(c) 1999-2000, Eric Williams. Rights are as granted under the WINE license. Don't hoard code... share it!", -1, 12, 228, 168, 36 ICON "AboutIcon", -1, 86, 12, 18, 20 CONTROL "", -1, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 12, 216, 168, 2 } diff --git a/programs/regedit/Si.rc b/programs/regedit/Si.rc index 52d2e698829..61035e6e1ed 100644 --- a/programs/regedit/Si.rc +++ b/programs/regedit/Si.rc @@ -72,8 +72,8 @@ BEGIN END POPUP "Pri&ljubljene" BEGIN - MENUITEM "&Dodaj med Priljubljene...", ID_FAVORITES_ADDTOFAVORITES - MENUITEM "&Odstrani iz Priljubljenih...", ID_FAVORITES_REMOVEFAVORITE + MENUITEM "&Dodaj med Priljubljene ...", ID_FAVORITES_ADDTOFAVORITES + MENUITEM "&Odstrani iz Priljubljenih ...", ID_FAVORITES_REMOVEFAVORITE END POPUP "&Pomoč" BEGIN diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c index a8017033bb9..5b19899b504 100644 --- a/programs/regedit/framewnd.c +++ b/programs/regedit/framewnd.c @@ -89,7 +89,7 @@ static void OnEnterMenuLoop(HWND hWnd) nParts = -1; SendMessageW(hStatusBar, SB_SETPARTS, 1, (long)&nParts); bInMenuLoop = TRUE; - SendMessageW(hStatusBar, SB_SETTEXTW, (WPARAM)0, (LPARAM)&empty); + SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)&empty); } static void OnExitMenuLoop(HWND hWnd) diff --git a/programs/regedit/main.c b/programs/regedit/main.c index 6fe129ac6f1..27bc26f5a89 100644 --- a/programs/regedit/main.c +++ b/programs/regedit/main.c @@ -92,7 +92,7 @@ static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) 0/*hbrBackground*/, 0/*lpszMenuName*/, szFrameClass, - (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON, + LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED) }; ATOM hFrameWndClass = RegisterClassEx(&wcFrame); /* register frame window class */ @@ -109,7 +109,7 @@ static BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) 0/*hbrBackground*/, 0/*lpszMenuName*/, szChildClass, - (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON, + LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED) }; diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index ab422bb104e..a4e893691b3 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -860,7 +860,7 @@ static void REGPROC_print_error(void) exit(1); } puts(lpMsgBuf); - LocalFree((HLOCAL)lpMsgBuf); + LocalFree(lpMsgBuf); exit(1); } @@ -888,6 +888,26 @@ static void REGPROC_resize_char_buffer(WCHAR **buffer, DWORD *len, DWORD require } /****************************************************************************** + * Same as REGPROC_resize_char_buffer() but on a regular buffer. + * + * Parameters: + * buffer - pointer to a buffer + * len - current size of the buffer in bytes + * required_size - size of the data to place in the buffer in bytes + */ +static void REGPROC_resize_binary_buffer(BYTE **buffer, DWORD *size, DWORD required_size) +{ + if (required_size > *size) { + *size = required_size; + if (!*buffer) + *buffer = HeapAlloc(GetProcessHeap(), 0, *size); + else + *buffer = HeapReAlloc(GetProcessHeap(), 0, *buffer, *size); + CHECK_ENOUGH_MEMORY(*buffer); + } +} + +/****************************************************************************** * Prints string str to file */ static void REGPROC_export_string(WCHAR **line_buf, DWORD *line_buf_size, DWORD *line_len, WCHAR *str, DWORD str_len) @@ -1056,13 +1076,7 @@ static void export_hkey(FILE *file, HKEY key, max_sub_key_len + curr_len + 1); REGPROC_resize_char_buffer(val_name_buf, val_name_size, max_val_name_len); - if (max_val_size > *val_size) { - *val_size = max_val_size; - if (!*val_buf) *val_buf = HeapAlloc(GetProcessHeap(), 0, *val_size); - else *val_buf = HeapReAlloc(GetProcessHeap(), 0, *val_buf, *val_size); - CHECK_ENOUGH_MEMORY(val_buf); - } - + REGPROC_resize_binary_buffer(val_buf, val_size, max_val_size); REGPROC_resize_char_buffer(line_buf, line_buf_size, lstrlenW(*reg_key_name_buf) + 4); /* output data for the current key */ sprintfW(*line_buf, key_format, *reg_key_name_buf); @@ -1077,7 +1091,11 @@ static void export_hkey(FILE *file, HKEY key, DWORD val_size1 = *val_size; ret = RegEnumValueW(key, i, *val_name_buf, &val_name_size1, NULL, &value_type, *val_buf, &val_size1); - if (ret != ERROR_SUCCESS) { + if (ret == ERROR_MORE_DATA) { + /* Increase the size of the buffers and retry */ + REGPROC_resize_char_buffer(val_name_buf, val_name_size, val_name_size1); + REGPROC_resize_binary_buffer(val_buf, val_size, val_size1); + } else if (ret != ERROR_SUCCESS) { more_data = FALSE; if (ret != ERROR_NO_MORE_ITEMS) { REGPROC_print_error(); @@ -1168,7 +1186,10 @@ static void export_hkey(FILE *file, HKEY key, ret = RegEnumKeyExW(key, i, *reg_key_name_buf + curr_len + 1, &buf_size, NULL, NULL, NULL, NULL); - if (ret != ERROR_SUCCESS && ret != ERROR_MORE_DATA) { + if (ret == ERROR_MORE_DATA) { + /* Increase the size of the buffer and retry */ + REGPROC_resize_char_buffer(reg_key_name_buf, reg_key_name_size, curr_len + 1 + buf_size); + } else if (ret != ERROR_SUCCESS) { more_data = FALSE; if (ret != ERROR_NO_MORE_ITEMS) { REGPROC_print_error(); diff --git a/programs/regedit/treeview.c b/programs/regedit/treeview.c index f51ccfd25c1..20d1b76b899 100644 --- a/programs/regedit/treeview.c +++ b/programs/regedit/treeview.c @@ -194,7 +194,7 @@ static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPWSTR label, HK tvins.u.item.iSelectedImage = Image_Open; tvins.u.item.cChildren = dwChildren; tvins.u.item.lParam = (LPARAM)hKey; - tvins.hInsertAfter = (HTREEITEM)(hKey ? TVI_LAST : TVI_SORT); + tvins.hInsertAfter = hKey ? TVI_LAST : TVI_SORT; tvins.hParent = hParent; return TreeView_InsertItemW(hwndTV, &tvins); @@ -533,7 +533,7 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPWSTR pHostName) tvins.u.item.cChildren = 5; /* Save the heading level in the item's application-defined data area. */ tvins.u.item.lParam = 0; - tvins.hInsertAfter = (HTREEITEM)TVI_FIRST; + tvins.hInsertAfter = TVI_FIRST; tvins.hParent = TVI_ROOT; /* Add the item to the tree view control. */ if (!(hRoot = TreeView_InsertItemW(hwndTV, &tvins))) return FALSE; diff --git a/programs/rpcss/Makefile.in b/programs/rpcss/Makefile.in index 48c63b76b6a..a2929c4c50e 100644 --- a/programs/rpcss/Makefile.in +++ b/programs/rpcss/Makefile.in @@ -1,4 +1,4 @@ -EXTRADEFS = -DWINE_NO_UNICODE_MACROS +EXTRADEFS = -D__WINESRC__ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ diff --git a/programs/rpcss/rpcss_main.c b/programs/rpcss/rpcss_main.c index ad5dd58cc34..5a22b1ccf5e 100644 --- a/programs/rpcss/rpcss_main.c +++ b/programs/rpcss/rpcss_main.c @@ -44,12 +44,14 @@ */ #include +#include #include #include #define NONAMELESSUNION #define NONAMELESSSTRUCT -#include "rpcss.h" +#include "windef.h" +#include "winbase.h" #include "winnt.h" #include "irot.h" #include "epm.h" diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c index 0715a989f1e..69355b0a019 100644 --- a/programs/winecfg/audio.c +++ b/programs/winecfg/audio.c @@ -536,8 +536,10 @@ static void findAudioDrivers(void) if (numFound) { loadedAudioDrv = HeapReAlloc(GetProcessHeap(), 0, loadedAudioDrv, (numFound + 1) * sizeof(AUDIO_DRIVER)); CopyMemory(&loadedAudioDrv[numFound], pAudioDrv, sizeof(AUDIO_DRIVER)); - } else - loadedAudioDrv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AUDIO_DRIVER)); + } else { + loadedAudioDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(AUDIO_DRIVER)); + CopyMemory(&loadedAudioDrv[0], pAudioDrv, sizeof(AUDIO_DRIVER)); + } } /* check local copy of registry string for unloadable drivers */ diff --git a/programs/winecfg/libraries.c b/programs/winecfg/libraries.c index 42b6e41bf0f..2ef9a536840 100644 --- a/programs/winecfg/libraries.c +++ b/programs/winecfg/libraries.c @@ -496,7 +496,7 @@ static void on_add_click(HWND dialog) load_library_settings(dialog); - SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_SELECTSTRING, (WPARAM) 0, (LPARAM) buffer); + SendDlgItemMessage(dialog, IDC_DLLS_LIST, LB_SELECTSTRING, 0, (LPARAM) buffer); set_controls_from_selection(dialog); } diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c index 9b7e8579c4e..d87aba071be 100644 --- a/programs/winecfg/theme.c +++ b/programs/winecfg/theme.c @@ -302,7 +302,7 @@ static BOOL fill_theme_list (HWND comboTheme, HWND comboColor, HWND comboSize) for (i = 0; i < themeFilesCount; i++) { - ThemeFile* item = (ThemeFile*)DSA_GetItemPtr (themeFiles, i); + ThemeFile* item = DSA_GetItemPtr (themeFiles, i); SendMessageW (comboTheme, CB_ADDSTRING, 0, (LPARAM)item->fancyName); } @@ -316,7 +316,7 @@ static BOOL fill_theme_list (HWND comboTheme, HWND comboColor, HWND comboSize) BOOL found = FALSE; for (i = 0; i < themeFilesCount; i++) { - theme = (ThemeFile*)DSA_GetItemPtr (themeFiles, i); + theme = DSA_GetItemPtr (themeFiles, i); if (lstrcmpiW (theme->themeFileName, currentTheme) == 0) { found = TRUE; @@ -332,8 +332,7 @@ static BOOL fill_theme_list (HWND comboTheme, HWND comboColor, HWND comboSize) myEnumThemeProc (NULL, currentTheme, currentTheme, currentTheme, NULL, NULL); themeIndex = themeFilesCount; - theme = (ThemeFile*)DSA_GetItemPtr (themeFiles, - themeFilesCount-1); + theme = DSA_GetItemPtr (themeFiles, themeFilesCount-1); } fill_color_size_combos (theme, comboColor, comboSize); select_color_and_size (theme, currentColor, comboColor, @@ -364,8 +363,7 @@ static BOOL update_color_and_size (int themeIndex, HWND comboColor, WCHAR currentTheme[MAX_PATH]; WCHAR currentColor[MAX_PATH]; WCHAR currentSize[MAX_PATH]; - ThemeFile* theme = - (ThemeFile*)DSA_GetItemPtr (themeFiles, themeIndex - 1); + ThemeFile* theme = DSA_GetItemPtr (themeFiles, themeIndex - 1); fill_color_size_combos (theme, comboColor, comboSize); @@ -399,8 +397,7 @@ static void do_apply_theme (int themeIndex, int colorIndex, int sizeIndex) } else { - ThemeFile* theme = - (ThemeFile*)DSA_GetItemPtr (themeFiles, themeIndex-1); + ThemeFile* theme = DSA_GetItemPtr (themeFiles, themeIndex-1); const WCHAR* themeFileName = theme->themeFileName; const WCHAR* colorName = NULL; const WCHAR* sizeName = NULL; diff --git a/programs/winedbg/db_disasm.c b/programs/winedbg/db_disasm.c index 1677bc9a9db..dc1cc3d78c6 100644 --- a/programs/winedbg/db_disasm.c +++ b/programs/winedbg/db_disasm.c @@ -1261,7 +1261,7 @@ static void db_disasm_esc( ADDRESS64* addr, int inst, int short_addr, * Normal address modes. */ db_read_address( addr, short_addr, regmodrm, &address); - dbg_printf(fp->f_name); + dbg_printf("%s", fp->f_name); switch(fp->f_size) { case SNGL: p = "s"; break; case DBLR: p = "l"; break; @@ -1463,15 +1463,15 @@ void be_i386_disasm_one_insn(ADDRESS64 *addr, int display) if( db_display ) { if (size == WORD) - dbg_printf(i_name); + dbg_printf("%s", i_name); else - dbg_printf(ip->i_extra); + dbg_printf("%s", ip->i_extra); } } else { if( db_display ) { - dbg_printf(i_name); + dbg_printf("%s", i_name); } if (i_size != NONE) { if (i_size == BYTE) { diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c index c6174fe9e35..c103c18837b 100644 --- a/programs/winedbg/memory.c +++ b/programs/winedbg/memory.c @@ -677,7 +677,7 @@ BOOL memory_get_register(DWORD regno, DWORD** value, char* buffer, int len) else *value = div->pval; - if (buffer) snprintf(buffer, len, div->name); + if (buffer) lstrcpynA(buffer, div->name, len); return TRUE; } } diff --git a/programs/winedbg/symbol.c b/programs/winedbg/symbol.c index 90c5510e226..c4b09a3315c 100644 --- a/programs/winedbg/symbol.c +++ b/programs/winedbg/symbol.c @@ -650,7 +650,7 @@ void symbol_print_local(const SYMBOL_INFO* sym, ULONG base, } else { - dbg_printf(buffer); + dbg_printf("%s", buffer); if (detailed) dbg_printf(" (%s)", (sym->Flags & SYMFLAG_PARAMETER) ? "parameter" : "local"); diff --git a/programs/winedbg/types.c b/programs/winedbg/types.c index fd13dac85e6..19fe68e397a 100644 --- a/programs/winedbg/types.c +++ b/programs/winedbg/types.c @@ -716,7 +716,7 @@ int types_print_type(const struct dbg_type* type, BOOL details) dbg_printf(")"); break; case SymTagTypedef: - dbg_printf(name); + dbg_printf("%s", name); break; default: WINE_ERR("Unknown type %u for %s\n", tag, name); diff --git a/programs/winefile/Si.rc b/programs/winefile/Si.rc index 1853832d1f7..5739b1172bd 100644 --- a/programs/winefile/Si.rc +++ b/programs/winefile/Si.rc @@ -43,7 +43,7 @@ IDM_WINEFILE MENU FIXED IMPURE MENUITEM "&Tiskaj ...", 102 MENUITEM "Poveži s programom ...", 103 MENUITEM SEPARATOR - MENUITEM "Ustvari &mapo...", 111 + MENUITEM "Ustvari &mapo ...", 111 MENUITEM "&Išči ...", 104 MENUITEM "Iz&beri datoteke ...", 116 MENUITEM SEPARATOR diff --git a/server/console.c b/server/console.c index b931e056e93..a79dc670f87 100644 --- a/server/console.c +++ b/server/console.c @@ -1380,7 +1380,7 @@ DECL_HANDLER(open_console) struct object *obj = NULL; reply->handle = 0; - if (req->from == (obj_handle_t)0) + if (!req->from) { if (current->process->console && current->process->console->renderer) obj = grab_object( (struct object*)current->process->console ); diff --git a/server/fd.c b/server/fd.c index 0d33e77991a..f7716d107b9 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1582,7 +1582,7 @@ struct fd *open_fd( const char *name, int flags, mode_t *mode, unsigned int acce /* if we tried to open a directory for write access, retry read-only */ if (errno != EISDIR || !(access & FILE_UNIX_WRITE_ACCESS) || - (fd->unix_fd = open( name, O_RDONLY | (flags & ~O_TRUNC), *mode )) == -1) + (fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode )) == -1) { file_set_error(); goto error; diff --git a/server/handle.c b/server/handle.c index 29214d6d013..37cfa9b28ef 100644 --- a/server/handle.c +++ b/server/handle.c @@ -64,6 +64,7 @@ static struct handle_table *global_table; #define RESERVED_ALL (RESERVED_INHERIT | RESERVED_CLOSE_PROTECT) #define MIN_HANDLE_ENTRIES 32 +#define MAX_HANDLE_ENTRIES 0x00ffffff /* handle to table index conversion */ @@ -191,13 +192,12 @@ struct handle_table *alloc_handle_table( struct process *process, int count ) static int grow_handle_table( struct handle_table *table ) { struct handle_entry *new_entries; - int count = table->count; + int count = min( table->count * 2, MAX_HANDLE_ENTRIES ); - if (count >= INT_MAX / 2) return 0; - count *= 2; - if (!(new_entries = realloc( table->entries, count * sizeof(struct handle_entry) ))) + if (count == table->count || + !(new_entries = realloc( table->entries, count * sizeof(struct handle_entry) ))) { - set_error( STATUS_NO_MEMORY ); + set_error( STATUS_INSUFFICIENT_RESOURCES ); return 0; } table->entries = new_entries; diff --git a/server/trace.c b/server/trace.c index 8b6e622f033..edb5440cedd 100644 --- a/server/trace.c +++ b/server/trace.c @@ -67,7 +67,7 @@ static void dump_uints( const int *ptr, int len ) static void dump_timeout( const timeout_t *time ) { - fprintf( stderr, get_timeout_str(*time) ); + fputs( get_timeout_str(*time), stderr ); } static void dump_file_pos( const file_pos_t *pos ) @@ -4582,6 +4582,7 @@ static const struct { "HANDLE_NOT_CLOSABLE", STATUS_HANDLE_NOT_CLOSABLE }, { "ILLEGAL_FUNCTION", STATUS_ILLEGAL_FUNCTION }, { "INSTANCE_NOT_AVAILABLE", STATUS_INSTANCE_NOT_AVAILABLE }, + { "INSUFFICIENT_RESOURCES", STATUS_INSUFFICIENT_RESOURCES }, { "INVALID_CID", STATUS_INVALID_CID }, { "INVALID_DEVICE_REQUEST", STATUS_INVALID_DEVICE_REQUEST }, { "INVALID_FILE_FOR_SECTION", STATUS_INVALID_FILE_FOR_SECTION }, diff --git a/tools/fnt2bdf.c b/tools/fnt2bdf.c index 1a14d6cdf76..f204720590a 100644 --- a/tools/fnt2bdf.c +++ b/tools/fnt2bdf.c @@ -47,21 +47,13 @@ /* global options */ -int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer); -int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer); - -char* g_lpstrFileName = NULL; -char* g_lpstrCharSet = NULL; -char* g_lpstrInputFile = NULL; -int g_outputPoints = 0; - -static const char* errorDLLRead = "Unable to read Windows DLL.\n"; -static const char* errorFNTRead = "Unable to read .FNT file.\n"; -static const char* errorOpenFile = "Unable to open file.\n"; -static const char* errorMemory = "Memory allocation error.\n"; -static const char* errorFile = "Corrupt or invalid file.\n"; -static const char* errorFontData = "Unable to parse font data: Error "; -static const char* errorEmpty = "No fonts found.\n"; +static int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer); +static int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer); + +static char* g_lpstrFileName = NULL; +static char* g_lpstrCharSet = NULL; +static char* g_lpstrInputFile = NULL; +static int g_outputPoints = 0; /* info */ @@ -202,7 +194,7 @@ static int parse_fnt_data(unsigned char* file_buffer, int length) return t; } -int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer) +static int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer) { FILE* fp; int ic; @@ -311,7 +303,7 @@ return 0; } -int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer) +static int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer) { int l_fchar = return_data_value(dfChar, &cpe_font_struct->hdr.fi.dfFirstChar), l_lchar = return_data_value(dfChar, &cpe_font_struct->hdr.fi.dfLastChar); @@ -595,20 +587,20 @@ int main(int argc, char **argv) if( !(lpfont = (unsigned char*) realloc( lpfont, length )) ) { - fprintf(stderr, errorMemory ); + fprintf(stderr, "Memory allocation error.\n" ); exit(1); } lseek( fd, offset, SEEK_SET ); if( read(fd, lpfont, length) != length ) { - fprintf(stderr, errorDLLRead ); + fprintf(stderr, "Unable to read Windows DLL.\n" ); exit(1); } if( (i = parse_fnt_data( lpfont, length )) ) { - fprintf(stderr, "%s%d\n", errorFontData, i ); + fprintf(stderr, "Unable to parse font data: Error %d\n", i ); exit(1); } } @@ -617,14 +609,14 @@ int main(int argc, char **argv) } else { - fprintf(stderr, errorEmpty ); + fprintf(stderr, "No fonts found.\n" ); exit(1); } free( lpdata ); } else { - fprintf(stderr, errorDLLRead); + fprintf(stderr, "Unable to read Windows DLL.\n" ); exit(1); } break; @@ -634,20 +626,20 @@ int main(int argc, char **argv) { if( (i = parse_fnt_data( lpdata, file_stat.st_size )) ) { - fprintf(stderr, "%s%d\n", errorFontData, i ); + fprintf(stderr, "Unable to parse font data: Error %d\n", i ); exit(1); } free( lpdata ); } else { - fprintf(stderr, errorFNTRead); + fprintf(stderr, "Unable to read .FNT file.\n" ); exit(1); } break; case FILE_ERROR: - fprintf(stderr, errorFile ); + fprintf(stderr, "Corrupt or invalid file.\n" ); exit(1); } close(fd); @@ -655,7 +647,7 @@ int main(int argc, char **argv) } else { - fprintf(stderr, errorOpenFile ); + fprintf(stderr, "Unable to open '%s'.\n", g_lpstrInputFile ); exit(1); } } diff --git a/tools/widl/client.c b/tools/widl/client.c index 40788954426..5221e26a621 100644 --- a/tools/widl/client.c +++ b/tools/widl/client.c @@ -415,10 +415,10 @@ static void write_clientinterfacedecl(type_t *iface) indent--; print_client("};\n"); if (old_names) - print_client("RPC_IF_HANDLE %s_ClientIfHandle = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", + print_client("RPC_IF_HANDLE %s_ClientIfHandle DECLSPEC_HIDDEN = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", iface->name, iface->name); else - print_client("RPC_IF_HANDLE %s%s_v%d_%d_c_ifspec = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", + print_client("RPC_IF_HANDLE %s%s_v%d_%d_c_ifspec DECLSPEC_HIDDEN = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", prefix_client, iface->name, MAJORVERSION(ver), MINORVERSION(ver), iface->name); fprintf(client, "\n"); } @@ -450,6 +450,10 @@ static void init_client(void) fprintf(client, "\n"); print_client("#include \"%s\"\n", header_name); print_client( "\n"); + print_client( "#ifndef DECLSPEC_HIDDEN\n"); + print_client( "#define DECLSPEC_HIDDEN\n"); + print_client( "#endif\n"); + print_client( "\n"); write_exceptions( client ); print_client( "\n"); } diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 74bec7b357f..a994fd7b06c 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -109,6 +109,10 @@ static void init_proxy(const statement_list_t *stmts) print_proxy( "\n"); print_proxy( "#include \"%s\"\n", header_name); print_proxy( "\n"); + print_proxy( "#ifndef DECLSPEC_HIDDEN\n"); + print_proxy( "#define DECLSPEC_HIDDEN\n"); + print_proxy( "#endif\n"); + print_proxy( "\n"); write_exceptions( proxy ); print_proxy( "\n"); print_proxy( "struct __proxy_frame\n"); @@ -504,6 +508,18 @@ static void gen_stub(type_t *iface, const func_t *cur, const char *cas, print_proxy("\n"); } +static int count_methods(type_t *iface) +{ + const func_t *cur; + int count = 0; + + if (iface->ref) count = count_methods(iface->ref); + if (iface->funcs) + LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) + if (!is_callas(cur->def->attrs)) count++; + return count; +} + static int write_proxy_methods(type_t *iface, int skip) { const func_t *cur; @@ -544,17 +560,15 @@ static int write_stub_methods(type_t *iface, int skip) static void write_proxy(type_t *iface, unsigned int *proc_offset) { - int midx = -1, stubs; + int midx = -1, count; const func_t *cur; - if (!iface->funcs) return; - /* FIXME: check for [oleautomation], shouldn't generate proxies/stubs if specified */ fprintf(proxy, "/*****************************************************************************\n"); fprintf(proxy, " * %s interface\n", iface->name); fprintf(proxy, " */\n"); - LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) + if (iface->funcs) LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) { const var_t *def = cur->def; if (!is_local(def->attrs)) { @@ -579,8 +593,11 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) } } + count = count_methods(iface); + if (midx != -1 && midx != count) error("invalid count %u/%u\n", count, midx); + /* proxy vtable */ - print_proxy( "static const CINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n", midx, iface->name); + print_proxy( "static const CINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n", count, iface->name); print_proxy( "{\n"); indent++; print_proxy( "{\n", iface->name); @@ -602,19 +619,20 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) print_proxy( "static const PRPC_STUB_FUNCTION %s_table[] =\n", iface->name); print_proxy( "{\n"); indent++; - stubs = write_stub_methods(iface, FALSE); + write_stub_methods(iface, FALSE); fprintf(proxy, "\n"); indent--; fprintf(proxy, "};\n"); print_proxy( "\n"); - print_proxy( "static const CInterfaceStubVtbl _%sStubVtbl =\n", iface->name); + print_proxy( "static %sCInterfaceStubVtbl _%sStubVtbl =\n", + need_delegation(iface) ? "" : "const ", iface->name); print_proxy( "{\n"); indent++; print_proxy( "{\n"); indent++; print_proxy( "&IID_%s,\n", iface->name); print_proxy( "0,\n"); - print_proxy( "%d,\n", stubs+3); + print_proxy( "%d,\n", count); print_proxy( "&%s_table[-3],\n", iface->name); indent--; print_proxy( "},\n", iface->name); @@ -685,23 +703,16 @@ static void write_proxy_stmts(const statement_list_t *stmts, unsigned int *proc_ } } -static void write_proxy_iface_name_format(const statement_list_t *stmts, const char *format) +static int cmp_iid( const void *ptr1, const void *ptr2 ) { - const statement_t *stmt; - if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) - { - if (stmt->type == STMT_LIBRARY) - write_proxy_iface_name_format(stmt->u.lib->stmts, format); - else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) - { - type_t *iface = stmt->u.type; - if (iface->ref && iface->funcs && need_proxy(iface)) - fprintf(proxy, format, iface->name); - } - } + const type_t * const *iface1 = ptr1; + const type_t * const *iface2 = ptr2; + const UUID *uuid1 = get_attrp( (*iface1)->attrs, ATTR_UUID ); + const UUID *uuid2 = get_attrp( (*iface2)->attrs, ATTR_UUID ); + return memcmp( uuid1, uuid2, sizeof(UUID) ); } -static void write_proxy_iface_base_iids(const statement_list_t *stmts) +static void build_iface_list( const statement_list_t *stmts, type_t **ifaces[], int *count ) { const statement_t *stmt; @@ -709,50 +720,36 @@ static void write_proxy_iface_base_iids(const statement_list_t *stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) { if (stmt->type == STMT_LIBRARY) - write_proxy_iface_base_iids(stmt->u.lib->stmts); + build_iface_list(stmt->u.lib->stmts, ifaces, count); else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) { type_t *iface = stmt->u.type; - if (iface->ref && iface->funcs && need_proxy(iface)) + if (iface->ref && need_proxy(iface)) { - if (need_delegation(iface)) - fprintf( proxy, " &IID_%s, /* %s */\n", iface->ref->name, iface->name ); - else - fprintf( proxy, " 0,\n" ); + *ifaces = xrealloc( *ifaces, (*count + 1) * sizeof(*ifaces) ); + (*ifaces)[(*count)++] = iface; } } } } -static void write_iid_lookup(const statement_list_t *stmts, const char *file_id, int *c) +static type_t **sort_interfaces( const statement_list_t *stmts, int *count ) { - const statement_t *stmt; - if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry ) - { - if (stmt->type == STMT_LIBRARY) - write_iid_lookup(stmt->u.lib->stmts, file_id, c); - else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP) - { - type_t *iface = stmt->u.type; - if(iface->ref && iface->funcs && need_proxy(iface)) - { - fprintf(proxy, " if (!_%s_CHECK_IID(%d))\n", file_id, *c); - fprintf(proxy, " {\n"); - fprintf(proxy, " *pIndex = %d;\n", *c); - fprintf(proxy, " return 1;\n"); - fprintf(proxy, " }\n"); - (*c)++; - } - } - } + type_t **ifaces = NULL; + + *count = 0; + build_iface_list( stmts, &ifaces, count ); + qsort( ifaces, *count, sizeof(*ifaces), cmp_iid ); + return ifaces; } void write_proxies(const statement_list_t *stmts) { int expr_eval_routines; char *file_id = proxy_token; - int c, have_baseiid; + int i, count, have_baseiid; unsigned int proc_offset = 0; + type_t **interfaces; if (!do_proxies) return; if (do_everything && !need_proxy_file(stmts)) return; @@ -775,23 +772,27 @@ void write_proxies(const statement_list_t *stmts) write_procformatstring(proxy, stmts, need_proxy); write_typeformatstring(proxy, stmts, need_proxy); + interfaces = sort_interfaces(stmts, &count); fprintf(proxy, "static const CInterfaceProxyVtbl* const _%s_ProxyVtblList[] =\n", file_id); fprintf(proxy, "{\n"); - write_proxy_iface_name_format(stmts, " (const CInterfaceProxyVtbl*)&_%sProxyVtbl,\n"); + for (i = 0; i < count; i++) + fprintf(proxy, " (const CInterfaceProxyVtbl*)&_%sProxyVtbl,\n", interfaces[i]->name); fprintf(proxy, " 0\n"); fprintf(proxy, "};\n"); fprintf(proxy, "\n"); fprintf(proxy, "static const CInterfaceStubVtbl* const _%s_StubVtblList[] =\n", file_id); fprintf(proxy, "{\n"); - write_proxy_iface_name_format(stmts, " (const CInterfaceStubVtbl*)&_%sStubVtbl,\n"); + for (i = 0; i < count; i++) + fprintf(proxy, " &_%sStubVtbl,\n", interfaces[i]->name); fprintf(proxy, " 0\n"); fprintf(proxy, "};\n"); fprintf(proxy, "\n"); fprintf(proxy, "static PCInterfaceName const _%s_InterfaceNamesList[] =\n", file_id); fprintf(proxy, "{\n"); - write_proxy_iface_name_format(stmts, " \"%s\",\n"); + for (i = 0; i < count; i++) + fprintf(proxy, " \"%s\",\n", interfaces[i]->name); fprintf(proxy, " 0\n"); fprintf(proxy, "};\n"); fprintf(proxy, "\n"); @@ -800,23 +801,35 @@ void write_proxies(const statement_list_t *stmts) { fprintf(proxy, "static const IID * _%s_BaseIIDList[] =\n", file_id); fprintf(proxy, "{\n"); - write_proxy_iface_base_iids(stmts); + for (i = 0; i < count; i++) + { + if (need_delegation(interfaces[i])) + fprintf( proxy, " &IID_%s, /* %s */\n", interfaces[i]->ref->name, interfaces[i]->name ); + else + fprintf( proxy, " 0,\n" ); + } fprintf(proxy, " 0\n"); fprintf(proxy, "};\n"); fprintf(proxy, "\n"); } - fprintf(proxy, "#define _%s_CHECK_IID(n) IID_GENERIC_CHECK_IID(_%s, pIID, n)\n", file_id, file_id); - fprintf(proxy, "\n"); - fprintf(proxy, "int __stdcall _%s_IID_Lookup(const IID* pIID, int* pIndex)\n", file_id); + fprintf(proxy, "static int __stdcall _%s_IID_Lookup(const IID* pIID, int* pIndex)\n", file_id); fprintf(proxy, "{\n"); - c = 0; - write_iid_lookup(stmts, file_id, &c); + fprintf(proxy, " int low = 0, high = %d;\n", count - 1); + fprintf(proxy, "\n"); + fprintf(proxy, " while (low <= high)\n"); + fprintf(proxy, " {\n"); + fprintf(proxy, " int pos = (low + high) / 2;\n"); + fprintf(proxy, " int res = IID_GENERIC_CHECK_IID(_%s, pIID, pos);\n", file_id); + fprintf(proxy, " if (!res) { *pIndex = pos; return 1; }\n"); + fprintf(proxy, " if (res > 0) low = pos + 1;\n"); + fprintf(proxy, " else high = pos - 1;\n"); + fprintf(proxy, " }\n"); fprintf(proxy, " return 0;\n"); fprintf(proxy, "}\n"); fprintf(proxy, "\n"); - fprintf(proxy, "const ExtendedProxyFileInfo %s_ProxyFileInfo =\n", file_id); + fprintf(proxy, "const ExtendedProxyFileInfo %s_ProxyFileInfo DECLSPEC_HIDDEN =\n", file_id); fprintf(proxy, "{\n"); fprintf(proxy, " (const PCInterfaceProxyVtblList*)&_%s_ProxyVtblList,\n", file_id); fprintf(proxy, " (const PCInterfaceStubVtblList*)&_%s_StubVtblList,\n", file_id); @@ -824,7 +837,7 @@ void write_proxies(const statement_list_t *stmts) if (have_baseiid) fprintf(proxy, " _%s_BaseIIDList,\n", file_id); else fprintf(proxy, " 0,\n"); fprintf(proxy, " &_%s_IID_Lookup,\n", file_id); - fprintf(proxy, " %d,\n", c); + fprintf(proxy, " %d,\n", count); fprintf(proxy, " 1,\n"); fprintf(proxy, " 0,\n"); fprintf(proxy, " 0,\n"); diff --git a/tools/widl/server.c b/tools/widl/server.c index 04e268b2a29..9b8edb7bcd6 100644 --- a/tools/widl/server.c +++ b/tools/widl/server.c @@ -266,7 +266,7 @@ static void write_dispatchtable(type_t *iface) print_server("0\n"); indent--; print_server("};\n"); - print_server("RPC_DISPATCH_TABLE %s_v%d_%d_DispatchTable =\n", iface->name, MAJORVERSION(ver), MINORVERSION(ver)); + print_server("static RPC_DISPATCH_TABLE %s_v%d_%d_DispatchTable =\n", iface->name, MAJORVERSION(ver), MINORVERSION(ver)); print_server("{\n"); indent++; print_server("%u,\n", method_count); @@ -330,7 +330,7 @@ static void write_serverinterfacedecl(type_t *iface) if (endpoints) write_endpoints( server, iface->name, endpoints ); - print_server("extern RPC_DISPATCH_TABLE %s_v%d_%d_DispatchTable;\n", iface->name, MAJORVERSION(ver), MINORVERSION(ver)); + print_server("static RPC_DISPATCH_TABLE %s_v%d_%d_DispatchTable;\n", iface->name, MAJORVERSION(ver), MINORVERSION(ver)); fprintf(server, "\n"); print_server("static const RPC_SERVER_INTERFACE %s___RpcServerInterface =\n", iface->name ); print_server("{\n"); @@ -358,10 +358,10 @@ static void write_serverinterfacedecl(type_t *iface) indent--; print_server("};\n"); if (old_names) - print_server("RPC_IF_HANDLE %s_ServerIfHandle = (RPC_IF_HANDLE)& %s___RpcServerInterface;\n", + print_server("RPC_IF_HANDLE %s_ServerIfHandle DECLSPEC_HIDDEN = (RPC_IF_HANDLE)& %s___RpcServerInterface;\n", iface->name, iface->name); else - print_server("RPC_IF_HANDLE %s%s_v%d_%d_s_ifspec = (RPC_IF_HANDLE)& %s___RpcServerInterface;\n", + print_server("RPC_IF_HANDLE %s%s_v%d_%d_s_ifspec DECLSPEC_HIDDEN = (RPC_IF_HANDLE)& %s___RpcServerInterface;\n", prefix_server, iface->name, MAJORVERSION(ver), MINORVERSION(ver), iface->name); fprintf(server, "\n"); } @@ -379,6 +379,10 @@ static void init_server(void) fprintf(server, "\n"); print_server("#include \"%s\"\n", header_name); print_server("\n"); + print_server( "#ifndef DECLSPEC_HIDDEN\n"); + print_server( "#define DECLSPEC_HIDDEN\n"); + print_server( "#endif\n"); + print_server( "\n"); write_exceptions( server ); print_server("\n"); print_server("struct __server_frame\n"); diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 98145a7863d..051d2e872e2 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2508,19 +2508,8 @@ static unsigned int get_required_buffer_size_type( return 0; case RPC_FC_STRUCT: - case RPC_FC_PSTRUCT: - { - size_t size = 0; - const var_t *field; if (!type->fields_or_args) return 0; - LIST_FOR_EACH_ENTRY( field, type->fields_or_args, const var_t, entry ) - { - unsigned int alignment; - size += get_required_buffer_size_type(field->type, field->name, - &alignment); - } - return size; - } + return fields_memsize(type->fields_or_args, alignment); case RPC_FC_RP: return @@ -2542,75 +2531,26 @@ static unsigned int get_required_buffer_size(const var_t *var, unsigned int *ali { int in_attr = is_attr(var->attrs, ATTR_IN); int out_attr = is_attr(var->attrs, ATTR_OUT); - const type_t *t; if (!in_attr && !out_attr) in_attr = 1; *alignment = 0; - for (t = var->type; is_ptr(t); t = t->ref) - if (is_attr(t->attrs, ATTR_CONTEXTHANDLE)) + if ((pass == PASS_IN && in_attr) || (pass == PASS_OUT && out_attr) || + pass == PASS_RETURN) + { + if (is_ptrchain_attr(var, ATTR_CONTEXTHANDLE)) { *alignment = 4; return 20; } - if (pass == PASS_OUT) - { - if (out_attr && is_ptr(var->type)) - { - type_t *type = var->type; - - if (type->type == RPC_FC_STRUCT) - { - const var_t *field; - unsigned int size = 36; - - if (!type->fields_or_args) return size; - LIST_FOR_EACH_ENTRY( field, type->fields_or_args, const var_t, entry ) - { - unsigned int align; - size += get_required_buffer_size_type( - field->type, field->name, &align); - } - return size; - } - } - return 0; - } - else - { - if ((!out_attr || in_attr) && !var->type->size_is - && !is_attr(var->attrs, ATTR_STRING) && !var->type->declarray) - { - if (is_ptr(var->type)) - { - type_t *type = var->type; - - if (is_base_type(type->type)) - { - return 25; - } - else if (type->type == RPC_FC_STRUCT) - { - unsigned int size = 36; - const var_t *field; - - if (!type->fields_or_args) return size; - LIST_FOR_EACH_ENTRY( field, type->fields_or_args, const var_t, entry ) - { - unsigned int align; - size += get_required_buffer_size_type( - field->type, field->name, &align); - } - return size; - } - } - } - - return get_required_buffer_size_type(var->type, var->name, alignment); + if (!is_string_type(var->attrs, var->type)) + return get_required_buffer_size_type(var->type, var->name, + alignment); } + return 0; } static unsigned int get_function_buffer_size( const func_t *func, enum pass pass ) @@ -2773,7 +2713,7 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix, } print_file(file, indent, "__frame->_StubMsg.Buffer += sizeof("); - write_type_decl(file, var->type, NULL); + write_type_decl(file, is_ptr(type) ? type->ref : type, NULL); fprintf(file, ");\n"); } @@ -3023,47 +2963,29 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func, const case RPC_FC_BOGUS_STRUCT: print_phase_function(file, indent, "ComplexStruct", local_var_prefix, phase, var, start_offset); break; - case RPC_FC_RP: - if (is_base_type( var->type->ref->type )) - { - print_phase_basetype(file, indent, local_var_prefix, phase, pass, var, var->name); - } - else if (var->type->ref->type == RPC_FC_STRUCT) - { - if (phase != PHASE_BUFFERSIZE && phase != PHASE_FREE) - print_phase_function(file, indent, local_var_prefix, "SimpleStruct", phase, var, start_offset + 4); - } - else - { - expr_t *iid; - if ((iid = get_attrp( var->attrs, ATTR_IIDIS ))) - { - print_file( file, indent, "__frame->_StubMsg.MaxCount = (unsigned long) " ); - write_expr( file, iid, 1, 1, NULL, NULL, local_var_prefix ); - fprintf( file, ";\n\n" ); - } - print_phase_function(file, indent, "Pointer", local_var_prefix, phase, var, start_offset); - } - break; default: error("write_remoting_arguments: Unsupported type: %s (0x%02x)\n", var->name, rtype); } } else { - if (last_ptr(var->type) && (pointer_type == RPC_FC_RP) && is_base_type(rtype)) + const type_t *ref = type->ref; + if (type->type == RPC_FC_RP && is_base_type(ref->type)) { if (phase != PHASE_FREE) print_phase_basetype(file, indent, local_var_prefix, phase, pass, var, var->name); } - else if (last_ptr(var->type) && (pointer_type == RPC_FC_RP) && (rtype == RPC_FC_STRUCT)) + else if (type->type == RPC_FC_RP && ref->type == RPC_FC_STRUCT && + !is_user_type(ref)) { if (phase != PHASE_BUFFERSIZE && phase != PHASE_FREE) - print_phase_function(file, indent, "SimpleStruct", local_var_prefix, phase, var, start_offset + 4); + print_phase_function(file, indent, "SimpleStruct", + local_var_prefix, phase, var, + ref->typestring_offset); } else { - if (var->type->ref->type == RPC_FC_IP) + if (ref->type == RPC_FC_IP) print_phase_function(file, indent, "InterfacePointer", local_var_prefix, phase, var, start_offset); else print_phase_function(file, indent, "Pointer", local_var_prefix, phase, var, start_offset); diff --git a/tools/widl/utils.c b/tools/widl/utils.c index 1730e41c608..2e05addeb7a 100644 --- a/tools/widl/utils.c +++ b/tools/widl/utils.c @@ -66,18 +66,6 @@ static void generic_msg(const loc_info_t *loc_info, const char *s, const char *t } -/* yyerror: yacc assumes this is not newline terminated. */ -void parser_error(const char *s, ...) -{ - loc_info_t cur_location = CURRENT_LOCATION; - va_list ap; - va_start(ap, s); - generic_msg(&cur_location, s, "Error", ap); - fprintf(stderr, "\n"); - va_end(ap); - exit(1); -} - void error_loc(const char *s, ...) { loc_info_t cur_loc = CURRENT_LOCATION; @@ -88,6 +76,12 @@ void error_loc(const char *s, ...) exit(1); } +/* yyerror: yacc assumes this is not newline terminated. */ +void parser_error(const char *s) +{ + error_loc("%s\n", s); +} + void error_loc_info(const loc_info_t *loc_info, const char *s, ...) { va_list ap; diff --git a/tools/widl/utils.h b/tools/widl/utils.h index 761d3b46453..5c440be8c01 100644 --- a/tools/widl/utils.h +++ b/tools/widl/utils.h @@ -33,7 +33,7 @@ char *xstrdup(const char *str); #define __attribute__(X) #endif -void parser_error(const char *s, ...) __attribute__((format (printf, 1, 2))) __attribute__((noreturn)); +void parser_error(const char *s) __attribute__((noreturn)); int parser_warning(const char *s, ...) __attribute__((format (printf, 1, 2))); void error_loc(const char *s, ...) __attribute__((format (printf, 1, 2))) __attribute__((noreturn)); void error(const char *s, ...) __attribute__((format (printf, 1, 2))) __attribute__((noreturn)); diff --git a/tools/widl/widl.c b/tools/widl/widl.c index c49b009622b..9b14de20fe4 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -253,7 +253,6 @@ static void write_dlldata_list(struct list *filenames) fprintf(dlldata, "/*** Autogenerated by WIDL %s ", PACKAGE_VERSION); fprintf(dlldata, "- Do not edit ***/\n\n"); - fprintf(dlldata, "#define PROXY_DELEGATION\n"); fprintf(dlldata, "#include \n"); fprintf(dlldata, "#include \n\n"); start_cplusplus_guard(dlldata); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index afcc7dad40e..276639e4f00 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -561,7 +561,7 @@ void BuildDef32File( DLLSPEC *spec ) case TYPE_STDCALL: { int at_param = strlen(odp->u.func.arg_types) * get_ptr_size(); - if (!kill_at) output( "@%d", at_param ); + if (!kill_at && target_cpu == CPU_x86) output( "@%d", at_param ); if (odp->flags & FLAG_FORWARD) { output( "=%s", odp->link_name ); @@ -569,7 +569,7 @@ void BuildDef32File( DLLSPEC *spec ) else if (strcmp(name, odp->link_name)) /* try to reduce output */ { output( "=%s", odp->link_name ); - if (!kill_at) output( "@%d", at_param ); + if (!kill_at && target_cpu == CPU_x86) output( "@%d", at_param ); } break; } -- 2.11.4.GIT