From 9a62491660e4d432282149652a305b7e559e2993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20B=C3=A9ron?= Date: Fri, 31 May 2002 23:06:46 +0000 Subject: [PATCH] Removed trailing whitespace. --- controls/button.c | 20 +- controls/combo.c | 298 ++-- controls/desktop.c | 2 +- controls/edit.c | 86 +- controls/icontitle.c | 6 +- controls/listbox.c | 20 +- controls/menu.c | 286 +-- controls/scroll.c | 72 +- controls/static.c | 6 +- controls/uitools.c | 28 +- debugger/break.c | 136 +- debugger/db_disasm.c | 124 +- debugger/debugger.h | 80 +- debugger/display.c | 10 +- debugger/expr.c | 10 +- debugger/ext_debugger.c | 12 +- debugger/hash.c | 78 +- debugger/info.c | 80 +- debugger/memory.c | 18 +- debugger/module.c | 144 +- debugger/msc.c | 200 +-- debugger/registers.c | 6 +- debugger/source.c | 28 +- debugger/stabs.c | 182 +- debugger/stack.c | 56 +- debugger/types.c | 82 +- debugger/winedbg.c | 206 +-- dlls/advapi32/eventlog.c | 8 +- dlls/advapi32/registry.c | 20 +- dlls/advapi32/security.c | 54 +- dlls/advapi32/service.c | 82 +- dlls/avifil32/avifile.c | 16 +- dlls/comcat/factory.c | 2 +- dlls/comctl32/animate.c | 172 +- dlls/comctl32/comboex.c | 174 +- dlls/comctl32/comctl32.h | 6 +- dlls/comctl32/comctl32undoc.c | 116 +- dlls/comctl32/commctrl.c | 12 +- dlls/comctl32/datetime.c | 380 ++-- dlls/comctl32/flatsb.c | 28 +- dlls/comctl32/header.c | 58 +- dlls/comctl32/hotkey.c | 2 +- dlls/comctl32/imagelist.c | 280 +-- dlls/comctl32/imagelist.h | 2 +- dlls/comctl32/ipaddress.c | 128 +- dlls/comctl32/listview.c | 1548 ++++++++--------- dlls/comctl32/monthcal.c | 294 ++-- dlls/comctl32/nativefont.c | 2 +- dlls/comctl32/pager.c | 116 +- dlls/comctl32/progress.c | 46 +- dlls/comctl32/propsheet.c | 86 +- dlls/comctl32/rebar.c | 162 +- dlls/comctl32/status.c | 32 +- dlls/comctl32/tab.c | 408 ++--- dlls/comctl32/toolbar.c | 310 ++-- dlls/comctl32/tooltips.c | 52 +- dlls/comctl32/trackbar.c | 224 +-- dlls/comctl32/treeview.c | 120 +- dlls/comctl32/updown.c | 154 +- dlls/commdlg/cdlg.h | 4 +- dlls/commdlg/cdlg32.c | 8 +- dlls/commdlg/colordlg.c | 98 +- dlls/commdlg/filedlg.c | 104 +- dlls/commdlg/filedlg95.c | 248 +-- dlls/commdlg/filedlgbrowser.c | 130 +- dlls/commdlg/filedlgbrowser.h | 8 +- dlls/commdlg/filetitle.c | 2 +- dlls/commdlg/finddlg.c | 44 +- dlls/commdlg/finddlg32.c | 2 +- dlls/commdlg/fontdlg.c | 130 +- dlls/commdlg/printdlg.c | 344 ++-- dlls/dciman32/dciman_main.c | 4 +- dlls/ddraw/convert.c | 2 +- dlls/ddraw/d3d_private.h | 10 +- dlls/ddraw/d3ddevice/main.c | 10 +- dlls/ddraw/d3ddevice/mesa.c | 140 +- dlls/ddraw/d3dexecutebuffer.c | 150 +- dlls/ddraw/d3dlight.c | 44 +- dlls/ddraw/d3dmaterial.c | 44 +- dlls/ddraw/d3dtexture.c | 68 +- dlls/ddraw/d3dviewport.c | 60 +- dlls/ddraw/dclipper/main.c | 6 +- dlls/ddraw/ddraw/hal.c | 4 +- dlls/ddraw/ddraw/hal.h | 4 +- dlls/ddraw/ddraw/main.c | 14 +- dlls/ddraw/ddraw/thunks.c | 4 +- dlls/ddraw/ddraw/user.c | 8 +- dlls/ddraw/ddraw_private.h | 4 +- dlls/ddraw/direct3d/main.c | 6 +- dlls/ddraw/direct3d/mesa.c | 10 +- dlls/ddraw/dpalette/main.c | 4 +- dlls/ddraw/dsurface/dib.c | 6 +- dlls/ddraw/dsurface/gamma.c | 6 +- dlls/ddraw/dsurface/hal.c | 4 +- dlls/ddraw/dsurface/main.c | 12 +- dlls/ddraw/dsurface/user.c | 2 +- dlls/ddraw/helper.c | 2 +- dlls/ddraw/main.c | 20 +- dlls/ddraw/mesa.c | 52 +- dlls/dinput/device.c | 72 +- dlls/dinput/dinput_main.c | 32 +- dlls/dinput/joystick/linux.c | 54 +- dlls/dinput/joystick/linuxinput.c | 58 +- dlls/dinput/keyboard/main.c | 30 +- dlls/dinput/mouse/main.c | 80 +- dlls/dplayx/dpinit.h | 2 +- dlls/dplayx/dplay.c | 800 ++++----- dlls/dplayx/dplay_global.h | 8 +- dlls/dplayx/dplaysp.c | 120 +- dlls/dplayx/dplaysp.h | 20 +- dlls/dplayx/dplayx_global.c | 270 +-- dlls/dplayx/dplayx_global.h | 18 +- dlls/dplayx/dplayx_main.c | 16 +- dlls/dplayx/dplayx_messages.c | 74 +- dlls/dplayx/dplayx_messages.h | 12 +- dlls/dplayx/dplayx_queue.h | 10 +- dlls/dplayx/dplobby.c | 230 +-- dlls/dplayx/lobbysp.c | 82 +- dlls/dplayx/lobbysp.h | 4 +- dlls/dplayx/name_server.c | 42 +- dlls/dplayx/name_server.h | 4 +- dlls/dsound/dsound_main.c | 132 +- dlls/gdi/bidi16.c | 6 +- dlls/gdi/driver.c | 6 +- dlls/gdi/enhmfdrv/enhmetafiledrv.h | 2 +- dlls/gdi/enhmfdrv/graphics.c | 24 +- dlls/gdi/enhmfdrv/init.c | 10 +- dlls/gdi/enhmfdrv/objects.c | 2 +- dlls/gdi/freetype.c | 42 +- dlls/gdi/mfdrv/bitblt.c | 18 +- dlls/gdi/mfdrv/graphics.c | 28 +- dlls/gdi/mfdrv/init.c | 38 +- dlls/gdi/mfdrv/metafiledrv.h | 2 +- dlls/gdi/mfdrv/objects.c | 2 +- dlls/gdi/mfdrv/text.c | 2 +- dlls/gdi/printdrv.c | 68 +- dlls/gdi/win16drv/font.c | 32 +- dlls/gdi/win16drv/graphics.c | 16 +- dlls/gdi/win16drv/init.c | 54 +- dlls/gdi/win16drv/prtdrv.c | 116 +- dlls/gdi/win16drv/text.c | 16 +- dlls/gdi/win16drv/win16drv.h | 108 +- dlls/gdi/wing.c | 6 +- dlls/icmp/icmp_main.c | 18 +- dlls/imagehlp/access.c | 6 +- dlls/imagehlp/imagehlp_main.c | 2 +- dlls/imagehlp/internal.c | 4 +- dlls/imagehlp/modify.c | 10 +- dlls/imagehlp/symbol.c | 2 +- dlls/imm32/imm.c | 16 +- dlls/kernel/comm.c | 156 +- dlls/kernel/console.c | 10 +- dlls/kernel/format_msg.c | 10 +- dlls/kernel/stress.c | 2 +- dlls/kernel/sync.c | 8 +- dlls/kernel/tests/alloc.c | 6 +- dlls/kernel/tests/locale.c | 12 +- dlls/kernel/tests/path.c | 30 +- dlls/kernel/tests/process.c | 24 +- dlls/kernel/thunk.c | 150 +- dlls/kernel/time.c | 24 +- dlls/kernel/toolhelp.c | 14 +- dlls/kernel/utthunk.c | 24 +- dlls/kernel/win87em.c | 10 +- dlls/kernel/windebug.c | 4 +- dlls/kernel/wowthunk.c | 36 +- dlls/lzexpand/lzexpand_main.c | 28 +- dlls/mpr/mpr_main.c | 2 +- dlls/mpr/multinet.c | 2 +- dlls/mpr/pwcache.c | 16 +- dlls/mpr/wnet.c | 118 +- dlls/msacm/driver.c | 126 +- dlls/msacm/filter.c | 104 +- dlls/msacm/format.c | 206 +-- dlls/msacm/imaadp32/imaadp32.c | 236 +-- dlls/msacm/internal.c | 48 +- dlls/msacm/msacm32_main.c | 18 +- dlls/msacm/msacm_main.c | 8 +- dlls/msacm/msacmdrv.h | 2 +- dlls/msacm/msadp32/msadp32.c | 192 +- dlls/msacm/msg711/msg711.c | 214 +-- dlls/msacm/pcmconverter.c | 128 +- dlls/msacm/stream.c | 72 +- dlls/msacm/wineacm.h | 16 +- dlls/msvcrt/except.c | 6 +- dlls/msvcrt/file.c | 104 +- dlls/msvcrt/lock.c | 10 +- dlls/msvcrt/mbcs.c | 4 +- dlls/msvcrt/msvcrt.h | 2 +- dlls/msvcrt/mtdll.h | 4 +- dlls/msvcrt/process.c | 24 +- dlls/msvcrt/thread.c | 6 +- dlls/msvideo/drawdib.c | 34 +- dlls/msvideo/mciwnd.c | 26 +- dlls/msvideo/msvideo_main.c | 60 +- dlls/netapi32/netapi32.c | 6 +- dlls/ntdll/cdrom.c | 50 +- dlls/ntdll/error.c | 2 +- dlls/ntdll/exception.c | 12 +- dlls/ntdll/file.c | 14 +- dlls/ntdll/heap.c | 22 +- dlls/ntdll/nt.c | 50 +- dlls/ntdll/om.c | 28 +- dlls/ntdll/reg.c | 6 +- dlls/ntdll/rtl.c | 30 +- dlls/ntdll/sec.c | 30 +- dlls/ntdll/signal_i386.c | 26 +- dlls/ntdll/signal_sparc.c | 8 +- dlls/ntdll/string.c | 2 +- dlls/ntdll/sync.c | 4 +- dlls/ntdll/time.c | 10 +- dlls/odbc32/proxyodbc.c | 4 +- dlls/odbc32/proxyodbc.h | 2 +- dlls/ole32/antimoniker.c | 42 +- dlls/ole32/bindctx.c | 38 +- dlls/ole32/clipboard.c | 312 ++-- dlls/ole32/compobj.c | 4 +- dlls/ole32/compositemoniker.c | 130 +- dlls/ole32/datacache.c | 338 ++-- dlls/ole32/defaulthandler.c | 370 ++-- dlls/ole32/errorinfo.c | 42 +- dlls/ole32/filemoniker.c | 128 +- dlls/ole32/hglobalstream.c | 280 +-- dlls/ole32/ifs.c | 14 +- dlls/ole32/itemmoniker.c | 52 +- dlls/ole32/marshal.c | 6 +- dlls/ole32/memlockbytes.c | 14 +- dlls/ole32/moniker.c | 30 +- dlls/ole32/ole2.c | 186 +- dlls/ole32/ole2nls.c | 2 +- dlls/ole32/ole2stubs.c | 6 +- dlls/ole32/oleobj.c | 150 +- dlls/ole32/oleproxy.c | 10 +- dlls/ole32/rpc.c | 4 +- dlls/ole32/stg_bigblockfile.c | 36 +- dlls/ole32/stg_stream.c | 200 +-- dlls/ole32/storage.c | 38 +- dlls/ole32/storage32.c | 1376 +++++++-------- dlls/ole32/storage32.h | 300 ++-- dlls/oleaut32/connpt.c | 52 +- dlls/oleaut32/dispatch.c | 4 +- dlls/oleaut32/ole2disp.c | 26 +- dlls/oleaut32/oleaut.c | 6 +- dlls/oleaut32/olefont.c | 174 +- dlls/oleaut32/olepicture.c | 94 +- dlls/oleaut32/parsedt.c | 4 +- dlls/oleaut32/safearray.c | 396 ++--- dlls/oleaut32/stubs.c | 6 +- dlls/oleaut32/tests/vartest.c | 16 +- dlls/oleaut32/tmarshal.c | 12 +- dlls/oleaut32/typelib.c | 494 +++--- dlls/oleaut32/typelib.h | 10 +- dlls/oleaut32/variant.c | 144 +- dlls/olecli/olecli_main.c | 2 +- dlls/opengl32/wgl.c | 36 +- dlls/opengl32/wgl.h | 66 +- dlls/psapi/psapi_main.c | 2 +- dlls/rasapi32/rasapi.c | 10 +- dlls/richedit/ansi_gen.h | 2 +- dlls/richedit/ansi_sym.h | 8 +- dlls/richedit/charlist.c | 40 +- dlls/richedit/charlist.h | 2 +- dlls/richedit/reader.c | 30 +- dlls/richedit/richedit.c | 70 +- dlls/richedit/text-writer.c | 22 +- dlls/richedit/text_map.h | 6 +- dlls/rpcrt4/rpcrt4_main.c | 76 +- dlls/serialui/confdlg.c | 28 +- dlls/setupapi/devinst.c | 12 +- dlls/setupapi/infparse.c | 2 +- dlls/setupapi/setupx16.h | 2 +- dlls/setupapi/stubs.c | 2 +- dlls/setupapi/virtcopy.c | 22 +- dlls/shdocvw/classinfo.c | 4 +- dlls/shdocvw/events.c | 4 +- dlls/shdocvw/factory.c | 2 +- dlls/shdocvw/misc.c | 2 +- dlls/shdocvw/oleobject.c | 6 +- dlls/shdocvw/persist.c | 4 +- dlls/shdocvw/webbrowser.c | 2 +- dlls/shell32/brsfolder.c | 26 +- dlls/shell32/changenotify.c | 40 +- dlls/shell32/classes.c | 30 +- dlls/shell32/clipboard.c | 18 +- dlls/shell32/control.c | 30 +- dlls/shell32/dataobject.c | 32 +- dlls/shell32/debughlp.c | 8 +- dlls/shell32/dialogs.c | 2 +- dlls/shell32/enumidlist.c | 30 +- dlls/shell32/folders.c | 16 +- dlls/shell32/iconcache.c | 50 +- dlls/shell32/memorystream.c | 26 +- dlls/shell32/pidl.c | 136 +- dlls/shell32/pidl.h | 20 +- dlls/shell32/shell.c | 60 +- dlls/shell32/shell32_main.c | 82 +- dlls/shell32/shell32_main.h | 20 +- dlls/shell32/shelllink.c | 172 +- dlls/shell32/shellole.c | 90 +- dlls/shell32/shellord.c | 138 +- dlls/shell32/shellpath.c | 76 +- dlls/shell32/shellreg.c | 4 +- dlls/shell32/shellstring.c | 16 +- dlls/shell32/shlexec.c | 148 +- dlls/shell32/shlfileop.c | 40 +- dlls/shell32/shlfolder.c | 312 ++-- dlls/shell32/shlmenu.c | 88 +- dlls/shell32/shlview.c | 212 +-- dlls/shell32/shpolicy.c | 12 +- dlls/shell32/shv_bg_cmenu.c | 56 +- dlls/shell32/shv_item_cmenu.c | 46 +- dlls/shell32/systray.c | 2 +- dlls/shell32/undocshell.h | 72 +- dlls/shlwapi/ordinal.c | 66 +- dlls/shlwapi/path.c | 6 +- dlls/shlwapi/reg.c | 66 +- dlls/shlwapi/regstream.c | 36 +- dlls/shlwapi/shlwapi_main.c | 2 +- dlls/shlwapi/string.c | 24 +- dlls/shlwapi/tests/shreg.c | 4 +- dlls/shlwapi/url.c | 66 +- dlls/snmpapi/main.c | 4 +- dlls/tapi32/assisted.c | 4 +- dlls/tapi32/line.c | 90 +- dlls/tapi32/phone.c | 4 +- dlls/ttydrv/dc.c | 4 +- dlls/ttydrv/graphics.c | 26 +- dlls/ttydrv/palette.c | 10 +- dlls/ttydrv/ttydrv.h | 6 +- dlls/ttydrv/user.c | 2 +- dlls/ttydrv/wnd.c | 16 +- dlls/twain/capability.c | 12 +- dlls/twain/ds_ctrl.c | 26 +- dlls/twain/ds_image.c | 18 +- dlls/twain/dsm_ctrl.c | 20 +- dlls/twain/twain.h | 102 +- dlls/twain/twain32_main.c | 12 +- dlls/twain/twain_i.h | 6 +- dlls/urlmon/umon.c | 6 +- dlls/urlmon/urlmon_main.c | 6 +- dlls/user/cache.c | 8 +- dlls/user/comm16.c | 88 +- dlls/user/dde/client.c | 140 +- dlls/user/dde/dde_private.h | 40 +- dlls/user/dde/ddeml16.c | 30 +- dlls/user/dde/misc.c | 342 ++-- dlls/user/dde/server.c | 238 +-- dlls/user/display.c | 2 +- dlls/user/exticon.c | 70 +- dlls/user/lstr.c | 10 +- dlls/user/message.c | 14 +- dlls/user/misc.c | 6 +- dlls/user/mouse.c | 4 +- dlls/user/network.c | 24 +- dlls/user/resource.c | 30 +- dlls/user/tests/sysparams.c | 10 +- dlls/user/text.c | 44 +- dlls/user/wnd16.c | 2 +- dlls/version/info.c | 26 +- dlls/version/install.c | 14 +- dlls/version/resource.c | 34 +- dlls/version/ver16.c | 16 +- dlls/win32s/w32skernel.c | 2 +- dlls/winaspi/aspi.c | 10 +- dlls/winaspi/winaspi16.c | 6 +- dlls/winaspi/winescsi.h | 4 +- dlls/winedos/devices.c | 4 +- dlls/winedos/dosaspi.c | 4 +- dlls/winedos/dosvm.c | 4 +- dlls/winedos/int10.c | 106 +- dlls/winedos/int16.c | 2 +- dlls/winedos/int21.c | 4 +- dlls/winedos/int33.c | 4 +- dlls/winedos/int67.c | 22 +- dlls/winedos/ioports.c | 6 +- dlls/winedos/module.c | 6 +- dlls/winedos/soundblaster.c | 22 +- dlls/winedos/vga.c | 30 +- dlls/winedos/vga.h | 8 +- dlls/wineps/afm.c | 54 +- dlls/wineps/afm2c.c | 30 +- dlls/wineps/brush.c | 4 +- dlls/wineps/clipping.c | 14 +- dlls/wineps/color.c | 4 +- dlls/wineps/data/AvantGarde_Book.c | 2 +- dlls/wineps/data/AvantGarde_BookOblique.c | 2 +- dlls/wineps/data/AvantGarde_Demi.c | 2 +- dlls/wineps/data/AvantGarde_DemiOblique.c | 2 +- dlls/wineps/data/Bookman_Demi.c | 2 +- dlls/wineps/data/Bookman_DemiItalic.c | 2 +- dlls/wineps/data/Bookman_Light.c | 2 +- dlls/wineps/data/Bookman_LightItalic.c | 2 +- dlls/wineps/data/Courier.c | 2 +- dlls/wineps/data/Courier_Bold.c | 2 +- dlls/wineps/data/Courier_BoldOblique.c | 2 +- dlls/wineps/data/Courier_Oblique.c | 2 +- dlls/wineps/data/Helvetica.c | 2 +- dlls/wineps/data/Helvetica_Bold.c | 2 +- dlls/wineps/data/Helvetica_BoldOblique.c | 2 +- dlls/wineps/data/Helvetica_Narrow.c | 2 +- dlls/wineps/data/Helvetica_Narrow_Bold.c | 2 +- .../data/Helvetica_Narrow_BoldOblique.c | 2 +- dlls/wineps/data/Helvetica_Narrow_Oblique.c | 2 +- dlls/wineps/data/Helvetica_Oblique.c | 2 +- dlls/wineps/data/NewCenturySchlbk_Bold.c | 2 +- .../wineps/data/NewCenturySchlbk_BoldItalic.c | 2 +- dlls/wineps/data/NewCenturySchlbk_Italic.c | 2 +- dlls/wineps/data/NewCenturySchlbk_Roman.c | 2 +- dlls/wineps/data/Palatino_Bold.c | 2 +- dlls/wineps/data/Palatino_BoldItalic.c | 2 +- dlls/wineps/data/Palatino_Italic.c | 2 +- dlls/wineps/data/Palatino_Roman.c | 2 +- dlls/wineps/data/Symbol.c | 2 +- dlls/wineps/data/Times_Bold.c | 2 +- dlls/wineps/data/Times_BoldItalic.c | 2 +- dlls/wineps/data/Times_Italic.c | 2 +- dlls/wineps/data/Times_Roman.c | 2 +- dlls/wineps/data/ZapfChancery_MediumItalic.c | 2 +- dlls/wineps/data/ZapfDingbats.c | 2 +- dlls/wineps/data/agl.c | 4 +- dlls/wineps/driver.c | 34 +- dlls/wineps/escape.c | 6 +- dlls/wineps/font.c | 94 +- dlls/wineps/glyphlist.c | 6 +- dlls/wineps/init.c | 28 +- dlls/wineps/mkagl.c | 174 +- dlls/wineps/pen.c | 10 +- dlls/wineps/ppd.c | 36 +- dlls/wineps/ps.c | 70 +- dlls/wineps/psdrv.h | 10 +- dlls/wineps/text.c | 18 +- dlls/wineps/truetype.c | 156 +- dlls/wineps/type1afm.c | 318 ++-- dlls/wininet/ftp.c | 144 +- dlls/wininet/http.c | 76 +- dlls/wininet/internet.c | 112 +- dlls/wininet/internet.h | 10 +- dlls/wininet/utility.c | 8 +- dlls/wininet/wininet_main.c | 2 +- dlls/winmm/driver.c | 74 +- dlls/winmm/joystick.c | 58 +- dlls/winmm/joystick/joystick.c | 48 +- dlls/winmm/lolvldrv.c | 180 +- dlls/winmm/mci.c | 286 +-- dlls/winmm/mcianim/mcianim.c | 138 +- dlls/winmm/mciavi/info.c | 52 +- dlls/winmm/mciavi/mciavi.c | 326 ++-- dlls/winmm/mciavi/mmoutput.c | 242 +-- dlls/winmm/mciavi/private_mciavi.h | 2 +- dlls/winmm/mciavi/wnd.c | 54 +- dlls/winmm/mcicda/mcicda.c | 178 +- dlls/winmm/mciseq/mcimidi.c | 454 ++--- dlls/winmm/mciwave/mciwave.c | 402 ++--- dlls/winmm/midimap/midimap.c | 114 +- dlls/winmm/mmio.c | 402 ++--- dlls/winmm/mmsystem.c | 738 ++++---- dlls/winmm/sound16.c | 2 +- dlls/winmm/time.c | 42 +- dlls/winmm/wavemap/wavemap.c | 92 +- dlls/winmm/winearts/arts.c | 14 +- dlls/winmm/winearts/audio.c | 194 +-- dlls/winmm/winemm.h | 4 +- dlls/winmm/wineoss/audio.c | 272 +-- dlls/winmm/wineoss/midi.c | 428 ++--- dlls/winmm/wineoss/midipatch.c | 268 +-- dlls/winmm/wineoss/mixer.c | 172 +- dlls/winmm/wineoss/mmaux.c | 20 +- dlls/winmm/wineoss/oss.c | 16 +- dlls/winmm/wineoss/oss.h | 6 +- dlls/winsock/async.c | 72 +- dlls/winsock/socket.c | 230 +-- dlls/winspool/info.c | 92 +- dlls/wsock32/protocol.c | 4 +- dlls/wsock32/socket.c | 256 +-- dlls/wsock32/wscontrol.h | 16 +- dlls/x11drv/clipboard.c | 126 +- dlls/x11drv/dga2.c | 2 +- dlls/x11drv/dga2.h | 6 +- dlls/x11drv/event.c | 118 +- dlls/x11drv/keyboard.c | 50 +- dlls/x11drv/mouse.c | 18 +- dlls/x11drv/scroll.c | 4 +- dlls/x11drv/window.c | 4 +- dlls/x11drv/wineclipsrv.c | 158 +- dlls/x11drv/winpos.c | 2 +- dlls/x11drv/x11ddraw.c | 48 +- dlls/x11drv/x11ddraw.h | 6 +- dlls/x11drv/x11drv_main.c | 10 +- dlls/x11drv/xrender.c | 18 +- dlls/x11drv/xvidmode.h | 6 +- files/change.c | 8 +- files/directory.c | 14 +- files/dos_fs.c | 84 +- files/drive.c | 60 +- files/file.c | 56 +- files/profile.c | 70 +- files/smb.c | 32 +- files/tape.c | 12 +- graphics/bitblt.c | 6 +- graphics/dispdib.c | 2 +- graphics/env.c | 8 +- graphics/fontengine.c | 12 +- graphics/painting.c | 82 +- graphics/path.c | 128 +- graphics/x11drv/bitblt.c | 16 +- graphics/x11drv/bitmap.c | 18 +- graphics/x11drv/brush.c | 16 +- graphics/x11drv/codepage.c | 20 +- graphics/x11drv/dib.c | 148 +- graphics/x11drv/graphics.c | 54 +- graphics/x11drv/init.c | 2 +- graphics/x11drv/opengl.c | 56 +- graphics/x11drv/palette.c | 132 +- graphics/x11drv/text.c | 28 +- graphics/x11drv/xfont.c | 300 ++-- if1632/relay.c | 12 +- if1632/snoop.c | 4 +- include/commctrl.h | 180 +- include/commdlg.h | 76 +- include/cursoricon.h | 4 +- include/d3d.h | 12 +- include/d3dtypes.h | 2 +- include/dde.h | 2 +- include/ddeml.h | 4 +- include/ddraw.h | 10 +- include/dinput.h | 6 +- include/dispdib.h | 2 +- include/dlgs.h | 2 +- include/docobj.h | 42 +- include/dplay.h | 86 +- include/dplobby.h | 22 +- include/dsdriver.h | 6 +- include/dsound.h | 28 +- include/file.h | 4 +- include/gdi.h | 14 +- include/guiddef.h | 4 +- include/imagehlp.h | 18 +- include/initguid.h | 2 +- include/instance.h | 2 +- include/miscemu.h | 6 +- include/mmddk.h | 14 +- include/mmreg.h | 60 +- include/mmsystem.h | 28 +- include/module.h | 4 +- include/msacm.h | 26 +- include/msdos.h | 2 +- include/msvcrt/stdio.h | 16 +- include/msvcrt/wctype.h | 2 +- include/netspi.h | 10 +- include/nspapi.h | 4 +- include/ntddk.h | 86 +- include/ntddstor.h | 4 +- include/ntdef.h | 6 +- include/ntsecapi.h | 2 +- include/objbase.h | 2 +- include/ole.h | 6 +- include/ole2.h | 6 +- include/ole2ver.h | 2 +- include/oleauto.h | 38 +- include/olectl.h | 16 +- include/oledlg.h | 596 +++---- include/path.h | 4 +- include/prsht.h | 58 +- include/psapi.h | 8 +- include/queue.h | 4 +- include/ras.h | 8 +- include/richedit.h | 4 +- include/rpcdce.h | 6 +- include/shellapi.h | 32 +- include/shlobj.h | 12 +- include/snoop.h | 2 +- include/spy.h | 2 +- include/sql.h | 4 +- include/sqlext.h | 62 +- include/storage.h | 2 +- include/tapi.h | 4 +- include/task.h | 4 +- include/tchar.h | 4 +- include/thread.h | 2 +- include/tlhelp32.h | 82 +- include/ver.h | 2 +- include/vfw.h | 18 +- include/winbase.h | 14 +- include/windowsx.h | 10 +- include/wine/icmpapi.h | 2 +- include/wine/ipexport.h | 2 +- include/wine/obj_base.h | 150 +- include/wine/obj_cache.h | 2 +- include/wine/obj_comcat.h | 2 +- include/wine/obj_connection.h | 4 +- include/wine/obj_contextmenu.h | 6 +- include/wine/obj_control.h | 28 +- include/wine/obj_dataobject.h | 6 +- include/wine/obj_inplace.h | 20 +- include/wine/obj_marshal.h | 2 +- include/wine/obj_misc.h | 8 +- include/wine/obj_oleaut.h | 28 +- include/wine/obj_olefont.h | 4 +- include/wine/obj_oleobj.h | 14 +- include/wine/obj_oleundo.h | 6 +- include/wine/obj_oleview.h | 6 +- include/wine/obj_picture.h | 4 +- include/wine/obj_property.h | 40 +- include/wine/obj_propertystorage.h | 8 +- include/wine/obj_queryassociations.h | 6 +- include/wine/obj_shellfolder.h | 22 +- include/wine/obj_shelllink.h | 8 +- include/wine/obj_shellview.h | 8 +- include/wine/unicode.h | 8 +- include/wine/windef16.h | 2 +- include/wine/wingdi16.h | 8 +- include/wine/winnet16.h | 6 +- include/wine/winuser16.h | 4 +- include/wine_gl.h | 6 +- include/winerror.h | 2 +- include/wingdi.h | 84 +- include/wininet.h | 406 ++--- include/winioctl.h | 80 +- include/winnls.h | 204 +-- include/winnt.h | 226 +-- include/winreg.h | 2 +- include/winsock.h | 30 +- include/winsock2.h | 8 +- include/winspool.h | 34 +- include/winuser.h | 24 +- include/winver.h | 2 +- include/wnaspi32.h | 2 +- include/wownt32.h | 2 +- include/wtypes.h | 8 +- include/x11drv.h | 12 +- include/x11font.h | 2 +- library/port.c | 10 +- loader/elf.c | 22 +- loader/loadorder.c | 12 +- loader/module.c | 54 +- loader/ne/convert.c | 34 +- loader/ne/module.c | 28 +- loader/ne/resource.c | 18 +- loader/ne/segment.c | 44 +- loader/pe_image.c | 38 +- loader/resource.c | 48 +- loader/task.c | 20 +- memory/atom.c | 28 +- memory/codepage.c | 2 +- memory/environ.c | 10 +- memory/global.c | 44 +- memory/heap.c | 40 +- memory/instr.c | 8 +- memory/local.c | 38 +- memory/registry.c | 4 +- memory/selector.c | 4 +- memory/virtual.c | 12 +- misc/cpu.c | 6 +- misc/error.c | 6 +- misc/options.c | 2 +- misc/registry.c | 32 +- misc/system.c | 2 +- misc/version.c | 24 +- miscemu/main.c | 2 +- msdos/dosconf.c | 16 +- msdos/dosmem.c | 54 +- msdos/dpmi.c | 22 +- msdos/int11.c | 10 +- msdos/int15.c | 2 +- msdos/int1a.c | 14 +- msdos/int21.c | 148 +- msdos/int26.c | 2 +- msdos/int2a.c | 2 +- msdos/int2f.c | 182 +- msdos/int41.c | 2 +- msdos/int4b.c | 4 +- msdos/int5c.c | 2 +- msdos/ioports.c | 18 +- msdos/ppdev.c | 16 +- msdos/vxd.c | 182 +- objects/bitmap.c | 18 +- objects/brush.c | 14 +- objects/clipping.c | 12 +- objects/color.c | 6 +- objects/dc.c | 38 +- objects/dib.c | 44 +- objects/enhmetafile.c | 300 ++-- objects/font.c | 92 +- objects/gdiobj.c | 24 +- objects/metafile.c | 152 +- objects/palette.c | 48 +- objects/pen.c | 14 +- objects/region.c | 212 +-- objects/text.c | 8 +- ole/ole2nls.c | 504 +++--- programs/avitools/aviinfo.c | 6 +- programs/avitools/aviplay.c | 14 +- programs/avitools/icinfo.c | 2 +- programs/clock/language.c | 20 +- programs/clock/license.h | 4 +- programs/clock/main.c | 38 +- programs/clock/main.h | 6 +- programs/clock/winclock.c | 34 +- programs/clock/winclock.h | 4 +- programs/control/control.c | 6 +- programs/control/params.h | 2 +- programs/notepad/dialog.c | 40 +- programs/notepad/language.c | 10 +- programs/notepad/license.h | 4 +- programs/notepad/main.c | 74 +- programs/notepad/main.h | 4 +- programs/notepad/search.c | 14 +- programs/progman/grpfile.c | 28 +- programs/progman/progman.h | 4 +- programs/progman/program.c | 2 +- programs/regapi/regapi.c | 286 +-- programs/regedit/regedit.c | 6 +- programs/regedit/regproc.c | 204 +-- programs/regedit/regproc.h | 8 +- programs/regsvr32/regsvr32.c | 14 +- programs/regtest/regtest.c | 4 +- programs/uninstaller/main.c | 34 +- programs/view/globals.h | 4 +- programs/view/init.c | 12 +- programs/view/view.c | 24 +- programs/view/winmain.c | 12 +- programs/wcmd/batch.c | 44 +- programs/wcmd/builtins.c | 28 +- programs/wcmd/directory.c | 8 +- programs/wcmd/wcmd.h | 4 +- programs/wcmd/wcmdmain.c | 36 +- programs/wineconsole/dialog.c | 92 +- programs/wineconsole/registry.c | 28 +- programs/wineconsole/user.c | 198 +-- programs/wineconsole/winecon_private.h | 2 +- programs/wineconsole/winecon_user.h | 6 +- programs/wineconsole/wineconsole.c | 40 +- programs/winemine/dialog.c | 52 +- programs/winemine/dialog.h | 2 +- programs/winemine/main.c | 416 ++--- programs/winemine/main.h | 8 +- programs/winemine/resource.h | 2 +- programs/winepath/winepath.c | 8 +- programs/winhelp/hlpfile.c | 6 +- programs/winhelp/macro.c | 4 +- programs/winhelp/winhelp.c | 8 +- relay32/snoop.c | 2 +- scheduler/process.c | 22 +- scheduler/pthread.c | 36 +- scheduler/syslevel.c | 16 +- scheduler/thread.c | 18 +- server/async.h | 8 +- server/console.c | 32 +- server/named_pipe.c | 2 +- server/registry.c | 4 +- server/smb.c | 2 +- server/sock.c | 6 +- tools/bin2res.c | 32 +- tools/fnt2bdf.c | 94 +- tools/fnt2bdf.h | 4 +- tools/winebuild/import.c | 4 +- tools/winebuild/main.c | 2 +- tools/winebuild/parser.c | 6 +- tools/winebuild/relay.c | 64 +- tools/winebuild/spec16.c | 28 +- tools/winebuild/utils.c | 6 +- tools/winedump/cvinclude.h | 14 +- tools/winedump/debug.c | 36 +- tools/winedump/main.c | 6 +- tools/winedump/msmangle.c | 4 +- tools/winedump/pe.c | 270 +-- tools/winedump/winedump.h | 2 +- tools/wmc/mcl.c | 6 +- tools/wmc/wmc.h | 4 +- tools/wmc/write.c | 2 +- tools/wrc/dumpres.c | 6 +- tools/wrc/genres.c | 6 +- tools/wrc/newstruc.c | 6 +- tools/wrc/utils.c | 2 +- tools/wrc/wrc.h | 4 +- tools/wrc/wrctypes.h | 4 +- tools/wrc/writeres.c | 8 +- win32/console.c | 154 +- win32/device.c | 108 +- win32/editline.c | 60 +- win32/except.c | 38 +- win32/init.c | 2 +- win32/newfns.c | 20 +- windows/caret.c | 14 +- windows/class.c | 30 +- windows/clipboard.c | 102 +- windows/cursoricon.c | 194 +-- windows/dce.c | 60 +- windows/defdlg.c | 10 +- windows/defwnd.c | 34 +- windows/dialog.c | 46 +- windows/driver.c | 86 +- windows/focus.c | 10 +- windows/hook.c | 14 +- windows/input.c | 44 +- windows/keyboard.c | 12 +- windows/mdi.c | 116 +- windows/message.c | 10 +- windows/msgbox.c | 28 +- windows/multimon.c | 6 +- windows/nonclient.c | 76 +- windows/painting.c | 102 +- windows/queue.c | 34 +- windows/rect.c | 8 +- windows/scroll.c | 2 +- windows/spy.c | 300 ++-- windows/syscolor.c | 10 +- windows/sysmetrics.c | 10 +- windows/sysparams.c | 94 +- windows/timer.c | 32 +- windows/user.c | 22 +- windows/win.c | 8 +- windows/winhelp.c | 2 +- windows/winpos.c | 40 +- windows/winproc.c | 32 +- 815 files changed, 22512 insertions(+), 22512 deletions(-) diff --git a/controls/button.c b/controls/button.c index bc83af896c5..0826dc13f8c 100644 --- a/controls/button.c +++ b/controls/button.c @@ -225,7 +225,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED ); } break; - + case WM_LBUTTONDBLCLK: if(style & BS_NOTIFY || btn_type == BS_RADIOBUTTON || @@ -342,7 +342,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, if ((btn_type == BS_RADIOBUTTON || btn_type == BS_AUTORADIOBUTTON) && (GetCapture() != hWnd) && !(SendMessageW(hWnd, BM_GETCHECK, 0, 0) & BST_CHECKED)) { - /* The notification is sent when the button (BS_AUTORADIOBUTTON) + /* The notification is sent when the button (BS_AUTORADIOBUTTON) is unchecked and the focus was not given by a mouse click. */ if (btn_type == BS_AUTORADIOBUTTON) SendMessageW( hWnd, BM_SETCHECK, BUTTON_CHECKED, 0 ); @@ -581,7 +581,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) break; default: - empty_rect: + empty_rect: r.right = r.left; r.bottom = r.top; return (UINT)(LONG)-1; @@ -732,7 +732,7 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) SetPixel( hDC, rc.right-1, rc.bottom-1, clr_wnd); InflateRect( &rc, -1, -1 ); } - + if (get_button_type(style) == BS_DEFPUSHBUTTON) { Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom); @@ -845,14 +845,14 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) if (!hBrush) /* did the app forget to call defwindowproc ? */ hBrush = DefWindowProcW( GetParent(hwnd), WM_CTLCOLORSTATIC, hDC, (LPARAM)hwnd ); - if (style & BS_LEFTTEXT) + if (style & BS_LEFTTEXT) { /* magic +4 is what CTL3D expects */ rtext.right -= checkBoxWidth + 4; rbox.left = rbox.right - checkBoxWidth; } - else + else { rtext.left += checkBoxWidth + 4; rbox.right = checkBoxWidth; @@ -860,7 +860,7 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) /* Draw the check-box bitmap */ if (action == ODA_DRAWENTIRE || action == ODA_SELECT) - { + { /* Since WM_ERASEBKGND does nothing, first prepare background */ if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush ); else FillRect( hDC, &client, hBrush ); @@ -905,10 +905,10 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) if (style & WS_DISABLED) flags |= DFCS_INACTIVE; - /* rbox must have the correct height */ + /* rbox must have the correct height */ delta = rbox.bottom - rbox.top - checkBoxHeight; - if (delta > 0) - { + if (delta > 0) + { int ofs = (abs(delta) / 2); rbox.bottom -= ofs + 1; rbox.top = rbox.bottom - checkBoxHeight; diff --git a/controls/combo.c b/controls/combo.c index bfb6fa4462e..cb1ac9b7989 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -1,8 +1,8 @@ /* * Combo controls - * + * * Copyright 1997 Alex Korobka - * + * * 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 @@ -97,7 +97,7 @@ const struct builtin_class_descr COMBO_builtin_class = static BOOL COMBO_Init() { HDC hDC; - + if( hComboBmp ) return TRUE; if( (hDC = CreateCompatibleDC(0)) ) { @@ -171,7 +171,7 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc ) { TRACE("[%04x]: freeing storage\n", lphc->self); - if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox ) + if( (CB_GETTYPE(lphc) != CBS_SIMPLE) && lphc->hWndLBox ) DestroyWindow( lphc->hWndLBox ); SetWindowLongA( lphc->self, 0, 0 ); @@ -183,9 +183,9 @@ static LRESULT COMBO_NCDestroy( LPHEADCOMBO lphc ) /*********************************************************************** * CBGetTextAreaHeight * - * This method will calculate the height of the text area of the + * This method will calculate the height of the text area of the * combobox. - * The height of the text area is set in two ways. + * The height of the text area is set in two ways. * It can be set explicitly through a combobox message or through a * WM_MEASUREITEM callback. * If this is not the case, the height is set to 13 dialog units. @@ -207,19 +207,19 @@ static INT CBGetTextAreaHeight( HDC hDC = GetDC(hwnd); HFONT hPrevFont = 0; INT baseUnitY; - + if (lphc->hFont) hPrevFont = SelectObject( hDC, lphc->hFont ); - + GetTextMetricsW(hDC, &tm); - + baseUnitY = tm.tmHeight; - + if( hPrevFont ) SelectObject( hDC, hPrevFont ); - + ReleaseDC(hwnd, hDC); - + iTextItemHeight = ((13 * baseUnitY) / 8); /* @@ -229,7 +229,7 @@ static INT CBGetTextAreaHeight( */ iTextItemHeight -= 2*COMBO_YBORDERSIZE(); } - + /* * Check the ownerdraw case if we haven't asked the parent the size * of the item yet. @@ -246,9 +246,9 @@ static INT CBGetTextAreaHeight( * We use the client rect for the width of the item. */ GetClientRect(hwnd, &clientRect); - + lphc->wState &= ~CBF_MEASUREITEM; - + /* * Send a first one to measure the size of the text area */ @@ -276,9 +276,9 @@ static INT CBGetTextAreaHeight( SendMessageW(lphc->owner, WM_MEASUREITEM, id, (LPARAM)&measureItem); lphc->fixedOwnerDrawHeight = measureItem.itemHeight; } - + /* - * Keep the size for the next time + * Keep the size for the next time */ lphc->editHeight = iTextItemHeight; } @@ -300,7 +300,7 @@ static void CBForceDummyResize( int newComboHeight; newComboHeight = CBGetTextAreaHeight(lphc->self,lphc) + 2*COMBO_YBORDERSIZE(); - + GetWindowRect(lphc->self, &windowRect); /* @@ -327,8 +327,8 @@ static void CBForceDummyResize( static void CBCalcPlacement( HWND hwnd, LPHEADCOMBO lphc, - LPRECT lprEdit, - LPRECT lprButton, + LPRECT lprEdit, + LPRECT lprButton, LPRECT lprLB) { /* @@ -354,7 +354,7 @@ static void CBCalcPlacement( /* * If the combobox is "simple" there is no button. */ - if( CB_GETTYPE(lphc) == CBS_SIMPLE ) + if( CB_GETTYPE(lphc) == CBS_SIMPLE ) lprButton->left = lprButton->right = lprButton->bottom = 0; else { @@ -366,7 +366,7 @@ static void CBCalcPlacement( lprButton->left = lprButton->right - GetSystemMetrics(SM_CXVSCROLL); lprEdit->right = lprButton->left; } - + /* * In the case of a dropdown, there is an additional spacing between the * text area and the button. @@ -383,7 +383,7 @@ static void CBCalcPlacement( { InflateRect(lprEdit, -EDIT_CONTROL_PADDING(), -EDIT_CONTROL_PADDING()); } - + /* * Adjust the size of the listbox popup. */ @@ -410,7 +410,7 @@ static void CBCalcPlacement( /* * In the case of a dropdown, the popup listbox is offset to the right. - * so, we want to make sure it's flush with the right side of the + * so, we want to make sure it's flush with the right side of the * combobox */ if( CB_GETTYPE(lphc) == CBS_DROPDOWN ) @@ -422,11 +422,11 @@ static void CBCalcPlacement( TRACE("\ttext\t= (%i,%i-%i,%i)\n", lprEdit->left, lprEdit->top, lprEdit->right, lprEdit->bottom); - + TRACE("\tbutton\t= (%i,%i-%i,%i)\n", lprButton->left, lprButton->top, lprButton->right, lprButton->bottom); - - TRACE("\tlbox\t= (%i,%i-%i,%i)\n", + + TRACE("\tlbox\t= (%i,%i-%i,%i)\n", lprLB->left, lprLB->top, lprLB->right, lprLB->bottom ); } @@ -437,7 +437,7 @@ static void CBGetDroppedControlRect( LPHEADCOMBO lphc, LPRECT lpRect) { /* In windows, CB_GETDROPPEDCONTROLRECT returns the upper left corner of the combo box and the lower right corner of the listbox */ - + GetWindowRect(lphc->self, lpRect); lpRect->right = lpRect->left + lphc->droppedRect.right - lphc->droppedRect.left; @@ -446,7 +446,7 @@ static void CBGetDroppedControlRect( LPHEADCOMBO lphc, LPRECT lpRect) } /*********************************************************************** - * COMBO_WindowPosChanging + * COMBO_WindowPosChanging */ static LRESULT COMBO_WindowPosChanging( HWND hwnd, @@ -459,7 +459,7 @@ static LRESULT COMBO_WindowPosChanging( * always the same height. We have to make sure they are not resized * to another value. */ - if ( ( CB_GETTYPE(lphc) != CBS_SIMPLE ) && + if ( ( CB_GETTYPE(lphc) != CBS_SIMPLE ) && ((posChanging->flags & SWP_NOSIZE) == 0) ) { int newComboHeight; @@ -547,7 +547,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG /* create listbox popup */ - lbeStyle = (LBS_NOTIFY | WS_BORDER | WS_CLIPSIBLINGS | WS_CHILD) | + lbeStyle = (LBS_NOTIFY | WS_BORDER | WS_CLIPSIBLINGS | WS_CHILD) | (style & (WS_VSCROLL | CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)); if( lphc->dwStyle & CBS_SORT ) @@ -558,7 +558,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG lbeStyle |= LBS_NOINTEGRALHEIGHT; if( lphc->dwStyle & CBS_DISABLENOSCROLL ) lbeStyle |= LBS_DISABLENOSCROLL; - + if( CB_GETTYPE(lphc) == CBS_SIMPLE ) /* child listbox */ { lbeStyle |= WS_VISIBLE; @@ -576,12 +576,12 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG lphc->hWndLBox = CreateWindowExW(lbeExStyle, clbName, - NULL, - lbeStyle, - lphc->droppedRect.left, - lphc->droppedRect.top, - lphc->droppedRect.right - lphc->droppedRect.left, - lphc->droppedRect.bottom - lphc->droppedRect.top, + NULL, + lbeStyle, + lphc->droppedRect.left, + lphc->droppedRect.top, + lphc->droppedRect.right - lphc->droppedRect.left, + lphc->droppedRect.bottom - lphc->droppedRect.top, hwnd, (HMENU)ID_CB_LISTBOX, GetWindowLongA( hwnd, GWL_HINSTANCE ), lphc ); @@ -591,13 +591,13 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG lbeStyle = WS_CHILD | WS_VISIBLE | ES_NOHIDESEL | ES_LEFT | ES_COMBO; /* - * In Win95 look, the border fo the edit control is + * In Win95 look, the border fo the edit control is * provided by the combobox */ if (TWEAK_WineLook == WIN31_LOOK) lbeStyle |= WS_BORDER; - - if( lphc->wState & CBF_EDIT ) + + if( lphc->wState & CBF_EDIT ) { if( lphc->dwStyle & CBS_OEMCONVERT ) lbeStyle |= ES_OEMCONVERT; @@ -611,18 +611,18 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG if (!IsWindowEnabled(hwnd)) lbeStyle |= WS_DISABLED; lphc->hWndEdit = CreateWindowExW(0, - editName, - NULL, + editName, + NULL, lbeStyle, - lphc->textRect.left, lphc->textRect.top, + lphc->textRect.left, lphc->textRect.top, lphc->textRect.right - lphc->textRect.left, - lphc->textRect.bottom - lphc->textRect.top, + lphc->textRect.bottom - lphc->textRect.top, hwnd, (HMENU)ID_CB_EDIT, GetWindowLongA( hwnd, GWL_HINSTANCE ), NULL ); if( !lphc->hWndEdit ) bEdit = FALSE; - } + } if( bEdit ) { @@ -630,7 +630,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG { /* Now do the trick with parent */ SetParent(lphc->hWndLBox, HWND_DESKTOP); - /* + /* * If the combo is a dropdown, we must resize the control * to fit only the text area and button. To do this, * we send a dummy resize and the WM_WINDOWPOSCHANGING message @@ -657,11 +657,11 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG * Paint combo button (normal, pressed, and disabled states). */ static void CBPaintButton( - LPHEADCOMBO lphc, + LPHEADCOMBO lphc, HDC hdc, RECT rectButton) { - if( lphc->wState & CBF_NOREDRAW ) + if( lphc->wState & CBF_NOREDRAW ) return; if (TWEAK_WineLook == WIN31_LOOK) @@ -671,7 +671,7 @@ static void CBPaintButton( HDC hMemDC; HBRUSH hPrevBrush; COLORREF oldTextColor, oldBkColor; - + hPrevBrush = SelectObject(hdc, GetSysColorBrush(COLOR_BTNFACE)); @@ -684,26 +684,26 @@ static void CBPaintButton( rectButton.right-rectButton.left, rectButton.bottom-rectButton.top, PATCOPY ); - + if( (bBool = lphc->wState & CBF_BUTTONDOWN) ) { DrawEdge( hdc, &rectButton, EDGE_SUNKEN, BF_RECT ); - } - else + } + else { DrawEdge( hdc, &rectButton, EDGE_RAISED, BF_RECT ); } - + /* * Remove the edge of the button from the rectangle * and calculate the position of the bitmap. */ - InflateRect( &rectButton, -2, -2); - + InflateRect( &rectButton, -2, -2); + x = (rectButton.left + rectButton.right - CBitWidth) >> 1; y = (rectButton.top + rectButton.bottom - CBitHeight) >> 1; - - + + hMemDC = CreateCompatibleDC( hdc ); SelectObject( hMemDC, hComboBmp ); oldTextColor = SetTextColor( hdc, GetSysColor(COLOR_BTNFACE) ); @@ -732,7 +732,7 @@ static void CBPaintButton( DrawFrameControl(hdc, &rectButton, DFC_SCROLL, - buttonState); + buttonState); } } @@ -742,7 +742,7 @@ static void CBPaintButton( * Paint CBS_DROPDOWNLIST text field / update edit control contents. */ static void CBPaintText( - LPHEADCOMBO lphc, + LPHEADCOMBO lphc, HDC hdc, RECT rectEdit) { @@ -753,7 +753,7 @@ static void CBPaintText( TRACE("\n"); - /* follow Windows combobox that sends a bunch of text + /* follow Windows combobox that sends a bunch of text * inquiries to its listbox while processing WM_PAINT. */ if( (id = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0) ) != LB_ERR ) @@ -774,7 +774,7 @@ static void CBPaintText( { static const WCHAR empty_stringW[] = { 0 }; if( CB_HASSTRINGS(lphc) ) SetWindowTextW( lphc->hWndEdit, pText ? pText : empty_stringW ); - if( lphc->wState & CBF_FOCUSED ) + if( lphc->wState & CBF_FOCUSED ) SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, (LPARAM)(-1)); } else /* paint text field ourselves */ @@ -786,7 +786,7 @@ static void CBPaintText( * Give ourselves some space. */ InflateRect( &rectEdit, -1, -1 ); - + if( CB_OWNERDRAWN(lphc) ) { DRAWITEMSTRUCT dis; @@ -794,7 +794,7 @@ static void CBPaintText( UINT ctlid = GetWindowLongA( lphc->self, GWL_ID ); /* setup state for DRAWITEM message. Owner will highlight */ - if ( (lphc->wState & CBF_FOCUSED) && + if ( (lphc->wState & CBF_FOCUSED) && !(lphc->wState & CBF_DROPPED) ) itemState |= ODS_SELECTED | ODS_FOCUS; @@ -804,7 +804,7 @@ static void CBPaintText( * clip region. */ clipRegion = CreateRectRgnIndirect(&rectEdit); - + if (GetClipRgn(hdc, clipRegion)!=1) { DeleteObject(clipRegion); @@ -821,9 +821,9 @@ static void CBPaintText( dis.itemState = itemState; dis.hDC = hdc; dis.rcItem = rectEdit; - dis.itemData = SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, + dis.itemData = SendMessageW(lphc->hWndLBox, LB_GETITEMDATA, (WPARAM)id, 0 ); - + /* * Clip the DC and have the parent draw the item. */ @@ -836,33 +836,33 @@ static void CBPaintText( /* * Reset the clipping region. */ - SelectClipRgn(hdc, clipRegion); + SelectClipRgn(hdc, clipRegion); } else { static const WCHAR empty_stringW[] = { 0 }; - if ( (lphc->wState & CBF_FOCUSED) && + if ( (lphc->wState & CBF_FOCUSED) && !(lphc->wState & CBF_DROPPED) ) { /* highlight */ FillRect( hdc, &rectEdit, GetSysColorBrush(COLOR_HIGHLIGHT) ); SetBkColor( hdc, GetSysColor( COLOR_HIGHLIGHT ) ); SetTextColor( hdc, GetSysColor( COLOR_HIGHLIGHTTEXT ) ); - } - - ExtTextOutW( hdc, - rectEdit.left + 1, + } + + ExtTextOutW( hdc, + rectEdit.left + 1, rectEdit.top + 1, - ETO_OPAQUE | ETO_CLIPPED, + ETO_OPAQUE | ETO_CLIPPED, &rectEdit, pText ? pText : empty_stringW , size, NULL ); - + if(lphc->wState & CBF_FOCUSED && !(lphc->wState & CBF_DROPPED)) DrawFocusRect( hdc, &rectEdit ); } - - if( hPrevFont ) + + if( hPrevFont ) SelectObject(hdc, hPrevFont ); } if (pText) @@ -874,7 +874,7 @@ static void CBPaintText( */ static void CBPaintBorder( HWND hwnd, - LPHEADCOMBO lphc, + LPHEADCOMBO lphc, HDC hdc) { RECT clientRect; @@ -937,7 +937,7 @@ static HBRUSH COMBO_PrepareColors( /* * Catch errors. */ - if( !hBkgBrush ) + if( !hBkgBrush ) hBkgBrush = GetSysColorBrush(COLOR_WINDOW); return hBkgBrush; @@ -947,7 +947,7 @@ static HBRUSH COMBO_PrepareColors( * COMBO_EraseBackground */ static LRESULT COMBO_EraseBackground( - HWND hwnd, + HWND hwnd, LPHEADCOMBO lphc, HDC hParamDC) { @@ -956,14 +956,14 @@ static LRESULT COMBO_EraseBackground( if(lphc->wState & CBF_EDIT) return TRUE; - + hDC = (hParamDC) ? hParamDC : GetDC(hwnd); /* * Retrieve the background brush */ hBkgBrush = COMBO_PrepareColors(lphc, hDC); - + FillRect(hDC, &lphc->textRect, hBkgBrush); if (!hParamDC) @@ -979,7 +979,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC) { PAINTSTRUCT ps; HDC hDC; - + hDC = (hParamDC) ? hParamDC : BeginPaint( lphc->self, &ps); @@ -1019,7 +1019,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC) FrameRect( hDC, &rPadEdit, GetSysColorBrush(COLOR_WINDOW) ); } - + if( !(lphc->wState & CBF_EDIT) ) { /* @@ -1028,8 +1028,8 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC) if (TWEAK_WineLook == WIN31_LOOK) { HPEN hPrevPen = SelectObject( hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); - - Rectangle( hDC, + + Rectangle( hDC, lphc->textRect.left, lphc->textRect.top, lphc->textRect.right - 1, lphc->textRect.bottom - 1); @@ -1043,7 +1043,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC) SelectObject( hDC, hPrevBrush ); } - if( !hParamDC ) + if( !hParamDC ) EndPaint(lphc->self, &ps); return 0; @@ -1058,11 +1058,11 @@ static INT CBUpdateLBox( LPHEADCOMBO lphc, BOOL bSelect ) { INT length, idx; LPWSTR pText = NULL; - + idx = LB_ERR; length = SendMessageW( lphc->hWndEdit, WM_GETTEXTLENGTH, 0, 0 ); - if( length > 0 ) + if( length > 0 ) pText = HeapAlloc( GetProcessHeap(), 0, (length + 1) * sizeof(WCHAR)); TRACE("\t edit text length %i\n", length ); @@ -1124,7 +1124,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index ) /*********************************************************************** * CBDropDown - * + * * Show listbox popup. */ static void CBDropDown( LPHEADCOMBO lphc ) @@ -1159,7 +1159,7 @@ static void CBDropDown( LPHEADCOMBO lphc ) /* now set popup position */ GetWindowRect( lphc->self, &rect ); - + /* * If it's a dropdown, the listbox is offset */ @@ -1193,14 +1193,14 @@ static void CBDropDown( LPHEADCOMBO lphc ) if( (rect.bottom + nDroppedHeight) >= GetSystemMetrics( SM_CYSCREEN ) ) rect.bottom = rect.top - nDroppedHeight; - SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom, + SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom, lphc->droppedRect.right - lphc->droppedRect.left, nDroppedHeight, SWP_NOACTIVATE | SWP_SHOWWINDOW); if( !(lphc->wState & CBF_NOREDRAW) ) - RedrawWindow( lphc->self, NULL, 0, RDW_INVALIDATE | + RedrawWindow( lphc->self, NULL, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN ); EnableWindow( lphc->hWndLBox, TRUE ); @@ -1217,7 +1217,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton ) { HWND hWnd = lphc->self; - TRACE("[%04x]: sel ok? [%i] dropped? [%i]\n", + TRACE("[%04x]: sel ok? [%i] dropped? [%i]\n", lphc->self, (INT)ok, (INT)(lphc->wState & CBF_DROPPED)); CB_NOTIFY( lphc, (ok) ? CBN_SELENDOK : CBN_SELENDCANCEL ); @@ -1225,7 +1225,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton ) if( IsWindow( hWnd ) && CB_GETTYPE(lphc) != CBS_SIMPLE ) { - if( lphc->wState & CBF_DROPPED ) + if( lphc->wState & CBF_DROPPED ) { RECT rect; @@ -1241,7 +1241,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton ) { rect = lphc->buttonRect; } - else + else { if( bButton ) { @@ -1256,7 +1256,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton ) } if( bButton && !(lphc->wState & CBF_NOREDRAW) ) - RedrawWindow( hWnd, &rect, 0, RDW_INVALIDATE | + RedrawWindow( hWnd, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN ); CB_NOTIFY( lphc, CBN_CLOSEUP ); } @@ -1347,10 +1347,10 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd ) /* ">> 8" makes gcc generate jump-table instead of cmp ladder */ switch( HIWORD(wParam) >> 8 ) - { + { case (EN_SETFOCUS >> 8): - TRACE("[%04x]: edit [%04x] got focus\n", + TRACE("[%04x]: edit [%04x] got focus\n", lphc->self, lphc->hWndEdit ); COMBO_SetFocus( lphc ); @@ -1363,7 +1363,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd ) /* NOTE: it seems that Windows' edit control sends an * undocumented message WM_USER + 0x1B instead of this - * notification (only when it happens to be a part of + * notification (only when it happens to be a part of * the combo). ?? - AK. */ @@ -1376,7 +1376,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd ) * In some circumstances (when the selection of the combobox * is changed for example) we don't wans the EN_CHANGE notification * to be forwarded to the parent of the combobox. This code - * checks a flag that is set in these occasions and ignores the + * checks a flag that is set in these occasions and ignores the * notification. */ if (lphc->wState & CBF_NOLBSELECT) @@ -1416,7 +1416,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd ) case LBN_SELCHANGE: case LBN_SELCANCEL: - TRACE("[%04x]: lbox selection change [%04x]\n", + TRACE("[%04x]: lbox selection change [%04x]\n", lphc->self, lphc->wState ); if( HIWORD(wParam) == LBN_SELCHANGE) @@ -1433,7 +1433,7 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd ) InvalidateRect(lphc->self, &lphc->textRect, TRUE); } - /* do not roll up if selection is being tracked + /* do not roll up if selection is being tracked * by arrowkeys in the dropdown listbox */ if( ((lphc->wState & CBF_DROPPED) && !(lphc->wState & CBF_NOROLLUP)) ) { @@ -1595,11 +1595,11 @@ static LRESULT COMBO_GetText( LPHEADCOMBO lphc, INT N, LPARAM lParam, BOOL unico /*********************************************************************** * CBResetPos * - * This function sets window positions according to the updated + * This function sets window positions according to the updated * component placement struct. */ static void CBResetPos( - LPHEADCOMBO lphc, + LPHEADCOMBO lphc, LPRECT rectEdit, LPRECT rectLB, BOOL bRedraw) @@ -1610,7 +1610,7 @@ static void CBResetPos( * sizing messages */ if( lphc->wState & CBF_EDIT ) - SetWindowPos( lphc->hWndEdit, 0, + SetWindowPos( lphc->hWndEdit, 0, rectEdit->left, rectEdit->top, rectEdit->right - rectEdit->left, rectEdit->bottom - rectEdit->top, @@ -1618,8 +1618,8 @@ static void CBResetPos( SetWindowPos( lphc->hWndLBox, 0, rectLB->left, rectLB->top, - rectLB->right - rectLB->left, - rectLB->bottom - rectLB->top, + rectLB->right - rectLB->left, + rectLB->bottom - rectLB->top, SWP_NOACTIVATE | SWP_NOZORDER | ((bDrop) ? SWP_NOREDRAW : 0) ); if( bDrop ) @@ -1643,9 +1643,9 @@ static void CBResetPos( static void COMBO_Size( LPHEADCOMBO lphc ) { CBCalcPlacement(lphc->self, - lphc, - &lphc->textRect, - &lphc->buttonRect, + lphc, + &lphc->textRect, + &lphc->buttonRect, &lphc->droppedRect); CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE ); @@ -1675,11 +1675,11 @@ static void COMBO_Font( LPHEADCOMBO lphc, HFONT hFont, BOOL bRedraw ) if ( CB_GETTYPE(lphc) == CBS_SIMPLE) { CBCalcPlacement(lphc->self, - lphc, - &lphc->textRect, - &lphc->buttonRect, + lphc, + &lphc->textRect, + &lphc->buttonRect, &lphc->droppedRect); - + CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE ); } else @@ -1708,23 +1708,23 @@ static LRESULT COMBO_SetItemHeight( LPHEADCOMBO lphc, INT index, INT height ) if ( CB_GETTYPE(lphc) == CBS_SIMPLE) { CBCalcPlacement(lphc->self, - lphc, - &lphc->textRect, - &lphc->buttonRect, + lphc, + &lphc->textRect, + &lphc->buttonRect, &lphc->droppedRect); - + CBResetPos( lphc, &lphc->textRect, &lphc->droppedRect, TRUE ); } else { CBForceDummyResize(lphc); } - + lRet = height; } - } + } else if ( CB_OWNERDRAWN(lphc) ) /* set listbox item height */ - lRet = SendMessageW(lphc->hWndLBox, LB_SETITEMHEIGHT, + lRet = SendMessageW(lphc->hWndLBox, LB_SETITEMHEIGHT, (WPARAM)index, (LPARAM)height ); return lRet; } @@ -1833,10 +1833,10 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam ) { POINT pt; RECT lbRect; - + pt.x = LOWORD(lParam); pt.y = HIWORD(lParam); - + if( lphc->wState & CBF_BUTTONDOWN ) { BOOL bButton; @@ -1878,23 +1878,23 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, hwnd, SPY_GetMsgName(message, hwnd), wParam, lParam ); if( lphc || message == WM_NCCREATE ) - switch(message) - { + switch(message) + { /* System messages */ - case WM_NCCREATE: + case WM_NCCREATE: { LONG style = unicode ? ((LPCREATESTRUCTW)lParam)->style : ((LPCREATESTRUCTA)lParam)->style; return COMBO_NCCreate(hwnd, style); } - case WM_NCDESTROY: + case WM_NCDESTROY: COMBO_NCDestroy(lphc); break;/* -> DefWindowProc */ - case WM_CREATE: - { + case WM_CREATE: + { HWND hwndParent; LONG style; if(unicode) @@ -1942,7 +1942,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, */ /* fall through */ case WM_SIZE: - if( lphc->hWndLBox && + if( lphc->hWndLBox && !(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc ); return TRUE; case WM_SETFONT: @@ -1977,7 +1977,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, if (j == -1) return 0; return SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, j, 0); } - else if( lphc->wState & CBF_EDIT ) + else if( lphc->wState & CBF_EDIT ) { LRESULT ret; lphc->wState |= CBF_NOEDITNOTIFY; @@ -1990,7 +1990,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, case WM_CUT: case WM_PASTE: case WM_COPY: - if( lphc->wState & CBF_EDIT ) + if( lphc->wState & CBF_EDIT ) { return unicode ? SendMessageW(lphc->hWndEdit, message, wParam, lParam) : SendMessageA(lphc->hWndEdit, message, wParam, lParam); @@ -2004,7 +2004,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, return COMBO_ItemOp(lphc, message, lParam); case WM_ENABLE: if( lphc->wState & CBF_EDIT ) - EnableWindow( lphc->hWndEdit, (BOOL)wParam ); + EnableWindow( lphc->hWndEdit, (BOOL)wParam ); EnableWindow( lphc->hWndLBox, (BOOL)wParam ); /* Force the control to repaint when the enabled state changes. */ @@ -2046,15 +2046,15 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, return unicode ? SendMessageW(hwndTarget, message, wParam, lParam) : SendMessageA(hwndTarget, message, wParam, lParam); } - case WM_LBUTTONDOWN: + case WM_LBUTTONDOWN: if( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self ); if( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam ); return TRUE; case WM_LBUTTONUP: COMBO_LButtonUp( lphc ); return TRUE; - case WM_MOUSEMOVE: - if( lphc->wState & CBF_CAPTURE ) + case WM_MOUSEMOVE: + if( lphc->wState & CBF_CAPTURE ) COMBO_MouseMove( lphc, wParam, lParam ); return TRUE; @@ -2117,7 +2117,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, if( (INT)wParam >= 0 ) /* listbox item */ return SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0); return CBGetTextAreaHeight(hwnd, lphc); - case CB_RESETCONTENT16: + case CB_RESETCONTENT16: case CB_RESETCONTENT: SendMessageW(lphc->hWndLBox, LB_RESETCONTENT, 0, 0); if( (lphc->wState & CBF_EDIT) && CB_HASSTRINGS(lphc) ) @@ -2150,7 +2150,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, return CB_ERR; case CB_GETDROPPEDCONTROLRECT16: lParam = (LPARAM)MapSL(lParam); - if( lParam ) + if( lParam ) { RECT r; CBGetDroppedControlRect( lphc, &r ); @@ -2163,7 +2163,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, case CB_GETDROPPEDSTATE16: case CB_GETDROPPEDSTATE: return (lphc->wState & CBF_DROPPED) ? TRUE : FALSE; - case CB_DIR16: + case CB_DIR16: lParam = (LPARAM)MapSL(lParam); message = LB_DIR16; /* fall through */ @@ -2181,15 +2181,15 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, if( !(lphc->wState & CBF_DROPPED) ) CBDropDown( lphc ); } - else - if( lphc->wState & CBF_DROPPED ) + else + if( lphc->wState & CBF_DROPPED ) CBRollUp( lphc, FALSE, TRUE ); } return TRUE; - case CB_GETCOUNT16: + case CB_GETCOUNT16: case CB_GETCOUNT: return SendMessageW(lphc->hWndLBox, LB_GETCOUNT, 0, 0); - case CB_GETCURSEL16: + case CB_GETCURSEL16: case CB_GETCURSEL: return SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0); case CB_SETCURSEL16: @@ -2207,14 +2207,14 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, InvalidateRect(lphc->self, &lphc->textRect, TRUE); lphc->wState &= ~CBF_SELCHANGE; return lParam; - case CB_GETLBTEXT16: + case CB_GETLBTEXT16: wParam = (INT)(INT16)wParam; lParam = (LPARAM)MapSL(lParam); /* fall through */ case CB_GETLBTEXT: return unicode ? SendMessageW(lphc->hWndLBox, LB_GETTEXT, wParam, lParam) : SendMessageA(lphc->hWndLBox, LB_GETTEXT, wParam, lParam); - case CB_GETLBTEXTLEN16: + case CB_GETLBTEXTLEN16: wParam = (INT)(INT16)wParam; /* fall through */ case CB_GETLBTEXTLEN: @@ -2229,7 +2229,7 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, /* fall through */ case CB_SETITEMDATA: return SendMessageW(lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam); - case CB_GETEDITSEL16: + case CB_GETEDITSEL16: wParam = lParam = 0; /* just in case */ /* fall through */ case CB_GETEDITSEL: @@ -2237,9 +2237,9 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, if( lphc->wState & CBF_EDIT ) return SendMessageW(lphc->hWndEdit, EM_GETSEL, wParam, lParam); return CB_ERR; - case CB_SETEDITSEL16: + case CB_SETEDITSEL16: case CB_SETEDITSEL: - if( lphc->wState & CBF_EDIT ) + if( lphc->wState & CBF_EDIT ) return SendMessageW(lphc->hWndEdit, EM_SETSEL, (INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) ); return CB_ERR; diff --git a/controls/desktop.c b/controls/desktop.c index 73f00ea671a..f3df7b00250 100644 --- a/controls/desktop.c +++ b/controls/desktop.c @@ -91,7 +91,7 @@ static HBITMAP DESKTOP_LoadBitmap( HDC hdc, const char *filename ) _lclose( file ); fileHeader = (BITMAPFILEHEADER *)buffer; bitmapInfo = (BITMAPINFO *)(buffer + sizeof(BITMAPFILEHEADER)); - + /* Check header content */ if ((fileHeader->bfType != 0x4d42) || (size < fileHeader->bfSize)) { diff --git a/controls/edit.c b/controls/edit.c index d2be39e056d..2209a15ebe5 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -214,7 +214,7 @@ static void EDIT_MoveWordBackward(HWND hwnd, EDITSTATE *es, BOOL extend); static void EDIT_MoveWordForward(HWND hwnd, EDITSTATE *es, BOOL extend); static void EDIT_PaintLine(HWND hwnd, EDITSTATE *es, HDC hdc, INT line, BOOL rev); static INT EDIT_PaintText(EDITSTATE *es, HDC hdc, INT x, INT y, INT line, INT col, INT count, BOOL rev); -static void EDIT_SetCaretPos(HWND hwnd, EDITSTATE *es, INT pos, BOOL after_wrap); +static void EDIT_SetCaretPos(HWND hwnd, EDITSTATE *es, INT pos, BOOL after_wrap); static void EDIT_SetRectNP(HWND hwnd, EDITSTATE *es, LPRECT lprc); static void EDIT_UnlockBuffer(HWND hwnd, EDITSTATE *es, BOOL force); static void EDIT_UpdateScrollInfo(HWND hwnd, EDITSTATE *es); @@ -357,16 +357,16 @@ static inline void EDIT_WM_Cut(HWND hwnd, EDITSTATE *es) * * Returns the window version in case Wine emulates a later version * of windows then the application expects. - * + * * In a number of cases when windows runs an application that was * designed for an earlier windows version, windows reverts * to "old" behaviour of that earlier version. - * - * An example is a disabled edit control that needs to be painted. - * Old style behaviour is to send a WM_CTLCOLOREDIT message. This was - * changed in Win95, NT4.0 by a WM_CTLCOLORSTATIC message _only_ for + * + * An example is a disabled edit control that needs to be painted. + * Old style behaviour is to send a WM_CTLCOLOREDIT message. This was + * changed in Win95, NT4.0 by a WM_CTLCOLORSTATIC message _only_ for * applications with an expected version 0f 4.0 or higher. - * + * */ static DWORD get_app_version(void) { @@ -382,7 +382,7 @@ static DWORD get_app_version(void) dwEmulatedVersion = MAKELONG( info.dwMinorVersion, info.dwMajorVersion ); /* FIXME: this may not be 100% correct; see discussion on the * wine developer list in Nov 1999 */ - version = dwProcVersion < dwEmulatedVersion ? dwProcVersion : dwEmulatedVersion; + version = dwProcVersion < dwEmulatedVersion ? dwProcVersion : dwEmulatedVersion; } return version; } @@ -1002,8 +1002,8 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, result = EDIT_WM_LButtonUp(hwnd, es); break; - case WM_MBUTTONDOWN: - DPRINTF_EDIT_MSG32("WM_MBUTTONDOWN"); + case WM_MBUTTONDOWN: + DPRINTF_EDIT_MSG32("WM_MBUTTONDOWN"); result = EDIT_WM_MButtonDown(hwnd); break; @@ -1065,7 +1065,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, DPRINTF_EDIT_MSG32("WM_STYLECHANGED"); result = EDIT_WM_StyleChanged (hwnd, es, wParam, (const STYLESTRUCT *)lParam); break; - + case WM_STYLECHANGING: DPRINTF_EDIT_MSG32("WM_STYLECHANGING"); result = 0; /* See EDIT_WM_StyleChanged */ @@ -1173,11 +1173,11 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend /* Find starting line. istart must lie inside an existing line or * at the end of buffer */ do { - if (istart < current_line->index + current_line->length || + if (istart < current_line->index + current_line->length || current_line->ending == END_0) break; - - previous_line = current_line; + + previous_line = current_line; current_line = current_line->next; line_index++; } while (current_line); @@ -1208,7 +1208,7 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend { if (!current_line || current_line->index + delta > current_position - es->text) { - /* The buffer has been expanded, create a new line and + /* The buffer has been expanded, create a new line and insert it into the link list */ LINEDEF *new_line = HeapAlloc(GetProcessHeap(), 0, sizeof(LINEDEF)); new_line->next = previous_line->next; @@ -1288,15 +1288,15 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend prev = 1; } - /* If the first line we are calculating, wrapped before istart, we must + /* If the first line we are calculating, wrapped before istart, we must * adjust istart in order for this to be reflected in the update region. */ if (current_line->index == nstart_index && istart > current_line->index + prev) istart = current_line->index + prev; /* else if we are updating the previous line before the first line we * are re-calculating and it expanded */ - else if (current_line == start_line && + else if (current_line == start_line && current_line->index != nstart_index && orig_net_length < prev) - { + { /* Line expanded due to an upwards line wrap so we must partially include * previous line in update region */ nstart_line = line_index; @@ -1361,16 +1361,16 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend if (hrgn) { HRGN tmphrgn; - /* + /* * We calculate two rectangles. One for the first line which may have * an indent with respect to the format rect. The other is a format-width * rectangle that spans the rest of the lines that changed or moved. */ - rc.top = es->format_rect.top + nstart_line * es->line_height - + rc.top = es->format_rect.top + nstart_line * es->line_height - (es->y_offset * es->line_height); /* Adjust for vertical scrollbar */ rc.bottom = rc.top + es->line_height; - rc.left = es->format_rect.left + (INT)LOWORD(GetTabbedTextExtentW(dc, - es->text + nstart_index, istart - nstart_index, + rc.left = es->format_rect.left + (INT)LOWORD(GetTabbedTextExtentW(dc, + es->text + nstart_index, istart - nstart_index, es->tabs_count, es->tabs)) - es->x_offset; /* Adjust for horz scroll */ rc.right = es->format_rect.right; SetRectRgn(hrgn, rc.left, rc.top, rc.right, rc.bottom); @@ -1378,9 +1378,9 @@ static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es, INT istart, INT iend rc.top = rc.bottom; rc.left = es->format_rect.left; rc.right = es->format_rect.right; - /* - * If lines were added or removed we must re-paint the remainder of the - * lines since the remaining lines were either shifted up or down. + /* + * If lines were added or removed we must re-paint the remainder of the + * lines since the remaining lines were either shifted up or down. */ if (line_count < es->line_count) /* We added lines */ rc.bottom = es->line_count * es->line_height; @@ -2083,7 +2083,7 @@ static void EDIT_MovePageUp_ML(HWND hwnd, EDITSTATE *es, BOOL extend) * Move the caret one line up, on a column with the nearest * x coordinate on the screen (might be a different column). * - */ + */ static void EDIT_MoveUp_ML(HWND hwnd, EDITSTATE *es, BOOL extend) { INT s = es->selection_start; @@ -2533,7 +2533,7 @@ static INT CALLBACK EDIT_WordBreakProc(LPWSTR s, INT index, INT count, INT actio * EM_CHARFROMPOS * * returns line number (not index) in high-order word of result. - * NB : Q137805 is unclear about this. POINT * pointer in lParam apply + * NB : Q137805 is unclear about this. POINT * pointer in lParam apply * to Richedit, not to the edit control. Original documentation is valid. * FIXME: do the specs mean to return -1 if outside client area or * if outside formatting rectangle ??? @@ -3104,7 +3104,7 @@ static void EDIT_EM_ReplaceSel(HWND hwnd, EDITSTATE *es, BOOL can_undo, LPCWSTR INT s = min(es->selection_start, es->selection_end); hrgn = CreateRectRgn(0, 0, 0, 0); - EDIT_BuildLineDefs_ML(hwnd, es, s, s + strl, + EDIT_BuildLineDefs_ML(hwnd, es, s, s + strl, strl - abs(es->selection_end - es->selection_start), hrgn); } else @@ -3114,7 +3114,7 @@ static void EDIT_EM_ReplaceSel(HWND hwnd, EDITSTATE *es, BOOL can_undo, LPCWSTR es->flags |= EF_MODIFIED; if (send_update) es->flags |= EF_UPDATE; EDIT_EM_ScrollCaret(hwnd, es); - + /* force scroll info update */ EDIT_UpdateScrollInfo(hwnd, es); @@ -3431,7 +3431,7 @@ static void EDIT_EM_SetLimitText(EDITSTATE *es, INT limit) /********************************************************************* * * EM_SETMARGINS - * + * * EC_USEFONTINFO is used as a left or right value i.e. lParam and not as an * action wParam despite what the docs say. EC_USEFONTINFO means one third * of the char's width, according to the new docs. @@ -3521,11 +3521,11 @@ static void EDIT_EM_SetSel(HWND hwnd, EDITSTATE *es, UINT start, UINT end, BOOL if (end != old_start) { /* - * One can also do + * One can also do * ORDER_UINT32(end, old_start); * EDIT_InvalidateText(hwnd, es, start, end); * EDIT_InvalidateText(hwnd, es, old_start, old_end); - * in place of the following if statement. + * in place of the following if statement. */ if (old_start > end ) { @@ -3723,7 +3723,7 @@ static void EDIT_WM_Char(HWND hwnd, EDITSTATE *es, WCHAR c) case 0x18: /* ^X */ SendMessageW(hwnd, WM_CUT, 0, 0); break; - + default: if (!(es->style & ES_READONLY) && (c >= ' ') && (c != 127)) { WCHAR str[2]; @@ -4273,7 +4273,7 @@ static LRESULT EDIT_WM_KeyDown(HWND hwnd, EDITSTATE *es, INT key) DWORD dw = SendMessageW( hwndParent, DM_GETDEFID, 0, 0 ); if (HIWORD(dw) == DC_HASDEFID) { - SendMessageW( hwndParent, WM_COMMAND, + SendMessageW( hwndParent, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)GetDlgItem( hwndParent, LOWORD(dw) ) ); } @@ -4376,8 +4376,8 @@ static LRESULT EDIT_WM_LButtonUp(HWND hwndSelf, EDITSTATE *es) * */ static LRESULT EDIT_WM_MButtonDown(HWND hwnd) -{ - SendMessageW(hwnd,WM_PASTE,0,0); +{ + SendMessageW(hwnd,WM_PASTE,0,0); return 0; } @@ -4507,10 +4507,10 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, DWORD style, HWND hwndParent, BOOL un es->line_count = 1; /* - * In Win95 look and feel, the WS_BORDER style is replaced by the - * WS_EX_CLIENTEDGE style for the edit control. This gives the edit + * In Win95 look and feel, the WS_BORDER style is replaced by the + * WS_EX_CLIENTEDGE style for the edit control. This gives the edit * control a non client area. Not always. This coordinates in some - * way with the window creation code in dialog.c When making + * way with the window creation code in dialog.c When making * modifications please ensure that the code still works for edit * controls created directly with style 0x50800000, exStyle 0 ( * which should have a single pixel border) @@ -4643,7 +4643,7 @@ static void EDIT_WM_SetFocus(HWND hwnd, EDITSTATE *es) * * WM_SETFONT * - * With Win95 look the margins are set to default font value unless + * With Win95 look the margins are set to default font value unless * the system font (font == 0) is being set, in which case they are left * unchanged. * @@ -4773,7 +4773,7 @@ static void EDIT_WM_Size(HWND hwnd, EDITSTATE *es, UINT action, INT width, INT h * * It appears that the Windows version of the edit control allows the style * (as retrieved by GetWindowLong) to be any value and maintains an internal - * style variable which will generally be different. In this function we + * style variable which will generally be different. In this function we * update the internal style based on what changed in the externally visible * style. * @@ -4795,7 +4795,7 @@ static LRESULT EDIT_WM_StyleChanged (HWND hwnd, */ style_change_mask = ES_UPPERCASE | ES_LOWERCASE | ES_NUMBER; - if (es->style & ES_MULTILINE) + if (es->style & ES_MULTILINE) style_change_mask |= ES_WANTRETURN; new_style = style->styleNew & style_change_mask; @@ -4809,7 +4809,7 @@ static LRESULT EDIT_WM_StyleChanged (HWND hwnd, } else if (new_style & ES_LOWERCASE) { new_style &= ~ES_UPPERCASE; } - + es->style = (es->style & ~style_change_mask) | new_style; } else if (GWL_EXSTYLE == which) { ; /* FIXME - what is needed here */ diff --git a/controls/icontitle.c b/controls/icontitle.c index afe7dc50128..e24bb3f892f 100644 --- a/controls/icontitle.c +++ b/controls/icontitle.c @@ -142,10 +142,10 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive ) hBrush = GetSysColorBrush(COLOR_ACTIVECAPTION); textColor = GetSysColor(COLOR_CAPTIONTEXT); } - else + else { if( GetWindowLongA( hwnd, GWL_STYLE ) & WS_CHILD ) - { + { hBrush = (HBRUSH) GetClassLongA(hwnd, GCL_HBRBACKGROUND); if( hBrush ) { @@ -164,7 +164,7 @@ static BOOL ICONTITLE_Paint( HWND hwnd, HWND owner, HDC hDC, BOOL bActive ) else { hBrush = GetStockObject( BLACK_BRUSH ); - textColor = RGB( 0xFF, 0xFF, 0xFF ); + textColor = RGB( 0xFF, 0xFF, 0xFF ); } } diff --git a/controls/listbox.c b/controls/listbox.c index e5667cd071a..951f548357a 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -253,12 +253,12 @@ static void LISTBOX_UpdateScroll( HWND hwnd, LB_DESCR *descr ) if (!(descr->style & WS_VSCROLL)) return; */ - /* It is important that we check descr->style, and not wnd->dwStyle, - for WS_VSCROLL, as the former is exactly the one passed in - argument to CreateWindow. - In Windows (and from now on in Wine :) a listbox created - with such a style (no WS_SCROLL) does not update - the scrollbar with listbox-related data, thus letting + /* It is important that we check descr->style, and not wnd->dwStyle, + for WS_VSCROLL, as the former is exactly the one passed in + argument to CreateWindow. + In Windows (and from now on in Wine :) a listbox created + with such a style (no WS_SCROLL) does not update + the scrollbar with listbox-related data, thus letting the programmer use it for his/her own purposes. */ if (descr->style & LBS_NOREDRAW) return; @@ -1416,7 +1416,7 @@ static void LISTBOX_MoveCaret( HWND hwnd, LB_DESCR *descr, INT index, /* Important, repaint needs to be done in this order if you want to mimic Windows behavior: - 1. Remove the focus and paint the item + 1. Remove the focus and paint the item 2. Remove the selection and paint the item(s) 3. Set the selection and repaint the item(s) 4. Set the focus to 'index' and repaint the item */ @@ -2089,7 +2089,7 @@ static LRESULT LISTBOX_HandleLButtonDownCombo( HWND hwnd, LB_DESCR *pDescr, nHitTestType = HTHSCROLL; } } - /* Windows sends this message when a scrollbar is clicked + /* Windows sends this message when a scrollbar is clicked */ if(nHitTestType != 0) @@ -2097,7 +2097,7 @@ static LRESULT LISTBOX_HandleLButtonDownCombo( HWND hwnd, LB_DESCR *pDescr, SendMessageW(hwnd, WM_NCLBUTTONDOWN, nHitTestType, MAKELONG(screenMousePos.x, screenMousePos.y)); } - /* Resume the Capture after scrolling is complete + /* Resume the Capture after scrolling is complete */ if(hWndOldCapture != 0) { @@ -3196,7 +3196,7 @@ static LRESULT WINAPI ComboLBWndProc_common( HWND hwnd, UINT msg, /*********************************************************************** * ComboLBWndProcA * - * NOTE: in Windows, winproc address of the ComboLBox is the same + * NOTE: in Windows, winproc address of the ComboLBox is the same * as that of the Listbox. */ LRESULT WINAPI ComboLBWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) diff --git a/controls/menu.c b/controls/menu.c index f5a66834575..949d71bb379 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -169,7 +169,7 @@ static HFONT hMenuFontBold = 0; static HMENU MENU_DefSysPopup = 0; /* Default system menu popup */ /* Use global popup window because there's no way 2 menus can - * be tracked at the same time. */ + * be tracked at the same time. */ static HWND top_popup; /* Flag set by EndMenu() to force an exit from menu tracking */ @@ -210,7 +210,7 @@ const struct builtin_class_descr MENU_builtin_class = if (flags & (bit)) { flags &= ~(bit); MENUOUT ((text)); } \ } while (0) -static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, +static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, const char *postfix) { TRACE("%s ", prefix); @@ -298,7 +298,7 @@ static POPUPMENU *MENU_GetMenu(HMENU hMenu) POPUPMENU *menu = USER_HEAP_LIN_ADDR(hMenu); if (!menu || menu->wMagic != MENU_MAGIC) { - WARN("invalid menu handle=%x, ptr=%p, magic=%x\n", hMenu, menu, menu? menu->wMagic:0); + WARN("invalid menu handle=%x, ptr=%p, magic=%x\n", hMenu, menu, menu? menu->wMagic:0); menu = NULL; } return menu; @@ -349,8 +349,8 @@ static HMENU MENU_CopySysPopup(void) * * Create a copy of the system menu. System menu in Windows is * a special menu bar with the single entry - system menu popup. - * This popup is presented to the outside world as a "system menu". - * However, the real system menu handle is sometimes seen in the + * This popup is presented to the outside world as a "system menu". + * However, the real system menu handle is sometimes seen in the * WM_MENUSELECT parameters (and Word 6 likes it this way). */ HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu ) @@ -365,7 +365,7 @@ HMENU MENU_GetSysMenu( HWND hWnd, HMENU hPopupMenu ) if (hPopupMenu == (HMENU)(-1)) hPopupMenu = MENU_CopySysPopup(); - else if( !hPopupMenu ) hPopupMenu = MENU_DefSysPopup; + else if( !hPopupMenu ) hPopupMenu = MENU_DefSysPopup; if (hPopupMenu) { @@ -414,12 +414,12 @@ BOOL MENU_Init() } else return FALSE; - if (! (hBitmap = CreateBitmap( 8, 8, 1, 1, shade_bits))) + if (! (hBitmap = CreateBitmap( 8, 8, 1, 1, shade_bits))) return FALSE; - if(!(hShadeBrush = CreatePatternBrush( hBitmap ))) + if(!(hShadeBrush = CreatePatternBrush( hBitmap ))) return FALSE; - + DeleteObject( hBitmap ); if (!(MENU_DefSysPopup = MENU_CopySysPopup())) return FALSE; @@ -427,7 +427,7 @@ BOOL MENU_Init() ncm.cbSize = sizeof (NONCLIENTMETRICSA); if (!(SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSA), &ncm, 0))) return FALSE; - + if (!(hMenuFont = CreateFontIndirectA( &ncm.lfMenuFont ))) return FALSE; @@ -582,7 +582,7 @@ static MENUITEM *MENU_FindItem( HMENU *hmenu, UINT *nPos, UINT wFlags ) /*********************************************************************** * MENU_FindSubMenu * - * Find a Sub menu. Return the position of the submenu, and modifies + * Find a Sub menu. Return the position of the submenu, and modifies * *hmenu in case it is found in another sub-menu. * If the submenu cannot be found, NO_SELECTED_ITEM is returned. */ @@ -591,8 +591,8 @@ UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget ) POPUPMENU *menu; UINT i; MENUITEM *item; - if (((*hmenu)==0xffff) || - (!(menu = MENU_GetMenu(*hmenu)))) + if (((*hmenu)==0xffff) || + (!(menu = MENU_GetMenu(*hmenu)))) return NO_SELECTED_ITEM; item = menu->items; for (i = 0; i < menu->nItems; i++, item++) { @@ -625,11 +625,11 @@ static void MENU_FreeItemData( MENUITEM* item ) /*********************************************************************** * MENU_FindItemByCoords * - * Find the item at the specified coordinates (screen coords). Does - * not work for child windows and therefore should not be called for + * Find the item at the specified coordinates (screen coords). Does + * not work for child windows and therefore should not be called for * an arbitrary system menu. */ -static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu, +static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu, POINT pt, UINT *pos ) { MENUITEM *item; @@ -658,7 +658,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu, * Find the menu item selected by a key press. * Return item id, -1 if none, -2 if we should close the menu. */ -static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu, +static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu, UINT key, BOOL forceMenuChar ) { TRACE("\tlooking for '%c' in [%04x]\n", (char)key, (UINT16)hmenu ); @@ -690,7 +690,7 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu, } } } - menuchar = SendMessageA( hwndOwner, WM_MENUCHAR, + menuchar = SendMessageA( hwndOwner, WM_MENUCHAR, MAKEWPARAM( key, menu->wFlags ), hmenu ); if (HIWORD(menuchar) == 2) return LOWORD(menuchar); if (HIWORD(menuchar) == 1) return (UINT)(-2); @@ -853,7 +853,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, UINT check_bitmap_width = GetSystemMetrics( SM_CXMENUCHECK ); TRACE("dc=0x%04x owner=0x%04x (%d,%d)\n", hdc, hwndOwner, orgX, orgY); - debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem, + debug_print_menuitem("MENU_CalcItemSize: menuitem:", lpitem, (menuBar ? " (MenuBar)" : "")); SetRect( &lpitem->rect, orgX, orgY, orgX, orgY ); @@ -880,7 +880,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, if (menuBar) { lpitem->rect.right += MENU_BAR_ITEMS_SPACE; - + /* under at least win95 you seem to be given a standard height for the menu and the height value is ignored */ @@ -892,11 +892,11 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, } else lpitem->rect.bottom += mis.itemHeight; - + TRACE("id=%04x size=%dx%d\n", lpitem->wID, mis.itemWidth, mis.itemHeight); /* Fall through to get check/arrow width calculation. */ - } + } if (lpitem->fType & MF_SEPARATOR) { @@ -928,14 +928,14 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, lpitem->rect.bottom += 2; } } - + /* it must be a text item - unless it's the system menu */ if (!(lpitem->fType & MF_SYSMENU) && IS_STRING_ITEM( lpitem->fType )) { SIZE size; GetTextExtentPoint32W(hdc, lpitem->text, strlenW(lpitem->text), &size); - + lpitem->rect.right += size.cx; if (TWEAK_WineLook == WIN31_LOOK) lpitem->rect.bottom += max( size.cy, GetSystemMetrics(SM_CYMENU) ); @@ -958,7 +958,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, { if (strchrW( lpitem->text, '\b' )) lpitem->rect.right += MENU_TAB_SPACE; - lpitem->xTab = lpitem->rect.right - check_bitmap_width + lpitem->xTab = lpitem->rect.right - check_bitmap_width - arrow_bitmap_width; } } @@ -983,7 +983,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner ) hdc = GetDC( 0 ); SelectObject( hdc, hMenuFont); - + start = 0; maxX = (TWEAK_WineLook == WIN31_LOOK) ? GetSystemMetrics(SM_CXBORDER) : 2+1 ; @@ -1020,7 +1020,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner ) lpitem->rect.right = maxX; if (IS_STRING_ITEM(lpitem->fType) && lpitem->xTab) lpitem->xTab = maxTab; - + } lppop->Height = max( lppop->Height, orgY ); } @@ -1055,7 +1055,7 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect, if ((lprect == NULL) || (lppop == NULL)) return; if (lppop->nItems == 0) return; - TRACE("left=%d top=%d right=%d bottom=%d\n", + TRACE("left=%d top=%d right=%d bottom=%d\n", lprect->left, lprect->top, lprect->right, lprect->bottom); lppop->Width = lprect->right - lprect->left; lppop->Height = 0; @@ -1075,7 +1075,7 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect, if ((i != start) && (lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break; - TRACE("calling MENU_CalcItemSize org=(%d, %d)\n", + TRACE("calling MENU_CalcItemSize org=(%d, %d)\n", orgX, orgY ); debug_print_menuitem (" item: ", lpitem, ""); MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, TRUE ); @@ -1132,7 +1132,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, lpitem->fState & (MF_HILITE | MF_MOUSESELECT) ); else - NC_DrawSysButton( hwnd, hdc, + NC_DrawSysButton( hwnd, hdc, lpitem->fState & (MF_HILITE | MF_MOUSESELECT) ); } @@ -1167,7 +1167,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, dis.rcItem = lpitem->rect; TRACE("Ownerdraw: owner=%04x itemID=%d, itemState=%d, itemAction=%d, " "hwndItem=%04x, hdc=%04x, rcItem={%d,%d,%d,%d}\n", hwndOwner, - dis.itemID, dis.itemState, dis.itemAction, dis.hwndItem, + dis.itemID, dis.itemState, dis.itemAction, dis.hwndItem, dis.hDC, dis.rcItem.left, dis.rcItem.top, dis.rcItem.right, dis.rcItem.bottom); SendMessageA( hwndOwner, WM_DRAWITEM, 0, (LPARAM)&dis ); @@ -1209,14 +1209,14 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, /* vertical separator */ if (!menuBar && (lpitem->fType & MF_MENUBARBREAK)) { - if (TWEAK_WineLook > WIN31_LOOK) + if (TWEAK_WineLook > WIN31_LOOK) { RECT rc = rect; rc.top = 3; rc.bottom = height - 3; DrawEdge (hdc, &rc, EDGE_ETCHED, BF_LEFT); } - else + else { SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); MoveToEx( hdc, rect.left, 0, NULL ); @@ -1227,7 +1227,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, /* horizontal separator */ if (lpitem->fType & MF_SEPARATOR) { - if (TWEAK_WineLook > WIN31_LOOK) + if (TWEAK_WineLook > WIN31_LOOK) { RECT rc = rect; rc.left++; @@ -1235,7 +1235,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, rc.top += SEPARATOR_HEIGHT / 2; DrawEdge (hdc, &rc, EDGE_ETCHED, BF_TOP); } - else + else { SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); MoveToEx( hdc, rect.left, rect.top + SEPARATOR_HEIGHT/2, NULL ); @@ -1296,7 +1296,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, /* Draw the check mark * * FIXME: - * Custom checkmark bitmaps are monochrome but not always 1bpp. + * Custom checkmark bitmaps are monochrome but not always 1bpp. */ HBITMAP bm = (lpitem->fState & MF_CHECKED) ? lpitem->hCheckBit : lpitem->hUnCheckBit; if (bm) /* we have a custom bitmap */ @@ -1324,7 +1324,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, DeleteObject( bm ); } } - + /* Draw the popup-menu arrow */ if (lpitem->fType & MF_POPUP) { @@ -1360,7 +1360,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, { register int i; HFONT hfontOld = 0; - + UINT uFormat = (menuBar) ? DT_CENTER | DT_VCENTER | DT_SINGLELINE : DT_LEFT | DT_VCENTER | DT_SINGLELINE; @@ -1394,7 +1394,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, } SetTextColor(hdc, RGB(0x80, 0x80, 0x80)); } - + DrawTextW( hdc, lpitem->text, i, &rect, uFormat); /* paint the shortcut text */ @@ -1405,7 +1405,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, rect.left = lpitem->xTab; uFormat = DT_LEFT | DT_VCENTER | DT_SINGLELINE; } - else + else { uFormat = DT_RIGHT | DT_VCENTER | DT_SINGLELINE; } @@ -1424,7 +1424,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, DrawTextW( hdc, lpitem->text + i + 1, -1, &rect, uFormat ); } - if (hfontOld) + if (hfontOld) SelectObject (hdc, hfontOld); } } @@ -1444,17 +1444,17 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu ) GetClientRect( hwnd, &rect ); - if(TWEAK_WineLook == WIN31_LOOK) + if(TWEAK_WineLook == WIN31_LOOK) { rect.bottom -= POPUP_YSHADE * GetSystemMetrics(SM_CYBORDER); rect.right -= POPUP_XSHADE * GetSystemMetrics(SM_CXBORDER); - } + } - if((hPrevBrush = SelectObject( hdc, GetSysColorBrush(COLOR_MENU) )) + if((hPrevBrush = SelectObject( hdc, GetSysColorBrush(COLOR_MENU) )) && (SelectObject( hdc, hMenuFont))) { HPEN hPrevPen; - + Rectangle( hdc, rect.left, rect.top, rect.right, rect.bottom ); hPrevPen = SelectObject( hdc, GetStockObject( NULL_PEN ) ); @@ -1494,11 +1494,11 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu ) UINT u; for (u = menu->nItems, item = menu->items; u > 0; u--, item++) - MENU_DrawMenuItem( hwnd, hmenu, menu->hwndOwner, hdc, item, + MENU_DrawMenuItem( hwnd, hmenu, menu->hwndOwner, hdc, item, menu->Height, FALSE, ODA_DRAWENTIRE ); } - } else + } else { SelectObject( hdc, hPrevBrush ); } @@ -1543,13 +1543,13 @@ UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd, FillRect(hDC, lprect, GetSysColorBrush(COLOR_MENU) ); - if (TWEAK_WineLook == WIN31_LOOK) + if (TWEAK_WineLook == WIN31_LOOK) { SelectObject( hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); MoveToEx( hDC, lprect->left, lprect->bottom, NULL ); LineTo( hDC, lprect->right, lprect->bottom ); } - else + else { SelectObject( hDC, SYSCOLOR_GetPen(COLOR_3DFACE)); MoveToEx( hDC, lprect->left, lprect->bottom, NULL ); @@ -1605,7 +1605,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id, /* adjust popup menu pos so that it fits within the desktop */ width = menu->Width + GetSystemMetrics(SM_CXBORDER); - height = menu->Height + GetSystemMetrics(SM_CYBORDER); + height = menu->Height + GetSystemMetrics(SM_CYBORDER); if( x + width > GetSystemMetrics(SM_CXSCREEN )) { @@ -1670,7 +1670,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex, SelectObject( hdc, hMenuFont); /* Clear previous highlighted item */ - if (lppop->FocusedItem != NO_SELECTED_ITEM) + if (lppop->FocusedItem != NO_SELECTED_ITEM) { lppop->items[lppop->FocusedItem].fState &= ~(MF_HILITE|MF_MOUSESELECT); MENU_DrawMenuItem(lppop->hWnd, hmenu, hwndOwner, hdc,&lppop->items[lppop->FocusedItem], @@ -1680,18 +1680,18 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex, /* Highlight new item (if any) */ lppop->FocusedItem = wIndex; - if (lppop->FocusedItem != NO_SELECTED_ITEM) + if (lppop->FocusedItem != NO_SELECTED_ITEM) { if(!(lppop->items[wIndex].fType & MF_SEPARATOR)) { lppop->items[wIndex].fState |= MF_HILITE; - MENU_DrawMenuItem( lppop->hWnd, hmenu, hwndOwner, hdc, + MENU_DrawMenuItem( lppop->hWnd, hmenu, hwndOwner, hdc, &lppop->items[wIndex], lppop->Height, !(lppop->wFlags & MF_POPUP), ODA_SELECT ); } if (sendMenuSelect) { MENUITEM *ip = &lppop->items[lppop->FocusedItem]; - SendMessageA( hwndOwner, WM_MENUSELECT, + SendMessageA( hwndOwner, WM_MENUSELECT, MAKELONG(ip->fType & MF_POPUP ? wIndex: ip->wID, ip->fType | ip->fState | MF_MOUSESELECT | (lppop->wFlags & MF_SYSMENU)), hmenu); @@ -1703,7 +1703,7 @@ static void MENU_SelectItem( HWND hwndOwner, HMENU hmenu, UINT wIndex, if((pos=MENU_FindSubMenu(&topmenu, hmenu))!=NO_SELECTED_ITEM){ POPUPMENU *ptm = MENU_GetMenu( topmenu ); MENUITEM *ip = &ptm->items[pos]; - SendMessageA( hwndOwner, WM_MENUSELECT, MAKELONG(pos, + SendMessageA( hwndOwner, WM_MENUSELECT, MAKELONG(pos, ip->fType | ip->fState | MF_MOUSESELECT | (ptm->wFlags & MF_SYSMENU)), topmenu); } @@ -1733,7 +1733,7 @@ static void MENU_MoveSelection( HWND hwndOwner, HMENU hmenu, INT offset ) if ( menu->FocusedItem != NO_SELECTED_ITEM ) { if( menu->nItems == 1 ) return; else - for (i = menu->FocusedItem + offset ; i >= 0 && i < menu->nItems + for (i = menu->FocusedItem + offset ; i >= 0 && i < menu->nItems ; i += offset) if (!(menu->items[i].fType & MF_SEPARATOR)) { @@ -1742,7 +1742,7 @@ static void MENU_MoveSelection( HWND hwndOwner, HMENU hmenu, INT offset ) } } - for ( i = (offset > 0) ? 0 : menu->nItems - 1; + for ( i = (offset > 0) ? 0 : menu->nItems - 1; i >= 0 && i < menu->nItems ; i += offset) if (!(menu->items[i].fType & MF_SEPARATOR)) { @@ -1792,7 +1792,7 @@ static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT id, item->text = (LPWSTR)(HBITMAP)LOWORD(str); else item->text = NULL; - if (flags & MF_OWNERDRAW) + if (flags & MF_OWNERDRAW) item->dwItemData = (DWORD)str; else item->dwItemData = 0; @@ -1812,7 +1812,7 @@ static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT id, item->fState = 0; return FALSE; } - } + } item->wID = id; if (flags & MF_POPUP) @@ -1846,16 +1846,16 @@ static MENUITEM *MENU_InsertItem( HMENU hMenu, UINT pos, UINT flags ) MENUITEM *newItems; POPUPMENU *menu; - if (!(menu = MENU_GetMenu(hMenu))) + if (!(menu = MENU_GetMenu(hMenu))) return NULL; /* Find where to insert new item */ if (flags & MF_BYPOSITION) { - if (pos > menu->nItems) + if (pos > menu->nItems) pos = menu->nItems; } else { - if (!MENU_FindItem( &hMenu, &pos, flags )) + if (!MENU_FindItem( &hMenu, &pos, flags )) pos = menu->nItems; else { if (!(menu = MENU_GetMenu( hMenu ))) @@ -2082,7 +2082,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu, rect = item->rect; /* correct item if modified as a reaction to WM_INITMENUPOPUP message */ - if (!(item->fState & MF_HILITE)) + if (!(item->fState & MF_HILITE)) { if (menu->wFlags & MF_POPUP) hdc = GetDC( menu->hWnd ); else hdc = GetDCEx( menu->hWnd, 0, DCX_CACHE | DCX_WINDOW); @@ -2090,7 +2090,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu, SelectObject( hdc, hMenuFont); item->fState |= MF_HILITE; - MENU_DrawMenuItem( menu->hWnd, hmenu, hwndOwner, hdc, item, menu->Height, !(menu->wFlags & MF_POPUP), ODA_DRAWENTIRE ); + MENU_DrawMenuItem( menu->hWnd, hmenu, hwndOwner, hdc, item, menu->Height, !(menu->wFlags & MF_POPUP), ODA_DRAWENTIRE ); ReleaseDC( menu->hWnd, hdc ); } if (!item->rect.top && !item->rect.left && !item->rect.bottom && !item->rect.right) @@ -2194,7 +2194,7 @@ static INT MENU_ExecFocusedItem( MTRACKER* pmt, HMENU hMenu, UINT wFlags ) TRACE("%p hmenu=0x%04x\n", pmt, hMenu); - if (!menu || !menu->nItems || + if (!menu || !menu->nItems || (menu->FocusedItem == NO_SELECTED_ITEM)) return -1; item = &menu->items[menu->FocusedItem]; @@ -2206,8 +2206,8 @@ static INT MENU_ExecFocusedItem( MTRACKER* pmt, HMENU hMenu, UINT wFlags ) { if (!(item->fState & (MF_GRAYED | MF_DISABLED)) && !(item->fType & MF_SEPARATOR)) { - /* If TPM_RETURNCMD is set you return the id, but - do not send a message to the owner */ + /* If TPM_RETURNCMD is set you return the id, but + do not send a message to the owner */ if(!(wFlags & TPM_RETURNCMD)) { if( menu->wFlags & MF_SYSMENU ) @@ -2282,11 +2282,11 @@ static BOOL MENU_ButtonDown( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags ) /* In win31, a newly popped menu always remains opened for the next buttonup */ if(TWEAK_WineLook == WIN31_LOOK) - ptmenu->bTimeToHide = FALSE; + ptmenu->bTimeToHide = FALSE; } return TRUE; - } + } /* Else the click was on the menu bar, finish the tracking */ } return FALSE; @@ -2349,13 +2349,13 @@ static BOOL MENU_MouseMove( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags ) id = 0; else MENU_FindItemByCoords( ptmenu, pmt->pt, &id ); - } + } if( id == NO_SELECTED_ITEM ) { - MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu, + MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu, NO_SELECTED_ITEM, TRUE, pmt->hTopMenu); - + } else if( ptmenu->FocusedItem != id ) { @@ -2443,21 +2443,21 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk ) if( hNewMenu != pmt->hTopMenu ) { - MENU_SelectItem( pmt->hOwnerWnd, pmt->hTopMenu, NO_SELECTED_ITEM, + MENU_SelectItem( pmt->hOwnerWnd, pmt->hTopMenu, NO_SELECTED_ITEM, FALSE, 0 ); - if( pmt->hCurrentMenu != pmt->hTopMenu ) + if( pmt->hCurrentMenu != pmt->hTopMenu ) MENU_HideSubPopups( pmt->hOwnerWnd, pmt->hTopMenu, FALSE ); } if( hNewWnd != pmt->hOwnerWnd ) { - ReleaseCapture(); + ReleaseCapture(); pmt->hOwnerWnd = hNewWnd; EVENT_Capture( pmt->hOwnerWnd, HTMENU ); } pmt->hTopMenu = pmt->hCurrentMenu = hNewMenu; /* all subpopups are hidden */ - MENU_SelectItem( pmt->hOwnerWnd, pmt->hTopMenu, id, TRUE, 0 ); + MENU_SelectItem( pmt->hOwnerWnd, pmt->hTopMenu, id, TRUE, 0 ); return TRUE; } @@ -2505,7 +2505,7 @@ static BOOL MENU_SuspendPopup( MTRACKER* pmt, UINT16 uMsg ) /*********************************************************************** * MENU_KeyEscape * - * Handle a VK_ESCAPE key event in a menu. + * Handle a VK_ESCAPE key event in a menu. */ static BOOL MENU_KeyEscape(MTRACKER* pmt, UINT wFlags) { @@ -2540,7 +2540,7 @@ static BOOL MENU_KeyEscape(MTRACKER* pmt, UINT wFlags) /*********************************************************************** * MENU_KeyLeft * - * Handle a VK_LEFT key event in a menu. + * Handle a VK_LEFT key event in a menu. */ static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags ) { @@ -2552,9 +2552,9 @@ static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags ) menu = MENU_GetMenu( hmenutmp ); /* Try to move 1 column left (if possible) */ - if( (prevcol = MENU_GetStartOfPrevColumn( pmt->hCurrentMenu )) != + if( (prevcol = MENU_GetStartOfPrevColumn( pmt->hCurrentMenu )) != NO_SELECTED_ITEM ) { - + MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu, prevcol, TRUE, 0 ); return; @@ -2568,7 +2568,7 @@ static void MENU_KeyLeft( MTRACKER* pmt, UINT wFlags ) } MENU_HideSubPopups( pmt->hOwnerWnd, hmenuprev, TRUE ); - pmt->hCurrentMenu = hmenuprev; + pmt->hCurrentMenu = hmenuprev; if ( (hmenuprev == pmt->hTopMenu) && !(menu->wFlags & MF_POPUP) ) { @@ -2619,7 +2619,7 @@ static void MENU_KeyRight( MTRACKER* pmt, UINT wFlags ) } /* Check to see if there's another column */ - if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) != + if( (nextcol = MENU_GetStartOfNextColumn( pmt->hCurrentMenu )) != NO_SELECTED_ITEM ) { TRACE("Going to %d.\n", nextcol ); MENU_SelectItem( pmt->hOwnerWnd, pmt->hCurrentMenu, @@ -2641,7 +2641,7 @@ static void MENU_KeyRight( MTRACKER* pmt, UINT wFlags ) if( hmenutmp || pmt->trackFlags & TF_SUSPENDPOPUP ) if( !MENU_SuspendPopup(pmt, WM_KEYDOWN) ) - pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, + pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, pmt->hTopMenu, TRUE, wFlags); } } @@ -2675,11 +2675,11 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, fEndMenu = FALSE; if (!(menu = MENU_GetMenu( hmenu ))) return FALSE; - if (wFlags & TPM_BUTTONDOWN) + if (wFlags & TPM_BUTTONDOWN) { /* Get the result in order to start the tracking or not */ fRemove = MENU_ButtonDown( &mt, hmenu, wFlags ); - fEndMenu = !fRemove; + fEndMenu = !fRemove; } EVENT_Capture( mt.hOwnerWnd, HTMENU ); @@ -2714,14 +2714,14 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, } /* check if EndMenu() tried to cancel us, by posting this message */ - if(msg.message == WM_CANCELMODE) + if(msg.message == WM_CANCELMODE) { /* we are now out of the loop */ fEndMenu = TRUE; /* remove the message from the queue */ PeekMessageA( &msg, 0, msg.message, msg.message, PM_REMOVE ); - + /* break out of internal loop, ala ESCAPE */ break; } @@ -2735,9 +2735,9 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, fRemove = FALSE; if ((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST)) { - /* + /* * use the mouse coordinates in lParam instead of those in the MSG - * struct to properly handle synthetic messages. lParam coords are + * struct to properly handle synthetic messages. lParam coords are * relative to client area, so they must be converted; since they can * be negative, we must use SLOWORD/SHIWORD instead of LOWORD/HIWORD. */ @@ -2763,7 +2763,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, fRemove = MENU_ButtonDown( &mt, hmenu, wFlags ); fEndMenu = !fRemove; break; - + case WM_RBUTTONUP: if (!(wFlags & TPM_RIGHTBUTTON)) break; /* fall through */ @@ -2782,13 +2782,13 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, with the menu tracking. If not, stop it */ else fEndMenu = ((wFlags & TPM_POPUPMENU) ? FALSE : TRUE); - + break; - + case WM_MOUSEMOVE: /* In win95 winelook, the selected menu item must be changed every time the mouse moves. In Win31 winelook, the mouse button has to be held down */ - + if ( hmenu && ((TWEAK_WineLook > WIN31_LOOK) || ( (msg.wParam & MK_LBUTTON) || ((wFlags & TPM_RIGHTBUTTON) && (msg.wParam & MK_RBUTTON)))) ) @@ -2807,11 +2807,11 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, { case VK_HOME: case VK_END: - MENU_SelectItem( mt.hOwnerWnd, mt.hCurrentMenu, + MENU_SelectItem( mt.hOwnerWnd, mt.hCurrentMenu, NO_SELECTED_ITEM, FALSE, 0 ); /* fall through */ case VK_UP: - MENU_MoveSelection( mt.hOwnerWnd, mt.hCurrentMenu, + MENU_MoveSelection( mt.hOwnerWnd, mt.hCurrentMenu, (msg.wParam == VK_HOME)? ITEM_NEXT : ITEM_PREV ); break; @@ -2827,11 +2827,11 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, case VK_LEFT: MENU_KeyLeft( &mt, wFlags ); break; - + case VK_RIGHT: MENU_KeyRight( &mt, wFlags ); break; - + case VK_ESCAPE: fEndMenu = MENU_KeyEscape(&mt, wFlags); break; @@ -2841,10 +2841,10 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, HELPINFO hi; hi.cbSize = sizeof(HELPINFO); hi.iContextType = HELPINFO_MENUITEM; - if (menu->FocusedItem == NO_SELECTED_ITEM) + if (menu->FocusedItem == NO_SELECTED_ITEM) hi.iCtrlId = 0; - else - hi.iCtrlId = menu->items[menu->FocusedItem].wID; + else + hi.iCtrlId = menu->items[menu->FocusedItem].wID; hi.hItemHandle = hmenu; hi.dwContextId = menu->dwContextHelpID; hi.MousePos = msg.pt; @@ -2863,7 +2863,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, case VK_MENU: fEndMenu = TRUE; break; - + } break; /* WM_SYSKEYDOWN */ @@ -2883,7 +2883,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, /* We will find a better way real soon... */ if ((msg.wParam <= 32) || (msg.wParam >= 127)) break; - pos = MENU_FindItemByKey( mt.hOwnerWnd, mt.hCurrentMenu, + pos = MENU_FindItemByKey( mt.hOwnerWnd, mt.hCurrentMenu, LOWORD(msg.wParam), FALSE ); if (pos == (UINT)-2) fEndMenu = TRUE; else if (pos == (UINT)-1) MessageBeep(0); @@ -2894,7 +2894,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, executedMenuId = MENU_ExecFocusedItem(&mt,mt.hCurrentMenu, wFlags); fEndMenu = (executedMenuId != -1); } - } + } break; } /* switch(msg.message) - kbd */ } @@ -2926,7 +2926,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, { MENU_HideSubPopups( mt.hOwnerWnd, mt.hTopMenu, FALSE ); - if (menu && menu->wFlags & MF_POPUP) + if (menu && menu->wFlags & MF_POPUP) { DestroyWindow( menu->hWnd ); menu->hWnd = 0; @@ -2967,7 +2967,7 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags) Recalculate menu sizes else clicks will not work */ SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); - + } } return TRUE; @@ -3185,9 +3185,9 @@ UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth, if (!(lppop = MENU_GetMenu( GetMenu(hwnd) ))) return 0; hdc = GetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW ); - SelectObject( hdc, hMenuFont); + SelectObject( hdc, hMenuFont); SetRect(&rectBar, orgX, orgY, orgX+menubarWidth, orgY+GetSystemMetrics(SM_CYMENU)); - MENU_MenuBarCalcSize( hdc, &rectBar, lppop, hwnd ); + MENU_MenuBarCalcSize( hdc, &rectBar, lppop, hwnd ); ReleaseDC( hwnd, hdc ); return lppop->Height; } @@ -3305,11 +3305,11 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags ) MENUITEM *item; POPUPMENU *menu; - TRACE("(%04x, %04X, %04X) !\n", + TRACE("(%04x, %04X, %04X) !\n", hMenu, wItemID, wFlags); /* Get the Popupmenu to access the owner menu */ - if (!(menu = MENU_GetMenu(hMenu))) + if (!(menu = MENU_GetMenu(hMenu))) return (UINT)-1; if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) @@ -3319,7 +3319,7 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags ) item->fState ^= (oldflags ^ wFlags) & (MF_GRAYED | MF_DISABLED); /* In win95 if the close item in the system menu change update the close button */ - if (TWEAK_WineLook == WIN95_LOOK) + if (TWEAK_WineLook == WIN95_LOOK) if((item->wID == SC_CLOSE) && (oldflags != wFlags)) { if (menu->hSysMenuOwner != 0) @@ -3327,7 +3327,7 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags ) POPUPMENU* parentMenu; /* Get the parent menu to access*/ - if (!(parentMenu = MENU_GetMenu(menu->hSysMenuOwner))) + if (!(parentMenu = MENU_GetMenu(menu->hSysMenuOwner))) return (UINT)-1; /* Refresh the frame to reflect the change*/ @@ -3335,7 +3335,7 @@ UINT WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags ) SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER); } } - + return oldflags; } @@ -3353,12 +3353,12 @@ INT16 WINAPI GetMenuString16( HMENU16 hMenu, UINT16 wItemID, /******************************************************************* * GetMenuStringA (USER32.@) */ -INT WINAPI GetMenuStringA( +INT WINAPI GetMenuStringA( HMENU hMenu, /* [in] menuhandle */ UINT wItemID, /* [in] menu item (dep. on wFlags) */ LPSTR str, /* [out] outbuffer. If NULL, func returns entry length*/ INT nMaxSiz, /* [in] length of buffer. if 0, func returns entry len*/ - UINT wFlags /* [in] MF_ flags */ + UINT wFlags /* [in] MF_ flags */ ) { MENUITEM *item; @@ -3401,7 +3401,7 @@ BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID, UINT wHilite ) { LPPOPUPMENU menu; - TRACE("(%04x, %04x, %04x, %04x);\n", + TRACE("(%04x, %04x, %04x, %04x);\n", hWnd, hMenu, wItemID, wHilite); if (!MENU_FindItem( &hMenu, &wItemID, wHilite )) return FALSE; if (!(menu = MENU_GetMenu(hMenu))) return FALSE; @@ -3427,7 +3427,7 @@ UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags ) UINT WINAPI GetMenuState( HMENU hMenu, UINT wItemID, UINT wFlags ) { MENUITEM *item; - TRACE("(menu=%04x, id=%04x, flags=%04x);\n", + TRACE("(menu=%04x, id=%04x, flags=%04x);\n", hMenu, wItemID, wFlags); if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return -1; debug_print_menuitem (" item: ", item, ""); @@ -3454,7 +3454,7 @@ INT16 WINAPI GetMenuItemCount16( HMENU16 hMenu ) { LPPOPUPMENU menu = MENU_GetMenu(hMenu); if (!menu) return -1; - TRACE("(%04x) returning %d\n", + TRACE("(%04x) returning %d\n", hMenu, menu->nItems ); return menu->nItems; } @@ -3467,7 +3467,7 @@ INT WINAPI GetMenuItemCount( HMENU hMenu ) { LPPOPUPMENU menu = MENU_GetMenu(hMenu); if (!menu) return -1; - TRACE("(%04x) returning %d\n", + TRACE("(%04x) returning %d\n", hMenu, menu->nItems ); return menu->nItems; } @@ -3612,7 +3612,7 @@ BOOL WINAPI RemoveMenu( HMENU hMenu, UINT nPos, UINT wFlags ) TRACE("(menu=%04x pos=%04x flags=%04x)\n",hMenu, nPos, wFlags); if (!(item = MENU_FindItem( &hMenu, &nPos, wFlags ))) return FALSE; if (!(menu = MENU_GetMenu(hMenu))) return FALSE; - + /* Remove item */ MENU_FreeItemData( item ); @@ -3884,20 +3884,20 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert ) { if( bRevert ) { - DestroyMenu(wndPtr->hSysMenu); + DestroyMenu(wndPtr->hSysMenu); wndPtr->hSysMenu = 0; } else { POPUPMENU *menu = MENU_GetMenu( wndPtr->hSysMenu ); - if( menu ) + if( menu ) { if( menu->nItems > 0 && menu->items[0].hSubMenu == MENU_DefSysPopup ) menu->items[0].hSubMenu = MENU_CopySysPopup(); } - else + else { - WARN("Current sys-menu (%04x) of wnd %04x is broken\n", + WARN("Current sys-menu (%04x) of wnd %04x is broken\n", wndPtr->hSysMenu, hWnd); wndPtr->hSysMenu = 0; } @@ -3945,7 +3945,7 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu ) /********************************************************************** * GetMenu (USER32.@) */ -HMENU WINAPI GetMenu( HWND hWnd ) +HMENU WINAPI GetMenu( HWND hWnd ) { HMENU retvalue = (HMENU)GetWindowLongA( hWnd, GWL_ID ); TRACE("for %04x returning %04x\n", hWnd, retvalue); @@ -4033,7 +4033,7 @@ BOOL WINAPI DrawMenuBar( HWND hWnd ) * DrawMenuBarTemp (USER32.@) * * UNDOCUMENTED !! - * + * * called by W98SE desk.cpl Control Panel Applet * * Not 100% sure about the param names, but close. @@ -4314,7 +4314,7 @@ static BOOL GetMenuItemInfo_common ( HMENU hmenu, UINT item, BOOL bypos, BOOL WINAPI GetMenuItemInfoA( HMENU hmenu, UINT item, BOOL bypos, LPMENUITEMINFOA lpmii) { - return GetMenuItemInfo_common (hmenu, item, bypos, + return GetMenuItemInfo_common (hmenu, item, bypos, (LPMENUITEMINFOW)lpmii, FALSE); } @@ -4371,7 +4371,7 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu, menu->text = NULL; } - /* make only MENU_ITEM_TYPE bits in menu->fType equal lpmii->fType */ + /* make only MENU_ITEM_TYPE bits in menu->fType equal lpmii->fType */ menu->fType &= ~MENU_ITEM_TYPE(menu->fType); menu->fType |= MENU_ITEM_TYPE(lpmii->fType); @@ -4445,10 +4445,10 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu, * SetMenuItemInfoA (USER32.@) */ BOOL WINAPI SetMenuItemInfoA(HMENU hmenu, UINT item, BOOL bypos, - const MENUITEMINFOA *lpmii) + const MENUITEMINFOA *lpmii) { if ((lpmii->fType & (MF_HILITE|MF_POPUP)) || (lpmii->fState)) { - /* QuickTime does pass invalid data into SetMenuItemInfo. + /* QuickTime does pass invalid data into SetMenuItemInfo. * do some of the checks Windows does. */ WARN("Bad masks for type (0x%08x) or state (0x%08x)\n", @@ -4479,7 +4479,7 @@ BOOL WINAPI SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT bypos) UINT i; POPUPMENU *menu; MENUITEM *item; - + TRACE("(0x%x,%d,%d)\n", hmenu, uItem, bypos); if (!(menu = MENU_GetMenu(hmenu))) return FALSE; @@ -4490,7 +4490,7 @@ BOOL WINAPI SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT bypos) { item->fState &= ~MFS_DEFAULT; } - + /* no default item */ if ( -1 == uItem) { @@ -4514,7 +4514,7 @@ BOOL WINAPI SetMenuDefaultItem(HMENU hmenu, UINT uItem, UINT bypos) return TRUE; } } - + } return FALSE; } @@ -4534,16 +4534,16 @@ UINT WINAPI GetMenuDefaultItem(HMENU hmenu, UINT bypos, UINT flags) /* find default item */ item = menu->items; - + /* empty menu */ if (! item) return -1; - + while ( !( item->fState & MFS_DEFAULT ) ) { i++; item++; if (i >= menu->nItems ) return -1; } - + /* default: don't return disabled items */ if ( (!(GMDI_USEDISABLED & flags)) && (item->fState & MFS_DISABLED )) return -1; @@ -4660,10 +4660,10 @@ BOOL16 WINAPI CheckMenuRadioItem16(HMENU16 hMenu, /********************************************************************** * GetMenuItemRect (USER32.@) * - * ATTENTION: Here, the returned values in rect are the screen - * coordinates of the item just like if the menu was + * ATTENTION: Here, the returned values in rect are the screen + * coordinates of the item just like if the menu was * always on the upper left side of the application. - * + * */ BOOL WINAPI GetMenuItemRect (HWND hwnd, HMENU hMenu, UINT uItem, LPRECT rect) @@ -4680,7 +4680,7 @@ BOOL WINAPI GetMenuItemRect (HWND hwnd, HMENU hMenu, UINT uItem, if(!hwnd) { itemMenu = MENU_GetMenu(hMenu); - if (itemMenu == NULL) + if (itemMenu == NULL) return FALSE; if(itemMenu->hWnd == 0) @@ -4688,7 +4688,7 @@ BOOL WINAPI GetMenuItemRect (HWND hwnd, HMENU hMenu, UINT uItem, referenceHwnd = itemMenu->hWnd; } - if ((rect == NULL) || (item == NULL)) + if ((rect == NULL) || (item == NULL)) return FALSE; *rect = item->rect; @@ -4803,7 +4803,7 @@ DWORD WINAPI GetMenuContextHelpId16( HMENU16 hMenu ) { return GetMenuContextHelpId( hMenu ); } - + /********************************************************************** * GetMenuContextHelpId (USER32.@) */ @@ -4966,11 +4966,11 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA } else { - /* some reasons for NOT sending the WM_{SYS}COMMAND message: + /* some reasons for NOT sending the WM_{SYS}COMMAND message: * #0: unknown (please report!) * #1: for WM_KEYUP,WM_SYSKEYUP * #2: mouse is captured - * #3: window is disabled + * #3: window is disabled * #4: it's a disabled system menu option * #5: it's a menu option, but window is iconic * #6: it's a menu option, but disabled diff --git a/controls/scroll.c b/controls/scroll.c index 9ae664d4c2f..7143c567147 100644 --- a/controls/scroll.c +++ b/controls/scroll.c @@ -111,9 +111,9 @@ static BOOL SCROLL_trackVertical; static BOOL SCROLL_MovingThumb = FALSE; /* Local functions */ -static BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar, +static BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar, BOOL fShowH, BOOL fShowV ); -static INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, +static INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, const SCROLLINFO *info, INT *action ); static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar, RECT *rect, INT arrowSize, @@ -519,7 +519,7 @@ static void SCROLL_DrawMovingThumb_31( HDC hdc, RECT *rect, BOOL vertical, r.left = rect->left + arrowSize - SCROLL_ARROW_THUMB_OVERLAP; if (r.left + thumbSize > rect->right - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP)) - r.left = rect->right - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP) + r.left = rect->right - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP) - thumbSize; r.right = r.left + thumbSize; } @@ -549,7 +549,7 @@ static void SCROLL_DrawMovingThumb_9x( HDC hdc, RECT *rect, BOOL vertical, SCROLL_DrawInterior_9x( SCROLL_TrackingWin, hdc, SCROLL_TrackingBar, rect, arrowSize, thumbSize, pos, 0, vertical, FALSE, FALSE ); - + SCROLL_MovingThumb = !SCROLL_MovingThumb; } @@ -567,7 +567,7 @@ static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical, * * Draw the scroll bar interior (everything except the arrows). */ -static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar, +static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar, RECT *rect, INT arrowSize, INT thumbSize, INT thumbPos, UINT flags, BOOL vertical, @@ -582,7 +582,7 @@ static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar, * to correctly setup default scrollbar colors */ if (nBar == SB_CTL) - { + { hBrush = (HBRUSH)SendMessageA( GetParent(hwnd), WM_CTLCOLORSCROLLBAR, (WPARAM)hdc,(LPARAM)hwnd); } @@ -656,7 +656,7 @@ static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar, } -static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar, +static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar, RECT *rect, INT arrowSize, INT thumbSize, INT thumbPos, UINT flags, BOOL vertical, @@ -685,11 +685,11 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar, * The window-owned scrollbars need to call DEFWND_ControlColor * to correctly setup default scrollbar colors */ - if (nBar == SB_CTL) { + if (nBar == SB_CTL) { hBrush = (HBRUSH)SendMessageA( GetParent(hwnd), WM_CTLCOLORSCROLLBAR, (WPARAM)hdc,(LPARAM)hwnd); } else { - hBrush = DEFWND_ControlColor( hdc, CTLCOLOR_SCROLLBAR ); + hBrush = DEFWND_ControlColor( hdc, CTLCOLOR_SCROLLBAR ); } } hSavePen = SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); @@ -792,7 +792,7 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar, * * Redraw the whole scrollbar. */ -void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, +void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior ) { INT arrowSize, thumbSize, thumbPos; @@ -829,7 +829,7 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, (SCROLL_trackHitTest == SCROLL_TOP_ARROW), (SCROLL_trackHitTest == SCROLL_BOTTOM_ARROW) ); else - SCROLL_DrawArrows( hdc, infoPtr, &rect, arrowSize, vertical, + SCROLL_DrawArrows( hdc, infoPtr, &rect, arrowSize, vertical, FALSE, FALSE ); } if( interior ) @@ -865,7 +865,7 @@ END: * Repaint the scroll bar interior after a SetScrollRange() or * SetScrollPos() call. */ -static void SCROLL_RefreshScrollBar( HWND hwnd, INT nBar, +static void SCROLL_RefreshScrollBar( HWND hwnd, INT nBar, BOOL arrows, BOOL interior ) { HDC hdc = GetDCEx( hwnd, 0, @@ -929,7 +929,7 @@ static void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt) SCROLLBAR_INFO *infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ); if (!infoPtr) return; - if ((SCROLL_trackHitTest == SCROLL_NOWHERE) && (msg != WM_LBUTTONDOWN)) + if ((SCROLL_trackHitTest == SCROLL_NOWHERE) && (msg != WM_LBUTTONDOWN)) return; hdc = GetDCEx( hwnd, 0, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW)); @@ -991,7 +991,7 @@ static void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt) SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, SB_LINEUP, (LPARAM)hwndCtl ); } - + SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, (TIMERPROC)0 ); @@ -1207,7 +1207,7 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, MoveWindow( hwnd, lpCreat->x, lpCreat->y, GetSystemMetrics(SM_CXVSCROLL)+1, lpCreat->cy, FALSE ); else if (lpCreat->style & SBS_RIGHTALIGN) - MoveWindow( hwnd, + MoveWindow( hwnd, lpCreat->x+lpCreat->cx-GetSystemMetrics(SM_CXVSCROLL)-1, lpCreat->y, GetSystemMetrics(SM_CXVSCROLL)+1, lpCreat->cy, FALSE ); @@ -1218,7 +1218,7 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, MoveWindow( hwnd, lpCreat->x, lpCreat->y, lpCreat->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE ); else if (lpCreat->style & SBS_BOTTOMALIGN) - MoveWindow( hwnd, + MoveWindow( hwnd, lpCreat->x, lpCreat->y+lpCreat->cy-GetSystemMetrics(SM_CYHSCROLL)-1, lpCreat->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE ); @@ -1397,7 +1397,7 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, /************************************************************************* * SetScrollInfo (USER32.@) - * SetScrollInfo can be used to set the position, upper bound, + * SetScrollInfo can be used to set the position, upper bound, * lower bound, and page size of a scrollbar control. * * RETURNS @@ -1409,9 +1409,9 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam, * (corresponding to the 76 different positions of the window on * the text), and info->nPage=25. */ -INT WINAPI SetScrollInfo( -HWND hwnd /* [in] Handle of window whose scrollbar will be affected */, -INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */, +INT WINAPI SetScrollInfo( +HWND hwnd /* [in] Handle of window whose scrollbar will be affected */, +INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */, const SCROLLINFO *info /* [in] Specifies what to change and new values */, BOOL bRedraw /* [in] Should scrollbar be redrawn afterwards ? */) { @@ -1434,10 +1434,10 @@ BOOL bRedraw /* [in] Should scrollbar be redrawn afterwards ? */) return retVal; } -INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, +INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, const SCROLLINFO *info, INT *action ) { - /* Update the scrollbar state and set action flags according to + /* Update the scrollbar state and set action flags according to * what has to be done graphics wise. */ SCROLLBAR_INFO *infoPtr; @@ -1468,7 +1468,7 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, { infoPtr->Page = info->nPage; *action |= SA_SSI_REFRESH; - bChangeParams = TRUE; + bChangeParams = TRUE; } } @@ -1500,7 +1500,7 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, if( infoPtr->MinVal != info->nMin || infoPtr->MaxVal != info->nMax ) { - *action |= SA_SSI_REFRESH; + *action |= SA_SSI_REFRESH; infoPtr->MinVal = info->nMin; infoPtr->MaxVal = info->nMax; bChangeParams = TRUE; @@ -1525,7 +1525,7 @@ INT SCROLL_SetScrollInfo( HWND hwnd, INT nBar, infoPtr->Page, infoPtr->CurVal, infoPtr->MinVal, infoPtr->MaxVal ); - /* don't change the scrollbar state if SetScrollInfo + /* don't change the scrollbar state if SetScrollInfo * is just called with SIF_DISABLENOSCROLL */ if(!(info->fMask & SIF_ALL)) goto done; @@ -1572,14 +1572,14 @@ done: /************************************************************************* * GetScrollInfo (USER32.@) - * GetScrollInfo can be used to retrieve the position, upper bound, + * GetScrollInfo can be used to retrieve the position, upper bound, * lower bound, and page size of a scrollbar control. * * RETURNS STD */ -BOOL WINAPI GetScrollInfo( - HWND hwnd /* [in] Handle of window */ , - INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */, +BOOL WINAPI GetScrollInfo( + HWND hwnd /* [in] Handle of window */ , + INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */, LPSCROLLINFO info /* [in/out] (info.fMask [in] specifies which values are to retrieve) */) { SCROLLBAR_INFO *infoPtr; @@ -1613,7 +1613,7 @@ BOOL WINAPI GetScrollInfo( * Note the ambiguity when 0 is returned. Use GetLastError * to make sure there was an error (and to know which one). */ -INT WINAPI SetScrollPos( +INT WINAPI SetScrollPos( HWND hwnd /* [in] Handle of window whose scrollbar will be affected */, INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */, INT nPos /* [in] New value */, @@ -1638,13 +1638,13 @@ BOOL bRedraw /* [in] Should scrollbar be redrawn afterwards ? */ ) * * RETURNS * Success: Current position - * Failure: 0 + * Failure: 0 * * REMARKS * Note the ambiguity when 0 is returned. Use GetLastError * to make sure there was an error (and to know which one). */ -INT WINAPI GetScrollPos( +INT WINAPI GetScrollPos( HWND hwnd, /* [in] Handle of window */ INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */) { @@ -1660,7 +1660,7 @@ INT nBar /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */) * * RETURNS STD */ -BOOL WINAPI SetScrollRange( +BOOL WINAPI SetScrollRange( HWND hwnd, /* [in] Handle of window whose scrollbar will be affected */ INT nBar, /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */ INT MinVal, /* [in] New minimum value */ @@ -1720,7 +1720,7 @@ INT SCROLL_SetNCSbState(HWND hwnd, int vMin, int vMax, int vPos, * * RETURNS STD */ -BOOL WINAPI GetScrollRange( +BOOL WINAPI GetScrollRange( HWND hwnd, /* [in] Handle of window */ INT nBar, /* [in] One of SB_HORZ, SB_VERT, or SB_CTL */ LPINT lpMin, /* [out] Where to store minimum value */ @@ -1745,7 +1745,7 @@ LPINT lpMax /* [out] Where to store maximum value */) * * Back-end for ShowScrollBar(). Returns FALSE if no action was taken. */ -BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar, +BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar, BOOL fShowH, BOOL fShowV ) { LONG style = GetWindowLongW( hwnd, GWL_STYLE ); @@ -1847,7 +1847,7 @@ BOOL WINAPI EnableScrollBar( HWND hwnd, INT nBar, UINT flags ) } else bFineWithMe = TRUE; - + if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, nBar ))) return FALSE; if (bFineWithMe && infoPtr->flags == flags) return FALSE; infoPtr->flags = flags; diff --git a/controls/static.c b/controls/static.c index d08979a4421..cce770cd300 100644 --- a/controls/static.c +++ b/controls/static.c @@ -238,7 +238,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, /* * FIXME * DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) ); - * + * * We don't want to do this yet because DestroyIcon32 is broken. If the icon * had already been loaded by the application the last thing we want to do is * GlobalFree16 the handle. @@ -292,7 +292,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, STATIC_SetIcon(hwnd, hIcon, style); break; } - case SS_BITMAP: + case SS_BITMAP: { HBITMAP hBitmap; if(unicode) @@ -485,7 +485,7 @@ static void STATIC_PaintRectfn( HWND hwnd, HDC hdc, DWORD style ) HBRUSH hBrush; GetClientRect( hwnd, &rc); - + switch (style & SS_TYPEMASK) { case SS_BLACKRECT: diff --git a/controls/uitools.c b/controls/uitools.c index 68fb2f90d53..1be5dae10f0 100644 --- a/controls/uitools.c +++ b/controls/uitools.c @@ -103,9 +103,9 @@ static const signed char LTRBOuterFlat[] = { static const signed char LTRBInnerFlat[] = { -1, -1, -1, -1, - -1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE, - -1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE, - -1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE, + -1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE, + -1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE, + -1, COLOR_BTNFACE, COLOR_BTNFACE, COLOR_BTNFACE, }; /*********************************************************************** @@ -117,7 +117,7 @@ static const signed char LTRBInnerFlat[] = { * * See also comments with UITOOLS_DrawRectEdge() */ -static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc, +static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags) { POINT Points[4]; @@ -140,7 +140,7 @@ static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc, OuterPen = InnerPen = (HPEN)GetStockObject(NULL_PEN); SavePen = (HPEN)SelectObject(hdc, InnerPen); spx = spy = epx = epy = 0; /* Satisfy the compiler... */ - + /* Determine the colors of the edges */ if(uFlags & BF_MONO) { @@ -430,7 +430,7 @@ static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc, */ -static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc, +static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags) { signed char LTInnerI, LTOuterI; @@ -447,7 +447,7 @@ static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc, BOOL retval = !( ((uType & BDR_INNER) == BDR_INNER || (uType & BDR_OUTER) == BDR_OUTER) && !(uFlags & (BF_FLAT|BF_MONO)) ); - + /* Init some vars */ LTInnerPen = LTOuterPen = RBInnerPen = RBOuterPen = (HPEN)GetStockObject(NULL_PEN); SavePen = (HPEN)SelectObject(hdc, LTInnerPen); @@ -470,7 +470,7 @@ static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc, * otherwise. * Dennis Björklund, 10 June, 99 */ - if( TWEAK_WineLook == WIN98_LOOK && LTInnerI != -1 ) + if( TWEAK_WineLook == WIN98_LOOK && LTInnerI != -1 ) LTInnerI = RBInnerI = COLOR_BTNFACE; } else if(uFlags & BF_SOFT) @@ -559,8 +559,8 @@ static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc, if(uFlags & BF_BOTTOM) InnerRect.bottom -= add; if((uFlags & BF_MIDDLE) && retval) - { - FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ? + { + FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ? COLOR_WINDOW : COLOR_BTNFACE)); } @@ -944,8 +944,8 @@ static BOOL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT uFlags) { case DFCS_CAPTIONCLOSE: { - /* The "X" is made by drawing a series of lines. - * The number of lines drawn depends on the size + /* The "X" is made by drawing a series of lines. + * The number of lines drawn depends on the size * of the bounding rect. e.g. For a 6x5 inside rect, * two lines are drawn from top-left to bottom-right, * and two lines from top-right to bottom-left. @@ -1145,7 +1145,7 @@ static BOOL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT uFlags) /* * This fixes a problem with really tiny "scroll" buttons. In particular - * with the updown control. + * with the updown control. * Making sure that the arrow is as least 3 pixels wide (or high). */ if (tri == 0) @@ -1405,7 +1405,7 @@ BOOL WINAPI DrawFrameControl( HDC hdc, LPRECT rc, UINT uType, /* Win95 doesn't support drawing in other mapping modes */ if(GetMapMode(hdc) != MM_TEXT) return FALSE; - + switch(uType) { case DFC_BUTTON: diff --git a/debugger/break.c b/debugger/break.c index 4f12579bc7a..63f8522b5ee 100644 --- a/debugger/break.c +++ b/debugger/break.c @@ -178,23 +178,23 @@ BOOL DEBUG_IsFctReturn(void) void DEBUG_SetBreakpoints( BOOL set ) { int i; - + #ifdef __i386__ DEBUG_context.Dr7 &= ~DR7_LOCAL_ENABLE_MASK; #endif - + for (i = 0; i < next_bp; i++) { if (!(breakpoints[i].refcount && breakpoints[i].enabled)) continue; - + switch (breakpoints[i].type) { case DBG_BREAK: { #ifdef __i386__ char ch = set ? INT3 : breakpoints[i].u.b.opcode; - - if (!DEBUG_WRITE_MEM( (void*)DEBUG_ToLinear(&breakpoints[i].addr), + + if (!DEBUG_WRITE_MEM( (void*)DEBUG_ToLinear(&breakpoints[i].addr), &ch, sizeof(ch) )) { DEBUG_Printf(DBG_CHN_MESG, "Invalid address for breakpoint %d, disabling it\n", i); @@ -204,14 +204,14 @@ void DEBUG_SetBreakpoints( BOOL set ) } break; case DBG_WATCH: - if (set) + if (set) { #ifdef __i386__ DWORD bits; int reg = breakpoints[i].u.w.reg; LPDWORD lpdr = NULL; - switch (reg) + switch (reg) { case 0: lpdr = &DEBUG_context.Dr0; break; case 1: lpdr = &DEBUG_context.Dr1; break; @@ -219,7 +219,7 @@ void DEBUG_SetBreakpoints( BOOL set ) case 3: lpdr = &DEBUG_context.Dr3; break; default: RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL); } - + *lpdr = DEBUG_ToLinear(&breakpoints[i].addr); bits = (breakpoints[i].u.w.rw) ? DR7_RW_WRITE : DR7_RW_READ; switch (breakpoints[i].u.w.len + 1) @@ -229,7 +229,7 @@ void DEBUG_SetBreakpoints( BOOL set ) case 1: bits |= DR7_LEN_1; break; default: RaiseException(DEBUG_STATUS_INTERNAL_ERROR, 0, 0, NULL); } - + DEBUG_context.Dr7 &= ~(0x0F << (DR7_CONTROL_SHIFT + DR7_CONTROL_SIZE * reg)); DEBUG_context.Dr7 |= bits << (DR7_CONTROL_SHIFT + DR7_CONTROL_SIZE * reg); DEBUG_context.Dr7 |= DR7_ENABLE_MASK(reg) | DR7_LOCAL_SLOWDOWN; @@ -246,22 +246,22 @@ void DEBUG_SetBreakpoints( BOOL set ) * Find the breakpoint for a given address. Return the breakpoint * number or -1 if none. * If type is DBG_BREAKPOINT, addr is a complete addr - * If type is DBG_WATCHPOINT, only addr.off is meaningful and contains + * If type is DBG_WATCHPOINT, only addr.off is meaningful and contains * linear address */ static int DEBUG_FindBreakpoint( const DBG_ADDR *addr, int type ) { int i; - + for (i = 0; i < next_bp; i++) { if (breakpoints[i].refcount && breakpoints[i].enabled && breakpoints[i].type == type ) { - if ((type == DBG_BREAK && + if ((type == DBG_BREAK && breakpoints[i].addr.seg == addr->seg && breakpoints[i].addr.off == addr->off) || - (type == DBG_WATCH && + (type == DBG_WATCH && DEBUG_ToLinear(&breakpoints[i].addr) == addr->off)) return i; } @@ -277,11 +277,11 @@ static int DEBUG_FindBreakpoint( const DBG_ADDR *addr, int type ) static int DEBUG_InitXPoint(int type, DBG_ADDR* addr) { int num; - - for (num = (next_bp < MAX_BREAKPOINTS) ? next_bp++ : 1; - num < MAX_BREAKPOINTS; num++) + + for (num = (next_bp < MAX_BREAKPOINTS) ? next_bp++ : 1; + num < MAX_BREAKPOINTS; num++) { - if (breakpoints[num].refcount == 0) + if (breakpoints[num].refcount == 0) { breakpoints[num].refcount = 1; breakpoints[num].enabled = TRUE; @@ -316,12 +316,12 @@ static int DEBUG_InitXPoint(int type, DBG_ADDR* addr) static BOOL DEBUG_GetWatchedValue( int num, LPDWORD val ) { BYTE buf[4]; - - if (!DEBUG_READ_MEM((void*)DEBUG_ToLinear(&breakpoints[num].addr), + + if (!DEBUG_READ_MEM((void*)DEBUG_ToLinear(&breakpoints[num].addr), buf, breakpoints[num].u.w.len + 1)) return FALSE; - - switch (breakpoints[num].u.w.len + 1) + + switch (breakpoints[num].u.w.len + 1) { case 4: *val = *(DWORD*)buf; break; case 2: *val = *(WORD*)buf; break; @@ -355,7 +355,7 @@ void DEBUG_AddBreakpoint( const DBG_VALUE *_value, BOOL (*func)(void) ) value.addr.seg = seg2; } - if ((num = DEBUG_FindBreakpoint(&value.addr, DBG_BREAK)) >= 1) + if ((num = DEBUG_FindBreakpoint(&value.addr, DBG_BREAK)) >= 1) { breakpoints[num].refcount++; return; @@ -401,7 +401,7 @@ void DEBUG_AddBreakpointFromId(const char *name, int lineno) return; } } - DEBUG_CurrProcess->delayed_bp = DBG_realloc(DEBUG_CurrProcess->delayed_bp, + DEBUG_CurrProcess->delayed_bp = DBG_realloc(DEBUG_CurrProcess->delayed_bp, sizeof(DBG_DELAYED_BP) * ++DEBUG_CurrProcess->num_delayed_bp); DEBUG_CurrProcess->delayed_bp[DEBUG_CurrProcess->num_delayed_bp - 1].name = strcpy(DBG_alloc(strlen(name) + 1), name); @@ -416,12 +416,12 @@ void DEBUG_AddBreakpointFromId(const char *name, int lineno) void DEBUG_AddBreakpointFromLineno(int lineno) { DBG_VALUE value; - + DEBUG_GetCurrentAddress(&value.addr); - + if (lineno != -1) { struct name_hash* nh; - + DEBUG_FindNearestSymbol(&value.addr, TRUE, &nh, 0, NULL); if (nh == NULL) { DEBUG_Printf(DBG_CHN_MESG, "Unable to add breakpoint\n"); @@ -429,7 +429,7 @@ void DEBUG_AddBreakpointFromLineno(int lineno) } DEBUG_GetLineNumberAddr(nh, lineno, &value.addr, TRUE); } - + value.type = NULL; value.cookie = DV_TARGET; DEBUG_AddBreakpoint( &value, NULL ); @@ -467,13 +467,13 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write ) int num, reg = -1; unsigned seg2; DWORD mask = 0; - + assert(_value->cookie == DV_TARGET || _value->cookie == DV_HOST); #ifdef __i386__ DEBUG_FixAddress( &value.addr, DEBUG_context.SegCs ); #endif - + if ( value.type != NULL && value.type == DEBUG_GetBasicType(DT_BASIC_CONST_INT) ) { /* @@ -486,10 +486,10 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write ) value.addr.off = DEBUG_GetExprValue(&value, NULL); value.addr.seg = seg2; } - - for (num = 1; num < next_bp; num++) + + for (num = 1; num < next_bp; num++) { - if (breakpoints[num].refcount && breakpoints[num].enabled && + if (breakpoints[num].refcount && breakpoints[num].enabled && breakpoints[num].type == DBG_WATCH) { mask |= (1 << breakpoints[num].u.w.reg); } @@ -505,12 +505,12 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write ) if ((num = DEBUG_InitXPoint(DBG_WATCH, &value.addr)) == -1) return; - + breakpoints[num].u.w.len = 4 - 1; if (_value->type && DEBUG_GetObjectSize(_value->type) < 4) breakpoints[num].u.w.len = 2 - 1; - - if (!DEBUG_GetWatchedValue( num, &breakpoints[num].u.w.oldval)) + + if (!DEBUG_GetWatchedValue( num, &breakpoints[num].u.w.oldval)) { DEBUG_Printf(DBG_CHN_MESG, "Bad address. Watchpoint not set\n"); breakpoints[num].refcount = 0; @@ -519,7 +519,7 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write ) { breakpoints[num].u.w.rw = (is_write) ? TRUE : FALSE; breakpoints[reg].u.w.reg = reg; - + DEBUG_Printf( DBG_CHN_MESG, "Watchpoint %d at ", num ); DEBUG_PrintAddress( &breakpoints[num].addr, breakpoints[num].is32 ? MODE_32 : MODE_16, TRUE ); DEBUG_Printf( DBG_CHN_MESG, "\n" ); @@ -534,7 +534,7 @@ void DEBUG_AddWatchpoint( const DBG_VALUE *_value, BOOL is_write ) void DEBUG_AddWatchpointFromId(const char *name) { DBG_VALUE value; - + if( DEBUG_GetSymbolValue(name, -1, &value, TRUE) ) DEBUG_AddWatchpoint( &value, 1 ); else @@ -593,7 +593,7 @@ void DEBUG_EnableBreakpoint( int num, BOOL enable ) * the value watched before the TRAP * Return -1 if none found (*oldval is undetermined) * - * Unfortunately, Linux does *NOT* (A REAL PITA) report with ptrace + * Unfortunately, Linux does *NOT* (A REAL PITA) report with ptrace * the DR6 register value, so we have to look with our own need the * cause of the TRAP. * -EP @@ -603,20 +603,20 @@ static int DEBUG_FindTriggeredWatchpoint(LPDWORD oldval) int found = -1; #ifdef __i386__ int i; - + /* Method 1 => get triggered watchpoint from context (doesn't work on Linux * 2.2.x). This should be fixed in >= 2.2.16 */ - for (i = 0; i < next_bp; i++) + for (i = 0; i < next_bp; i++) { DWORD val = 0; - if (breakpoints[i].refcount && breakpoints[i].enabled && + if (breakpoints[i].refcount && breakpoints[i].enabled && breakpoints[i].type == DBG_WATCH && (DEBUG_context.Dr6 & (1 << breakpoints[i].u.w.reg))) { DEBUG_context.Dr6 &= ~(1 << breakpoints[i].u.w.reg); - + *oldval = breakpoints[i].u.w.oldval; if (DEBUG_GetWatchedValue(i, &val)) { breakpoints[i].u.w.oldval = val; @@ -624,23 +624,23 @@ static int DEBUG_FindTriggeredWatchpoint(LPDWORD oldval) } } } - + /* Method 1 failed, trying method 2 */ - + /* Method 2 => check if value has changed among registered watchpoints * this really sucks, but this is how gdb 4.18 works on my linux box * -EP */ - for (i = 0; i < next_bp; i++) + for (i = 0; i < next_bp; i++) { DWORD val = 0; - if (breakpoints[i].refcount && breakpoints[i].enabled && - breakpoints[i].type == DBG_WATCH && - DEBUG_GetWatchedValue(i, &val)) + if (breakpoints[i].refcount && breakpoints[i].enabled && + breakpoints[i].type == DBG_WATCH && + DEBUG_GetWatchedValue(i, &val)) { *oldval = breakpoints[i].u.w.oldval; - if (val != *oldval) + if (val != *oldval) { DEBUG_context.Dr6 &= ~(1 << breakpoints[i].u.w.reg); breakpoints[i].u.w.oldval = val; @@ -671,7 +671,7 @@ void DEBUG_InfoBreakpoints(void) if (breakpoints[i].refcount && breakpoints[i].type == DBG_BREAK) { DEBUG_Printf( DBG_CHN_MESG, "%d: %c ", i, breakpoints[i].enabled ? 'y' : 'n'); - DEBUG_PrintAddress( &breakpoints[i].addr, + DEBUG_PrintAddress( &breakpoints[i].addr, breakpoints[i].is32 ? MODE_32 : MODE_16, TRUE); DEBUG_Printf( DBG_CHN_MESG, " (%u)\n", breakpoints[i].refcount ); if( breakpoints[i].condition != NULL ) @@ -688,10 +688,10 @@ void DEBUG_InfoBreakpoints(void) if (breakpoints[i].refcount && breakpoints[i].type == DBG_WATCH) { DEBUG_Printf( DBG_CHN_MESG, "%d: %c ", i, breakpoints[i].enabled ? 'y' : 'n'); - DEBUG_PrintAddress( &breakpoints[i].addr, + DEBUG_PrintAddress( &breakpoints[i].addr, breakpoints[i].is32 ? MODE_32 : MODE_16, TRUE); - DEBUG_Printf( DBG_CHN_MESG, " on %d byte%s (%c)\n", - breakpoints[i].u.w.len + 1, + DEBUG_Printf( DBG_CHN_MESG, " on %d byte%s (%c)\n", + breakpoints[i].u.w.len + 1, breakpoints[i].u.w.len > 0 ? "s" : "", breakpoints[i].u.w.rw ? 'W' : 'R'); if( breakpoints[i].condition != NULL ) @@ -731,7 +731,7 @@ static BOOL DEBUG_ShallBreak( int bpnum ) return FALSE; } } - + if ( breakpoints[bpnum].skipcount > 0 && --breakpoints[bpnum].skipcount > 0 ) return FALSE; @@ -775,7 +775,7 @@ BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, int * count ) syminfo = DEBUG_PrintAddress( &breakpoints[bpnum].addr, breakpoints[bpnum].is32 ? MODE_32 : MODE_16, TRUE ); DEBUG_Printf( DBG_CHN_MESG, "\n" ); - + if( syminfo.list.sourcefile != NULL ) DEBUG_List(&syminfo.list, NULL, 0); return FALSE; @@ -785,7 +785,7 @@ BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, int * count ) if ((wpnum != 0) && (wpnum != -1)) { /* If not single-stepping, do not back up over the int3 instruction */ - if (code == EXCEPTION_BREAKPOINT) + if (code == EXCEPTION_BREAKPOINT) { #ifdef __i386__ DEBUG_context.Eip++; @@ -793,12 +793,12 @@ BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, int * count ) #endif } if (!DEBUG_ShallBreak(wpnum)) return TRUE; - + addr_mode = DEBUG_GetSelectorType( addr->seg ); DEBUG_Printf(DBG_CHN_MESG, "Stopped on watchpoint %d at ", wpnum); syminfo = DEBUG_PrintAddress( addr, addr_mode, TRUE ); - - DEBUG_Printf(DBG_CHN_MESG, " values: old=%lu new=%lu\n", + + DEBUG_Printf(DBG_CHN_MESG, " values: old=%lu new=%lu\n", oldval, breakpoints[wpnum].u.w.oldval); if (syminfo.list.sourcefile != NULL) DEBUG_List(&syminfo.list, NULL, 0); @@ -829,7 +829,7 @@ BOOL DEBUG_ShouldContinue( DBG_ADDR *addr, DWORD code, int * count ) */ return TRUE; } - + /* * If we are about to stop, then print out the source line if we * have it. @@ -893,7 +893,7 @@ void DEBUG_RestartExecution( int count ) */ ret_mode = mode = DEBUG_CurrThread->exec_mode; - bp = DEBUG_FindBreakpoint( &addr, DBG_BREAK ); + bp = DEBUG_FindBreakpoint( &addr, DBG_BREAK ); if ( bp != -1 && bp != 0) { /* @@ -912,7 +912,7 @@ void DEBUG_RestartExecution( int count ) DEBUG_Printf(DBG_CHN_MESG, "Not stopped at any breakpoint; argument ignored.\n"); } } - + if( mode == EXEC_FINISH && DEBUG_IsFctReturn() ) { mode = ret_mode = EXEC_STEPI_INSTR; @@ -932,7 +932,7 @@ void DEBUG_RestartExecution( int count ) addr2 = addr; DEBUG_Disasm(&addr2, FALSE); addr2.off += delta; - + status = DEBUG_CheckLinenoStatus(&addr2); /* * Anytime we have a trampoline, step over it. @@ -946,7 +946,7 @@ void DEBUG_RestartExecution( int count ) #endif mode = EXEC_STEP_OVER_TRAMPOLINE; } - + if( mode == EXEC_STEP_INSTR && status == FUNC_HAS_NO_LINES ) { #if 0 @@ -964,7 +964,7 @@ void DEBUG_RestartExecution( int count ) { DEBUG_Printf(DBG_CHN_MESG, "Single stepping until exit from function, \n"); DEBUG_Printf(DBG_CHN_MESG, "which has no line number information.\n"); - + ret_mode = mode = EXEC_FINISH; } } @@ -986,8 +986,8 @@ void DEBUG_RestartExecution( int count ) * address just after the call. */ #ifdef __i386__ - DEBUG_READ_MEM((void*)(DEBUG_context.Esp + - 2 * sizeof(unsigned int)), + DEBUG_READ_MEM((void*)(DEBUG_context.Esp + + 2 * sizeof(unsigned int)), &addr.off, sizeof(addr.off)); DEBUG_context.EFlags &= ~STEP_FLAG; #endif @@ -995,7 +995,7 @@ void DEBUG_RestartExecution( int count ) breakpoints[0].enabled = TRUE; breakpoints[0].refcount = 1; breakpoints[0].skipcount = 0; - DEBUG_READ_MEM((void*)DEBUG_ToLinear( &addr ), &breakpoints[0].u.b.opcode, + DEBUG_READ_MEM((void*)DEBUG_ToLinear( &addr ), &breakpoints[0].u.b.opcode, sizeof(char)); DEBUG_SetBreakpoints( TRUE ); break; diff --git a/debugger/db_disasm.c b/debugger/db_disasm.c index fcbd6d3884f..99945a1283f 100644 --- a/debugger/db_disasm.c +++ b/debugger/db_disasm.c @@ -1,25 +1,25 @@ -/* +/* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -30,23 +30,23 @@ * Add a switch to disassemble 16-bit code. * Fix spelling of 'lods' opcodes. * [91/10/30 dbg] - * + * * Revision 2.5 91/10/09 16:05:58 af * Supported disassemble of non current task by passing task parameter. * [91/08/29 tak] - * + * * Revision 2.4 91/05/14 16:05:04 mrt * Correcting copyright - * + * * Revision 2.3 91/02/05 17:11:03 mrt * Changed to new Mach copyright * [91/02/01 17:31:03 mrt] - * + * * Revision 2.2 90/08/27 21:55:56 dbg * Fix register operand for move to/from control/test/debug * register instructions. Add i486 instructions. * [90/08/27 dbg] - * + * * Import db_sym.h. Print instruction displacements in * current radix (signed). Change calling sequence of * db_disasm. @@ -55,7 +55,7 @@ * [90/08/08 dbg] * Created. * [90/07/25 dbg] - * + * */ /* @@ -280,23 +280,23 @@ static const struct inst db_inst_0f3x[] = { }; static const struct inst db_inst_0f4x[] = { -/*40*/ { "cmovo", TRUE, NONE, op2(E, R), 0 }, -/*41*/ { "cmovno", TRUE, NONE, op2(E, R), 0 }, -/*42*/ { "cmovnae",TRUE, NONE, op2(E, R), 0 }, -/*43*/ { "cmovnb", TRUE, NONE, op2(E, R), 0 }, -/*44*/ { "cmove", TRUE, NONE, op2(E, R), 0 }, -/*45*/ { "cmovne", TRUE, NONE, op2(E, R), 0 }, -/*46*/ { "cmovna", TRUE, NONE, op2(E, R), 0 }, -/*47*/ { "cmova", TRUE, NONE, op2(E, R), 0 }, +/*40*/ { "cmovo", TRUE, NONE, op2(E, R), 0 }, +/*41*/ { "cmovno", TRUE, NONE, op2(E, R), 0 }, +/*42*/ { "cmovnae",TRUE, NONE, op2(E, R), 0 }, +/*43*/ { "cmovnb", TRUE, NONE, op2(E, R), 0 }, +/*44*/ { "cmove", TRUE, NONE, op2(E, R), 0 }, +/*45*/ { "cmovne", TRUE, NONE, op2(E, R), 0 }, +/*46*/ { "cmovna", TRUE, NONE, op2(E, R), 0 }, +/*47*/ { "cmova", TRUE, NONE, op2(E, R), 0 }, -/*48*/ { "cmovs", TRUE, NONE, op2(E, R), 0 }, -/*49*/ { "cmovns", TRUE, NONE, op2(E, R), 0 }, -/*4a*/ { "cmovpe", TRUE, NONE, op2(E, R), 0 }, -/*4b*/ { "cmovpo", TRUE, NONE, op2(E, R), 0 }, -/*4c*/ { "cmovl", TRUE, NONE, op2(E, R), 0 }, -/*4d*/ { "cmovge", TRUE, NONE, op2(E, R), 0 }, -/*4e*/ { "cmovle", TRUE, NONE, op2(E, R), 0 }, -/*4f*/ { "cmovnle",TRUE, NONE, op2(E, R), 0 }, +/*48*/ { "cmovs", TRUE, NONE, op2(E, R), 0 }, +/*49*/ { "cmovns", TRUE, NONE, op2(E, R), 0 }, +/*4a*/ { "cmovpe", TRUE, NONE, op2(E, R), 0 }, +/*4b*/ { "cmovpo", TRUE, NONE, op2(E, R), 0 }, +/*4c*/ { "cmovl", TRUE, NONE, op2(E, R), 0 }, +/*4d*/ { "cmovge", TRUE, NONE, op2(E, R), 0 }, +/*4e*/ { "cmovle", TRUE, NONE, op2(E, R), 0 }, +/*4f*/ { "cmovnle",TRUE, NONE, op2(E, R), 0 }, }; static const struct inst db_inst_0f5x[] = { @@ -320,43 +320,43 @@ static const struct inst db_inst_0f5x[] = { }; static const struct inst db_inst_0f6x[] = { -/*60*/ { "punpcklbw", TRUE, NONE, op2(E, MX), 0 }, -/*61*/ { "punpcklwd", TRUE, NONE, op2(E, MX), 0 }, -/*62*/ { "punpckldq", TRUE, NONE, op2(E, MX), 0 }, -/*63*/ { "packsswb", TRUE, NONE, op2(E, MX), 0 }, -/*64*/ { "pcmpgtb", TRUE, NONE, op2(E, MX), 0 }, -/*65*/ { "pcmpgtw", TRUE, NONE, op2(E, MX), 0 }, -/*66*/ { "pcmpgtd", TRUE, NONE, op2(E, MX), 0 }, -/*67*/ { "packuswb", TRUE, NONE, op2(E, MX), 0 }, +/*60*/ { "punpcklbw", TRUE, NONE, op2(E, MX), 0 }, +/*61*/ { "punpcklwd", TRUE, NONE, op2(E, MX), 0 }, +/*62*/ { "punpckldq", TRUE, NONE, op2(E, MX), 0 }, +/*63*/ { "packsswb", TRUE, NONE, op2(E, MX), 0 }, +/*64*/ { "pcmpgtb", TRUE, NONE, op2(E, MX), 0 }, +/*65*/ { "pcmpgtw", TRUE, NONE, op2(E, MX), 0 }, +/*66*/ { "pcmpgtd", TRUE, NONE, op2(E, MX), 0 }, +/*67*/ { "packuswb", TRUE, NONE, op2(E, MX), 0 }, -/*68*/ { "punpckhbw", TRUE, NONE, op2(E, MX), 0 }, -/*69*/ { "punpckhwd", TRUE, NONE, op2(E, MX), 0 }, -/*6a*/ { "punpckhdq", TRUE, NONE, op2(E, MX), 0 }, -/*6b*/ { "packssdw", TRUE, NONE, op2(E, MX), 0 }, -/*6c*/ { "(bad)", TRUE, NONE, 0, 0 }, -/*6d*/ { "(bad)", TRUE, NONE, 0, 0 }, -/*6e*/ { "movd", TRUE, NONE, op2(E, MX), 0 }, -/*6f*/ { "movq", TRUE, NONE, op2(E, MX), 0 }, +/*68*/ { "punpckhbw", TRUE, NONE, op2(E, MX), 0 }, +/*69*/ { "punpckhwd", TRUE, NONE, op2(E, MX), 0 }, +/*6a*/ { "punpckhdq", TRUE, NONE, op2(E, MX), 0 }, +/*6b*/ { "packssdw", TRUE, NONE, op2(E, MX), 0 }, +/*6c*/ { "(bad)", TRUE, NONE, 0, 0 }, +/*6d*/ { "(bad)", TRUE, NONE, 0, 0 }, +/*6e*/ { "movd", TRUE, NONE, op2(E, MX), 0 }, +/*6f*/ { "movq", TRUE, NONE, op2(E, MX), 0 }, }; static const struct inst db_inst_0f7x[] = { -/*70*/ { "pshufw", TRUE, NONE, op2(MX, EMX), 0 }, +/*70*/ { "pshufw", TRUE, NONE, op2(MX, EMX), 0 }, /*71*/ { "(grp10)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp10 }, -/*72*/ { "(grp11)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp11 }, -/*73*/ { "(grp12)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp12 }, -/*74*/ { "pcmpeqb", TRUE, NONE, op2(E, MX), 0 }, -/*75*/ { "pcmpeqw", TRUE, NONE, op2(E, MX), 0 }, -/*76*/ { "pcmpeqd", TRUE, NONE, op2(E, MX), 0 }, -/*77*/ { "emms", FALSE,NONE, 0, 0 }, +/*72*/ { "(grp11)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp11 }, +/*73*/ { "(grp12)", TRUE, BYTE, op2(EMX, I), (char*)db_Grp12 }, +/*74*/ { "pcmpeqb", TRUE, NONE, op2(E, MX), 0 }, +/*75*/ { "pcmpeqw", TRUE, NONE, op2(E, MX), 0 }, +/*76*/ { "pcmpeqd", TRUE, NONE, op2(E, MX), 0 }, +/*77*/ { "emms", FALSE,NONE, 0, 0 }, -/*78*/ { "(bad)", TRUE, NONE, 0, 0 }, -/*79*/ { "(bad)", TRUE, NONE, 0, 0 }, -/*7a*/ { "(bad)", TRUE, NONE, 0, 0 }, -/*7b*/ { "(bad)", TRUE, NONE, 0, 0 }, -/*7c*/ { "(bad)", TRUE, NONE, 0, 0 }, -/*7d*/ { "(bad)", TRUE, NONE, 0, 0 }, -/*7e*/ { "movd", TRUE, NONE, op2(E, MX), 0 }, -/*7f*/ { "movq", TRUE, NONE, op2(EMX, MX), 0 }, +/*78*/ { "(bad)", TRUE, NONE, 0, 0 }, +/*79*/ { "(bad)", TRUE, NONE, 0, 0 }, +/*7a*/ { "(bad)", TRUE, NONE, 0, 0 }, +/*7b*/ { "(bad)", TRUE, NONE, 0, 0 }, +/*7c*/ { "(bad)", TRUE, NONE, 0, 0 }, +/*7d*/ { "(bad)", TRUE, NONE, 0, 0 }, +/*7e*/ { "movd", TRUE, NONE, op2(E, MX), 0 }, +/*7f*/ { "movq", TRUE, NONE, op2(EMX, MX), 0 }, }; static const struct inst db_inst_0f8x[] = { @@ -1209,11 +1209,11 @@ void db_print_address(char *seg, int size, struct i_addr *addrp, int byref) if (addrp->index) DEBUG_Printf(DBG_CHN_MESG,",%s,%d", addrp->index, 1<ss); DEBUG_Printf(DBG_CHN_MESG,")"); - } + } else { /* try to get destination of indirect call - does not work for segmented adresses */ + does not work for segmented adresses */ if (!seg && byref) { void* a1; void* a2; @@ -1812,7 +1812,7 @@ void DEBUG_Disasm( DBG_ADDR *addr, int display ) { DEBUG_PrintAddress( &address, short_addr ? MODE_16 : MODE_32, TRUE ); } - + } break; } diff --git a/debugger/debugger.h b/debugger/debugger.h index ff5e2bfc931..833c63c8cb7 100644 --- a/debugger/debugger.h +++ b/debugger/debugger.h @@ -40,22 +40,22 @@ #define SYM_TRAMPOLINE 0x10 #define SYM_STEP_THROUGH 0x20 -enum debug_type {DT_BASIC, DT_POINTER, DT_ARRAY, DT_STRUCT, DT_ENUM, +enum debug_type {DT_BASIC, DT_POINTER, DT_ARRAY, DT_STRUCT, DT_ENUM, DT_FUNC, DT_BITFIELD}; -enum debug_type_basic {DT_BASIC_INT = 1, DT_BASIC_CHAR, DT_BASIC_LONGINT, DT_BASIC_UINT, - DT_BASIC_ULONGINT, DT_BASIC_LONGLONGINT, DT_BASIC_ULONGLONGINT, - DT_BASIC_SHORTINT, DT_BASIC_USHORTINT, DT_BASIC_SCHAR, DT_BASIC_UCHAR, - DT_BASIC_FLOAT, DT_BASIC_LONGDOUBLE, DT_BASIC_DOUBLE, - DT_BASIC_CMPLX_INT, DT_BASIC_CMPLX_FLOAT, DT_BASIC_CMPLX_DOUBLE, - DT_BASIC_CMPLX_LONGDOUBLE, DT_BASIC_VOID, +enum debug_type_basic {DT_BASIC_INT = 1, DT_BASIC_CHAR, DT_BASIC_LONGINT, DT_BASIC_UINT, + DT_BASIC_ULONGINT, DT_BASIC_LONGLONGINT, DT_BASIC_ULONGLONGINT, + DT_BASIC_SHORTINT, DT_BASIC_USHORTINT, DT_BASIC_SCHAR, DT_BASIC_UCHAR, + DT_BASIC_FLOAT, DT_BASIC_LONGDOUBLE, DT_BASIC_DOUBLE, + DT_BASIC_CMPLX_INT, DT_BASIC_CMPLX_FLOAT, DT_BASIC_CMPLX_DOUBLE, + DT_BASIC_CMPLX_LONGDOUBLE, DT_BASIC_VOID, /* modifier on size isn't possible on current types definitions * so we need to add more types... */ - DT_BASIC_BOOL1, DT_BASIC_BOOL2, DT_BASIC_BOOL4, + DT_BASIC_BOOL1, DT_BASIC_BOOL2, DT_BASIC_BOOL4, /* this is not really a basic type... */ - DT_BASIC_STRING, + DT_BASIC_STRING, /* this is for historical reasons... should take care of it RSN */ - DT_BASIC_CONST_INT, + DT_BASIC_CONST_INT, /* to be kept as last... sentinel entry... do not use */ DT_BASIC_LAST}; @@ -85,7 +85,7 @@ typedef struct # define DV_HOST 0x50DA # define DV_INVALID 0x0000 - DBG_ADDR addr; + DBG_ADDR addr; } DBG_VALUE; struct list_id @@ -157,7 +157,7 @@ enum exit_mode /* of exception handling */ typedef struct { DBG_ADDR addr; - WORD enabled : 1, + WORD enabled : 1, type : 1, is32 : 1, refcount : 13; @@ -347,7 +347,7 @@ extern int DEBUG_FreeExpr(struct expr * exp); extern int DEBUG_DisplayExpr(const struct expr * exp); /* debugger/hash.c */ -extern struct name_hash * DEBUG_AddSymbol( const char *name, +extern struct name_hash * DEBUG_AddSymbol( const char *name, const DBG_VALUE *addr, const char *sourcefile, int flags); @@ -359,37 +359,37 @@ extern const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag, unsigned int ebp, struct list_id * source); extern void DEBUG_ReadSymbolTable( const char * filename ); -extern void DEBUG_AddLineNumber( struct name_hash * func, int line_num, +extern void DEBUG_AddLineNumber( struct name_hash * func, int line_num, unsigned long offset ); extern struct wine_locals * - DEBUG_AddLocal( struct name_hash * func, int regno, + DEBUG_AddLocal( struct name_hash * func, int regno, int offset, int pc_start, int pc_end, char * name); extern int DEBUG_CheckLinenoStatus(const DBG_ADDR *addr); -extern void DEBUG_GetFuncInfo(struct list_id * ret, const char * file, +extern void DEBUG_GetFuncInfo(struct list_id * ret, const char * file, const char * func); extern int DEBUG_SetSymbolSize(struct name_hash * sym, unsigned int len); extern int DEBUG_SetSymbolBPOff(struct name_hash * sym, unsigned int len); extern int DEBUG_GetSymbolAddr(struct name_hash * sym, DBG_ADDR * addr); extern int DEBUG_cmp_sym(const void * p1, const void * p2); -extern BOOL DEBUG_GetLineNumberAddr( const struct name_hash *, const int lineno, +extern BOOL DEBUG_GetLineNumberAddr( const struct name_hash *, const int lineno, DBG_ADDR *addr, int bp_flag ); -extern int DEBUG_SetLocalSymbolType(struct wine_locals * sym, +extern int DEBUG_SetLocalSymbolType(struct wine_locals * sym, struct datatype * type); extern BOOL DEBUG_Normalize(struct name_hash * nh ); /* debugger/info.c */ extern void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format ); -extern struct symbol_info DEBUG_PrintAddress( const DBG_ADDR *addr, +extern struct symbol_info DEBUG_PrintAddress( const DBG_ADDR *addr, enum dbg_mode mode, int flag ); extern void DEBUG_Help(void); extern void DEBUG_HelpInfo(void); -extern struct symbol_info DEBUG_PrintAddressAndArgs( const DBG_ADDR *addr, +extern struct symbol_info DEBUG_PrintAddressAndArgs( const DBG_ADDR *addr, enum dbg_mode mode, - unsigned int ebp, + unsigned int ebp, int flag ); extern void DEBUG_InfoClass(const char* clsName); extern void DEBUG_WalkClasses(void); @@ -425,27 +425,27 @@ extern int DEBUG_PrintStringW( int chnl, const DBG_ADDR* address, int len ); /* debugger/module.c */ extern int DEBUG_LoadEntryPoints( const char * prefix ); extern void DEBUG_LoadModule32( const char* name, HANDLE hFile, DWORD base ); -extern DBG_MODULE* DEBUG_AddModule(const char* name, enum DbgModuleType type, +extern DBG_MODULE* DEBUG_AddModule(const char* name, enum DbgModuleType type, void* mod_addr, u_long size, HMODULE hmod); extern DBG_MODULE* DEBUG_FindModuleByName(const char* name, enum DbgModuleType type); extern DBG_MODULE* DEBUG_FindModuleByHandle(HANDLE handle, enum DbgModuleType type); extern DBG_MODULE* DEBUG_FindModuleByAddr(void* addr, enum DbgModuleType type); extern DBG_MODULE* DEBUG_GetProcessMainModule(DBG_PROCESS* process); -extern DBG_MODULE* DEBUG_RegisterPEModule(HMODULE, u_long load_addr, u_long size, +extern DBG_MODULE* DEBUG_RegisterPEModule(HMODULE, u_long load_addr, u_long size, const char* name); -extern DBG_MODULE* DEBUG_RegisterELFModule(u_long load_addr, u_long size, +extern DBG_MODULE* DEBUG_RegisterELFModule(u_long load_addr, u_long size, const char* name); extern enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile, void* _nth, unsigned long nth_ofs); -extern void DEBUG_ReportDIL(enum DbgInfoLoad dil, const char* pfx, +extern void DEBUG_ReportDIL(enum DbgInfoLoad dil, const char* pfx, const char* filename, DWORD load_addr); extern void DEBUG_InfoShare(void); /* debugger/msc.c */ -extern enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo(DBG_MODULE* module, HANDLE hFile, +extern enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo(DBG_MODULE* module, HANDLE hFile, void* nth, unsigned long nth_ofs); -extern enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, - HANDLE hFile, void* nth, +extern enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, + HANDLE hFile, void* nth, unsigned long nth_ofs); extern void DEBUG_InitCVDataTypes(void); @@ -456,7 +456,7 @@ extern BOOL DEBUG_ValidateRegisters(void); /* debugger/source.c */ extern void DEBUG_ShowDir(void); extern void DEBUG_AddPath(const char * path); -extern void DEBUG_List(struct list_id * line1, struct list_id * line2, +extern void DEBUG_List(struct list_id * line1, struct list_id * line2, int delta); extern void DEBUG_NukePath(void); extern void DEBUG_Disassemble(const DBG_VALUE *, const DBG_VALUE*, int offset); @@ -467,40 +467,40 @@ extern void DEBUG_InfoStack(void); extern void DEBUG_BackTrace(DWORD threadID, BOOL noisy); extern int DEBUG_InfoLocals(void); extern int DEBUG_SetFrame(int newframe); -extern int DEBUG_GetCurrentFrame(struct name_hash ** name, +extern int DEBUG_GetCurrentFrame(struct name_hash ** name, unsigned int * eip, unsigned int * ebp); /* debugger/stabs.c */ extern enum DbgInfoLoad DEBUG_ReadExecutableDbgInfo(const char* exe_name); -extern enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, - unsigned int staboff, int stablen, +extern enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, + unsigned int staboff, int stablen, unsigned int strtaboff, int strtablen); /* debugger/types.c */ extern int DEBUG_nchar; extern void DEBUG_InitTypes(void); -extern struct datatype * DEBUG_NewDataType(enum debug_type xtype, +extern struct datatype * DEBUG_NewDataType(enum debug_type xtype, const char * typename); -extern unsigned int DEBUG_TypeDerefPointer(const DBG_VALUE *value, +extern unsigned int DEBUG_TypeDerefPointer(const DBG_VALUE *value, struct datatype ** newtype); -extern int DEBUG_AddStructElement(struct datatype * dt, - char * name, struct datatype * type, +extern int DEBUG_AddStructElement(struct datatype * dt, + char * name, struct datatype * type, int offset, int size); extern int DEBUG_SetStructSize(struct datatype * dt, int size); extern int DEBUG_SetPointerType(struct datatype * dt, struct datatype * dt2); extern int DEBUG_SetArrayParams(struct datatype * dt, int min, int max, struct datatype * dt2); extern void DEBUG_Print( const DBG_VALUE *addr, int count, char format, int level ); -extern unsigned int DEBUG_FindStructElement(DBG_VALUE * addr, +extern unsigned int DEBUG_FindStructElement(DBG_VALUE * addr, const char * ele_name, int * tmpbuf); extern struct datatype * DEBUG_GetPointerType(struct datatype * dt); extern int DEBUG_GetObjectSize(struct datatype * dt); -extern unsigned int DEBUG_ArrayIndex(const DBG_VALUE * addr, DBG_VALUE * result, +extern unsigned int DEBUG_ArrayIndex(const DBG_VALUE * addr, DBG_VALUE * result, int index); extern struct datatype * DEBUG_FindOrMakePointerType(struct datatype * reftype); extern long long int DEBUG_GetExprValue(const DBG_VALUE * addr, char ** format); -extern int DEBUG_SetBitfieldParams(struct datatype * dt, int offset, +extern int DEBUG_SetBitfieldParams(struct datatype * dt, int offset, int nbits, struct datatype * dt2); extern int DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2); extern enum debug_type DEBUG_GetType(struct datatype * dt); @@ -518,7 +518,7 @@ extern struct datatype * DEBUG_GetBasicType(enum debug_type_basic); extern void DEBUG_OutputA(int chn, const char* buffer, int len); extern void DEBUG_OutputW(int chn, const WCHAR* buffer, int len); #ifdef __GNUC__ -extern int DEBUG_Printf(int chn, const char* format, ...) __attribute__((format (printf,2,3))); +extern int DEBUG_Printf(int chn, const char* format, ...) __attribute__((format (printf,2,3))); #else extern int DEBUG_Printf(int chn, const char* format, ...); #endif diff --git a/debugger/display.c b/debugger/display.c index ce58c16219e..3219e4eb7a4 100644 --- a/debugger/display.c +++ b/debugger/display.c @@ -109,14 +109,14 @@ DEBUG_DoDisplay(void) DEBUG_Printf(DBG_CHN_MESG, " = "); if( displaypoints[i].format == 'i' ) { - DEBUG_ExamineMemory( &value, - displaypoints[i].count, + DEBUG_ExamineMemory( &value, + displaypoints[i].count, displaypoints[i].format); } else { - DEBUG_Print( &value, - displaypoints[i].count, + DEBUG_Print( &value, + displaypoints[i].count, displaypoints[i].format, 0); } } @@ -130,7 +130,7 @@ int DEBUG_DelDisplay(int displaynum) { int i; - + if( displaynum >= MAX_DISPLAY || displaynum == 0 || displaynum < -1 ) { DEBUG_Printf(DBG_CHN_MESG, "Invalid display number\n"); diff --git a/debugger/expr.c b/debugger/expr.c index 727a65990e5..ce6f9ba3b1e 100644 --- a/debugger/expr.c +++ b/debugger/expr.c @@ -351,7 +351,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp) break; case EXPR_TYPE_SYMBOL: if( !DEBUG_GetSymbolValue(exp->un.symbol.name, -1, &rtn, FALSE) ) - { + { DEBUG_Printf(DBG_CHN_MESG, "%s\n", exp->un.symbol.name); RaiseException(DEBUG_STATUS_NO_SYMBOL, 0, 0, NULL); } @@ -474,7 +474,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp) { RaiseException(DEBUG_STATUS_BAD_TYPE, 0, 0, NULL); } - if( exp1.type == DEBUG_GetBasicType(DT_BASIC_CONST_INT) && + if( exp1.type == DEBUG_GetBasicType(DT_BASIC_CONST_INT) && exp2.type == DEBUG_GetBasicType(DT_BASIC_CONST_INT) ) { rtn.type = exp1.type; @@ -643,11 +643,11 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp) * => exp1 is host, result is target * x is a pointer to internal variable x * => exp1 is host, result is host - * so we force DV_TARGET, because dereferencing pointers to + * so we force DV_TARGET, because dereferencing pointers to * internal variables is very unlikely. a correct fix would be * rather large. */ - rtn.cookie = DV_TARGET; + rtn.cookie = DV_TARGET; rtn.addr.off = (unsigned int) DEBUG_TypeDerefPointer(&exp1, &rtn.type); if (!rtn.type) { @@ -707,7 +707,7 @@ DEBUG_DisplayExpr(const struct expr * exp) DEBUG_Printf(DBG_CHN_MESG, "%d", exp->un.u_const.value); break; case EXPR_TYPE_STRING: - DEBUG_Printf(DBG_CHN_MESG, "\"%s\"", exp->un.string.str); + DEBUG_Printf(DBG_CHN_MESG, "\"%s\"", exp->un.string.str); break; case EXPR_TYPE_SYMBOL: DEBUG_Printf(DBG_CHN_MESG, "%s" , exp->un.symbol.name); diff --git a/debugger/ext_debugger.c b/debugger/ext_debugger.c index 2379bc9bffa..a42c07d46c9 100644 --- a/debugger/ext_debugger.c +++ b/debugger/ext_debugger.c @@ -1,4 +1,4 @@ -/* +/* * Convenience functions to handle use of external debugger. * * Copyright 1999 Kevin Holbrook @@ -104,7 +104,7 @@ void DEBUG_ExternalDebugger(void) const char *dbg_external; const char *dbg_wine_location; const char *dbg_no_xterm; - char pid_string[DBG_BUFF_SIZE]; + char pid_string[DBG_BUFF_SIZE]; /* check settings in environment for debugger to use */ @@ -134,15 +134,15 @@ void DEBUG_ExternalDebugger(void) if (dbg_no_xterm) status = execlp(dbg_external, dbg_external, dbg_wine_location, pid_string, NULL); else - status = execlp("xterm", "xterm", "-e", dbg_external, dbg_wine_location, pid_string, NULL); + status = execlp("xterm", "xterm", "-e", dbg_external, dbg_wine_location, pid_string, NULL); if (status == -1) { if (dbg_no_xterm) - fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"%s %s %s\" (%s)\n", + fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"%s %s %s\" (%s)\n", dbg_external, dbg_wine_location, pid_string, strerror(errno)); else - fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"xterm -e %s %s %s\" (%s)\n", + fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"xterm -e %s %s %s\" (%s)\n", dbg_external, dbg_wine_location, pid_string, strerror(errno)); } @@ -154,7 +154,7 @@ void DEBUG_ExternalDebugger(void) } else fprintf(stderr, "DEBUG_ExternalDebugger failed.\n"); - + } diff --git a/debugger/hash.c b/debugger/hash.c index 79b9d9c46e7..7d9fb89b8fa 100644 --- a/debugger/hash.c +++ b/debugger/hash.c @@ -60,7 +60,7 @@ struct name_hash int n_locals; int locals_alloc; WineLocals * local_vars; - + int n_lines; int lines_alloc; WineLineNo * linetab; @@ -88,7 +88,7 @@ static unsigned int name_hash( const char * name ) p = name; - while (*p) + while (*p) { hash = (hash << 4) + *p++; @@ -170,7 +170,7 @@ DEBUG_ResortSymbols(void) return; } - addr_sorttab = (struct name_hash **) DBG_realloc(addr_sorttab, + addr_sorttab = (struct name_hash **) DBG_realloc(addr_sorttab, nsym * sizeof(struct name_hash *)); nsym = 0; @@ -195,7 +195,7 @@ DEBUG_ResortSymbols(void) * Add a symbol to the table. */ struct name_hash * -DEBUG_AddSymbol( const char * name, const DBG_VALUE *value, +DEBUG_AddSymbol( const char * name, const DBG_VALUE *value, const char * source, int flags) { struct name_hash * new; @@ -248,7 +248,7 @@ DEBUG_AddSymbol( const char * name, const DBG_VALUE *value, * First see if we already have an entry for this symbol. If so * return it, so we don't end up with duplicates. */ - + new = (struct name_hash *) DBG_alloc(sizeof(struct name_hash)); new->value = *value; new->name = DBG_strdup(name); @@ -347,7 +347,7 @@ BOOL DEBUG_Normalize(struct name_hash * nh ) * * Get the address of a named symbol. */ -static int DEBUG_GSV_Helper(const char* name, const int lineno, +static int DEBUG_GSV_Helper(const char* name, const int lineno, DBG_VALUE* value, int num, int bp_flag) { struct name_hash* nh; @@ -369,7 +369,7 @@ static int DEBUG_GSV_Helper(const char* name, const int lineno, return i; } -BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, +BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, DBG_VALUE *rtn, int bp_flag ) { #define NUMDBGV 10 @@ -382,7 +382,7 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, if (!num && (name[0] != '_')) { char buffer[512]; - + assert(strlen(name) < sizeof(buffer) - 2); /* one for '_', one for '\0' */ buffer[0] = '_'; strcpy(buffer + 1, name); @@ -390,7 +390,7 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, } /* now get the local symbols if any */ - if (DEBUG_GetStackSymbolValue(name, &vtmp) && num < NUMDBGV) + if (DEBUG_GetStackSymbolValue(name, &vtmp) && num < NUMDBGV) { value[num] = vtmp; local = num; @@ -447,7 +447,7 @@ BOOL DEBUG_GetSymbolValue( const char * name, const int lineno, * * Get the address of a named symbol. */ -BOOL DEBUG_GetLineNumberAddr( const struct name_hash * nh, const int lineno, +BOOL DEBUG_GetLineNumberAddr( const struct name_hash * nh, const int lineno, DBG_ADDR *addr, int bp_flag ) { int i; @@ -584,13 +584,13 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag, low = 0; high = sorttab_nsym; if( addr_sorttab[0]->value.addr.seg > addr->seg - || ( addr_sorttab[0]->value.addr.seg == addr->seg + || ( addr_sorttab[0]->value.addr.seg == addr->seg && addr_sorttab[0]->value.addr.off > addr->off) ) { nearest = NULL; } else if( addr_sorttab[high - 1]->value.addr.seg < addr->seg - || ( addr_sorttab[high - 1]->value.addr.seg == addr->seg + || ( addr_sorttab[high - 1]->value.addr.seg == addr->seg && addr_sorttab[high - 1]->value.addr.off < addr->off) ) { nearest = addr_sorttab[high - 1]; @@ -602,10 +602,10 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag, mid = (high + low)/2; if( mid == low ) { - /* + /* * See if there are any other entries that might also * have the same address, and would also have a line - * number table. + * number table. */ if( mid > 0 && addr_sorttab[mid]->linetab == NULL ) { @@ -643,7 +643,7 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag, break; } if( (addr_sorttab[mid]->value.addr.seg < addr->seg) - || ( addr_sorttab[mid]->value.addr.seg == addr->seg + || ( addr_sorttab[mid]->value.addr.seg == addr->seg && addr_sorttab[mid]->value.addr.off <= addr->off) ) { low = mid; @@ -724,7 +724,7 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag, module = DEBUG_FindModuleByAddr((void*)DEBUG_ToLinear(addr), DMT_UNKNOWN); if (module) { char* ptr = strrchr(module->module_name, '/'); - + if (!ptr++) ptr = module->module_name; sprintf( modbuf, " in %s", ptr); } @@ -767,13 +767,13 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag, sourcefile = strrchr( nearest->sourcefile, '/' ); if (!sourcefile) sourcefile = nearest->sourcefile; else sourcefile++; - + if (addr->off == nearest->value.addr.off) - sprintf( name_buffer, "%s%s [%s%s]%s", nearest->name, + sprintf( name_buffer, "%s%s [%s%s]%s", nearest->name, arglist, sourcefile, lineinfo, modbuf); else sprintf( name_buffer, "%s+0x%lx%s [%s%s]%s", nearest->name, - addr->off - nearest->value.addr.off, + addr->off - nearest->value.addr.off, arglist, sourcefile, lineinfo, modbuf ); } else @@ -818,17 +818,17 @@ void DEBUG_ReadSymbolTable( const char* filename ) value.addr.seg = 0; value.addr.off = 0; value.cookie = DV_TARGET; - + while (1) { fgets( buffer, sizeof(buffer), symbolfile ); if (feof(symbolfile)) break; - + /* Strip any text after a # sign (i.e. comments) */ cpnt = buffer; while (*cpnt) if(*cpnt++ == '#') { *cpnt = 0; break; } - + /* Quietly ignore any lines that have just whitespace */ cpnt = buffer; while(*cpnt) @@ -837,7 +837,7 @@ void DEBUG_ReadSymbolTable( const char* filename ) cpnt++; } if (!(*cpnt) || *cpnt == '\n') continue; - + if (sscanf(buffer, "%lx %c %s", &value.addr.off, &type, name) == 3) DEBUG_AddSymbol( name, &value, NULL, SYM_WINE ); } @@ -846,7 +846,7 @@ void DEBUG_ReadSymbolTable( const char* filename ) void -DEBUG_AddLineNumber( struct name_hash * func, int line_num, +DEBUG_AddLineNumber( struct name_hash * func, int line_num, unsigned long offset ) { if( func == NULL ) @@ -869,7 +869,7 @@ DEBUG_AddLineNumber( struct name_hash * func, int line_num, struct wine_locals * -DEBUG_AddLocal( struct name_hash * func, int regno, +DEBUG_AddLocal( struct name_hash * func, int regno, int offset, int pc_start, int pc_end, @@ -942,13 +942,13 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr) low = 0; high = sorttab_nsym; if( addr_sorttab[0]->value.addr.seg > addr->seg - || ( addr_sorttab[0]->value.addr.seg == addr->seg + || ( addr_sorttab[0]->value.addr.seg == addr->seg && addr_sorttab[0]->value.addr.off > addr->off) ) { nearest = NULL; } else if( addr_sorttab[high - 1]->value.addr.seg < addr->seg - || ( addr_sorttab[high - 1]->value.addr.seg == addr->seg + || ( addr_sorttab[high - 1]->value.addr.seg == addr->seg && addr_sorttab[high - 1]->value.addr.off < addr->off) ) { nearest = addr_sorttab[high - 1]; @@ -960,10 +960,10 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr) mid = (high + low)/2; if( mid == low ) { - /* + /* * See if there are any other entries that might also * have the same address, and would also have a line - * number table. + * number table. */ if( mid > 0 && addr_sorttab[mid]->linetab == NULL ) { @@ -1001,7 +1001,7 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr) break; } if( (addr_sorttab[mid]->value.addr.seg < addr->seg) - || ( addr_sorttab[mid]->value.addr.seg == addr->seg + || ( addr_sorttab[mid]->value.addr.seg == addr->seg && addr_sorttab[mid]->value.addr.off <= addr->off) ) { low = mid; @@ -1078,7 +1078,7 @@ int DEBUG_CheckLinenoStatus( const DBG_ADDR *addr) * handler can deal with. */ void -DEBUG_GetFuncInfo( struct list_id * ret, const char * filename, +DEBUG_GetFuncInfo( struct list_id * ret, const char * filename, const char * name) { char buffer[256]; @@ -1185,14 +1185,14 @@ BOOL DEBUG_GetStackSymbolValue( const char * name, DBG_VALUE *value ) * comes up with RBRAC/LBRAC stabs in particular. */ if( (curr_func->local_vars[i].pc_start != 0) - && ((eip - curr_func->value.addr.off) + && ((eip - curr_func->value.addr.off) < curr_func->local_vars[i].pc_start) ) { continue; } if( (curr_func->local_vars[i].pc_end != 0) - && ((eip - curr_func->value.addr.off) + && ((eip - curr_func->value.addr.off) > curr_func->local_vars[i].pc_end) ) { continue; @@ -1209,11 +1209,11 @@ BOOL DEBUG_GetStackSymbolValue( const char * name, DBG_VALUE *value ) * Register variable. Point to DEBUG_context field. */ assert(curr_func->local_vars[i].regno - 1 < sizeof(reg_ofs)/sizeof(reg_ofs[0])); - value->addr.off = ((DWORD)&DEBUG_context) + + value->addr.off = ((DWORD)&DEBUG_context) + reg_ofs[curr_func->local_vars[i].regno - 1]; value->cookie = DV_HOST; } - else + else { value->addr.off = ebp + curr_func->local_vars[i].offset; value->cookie = DV_TARGET; @@ -1252,19 +1252,19 @@ DEBUG_InfoLocals(void) * comes up with RBRAC/LBRAC stabs in particular. */ if( (curr_func->local_vars[i].pc_start != 0) - && ((eip - curr_func->value.addr.off) + && ((eip - curr_func->value.addr.off) < curr_func->local_vars[i].pc_start) ) { continue; } if( (curr_func->local_vars[i].pc_end != 0) - && ((eip - curr_func->value.addr.off) + && ((eip - curr_func->value.addr.off) > curr_func->local_vars[i].pc_end) ) { continue; } - + DEBUG_PrintTypeCast(curr_func->local_vars[i].type); if( curr_func->local_vars[i].regno != 0 ) @@ -1278,7 +1278,7 @@ DEBUG_InfoLocals(void) } else { - DEBUG_READ_MEM_VERBOSE((void*)(ebp + curr_func->local_vars[i].offset), + DEBUG_READ_MEM_VERBOSE((void*)(ebp + curr_func->local_vars[i].offset), &val, sizeof(val)); DEBUG_Printf(DBG_CHN_MESG, " %s == 0x%8.8x\n", curr_func->local_vars[i].name, val); diff --git a/debugger/info.c b/debugger/info.c index d17b0600354..0bc4e6d9a2e 100644 --- a/debugger/info.c +++ b/debugger/info.c @@ -38,39 +38,39 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format ) { char * default_format; long long int res; - + assert(value->cookie == DV_TARGET || value->cookie == DV_HOST); - if (value->type == NULL) + if (value->type == NULL) { DEBUG_Printf(DBG_CHN_MESG, "Unable to evaluate expression\n"); return; } - + default_format = NULL; res = DEBUG_GetExprValue(value, &default_format); - + switch (format) { case 'x': - if (value->addr.seg) + if (value->addr.seg) { DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "0x%04lx", (long unsigned int)res); } - else + else { DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "0x%08lx", (long unsigned int)res); } break; - + case 'd': DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "%ld\n", (long int)res); break; - + case 'c': DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "%d = '%c'", (char)(res & 0xff), (char)(res & 0xff)); break; - + case 'u': { WCHAR wch = (WCHAR)(res & 0xFFFF); @@ -79,7 +79,7 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format ) DEBUG_Printf(DBG_CHN_MESG, "'"); } break; - + case 'i': case 's': case 'w': @@ -92,27 +92,27 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format ) { char* ptr; int state = 0; - + /* FIXME: simplistic implementation for default_format being * foo%Sbar => will print foo, then string then bar */ - for (ptr = default_format; *ptr; ptr++) + for (ptr = default_format; *ptr; ptr++) { - if (*ptr == '%') - { + if (*ptr == '%') + { state++; - } - else if (state == 1) + } + else if (state == 1) { - if (*ptr == 'S') + if (*ptr == 'S') { DBG_ADDR addr; - + addr.seg = 0; addr.off = (long)res; DEBUG_nchar += DEBUG_PrintStringA(DBG_CHN_MESG, &addr, -1); } - else + else { /* shouldn't happen */ DEBUG_Printf(DBG_CHN_MESG, "%%%c", *ptr); @@ -126,7 +126,7 @@ void DEBUG_PrintBasic( const DBG_VALUE* value, int count, char format ) DEBUG_nchar++; } } - } + } else if (strcmp(default_format, "%B") == 0) { DEBUG_nchar += DEBUG_Printf(DBG_CHN_MESG, "%s", res ? "true" : "false"); @@ -151,7 +151,7 @@ DEBUG_PrintAddress( const DBG_ADDR *addr, enum dbg_mode mode, int flag ) { struct symbol_info rtn; - const char *name = DEBUG_FindNearestSymbol( addr, flag, &rtn.sym, 0, + const char *name = DEBUG_FindNearestSymbol( addr, flag, &rtn.sym, 0, &rtn.list ); if (addr->seg) DEBUG_Printf( DBG_CHN_MESG, "0x%04lx:", addr->seg&0xFFFF ); @@ -173,7 +173,7 @@ DEBUG_PrintAddressAndArgs( const DBG_ADDR *addr, enum dbg_mode mode, { struct symbol_info rtn; - const char *name = DEBUG_FindNearestSymbol( addr, flag, &rtn.sym, ebp, + const char *name = DEBUG_FindNearestSymbol( addr, flag, &rtn.sym, ebp, &rtn.list ); if (addr->seg) DEBUG_Printf( DBG_CHN_MESG, "0x%04lx:", addr->seg ); @@ -274,7 +274,7 @@ void DEBUG_InfoClass(const char* name) } DEBUG_Printf(DBG_CHN_MESG, "Class '%s':\n", name); - DEBUG_Printf(DBG_CHN_MESG, + DEBUG_Printf(DBG_CHN_MESG, "style=%08x wndProc=%08lx\n" "inst=%p icon=%p cursor=%p bkgnd=%p\n" "clsExtra=%d winExtra=%d\n", @@ -282,7 +282,7 @@ void DEBUG_InfoClass(const char* name) wca.hIcon, wca.hCursor, wca.hbrBackground, wca.cbClsExtra, wca.cbWndExtra); - /* FIXME: + /* FIXME: * + print #windows (or even list of windows...) * + print extra bytes => this requires a window handle on this very class... */ @@ -298,7 +298,7 @@ static void DEBUG_InfoClass2(HWND hWnd, const char* name) } DEBUG_Printf(DBG_CHN_MESG, "Class '%s':\n", name); - DEBUG_Printf(DBG_CHN_MESG, + DEBUG_Printf(DBG_CHN_MESG, "style=%08x wndProc=%08lx\n" "inst=%p icon=%p cursor=%p bkgnd=%p\n" "clsExtra=%d winExtra=%d\n", @@ -402,20 +402,20 @@ void DEBUG_InfoWindow(HWND hWnd) "inst=%p active=%p idmenu=%08lx\n" "style=%08lx exstyle=%08lx wndproc=%08lx text='%s'\n" "client=%d,%d-%d,%d window=%d,%d-%d,%d sysmenu=%p\n", - GetWindow(hWnd, GW_HWNDNEXT), + GetWindow(hWnd, GW_HWNDNEXT), GetWindow(hWnd, GW_CHILD), - GetParent(hWnd), + GetParent(hWnd), GetWindow(hWnd, GW_OWNER), clsName, - (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE), + (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE), GetLastActivePopup(hWnd), GetWindowLong(hWnd, GWL_ID), GetWindowLong(hWnd, GWL_STYLE), GetWindowLong(hWnd, GWL_EXSTYLE), GetWindowLong(hWnd, GWL_WNDPROC), - wndName, - clientRect.left, clientRect.top, clientRect.right, clientRect.bottom, - windowRect.left, windowRect.top, windowRect.right, windowRect.bottom, + wndName, + clientRect.left, clientRect.top, clientRect.right, clientRect.bottom, + windowRect.left, windowRect.top, windowRect.right, windowRect.bottom, GetSystemMenu(hWnd, FALSE)); if (GetClassLong(hWnd, GCL_CBWNDEXTRA)) { @@ -441,7 +441,7 @@ void DEBUG_WalkWindows(HWND hWnd, int indent) hWnd = GetDesktopWindow(); if (!indent) /* first time around */ - DEBUG_Printf(DBG_CHN_MESG, + DEBUG_Printf(DBG_CHN_MESG, "%-16.16s %-17.17s %-8.8s %s\n", "hwnd", "Class Name", " Style", " WndProc Text"); @@ -450,7 +450,7 @@ void DEBUG_WalkWindows(HWND hWnd, int indent) strcpy(clsName, "-- Unknown --"); if (!GetWindowText(hWnd, wndName, sizeof(wndName))) strcpy(wndName, "-- Empty --"); - + /* FIXME: missing hmemTaskQ */ DEBUG_Printf(DBG_CHN_MESG, "%*s%04x%*s", indent, "", (UINT)hWnd, 13-indent,""); DEBUG_Printf(DBG_CHN_MESG, "%-17.17s %08lx %08lx %.14s\n", @@ -515,12 +515,12 @@ void DEBUG_WalkThreads(void) { DBG_PROCESS* p = DEBUG_GetProcess(entry.th32OwnerProcessID); - DEBUG_Printf(DBG_CHN_MESG, "%08lx%s %s\n", + DEBUG_Printf(DBG_CHN_MESG, "%08lx%s %s\n", entry.th32OwnerProcessID, p ? " (D)" : "", p ? p->imageName : ""); lastProcessId = entry.th32OwnerProcessID; } DEBUG_Printf(DBG_CHN_MESG, "\t%08lx %4ld%s\n", - entry.th32ThreadID, entry.tpBasePri, + entry.th32ThreadID, entry.tpBasePri, (entry.th32ThreadID == current) ? " <==" : ""); } @@ -549,7 +549,7 @@ void DEBUG_InfoSegments(DWORD start, int length) if (!GetThreadSelectorEntry(DEBUG_CurrThread->handle, (i << 3)|7, &le)) continue; - if (le.HighWord.Bits.Type & 0x08) + if (le.HighWord.Bits.Type & 0x08) { flags[0] = (le.HighWord.Bits.Type & 0x2) ? 'r' : '-'; flags[1] = '-'; @@ -561,12 +561,12 @@ void DEBUG_InfoSegments(DWORD start, int length) flags[1] = (le.HighWord.Bits.Type & 0x2) ? 'w' : '-'; flags[2] = '-'; } - DEBUG_Printf(DBG_CHN_MESG, + DEBUG_Printf(DBG_CHN_MESG, "%04lx: sel=%04lx base=%08x limit=%08x %d-bit %c%c%c\n", - i, (i<<3)|7, - (le.HighWord.Bits.BaseHi << 24) + + i, (i<<3)|7, + (le.HighWord.Bits.BaseHi << 24) + (le.HighWord.Bits.BaseMid << 16) + le.BaseLow, - ((le.HighWord.Bits.LimitHi << 8) + le.LimitLow) << + ((le.HighWord.Bits.LimitHi << 8) + le.LimitLow) << (le.HighWord.Bits.Granularity ? 12 : 0), le.HighWord.Bits.Default_Big ? 32 : 16, flags[0], flags[1], flags[2] ); diff --git a/debugger/memory.c b/debugger/memory.c index ea622d8000a..52151a5ded5 100644 --- a/debugger/memory.c +++ b/debugger/memory.c @@ -71,7 +71,7 @@ enum dbg_mode DEBUG_GetSelectorType( WORD sel ) if (IS_VM86_MODE()) return MODE_VM86; if (sel == 0) return MODE_32; - if (GetThreadSelectorEntry( DEBUG_CurrThread->handle, sel, &le)) + if (GetThreadSelectorEntry( DEBUG_CurrThread->handle, sel, &le)) return le.HighWord.Bits.Default_Big ? MODE_32 : MODE_16; /* selector doesn't exist */ return MODE_INVALID; @@ -80,7 +80,7 @@ enum dbg_mode DEBUG_GetSelectorType( WORD sel ) #endif } #ifdef __i386__ -void DEBUG_FixAddress( DBG_ADDR *addr, DWORD def) +void DEBUG_FixAddress( DBG_ADDR *addr, DWORD def) { if (addr->seg == 0xffffffff) addr->seg = def; if (DEBUG_IsSelectorSystem(addr->seg)) addr->seg = 0; @@ -98,12 +98,12 @@ DWORD DEBUG_ToLinear( const DBG_ADDR *addr ) { #ifdef __i386__ LDT_ENTRY le; - + if (IS_VM86_MODE()) return (DWORD)(LOWORD(addr->seg) << 4) + addr->off; if (DEBUG_IsSelectorSystem(addr->seg)) return addr->off; - + if (GetThreadSelectorEntry( DEBUG_CurrThread->handle, addr->seg, &le)) { return (le.HighWord.Bits.BaseHi << 24) + (le.HighWord.Bits.BaseMid << 16) + le.BaseLow + addr->off; } @@ -151,7 +151,7 @@ void DEBUG_InvalLinAddr( void* addr ) * * Read a memory value. */ -/* FIXME: this function is now getting closer and closer to +/* FIXME: this function is now getting closer and closer to * DEBUG_ExprGetValue. They should be merged... */ int DEBUG_ReadMemory( const DBG_VALUE* val ) @@ -171,7 +171,7 @@ int DEBUG_ReadMemory( const DBG_VALUE* val ) DEBUG_FixAddress( &addr, DEBUG_context.SegDs ); #endif lin = (void*)DEBUG_ToLinear( &addr ); - + DEBUG_READ_MEM_VERBOSE(lin, &value, os); } else { if (val->addr.off) @@ -218,7 +218,7 @@ BOOL DEBUG_GrabAddress( DBG_VALUE* value, BOOL fromCode ) assert(value->cookie == DV_TARGET || value->cookie == DV_HOST); #ifdef __i386__ - DEBUG_FixAddress( &value->addr, + DEBUG_FixAddress( &value->addr, (fromCode) ? DEBUG_context.SegCs : DEBUG_context.SegDs); #endif @@ -303,10 +303,10 @@ void DEBUG_ExamineMemory( const DBG_VALUE *_value, int count, char format ) DEBUG_Printf(DBG_CHN_MESG,"\n"); \ } \ return -#define DO_DUMP(_t,_l,_f) DO_DUMP2(_t,_l,_f,_v) +#define DO_DUMP(_t,_l,_f) DO_DUMP2(_t,_l,_f,_v) case 'x': DO_DUMP(int, 4, " %8.8x"); - case 'd': DO_DUMP(unsigned int, 4, " %10d"); + case 'd': DO_DUMP(unsigned int, 4, " %10d"); case 'w': DO_DUMP(unsigned short, 8, " %04x"); case 'c': DO_DUMP2(char, 32, " %c", (_v < 0x20) ? ' ' : _v); case 'b': DO_DUMP2(char, 16, " %02x", (_v) & 0xff); diff --git a/debugger/module.c b/debugger/module.c index 3ecd97d264e..460e27b7aeb 100644 --- a/debugger/module.c +++ b/debugger/module.c @@ -28,10 +28,10 @@ #include "winuser.h" /*********************************************************************** - * Creates and links a new module to the current process + * Creates and links a new module to the current process * */ -DBG_MODULE* DEBUG_AddModule(const char* name, enum DbgModuleType type, +DBG_MODULE* DEBUG_AddModule(const char* name, enum DbgModuleType type, void* mod_addr, u_long size, HMODULE hmodule) { DBG_MODULE* wmod; @@ -65,10 +65,10 @@ DBG_MODULE* DEBUG_FindModuleByName(const char* name, enum DbgModuleType type) { int i; DBG_MODULE** amod = DEBUG_CurrProcess->modules; - + for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) { if ((type == DMT_UNKNOWN || type == amod[i]->type) && - !strcasecmp(name, amod[i]->module_name)) + !strcasecmp(name, amod[i]->module_name)) return amod[i]; } return NULL; @@ -77,7 +77,7 @@ DBG_MODULE* DEBUG_FindModuleByName(const char* name, enum DbgModuleType type) /*********************************************************************** * DEBUG_FindModuleByAddr * - * either the addr where module is loaded, or any address inside the + * either the addr where module is loaded, or any address inside the * module */ DBG_MODULE* DEBUG_FindModuleByAddr(void* addr, enum DbgModuleType type) @@ -85,7 +85,7 @@ DBG_MODULE* DEBUG_FindModuleByAddr(void* addr, enum DbgModuleType type) int i; DBG_MODULE** amod = DEBUG_CurrProcess->modules; DBG_MODULE* res = NULL; - + for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) { if ((type == DMT_UNKNOWN || type == amod[i]->type) && (u_long)addr >= (u_long)amod[i]->load_addr && @@ -105,10 +105,10 @@ DBG_MODULE* DEBUG_FindModuleByHandle(HANDLE handle, enum DbgModuleType type) { int i; DBG_MODULE** amod = DEBUG_CurrProcess->modules; - + for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) { - if ((type == DMT_UNKNOWN || type == amod[i]->type) && - handle == amod[i]->handle) + if ((type == DMT_UNKNOWN || type == amod[i]->type) && + handle == amod[i]->handle) return amod[i]; } return NULL; @@ -120,7 +120,7 @@ DBG_MODULE* DEBUG_FindModuleByHandle(HANDLE handle, enum DbgModuleType type) DBG_MODULE* DEBUG_GetProcessMainModule(DBG_PROCESS* process) { if (!process || !process->num_modules) return NULL; - + /* main module is the first to be loaded on a given process, so it's the first * in the array */ assert(process->modules[0]->main); @@ -180,7 +180,7 @@ DBG_MODULE* DEBUG_RegisterNEModule(HMODULE hModule, void* load_addr, u_long size * Helper function fo DEBUG_LoadModuleEPs16: * finds the address of a given entry point from a given module */ -static BOOL DEBUG_GetEP16(char* moduleAddr, const NE_MODULE* module, +static BOOL DEBUG_GetEP16(char* moduleAddr, const NE_MODULE* module, WORD ordinal, DBG_ADDR* addr) { void* idx; @@ -196,18 +196,18 @@ static BOOL DEBUG_GetEP16(char* moduleAddr, const NE_MODULE* module, if (!DEBUG_READ_MEM_VERBOSE(idx, &bundle, sizeof(bundle))) return FALSE; } while ((ordinal < bundle.first + 1) || (ordinal > bundle.last)); - - if (!DEBUG_READ_MEM_VERBOSE((char*)idx + sizeof(ET_BUNDLE) + - (ordinal - bundle.first - 1) * sizeof(ET_ENTRY), + + if (!DEBUG_READ_MEM_VERBOSE((char*)idx + sizeof(ET_BUNDLE) + + (ordinal - bundle.first - 1) * sizeof(ET_ENTRY), &entry, sizeof(ET_ENTRY))) return FALSE; - + addr->seg = entry.segnum; addr->off = entry.offs; - + if (addr->seg == 0xfe) addr->seg = 0xffff; /* constant entry */ else { - if (!DEBUG_READ_MEM_VERBOSE(moduleAddr + module->seg_table + + if (!DEBUG_READ_MEM_VERBOSE(moduleAddr + module->seg_table + sizeof(ste) * (addr->seg - 1), &ste, sizeof(ste))) return FALSE; @@ -235,16 +235,16 @@ static void DEBUG_LoadModule16(HMODULE hModule, NE_MODULE* module, char* moduleA value.cookie = DV_TARGET; value.addr.seg = 0; value.addr.off = 0; - + cpnt = moduleAddr + module->name_table; - + /* First search the resident names */ - + /* skip module name */ if (!DEBUG_READ_MEM_VERBOSE(cpnt, buf, sizeof(buf)) || !buf[0]) return; cpnt += 1 + buf[0] + sizeof(WORD); - + while (DEBUG_READ_MEM_VERBOSE(cpnt, buf, sizeof(buf)) && buf[0]) { sprintf(epname, "%s.%.*s", name, buf[0], &buf[1]); if (DEBUG_GetEP16(moduleAddr, module, *(WORD*)&buf[1 + buf[0]], &value.addr)) { @@ -252,7 +252,7 @@ static void DEBUG_LoadModule16(HMODULE hModule, NE_MODULE* module, char* moduleA } cpnt += buf[0] + 1 + sizeof(WORD); } - + /* Now search the non-resident names table */ if (!module->nrname_handle) return; /* No non-resident table */ cpnt = (char *)GlobalLock16(module->nrname_handle); @@ -286,10 +286,10 @@ void DEBUG_LoadModule32(const char* name, HANDLE hFile, DWORD base) &nth_ofs, sizeof(nth_ofs)) || !DEBUG_READ_MEM_VERBOSE((void*)(base + nth_ofs), &pe_header, sizeof(pe_header))) return; - + pe_seg_ofs = nth_ofs + OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader) + pe_header.FileHeader.SizeOfOptionalHeader; - + for (i = 0; i < pe_header.FileHeader.NumberOfSections; i++, pe_seg_ofs += sizeof(pe_seg)) { if (!DEBUG_READ_MEM_VERBOSE((void*)(base + pe_seg_ofs), &pe_seg, sizeof(pe_seg))) continue; @@ -304,7 +304,7 @@ void DEBUG_LoadModule32(const char* name, HANDLE hFile, DWORD base) if (dil != DIL_LOADED) dil = DEBUG_RegisterMSCDebugInfo(wmod, hFile, &pe_header, nth_ofs); if (dil != DIL_LOADED) - dil = DEBUG_RegisterPEDebugInfo(wmod, hFile, &pe_header, nth_ofs); + dil = DEBUG_RegisterPEDebugInfo(wmod, hFile, &pe_header, nth_ofs); wmod->dil = dil; } @@ -333,14 +333,14 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile, value.cookie = DV_TARGET; value.addr.seg = 0; value.addr.off = 0; - + /* Add start of DLL */ value.addr.off = base; if ((prefix = strrchr(wmod->module_name, '\\' ))) prefix++; else prefix = wmod->module_name; DEBUG_AddSymbol(prefix, &value, NULL, SYM_WIN32 | SYM_FUNC); - + /* Add entry point */ snprintf(buffer, sizeof(buffer), "%s.EntryPoint", prefix); value.addr.off = base + nth->OptionalHeader.AddressOfEntryPoint; @@ -349,7 +349,7 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile, /* Add start of sections */ pe_seg_ofs = nth_ofs + OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader) + nth->FileHeader.SizeOfOptionalHeader; - + for (i = 0; i < nth->FileHeader.NumberOfSections; i++, pe_seg_ofs += sizeof(pe_seg)) { if (!DEBUG_READ_MEM_VERBOSE((void*)(base + pe_seg_ofs), &pe_seg, sizeof(pe_seg))) continue; @@ -357,10 +357,10 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile, value.addr.off = base + pe_seg.VirtualAddress; DEBUG_AddSymbol(buffer, &value, NULL, SYM_WIN32 | SYM_FUNC); } - + /* Add exported functions */ - dir_ofs = nth_ofs + - OFFSET_OF(IMAGE_NT_HEADERS, + dir_ofs = nth_ofs + + OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT]); if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir_ofs), &dir, sizeof(dir)) && dir.Size) { IMAGE_EXPORT_DIRECTORY exports; @@ -368,18 +368,18 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile, void** functions = NULL; DWORD* names = NULL; unsigned int j; - - if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir.VirtualAddress), + + if (DEBUG_READ_MEM_VERBOSE((void*)(base + dir.VirtualAddress), &exports, sizeof(exports)) && - + ((functions = DBG_alloc(sizeof(functions[0]) * exports.NumberOfFunctions))) && DEBUG_READ_MEM_VERBOSE((void*)(base + (DWORD)exports.AddressOfFunctions), functions, sizeof(functions[0]) * exports.NumberOfFunctions) && - + ((ordinals = DBG_alloc(sizeof(ordinals[0]) * exports.NumberOfNames))) && DEBUG_READ_MEM_VERBOSE((void*)(base + (DWORD)exports.AddressOfNameOrdinals), ordinals, sizeof(ordinals[0]) * exports.NumberOfNames) && - + ((names = DBG_alloc(sizeof(names[0]) * exports.NumberOfNames))) && DEBUG_READ_MEM_VERBOSE((void*)(base + (DWORD)exports.AddressOfNames), names, sizeof(names[0]) * exports.NumberOfNames)) { @@ -393,7 +393,7 @@ enum DbgInfoLoad DEBUG_RegisterPEDebugInfo(DBG_MODULE* wmod, HANDLE hFile, value.addr.off = base + (DWORD)functions[ordinals[i]]; DEBUG_AddSymbol(buffer, &value, NULL, SYM_WIN32 | SYM_FUNC); } - + for (i = 0; i < exports.NumberOfFunctions; i++) { if (!functions[i]) continue; /* Check if we already added it with a name */ @@ -448,7 +448,7 @@ int DEBUG_LoadEntryPoints(const char* pfx) rowcount = 3 + (pfx ? strlen(pfx) : 0); first = 1; } - + len = strlen(entry.szModule); if ((rowcount + len) > 76) { DEBUG_Printf(DBG_CHN_MESG, "\n "); @@ -456,12 +456,12 @@ int DEBUG_LoadEntryPoints(const char* pfx) } DEBUG_Printf(DBG_CHN_MESG, " %s", entry.szModule); rowcount += len + 1; - + DEBUG_LoadModule16(entry.hModule, &module, moduleAddr, entry.szModule); } while (ModuleNext16(&entry)); #endif - - if (first) DEBUG_Printf(DBG_CHN_MESG, "\n"); + + if (first) DEBUG_Printf(DBG_CHN_MESG, "\n"); return first; } @@ -470,23 +470,23 @@ void DEBUG_ReportDIL(enum DbgInfoLoad dil, const char* pfx, const char* filename const char* fmt; switch (dil) { - case DIL_DEFERRED: + case DIL_DEFERRED: fmt = "Deferring debug information loading for %s '%s' (0x%08x)\n"; break; - case DIL_LOADED: - fmt = "Loaded debug information from %s '%s' (0x%08x)\n"; + case DIL_LOADED: + fmt = "Loaded debug information from %s '%s' (0x%08x)\n"; break; - case DIL_NOINFO: - fmt = "No debug information in %s '%s' (0x%08x)\n"; + case DIL_NOINFO: + fmt = "No debug information in %s '%s' (0x%08x)\n"; break; - case DIL_ERROR: - fmt = "Can't find file for %s '%s' (0x%08x)\n"; + case DIL_ERROR: + fmt = "Can't find file for %s '%s' (0x%08x)\n"; break; - default: - DEBUG_Printf(DBG_CHN_ERR, "Oooocch (%d)\n", dil); + default: + DEBUG_Printf(DBG_CHN_ERR, "Oooocch (%d)\n", dil); return; } - + DEBUG_Printf(DBG_CHN_MESG, fmt, pfx, filename, load_addr); } @@ -496,7 +496,7 @@ static const char* DEBUG_GetModuleType(enum DbgModuleType type) case DMT_NE: return "NE"; case DMT_PE: return "PE"; case DMT_ELF: return "ELF"; - default: return "???";; + default: return "???"; } } @@ -519,7 +519,7 @@ static const char* DEBUG_GetDbgInfo(enum DbgInfoLoad dil) */ static int DEBUG_ModuleCompare(const void* p1, const void* p2) { - return (*((const DBG_MODULE**)p1))->load_addr - + return (*((const DBG_MODULE**)p1))->load_addr - (*((const DBG_MODULE**)p2))->load_addr; } @@ -528,22 +528,22 @@ static int DEBUG_ModuleCompare(const void* p1, const void* p2) * * returns TRUE is wmod_child is contained (inside bounds) of wmod_cntnr */ -static inline BOOL DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr, +static inline BOOL DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr, const DBG_MODULE* wmod_child) { return wmod_cntnr->load_addr < wmod_child->load_addr && - (DWORD)wmod_cntnr->load_addr + wmod_cntnr->size > + (DWORD)wmod_cntnr->load_addr + wmod_cntnr->size > (DWORD)wmod_child->load_addr + wmod_child->size; } static void DEBUG_InfoShareModule(const DBG_MODULE* module, int ident) { if (ident) DEBUG_Printf(DBG_CHN_MESG, " \\-"); - DEBUG_Printf(DBG_CHN_MESG, "%s\t0x%08lx-%08lx\t%s\n", + DEBUG_Printf(DBG_CHN_MESG, "%s\t0x%08lx-%08lx\t%s\n", DEBUG_GetModuleType(module->type), (DWORD)module->load_addr, (DWORD)module->load_addr + module->size, module->module_name); -} +} /*********************************************************************** * DEBUG_InfoShare @@ -554,16 +554,16 @@ void DEBUG_InfoShare(void) { DBG_MODULE** ref; int i, j; - + ref = DBG_alloc(sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules); if (!ref) return; - - DEBUG_Printf(DBG_CHN_MESG, "Module\tAddress\t\t\tName\t%d modules\n", + + DEBUG_Printf(DBG_CHN_MESG, "Module\tAddress\t\t\tName\t%d modules\n", DEBUG_CurrProcess->num_modules); - - memcpy(ref, DEBUG_CurrProcess->modules, + + memcpy(ref, DEBUG_CurrProcess->modules, sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules); - qsort(ref, DEBUG_CurrProcess->num_modules, sizeof(DBG_MODULE*), + qsort(ref, DEBUG_CurrProcess->num_modules, sizeof(DBG_MODULE*), DEBUG_ModuleCompare); for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) { switch (ref[i]->type) { @@ -582,7 +582,7 @@ void DEBUG_InfoShare(void) DEBUG_IsContainer(ref[j], ref[i])) break; } - if (j >= DEBUG_CurrProcess->num_modules) + if (j >= DEBUG_CurrProcess->num_modules) DEBUG_InfoShareModule(ref[i], 0); break; default: @@ -621,21 +621,21 @@ void DEBUG_WalkModules(void) { DBG_MODULE** amod; int i; - + DEBUG_Printf(DBG_CHN_MESG, "Address\t\t\tModule\tName\n"); - + amod = DBG_alloc(sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules); if (!amod) return; - - memcpy(amod, DEBUG_CurrProcess->modules, + + memcpy(amod, DEBUG_CurrProcess->modules, sizeof(DBG_MODULE*) * DEBUG_CurrProcess->num_modules); - qsort(amod, DEBUG_CurrProcess->num_modules, sizeof(DBG_MODULE*), + qsort(amod, DEBUG_CurrProcess->num_modules, sizeof(DBG_MODULE*), DEBUG_ModuleCompare); for (i = 0; i < DEBUG_CurrProcess->num_modules; i++) { if (amod[i]->type == DMT_ELF) continue; - - DEBUG_Printf(DBG_CHN_MESG, "0x%08lx-%08lx\t(%s)\t%s\n", - (DWORD)amod[i]->load_addr, + + DEBUG_Printf(DBG_CHN_MESG, "0x%08lx-%08lx\t(%s)\t%s\n", + (DWORD)amod[i]->load_addr, (DWORD)amod[i]->load_addr + amod[i]->size, DEBUG_GetModuleType(amod[i]->type), amod[i]->module_name); } diff --git a/debugger/msc.c b/debugger/msc.c index a3172d2ed9d..f18933cbbf1 100644 --- a/debugger/msc.c +++ b/debugger/msc.c @@ -74,7 +74,7 @@ static void DEBUG_LocateDebugInfoFile(const char *filename, char *dbg_filename) char *str2 = DBG_alloc(MAX_PATHNAME_LEN*10); const char *file; char *name_part; - + file = strrchr(filename, '\\'); if( file == NULL ) file = filename; else file++; @@ -121,7 +121,7 @@ static void* DEBUG_MapDebugInfoFile(const char* name, DWORD offset, DWORD size, if ((*hMap = CreateFileMapping(*hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == 0) return NULL; - + if ((ret = MapViewOfFile(*hMap, FILE_MAP_READ, 0, g_offset, g_size)) != NULL) ret += offset - g_offset; @@ -178,7 +178,7 @@ static const char* DEBUG_GetCoffName( PIMAGE_SYMBOL coff_sym, const char* coff_s { nampnt = coff_strtab + coff_sym->N.Name.Long; } - + if( nampnt[0] == '_' ) nampnt++; return nampnt; @@ -193,7 +193,7 @@ static int DEBUG_AddCoffFile( struct CoffFileSet* coff_files, const char* filena coff_files->nfiles_alloc += 10; coff_files->files = (struct CoffFile *) DBG_realloc(coff_files->files, coff_files->nfiles_alloc * sizeof(struct CoffFile)); - } + } file = coff_files->files + coff_files->nfiles; file->startaddr = 0xffffffff; file->endaddr = 0; @@ -202,7 +202,7 @@ static int DEBUG_AddCoffFile( struct CoffFileSet* coff_files, const char* filena file->linecnt = 0; file->entries = NULL; file->neps = file->neps_alloc = 0; - + return coff_files->nfiles++; } @@ -211,8 +211,8 @@ static void DEBUG_AddCoffSymbol( struct CoffFile* coff_file, struct name_hash* s if( coff_file->neps + 1 >= coff_file->neps_alloc ) { coff_file->neps_alloc += 10; - coff_file->entries = (struct name_hash **) - DBG_realloc(coff_file->entries, + coff_file->entries = (struct name_hash **) + DBG_realloc(coff_file->entries, coff_file->neps_alloc * sizeof(struct name_hash *)); } coff_file->entries[coff_file->neps++] = sym; @@ -246,7 +246,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) coff_files.files = NULL; coff_files.nfiles = coff_files.nfiles_alloc = 0; - + coff = (PIMAGE_COFF_SYMBOLS_HEADER) root; coff_symbols = (PIMAGE_SYMBOL) ((unsigned int) coff + coff->LvaToFirstSymbol); @@ -305,7 +305,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) aux->Section.NumberOfLinenumbers, aux->Section.Number, aux->Section.Selection); - DEBUG_Printf(DBG_CHN_TRACE, "More sect %d %s %08lx %d %d %d\n", + DEBUG_Printf(DBG_CHN_TRACE, "More sect %d %s %08lx %d %d %d\n", coff_sym->SectionNumber, DEBUG_GetCoffName( coff_sym, coff_strtab ), coff_sym->Value, @@ -337,12 +337,12 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) { coff_files.files[curr_file_idx].startaddr = coff_sym->Value; } - + if( coff_files.files[curr_file_idx].endaddr < coff_sym->Value + aux->Section.Length ) { coff_files.files[curr_file_idx].endaddr = coff_sym->Value + aux->Section.Length; } - + coff_files.files[curr_file_idx].linetab_offset = linetab_indx; coff_files.files[curr_file_idx].linecnt = aux->Section.NumberOfLinenumbers; linetab_indx += aux->Section.NumberOfLinenumbers; @@ -370,9 +370,9 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) #endif /* FIXME: was adding symbol to this_file ??? */ - DEBUG_AddCoffSymbol( &coff_files.files[curr_file_idx], - DEBUG_AddSymbol( nampnt, &new_value, - coff_files.files[curr_file_idx].filename, + DEBUG_AddCoffSymbol( &coff_files.files[curr_file_idx], + DEBUG_AddSymbol( nampnt, &new_value, + coff_files.files[curr_file_idx].filename, SYM_WIN32 | SYM_FUNC ) ); i += naux; continue; @@ -392,7 +392,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) #ifdef MORE_DBG DEBUG_Printf(DBG_CHN_TRACE, "%d: %lx %s\n", i, new_value.addr.off, nampnt); - DEBUG_Printf(DBG_CHN_TRACE,"\tAdding global symbol %s (sect=%s)\n", + DEBUG_Printf(DBG_CHN_TRACE,"\tAdding global symbol %s (sect=%s)\n", nampnt, MSC_INFO(module)->sectp[coff_sym->SectionNumber - 1].Name); #endif @@ -409,7 +409,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) } } if (j < coff_files.nfiles) { - DEBUG_AddCoffSymbol( &coff_files.files[j], + DEBUG_AddCoffSymbol( &coff_files.files[j], DEBUG_AddSymbol( nampnt, &new_value, this_file, SYM_WIN32 | SYM_FUNC ) ); } else { DEBUG_AddSymbol( nampnt, &new_value, NULL, SYM_WIN32 | SYM_FUNC ); @@ -444,7 +444,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) i += naux; continue; } - + if( (coff_sym->StorageClass == IMAGE_SYM_CLASS_STATIC) && (naux == 0) ) { @@ -457,7 +457,7 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) } #ifdef MORE_DBG - DEBUG_Printf(DBG_CHN_TRACE,"Skipping unknown entry '%s' %d %d %d\n", + DEBUG_Printf(DBG_CHN_TRACE,"Skipping unknown entry '%s' %d %d %d\n", DEBUG_GetCoffName( coff_sym, coff_strtab ), coff_sym->StorageClass, coff_sym->SectionNumber, naux); #endif @@ -466,9 +466,9 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) * For now, skip past the aux entries. */ i += naux; - + } - + /* * OK, we now should have a list of files, and we should have a list * of entrypoints. We need to sort the entrypoints so that we are @@ -518,10 +518,10 @@ static enum DbgInfoLoad DEBUG_ProcessCoff( DBG_MODULE *module, LPBYTE root ) * first. */ DEBUG_GetSymbolAddr(coff_files.files[j].entries[l], &new_value.addr); - DEBUG_AddLineNumber(coff_files.files[j].entries[l], + DEBUG_AddLineNumber(coff_files.files[j].entries[l], linepnt->Linenumber, - (unsigned int) module->load_addr - + linepnt->Type.VirtualAddress + (unsigned int) module->load_addr + + linepnt->Type.VirtualAddress - new_value.addr.off); } } @@ -1164,7 +1164,7 @@ numeric_leaf( int *value, unsigned short int *leaf ) *value = type; } else - { + { switch ( type ) { case LF_CHAR: @@ -1275,7 +1275,7 @@ terminate_string( unsigned char *name ) return symname; } -static +static struct datatype * DEBUG_GetCVType(unsigned int typeno) { struct datatype * dt = NULL; @@ -1305,7 +1305,7 @@ DEBUG_AddCVType( unsigned int typeno, struct datatype *dt ) while ( typeno - 0x1000 >= num_cv_defined_types ) { num_cv_defined_types += 0x100; - cv_defined_types = (struct datatype **) + cv_defined_types = (struct datatype **) DBG_realloc( cv_defined_types, num_cv_defined_types * sizeof(struct datatype *) ); @@ -1334,12 +1334,12 @@ DEBUG_ClearTypeTable( void ) static int DEBUG_AddCVType_Pointer( unsigned int typeno, unsigned int datatype ) { - struct datatype *dt = + struct datatype *dt = DEBUG_FindOrMakePointerType( DEBUG_GetCVType( datatype ) ); return DEBUG_AddCVType( typeno, dt ); } - + static int DEBUG_AddCVType_Array( unsigned int typeno, char *name, unsigned int elemtype, unsigned int arr_len ) @@ -1351,10 +1351,10 @@ DEBUG_AddCVType_Array( unsigned int typeno, char *name, DEBUG_SetArrayParams( dt, 0, arr_max, elem ); return DEBUG_AddCVType( typeno, dt ); -} +} static int -DEBUG_AddCVType_Bitfield( unsigned int typeno, +DEBUG_AddCVType_Bitfield( unsigned int typeno, unsigned int bitoff, unsigned int nbits, unsigned int basetype ) { @@ -1364,7 +1364,7 @@ DEBUG_AddCVType_Bitfield( unsigned int typeno, DEBUG_SetBitfieldParams( dt, bitoff, nbits, base ); return DEBUG_AddCVType( typeno, dt ); } - + static int DEBUG_AddCVType_EnumFieldList( unsigned int typeno, unsigned char *list, int len ) { @@ -1388,7 +1388,7 @@ DEBUG_AddCVType_EnumFieldList( unsigned int typeno, unsigned char *list, int len int value, vlen = numeric_leaf( &value, &type->enumerate.value ); unsigned char *name = (unsigned char *)&type->enumerate.value + vlen; - DEBUG_AddStructElement( dt, terminate_string( name ), + DEBUG_AddStructElement( dt, terminate_string( name ), NULL, value, 0 ); ptr += 2 + 2 + vlen + (1 + name[0]); @@ -1404,7 +1404,7 @@ DEBUG_AddCVType_EnumFieldList( unsigned int typeno, unsigned char *list, int len return DEBUG_AddCVType( typeno, dt ); } - + static int DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int len ) { @@ -1477,7 +1477,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l struct datatype *subtype = DEBUG_GetCVType( type->member.type ); int elem_size = subtype? DEBUG_GetObjectSize( subtype ) : 0; - DEBUG_AddStructElement( dt, terminate_string( name ), + DEBUG_AddStructElement( dt, terminate_string( name ), subtype, offset << 3, elem_size << 3 ); ptr += 2 + 2 + 2 + olen + (1 + name[0]); @@ -1492,7 +1492,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l struct datatype *subtype = DEBUG_GetCVType( type->member32.type ); int elem_size = subtype? DEBUG_GetObjectSize( subtype ) : 0; - DEBUG_AddStructElement( dt, terminate_string( name ), + DEBUG_AddStructElement( dt, terminate_string( name ), subtype, offset << 3, elem_size << 3 ); ptr += 2 + 2 + 4 + olen + (1 + name[0]); @@ -1533,7 +1533,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l /* FIXME: ignored for now */ ptr += 2 + 2; break; - + case LF_VFUNCTAB_32: /* FIXME: ignored for now */ ptr += 2 + 2 + 4; @@ -1560,7 +1560,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l case 4: case 6: /* (pure) introducing virtual method */ ptr += 2 + 2 + 4 + 4 + (1 + type->onemethod32_virt.name[0]); break; - + default: ptr += 2 + 2 + 4 + (1 + type->onemethod32.name[0]); break; @@ -1576,7 +1576,7 @@ DEBUG_AddCVType_StructFieldList( unsigned int typeno, unsigned char *list, int l return DEBUG_AddCVType( typeno, dt ); } - + static int DEBUG_AddCVType_Enum( unsigned int typeno, char *name, unsigned int fieldlist ) { @@ -1646,12 +1646,12 @@ DEBUG_ParseTypeTable( char *table, int len ) } case LF_BITFIELD: - retv = DEBUG_AddCVType_Bitfield( curr_type, type->bitfield.bitoff, + retv = DEBUG_AddCVType_Bitfield( curr_type, type->bitfield.bitoff, type->bitfield.nbits, type->bitfield.type ); break; case LF_BITFIELD_32: - retv = DEBUG_AddCVType_Bitfield( curr_type, type->bitfield32.bitoff, + retv = DEBUG_AddCVType_Bitfield( curr_type, type->bitfield32.bitoff, type->bitfield32.nbits, type->bitfield32.type ); break; @@ -1742,7 +1742,7 @@ DEBUG_ParseTypeTable( char *table, int len ) curr_type++; ptr += type->generic.len + 2; } - + return TRUE; } @@ -1819,7 +1819,7 @@ DEBUG_SnarfLinetab(char * linetab, * There is one header for each segment, so that we can reach in * and pull bits as required. */ - lt_hdr = (struct codeview_linetab_hdr *) + lt_hdr = (struct codeview_linetab_hdr *) DBG_alloc((nseg + 1) * sizeof(*lt_hdr)); if( lt_hdr == NULL ) { @@ -1865,7 +1865,7 @@ DEBUG_SnarfLinetab(char * linetab, lt_hdr[this_seg].segno = *pnt2.s++; lt_hdr[this_seg].nline = *pnt2.s++; lt_hdr[this_seg].offtab = pnt2.ui; - lt_hdr[this_seg].linetab = (unsigned short *) + lt_hdr[this_seg].linetab = (unsigned short *) (pnt2.ui + lt_hdr[this_seg].nline); } } @@ -2039,7 +2039,7 @@ union codeview_symbol -static unsigned int +static unsigned int DEBUG_MapCVOffset( DBG_MODULE *module, unsigned int offset ) { int nomap = module->msc_info->nomap; @@ -2060,7 +2060,7 @@ DEBUG_MapCVOffset( DBG_MODULE *module, unsigned int offset ) static struct name_hash * DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen, int type, unsigned int seg, unsigned int offset, - int size, int cookie, int flags, + int size, int cookie, int flags, struct codeview_linetab_hdr *linetab ) { int nsect = module->msc_info->nsect; @@ -2074,7 +2074,7 @@ DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen, * Some sanity checks */ - if ( !name || !namelen ) + if ( !name || !namelen ) return NULL; if ( !seg || seg > nsect ) @@ -2087,7 +2087,7 @@ DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen, value.cookie = cookie; value.addr.seg = 0; - value.addr.off = (unsigned int) module->load_addr + + value.addr.off = (unsigned int) module->load_addr + DEBUG_MapCVOffset( module, sectp[seg-1].VirtualAddress + offset ); memcpy( symname, name, namelen ); @@ -2112,8 +2112,8 @@ DEBUG_AddCVSymbol( DBG_MODULE *module, char *name, int namelen, /* * Create Wine symbol record - */ - symbol = DEBUG_AddSymbol( symname, &value, + */ + symbol = DEBUG_AddSymbol( symname, &value, linetab? linetab->sourcefile : NULL, flags ); if ( size ) @@ -2181,7 +2181,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size, case S_LDATA: case S_PUB: DEBUG_AddCVSymbol( module, sym->data.name, sym->data.namelen, - sym->data.symtype, sym->data.seg, + sym->data.symtype, sym->data.seg, sym->data.offset, 0, DV_TARGET, SYM_WIN32 | SYM_DATA, NULL ); break; @@ -2189,7 +2189,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size, case S_LDATA_32: case S_PUB_32: DEBUG_AddCVSymbol( module, sym->data32.name, sym->data32.namelen, - sym->data32.symtype, sym->data32.seg, + sym->data32.symtype, sym->data32.seg, sym->data32.offset, 0, DV_TARGET, SYM_WIN32 | SYM_DATA, NULL ); break; @@ -2201,7 +2201,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size, */ case S_THUNK: DEBUG_AddCVSymbol( module, sym->thunk.name, sym->thunk.namelen, - 0, sym->thunk.segment, + 0, sym->thunk.segment, sym->thunk.offset, sym->thunk.thunk_len, DV_TARGET, SYM_WIN32 | SYM_FUNC, NULL ); break; @@ -2214,7 +2214,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size, DEBUG_Normalize( curr_func ); curr_func = DEBUG_AddCVSymbol( module, sym->proc.name, sym->proc.namelen, - sym->proc.proctype, sym->proc.segment, + sym->proc.proctype, sym->proc.segment, sym->proc.offset, sym->proc.proc_len, DV_TARGET, SYM_WIN32 | SYM_FUNC, linetab ); @@ -2225,7 +2225,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size, DEBUG_Normalize( curr_func ); curr_func = DEBUG_AddCVSymbol( module, sym->proc32.name, sym->proc32.namelen, - sym->proc32.proctype, sym->proc32.segment, + sym->proc32.proctype, sym->proc32.segment, sym->proc32.offset, sym->proc32.proc_len, DV_TARGET, SYM_WIN32 | SYM_FUNC, linetab ); @@ -2250,7 +2250,7 @@ DEBUG_SnarfCodeView( DBG_MODULE *module, LPBYTE root, int offset, int size, * These are special, in that they are always followed by an * additional length-prefixed string which is *not* included * into the symbol length count. We need to skip it. - */ + */ case S_PROCREF: case S_DATAREF: case S_LPROCREF: @@ -2511,7 +2511,7 @@ static void pdb_convert_types_header( PDB_TYPES *types, char *image ) } } -static void pdb_convert_symbols_header( PDB_SYMBOLS *symbols, +static void pdb_convert_symbols_header( PDB_SYMBOLS *symbols, int *header_size, char *image ) { memset( symbols, 0, sizeof(PDB_SYMBOLS) ); @@ -2542,7 +2542,7 @@ static void pdb_convert_symbols_header( PDB_SYMBOLS *symbols, } } -static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module, +static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module, const char *filename, DWORD timestamp ) { enum DbgInfoLoad dil = DIL_ERROR; @@ -2619,7 +2619,7 @@ static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module, } - /* + /* * Check .PDB time stamp */ @@ -2629,23 +2629,23 @@ static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module, filename, root->TimeDateStamp, timestamp ); } - /* + /* * Read type table */ DEBUG_ParseTypeTable( types_image + types.type_offset, types.type_size ); - + /* * Read type-server .PDB imports */ if ( symbols.pdbimport_size ) - { + { /* FIXME */ DEBUG_Printf(DBG_CHN_ERR, "-Type server .PDB imports ignored!\n" ); } - /* + /* * Read global symbol table */ @@ -2704,10 +2704,10 @@ static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module, file_name += strlen(file_name) + 1; file = (char *)( (DWORD)(file_name + strlen(file_name) + 1 + 3) & ~3 ); } - + dil = DIL_LOADED; - leave: + leave: /* * Cleanup @@ -2735,22 +2735,22 @@ static enum DbgInfoLoad DEBUG_ProcessPDBFile( DBG_MODULE *module, #define CODEVIEW_NB09_SIG ( 'N' | ('B' << 8) | ('0' << 16) | ('9' << 24) ) #define CODEVIEW_NB10_SIG ( 'N' | ('B' << 8) | ('1' << 16) | ('0' << 24) ) #define CODEVIEW_NB11_SIG ( 'N' | ('B' << 8) | ('1' << 16) | ('1' << 24) ) - + typedef struct _CODEVIEW_HEADER { DWORD dwSignature; DWORD lfoDirectory; - + } CODEVIEW_HEADER, *PCODEVIEW_HEADER; - + typedef struct _CODEVIEW_PDB_DATA { DWORD timestamp; DWORD unknown; CHAR name[ 1 ]; - + } CODEVIEW_PDB_DATA, *PCODEVIEW_PDB_DATA; - + typedef struct _CV_DIRECTORY_HEADER { WORD cbDirHeader; @@ -2758,16 +2758,16 @@ typedef struct _CV_DIRECTORY_HEADER DWORD cDir; DWORD lfoNextDir; DWORD flags; - + } CV_DIRECTORY_HEADER, *PCV_DIRECTORY_HEADER; - + typedef struct _CV_DIRECTORY_ENTRY { WORD subsection; WORD iMod; DWORD lfo; DWORD cb; - + } CV_DIRECTORY_ENTRY, *PCV_DIRECTORY_ENTRY; @@ -2779,7 +2779,7 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root ) { PCODEVIEW_HEADER cv = (PCODEVIEW_HEADER)root; enum DbgInfoLoad dil = DIL_ERROR; - + switch ( cv->dwSignature ) { case CODEVIEW_NB09_SIG: @@ -2792,16 +2792,16 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root ) ent = (PCV_DIRECTORY_ENTRY)((LPBYTE)hdr + hdr->cbDirHeader); for ( i = 0; i < hdr->cDir; i++, ent = next ) { - next = (i == hdr->cDir-1)? NULL : + next = (i == hdr->cDir-1)? NULL : (PCV_DIRECTORY_ENTRY)((LPBYTE)ent + hdr->cbDirEntry); - prev = (i == 0)? NULL : + prev = (i == 0)? NULL : (PCV_DIRECTORY_ENTRY)((LPBYTE)ent - hdr->cbDirEntry); if ( ent->subsection == sstAlignSym ) { /* * Check the next and previous entry. If either is a - * sstSrcModule, it contains the line number info for + * sstSrcModule, it contains the line number info for * this file. * * FIXME: This is not a general solution! @@ -2815,7 +2815,7 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root ) if ( prev && prev->iMod == ent->iMod && prev->subsection == sstSrcModule ) linetab = DEBUG_SnarfLinetab( root + prev->lfo, prev->cb ); - + DEBUG_SnarfCodeView( module, root + ent->lfo, sizeof(DWORD), ent->cb, linetab ); @@ -2825,7 +2825,7 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root ) dil = DIL_LOADED; break; } - + case CODEVIEW_NB10_SIG: { PCODEVIEW_PDB_DATA pdb = (PCODEVIEW_PDB_DATA)(cv + 1); @@ -2833,9 +2833,9 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root ) dil = DEBUG_ProcessPDBFile( module, pdb->name, pdb->timestamp ); break; } - + default: - DEBUG_Printf( DBG_CHN_ERR, "Unknown CODEVIEW signature %08lX in module %s\n", + DEBUG_Printf( DBG_CHN_ERR, "Unknown CODEVIEW signature %08lX in module %s\n", cv->dwSignature, module->module_name ); break; } @@ -2847,9 +2847,9 @@ static enum DbgInfoLoad DEBUG_ProcessCodeView( DBG_MODULE *module, LPBYTE root ) /*======================================================================== * Process debug directory. */ -static enum DbgInfoLoad DEBUG_ProcessDebugDirectory( DBG_MODULE *module, +static enum DbgInfoLoad DEBUG_ProcessDebugDirectory( DBG_MODULE *module, LPBYTE file_map, - PIMAGE_DEBUG_DIRECTORY dbg, + PIMAGE_DEBUG_DIRECTORY dbg, int nDbg ) { enum DbgInfoLoad dil = DIL_ERROR; @@ -2916,14 +2916,14 @@ typedef struct _FPO_DATA { /*======================================================================== * Process DBG file. */ -static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module, +static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module, const char *filename, DWORD timestamp ) { enum DbgInfoLoad dil = DIL_ERROR; HANDLE hFile = INVALID_HANDLE_VALUE, hMap = 0; LPBYTE file_map = NULL; PIMAGE_SEPARATE_DEBUG_HEADER hdr; - PIMAGE_DEBUG_DIRECTORY dbg; + PIMAGE_DEBUG_DIRECTORY dbg; int nDbg; @@ -2950,8 +2950,8 @@ static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module, } - dbg = (PIMAGE_DEBUG_DIRECTORY) ( file_map + sizeof(*hdr) - + hdr->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) + dbg = (PIMAGE_DEBUG_DIRECTORY) ( file_map + sizeof(*hdr) + + hdr->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) + hdr->ExportedNamesSize ); nDbg = hdr->DebugDirectorySize / sizeof(*dbg); @@ -2968,7 +2968,7 @@ static enum DbgInfoLoad DEBUG_ProcessDBGFile( DBG_MODULE *module, /*======================================================================== * Process MSC debug information in PE file. */ -enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile, +enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile, void *_nth, unsigned long nth_ofs ) { enum DbgInfoLoad dil = DIL_ERROR; @@ -2989,7 +2989,7 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile, if ( !extra_info.sectp ) goto leave; - if ( !DEBUG_READ_MEM_VERBOSE( (char *)module->load_addr + + if ( !DEBUG_READ_MEM_VERBOSE( (char *)module->load_addr + nth_ofs + OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader) + nth->FileHeader.SizeOfOptionalHeader, extra_info.sectp, @@ -2999,14 +2999,14 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile, /* Read in debug directory */ nDbg = dir->Size / sizeof(IMAGE_DEBUG_DIRECTORY); - if ( !nDbg ) + if ( !nDbg ) goto leave; dbg = (PIMAGE_DEBUG_DIRECTORY) DBG_alloc( nDbg * sizeof(IMAGE_DEBUG_DIRECTORY) ); - if ( !dbg ) + if ( !dbg ) goto leave; - if ( !DEBUG_READ_MEM_VERBOSE( (char *)module->load_addr + dir->VirtualAddress, + if ( !DEBUG_READ_MEM_VERBOSE( (char *)module->load_addr + dir->VirtualAddress, dbg, nDbg * sizeof(IMAGE_DEBUG_DIRECTORY) ) ) goto leave; @@ -3025,10 +3025,10 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile, PIMAGE_DEBUG_MISC misc = (PIMAGE_DEBUG_MISC)(file_map + dbg->PointerToRawData); - if ( nDbg != 1 || dbg->Type != IMAGE_DEBUG_TYPE_MISC + if ( nDbg != 1 || dbg->Type != IMAGE_DEBUG_TYPE_MISC || misc->DataType != IMAGE_DEBUG_MISC_EXENAME ) { - DEBUG_Printf( DBG_CHN_ERR, "-Debug info stripped, but no .DBG file in module %s\n", + DEBUG_Printf( DBG_CHN_ERR, "-Debug info stripped, but no .DBG file in module %s\n", module->module_name ); goto leave; } @@ -3048,14 +3048,14 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile, PIMAGE_NT_HEADERS mpd_nth = (PIMAGE_NT_HEADERS)(file_map + nth_ofs); PIMAGE_DATA_DIRECTORY mpd_dir; PIMAGE_DEBUG_DIRECTORY mpd_dbg = NULL; - + /* sanity checks */ - if ( mpd_nth->Signature != IMAGE_NT_SIGNATURE || + if ( mpd_nth->Signature != IMAGE_NT_SIGNATURE || mpd_nth->FileHeader.NumberOfSections != nth->FileHeader.NumberOfSections || !(mpd_nth->FileHeader.Characteristics & IMAGE_FILE_DEBUG_STRIPPED )) goto leave; mpd_dir = mpd_nth->OptionalHeader.DataDirectory + IMAGE_DIRECTORY_ENTRY_DEBUG; - + if ((mpd_dir->Size / sizeof(IMAGE_DEBUG_DIRECTORY)) != nDbg) goto leave; @@ -3079,7 +3079,7 @@ enum DbgInfoLoad DEBUG_RegisterMSCDebugInfo( DBG_MODULE *module, HANDLE hFile, * look for stabs information in PE header (it's how mingw compiler provides its * debugging information), and also wine PE <-> ELF linking through .wsolnk sections */ -enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile, +enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile, void* _nth, unsigned long nth_ofs) { IMAGE_SECTION_HEADER pe_seg; @@ -3093,7 +3093,7 @@ enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile, nth->FileHeader.SizeOfOptionalHeader; for (i = 0; i < nth->FileHeader.NumberOfSections; i++, pe_seg_ofs += sizeof(pe_seg)) { - if (!DEBUG_READ_MEM_VERBOSE((void*)((char *)module->load_addr + pe_seg_ofs), + if (!DEBUG_READ_MEM_VERBOSE((void*)((char *)module->load_addr + pe_seg_ofs), &pe_seg, sizeof(pe_seg))) continue; @@ -3111,7 +3111,7 @@ enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile, if (s1) { if (DEBUG_READ_MEM_VERBOSE((char*)module->load_addr + stabs, s1, stabsize) && - DEBUG_READ_MEM_VERBOSE((char*)module->load_addr + stabstr, + DEBUG_READ_MEM_VERBOSE((char*)module->load_addr + stabstr, s1 + stabsize, stabstrsize)) { dil = DEBUG_ParseStabs(s1, 0, 0, stabsize, stabsize, stabstrsize); } else { @@ -3119,7 +3119,7 @@ enum DbgInfoLoad DEBUG_RegisterStabsDebugInfo(DBG_MODULE* module, HANDLE hFile, } DBG_free(s1); } else { - DEBUG_Printf(DBG_CHN_MESG, "couldn't alloc %d bytes\n", + DEBUG_Printf(DBG_CHN_MESG, "couldn't alloc %d bytes\n", stabsize + stabstrsize); } } else { diff --git a/debugger/registers.c b/debugger/registers.c index 04b9b1e1257..2ea54e3ad53 100644 --- a/debugger/registers.c +++ b/debugger/registers.c @@ -84,7 +84,7 @@ char *DEBUG_Flags( DWORD flag, char *buf ) /*********************************************************************** * DEBUG_InfoRegisters * - * Display registers information. + * Display registers information. */ void DEBUG_InfoRegisters(void) { @@ -113,11 +113,11 @@ void DEBUG_InfoRegisters(void) { char flag[33]; - DEBUG_Printf( DBG_CHN_MESG, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx(%s)\n", + DEBUG_Printf( DBG_CHN_MESG, "\n EIP:%08lx ESP:%08lx EBP:%08lx EFLAGS:%08lx(%s)\n", DEBUG_context.Eip, DEBUG_context.Esp, DEBUG_context.Ebp, DEBUG_context.EFlags, DEBUG_Flags(DEBUG_context.EFlags, flag)); - DEBUG_Printf( DBG_CHN_MESG, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n", + DEBUG_Printf( DBG_CHN_MESG, " EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n", DEBUG_context.Eax, DEBUG_context.Ebx, DEBUG_context.Ecx, DEBUG_context.Edx ); DEBUG_Printf( DBG_CHN_MESG, " ESI:%08lx EDI:%08lx\n", diff --git a/debugger/source.c b/debugger/source.c index b9db16f3396..3c382167b60 100644 --- a/debugger/source.c +++ b/debugger/source.c @@ -156,7 +156,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end) break; } } - + } if( ol == NULL ) @@ -186,14 +186,14 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end) * Now append the base file name. */ strcat(tmppath, basename); - + status = stat(tmppath, &statbuf); if( status != -1 ) { break; } } - + if( sl == NULL ) { char zbuf[256]; @@ -202,12 +202,12 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end) */ sprintf(zbuf, "Enter path to file '%s': ", sourcefile); DEBUG_ReadLine(zbuf, tmppath, sizeof(tmppath), FALSE, FALSE); - + if( tmppath[strlen(tmppath)-1] == '\n' ) { tmppath[strlen(tmppath)-1] = '\0'; } - + if( tmppath[strlen(tmppath)-1] != '/' ) { strcat(tmppath, "/"); @@ -216,7 +216,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end) * Now append the base file name. */ strcat(tmppath, basename); - + status = stat(tmppath, &statbuf); if( status == -1 ) { @@ -302,14 +302,14 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end) { return FALSE; } - + addr = mmap(0, ol->size, PROT_READ, MAP_PRIVATE, fd, 0); if( addr == (char *) -1 ) { return FALSE; } } - + /* * All we need to do is to display the source lines here. */ @@ -325,7 +325,7 @@ DEBUG_DisplaySource(char * sourcefile, int start, int end) memset(&buffer, 0, sizeof(buffer)); if( ol->linelist[i+1] != ol->linelist[i] ) { - memcpy(&buffer, addr + ol->linelist[i], + memcpy(&buffer, addr + ol->linelist[i], (ol->linelist[i+1] - ol->linelist[i]) - 1); } DEBUG_Printf(DBG_CHN_MESG,"%d\t%s\n", i + 1, buffer); @@ -351,10 +351,10 @@ DEBUG_List(struct list_id * source1, struct list_id * source2, * We need to see what source file we need. Hopefully we only have * one specified, otherwise we might as well punt. */ - if( source1 != NULL - && source2 != NULL + if( source1 != NULL + && source2 != NULL && source1->sourcefile != NULL - && source2->sourcefile != NULL + && source2->sourcefile != NULL && strcmp(source1->sourcefile, source2->sourcefile) != 0 ) { DEBUG_Printf(DBG_CHN_MESG, "Ambiguous source file specification.\n"); @@ -367,8 +367,8 @@ DEBUG_List(struct list_id * source1, struct list_id * source2, sourcefile = source1->sourcefile; } - if( sourcefile == NULL - && source2 != NULL + if( sourcefile == NULL + && source2 != NULL && source2->sourcefile != NULL ) { sourcefile = source2->sourcefile; diff --git a/debugger/stabs.c b/debugger/stabs.c index 7824dd1b15b..2cd53e74886 100644 --- a/debugger/stabs.c +++ b/debugger/stabs.c @@ -129,11 +129,11 @@ static int cu_include_stk_idx = 0; static struct datatype** cu_vector = NULL; static int cu_nrofentries = 0; -static -int +static +int DEBUG_CreateInclude(const char* file, unsigned long val) { - if (num_include_def == num_alloc_include_def) + if (num_include_def == num_alloc_include_def) { num_alloc_include_def += 256; include_defs = DBG_realloc(include_defs, sizeof(include_defs[0])*num_alloc_include_def); @@ -143,35 +143,35 @@ DEBUG_CreateInclude(const char* file, unsigned long val) include_defs[num_include_def].value = val; include_defs[num_include_def].vector = NULL; include_defs[num_include_def].nrofentries = 0; - + return num_include_def++; } -static -int +static +int DEBUG_FindInclude(const char* file, unsigned long val) { int i; - - for (i = 0; i < num_include_def; i++) + + for (i = 0; i < num_include_def; i++) { - if (val == include_defs[i].value && + if (val == include_defs[i].value && strcmp(file, include_defs[i].name) == 0) return i; } return -1; } -static +static int DEBUG_AddInclude(int idx) { ++cu_include_stk_idx; - + /* is this happen, just bump MAX_INCLUDES */ /* we could also handle this as another dynarray */ assert(cu_include_stk_idx < MAX_INCLUDES); - + cu_include_stack[cu_include_stk_idx] = idx; return cu_include_stk_idx; } @@ -193,10 +193,10 @@ void DEBUG_FreeIncludes(void) { int i; - + DEBUG_ResetIncludes(); - - for (i = 0; i < num_include_def; i++) + + for (i = 0; i < num_include_def; i++) { DBG_free(include_defs[i].name); DBG_free(include_defs[i].vector); @@ -212,18 +212,18 @@ DEBUG_FreeIncludes(void) static struct datatype** -DEBUG_FileSubNr2StabEnum(int filenr, int subnr) +DEBUG_FileSubNr2StabEnum(int filenr, int subnr) { struct datatype** ret; - + /* DEBUG_Printf(DBG_CHN_MESG, "creating type id for (%d,%d)\n", filenr, subnr); */ - + /* FIXME: I could perhaps create a dummy include_def for each compilation * unit which would allow not to handle those two cases separately */ - if (filenr == 0) + if (filenr == 0) { - if (cu_nrofentries <= subnr) + if (cu_nrofentries <= subnr) { cu_vector = DBG_realloc(cu_vector, sizeof(cu_vector[0])*(subnr+1)); memset(cu_vector+cu_nrofentries, 0, sizeof(cu_vector[0])*(subnr+1-cu_nrofentries)); @@ -234,11 +234,11 @@ DEBUG_FileSubNr2StabEnum(int filenr, int subnr) else { include_def* idef; - + assert(filenr <= cu_include_stk_idx); - + idef = &include_defs[cu_include_stack[filenr]]; - + if (idef->nrofentries <= subnr) { idef->vector = DBG_realloc(idef->vector, sizeof(idef->vector[0])*(subnr+1)); @@ -251,7 +251,7 @@ DEBUG_FileSubNr2StabEnum(int filenr, int subnr) return ret; } -static +static struct datatype** DEBUG_ReadTypeEnum(char **x) { int filenr,subnr; @@ -303,7 +303,7 @@ static int DEBUG_PTS_ReadNum(struct ParseTypedefData* ptd, int* v) return 0; } -static int DEBUG_PTS_ReadTypeReference(struct ParseTypedefData* ptd, +static int DEBUG_PTS_ReadTypeReference(struct ParseTypedefData* ptd, int* filenr, int* subnr) { if (*ptd->ptr == '(') { @@ -320,7 +320,7 @@ static int DEBUG_PTS_ReadTypeReference(struct ParseTypedefData* ptd, return 0; } -static int DEBUG_PTS_ReadRange(struct ParseTypedefData* ptd, struct datatype** dt, +static int DEBUG_PTS_ReadRange(struct ParseTypedefData* ptd, struct datatype** dt, int* lo, int* hi) { /* type ';' ';' ';' */ @@ -350,7 +350,7 @@ static inline int DEBUG_PTS_ReadAggregate(struct ParseTypedefData* ptd, struct d * but don't store results into the struct * FIXME: there's a quite ugly memory leak in there... */ - + /* Now parse the individual elements of the structure/union. */ while (*ptd->ptr != ';') { /* agg_name : type ',' ',' */ @@ -396,7 +396,7 @@ static inline int DEBUG_PTS_ReadArray(struct ParseTypedefData* ptd, struct datat struct datatype* rdt; /* ar;;; */ - + if (*ptd->ptr++ != 'r') return -1; /* FIXME: range type is lost, always assume int */ if (DEBUG_PTS_ReadRange(ptd, &rdt, &lo, &hi) == -1) return -1; @@ -470,7 +470,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen } else if (!dt1 && !dt2) { new_dt = NULL; } else { - DEBUG_Printf(DBG_CHN_MESG, "Unknown condition %08lx %08lx (%s)\n", + DEBUG_Printf(DBG_CHN_MESG, "Unknown condition %08lx %08lx (%s)\n", (unsigned long)dt1, (unsigned long)dt2, ptd->ptr); return -1; } @@ -502,13 +502,13 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen dt2 = DEBUG_TypeCast(DT_STRUCT, typename); if (!dt1) { new_dt = DEBUG_NewDataType(DT_STRUCT, typename); - /* we need to set it here, because a struct can hold a pointer - * to itself + /* we need to set it here, because a struct can hold a pointer + * to itself */ *DEBUG_FileSubNr2StabEnum(filenr1, subnr1) = new_dt; } else { if (DEBUG_GetType(dt1) != DT_STRUCT) { - DEBUG_Printf(DBG_CHN_MESG, + DEBUG_Printf(DBG_CHN_MESG, "Forward declaration is not an aggregate\n"); return -1; } @@ -524,10 +524,10 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen case 's': case 'u': lo = DT_STRUCT; break; default: return -1; } - + idx = ptd->idx; if (DEBUG_PTS_ReadID(ptd) == -1) return -1; - new_dt = DEBUG_NewDataType(lo, ptd->buf + idx); + new_dt = DEBUG_NewDataType(lo, ptd->buf + idx); ptd->idx = idx; break; case '-': @@ -538,7 +538,7 @@ static int DEBUG_PTS_ReadTypedef(struct ParseTypedefData* ptd, const char* typen enum debug_type_basic basic = DT_BASIC_LAST; switch (lo) { - case 1: basic = DT_BASIC_INT; break; + case 1: basic = DT_BASIC_INT; break; case 2: basic = DT_BASIC_CHAR; break; case 3: basic = DT_BASIC_SHORTINT; break; case 4: basic = DT_BASIC_LONGINT; break; @@ -622,7 +622,7 @@ static int DEBUG_ParseTypedefStab(char* ptr, const char* typename) int ret = -1; /* check for already existing definition */ - + ptd.idx = 0; if ((ptd.ptr = strchr(ptr, ':'))) { ptd.ptr++; @@ -659,7 +659,7 @@ DEBUG_ParseStabType(const char * stab) */ if (*c != '(') c++; - /* + /* * The next is either an integer or a (integer,integer). * The DEBUG_ReadTypeEnum takes care that stab_types is large enough. */ @@ -667,7 +667,7 @@ DEBUG_ParseStabType(const char * stab) } enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, - unsigned int staboff, int stablen, + unsigned int staboff, int stablen, unsigned int strtaboff, int strtablen) { struct name_hash * curr_func = NULL; @@ -794,7 +794,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, new_value.cookie = DV_TARGET; stab_strcpy(symname, sizeof(symname), ptr); - curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath, + curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath, SYM_WINE | SYM_DATA ); break; case N_PSYM: @@ -804,7 +804,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, if( curr_func != NULL && !in_external_file ) { stab_strcpy(symname, sizeof(symname), ptr); - curr_loc = DEBUG_AddLocal( curr_func, 0, + curr_loc = DEBUG_AddLocal( curr_func, 0, stab_ptr->n_value, 0, 0, symname ); DEBUG_SetLocalSymbolType( curr_loc, DEBUG_ParseStabType(ptr) ); } @@ -813,7 +813,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, if( curr_func != NULL && !in_external_file ) { stab_strcpy(symname, sizeof(symname), ptr); - curr_loc = DEBUG_AddLocal( curr_func, stab_ptr->n_value + 1, + curr_loc = DEBUG_AddLocal( curr_func, stab_ptr->n_value + 1, 0, 0, 0, symname ); DEBUG_SetLocalSymbolType( curr_loc, DEBUG_ParseStabType(ptr) ); } @@ -822,7 +822,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, if( curr_func != NULL && !in_external_file ) { stab_strcpy(symname, sizeof(symname), ptr); - curr_loc = DEBUG_AddLocal( curr_func, 0, + curr_loc = DEBUG_AddLocal( curr_func, 0, stab_ptr->n_value, 0, 0, symname ); DEBUG_SetLocalSymbolType( curr_loc, DEBUG_ParseStabType(ptr) ); } @@ -835,7 +835,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, if( curr_func != NULL && !in_external_file ) { #ifdef __ELF__ - DEBUG_AddLineNumber(curr_func, stab_ptr->n_desc, + DEBUG_AddLineNumber(curr_func, stab_ptr->n_desc, stab_ptr->n_value); #else #if 0 @@ -844,7 +844,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, * a.out, and as a result we would end up attaching the line * number to the wrong function. */ - DEBUG_AddLineNumber(curr_func, stab_ptr->n_desc, + DEBUG_AddLineNumber(curr_func, stab_ptr->n_desc, stab_ptr->n_value - curr_func->addr.off); #endif #endif @@ -884,7 +884,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, curr_func = DEBUG_AddSymbol( symname, &new_value, currpath, SYM_WINE | SYM_FUNC ); #endif - } + } else { /* some GCC seem to use a N_FUN "" to mark the end of a function */ @@ -979,7 +979,7 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, stabbuff[0] = '\0'; #if 0 - DEBUG_Printf(DBG_CHN_MESG, "%d %x %s\n", stab_ptr->n_type, + DEBUG_Printf(DBG_CHN_MESG, "%d %x %s\n", stab_ptr->n_type, (unsigned int) stab_ptr->n_value, strs + (unsigned int) stab_ptr->n_un.n_name); #endif @@ -1001,8 +1001,8 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, unsigned int load_offset, * This is all really quite easy, since we don't have to worry about line * numbers or local data variables. */ -static int DEBUG_ProcessElfSymtab(DBG_MODULE* module, char* addr, - u_long load_addr, Elf32_Shdr* symtab, +static int DEBUG_ProcessElfSymtab(DBG_MODULE* module, char* addr, + u_long load_addr, Elf32_Shdr* symtab, Elf32_Shdr* strtab) { char * curfile = NULL; @@ -1058,7 +1058,7 @@ static int DEBUG_ProcessElfSymtab(DBG_MODULE* module, char* addr, new_value.type = NULL; new_value.addr.off = load_addr + symp->st_value; new_value.cookie = DV_TARGET; - flags = SYM_WINE | ((ELF32_ST_TYPE(symp->st_info) == STT_FUNC) + flags = SYM_WINE | ((ELF32_ST_TYPE(symp->st_info) == STT_FUNC) ? SYM_FUNC : SYM_DATA); if( ELF32_ST_BIND(symp->st_info) == STB_GLOBAL ) curr_sym = DEBUG_AddSymbol( symname, &new_value, NULL, flags ); @@ -1080,9 +1080,9 @@ static int DEBUG_ProcessElfSymtab(DBG_MODULE* module, char* addr, * Loads the symbolic information from ELF module stored in 'filename' * the module has been loaded at 'load_offset' address, so symbols' address * relocation is performed - * returns + * returns * -1 if the file cannot be found/opened - * 0 if the file doesn't contain symbolic info (or this info cannot be + * 0 if the file doesn't contain symbolic info (or this info cannot be * read or parsed) * 1 on success */ @@ -1112,14 +1112,14 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module) * Now open the file, so that we can mmap() it. */ if ((fd = open(module->module_name, O_RDONLY)) == -1) goto leave; - + dil = DIL_NOINFO; /* * Now mmap() the file. */ addr = mmap(0, statbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0); if (addr == (char*)0xffffffff) goto leave; - + /* * Next, we need to find a few of the internal ELF headers within * this thing. We need the main executable header, and the section @@ -1128,27 +1128,27 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module) ehptr = (Elf32_Ehdr*) addr; spnt = (Elf32_Shdr*) (addr + ehptr->e_shoff); shstrtab = (addr + spnt[ehptr->e_shstrndx].sh_offset); - + stabsect = stabstrsect = -1; - + for (i = 0; i < ehptr->e_shnum; i++) { if (strcmp(shstrtab + spnt[i].sh_name, ".stab") == 0) stabsect = i; - + if (strcmp(shstrtab + spnt[i].sh_name, ".stabstr") == 0) stabstrsect = i; } - + if (stabsect == -1 || stabstrsect == -1) { DEBUG_Printf(DBG_CHN_WARN, "no .stab section\n"); goto leave; } - + /* * OK, now just parse all of the stabs. */ - if (DEBUG_ParseStabs(addr, - module->elf_info->elf_addr, + if (DEBUG_ParseStabs(addr, + module->elf_info->elf_addr, spnt[stabsect].sh_offset, spnt[stabsect].sh_size, spnt[stabstrsect].sh_offset, @@ -1159,36 +1159,36 @@ enum DbgInfoLoad DEBUG_LoadElfStabs(DBG_MODULE* module) DEBUG_Printf(DBG_CHN_WARN, "bad stabs\n"); goto leave; } - + for (i = 0; i < ehptr->e_shnum; i++) { if ( (strcmp(shstrtab + spnt[i].sh_name, ".symtab") == 0) && (spnt[i].sh_type == SHT_SYMTAB)) DEBUG_ProcessElfSymtab(module, addr, module->elf_info->elf_addr, spnt + i, spnt + spnt[i].sh_link); - + if ( (strcmp(shstrtab + spnt[i].sh_name, ".dynsym") == 0) && (spnt[i].sh_type == SHT_DYNSYM)) - DEBUG_ProcessElfSymtab(module, addr, module->elf_info->elf_addr, + DEBUG_ProcessElfSymtab(module, addr, module->elf_info->elf_addr, spnt + i, spnt + spnt[i].sh_link); } leave: if (addr != (char*)0xffffffff) munmap(addr, statbuf.st_size); if (fd != -1) close(fd); - + return dil; } /* * Loads the information for ELF module stored in 'filename' * the module has been loaded at 'load_offset' address - * returns + * returns * -1 if the file cannot be found/opened - * 0 if the file doesn't contain symbolic info (or this info cannot be + * 0 if the file doesn't contain symbolic info (or this info cannot be * read or parsed) * 1 on success */ -static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename, +static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename, unsigned int load_offset, unsigned int* dyn_addr) { @@ -1210,12 +1210,12 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename, /* check that the file exists, and that the module hasn't been loaded yet */ if (stat(filename, &statbuf) == -1) goto leave; - + /* * Now open the file, so that we can mmap() it. */ if ((fd = open(filename, O_RDONLY)) == -1) goto leave; - + /* * Now mmap() the file. */ @@ -1223,7 +1223,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename, if (addr == (char*)0xffffffff) goto leave; dil = DIL_NOINFO; - + /* * Next, we need to find a few of the internal ELF headers within * this thing. We need the main executable header, and the section @@ -1248,7 +1248,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename, if (size < ppnt[i].p_vaddr - delta + ppnt[i].p_memsz) size = ppnt[i].p_vaddr - delta + ppnt[i].p_memsz; } - + for (i = 0; i < ehptr->e_shnum; i++) { if (strcmp(shstrtab + spnt[i].sh_name, ".bss") == 0 && spnt[i].sh_type == SHT_NOBITS) { @@ -1260,8 +1260,8 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename, if (dyn_addr) *dyn_addr = spnt[i].sh_addr; } } - - module = DEBUG_RegisterELFModule((load_offset == 0) ? ehptr->e_entry : load_offset, + + module = DEBUG_RegisterELFModule((load_offset == 0) ? ehptr->e_entry : load_offset, size, filename); if (!module) { dil = DIL_ERROR; @@ -1280,13 +1280,13 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(const char* filename, if (addr != (char*)0xffffffff) munmap(addr, statbuf.st_size); if (fd != -1) close(fd); if (module) module->dil = dil; - + return dil; } -static enum DbgInfoLoad DEBUG_ProcessElfFileFromPath(const char * filename, - unsigned int load_offset, - unsigned int* dyn_addr, +static enum DbgInfoLoad DEBUG_ProcessElfFileFromPath(const char * filename, + unsigned int load_offset, + unsigned int* dyn_addr, const char* path) { enum DbgInfoLoad dil = DIL_ERROR; @@ -1313,7 +1313,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfFileFromPath(const char * filename, return dil; } -static enum DbgInfoLoad DEBUG_ProcessElfObject(const char* filename, +static enum DbgInfoLoad DEBUG_ProcessElfObject(const char* filename, unsigned int load_offset, unsigned int* dyn_addr) { @@ -1335,7 +1335,7 @@ static enum DbgInfoLoad DEBUG_ProcessElfObject(const char* filename, return dil; } - + static BOOL DEBUG_WalkList(struct r_debug* dbg_hdr) { u_long lm_addr; @@ -1361,7 +1361,7 @@ static BOOL DEBUG_WalkList(struct r_debug* dbg_hdr) DEBUG_ProcessElfObject(bufstr, (unsigned)lm.l_addr, NULL); } } - + return TRUE; } @@ -1369,12 +1369,12 @@ static BOOL DEBUG_RescanElf(void) { struct r_debug dbg_hdr; - if (!DEBUG_CurrProcess || + if (!DEBUG_CurrProcess || !DEBUG_READ_MEM_VERBOSE((void*)DEBUG_CurrProcess->dbg_hdr_addr, &dbg_hdr, sizeof(dbg_hdr))) return FALSE; switch (dbg_hdr.r_state) { - case RT_CONSISTENT: + case RT_CONSISTENT: DEBUG_WalkList(&dbg_hdr); DEBUG_CheckDelayedBP(); break; @@ -1393,35 +1393,35 @@ enum DbgInfoLoad DEBUG_ReadExecutableDbgInfo(const char* exe_name) struct r_debug dbg_hdr; enum DbgInfoLoad dil = DIL_NOINFO; unsigned int dyn_addr; - + /* * Make sure we can stat and open this file. */ if (exe_name == NULL) goto leave; DEBUG_ProcessElfObject(exe_name, 0, &dyn_addr); - + do { if (!DEBUG_READ_MEM_VERBOSE((void*)dyn_addr, &dyn, sizeof(dyn))) goto leave; dyn_addr += sizeof(dyn); } while (dyn.d_tag != DT_DEBUG && dyn.d_tag != DT_NULL); if (dyn.d_tag == DT_NULL) goto leave; - + /* * OK, now dig into the actual tables themselves. */ if (!DEBUG_READ_MEM_VERBOSE((void*)dyn.d_un.d_ptr, &dbg_hdr, sizeof(dbg_hdr))) goto leave; - + assert(!DEBUG_CurrProcess->dbg_hdr_addr); DEBUG_CurrProcess->dbg_hdr_addr = (u_long)dyn.d_un.d_ptr; - + if (dbg_hdr.r_brk) { DBG_VALUE value; - + DEBUG_Printf(DBG_CHN_TRACE, "Setting up a breakpoint on r_brk(%lx)\n", (unsigned long)dbg_hdr.r_brk); - + DEBUG_SetBreakpoints(FALSE); value.type = NULL; value.cookie = DV_TARGET; @@ -1430,9 +1430,9 @@ enum DbgInfoLoad DEBUG_ReadExecutableDbgInfo(const char* exe_name) DEBUG_AddBreakpoint(&value, DEBUG_RescanElf); DEBUG_SetBreakpoints(TRUE); } - + dil = DEBUG_WalkList(&dbg_hdr); - + leave: return dil; } diff --git a/debugger/stack.c b/debugger/stack.c index c0f460de267..36333f761ce 100644 --- a/debugger/stack.c +++ b/debugger/stack.c @@ -70,7 +70,7 @@ void DEBUG_InfoStack(void) { #ifdef __i386__ DBG_VALUE value; - + value.type = NULL; value.cookie = DV_TARGET; value.addr.seg = DEBUG_context.SegSs; @@ -109,8 +109,8 @@ static void DEBUG_ForceFrame(DBG_ADDR *stack, DBG_ADDR *code, int frameno, enum if (noisy) frames[theframe].frame = DEBUG_PrintAddressAndArgs( code, mode, stack->off, TRUE ); else - DEBUG_FindNearestSymbol( code, TRUE, - &frames[theframe].frame.sym, stack->off, + DEBUG_FindNearestSymbol( code, TRUE, + &frames[theframe].frame.sym, stack->off, &frames[theframe].frame.list); frames[theframe].ss = stack->seg; frames[theframe].ebp = stack->off; @@ -126,9 +126,9 @@ static BOOL DEBUG_Frame16(DBG_THREAD* thread, DBG_ADDR *addr, unsigned int *cs, FRAME16 frame; void* p = (void*)DEBUG_ToLinear(addr); DBG_ADDR code; - + if (!p) return FALSE; - + if (!DEBUG_READ_MEM(p, &frame, sizeof(frame))) { if (noisy) DEBUG_InvalAddr(addr); return FALSE; @@ -141,7 +141,7 @@ static BOOL DEBUG_Frame16(DBG_THREAD* thread, DBG_ADDR *addr, unsigned int *cs, * but check whether it could be anyway */ if (((frame.cs&7)==7) && (frame.cs != *cs)) { LDT_ENTRY le; - + if (GetThreadSelectorEntry( thread->handle, frame.cs, &le) && (le.HighWord.Bits.Type & 0x08)) { /* code segment */ /* it is very uncommon to push a code segment cs as @@ -164,9 +164,9 @@ static BOOL DEBUG_Frame32(DBG_ADDR *addr, unsigned int *cs, int frameno, int noi void* p = (void*)DEBUG_ToLinear(addr); DBG_ADDR code; DWORD old_bp = addr->off; - + if (!p) return FALSE; - + if (!DEBUG_READ_MEM(p, &frame, sizeof(frame))) { if (noisy) DEBUG_InvalAddr(addr); return FALSE; @@ -204,7 +204,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy) int copy_nframe = 0; int copy_curr_frame = 0; struct bt_info* copy_frames = NULL; - + if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Backtrace:\n" ); if (tid == DEBUG_CurrTid) @@ -284,8 +284,8 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy) return; } - /* cur_switch holds address of curr_stack's field in TEB in debuggee - * address space + /* cur_switch holds address of curr_stack's field in TEB in debuggee + * address space */ cur_switch = (DWORD)thread->teb + OFFSET_OF(TEB, cur_stack); if (!DEBUG_READ_MEM((void*)cur_switch, &next_switch, sizeof(next_switch))) { @@ -295,7 +295,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy) if (is16) { if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) { - if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", + if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", (unsigned long)(STACK32FRAME*)next_switch ); return; } @@ -306,9 +306,9 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy) tmp.seg = SELECTOROF(next_switch); tmp.off = OFFSETOF(next_switch); p = DEBUG_ToLinear(&tmp); - + if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) { - if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", + if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", (unsigned long)(STACK16FRAME*)p ); return; } @@ -320,7 +320,7 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy) sw_addr.seg = (DWORD)-1; sw_addr.off = (DWORD)-1; } - + for (ok = TRUE; ok;) { if ((frames[frameno].ss == sw_addr.seg) && sw_addr.off && (frames[frameno].ebp >= sw_addr.off)) @@ -328,65 +328,65 @@ void DEBUG_BackTrace(DWORD tid, BOOL noisy) /* 16<->32 switch... * yes, I know this is confusing, it gave me a headache too */ if (is16) { - + if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) { - if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", + if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", (unsigned long)(STACK32FRAME*)next_switch ); return; } code.seg = 0; code.off = frame32.retaddr; - + cs = 0; addr.seg = 0; addr.off = frame32.ebp; DEBUG_ForceFrame( &addr, &code, ++frameno, MODE_32, noisy, NULL ); - + next_switch = cur_switch; tmp.seg = SELECTOROF(next_switch); tmp.off = OFFSETOF(next_switch); p = DEBUG_ToLinear(&tmp); - + if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) { - if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", + if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", (unsigned long)(STACK16FRAME*)p ); return; } cur_switch = (DWORD)frame16.frame32; sw_addr.seg = 0; sw_addr.off = cur_switch; - + is16 = FALSE; } else { tmp.seg = SELECTOROF(next_switch); tmp.off = OFFSETOF(next_switch); p = DEBUG_ToLinear(&tmp); - + if (!DEBUG_READ_MEM((void*)p, &frame16, sizeof(STACK16FRAME))) { if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", (unsigned long)(STACK16FRAME*)p ); return; } - + code.seg = frame16.cs; code.off = frame16.ip; - + cs = frame16.cs; addr.seg = SELECTOROF(next_switch); addr.off = frame16.bp; DEBUG_ForceFrame( &addr, &code, ++frameno, MODE_16, noisy, NULL ); - + next_switch = cur_switch; if (!DEBUG_READ_MEM((void*)next_switch, &frame32, sizeof(STACK32FRAME))) { - if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", + if (noisy) DEBUG_Printf( DBG_CHN_MESG, "Bad stack frame 0x%08lx\n", (unsigned long)(STACK32FRAME*)next_switch ); return; } cur_switch = (DWORD)frame32.frame16; sw_addr.seg = SELECTOROF(cur_switch); sw_addr.off = OFFSETOF(cur_switch); - + is16 = TRUE; } if (!DEBUG_READ_MEM((void*)DEBUG_ToLinear(&sw_addr), &ch, sizeof(ch))) { diff --git a/debugger/types.c b/debugger/types.c index 298e5af8b75..2a5805ec80a 100644 --- a/debugger/types.c +++ b/debugger/types.c @@ -116,7 +116,7 @@ static unsigned int type_hash( const char * name ) p = name; - while (*p) + while (*p) { hash = (hash << 4) + *p++; @@ -131,7 +131,7 @@ static unsigned int type_hash( const char * name ) static struct datatype * -DEBUG_InitBasic(int type, char * name, int size, int b_signed, +DEBUG_InitBasic(int type, char * name, int size, int b_signed, char * output_format) { int hash; @@ -174,12 +174,12 @@ DEBUG_LookupDataType(enum debug_type xtype, int hash, const char * typename) { for( dt = type_hash_table[hash]; dt; dt = dt->next ) { - if( xtype != dt->type || dt->name == NULL + if( xtype != dt->type || dt->name == NULL || dt->name[0] != typename[0]) { continue; } - + if( strcmp(dt->name, typename) == 0 ) { return dt; @@ -223,11 +223,11 @@ DEBUG_NewDataType(enum debug_type xtype, const char * typename) if( dt == NULL ) { dt = (struct datatype *) DBG_alloc(sizeof(struct datatype)); - + if( dt != NULL ) { memset(dt, 0, sizeof(*dt)); - + dt->type = xtype; if( typename != NULL ) { @@ -266,7 +266,7 @@ DEBUG_FindOrMakePointerType(struct datatype * reftype) { continue; } - + if( dt->un.pointer.pointsto == reftype ) { return dt; @@ -277,7 +277,7 @@ DEBUG_FindOrMakePointerType(struct datatype * reftype) if( dt == NULL ) { dt = (struct datatype *) DBG_alloc(sizeof(struct datatype)); - + if( dt != NULL ) { dt->type = DT_POINTER; @@ -351,33 +351,33 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format) struct en_values * e; char * def_format = "0x%x"; DBG_VALUE value = *_value; - + assert(_value->cookie == DV_TARGET || _value->cookie == DV_HOST); - + rtn = 0; rtn2 = 0; /* FIXME? I don't quite get this... - * if this is wrong, value.addr shall be linearized + * if this is wrong, value.addr shall be linearized */ - value.addr.seg = 0; + value.addr.seg = 0; assert(value.type != NULL); - + switch (value.type->type) { case DT_BASIC: - + if (value.type->un.basic.basic_size > sizeof(rtn)) { - DEBUG_Printf(DBG_CHN_ERR, "Size too large (%d)\n", + DEBUG_Printf(DBG_CHN_ERR, "Size too large (%d)\n", value.type->un.basic.basic_size); return 0; } /* FIXME: following code implies i386 byte ordering */ if (_value->cookie == DV_TARGET) { - if (!DEBUG_READ_MEM_VERBOSE((void*)value.addr.off, &rtn, + if (!DEBUG_READ_MEM_VERBOSE((void*)value.addr.off, &rtn, value.type->un.basic.basic_size)) return 0; } else { memcpy(&rtn, (void*)value.addr.off, value.type->un.basic.basic_size); } - + if ( (value.type->un.basic.b_signed) && ((value.type->un.basic.basic_size & 3) != 0) && ((rtn >> (value.type->un.basic.basic_size * 8 - 1)) != 0)) { @@ -394,12 +394,12 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format) if (value.type->un.basic.output_format != NULL) { def_format = value.type->un.basic.output_format; } - + /* * Check for single character prints that are out of range. */ if ( value.type->un.basic.basic_size == 1 - && strcmp(def_format, "'%c'") == 0 + && strcmp(def_format, "'%c'") == 0 && ((rtn < 0x20) || (rtn > 0x80))) { def_format = "%d"; } @@ -411,16 +411,16 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format) } else { rtn2 = *(unsigned int*)(value.addr.off); } - + type2 = value.type->un.pointer.pointsto; - + if (!type2) { def_format = "Internal symbol error: unable to access memory location 0x%08x"; rtn = 0; break; } - - if (type2->type == DT_BASIC && type2->un.basic.basic_size == 1) { + + if (type2->type == DT_BASIC && type2->un.basic.basic_size == 1) { if (_value->cookie == DV_TARGET) { char ch; def_format = "\"%S\""; @@ -461,8 +461,8 @@ DEBUG_GetExprValue(const DBG_VALUE* _value, char** format) rtn = 0; break; } - - + + if (format != NULL) { *format = def_format; } @@ -594,7 +594,7 @@ DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2) } int -DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type, +DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type, int offset, int size) { struct member * m; @@ -605,7 +605,7 @@ DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type { for(last = dt->un.structure.members; last; last = last->next) { - if( (last->name[0] == name[0]) + if( (last->name[0] == name[0]) && (strcmp(last->name, name) == 0) ) { return TRUE; @@ -620,7 +620,7 @@ DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type { return FALSE; } - + m->name = DBG_strdup(name); m->type = type; m->offset = offset; @@ -653,7 +653,7 @@ DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type { return FALSE; } - + e->name = DBG_strdup(name); e->value = offset; e->next = dt->un.enumeration.members; @@ -666,7 +666,7 @@ DEBUG_AddStructElement(struct datatype * dt, char * name, struct datatype * type return TRUE; } -struct datatype * +struct datatype * DEBUG_GetPointerType(struct datatype * dt) { if( dt->type == DT_POINTER ) @@ -707,7 +707,7 @@ DEBUG_SetArrayParams(struct datatype * dt, int min, int max, struct datatype * d } int -DEBUG_SetBitfieldParams(struct datatype * dt, int offset, int nbits, +DEBUG_SetBitfieldParams(struct datatype * dt, int offset, int nbits, struct datatype * dt2) { assert(dt->type == DT_BITFIELD); @@ -736,7 +736,7 @@ int DEBUG_GetObjectSize(struct datatype * dt) case DT_ENUM: return sizeof(int); case DT_ARRAY: - return (dt->un.array.end - dt->un.array.start) + return (dt->un.array.end - dt->un.array.start) * DEBUG_GetObjectSize(dt->un.array.basictype); case DT_BITFIELD: /* @@ -780,7 +780,7 @@ DEBUG_ArrayIndex(const DBG_VALUE * value, DBG_VALUE * result, int index) size = DEBUG_GetObjectSize(value->type->un.array.basictype); result->type = value->type->un.array.basictype; result->addr.off = value->addr.off + size * (index - value->type->un.array.start); - + /* Contents of array must be on same target */ result->cookie = value->cookie; } @@ -814,7 +814,7 @@ DEBUG_Print( const DBG_VALUE *value, int count, char format, int level ) DEBUG_Printf( DBG_CHN_MESG, "Count other than 1 is meaningless in 'print' command\n" ); return; } - + if( value->type == NULL ) { /* No type, just print the addr value */ @@ -823,7 +823,7 @@ DEBUG_Print( const DBG_VALUE *value, int count, char format, int level ) DEBUG_nchar += DEBUG_Printf( DBG_CHN_MESG, "0x%08lx", value->addr.off ); goto leave; } - + if( level == 0 ) { DEBUG_nchar = 0; @@ -897,7 +897,7 @@ DEBUG_Print( const DBG_VALUE *value, int count, char format, int level ) default: assert(0); } DEBUG_nchar += clen; - if (clen != len) + if (clen != len) { DEBUG_Printf(DBG_CHN_MESG, "...\""); goto leave; @@ -929,7 +929,7 @@ DEBUG_Print( const DBG_VALUE *value, int count, char format, int level ) break; case DT_FUNC: DEBUG_Printf(DBG_CHN_MESG, "Function at ???\n"); - break; + break; default: DEBUG_Printf(DBG_CHN_MESG, "Unknown type (%d)\n", value->type->type); assert(FALSE); @@ -986,7 +986,7 @@ DEBUG_DumpTypes(void) nm++; } } - DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - STRUCT(%s) %d %d %s\n", + DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - STRUCT(%s) %d %d %s\n", (unsigned long)dt, name, dt->un.structure.size, nm, member_name); break; case DT_ARRAY: @@ -994,11 +994,11 @@ DEBUG_DumpTypes(void) (unsigned long)dt, name, (unsigned long)dt->un.array.basictype); break; case DT_ENUM: - DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - ENUM(%s)\n", + DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - ENUM(%s)\n", (unsigned long)dt, name); break; case DT_BITFIELD: - DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - BITFIELD(%s)\n", + DEBUG_Printf(DBG_CHN_MESG, "0x%08lx - BITFIELD(%s)\n", (unsigned long)dt, name); break; case DT_FUNC: @@ -1093,7 +1093,7 @@ int DEBUG_PrintType( const DBG_VALUE *value ) { assert(value->cookie == DV_TARGET || value->cookie == DV_HOST); - if (!value->type) + if (!value->type) { DEBUG_Printf(DBG_CHN_MESG, "Unknown type\n"); return FALSE; diff --git a/debugger/winedbg.c b/debugger/winedbg.c index cf7acad5e81..c256532b467 100644 --- a/debugger/winedbg.c +++ b/debugger/winedbg.c @@ -113,7 +113,7 @@ static BOOL DEBUG_IntVarsRW(int read) for (i = 0; i < DBG_IV_LAST; i++) { if (read) { if (!DEBUG_IntVars[i].pval) { - if (!RegQueryValueEx(hkey, DEBUG_IntVars[i].name, 0, + if (!RegQueryValueEx(hkey, DEBUG_IntVars[i].name, 0, &type, (LPSTR)&val, &count)) DEBUG_IntVars[i].val = val; DEBUG_IntVars[i].pval = &DEBUG_IntVars[i].val; @@ -123,7 +123,7 @@ static BOOL DEBUG_IntVarsRW(int read) } else { /* FIXME: type should be infered from basic type -if any- of intvar */ if (DEBUG_IntVars[i].pval == &DEBUG_IntVars[i].val) - RegSetValueEx(hkey, DEBUG_IntVars[i].name, 0, + RegSetValueEx(hkey, DEBUG_IntVars[i].name, 0, type, (LPCVOID)DEBUG_IntVars[i].pval, count); } } @@ -141,7 +141,7 @@ DBG_INTVAR* DEBUG_GetIntVar(const char* name) } return NULL; } - + static WINE_EXCEPTION_FILTER(wine_dbg) { DEBUG_Printf(DBG_CHN_MESG, "\nwine_dbg: Exception (%lx) inside debugger, continuing...\n", GetExceptionCode()); @@ -152,7 +152,7 @@ static WINE_EXCEPTION_FILTER(wine_dbg) DBG_PROCESS* DEBUG_GetProcess(DWORD pid) { DBG_PROCESS* p; - + for (p = DEBUG_ProcessList; p; p = p->next) if (p->pid == pid) break; return p; @@ -220,11 +220,11 @@ static BOOL DEBUG_ProcessGetStringIndirect(char* buffer, int size, HANDLE hp, LP { LPVOID ad; DWORD sz; - - if ( addr - && ReadProcessMemory(hp, addr, &ad, sizeof(ad), &sz) - && sz == sizeof(ad) - && ad + + if ( addr + && ReadProcessMemory(hp, addr, &ad, sizeof(ad), &sz) + && sz == sizeof(ad) + && ad && ReadProcessMemory(hp, ad, buffer, size, &sz)) return TRUE; *(WCHAR*)buffer = 0; @@ -234,19 +234,19 @@ static BOOL DEBUG_ProcessGetStringIndirect(char* buffer, int size, HANDLE hp, LP DBG_THREAD* DEBUG_GetThread(DBG_PROCESS* p, DWORD tid) { DBG_THREAD* t; - + for (t = p->threads; t; t = t->next) if (t->tid == tid) break; return t; } -static DBG_THREAD* DEBUG_AddThread(DBG_PROCESS* p, DWORD tid, +static DBG_THREAD* DEBUG_AddThread(DBG_PROCESS* p, DWORD tid, HANDLE h, LPVOID start, LPVOID teb) { DBG_THREAD* t = DBG_alloc(sizeof(DBG_THREAD)); if (!t) return NULL; - + t->handle = h; t->tid = tid; t->start = start; @@ -270,10 +270,10 @@ static DBG_THREAD* DEBUG_AddThread(DBG_PROCESS* p, DWORD tid, static void DEBUG_InitCurrThread(void) { if (DEBUG_CurrThread->start) { - if (DEBUG_CurrThread->process->num_threads == 1 || + if (DEBUG_CurrThread->process->num_threads == 1 || DBG_IVAR(BreakAllThreadsStartup)) { DBG_VALUE value; - + DEBUG_SetBreakpoints(FALSE); value.type = NULL; value.cookie = DV_TARGET; @@ -315,7 +315,7 @@ BOOL DEBUG_Detach(void) { /* remove all set breakpoints in debuggee code */ DEBUG_SetBreakpoints(FALSE); - /* needed for single stepping (ugly). + /* needed for single stepping (ugly). * should this be handled inside the server ??? */ #ifdef __i386__ DEBUG_context.EFlags &= ~STEP_FLAG; @@ -357,11 +357,11 @@ static BOOL DEBUG_ExceptionProlog(BOOL is_debug, BOOL force, DWORD code) } DEBUG_Printf(DBG_CHN_MESG, ".\n"); } - + DEBUG_LoadEntryPoints("Loading new modules symbols:\n"); - if (!force && is_debug && - DEBUG_ShouldContinue(&addr, code, + if (!force && is_debug && + DEBUG_ShouldContinue(&addr, code, &DEBUG_CurrThread->exec_count)) return FALSE; @@ -407,7 +407,7 @@ static BOOL DEBUG_ExceptionProlog(BOOL is_debug, BOOL force, DWORD code) DEBUG_DisassembleInstruction(&addr); /* resets list internal arguments so we can look at source code when needed */ - DEBUG_FindNearestSymbol(&addr, TRUE, NULL, 0, &list); + DEBUG_FindNearestSymbol(&addr, TRUE, NULL, 0, &list); if (list.sourcefile) DEBUG_List(&list, NULL, 0); } return TRUE; @@ -490,7 +490,7 @@ static void DEBUG_HandleException(EXCEPTION_RECORD *rec, BOOL first_chance, BOOL break; case EXCEPTION_ACCESS_VIOLATION: if (rec->NumberParameters == 2) - DEBUG_Printf(DBG_CHN_MESG, "page fault on %s access to 0x%08lx", + DEBUG_Printf(DBG_CHN_MESG, "page fault on %s access to 0x%08lx", rec->ExceptionInformation[0] ? "write" : "read", rec->ExceptionInformation[1]); else @@ -548,10 +548,10 @@ static void DEBUG_HandleException(EXCEPTION_RECORD *rec, BOOL first_chance, BOOL } #if 0 - DEBUG_Printf(DBG_CHN_TRACE, + DEBUG_Printf(DBG_CHN_TRACE, "Entering debugger PC=%lx EFL=%08lx mode=%d count=%d\n", #ifdef __i386__ - DEBUG_context.Eip, DEBUG_context.EFlags, + DEBUG_context.Eip, DEBUG_context.EFlags, #else 0L, 0L, #endif @@ -583,10 +583,10 @@ static void DEBUG_HandleException(EXCEPTION_RECORD *rec, BOOL first_chance, BOOL DEBUG_ExceptionEpilog(); #if 0 - DEBUG_Printf(DBG_CHN_TRACE, + DEBUG_Printf(DBG_CHN_TRACE, "Exiting debugger PC=%lx EFL=%08lx mode=%d count=%d\n", #ifdef __i386__ - DEBUG_context.Eip, DEBUG_context.EFlags, + DEBUG_context.Eip, DEBUG_context.EFlags, #else 0L, 0L, #endif @@ -605,9 +605,9 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) __TRY { if ((DEBUG_CurrProcess = DEBUG_GetProcess(de->dwProcessId)) != NULL) DEBUG_CurrThread = DEBUG_GetThread(DEBUG_CurrProcess, de->dwThreadId); - else + else DEBUG_CurrThread = NULL; - + switch (de->dwDebugEventCode) { case EXCEPTION_DEBUG_EVENT: if (!DEBUG_CurrThread) { @@ -615,9 +615,9 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) de->dwProcessId, de->dwThreadId); break; } - - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exception code=%08lx\n", - de->dwProcessId, de->dwThreadId, + + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exception code=%08lx\n", + de->dwProcessId, de->dwThreadId, de->u.Exception.ExceptionRecord.ExceptionCode); if (DEBUG_CurrProcess->continue_on_first_exception) { @@ -641,20 +641,20 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) DEBUG_Printf(DBG_CHN_WARN, "Can't get thread's context\n"); break; } - - DEBUG_HandleException(&de->u.Exception.ExceptionRecord, - de->u.Exception.dwFirstChance, + + DEBUG_HandleException(&de->u.Exception.ExceptionRecord, + de->u.Exception.dwFirstChance, DEBUG_CurrThread->wait_for_first_exception); if (DEBUG_CurrThread) { DEBUG_CurrThread->wait_for_first_exception = 0; SetThreadContext(DEBUG_CurrThread->handle, &DEBUG_context); } break; - + case CREATE_THREAD_DEBUG_EVENT: - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create thread D @%08lx\n", de->dwProcessId, de->dwThreadId, + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create thread D @%08lx\n", de->dwProcessId, de->dwThreadId, (unsigned long)(LPVOID)de->u.CreateThread.lpStartAddress); - + if (DEBUG_CurrProcess == NULL) { DEBUG_Printf(DBG_CHN_ERR, "Unknown process\n"); break; @@ -663,11 +663,11 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) DEBUG_Printf(DBG_CHN_TRACE, "Thread already listed, skipping\n"); break; } - - DEBUG_CurrThread = DEBUG_AddThread(DEBUG_CurrProcess, - de->dwThreadId, - de->u.CreateThread.hThread, - de->u.CreateThread.lpStartAddress, + + DEBUG_CurrThread = DEBUG_AddThread(DEBUG_CurrProcess, + de->dwThreadId, + de->u.CreateThread.hThread, + de->u.CreateThread.lpStartAddress, de->u.CreateThread.lpThreadLocalBase); if (!DEBUG_CurrThread) { DEBUG_Printf(DBG_CHN_ERR, "Couldn't create thread\n"); @@ -675,20 +675,20 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) } DEBUG_InitCurrThread(); break; - + case CREATE_PROCESS_DEBUG_EVENT: - DEBUG_ProcessGetStringIndirect(buffer, sizeof(buffer), - de->u.CreateProcessInfo.hProcess, + DEBUG_ProcessGetStringIndirect(buffer, sizeof(buffer), + de->u.CreateProcessInfo.hProcess, de->u.CreateProcessInfo.lpImageName); /* FIXME unicode ? de->u.CreateProcessInfo.fUnicode */ - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create process '%s'/%p @%08lx (%ld<%ld>)\n", - de->dwProcessId, de->dwThreadId, + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create process '%s'/%p @%08lx (%ld<%ld>)\n", + de->dwProcessId, de->dwThreadId, buffer, de->u.CreateProcessInfo.lpImageName, (unsigned long)(LPVOID)de->u.CreateProcessInfo.lpStartAddress, de->u.CreateProcessInfo.dwDebugInfoFileOffset, de->u.CreateProcessInfo.nDebugInfoSize); - + if ((DEBUG_CurrProcess = DEBUG_GetProcess(de->dwProcessId)) != NULL) { if (DEBUG_CurrProcess->handle) { DEBUG_Printf(DBG_CHN_ERR, "Skipping already defined process\n"); @@ -707,44 +707,44 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) break; } } - - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create thread I @%08lx\n", - de->dwProcessId, de->dwThreadId, + + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: create thread I @%08lx\n", + de->dwProcessId, de->dwThreadId, (unsigned long)(LPVOID)de->u.CreateProcessInfo.lpStartAddress); - - DEBUG_CurrThread = DEBUG_AddThread(DEBUG_CurrProcess, - de->dwThreadId, - de->u.CreateProcessInfo.hThread, - de->u.CreateProcessInfo.lpStartAddress, + + DEBUG_CurrThread = DEBUG_AddThread(DEBUG_CurrProcess, + de->dwThreadId, + de->u.CreateProcessInfo.hThread, + de->u.CreateProcessInfo.lpStartAddress, de->u.CreateProcessInfo.lpThreadLocalBase); if (!DEBUG_CurrThread) { DEBUG_Printf(DBG_CHN_ERR, "Couldn't create thread\n"); break; } - + DEBUG_InitCurrProcess(); DEBUG_InitCurrThread(); /* module is either PE, NE or ELF module (for WineLib), but all * are loaded with wine, so load its symbols, then the main module */ - do + do { char* ptr = getenv("WINELOADER"); - + if (!ptr || DEBUG_ReadExecutableDbgInfo( ptr ) == DIL_ERROR) DEBUG_ReadExecutableDbgInfo( "wine" ); } while (0); - DEBUG_LoadModule32(DEBUG_CurrProcess->imageName, de->u.CreateProcessInfo.hFile, + DEBUG_LoadModule32(DEBUG_CurrProcess->imageName, de->u.CreateProcessInfo.hFile, (DWORD)de->u.CreateProcessInfo.lpBaseOfImage); break; - + case EXIT_THREAD_DEBUG_EVENT: - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exit thread (%ld)\n", + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exit thread (%ld)\n", de->dwProcessId, de->dwThreadId, de->u.ExitThread.dwExitCode); - + if (DEBUG_CurrThread == NULL) { DEBUG_Printf(DBG_CHN_ERR, "Unknown thread\n"); break; @@ -752,11 +752,11 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) /* FIXME: remove break point set on thread startup */ DEBUG_DelThread(DEBUG_CurrThread); break; - + case EXIT_PROCESS_DEBUG_EVENT: - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exit process (%ld)\n", + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: exit process (%ld)\n", de->dwProcessId, de->dwThreadId, de->u.ExitProcess.dwExitCode); - + if (DEBUG_CurrProcess == NULL) { DEBUG_Printf(DBG_CHN_ERR, "Unknown process\n"); break; @@ -769,19 +769,19 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) DEBUG_Printf(DBG_CHN_MESG, "Process of pid=%08lx has terminated\n", DEBUG_CurrPid); break; - + case LOAD_DLL_DEBUG_EVENT: if (DEBUG_CurrThread == NULL) { DEBUG_Printf(DBG_CHN_ERR, "Unknown thread\n"); break; } - DEBUG_ProcessGetStringIndirect(buffer, sizeof(buffer), - DEBUG_CurrThread->process->handle, + DEBUG_ProcessGetStringIndirect(buffer, sizeof(buffer), + DEBUG_CurrThread->process->handle, de->u.LoadDll.lpImageName); - + /* FIXME unicode: de->u.LoadDll.fUnicode */ - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: loads DLL %s @%08lx (%ld<%ld>)\n", - de->dwProcessId, de->dwThreadId, + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: loads DLL %s @%08lx (%ld<%ld>)\n", + de->dwProcessId, de->dwThreadId, buffer, (unsigned long)de->u.LoadDll.lpBaseOfDll, de->u.LoadDll.dwDebugInfoFileOffset, de->u.LoadDll.nDebugInfoSize); @@ -789,43 +789,43 @@ static void DEBUG_HandleDebugEvent(DEBUG_EVENT* de) DEBUG_LoadModule32(buffer, de->u.LoadDll.hFile, (DWORD)de->u.LoadDll.lpBaseOfDll); DEBUG_CheckDelayedBP(); if (DBG_IVAR(BreakOnDllLoad)) { - DEBUG_Printf(DBG_CHN_MESG, "Stopping on DLL %s loading at %08lx\n", + DEBUG_Printf(DBG_CHN_MESG, "Stopping on DLL %s loading at %08lx\n", buffer, (unsigned long)de->u.LoadDll.lpBaseOfDll); DEBUG_Parser(); } break; - + case UNLOAD_DLL_DEBUG_EVENT: - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: unload DLL @%08lx\n", de->dwProcessId, de->dwThreadId, + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: unload DLL @%08lx\n", de->dwProcessId, de->dwThreadId, (unsigned long)de->u.UnloadDll.lpBaseOfDll); break; - + case OUTPUT_DEBUG_STRING_EVENT: if (DEBUG_CurrThread == NULL) { DEBUG_Printf(DBG_CHN_ERR, "Unknown thread\n"); break; } - - DEBUG_ProcessGetString(buffer, sizeof(buffer), - DEBUG_CurrThread->process->handle, + + DEBUG_ProcessGetString(buffer, sizeof(buffer), + DEBUG_CurrThread->process->handle, de->u.DebugString.lpDebugStringData); - + /* FIXME unicode de->u.DebugString.fUnicode ? */ - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: output debug string (%s)\n", + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: output debug string (%s)\n", de->dwProcessId, de->dwThreadId, buffer); break; - + case RIP_EVENT: - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: rip error=%ld type=%ld\n", - de->dwProcessId, de->dwThreadId, de->u.RipInfo.dwError, + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: rip error=%ld type=%ld\n", + de->dwProcessId, de->dwThreadId, de->u.RipInfo.dwError, de->u.RipInfo.dwType); break; - + default: - DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: unknown event (%ld)\n", + DEBUG_Printf(DBG_CHN_TRACE, "%08lx:%08lx: unknown event (%ld)\n", de->dwProcessId, de->dwThreadId, de->dwDebugEventCode); } - + } __EXCEPT(wine_dbg) { DEBUG_ExitMode = EXIT_CONTINUE; } @@ -837,8 +837,8 @@ static DWORD DEBUG_MainLoop(void) DEBUG_EVENT de; DEBUG_Printf(DBG_CHN_MESG, " on pid %lx\n", DEBUG_CurrPid); - - while (DEBUG_ExitMode == EXIT_CONTINUE) + + while (DEBUG_ExitMode == EXIT_CONTINUE) { /* wait until we get at least one loaded process */ while (!DEBUG_ProcessList) @@ -848,12 +848,12 @@ static DWORD DEBUG_MainLoop(void) } if (DEBUG_ExitMode != EXIT_CONTINUE) break; - while ((DEBUG_ExitMode == EXIT_CONTINUE || DEBUG_ExitMode == EXIT_PASS) && - DEBUG_ProcessList && - WaitForDebugEvent(&de, INFINITE)) + while ((DEBUG_ExitMode == EXIT_CONTINUE || DEBUG_ExitMode == EXIT_PASS) && + DEBUG_ProcessList && + WaitForDebugEvent(&de, INFINITE)) { DEBUG_HandleDebugEvent(&de); - ContinueDebugEvent(de.dwProcessId, de.dwThreadId, + ContinueDebugEvent(de.dwProcessId, de.dwThreadId, (DEBUG_ExitMode == EXIT_PASS) ? DBG_EXCEPTION_NOT_HANDLED : DBG_CONTINUE); } if (DEBUG_ExitMode == EXIT_DETACH && DEBUG_Detach()) @@ -865,7 +865,7 @@ static DWORD DEBUG_MainLoop(void) DEBUG_ExitMode = EXIT_QUIT; } } - + DEBUG_Printf(DBG_CHN_MESG, "WineDbg terminated on pid %lx\n", DEBUG_CurrPid); return 0; @@ -878,11 +878,11 @@ static DWORD DEBUG_AutoMode(void) DEBUG_Printf(DBG_CHN_MESG, " on pid %lx\n", DEBUG_CurrPid); while ((DEBUG_ExitMode == EXIT_CONTINUE || DEBUG_ExitMode == EXIT_PASS) && - DEBUG_ProcessList && + DEBUG_ProcessList && WaitForDebugEvent(&de, INFINITE)) { DEBUG_HandleDebugEvent(&de); - ContinueDebugEvent(de.dwProcessId, de.dwThreadId, + ContinueDebugEvent(de.dwProcessId, de.dwThreadId, (DEBUG_ExitMode == EXIT_PASS) ? DBG_EXCEPTION_NOT_HANDLED : DBG_CONTINUE); } /* print some extra information */ @@ -904,8 +904,8 @@ static BOOL DEBUG_Start(LPSTR cmdLine) startup.cb = sizeof(startup); startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = SW_SHOWNORMAL; - - if (!CreateProcess(NULL, cmdLine, NULL, NULL, + + if (!CreateProcess(NULL, cmdLine, NULL, NULL, FALSE, DEBUG_PROCESS|DETACHED_PROCESS, NULL, NULL, &startup, &info)) { DEBUG_Printf(DBG_CHN_MESG, "Couldn't start process '%s'\n", cmdLine); return FALSE; @@ -938,10 +938,10 @@ static void DEBUG_InitConsole(void) SMALL_RECT sr; DWORD mode; - /* keep it as a cuiexe for now, so that Wine won't touch the Unix stdin, + /* keep it as a cuiexe for now, so that Wine won't touch the Unix stdin, * stdout and stderr streams */ - if (DBG_IVAR(UseXTerm)) + if (DBG_IVAR(UseXTerm)) { FreeConsole(); AllocConsole(); @@ -970,7 +970,7 @@ int main(int argc, char** argv) /* Initialize the type handling stuff. */ DEBUG_InitTypes(); - DEBUG_InitCVDataTypes(); + DEBUG_InitCVDataTypes(); /* Initialize internal vars (types must have been initialized before) */ if (!DEBUG_IntVarsRW(TRUE)) return -1; @@ -988,9 +988,9 @@ int main(int argc, char** argv) } DEBUG_InitConsole(); - + DEBUG_Printf(DBG_CHN_MESG, "WineDbg starting... "); - + if (argc == 3) { HANDLE hEvent; DWORD pid; @@ -1009,11 +1009,11 @@ int main(int argc, char** argv) DEBUG_CurrPid = pid; } } - + if (DEBUG_CurrPid == 0 && argc > 1) { int i, len; LPSTR cmdLine; - + if (!(cmdLine = DBG_alloc(len = 1))) goto oom_leave; cmdLine[0] = '\0'; diff --git a/dlls/advapi32/eventlog.c b/dlls/advapi32/eventlog.c index 0bd3877d7e1..25952b9edd5 100644 --- a/dlls/advapi32/eventlog.c +++ b/dlls/advapi32/eventlog.c @@ -160,7 +160,7 @@ OpenBackupEventLogW( LPCWSTR lpUNCServerName, LPCWSTR lpFileName ) /****************************************************************************** * OpenEventLogA [ADVAPI32.@] */ -HANDLE WINAPI OpenEventLogA(LPCSTR uncname,LPCSTR source) +HANDLE WINAPI OpenEventLogA(LPCSTR uncname,LPCSTR source) { FIXME("(%s,%s),stub!\n",uncname,source); return 0xcafe4242; @@ -204,7 +204,7 @@ BOOL WINAPI ReadEventLogA( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOf */ BOOL WINAPI ReadEventLogW( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset, - LPVOID lpBuffer, DWORD nNumberOfBytesToRead, + LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD *pnBytesRead, DWORD *pnMinNumberOfBytesNeeded ) { FIXME("stub\n"); @@ -269,8 +269,8 @@ BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD d * lpRawData [] */ BOOL WINAPI -ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory, - DWORD dwEventID, PSID lpUserSid, WORD wNumStrings, +ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory, + DWORD dwEventID, PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCWSTR *lpStrings, LPVOID lpRawData ) { FIXME("stub\n"); diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 8e8ac016a87..9b73691171a 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -76,7 +76,7 @@ inline static int is_version_nt(void) * FIXME MAXIMUM_ALLOWED in access mask not supported by server */ DWORD WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPWSTR class, - DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa, + DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa, LPHKEY retkey, LPDWORD dispos ) { OBJECT_ATTRIBUTES attr; @@ -105,7 +105,7 @@ DWORD WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPWSTR cl * FIXME MAXIMUM_ALLOWED in access mask not supported by server */ DWORD WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR class, - DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa, + DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa, LPHKEY retkey, LPDWORD dispos ) { OBJECT_ATTRIBUTES attr; @@ -442,9 +442,9 @@ DWORD WINAPI RegEnumKeyA( HKEY hkey, DWORD index, LPSTR name, DWORD name_len ) * security [O] Buffer for security descriptor length * modif [O] Modification time * - * - win95 allows class to be valid and class_len to be NULL + * - win95 allows class to be valid and class_len to be NULL * - winnt returns ERROR_INVALID_PARAMETER if class is valid and class_len is NULL - * - both allow class to be NULL and class_len to be NULL + * - both allow class to be NULL and class_len to be NULL * (it's hard to test validity, so test !NULL instead) */ DWORD WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPDWORD reserved, @@ -652,7 +652,7 @@ DWORD WINAPI RegDeleteKeyA( HKEY hkey, LPCSTR name ) * Failure: Error code * * NOTES - * win95 does not care about count for REG_SZ and finds out the len by itself (js) + * win95 does not care about count for REG_SZ and finds out the len by itself (js) * NT does definitely care (aj) */ DWORD WINAPI RegSetValueExW( HKEY hkey, LPCWSTR name, DWORD reserved, @@ -780,7 +780,7 @@ DWORD WINAPI RegSetValueA( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWOR * not required. * count [I/O] Address of data buffer size * - * RETURNS + * RETURNS * ERROR_SUCCESS: Success * ERROR_MORE_DATA: !!! if the specified buffer is not big enough to hold the data * buffer is left untouched. The MS-documentation is wrong (js) !!! @@ -850,7 +850,7 @@ DWORD WINAPI RegQueryValueExW( HKEY hkey, LPCWSTR name, LPDWORD reserved, LPDWOR * RegQueryValueExA [ADVAPI32.@] * * NOTES: - * the documentation is wrong: if the buffer is too small it remains untouched + * the documentation is wrong: if the buffer is too small it remains untouched */ DWORD WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count ) @@ -1441,7 +1441,7 @@ LONG WINAPI RegUnLoadKeyA( HKEY hkey, LPCSTR lpSubKey ) LONG WINAPI RegReplaceKeyW( HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpNewFile, LPCWSTR lpOldFile ) { - FIXME("(%x,%s,%s,%s): stub\n", hkey, debugstr_w(lpSubKey), + FIXME("(%x,%s,%s,%s): stub\n", hkey, debugstr_w(lpSubKey), debugstr_w(lpNewFile),debugstr_w(lpOldFile)); return ERROR_SUCCESS; } @@ -1560,7 +1560,7 @@ DWORD WINAPI RegFlushKey( HKEY hkey ) * hHey [I] Predefined registry handle * phkResult [I] Address of buffer for remote registry handle */ -LONG WINAPI RegConnectRegistryW( LPCWSTR lpMachineName, HKEY hKey, +LONG WINAPI RegConnectRegistryW( LPCWSTR lpMachineName, HKEY hKey, LPHKEY phkResult ) { TRACE("(%s,%x,%p): stub\n",debugstr_w(lpMachineName),hKey,phkResult); @@ -1597,7 +1597,7 @@ LONG WINAPI RegConnectRegistryA( LPCSTR machine, HKEY hkey, LPHKEY reskey ) * hEvent [I] Handle of signaled event * fAsync [I] Flag for asynchronous reporting */ -LONG WINAPI RegNotifyChangeKeyValue( HKEY hkey, BOOL fWatchSubTree, +LONG WINAPI RegNotifyChangeKeyValue( HKEY hkey, BOOL fWatchSubTree, DWORD fdwNotifyFilter, HANDLE hEvent, BOOL fAsync ) { diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index add48796a53..53e0a5d85c6 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -65,7 +65,7 @@ static void dumpLsaAttributes( PLSA_OBJECT_ATTRIBUTES oa ) * RETURNS STD */ BOOL WINAPI -OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess, +OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess, HANDLE *TokenHandle ) { CallWin32ToNt(NtOpenProcessToken( ProcessHandle, DesiredAccess, TokenHandle )); @@ -81,7 +81,7 @@ OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess, * thandle [] */ BOOL WINAPI -OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess, +OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, HANDLE *TokenHandle) { CallWin32ToNt (NtOpenThreadToken(ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle)); @@ -192,7 +192,7 @@ AllocateAndInitializeSid( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, PSID *pSid ) { CallWin32ToNt (RtlAllocateAndInitializeSid( - pIdentifierAuthority, nSubAuthorityCount, + pIdentifierAuthority, nSubAuthorityCount, nSubAuthority0, nSubAuthority1, nSubAuthority2, nSubAuthority3, nSubAuthority4, nSubAuthority5, nSubAuthority6, nSubAuthority7, pSid )); @@ -207,7 +207,7 @@ AllocateAndInitializeSid( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, PVOID WINAPI FreeSid( PSID pSid ) { - RtlFreeSid(pSid); + RtlFreeSid(pSid); return NULL; /* is documented like this */ } @@ -253,7 +253,7 @@ EqualSid( PSID pSid1, PSID pSid2 ) /****************************************************************************** * EqualPrefixSid [ADVAPI32.@] */ -BOOL WINAPI EqualPrefixSid (PSID pSid1, PSID pSid2) +BOOL WINAPI EqualPrefixSid (PSID pSid1, PSID pSid2) { return RtlEqualPrefixSid(pSid1, pSid2); } @@ -338,7 +338,7 @@ GetLengthSid (PSID pSid) ###### SECURITY DESCRIPTOR FUNCTIONS ###### ############################################## */ - + /****************************************************************************** * InitializeSecurityDescriptor [ADVAPI32.@] * @@ -379,7 +379,7 @@ GetSecurityDescriptorOwner( SECURITY_DESCRIPTOR *pDescr, PSID *pOwner, * * PARAMS */ -BOOL WINAPI SetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pSecurityDescriptor, +BOOL WINAPI SetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted) { CallWin32ToNt (RtlSetOwnerSecurityDescriptor(pSecurityDescriptor, pOwner, bOwnerDefaulted)); @@ -393,7 +393,7 @@ BOOL WINAPI GetSecurityDescriptorGroup( LPBOOL GroupDefaulted) { CallWin32ToNt (RtlGetGroupSecurityDescriptor(SecurityDescriptor, Group, (PBOOLEAN)GroupDefaulted)); -} +} /****************************************************************************** * SetSecurityDescriptorGroup [ADVAPI32.@] */ @@ -426,12 +426,12 @@ BOOL WINAPI GetSecurityDescriptorDacl( { CallWin32ToNt (RtlGetDaclSecurityDescriptor(pSecurityDescriptor, (PBOOLEAN)lpbDaclPresent, pDacl, (PBOOLEAN)lpbDaclDefaulted)); -} +} /****************************************************************************** * SetSecurityDescriptorDacl [ADVAPI32.@] */ -BOOL WINAPI +BOOL WINAPI SetSecurityDescriptorDacl ( PSECURITY_DESCRIPTOR lpsd, BOOL daclpresent, @@ -451,7 +451,7 @@ BOOL WINAPI GetSecurityDescriptorSacl( { CallWin32ToNt (RtlGetSaclSecurityDescriptor(lpsd, (PBOOLEAN)lpbSaclPresent, pSacl, (PBOOLEAN)lpbSaclDefaulted)); -} +} /************************************************************************** * SetSecurityDescriptorSacl [ADVAPI32.@] @@ -489,7 +489,7 @@ BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescri PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision) { CallWin32ToNt (RtlGetControlSecurityDescriptor(pSecurityDescriptor,pControl,lpdwRevision)); -} +} /* ############################## ###### ACL FUNCTIONS ###### @@ -526,7 +526,7 @@ DWORD WINAPI InitializeAcl(PACL acl, DWORD size, DWORD rev) BOOL WINAPI LookupPrivilegeValueW( LPCWSTR lpSystemName, LPCWSTR lpName, LPVOID lpLuid ) { - FIXME("(%s,%s,%p): stub\n",debugstr_w(lpSystemName), + FIXME("(%s,%s,%p): stub\n",debugstr_w(lpSystemName), debugstr_w(lpName), lpLuid); return TRUE; } @@ -555,7 +555,7 @@ LookupPrivilegeValueA( LPCSTR lpSystemName, LPCSTR lpName, LPVOID lpLuid ) * privileges */ BOOL WINAPI -GetFileSecurityA( LPCSTR lpFileName, +GetFileSecurityA( LPCSTR lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded ) @@ -579,12 +579,12 @@ GetFileSecurityA( LPCSTR lpFileName, * lpnLengthNeeded [] */ BOOL WINAPI -GetFileSecurityW( LPCWSTR lpFileName, +GetFileSecurityW( LPCWSTR lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded ) { - FIXME("(%s) : stub\n", debugstr_w(lpFileName) ); + FIXME("(%s) : stub\n", debugstr_w(lpFileName) ); return TRUE; } @@ -686,11 +686,11 @@ BOOL WINAPI SetFileSecurityA( LPCSTR lpFileName, * pSecurityDescriptor [] */ BOOL WINAPI -SetFileSecurityW( LPCWSTR lpFileName, +SetFileSecurityW( LPCWSTR lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor ) { - FIXME("(%s) : stub\n", debugstr_w(lpFileName) ); + FIXME("(%s) : stub\n", debugstr_w(lpFileName) ); return TRUE; } @@ -752,7 +752,7 @@ LsaOpenPolicy( * LsaQueryInformationPolicy [ADVAPI32.@] */ NTSTATUS WINAPI -LsaQueryInformationPolicy( +LsaQueryInformationPolicy( IN LSA_HANDLE PolicyHandle, IN POLICY_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer) @@ -778,7 +778,7 @@ LsaQueryInformationPolicy( SID sid; }; SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY}; - + struct di * xdi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(xdi)); RtlInitUnicodeString(&(xdi->ppdi.Name), HEAP_strdupAtoW(GetProcessHeap(),0,"DOMAIN")); xdi->ppdi.Sid = &(xdi->sid); @@ -789,8 +789,8 @@ LsaQueryInformationPolicy( *Buffer = xdi; } break; - case PolicyAuditLogInformation: - case PolicyPdAccountInformation: + case PolicyAuditLogInformation: + case PolicyPdAccountInformation: case PolicyLsaServerRoleInformation: case PolicyReplicaSourceInformation: case PolicyDefaultQuotaInformation: @@ -803,8 +803,8 @@ LsaQueryInformationPolicy( return FALSE; } } - return TRUE; -} + return TRUE; +} /****************************************************************************** * LsaLookupSids [ADVAPI32.@] @@ -816,13 +816,13 @@ typedef struct LONG DomainIndex; } LSA_TRANSLATED_NAME, *PLSA_TRANSLATED_NAME; -typedef struct +typedef struct { LSA_UNICODE_STRING Name; PSID Sid; } LSA_TRUST_INFORMATION, *PLSA_TRUST_INFORMATION; -typedef struct +typedef struct { ULONG Entries; PLSA_TRUST_INFORMATION Domains; @@ -977,7 +977,7 @@ BOOL WINAPI GetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce ) BOOL WINAPI PrivilegeCheck( HANDLE ClientToken, PPRIVILEGE_SET RequiredPrivileges, LPBOOL pfResult) { FIXME("stub %d %p %p\n", ClientToken, RequiredPrivileges, pfResult); - if (pfResult) + if (pfResult) *pfResult=TRUE; return TRUE; } diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index 55acfd216d9..23f4d82b9c8 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -42,7 +42,7 @@ EnumServicesStatusA( SC_HANDLE hSCManager, DWORD dwServiceType, DWORD dwServiceState, LPENUM_SERVICE_STATUSA lpServices, DWORD cbBufSize, LPDWORD pcbBytesNeeded, LPDWORD lpServicesReturned, LPDWORD lpResumeHandle ) -{ FIXME("%x type=%lx state=%lx %p %lx %p %p %p\n", hSCManager, +{ FIXME("%x type=%lx state=%lx %p %lx %p %p %p\n", hSCManager, dwServiceType, dwServiceState, lpServices, cbBufSize, pcbBytesNeeded, lpServicesReturned, lpResumeHandle); SetLastError (ERROR_ACCESS_DENIED); @@ -57,7 +57,7 @@ EnumServicesStatusW( SC_HANDLE hSCManager, DWORD dwServiceType, DWORD dwServiceState, LPENUM_SERVICE_STATUSW lpServices, DWORD cbBufSize, LPDWORD pcbBytesNeeded, LPDWORD lpServicesReturned, LPDWORD lpResumeHandle ) -{ FIXME("%x type=%lx state=%lx %p %lx %p %p %p\n", hSCManager, +{ FIXME("%x type=%lx state=%lx %p %lx %p %p %p\n", hSCManager, dwServiceType, dwServiceState, lpServices, cbBufSize, pcbBytesNeeded, lpServicesReturned, lpResumeHandle); SetLastError (ERROR_ACCESS_DENIED); @@ -69,14 +69,14 @@ EnumServicesStatusW( SC_HANDLE hSCManager, DWORD dwServiceType, */ BOOL WINAPI StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent ) -{ +{ LPSERVICE_MAIN_FUNCTIONA fpMain; HANDLE wait; DWORD dwNumServiceArgs ; LPWSTR *lpArgVecW; LPSTR *lpArgVecA; int i; - + TRACE("(%p)\n", servent); wait = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "ADVAPI32_ServiceStartData"); if(wait == 0) @@ -93,7 +93,7 @@ StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent ) /* Convert the Unicode arg vectors back to ASCII */ if(dwNumServiceArgs) - lpArgVecA = (LPSTR*) HeapAlloc( GetProcessHeap(), 0, + lpArgVecA = (LPSTR*) HeapAlloc( GetProcessHeap(), 0, dwNumServiceArgs*sizeof(LPSTR) ); else lpArgVecA = NULL; @@ -102,7 +102,7 @@ StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent ) lpArgVecA[i]=HEAP_strdupWtoA(GetProcessHeap(), 0, lpArgVecW[i]); /* FIXME: should we blindly start all services? */ - while (servent->lpServiceName) { + while (servent->lpServiceName) { TRACE("%s at %p)\n", debugstr_a(servent->lpServiceName),servent); fpMain = servent->lpServiceProc; @@ -131,12 +131,12 @@ StartServiceCtrlDispatcherA( LPSERVICE_TABLE_ENTRYA servent ) */ BOOL WINAPI StartServiceCtrlDispatcherW( LPSERVICE_TABLE_ENTRYW servent ) -{ +{ LPSERVICE_MAIN_FUNCTIONW fpMain; HANDLE wait; DWORD dwNumServiceArgs ; LPWSTR *lpServiceArgVectors ; - + TRACE("(%p)\n", servent); wait = OpenSemaphoreA(SEMAPHORE_ALL_ACCESS, FALSE, "ADVAPI32_ServiceStartData"); if(wait == 0) @@ -152,7 +152,7 @@ StartServiceCtrlDispatcherW( LPSERVICE_TABLE_ENTRYW servent ) ReleaseSemaphore(wait, 1, NULL); /* FIXME: should we blindly start all services? */ - while (servent->lpServiceName) { + while (servent->lpServiceName) { TRACE("%s at %p)\n", debugstr_w(servent->lpServiceName),servent); fpMain = servent->lpServiceProc; @@ -172,7 +172,7 @@ SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerA( LPCSTR lpServiceName, LPHANDLER_FUNCTION lpfHandler ) { FIXME("%s %p\n", lpServiceName, lpfHandler); - return 0xcacacafe; + return 0xcacacafe; } /****************************************************************************** @@ -183,10 +183,10 @@ RegisterServiceCtrlHandlerA( LPCSTR lpServiceName, * lpfHandler [] */ SERVICE_STATUS_HANDLE WINAPI -RegisterServiceCtrlHandlerW( LPCWSTR lpServiceName, +RegisterServiceCtrlHandlerW( LPCWSTR lpServiceName, LPHANDLER_FUNCTION lpfHandler ) { FIXME("%s %p\n", debugstr_w(lpServiceName), lpfHandler); - return 0xcacacafe; + return 0xcacacafe; } /****************************************************************************** @@ -215,7 +215,7 @@ SetServiceStatus( SERVICE_STATUS_HANDLE hService, LPSERVICE_STATUS lpStatus ) SC_HANDLE WINAPI OpenSCManagerA( LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess ) -{ +{ LPWSTR lpMachineNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpMachineName); LPWSTR lpDatabaseNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpDatabaseName); SC_HANDLE ret = OpenSCManagerW(lpMachineNameW,lpDatabaseNameW, @@ -248,7 +248,7 @@ OpenSCManagerW( LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, HKEY hKey; LONG r; - TRACE("(%s,%s,0x%08lx)\n", debugstr_w(lpMachineName), + TRACE("(%s,%s,0x%08lx)\n", debugstr_w(lpMachineName), debugstr_w(lpDatabaseName), dwDesiredAccess); /* @@ -294,7 +294,7 @@ AllocateLocallyUniqueId( PLUID lpluid ) * RETURNS STD */ BOOL WINAPI -ControlService( SC_HANDLE hService, DWORD dwControl, +ControlService( SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus ) { FIXME("(%d,%ld,%p): stub\n",hService,dwControl,lpServiceStatus); @@ -317,7 +317,7 @@ CloseServiceHandle( SC_HANDLE hSCObject ) TRACE("(%x)\n", hSCObject); RegCloseKey(hSCObject); - + return TRUE; } @@ -326,7 +326,7 @@ CloseServiceHandle( SC_HANDLE hSCObject ) * OpenServiceA [ADVAPI32.@] */ SC_HANDLE WINAPI -OpenServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName, +OpenServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName, DWORD dwDesiredAccess ) { LPWSTR lpServiceNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpServiceName); @@ -387,11 +387,11 @@ OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, */ SC_HANDLE WINAPI CreateServiceW( SC_HANDLE hSCManager, LPCWSTR lpServiceName, - LPCWSTR lpDisplayName, DWORD dwDesiredAccess, - DWORD dwServiceType, DWORD dwStartType, + LPCWSTR lpDisplayName, DWORD dwDesiredAccess, + DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCWSTR lpBinaryPathName, - LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId, - LPCWSTR lpDependencies, LPCWSTR lpServiceStartName, + LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId, + LPCWSTR lpDependencies, LPCWSTR lpServiceStartName, LPCWSTR lpPassword ) { FIXME("(%u,%s,%s,...)\n", hSCManager, debugstr_w(lpServiceName), debugstr_w(lpDisplayName)); @@ -404,11 +404,11 @@ CreateServiceW( SC_HANDLE hSCManager, LPCWSTR lpServiceName, */ SC_HANDLE WINAPI CreateServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName, - LPCSTR lpDisplayName, DWORD dwDesiredAccess, - DWORD dwServiceType, DWORD dwStartType, + LPCSTR lpDisplayName, DWORD dwDesiredAccess, + DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCSTR lpBinaryPathName, - LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId, - LPCSTR lpDependencies, LPCSTR lpServiceStartName, + LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId, + LPCSTR lpDependencies, LPCSTR lpServiceStartName, LPCSTR lpPassword ) { HKEY hKey; @@ -417,7 +417,7 @@ CreateServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName, TRACE("(%u,%s,%s,...)\n", hSCManager, debugstr_a(lpServiceName), debugstr_a(lpDisplayName)); - r = RegCreateKeyExA(hSCManager, lpServiceName, 0, NULL, + r = RegCreateKeyExA(hSCManager, lpServiceName, 0, NULL, REG_OPTION_NON_VOLATILE, dwDesiredAccess, NULL, &hKey, &dp); if (r!=ERROR_SUCCESS) return 0; @@ -439,14 +439,14 @@ CreateServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName, if (r!=ERROR_SUCCESS) return 0; - r = RegSetValueExA(hKey, "ErrorControl", 0, REG_DWORD, + r = RegSetValueExA(hKey, "ErrorControl", 0, REG_DWORD, (LPVOID)&dwErrorControl, sizeof (DWORD) ); if (r!=ERROR_SUCCESS) return 0; if(lpBinaryPathName) { - r = RegSetValueExA(hKey, "ImagePath", 0, REG_SZ, + r = RegSetValueExA(hKey, "ImagePath", 0, REG_SZ, lpBinaryPathName,strlen(lpBinaryPathName)+1 ); if (r!=ERROR_SUCCESS) return 0; @@ -454,28 +454,28 @@ CreateServiceA( SC_HANDLE hSCManager, LPCSTR lpServiceName, if(lpLoadOrderGroup) { - r = RegSetValueExA(hKey, "Group", 0, REG_SZ, + r = RegSetValueExA(hKey, "Group", 0, REG_SZ, lpLoadOrderGroup, strlen(lpLoadOrderGroup)+1 ); if (r!=ERROR_SUCCESS) return 0; } - r = RegSetValueExA(hKey, "ErrorControl", 0, REG_DWORD, + r = RegSetValueExA(hKey, "ErrorControl", 0, REG_DWORD, (LPVOID)&dwErrorControl, sizeof (DWORD) ); if (r!=ERROR_SUCCESS) return 0; if(lpDependencies) { - DWORD len = 0; + DWORD len = 0; /* determine the length of a double null terminated multi string */ do { len += (strlen(&lpDependencies[len])+1); - } while (lpDependencies[len++]); - + } while (lpDependencies[len++]); + /* FIXME: this should be unicode */ - r = RegSetValueExA(hKey, "Dependencies", 0, REG_MULTI_SZ, + r = RegSetValueExA(hKey, "Dependencies", 0, REG_MULTI_SZ, lpDependencies, len ); if (r!=ERROR_SUCCESS) return 0; @@ -526,7 +526,7 @@ StartServiceA( SC_HANDLE hService, DWORD dwNumServiceArgs, TRACE("(%d,%ld,%p)\n",hService,dwNumServiceArgs,lpServiceArgVectors); if(dwNumServiceArgs) - lpwstr = (LPWSTR*) HeapAlloc( GetProcessHeap(), 0, + lpwstr = (LPWSTR*) HeapAlloc( GetProcessHeap(), 0, dwNumServiceArgs*sizeof(LPWSTR) ); else lpwstr = NULL; @@ -615,14 +615,14 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs, } } - /* + /* * FIXME: lpServiceArgsVectors need to be stored and returned to * the service when it calls StartServiceCtrlDispatcher * * Chuck these in a global (yuk) so we can pass them to * another process - address space separation will break this. */ - + r = WaitForSingleObject(data,INFINITE); if( r == WAIT_FAILED) @@ -635,8 +635,8 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs, ZeroMemory(&startupinfo,sizeof(STARTUPINFOA)); startupinfo.cb = sizeof(STARTUPINFOA); - r = CreateProcessA(path, - NULL, + r = CreateProcessA(path, + NULL, NULL, /* process security attribs */ NULL, /* thread security attribs */ FALSE, /* inherit handles */ @@ -655,7 +655,7 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs, /* docs for StartServiceCtrlDispatcher say this should be 30 sec */ r = WaitForSingleObject(wait,30000); - + ReleaseSemaphore(data, 1, NULL); if( r == WAIT_FAILED) @@ -670,7 +670,7 @@ StartServiceW( SC_HANDLE hService, DWORD dwNumServiceArgs, * PARAMS * hService [] * lpservicestatus [] - * + * */ BOOL WINAPI QueryServiceStatus( SC_HANDLE hService, LPSERVICE_STATUS lpservicestatus ) diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c index 502727c9ba9..6e3d47f729c 100644 --- a/dlls/avifil32/avifile.c +++ b/dlls/avifil32/avifile.c @@ -1,4 +1,4 @@ -/* +/* * Copyright 1999 Marcus Meissner * * This library is free software; you can redistribute it and/or @@ -144,14 +144,14 @@ static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile* iface,REFIID refiid,LP static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile* iface) { ICOM_THIS(IAVIFileImpl,iface); - + FIXME("(%p)->AddRef()\n",iface); return ++(This->ref); } static ULONG WINAPI IAVIFile_fnRelease(IAVIFile* iface) { ICOM_THIS(IAVIFileImpl,iface); - + FIXME("(%p)->Release()\n",iface); if (!--(This->ref)) { HeapFree(GetProcessHeap(),0,iface); @@ -253,14 +253,14 @@ static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream*iface) { ICOM_THIS(IAVIStreamImpl,iface); - + FIXME("(%p)->AddRef()\n",iface); return ++(This->ref); } static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface) { ICOM_THIS(IAVIStreamImpl,iface); - + FIXME("(%p)->Release()\n",iface); if (!--(This->ref)) { HeapFree(GetProcessHeap(),0,This); @@ -301,7 +301,7 @@ static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID fo as->lpInputFormat = HeapAlloc(GetProcessHeap(),0,formatsize); memcpy(as->lpInputFormat,format,formatsize); if (as->iscompressing) { - int xsize; + int xsize; /* Set up the Compressor part */ xsize = ICCompressGetFormatSize(as->hic,as->lpInputFormat); as->lpCompressFormat = HeapAlloc(GetProcessHeap(),0,xsize); @@ -384,7 +384,7 @@ static HRESULT WINAPI IAVIStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info, */ HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE iface,PAVISTREAM *ppavi,AVISTREAMINFOA * psi) { AVISTREAMINFOW psiw; - + /* Only the szName at the end is different */ memcpy(&psiw,psi,sizeof(*psi)-sizeof(psi->szName)); MultiByteToWideChar( CP_ACP, 0, psi->szName, -1, @@ -481,7 +481,7 @@ HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM *ppsCompressed,PAVISTREAM ppsS as->hic = ICOpen(aco->fccType,aco->fccHandler,ICMODE_COMPRESS); /* May happen. for instance if the codec is not able to compress */ - if (!as->hic) + if (!as->hic) return AVIERR_UNSUPPORTED; ICGetInfo(as->hic,&(as->icinfo),sizeof(ICINFO)); diff --git a/dlls/comcat/factory.c b/dlls/comcat/factory.c index db52a1c9411..5e39e5946d9 100644 --- a/dlls/comcat/factory.c +++ b/dlls/comcat/factory.c @@ -79,7 +79,7 @@ static ULONG WINAPI COMCAT_IClassFactory_Release(LPCLASSFACTORY iface) if (InterlockedDecrement(&This->ref) == 0) { InterlockedDecrement(&dll_ref); } - return This->ref;; + return This->ref; } /********************************************************************** diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c index 6b6e6a6952a..74e0458bd95 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -71,7 +71,7 @@ typedef struct int nLoop; int currFrame; /* tranparency info*/ - COLORREF transparentColor; + COLORREF transparentColor; HBRUSH hbrushBG; HBITMAP hbmPrevFrame; } ANIMATE_INFO; @@ -81,8 +81,8 @@ typedef struct static void ANIMATE_Notify(ANIMATE_INFO* infoPtr, UINT notif) { - SendMessageA(GetParent(infoPtr->hWnd), WM_COMMAND, - MAKEWPARAM(GetDlgCtrlID(infoPtr->hWnd), notif), + SendMessageA(GetParent(infoPtr->hWnd), WM_COMMAND, + MAKEWPARAM(GetDlgCtrlID(infoPtr->hWnd), notif), (LPARAM)infoPtr->hWnd); } @@ -91,19 +91,19 @@ static BOOL ANIMATE_LoadResA(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPSTR lpNam HRSRC hrsrc; MMIOINFO mminfo; LPVOID lpAvi; - + hrsrc = FindResourceA(hInst, lpName, "AVI"); if (!hrsrc) return FALSE; - + infoPtr->hRes = LoadResource(hInst, hrsrc); if (!infoPtr->hRes) return FALSE; - + lpAvi = LockResource(infoPtr->hRes); if (!lpAvi) return FALSE; - + memset(&mminfo, 0, sizeof(mminfo)); mminfo.fccIOProc = FOURCC_MEM; mminfo.pchBuffer = (LPSTR)lpAvi; @@ -122,10 +122,10 @@ static BOOL ANIMATE_LoadFileA(ANIMATE_INFO *infoPtr, LPSTR lpName) { infoPtr->hMMio = mmioOpenA((LPSTR)lpName, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE); - + if (!infoPtr->hMMio) return FALSE; - + return TRUE; } @@ -135,7 +135,7 @@ static LRESULT ANIMATE_DoStop(ANIMATE_INFO *infoPtr) EnterCriticalSection(&infoPtr->cs); /* should stop playing */ - if (infoPtr->hThread) + if (infoPtr->hThread) { if (!TerminateThread(infoPtr->hThread,0)) WARN("could not destroy animation thread!\n"); @@ -197,36 +197,36 @@ static void ANIMATE_Free(ANIMATE_INFO *infoPtr) infoPtr->indata = infoPtr->outdata = NULL; infoPtr->hWnd = 0; infoPtr->hMMio = 0; - + memset(&infoPtr->mah, 0, sizeof(infoPtr->mah)); memset(&infoPtr->ash, 0, sizeof(infoPtr->ash)); infoPtr->nFromFrame = infoPtr->nToFrame = infoPtr->nLoop = infoPtr->currFrame = 0; } - infoPtr->transparentColor = ANIMATE_COLOR_NONE; + infoPtr->transparentColor = ANIMATE_COLOR_NONE; } static void ANIMATE_TransparentBlt(ANIMATE_INFO* infoPtr, HDC hdcDest, HDC hdcSource) -{ +{ HDC hdcMask; HBITMAP hbmMask; - HBITMAP hbmOld; - + HBITMAP hbmOld; + /* create a transparency mask */ hdcMask = CreateCompatibleDC(hdcDest); - hbmMask = CreateBitmap(infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, 1,1,NULL); - hbmOld = SelectObject(hdcMask, hbmMask); + hbmMask = CreateBitmap(infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, 1,1,NULL); + hbmOld = SelectObject(hdcMask, hbmMask); SetBkColor(hdcSource,infoPtr->transparentColor); BitBlt(hdcMask,0,0,infoPtr->inbih->biWidth, infoPtr->inbih->biHeight,hdcSource,0,0,SRCCOPY); - + /* mask the source bitmap */ - SetBkColor(hdcSource, RGB(0,0,0)); - SetTextColor(hdcSource, RGB(255,255,255)); + SetBkColor(hdcSource, RGB(0,0,0)); + SetTextColor(hdcSource, RGB(255,255,255)); BitBlt(hdcSource, 0, 0, infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, hdcMask, 0, 0, SRCAND); /* mask the destination bitmap */ - SetBkColor(hdcDest, RGB(255,255,255)); - SetTextColor(hdcDest, RGB(0,0,0)); + SetBkColor(hdcDest, RGB(255,255,255)); + SetTextColor(hdcDest, RGB(0,0,0)); BitBlt(hdcDest, 0, 0, infoPtr->inbih->biWidth, infoPtr->inbih->biHeight, hdcMask, 0, 0, SRCAND); /* combine source and destination */ @@ -260,48 +260,48 @@ static LRESULT ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC) pBitmapInfo = (LPBITMAPINFO)infoPtr->outbih; nWidth = infoPtr->outbih->biWidth; - nHeight = infoPtr->outbih->biHeight; + nHeight = infoPtr->outbih->biHeight; } else - { + { pBitmapData = infoPtr->indata; pBitmapInfo = (LPBITMAPINFO)infoPtr->inbih; nWidth = infoPtr->inbih->biWidth; - nHeight = infoPtr->inbih->biHeight; - } + nHeight = infoPtr->inbih->biHeight; + } if(!infoPtr->hbmPrevFrame) { infoPtr->hbmPrevFrame=CreateCompatibleBitmap(hDC, nWidth,nHeight ); } - SetDIBits(hDC, infoPtr->hbmPrevFrame, 0, nHeight, pBitmapData, (LPBITMAPINFO)pBitmapInfo, DIB_RGB_COLORS); - + SetDIBits(hDC, infoPtr->hbmPrevFrame, 0, nHeight, pBitmapData, (LPBITMAPINFO)pBitmapInfo, DIB_RGB_COLORS); + hdcMem = CreateCompatibleDC(hDC); hbmOld = SelectObject(hdcMem, infoPtr->hbmPrevFrame); - /* - * we need to get the transparent color even without ACS_TRANSPARENT, + /* + * we need to get the transparent color even without ACS_TRANSPARENT, * because the style can be changed later on and the color should always - * be obtained in the first frame + * be obtained in the first frame */ if(infoPtr->transparentColor == ANIMATE_COLOR_NONE) { infoPtr->transparentColor = GetPixel(hdcMem,0,0); - } + } - if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT) - { + if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT) + { HDC hdcFinal = CreateCompatibleDC(hDC); HBITMAP hbmFinal = CreateCompatibleBitmap(hDC,nWidth, nHeight); HBITMAP hbmOld2 = SelectObject(hdcFinal, hbmFinal); RECT rect; - + rect.left = 0; rect.top = 0; rect.right = nWidth; rect.bottom = nHeight; - + if(!infoPtr->hbrushBG) infoPtr->hbrushBG = GetCurrentObject(hDC, OBJ_BRUSH); @@ -314,16 +314,16 @@ static LRESULT ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC) DeleteObject(infoPtr->hbmPrevFrame); infoPtr->hbmPrevFrame = hbmFinal; } - - if (GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_CENTER) + + if (GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_CENTER) { - RECT rect; + RECT rect; GetWindowRect(infoPtr->hWnd, &rect); - nOffsetX = ((rect.right - rect.left) - nWidth)/2; - nOffsetY = ((rect.bottom - rect.top) - nHeight)/2; + nOffsetX = ((rect.right - rect.left) - nWidth)/2; + nOffsetY = ((rect.bottom - rect.top) - nHeight)/2; } - BitBlt(hDC, nOffsetX, nOffsetY, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY); + BitBlt(hDC, nOffsetX, nOffsetY, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY); SelectObject(hdcMem, hbmOld); DeleteDC(hdcMem); @@ -340,9 +340,9 @@ static LRESULT ANIMATE_DrawFrame(ANIMATE_INFO* infoPtr) mmioSeek(infoPtr->hMMio, infoPtr->lpIndex[infoPtr->currFrame], SEEK_SET); mmioRead(infoPtr->hMMio, infoPtr->indata, infoPtr->ash.dwSuggestedBufferSize); - + if (infoPtr->hic && - fnIC.fnICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata, + fnIC.fnICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata, infoPtr->outbih, infoPtr->outdata) != ICERR_OK) { LeaveCriticalSection(&infoPtr->cs); WARN("Decompression error\n"); @@ -371,7 +371,7 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_) { ANIMATE_INFO* infoPtr = (ANIMATE_INFO*)ptr_; HDC hDC; - + if(!infoPtr) { WARN("animation structure undefined!\n"); @@ -379,8 +379,8 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_) } while(1) - { - if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT) + { + if(GetWindowLongA(infoPtr->hWnd, GWL_STYLE) & ACS_TRANSPARENT) { hDC = GetDC(infoPtr->hWnd); /* sometimes the animation window will be destroyed in between @@ -388,11 +388,11 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_) infoPtr->hbrushBG = SendMessageA(GetParent(infoPtr->hWnd),WM_CTLCOLORSTATIC,hDC, infoPtr->hWnd); ReleaseDC(infoPtr->hWnd,hDC); } - + EnterCriticalSection(&infoPtr->cs); ANIMATE_DrawFrame(infoPtr); LeaveCriticalSection(&infoPtr->cs); - + /* time is in microseconds, we should convert it to milliseconds */ Sleep((infoPtr->mah.dwMicroSecPerFrame+500)/1000); } @@ -419,7 +419,7 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam) if (infoPtr->nToFrame == 0xFFFF) infoPtr->nToFrame = infoPtr->mah.dwTotalFrames - 1; - TRACE("(repeat=%d from=%d to=%d);\n", + TRACE("(repeat=%d from=%d to=%d);\n", infoPtr->nLoop, infoPtr->nFromFrame, infoPtr->nToFrame); if (infoPtr->nFromFrame >= infoPtr->nToFrame || @@ -442,9 +442,9 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam) ERR("Could not create animation thread!\n"); return FALSE; } - + } - + ANIMATE_Notify(infoPtr, ACN_START); return TRUE; @@ -512,13 +512,13 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) mmioRead(infoPtr->hMMio, (LPSTR)&infoPtr->ash, sizeof(infoPtr->ash)); - TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccType)), - HIBYTE(LOWORD(infoPtr->ash.fccType)), - LOBYTE(HIWORD(infoPtr->ash.fccType)), + TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccType)), + HIBYTE(LOWORD(infoPtr->ash.fccType)), + LOBYTE(HIWORD(infoPtr->ash.fccType)), HIBYTE(HIWORD(infoPtr->ash.fccType))); - TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccHandler)), - HIBYTE(LOWORD(infoPtr->ash.fccHandler)), - LOBYTE(HIWORD(infoPtr->ash.fccHandler)), + TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(infoPtr->ash.fccHandler)), + HIBYTE(LOWORD(infoPtr->ash.fccHandler)), + LOBYTE(HIWORD(infoPtr->ash.fccHandler)), HIBYTE(HIWORD(infoPtr->ash.fccHandler))); TRACE("ash.dwFlags=%ld\n", infoPtr->ash.dwFlags); TRACE("ash.wPriority=%d\n", infoPtr->ash.wPriority); @@ -531,7 +531,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) TRACE("ash.dwSuggestedBufferSize=%ld\n", infoPtr->ash.dwSuggestedBufferSize); TRACE("ash.dwQuality=%ld\n", infoPtr->ash.dwQuality); TRACE("ash.dwSampleSize=%ld\n", infoPtr->ash.dwSampleSize); - TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", infoPtr->ash.rcFrame.top, infoPtr->ash.rcFrame.left, + TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", infoPtr->ash.rcFrame.top, infoPtr->ash.rcFrame.left, infoPtr->ash.rcFrame.bottom, infoPtr->ash.rcFrame.right); mmioAscend(infoPtr->hMMio, &mmckInfo, 0); @@ -565,10 +565,10 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) mmioAscend(infoPtr->hMMio, &mmckInfo, 0); mmioAscend(infoPtr->hMMio, &mmckList, 0); - + #if 0 /* an AVI has 0 or 1 video stream, and to be animated should not contain - * an audio stream, so only one strl is allowed + * an audio stream, so only one strl is allowed */ mmckList.fccType = mmioFOURCC('s', 't', 'r', 'l'); if (mmioDescend(infoPtr->hMMio, &mmckList, &mmckHead, MMIO_FINDLIST) == 0) { @@ -589,7 +589,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) /* FIXME: should handle the 'rec ' LIST when present */ - infoPtr->lpIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + infoPtr->lpIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, infoPtr->mah.dwTotalFrames * sizeof(DWORD)); if (!infoPtr->lpIndex) { WARN("Can't alloc index array\n"); @@ -597,7 +597,7 @@ static BOOL ANIMATE_GetAviInfo(ANIMATE_INFO *infoPtr) } numFrame = insize = 0; - while (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckList, 0) == 0 && + while (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckList, 0) == 0 && numFrame < infoPtr->mah.dwTotalFrames) { infoPtr->lpIndex[numFrame] = mmckInfo.dwDataOffset; if (insize < mmckInfo.cksize) @@ -633,7 +633,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) (infoPtr->ash.fccHandler == mmioFOURCC('R', 'L', 'E', ' ')) || (infoPtr->ash.fccHandler == mmioFOURCC(0, 0, 0, 0))) { - infoPtr->hic = 0; + infoPtr->hic = 0; return TRUE; } @@ -643,8 +643,8 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) WARN("Can't load codec for the file\n"); return FALSE; } - - outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, + + outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, (DWORD)infoPtr->inbih, 0L); infoPtr->outbih = HeapAlloc(GetProcessHeap(), 0, outSize); @@ -653,7 +653,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) return FALSE; } - if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, + if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT, (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) { WARN("Can't get output BIH\n"); return FALSE; @@ -665,7 +665,7 @@ static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr) return FALSE; } - if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN, + if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN, (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) { WARN("Can't begin decompression\n"); return FALSE; @@ -686,7 +686,7 @@ static LRESULT ANIMATE_OpenA(HWND hWnd, WPARAM wParam, LPARAM lParam) TRACE("Closing avi!\n"); return TRUE; } - + if (!hInstance) hInstance = GetWindowLongA(hWnd, GWL_HINSTANCE); @@ -786,7 +786,7 @@ static LRESULT ANIMATE_Create(HWND hWnd, WPARAM wParam, LPARAM lParam) infoPtr->hbmPrevFrame = 0; InitializeCriticalSection(&infoPtr->cs); - + return 0; } @@ -810,11 +810,11 @@ static LRESULT ANIMATE_Destroy(HWND hWnd, WPARAM wParam, LPARAM lParam) static LRESULT ANIMATE_EraseBackground(HWND hWnd, WPARAM wParam, LPARAM lParam) { RECT rect; - HBRUSH hBrush = 0; + HBRUSH hBrush = 0; - if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT) + if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT) { - hBrush = SendMessageA(GetParent(hWnd),WM_CTLCOLORSTATIC,(HDC)wParam, hWnd); + hBrush = SendMessageA(GetParent(hWnd),WM_CTLCOLORSTATIC,(HDC)wParam, hWnd); } GetClientRect(hWnd, &rect); @@ -840,27 +840,27 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP { case ACM_OPENA: return ANIMATE_OpenA(hWnd, wParam, lParam); - + /* case ACM_OPEN32W: FIXME!! */ /* return ANIMATE_Open32W(hWnd, wParam, lParam); */ - + case ACM_PLAY: return ANIMATE_Play(hWnd, wParam, lParam); - + case ACM_STOP: return ANIMATE_Stop(hWnd, wParam, lParam); - + case WM_NCCREATE: ANIMATE_Create(hWnd, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam); - + case WM_NCHITTEST: return HTTRANSPARENT; case WM_DESTROY: ANIMATE_Destroy(hWnd, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam); - + case WM_ERASEBKGND: ANIMATE_EraseBackground(hWnd, wParam, lParam); break; @@ -874,7 +874,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP infoPtr->hbrushBG = SendMessageA(GetParent(hWnd),WM_CTLCOLORSTATIC,(HDC)wParam, hWnd); } return ANIMATE_DrawFrame(ANIMATE_GetInfoPtr(hWnd)); - + case WM_CLOSE: ANIMATE_Free(ANIMATE_GetInfoPtr(hWnd)); return TRUE; @@ -882,16 +882,16 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP case WM_PAINT: { ANIMATE_INFO* infoPtr = ANIMATE_GetInfoPtr(hWnd); - + /* the animation isn't playing, don't paint */ if(!infoPtr->uTimer && !infoPtr->hThread) /* default paint handling */ return DefWindowProcA(hWnd, uMsg, wParam, lParam); - + if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT) infoPtr->hbrushBG = SendMessageA(GetParent(hWnd), WM_CTLCOLORSTATIC, (HDC)wParam, hWnd); - + if (wParam) { EnterCriticalSection(&infoPtr->cs); @@ -906,7 +906,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP EnterCriticalSection(&infoPtr->cs); ANIMATE_PaintFrame(infoPtr, hDC); LeaveCriticalSection(&infoPtr->cs); - + EndPaint(hWnd, &ps); } } @@ -919,7 +919,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP default: if (uMsg >= WM_USER) ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam); - + return DefWindowProcA(hWnd, uMsg, wParam, lParam); } return 0; @@ -937,7 +937,7 @@ void ANIMATE_Register(void) wndClass.hCursor = LoadCursorA(0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wndClass.lpszClassName = ANIMATE_CLASSA; - + RegisterClassA(&wndClass); } diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index fa062317201..9e1fd6e4991 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -87,12 +87,12 @@ typedef struct /* * Special flag set in DRAWITEMSTRUCT itemState field. It is set by - * the ComboEx version of the Combo Window Proc so that when the - * WM_DRAWITEM message is then passed to ComboEx, we know that this + * the ComboEx version of the Combo Window Proc so that when the + * WM_DRAWITEM message is then passed to ComboEx, we know that this * particular WM_DRAWITEM message is for listbox only items. Any messasges * without this flag is then for the Edit control field. * - * We really cannot use the ODS_COMBOBOXEDIT flag because MSDN states that + * We really cannot use the ODS_COMBOBOXEDIT flag because MSDN states that * only version 4.0 applications will have ODS_COMBOBOXEDIT set. */ #define ODS_COMBOEXLBOX 0x4000 @@ -163,7 +163,7 @@ static void COMBOEX_DumpInput (COMBOBOXEXITEMW *input) inline static CBE_ITEMDATA *get_item_data(COMBOEX_INFO *infoPtr, INT index) { - return (CBE_ITEMDATA *)SendMessageW (infoPtr->hwndCombo, CB_GETITEMDATA, + return (CBE_ITEMDATA *)SendMessageW (infoPtr->hwndCombo, CB_GETITEMDATA, (WPARAM)index, 0); } @@ -206,14 +206,14 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr) if (code == CBEN_ENDEDITW) code = CBEN_ENDEDITA; else if (code == CBEN_GETDISPINFOW) code = CBEN_GETDISPINFOA; else if (code == CBEN_DRAGBEGINW) code = CBEN_DRAGBEGINA; - + ret = COMBOEX_Notify (infoPtr, code, (NMHDR *)hdr); if (astr && hdr->ceItem.pszText == (LPWSTR)astr) hdr->ceItem.pszText = wstr; - + if (astr) COMCTL32_Free(astr); - + return ret; } } @@ -227,7 +227,7 @@ static INT COMBOEX_NotifyEndEdit (COMBOEX_INFO *infoPtr, NMCBEENDEDITW *neew, LP return COMBOEX_Notify (infoPtr, CBEN_ENDEDITW, &neew->hdr); } else { NMCBEENDEDITA neea; - + memcpy (&neea.hdr, &neew->hdr, sizeof(NMHDR)); neea.fChanged = neew->fChanged; neea.iNewSelection = neew->iNewSelection; @@ -253,10 +253,10 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) NMCOMBOBOXEXW nmce; LPWSTR text, buf; INT len; - - if (item->pszText != LPSTR_TEXTCALLBACKW) + + if (item->pszText != LPSTR_TEXTCALLBACKW) return item->pszText; - + ZeroMemory(&nmce, sizeof(nmce)); nmce.ceItem.mask = CBEIF_TEXT; COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce); @@ -276,7 +276,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) text = buf; } else text = nmce.ceItem.pszText; - + if (nmce.ceItem.mask & CBEIF_DI_SETITEM) item->pszText = text; return text; @@ -395,7 +395,7 @@ static void COMBOEX_SetEditText (COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) } } - + static CBE_ITEMDATA * COMBOEX_FindItem(COMBOEX_INFO *infoPtr, INT index) { CBE_ITEMDATA *item; @@ -425,7 +425,7 @@ static inline BOOL COMBOEX_HasEdit(COMBOEX_INFO *infoPtr) { return infoPtr->hwndEdit; } - + /* *** CBEM_xxx message support *** */ @@ -480,7 +480,7 @@ static BOOL COMBOEX_GetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit) if(!COMBOEX_GetItemW (infoPtr, &tmpcit)) return FALSE; if (is_textW(tmpcit.pszText) && cit->pszText) - WideCharToMultiByte (CP_ACP, 0, tmpcit.pszText, -1, + WideCharToMultiByte (CP_ACP, 0, tmpcit.pszText, -1, cit->pszText, cit->cchTextMax, NULL, NULL); else if (cit->pszText) cit->pszText[0] = 0; else cit->pszText = (LPSTR)tmpcit.pszText; @@ -519,7 +519,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) /* get zero-filled space and chain it in */ if(!(item = (CBE_ITEMDATA *)COMCTL32_Alloc (sizeof(*item)))) return -1; - + /* locate position to insert new item in */ if (index == infoPtr->nb_items) { /* fast path for iItem = -1 */ @@ -575,7 +575,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) if (TRACE_ON(comboex)) COMBOEX_DumpItem (item); - SendMessageW (infoPtr->hwndCombo, CB_INSERTSTRING, + SendMessageW (infoPtr->hwndCombo, CB_INSERTSTRING, (WPARAM)cit->iItem, (LPARAM)item); memset (&nmcit.ceItem, 0, sizeof(nmcit.ceItem)); @@ -601,15 +601,15 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit) MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len); citW.pszText = wstr; } - ret = COMBOEX_InsertItemW(infoPtr, &citW);; - + ret = COMBOEX_InsertItemW(infoPtr, &citW); + if (wstr) COMCTL32_Free(wstr); - + return ret; } -static DWORD +static DWORD COMBOEX_SetExtendedStyle (COMBOEX_INFO *infoPtr, DWORD mask, DWORD style) { DWORD dwTemp; @@ -675,7 +675,7 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) if (!(item = COMBOEX_FindItem(infoPtr, index))) return FALSE; - /* add/change stuff to the internal item structure */ + /* add/change stuff to the internal item structure */ item->mask |= cit->mask; if (cit->mask & CBEIF_TEXT) { INT len = 0; @@ -725,7 +725,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit) MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len); citW.pszText = wstr; } - ret = COMBOEX_SetItemW(infoPtr, &citW);; + ret = COMBOEX_SetItemW(infoPtr, &citW); if (wstr) COMCTL32_Free(wstr); @@ -856,7 +856,7 @@ static INT COMBOEX_SetItemHeight (COMBOEX_INFO *infoPtr, INT index, UINT height) GetWindowRect (infoPtr->hwndCombo, &cb_wrect); GetWindowRect (infoPtr->hwndSelf, &cbx_wrect); GetClientRect (infoPtr->hwndSelf, &cbx_crect); - /* the height of comboex as height of the combo + comboex border */ + /* the height of comboex as height of the combo + comboex border */ height = cb_wrect.bottom-cb_wrect.top + cbx_wrect.bottom-cbx_wrect.top - (cbx_crect.bottom-cbx_crect.top); @@ -894,7 +894,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) /* initialize info structure */ /* note that infoPtr is allocated zero-filled */ - + infoPtr->hwndSelf = hwnd; infoPtr->selected = -1; @@ -933,14 +933,14 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) infoPtr->hwndCombo = CreateWindowW (COMBOBOX, NIL, /* following line added to match native */ WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VSCROLL | - CBS_NOINTEGRALHEIGHT | CBS_DROPDOWNLIST | + CBS_NOINTEGRALHEIGHT | CBS_DROPDOWNLIST | /* was base and is necessary */ WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED | dwComboStyle, cs->y, cs->x, cs->cx, cs->cy, hwnd, (HMENU) GetWindowLongW (hwnd, GWL_ID), GetWindowLongW (hwnd, GWL_HINSTANCE), NULL); - /* + /* * native does the following at this point according to trace: * GetWindowThreadProcessId(hwndCombo,0) * GetCurrentThreadId() @@ -949,11 +949,11 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) */ /* - * Setup a property to hold the pointer to the COMBOBOXEX + * Setup a property to hold the pointer to the COMBOBOXEX * data structure. */ SetPropA(infoPtr->hwndCombo, COMBOEX_SUBCLASS_PROP, hwnd); - infoPtr->prevComboWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndCombo, + infoPtr->prevComboWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndCombo, GWL_WNDPROC, (LONG)COMBOEX_ComboWndProc); infoPtr->font = SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0); @@ -966,7 +966,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) infoPtr->hwndEdit = CreateWindowExW (0, EDIT, NIL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | ES_AUTOHSCROLL, 0, 0, 0, 0, /* will set later */ - infoPtr->hwndCombo, + infoPtr->hwndCombo, (HMENU) GetWindowLongW (hwnd, GWL_ID), GetWindowLongW (hwnd, GWL_HINSTANCE), NULL); @@ -979,11 +979,11 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) */ /* - * Setup a property to hold the pointer to the COMBOBOXEX + * Setup a property to hold the pointer to the COMBOBOXEX * data structure. */ SetPropA(infoPtr->hwndEdit, COMBOEX_SUBCLASS_PROP, hwnd); - infoPtr->prevEditWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndEdit, + infoPtr->prevEditWndProc = (WNDPROC)SetWindowLongW(infoPtr->hwndEdit, GWL_WNDPROC, (LONG)COMBOEX_EditWndProc); infoPtr->font = SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0); } @@ -993,7 +993,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) * all associated controls */ if (!infoPtr->font) { - SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof(mylogfont), + SystemParametersInfoW (SPI_GETICONTITLELOGFONT, sizeof(mylogfont), &mylogfont, 0); infoPtr->font = infoPtr->defaultFont = CreateFontIndirectW (&mylogfont); } @@ -1014,21 +1014,21 @@ static LRESULT COMBOEX_Create (HWND hwnd, LPCREATESTRUCTA cs) wnrc1.left, wnrc1.top, wnrc1.right, wnrc1.bottom, clrc1.left, clrc1.top, clrc1.right, clrc1.bottom, cmbwrc.left, cmbwrc.top, cmbwrc.right, cmbwrc.bottom); - SetWindowPos(infoPtr->hwndCombo, HWND_TOP, + SetWindowPos(infoPtr->hwndCombo, HWND_TOP, 0, 0, wnrc1.right-wnrc1.left, wnrc1.bottom-wnrc1.top, SWP_NOACTIVATE | SWP_NOREDRAW); GetWindowRect(infoPtr->hwndCombo, &cmbwrc); TRACE("CB window=(%d,%d)-(%d,%d)\n", cmbwrc.left, cmbwrc.top, cmbwrc.right, cmbwrc.bottom); - SetWindowPos(hwnd, HWND_TOP, + SetWindowPos(hwnd, HWND_TOP, 0, 0, cmbwrc.right-cmbwrc.left, cmbwrc.bottom-cmbwrc.top, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE); COMBOEX_AdjustEditPos (infoPtr); /* - * Create an item structure to represent the data in the + * Create an item structure to represent the data in the * EDIT control. It is allocated zero-filled. */ infoPtr->edit = (CBE_ITEMDATA *)COMCTL32_Alloc (sizeof (CBE_ITEMDATA)); @@ -1060,11 +1060,11 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa SetFocus (infoPtr->hwndCombo); ShowWindow (infoPtr->hwndEdit, SW_HIDE); return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); - + case CBN_CLOSEUP: SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); /* - * from native trace of first dropdown after typing in URL in IE4 + * from native trace of first dropdown after typing in URL in IE4 * CB_GETCURSEL(Combo) * GetWindowText(Edit) * CB_GETCURSEL(Combo) @@ -1074,7 +1074,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa * CB_GETCURSEL(Combo) * CB_SETCURSEL(COMBOEX, n) * SetFocus(Combo) - * the rest is supposition + * the rest is supposition */ ShowWindow (infoPtr->hwndEdit, SW_SHOW); InvalidateRect (infoPtr->hwndCombo, 0, TRUE); @@ -1154,7 +1154,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa return SendMessageW (parent, WM_COMMAND, wParam, (LPARAM)infoPtr->hwndSelf); case CBN_SELENDOK: - /* + /* * We have to change the handle since we are the control * issuing the message. IE4 depends on this. */ @@ -1188,7 +1188,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam, LPARAM lPa return 0; default: - /* + /* * We have to change the handle since we are the control * issuing the message. IE4 depends on this. * We also need to set the focus back to the Edit control @@ -1263,13 +1263,13 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) if (!IsWindowEnabled(infoPtr->hwndCombo)) return 0; - TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", + TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", dis->CtlType, dis->CtlID); - TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n", + TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n", dis->itemID, dis->itemAction, dis->itemState); TRACE("hWnd=0x%04x hDC=0x%04x (%d,%d)-(%d,%d) itemData=0x%08lx\n", - dis->hwndItem, dis->hDC, dis->rcItem.left, - dis->rcItem.top, dis->rcItem.right, dis->rcItem.bottom, + dis->hwndItem, dis->hDC, dis->rcItem.left, + dis->rcItem.top, dis->rcItem.right, dis->rcItem.bottom, dis->itemData); /* MSDN says: */ @@ -1285,13 +1285,13 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) /* though the list box or combo box has the focus. */ if (dis->itemID == 0xffffffff) { if ( ( (dis->itemAction & ODA_FOCUS) && (dis->itemState & ODS_SELECTED)) || - ( (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) && (dis->itemState & ODS_FOCUS) ) ) { + ( (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) && (dis->itemState & ODS_FOCUS) ) ) { TRACE("drawing item -1 special focus, rect=(%d,%d)-(%d,%d)\n", dis->rcItem.left, dis->rcItem.top, dis->rcItem.right, dis->rcItem.bottom); } - else if ((dis->CtlType == ODT_COMBOBOX) && + else if ((dis->CtlType == ODT_COMBOBOX) && (dis->itemAction == ODA_DRAWENTIRE)) { /* draw of edit control data */ @@ -1333,7 +1333,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) item->pszText = (LPWSTR)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); if (item->pszText) GetWindowTextW(infoPtr->hwndEdit, item->pszText, len+1); - + TRACE("edit control hwndEdit=%0x, text len=%d str=%s\n", infoPtr->hwndEdit, len, debugstr_txt(item->pszText)); } @@ -1381,8 +1381,8 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) } else { /* drawing combo/edit entry */ if (IsWindowVisible(infoPtr->hwndEdit)) { - /* if we have an edit control, the slave the - * selection state to the Edit focus state + /* if we have an edit control, the slave the + * selection state to the Edit focus state */ if (infoPtr->flags & WCBE_EDITFOCUSED) { if (item->mask & CBEIF_SELECTEDIMAGE) @@ -1390,7 +1390,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) drawstate = ILD_SELECTED; } } else { - /* if we don't have an edit control, use + /* if we don't have an edit control, use * the requested state. */ if (dis->itemState & ODS_SELECTED) { @@ -1414,10 +1414,10 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) len = strlenW (str); GetTextExtentPoint32W (dis->hDC, str, len, &txtsize); - + if (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) { int overlay = item->iOverlay; - + if (drawimage == I_IMAGECALLBACK) { NMCOMBOBOXEXW nmce; ZeroMemory(&nmce, sizeof(nmce)); @@ -1441,11 +1441,11 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) item->iOverlay = nmce.ceItem.iOverlay; overlay = nmce.ceItem.iOverlay; } - - if (drawimage >= 0 && + + if (drawimage >= 0 && !(infoPtr->dwExtStyle & (CBES_EX_NOEDITIMAGE | CBES_EX_NOEDITIMAGEINDENT))) { if (overlay > 0) ImageList_SetOverlayImage (infoPtr->himl, overlay, 1); - ImageList_Draw (infoPtr->himl, drawimage, dis->hDC, xbase, dis->rcItem.top, + ImageList_Draw (infoPtr->himl, drawimage, dis->hDC, xbase, dis->rcItem.top, drawstate | (overlay > 0 ? INDEXTOOVERLAYMASK(1) : 0)); } @@ -1472,7 +1472,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis) SetTextColor (dis->hDC, txc); } } - + if (dis->itemAction & ODA_FOCUS) { rect.left = xbase + xioff - 1; rect.right = rect.left + txtsize.cx + 2; @@ -1508,7 +1508,7 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr) infoPtr->items = 0; } - if (infoPtr->defaultFont) + if (infoPtr->defaultFont) DeleteObject (infoPtr->defaultFont); /* free comboex info data */ @@ -1564,7 +1564,7 @@ static LRESULT COMBOEX_NotifyFormat (COMBOEX_INFO *infoPtr, LPARAM lParam) static LRESULT COMBOEX_Size (COMBOEX_INFO *infoPtr, INT width, INT height) { - TRACE("(width=%d, height=%d)\n", width, height); + TRACE("(width=%d, height=%d)\n", width, height); MoveWindow (infoPtr->hwndCombo, 0, 0, width, height, TRUE); @@ -1585,8 +1585,8 @@ static LRESULT COMBOEX_WindowPosChanging (COMBOEX_INFO *infoPtr, WINDOWPOS *wp) /* width is winpos value + border width of comboex */ width = wp->cx - + (cbx_wrect.right-cbx_wrect.left) - - (cbx_crect.right-cbx_crect.left); + + (cbx_wrect.right-cbx_wrect.left) + - (cbx_crect.right-cbx_crect.left); TRACE("winpos=(%d,%d %dx%d) flags=0x%08x\n", wp->x, wp->y, wp->cx, wp->cy, wp->flags); @@ -1630,7 +1630,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) RECT rect; LRESULT lret; - TRACE("hwnd=%x msg=%x wparam=%x lParam=%lx, info_ptr=%p\n", + TRACE("hwnd=%x msg=%x wparam=%x lParam=%lx, info_ptr=%p\n", hwnd, uMsg, wParam, lParam, infoPtr); if (!infoPtr) return 0; @@ -1642,12 +1642,12 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* handle (ignore) the return character */ if (wParam == VK_RETURN) return 0; /* all other characters pass into the real Edit */ - return CallWindowProcW (infoPtr->prevEditWndProc, + return CallWindowProcW (infoPtr->prevEditWndProc, hwnd, uMsg, wParam, lParam); case WM_ERASEBKGND: /* - * The following was determined by traces of the native + * The following was determined by traces of the native */ hDC = (HDC) wParam; obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW)); @@ -1656,7 +1656,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) rect.left, rect.top, rect.right, rect.bottom); ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0); SetBkColor (hDC, obkc); - return CallWindowProcW (infoPtr->prevEditWndProc, + return CallWindowProcW (infoPtr->prevEditWndProc, hwnd, uMsg, wParam, lParam); case WM_KEYDOWN: { @@ -1671,7 +1671,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) * GetWindowTextA(Edit,&?, 0x104) x * CB_GETCURSEL to Combo rets -1 x * WM_NOTIFY to COMBOEX parent (rebar) x - * (CBEN_ENDEDIT{A|W} + * (CBEN_ENDEDIT{A|W} * fChanged = FALSE x * inewSelection = -1 x * txt="www.hoho" x @@ -1700,9 +1700,9 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ERR("item %d not found. Problem!\n", oldItem); break; } - infoPtr->selected = oldItem; + infoPtr->selected = oldItem; COMBOEX_SetEditText (infoPtr, item); - RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE | + RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE | RDW_INVALIDATE); break; @@ -1712,9 +1712,9 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) * GetWindowTextA(Edit,&?, 0x104) x * CB_GETCURSEL to Combo rets -1 x * CB_GETCOUNT to Combo rets 0 - * if >0 loop + * if >0 loop * CB_GETITEMDATA to match - * *** above 3 lines simulated by FindItem x + * *** above 3 lines simulated by FindItem x * WM_NOTIFY to COMBOEX parent (rebar) x * (CBEN_ENDEDIT{A|W} x * fChanged = TRUE (-1) x @@ -1749,20 +1749,20 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } cbeend.iNewSelection = selected; - cbeend.fChanged = TRUE; + cbeend.fChanged = TRUE; cbeend.iWhy = CBENF_RETURN; if (COMBOEX_NotifyEndEdit (infoPtr, &cbeend, edit_text)) { /* abort the change, restore previous */ TRACE("Notify requested abort of change\n"); COMBOEX_SetEditText (infoPtr, infoPtr->edit); - RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE | + RedrawWindow (infoPtr->hwndCombo, 0, 0, RDW_ERASE | RDW_INVALIDATE); return 0; } oldItem = SendMessageW (infoPtr->hwndCombo,CB_GETCURSEL, 0, 0); if (oldItem != -1) { /* if something is selected, then deselect it */ - SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, + SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, (WPARAM)-1, 0); } InvalidateRect (infoPtr->hwndCombo, 0, 0); @@ -1786,13 +1786,13 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SETFOCUS: /* remember the focus to set state of icon */ - lret = CallWindowProcW (infoPtr->prevEditWndProc, + lret = CallWindowProcW (infoPtr->prevEditWndProc, hwnd, uMsg, wParam, lParam); infoPtr->flags |= WCBE_EDITFOCUSED; return lret; case WM_KILLFOCUS: - /* + /* * do NOTIFY CBEN_ENDEDIT with CBENF_KILLFOCUS */ infoPtr->flags &= ~WCBE_EDITFOCUSED; @@ -1810,7 +1810,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* fall through */ default: - return CallWindowProcW (infoPtr->prevEditWndProc, + return CallWindowProcW (infoPtr->prevEditWndProc, hwnd, uMsg, wParam, lParam); } return 0; @@ -1830,7 +1830,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) RECT rect; WCHAR edit_text[260]; - TRACE("hwnd=%x msg=%x wparam=%x lParam=%lx, info_ptr=%p\n", + TRACE("hwnd=%x msg=%x wparam=%x lParam=%lx, info_ptr=%p\n", hwnd, uMsg, wParam, lParam, infoPtr); if (!infoPtr) return 0; @@ -1848,12 +1848,12 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) * that ComboEx knows this is listbox. */ ((DRAWITEMSTRUCT *)lParam)->itemState |= ODS_COMBOEXLBOX; - return CallWindowProcW (infoPtr->prevComboWndProc, + return CallWindowProcW (infoPtr->prevComboWndProc, hwnd, uMsg, wParam, lParam); case WM_ERASEBKGND: /* - * The following was determined by traces of the native + * The following was determined by traces of the native */ hDC = (HDC) wParam; obkc = SetBkColor (hDC, GetSysColor (COLOR_WINDOW)); @@ -1862,7 +1862,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) rect.left, rect.top, rect.right, rect.bottom); ExtTextOutW (hDC, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0); SetBkColor (hDC, obkc); - return CallWindowProcW (infoPtr->prevComboWndProc, + return CallWindowProcW (infoPtr->prevComboWndProc, hwnd, uMsg, wParam, lParam); case WM_SETCURSOR: @@ -1877,7 +1877,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) nmmse.pt.y = 0; nmmse.dwHitInfo = lParam; COMBOEX_Notify (infoPtr, NM_SETCURSOR, (NMHDR *)&nmmse); - return CallWindowProcW (infoPtr->prevComboWndProc, + return CallWindowProcW (infoPtr->prevComboWndProc, hwnd, uMsg, wParam, lParam); case WM_COMMAND: @@ -1917,11 +1917,11 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) InvalidateRect (infoPtr->hwndCombo, 0, 0); if (focusedhwnd) SendMessageW (infoPtr->hwndCombo, WM_KILLFOCUS, - (WPARAM)focusedhwnd, 0); + (WPARAM)focusedhwnd, 0); return 0; case EN_SETFOCUS: { - /* + /* * For EN_SETFOCUS this issues the same calls and messages * as the native seems to do. * @@ -1947,7 +1947,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } case EN_CHANGE: { - /* + /* * For EN_CHANGE this issues the same calls and messages * as the native seems to do. */ @@ -2023,7 +2023,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; }/* fall through */ default: - return CallWindowProcW (infoPtr->prevComboWndProc, + return CallWindowProcW (infoPtr->prevComboWndProc, hwnd, uMsg, wParam, lParam); } return 0; @@ -2114,7 +2114,7 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) uMsg, wParam, lParam); /* Combo messages OK to just forward to the regular COMBO */ - case CB_GETCOUNT: + case CB_GETCOUNT: case CB_GETCURSEL: case CB_GETDROPPEDSTATE: case CB_SETDROPPEDWIDTH: @@ -2194,7 +2194,7 @@ void COMBOEX_Register (void) wndClass.hCursor = LoadCursorW (0, IDC_ARROWW); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wndClass.lpszClassName = WC_COMBOBOXEXW; - + RegisterClassW (&wndClass); } diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h index d9da1275513..71b69fa1f58 100644 --- a/dlls/comctl32/comctl32.h +++ b/dlls/comctl32/comctl32.h @@ -1,5 +1,5 @@ /****************************************************************************** - * + * * Common definitions (resource ids and global variables) * * Copyright 1999 Thuy Nguyen @@ -93,7 +93,7 @@ extern HBRUSH COMCTL32_hPattern55AABrush; /* DragList icon */ #define IDI_DRAGARROW 150 -typedef struct +typedef struct { COLORREF clrBtnHighlight; /* COLOR_BTNHIGHLIGHT */ COLORREF clrBtnShadow; /* COLOR_BTNSHADOW */ @@ -121,7 +121,7 @@ VOID COMCTL32_RefreshSysColors(void); INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen); BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc); -#define COMCTL32_VERSION_MINOR 0 +#define COMCTL32_VERSION_MINOR 0 #define WINE_FILEVERSION 5, COMCTL32_VERSION_MINOR, 0, 0 #define WINE_FILEVERSIONSTR "5.00" diff --git a/dlls/comctl32/comctl32undoc.c b/dlls/comctl32/comctl32undoc.c index 2d843c2bd0b..2b97f91b36d 100644 --- a/dlls/comctl32/comctl32undoc.c +++ b/dlls/comctl32/comctl32undoc.c @@ -273,7 +273,7 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags, break; } nResult = (pfnCompare)(*pWork1, *pWork2, lParam); - TRACE("compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d\n", + TRACE("compare result=%d, dpa1.cnt=%d, dpa2.cnt=%d\n", nResult, nIndex, nCount); if (nResult == 0) @@ -522,7 +522,7 @@ VOID MRU_SaveChanged( LPWINEMRULIST mp ) */ /* open the sub key */ - if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, + if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 0, KEY_WRITE, &newkey))) { /* not present - what to do ??? */ ERR("Can not open key, error=%d, attempting to create\n", @@ -542,7 +542,7 @@ VOID MRU_SaveChanged( LPWINEMRULIST mp ) } if (mp->wineFlags & WMRUF_CHANGED) { mp->wineFlags &= ~WMRUF_CHANGED; - err = RegSetValueExA(newkey, "MRUList", 0, REG_SZ, + err = RegSetValueExA(newkey, "MRUList", 0, REG_SZ, mp->realMRU, strlen(mp->realMRU) + 1); if (err) { ERR("error saving MRUList, err=%d\n", err); @@ -555,8 +555,8 @@ VOID MRU_SaveChanged( LPWINEMRULIST mp ) if (witem->itemFlag & WMRUIF_CHANGED) { witem->itemFlag &= ~WMRUIF_CHANGED; realname[0] = 'a' + i; - err = RegSetValueExW(newkey, realname, 0, - (mp->extview.dwFlags & MRUF_BINARY_LIST) ? + err = RegSetValueExW(newkey, realname, 0, + (mp->extview.dwFlags & MRUF_BINARY_LIST) ? REG_BINARY : REG_SZ, &witem->datastart, witem->size); if (err) { @@ -601,7 +601,7 @@ FreeMRUList (HANDLE hMRUList) /************************************************************************** * FindMRUData [COMCTL32.169] - * + * * Searches binary list for item that matches lpData of length cbData. * Returns position in list order 0 -> MRU and if lpRegNum != NULL then value * corresponding to item's reg. name will be stored in it ('a' -> 0). @@ -636,7 +636,7 @@ FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum) for(i=0; icursize; i++) { if (mp->extview.dwFlags & MRUF_BINARY_LIST) { - if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart, + if (!mp->extview.lpfnCompare(lpData, &mp->array[i]->datastart, cbData)) break; } @@ -678,7 +678,7 @@ FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum) /************************************************************************** * AddMRUData [COMCTL32.167] - * + * * Add item to MRU binary list. If item already exists in list then it is * simply moved up to the top of the list and not added again. If list is * full then the least recently used item is removed to make room. @@ -718,7 +718,7 @@ AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData) } /* Allocate space for new item and move in the data */ - mp->array[replace] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(cbData + + mp->array[replace] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(cbData + sizeof(WINEMRUITEM)); witem->itemFlag |= WMRUIF_CHANGED; witem->size = cbData; @@ -730,7 +730,7 @@ AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData) mp->realMRU[i] = mp->realMRU[i-1]; } mp->realMRU[0] = replace + 'a'; - TRACE("(%08x, %p, %ld) adding data, /%c/ now most current\n", + TRACE("(%08x, %p, %ld) adding data, /%c/ now most current\n", hList, lpData, cbData, replace+'a'); ret = replace; @@ -744,7 +744,7 @@ AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData) /************************************************************************** * AddMRUStringW [COMCTL32.401] - * + * * Add item to MRU string list. If item already exists in list them it is * simply moved up to the top of the list and not added again. If list is * full then the least recently used item is removed to make room. @@ -807,7 +807,7 @@ FindMRUStringW (HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum) /************************************************************************** * FindMRUStringA [COMCTL32.155] - * + * * Searches string list for item that matches lpszString. * Returns position in list order 0 -> MRU and if lpRegNum != NULL then value * corresponding to item's reg. name will be stored in it ('a' -> 0). @@ -858,10 +858,10 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp) sizeof(LPVOID)); /* open the sub key */ - if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, + if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey, 0, emptyW, - REG_OPTION_NON_VOLATILE, + REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, 0, &newkey, @@ -877,7 +877,7 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp) /* get values from key 'MRUList' */ if (newkey) { datasize = mp->extview.nMaxItems + 1; - if((err=RegQueryValueExA( newkey, "MRUList", 0, &type, mp->realMRU, + if((err=RegQueryValueExA( newkey, "MRUList", 0, &type, mp->realMRU, &datasize))) { /* not present - set size to 1 (will become 0 later) */ datasize = 1; @@ -897,10 +897,10 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp) /* not present - what to do ??? */ ERR("Key %s not found 1\n", debugstr_w(realname)); } - mp->array[i] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(datasize + + mp->array[i] = witem = (LPWINEMRUITEM)COMCTL32_Alloc(datasize + sizeof(WINEMRUITEM)); witem->size = datasize; - if(RegQueryValueExW( newkey, realname, 0, &type, + if(RegQueryValueExW( newkey, realname, 0, &type, &witem->datastart, &datasize)) { /* not present - what to do ??? */ ERR("Key %s not found 2\n", debugstr_w(realname)); @@ -939,7 +939,7 @@ CreateMRUListLazyW (LPCREATEMRULISTW lpcml, DWORD dwParam2, DWORD dwParam3, DWOR strcpyW((LPWSTR)mp->extview.lpszSubKey, lpcml->lpszSubKey); mp->isUnicode = TRUE; - return CreateMRUListLazy_common(mp); + return CreateMRUListLazy_common(mp); } /************************************************************************** @@ -1008,7 +1008,7 @@ CreateMRUListA (LPCREATEMRULISTA lpcml) * string lists specifies full length of string. Enumerating past the end * of list returns -1. * If lpBuffer == NULL or nItemPos is -ve return value is no. of items in - * the list. + * the list. */ INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize) @@ -1023,16 +1023,16 @@ DWORD nBufferSize) desired -= 'a'; TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired); witem = mp->array[desired]; - datasize = min( witem->size, nBufferSize ); + datasize = min( witem->size, nBufferSize ); memcpy( lpBuffer, &witem->datastart, datasize); - TRACE("(%08x, %d, %p, %ld): returning len=%d\n", + TRACE("(%08x, %d, %p, %ld): returning len=%d\n", hList, nItemPos, lpBuffer, nBufferSize, datasize); return datasize; } /************************************************************************** * EnumMRUListA [COMCTL32.154] - * + * */ INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize) @@ -1049,7 +1049,7 @@ DWORD nBufferSize) TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired); witem = mp->array[desired]; if(mp->extview.dwFlags & MRUF_BINARY_LIST) { - datasize = min( witem->size, nBufferSize ); + datasize = min( witem->size, nBufferSize ); memcpy( lpBuffer, &witem->datastart, datasize); } else { lenA = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1, @@ -1058,11 +1058,11 @@ DWORD nBufferSize) WideCharToMultiByte(CP_ACP, 0, (LPWSTR)&witem->datastart, -1, lpBuffer, datasize, NULL, NULL); } - TRACE("(%08x, %d, %p, %ld): returning len=%d\n", + TRACE("(%08x, %d, %p, %ld): returning len=%d\n", hList, nItemPos, lpBuffer, nBufferSize, datasize); return datasize; } - + /************************************************************************** * Str_GetPtrA [COMCTL32.233] @@ -1118,7 +1118,7 @@ BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc) { TRACE("(%p %p)\n", lppDest, lpSrc); - + if (lpSrc) { LPSTR ptr = COMCTL32_ReAlloc (*lppDest, strlen (lpSrc) + 1); if (!ptr) @@ -1191,7 +1191,7 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc) { TRACE("(%p %p)\n", lppDest, lpSrc); - + if (lpSrc) { INT len = strlenW (lpSrc) + 1; LPWSTR ptr = COMCTL32_ReAlloc (*lppDest, len * sizeof(WCHAR)); @@ -1363,7 +1363,7 @@ DSA_Destroy (const HDSA hdsa) /************************************************************************** - * DSA_GetItem [COMCTL32.322] + * DSA_GetItem [COMCTL32.322] * * PARAMS * hdsa [I] pointer to the array control structure @@ -1381,7 +1381,7 @@ DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest) LPVOID pSrc; TRACE("(%p %d %p)\n", hdsa, nIndex, pDest); - + if (!hdsa) return FALSE; if ((nIndex < 0) || (nIndex >= hdsa->nItemCount)) @@ -1395,7 +1395,7 @@ DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest) /************************************************************************** - * DSA_GetItemPtr [COMCTL32.323] + * DSA_GetItemPtr [COMCTL32.323] * * Retrieves a pointer to the specified item. * @@ -1421,7 +1421,7 @@ DSA_GetItemPtr (const HDSA hdsa, INT nIndex) return NULL; pSrc = (char *) hdsa->pData + (hdsa->nItemSize * nIndex); - + TRACE("-- ret=%p\n", pSrc); return pSrc; @@ -1429,7 +1429,7 @@ DSA_GetItemPtr (const HDSA hdsa, INT nIndex) /************************************************************************** - * DSA_SetItem [COMCTL32.325] + * DSA_SetItem [COMCTL32.325] * * Sets the contents of an item in the array. * @@ -1448,12 +1448,12 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) { INT nSize, nNewItems; LPVOID pDest, lpTemp; - + TRACE("(%p %d %p)\n", hdsa, nIndex, pSrc); if ((!hdsa) || nIndex < 0) return FALSE; - + if (hdsa->nItemCount <= nIndex) { /* within the old array */ if (hdsa->nMaxCount > nIndex) { @@ -1473,7 +1473,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) hdsa->nMaxCount = nNewItems; hdsa->nItemCount = nIndex + 1; hdsa->pData = lpTemp; - } + } } /* put the new entry in */ @@ -1487,7 +1487,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) /************************************************************************** - * DSA_InsertItem [COMCTL32.324] + * DSA_InsertItem [COMCTL32.324] * * PARAMS * hdsa [I] pointer to the array control structure @@ -1504,7 +1504,7 @@ DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) { INT nNewItems, nSize; LPVOID lpTemp, lpDest; - + TRACE("(%p %d %p)\n", hdsa, nIndex, pSrc); if ((!hdsa) || nIndex < 0) @@ -1524,7 +1524,7 @@ DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) return -1; hdsa->nMaxCount = nNewItems; - hdsa->pData = lpTemp; + hdsa->pData = lpTemp; } /* do we need to move elements ? */ @@ -1549,7 +1549,7 @@ DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) /************************************************************************** - * DSA_DeleteItem [COMCTL32.326] + * DSA_DeleteItem [COMCTL32.326] * * PARAMS * hdsa [I] pointer to the array control structure @@ -1565,7 +1565,7 @@ DSA_DeleteItem (const HDSA hdsa, INT nIndex) { LPVOID lpDest,lpSrc; INT nSize; - + TRACE("(%p %d)\n", hdsa, nIndex); if (!hdsa) @@ -1582,9 +1582,9 @@ DSA_DeleteItem (const HDSA hdsa, INT nIndex) lpDest, lpSrc, nSize); memmove (lpDest, lpSrc, nSize); } - + hdsa->nItemCount--; - + /* free memory ? */ if ((hdsa->nMaxCount - hdsa->nItemCount) >= hdsa->nGrow) { nSize = hdsa->nItemSize * hdsa->nItemCount; @@ -1619,7 +1619,7 @@ DSA_DeleteAllItems (const HDSA hdsa) { TRACE("(%p)\n", hdsa); - if (!hdsa) + if (!hdsa) return FALSE; if (hdsa->pData && (!COMCTL32_Free (hdsa->pData))) return FALSE; @@ -1949,12 +1949,12 @@ BOOL WINAPI DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p) { LPVOID *lpTemp; - + TRACE("(%p %d %p)\n", hdpa, i, p); if ((!hdpa) || i < 0) return FALSE; - + if (hdpa->nItemCount <= i) { /* within the old array */ if (hdpa->nMaxCount > i) { @@ -1973,8 +1973,8 @@ DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p) return FALSE; hdpa->nItemCount = nNewItems; - hdpa->ptrs = lpTemp; - } + hdpa->ptrs = lpTemp; + } } /* put the new entry in */ @@ -2003,7 +2003,7 @@ DPA_DeletePtr (const HDPA hdpa, INT i) { LPVOID *lpDest, *lpSrc, lpTemp = NULL; INT nSize; - + TRACE("(%p %d)\n", hdpa, i); if ((!hdpa) || i < 0 || i >= hdpa->nItemCount) @@ -2020,9 +2020,9 @@ DPA_DeletePtr (const HDPA hdpa, INT i) lpDest, lpSrc, nSize); memmove (lpDest, lpSrc, nSize); } - + hdpa->nItemCount --; - + /* free memory ?*/ if ((hdpa->nMaxCount - hdpa->nItemCount) >= hdpa->nGrow) { INT nNewItems = max(hdpa->nGrow * 2, hdpa->nItemCount); @@ -2033,7 +2033,7 @@ DPA_DeletePtr (const HDPA hdpa, INT i) return NULL; hdpa->nMaxCount = nNewItems; - hdpa->ptrs = (LPVOID*)lpDest; + hdpa->ptrs = (LPVOID*)lpDest; } return lpTemp; @@ -2058,7 +2058,7 @@ DPA_DeleteAllPtrs (const HDPA hdpa) { TRACE("(%p)\n", hdpa); - if (!hdpa) + if (!hdpa) return FALSE; if (hdpa->ptrs && (!HeapFree (hdpa->hHeap, 0, hdpa->ptrs))) @@ -2097,7 +2097,7 @@ DPA_QuickSort (LPVOID *lpPtrs, INT l, INT r, LPVOID t; TRACE("l=%i r=%i\n", l, r); - + if (l==r) /* one element is always sorted */ return; if (r0) { @@ -2228,7 +2228,7 @@ DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart, INT nIndex; TRACE("linear search\n"); - + nIndex = (nStart == -1)? 0 : nStart; lpPtr = hdpa->ptrs; for (; nIndex < hdpa->nItemCount; nIndex++) { @@ -2493,7 +2493,7 @@ COMCTL32_StrToIntW (LPWSTR lpString) * PARAMS * hdpa [I] handle to the dynamic pointer array * enumProc [I] - * lParam [I] + * lParam [I] * * RETURNS * none @@ -2674,7 +2674,7 @@ LPSTR WINAPI COMCTL32_StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch ) if (*lpStart != LOBYTE(wMatch)) continue; if (dbcs && lpStart[1] != HIBYTE(wMatch)) continue; lpGotIt = lpStart; - } + } return (LPSTR)lpGotIt; } @@ -2728,7 +2728,7 @@ INT WINAPI COMCTL32_StrSpnW( LPWSTR lpStr, LPWSTR lpSet) { for(; (*lpLoop != 0); lpLoop++) if( strchrW(lpSet, *(WORD*)lpLoop)) return (INT)(lpLoop-lpStr); - + return (INT)(lpLoop-lpStr); } diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 286fa6961d6..7b36120a36e 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -1,4 +1,4 @@ -/* +/* * Common controls functions * * Copyright 1997 Dimitrie O. Paun @@ -274,7 +274,7 @@ MenuHelp (UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, /*********************************************************************** - * ShowHideMenuCtl [COMCTL32.3] + * ShowHideMenuCtl [COMCTL32.3] * * Shows or hides controls and updates the corresponding menu item. * @@ -497,9 +497,9 @@ void WINAPI DrawStatusTextA (HDC hdc, LPRECT lprc, LPCSTR text, UINT style) HWND WINAPI CreateStatusWindowA (INT style, LPCSTR text, HWND parent, UINT wid) { - return CreateWindowA(STATUSCLASSNAMEA, text, style, + return CreateWindowA(STATUSCLASSNAMEA, text, style, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, parent, wid, 0, 0); } @@ -561,7 +561,7 @@ CreateUpDownControl (DWORD style, INT x, INT y, INT cx, INT cy, if (hUD) { SendMessageA (hUD, UDM_SETBUDDY, buddy, 0); SendMessageA (hUD, UDM_SETRANGE, 0, MAKELONG(maxVal, minVal)); - SendMessageA (hUD, UDM_SETPOS, 0, MAKELONG(curVal, 0)); + SendMessageA (hUD, UDM_SETPOS, 0, MAKELONG(curVal, 0)); } return hUD; @@ -936,7 +936,7 @@ COMCTL32_DllGetVersion (DLLVERSIONINFO *pdvi) */ HRESULT WINAPI COMCTL32_DllInstall(BOOL bInstall, LPCWSTR cmdline) { - FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE", + FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE", debugstr_w(cmdline)); return S_OK; diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index e620dea5692..7d08b2d53f2 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -55,7 +55,7 @@ typedef struct int haveFocus; int *fieldspec; RECT *fieldRect; - int *buflen; + int *buflen; char textbuf[256]; POINT monthcal_pos; } DATETIME_INFO, *LPDATETIME_INFO; @@ -65,12 +65,12 @@ extern int MONTHCAL_MonthLength(int month, int year); /* this list of defines is closely related to `allowedformatchars' defined * in datetime.c; the high nibble indicates the `base type' of the format - * specifier. + * specifier. * Do not change without first reading DATETIME_UseFormat. - * + * */ -#define DT_END_FORMAT 0 +#define DT_END_FORMAT 0 #define ONEDIGITDAY 0x01 #define TWODIGITDAY 0x02 #define THREECHARDAY 0x03 @@ -122,7 +122,7 @@ DATETIME_GetSystemTime (HWND hwnd, WPARAM wParam, LPARAM lParam ) TRACE("%04x %08lx\n",wParam,lParam); if (!lParam) return GDT_NONE; - if ((dwStyle & DTS_SHOWNONE) && + if ((dwStyle & DTS_SHOWNONE) && (SendMessageA (infoPtr->hwndCheckbut, BM_GETCHECK, 0, 0))) return GDT_NONE; @@ -141,7 +141,7 @@ DATETIME_SetSystemTime (HWND hwnd, WPARAM wParam, LPARAM lParam ) TRACE("%04x %08lx\n",wParam,lParam); if (!lParam) return 0; - if (lParam==GDT_VALID) + if (lParam==GDT_VALID) MONTHCAL_CopyTime (lprgSysTimeArray, &infoPtr->date); if (lParam==GDT_NONE) { infoPtr->dateValid=FALSE; @@ -225,20 +225,20 @@ DATETIME_SetMonthCalFont (HWND hwnd, WPARAM wParam, LPARAM lParam) } -/* - Split up a formattxt in actions. +/* + Split up a formattxt in actions. See ms documentation for the meaning of the letter codes/'specifiers'. - Notes: + Notes: *'dddddd' is handled as 'dddd' plus 'dd'. - *unrecognized formats are strings (here given the type DT_STRING; + *unrecognized formats are strings (here given the type DT_STRING; start of the string is encoded in lower bits of DT_STRING. Therefore, 'string' ends finally up as 'tring'. */ -static void +static void DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt) { int i,j,k,len; @@ -255,20 +255,20 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt) for (i=0; ifieldspec[*nrFields]); if ((*nrFields==0) && (infoPtr->fieldspec[*nrFields]==0)) { infoPtr->fieldspec[*nrFields]=(j<<4) +1; break; } - if (infoPtr->fieldspec[*nrFields]>>4!=j) { - (*nrFields)++; + if (infoPtr->fieldspec[*nrFields]>>4!=j) { + (*nrFields)++; infoPtr->fieldspec[*nrFields]=(j<<4) +1; break; } if ((infoPtr->fieldspec[*nrFields] & 0x0f)==maxrepetition[j]) { - (*nrFields)++; + (*nrFields)++; infoPtr->fieldspec[*nrFields]=(j<<4) +1; break; } @@ -283,12 +283,12 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt) if ((*nrFields==0) && (infoPtr->fieldspec[*nrFields]==0)) { infoPtr->fieldspec[*nrFields]=DT_STRING+k; infoPtr->buflen[*nrFields]=0; - } else + } else if ((infoPtr->fieldspec[*nrFields] & DT_STRING)!=DT_STRING) { (*nrFields)++; infoPtr->fieldspec[*nrFields]=DT_STRING+k; infoPtr->buflen[*nrFields]=0; - } + } infoPtr->textbuf[k]=formattxt[i]; k++; infoPtr->buflen[*nrFields]++; @@ -306,7 +306,7 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, const char *formattxt) } -static LRESULT +static LRESULT DATETIME_SetFormat (HWND hwnd, WPARAM wParam, LPARAM lParam) { DATETIME_INFO *infoPtr= DATETIME_GetInfoPtr (hwnd); @@ -317,15 +317,15 @@ DATETIME_SetFormat (HWND hwnd, WPARAM wParam, LPARAM lParam) if (!lParam) { DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); - if (dwStyle & DTS_LONGDATEFORMAT) + if (dwStyle & DTS_LONGDATEFORMAT) format_item=LOCALE_SLONGDATE; - else if (dwStyle & DTS_TIMEFORMAT) + else if (dwStyle & DTS_TIMEFORMAT) format_item=LOCALE_STIMEFORMAT; else /* DTS_SHORTDATEFORMAT */ format_item=LOCALE_SSHORTDATE; GetLocaleInfoA( GetSystemDefaultLCID(), format_item,format_buf,sizeof(format_buf)); DATETIME_UseFormat (infoPtr, format_buf); - } + } else DATETIME_UseFormat (infoPtr, (char *) lParam); @@ -333,7 +333,7 @@ DATETIME_SetFormat (HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT DATETIME_SetFormatW (HWND hwnd, WPARAM wParam, LPARAM lParam) { @@ -348,14 +348,14 @@ DATETIME_SetFormatW (HWND hwnd, WPARAM wParam, LPARAM lParam) retval=DATETIME_SetFormat (hwnd, 0, (LPARAM) buf); COMCTL32_Free (buf); return retval; - } + } else return DATETIME_SetFormat (hwnd, 0, 0); } -static void +static void DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result) { SYSTEMTIME date = infoPtr->date; @@ -370,7 +370,7 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result) } if (!infoPtr->fieldspec) return; - + spec=infoPtr->fieldspec[count]; if (spec & DT_STRING) { int txtlen=infoPtr->buflen[count]; @@ -381,18 +381,18 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result) return; } - + switch (spec) { - case DT_END_FORMAT: + case DT_END_FORMAT: *result=0; break; - case ONEDIGITDAY: + case ONEDIGITDAY: sprintf (result,"%d",date.wDay); break; - case TWODIGITDAY: + case TWODIGITDAY: sprintf (result,"%.2d",date.wDay); break; - case THREECHARDAY: + case THREECHARDAY: GetLocaleInfoA( LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME1+(date.wDayOfWeek+6)%7, result,4); /*sprintf (result,"%.3s",days[date.wDayOfWeek]);*/ @@ -402,83 +402,83 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoPtr, int count, char *result) buffer,sizeof(buffer)); strcpy (result,buffer); break; - case ONEDIGIT12HOUR: - if (date.wHour>12) + case ONEDIGIT12HOUR: + if (date.wHour>12) sprintf (result,"%d",date.wHour-12); - else + else sprintf (result,"%d",date.wHour); break; - case TWODIGIT12HOUR: - if (date.wHour>12) + case TWODIGIT12HOUR: + if (date.wHour>12) sprintf (result,"%.2d",date.wHour-12); - else + else sprintf (result,"%.2d",date.wHour); break; - case ONEDIGIT24HOUR: + case ONEDIGIT24HOUR: sprintf (result,"%d",date.wHour); break; - case TWODIGIT24HOUR: + case TWODIGIT24HOUR: sprintf (result,"%.2d",date.wHour); break; - case ONEDIGITSECOND: + case ONEDIGITSECOND: sprintf (result,"%d",date.wSecond); break; - case TWODIGITSECOND: + case TWODIGITSECOND: sprintf (result,"%.2d",date.wSecond); break; - case ONEDIGITMINUTE: + case ONEDIGITMINUTE: sprintf (result,"%d",date.wMinute); break; - case TWODIGITMINUTE: + case TWODIGITMINUTE: sprintf (result,"%.2d",date.wMinute); break; - case ONEDIGITMONTH: + case ONEDIGITMONTH: sprintf (result,"%d",date.wMonth); break; - case TWODIGITMONTH: + case TWODIGITMONTH: sprintf (result,"%.2d",date.wMonth); break; - case THREECHARMONTH: + case THREECHARMONTH: GetLocaleInfoA( GetSystemDefaultLCID(),LOCALE_SMONTHNAME1+date.wMonth -1, buffer,sizeof(buffer)); sprintf (result,"%.3s",buffer); break; - case FULLMONTH: + case FULLMONTH: GetLocaleInfoA( GetSystemDefaultLCID(),LOCALE_SMONTHNAME1+date.wMonth -1, result,sizeof(result)); break; - case ONELETTERAMPM: - if (date.wHour<12) + case ONELETTERAMPM: + if (date.wHour<12) strcpy (result,"A"); - else + else strcpy (result,"P"); break; - case TWOLETTERAMPM: - if (date.wHour<12) + case TWOLETTERAMPM: + if (date.wHour<12) strcpy (result,"AM"); - else + else strcpy (result,"PM"); break; - case FORMATCALLBACK: + case FORMATCALLBACK: FIXME ("Not implemented\n"); strcpy (result,"xxx"); break; - case ONEDIGITYEAR: + case ONEDIGITYEAR: sprintf (result,"%d",date.wYear-10* (int) floor(date.wYear/10)); break; - case TWODIGITYEAR: + case TWODIGITYEAR: sprintf (result,"%.2d",date.wYear-100* (int) floor(date.wYear/100)); break; - case FULLYEAR: + case FULLYEAR: sprintf (result,"%d",date.wYear); break; } - + TRACE ("arg%d=%x->[%s]\n",count,infoPtr->fieldspec[count],result); } -static void +static void DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number) { SYSTEMTIME *date = &infoPtr->date; @@ -489,53 +489,53 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number) spec=infoPtr->fieldspec[number]; if ((spec & DTHT_DATEFIELD)==0) return; - + switch (spec) { - case ONEDIGITDAY: - case TWODIGITDAY: - case THREECHARDAY: + case ONEDIGITDAY: + case TWODIGITDAY: + case THREECHARDAY: case FULLDAY: date->wDay++; if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear)) - date->wDay=1; + date->wDay=1; break; - case ONEDIGIT12HOUR: - case TWODIGIT12HOUR: - case ONEDIGIT24HOUR: - case TWODIGIT24HOUR: + case ONEDIGIT12HOUR: + case TWODIGIT12HOUR: + case ONEDIGIT24HOUR: + case TWODIGIT24HOUR: date->wHour++; if (date->wHour>23) date->wHour=0; break; - case ONEDIGITSECOND: - case TWODIGITSECOND: + case ONEDIGITSECOND: + case TWODIGITSECOND: date->wSecond++; if (date->wSecond>59) date->wSecond=0; break; - case ONEDIGITMINUTE: - case TWODIGITMINUTE: + case ONEDIGITMINUTE: + case TWODIGITMINUTE: date->wMinute++; if (date->wMinute>59) date->wMinute=0; break; - case ONEDIGITMONTH: - case TWODIGITMONTH: - case THREECHARMONTH: - case FULLMONTH: + case ONEDIGITMONTH: + case TWODIGITMONTH: + case THREECHARMONTH: + case FULLMONTH: date->wMonth++; if (date->wMonth>12) date->wMonth=1; - if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear)) + if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear)) date->wDay=MONTHCAL_MonthLength(date->wMonth,date->wYear); break; - case ONELETTERAMPM: - case TWOLETTERAMPM: + case ONELETTERAMPM: + case TWOLETTERAMPM: date->wHour+=12; if (date->wHour>23) date->wHour-=24; break; - case FORMATCALLBACK: + case FORMATCALLBACK: FIXME ("Not implemented\n"); break; - case ONEDIGITYEAR: - case TWODIGITYEAR: - case FULLYEAR: + case ONEDIGITYEAR: + case TWODIGITYEAR: + case FULLYEAR: date->wYear++; break; } @@ -543,7 +543,7 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number) } -static void +static void DATETIME_DecreaseField (DATETIME_INFO *infoPtr, int number) { SYSTEMTIME *date = & infoPtr->date; @@ -554,65 +554,65 @@ DATETIME_DecreaseField (DATETIME_INFO *infoPtr, int number) spec = infoPtr->fieldspec[number]; if ((spec & DTHT_DATEFIELD)==0) return; - + TRACE ("%x\n",spec); switch (spec) { - case ONEDIGITDAY: - case TWODIGITDAY: - case THREECHARDAY: + case ONEDIGITDAY: + case TWODIGITDAY: + case THREECHARDAY: case FULLDAY: date->wDay--; - if (date->wDay<1) + if (date->wDay<1) date->wDay=MONTHCAL_MonthLength(date->wMonth,date->wYear); break; - case ONEDIGIT12HOUR: - case TWODIGIT12HOUR: - case ONEDIGIT24HOUR: - case TWODIGIT24HOUR: - if (date->wHour) + case ONEDIGIT12HOUR: + case TWODIGIT12HOUR: + case ONEDIGIT24HOUR: + case TWODIGIT24HOUR: + if (date->wHour) date->wHour--; else date->wHour=23; break; - case ONEDIGITSECOND: - case TWODIGITSECOND: - if (date->wHour) + case ONEDIGITSECOND: + case TWODIGITSECOND: + if (date->wHour) date->wSecond--; else date->wHour=59; break; - case ONEDIGITMINUTE: - case TWODIGITMINUTE: - if (date->wMinute) + case ONEDIGITMINUTE: + case TWODIGITMINUTE: + if (date->wMinute) date->wMinute--; else date->wMinute=59; break; - case ONEDIGITMONTH: - case TWODIGITMONTH: - case THREECHARMONTH: - case FULLMONTH: - if (date->wMonth>1) + case ONEDIGITMONTH: + case TWODIGITMONTH: + case THREECHARMONTH: + case FULLMONTH: + if (date->wMonth>1) date->wMonth--; else date->wMonth=12; - if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear)) + if (date->wDay>MONTHCAL_MonthLength(date->wMonth,date->wYear)) date->wDay=MONTHCAL_MonthLength(date->wMonth,date->wYear); break; - case ONELETTERAMPM: - case TWOLETTERAMPM: - if (date->wHour<12) + case ONELETTERAMPM: + case TWOLETTERAMPM: + if (date->wHour<12) date->wHour+=12; else date->wHour-=12; break; - case FORMATCALLBACK: + case FORMATCALLBACK: FIXME ("Not implemented\n"); break; - case ONEDIGITYEAR: - case TWODIGITYEAR: - case FULLYEAR: + case ONEDIGITYEAR: + case TWODIGITYEAR: + case FULLYEAR: date->wYear--; break; } @@ -620,7 +620,7 @@ DATETIME_DecreaseField (DATETIME_INFO *infoPtr, int number) } -static void +static void DATETIME_ResetFieldDown (DATETIME_INFO *infoPtr, int number) { SYSTEMTIME *date = &infoPtr->date; @@ -631,47 +631,47 @@ DATETIME_ResetFieldDown (DATETIME_INFO *infoPtr, int number) spec = infoPtr->fieldspec[number]; if ((spec & DTHT_DATEFIELD)==0) return; - + switch (spec) { - case ONEDIGITDAY: - case TWODIGITDAY: - case THREECHARDAY: + case ONEDIGITDAY: + case TWODIGITDAY: + case THREECHARDAY: case FULLDAY: date->wDay = 1; break; - case ONEDIGIT12HOUR: - case TWODIGIT12HOUR: - case ONEDIGIT24HOUR: - case TWODIGIT24HOUR: - case ONELETTERAMPM: - case TWOLETTERAMPM: + case ONEDIGIT12HOUR: + case TWODIGIT12HOUR: + case ONEDIGIT24HOUR: + case TWODIGIT24HOUR: + case ONELETTERAMPM: + case TWOLETTERAMPM: date->wHour = 0; break; - case ONEDIGITSECOND: - case TWODIGITSECOND: + case ONEDIGITSECOND: + case TWODIGITSECOND: date->wSecond = 0; break; - case ONEDIGITMINUTE: - case TWODIGITMINUTE: + case ONEDIGITMINUTE: + case TWODIGITMINUTE: date->wMinute = 0; break; - case ONEDIGITMONTH: - case TWODIGITMONTH: - case THREECHARMONTH: - case FULLMONTH: + case ONEDIGITMONTH: + case TWODIGITMONTH: + case THREECHARMONTH: + case FULLMONTH: date->wMonth = 1; - case FORMATCALLBACK: + case FORMATCALLBACK: FIXME ("Not implemented\n"); break; - case ONEDIGITYEAR: - case TWODIGITYEAR: - /* FYI: On 1752/9/14 the calendar changed and England and the - * American colonies changed to the Gregorian calendar. This change - * involved having September 14th follow September 2nd. So no date + case ONEDIGITYEAR: + case TWODIGITYEAR: + /* FYI: On 1752/9/14 the calendar changed and England and the + * American colonies changed to the Gregorian calendar. This change + * involved having September 14th follow September 2nd. So no date * algorithm works before that date. */ - case FULLYEAR: + case FULLYEAR: date->wSecond = 0; date->wMinute = 0; date->wHour = 0; @@ -684,7 +684,7 @@ DATETIME_ResetFieldDown (DATETIME_INFO *infoPtr, int number) } -static void +static void DATETIME_ResetFieldUp (DATETIME_INFO *infoPtr, int number) { SYSTEMTIME *date = & infoPtr->date; @@ -695,41 +695,41 @@ DATETIME_ResetFieldUp (DATETIME_INFO *infoPtr, int number) spec=infoPtr->fieldspec[number]; if ((spec & DTHT_DATEFIELD)==0) return; - + switch (spec) { - case ONEDIGITDAY: - case TWODIGITDAY: - case THREECHARDAY: + case ONEDIGITDAY: + case TWODIGITDAY: + case THREECHARDAY: case FULLDAY: date->wDay=MONTHCAL_MonthLength(date->wMonth,date->wYear); break; - case ONEDIGIT12HOUR: - case TWODIGIT12HOUR: - case ONEDIGIT24HOUR: - case TWODIGIT24HOUR: - case ONELETTERAMPM: - case TWOLETTERAMPM: + case ONEDIGIT12HOUR: + case TWODIGIT12HOUR: + case ONEDIGIT24HOUR: + case TWODIGIT24HOUR: + case ONELETTERAMPM: + case TWOLETTERAMPM: date->wHour=23; break; - case ONEDIGITSECOND: - case TWODIGITSECOND: + case ONEDIGITSECOND: + case TWODIGITSECOND: date->wSecond=59; break; - case ONEDIGITMINUTE: - case TWODIGITMINUTE: + case ONEDIGITMINUTE: + case TWODIGITMINUTE: date->wMinute=59; break; - case ONEDIGITMONTH: - case TWODIGITMONTH: - case THREECHARMONTH: - case FULLMONTH: + case ONEDIGITMONTH: + case TWODIGITMONTH: + case THREECHARMONTH: + case FULLMONTH: date->wMonth=12; - case FORMATCALLBACK: + case FORMATCALLBACK: FIXME ("Not implemented\n"); break; - case ONEDIGITYEAR: - case TWODIGITYEAR: - case FULLYEAR: + case ONEDIGITYEAR: + case TWODIGITYEAR: + case FULLYEAR: date->wYear=9999; /* Y10K problem? naaah. */ break; } @@ -751,14 +751,14 @@ static void DATETIME_Refresh (HWND hwnd, HDC hdc) HBRUSH hbr; SIZE size; COLORREF oldBk, oldTextColor; - + /* draw control edge */ TRACE("\n"); hbr = CreateSolidBrush(RGB(255, 255, 255)); FillRect(hdc, rcClient, hbr); DrawEdge(hdc, rcClient, EDGE_SUNKEN, BF_RECT); - DeleteObject(hbr); - + DeleteObject(hbr); + if (infoPtr->dateValid) { char txt[80]; HFONT oldFont; @@ -825,7 +825,7 @@ DATETIME_HitTest (HWND hwnd, DATETIME_INFO *infoPtr, POINT pt) for (i=0; inrFields; i++) { if (PtInRect (&infoPtr->fieldRect[i], pt)) { retval = i; - TRACE("Hit in date text in field %d\n", i); + TRACE("Hit in date text in field %d\n", i); break; } } @@ -838,7 +838,7 @@ done: static LRESULT DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) { - DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); + DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); int old, new; POINT pt; @@ -867,7 +867,7 @@ DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) if(dwStyle & DTS_RIGHTALIGN) infoPtr->monthcal_pos.x = infoPtr->rcClient.right - ((infoPtr->calbutton.right - infoPtr->calbutton.left) + 145); - else + else infoPtr->monthcal_pos.x = 8; infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom; @@ -881,7 +881,7 @@ DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) ShowWindow(infoPtr->hMonthCal, SW_SHOW); TRACE ("dt:%x mc:%x mc parent:%x, desktop:%x, mcpp:%x\n", - hwnd,infoPtr->hMonthCal, + hwnd,infoPtr->hMonthCal, GetParent (infoPtr->hMonthCal), GetDesktopWindow (), GetParent (GetParent (infoPtr->hMonthCal))); @@ -897,10 +897,10 @@ DATETIME_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) static LRESULT DATETIME_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) { - DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); + DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); TRACE("\n"); - + if(infoPtr->bCalDepressed == TRUE) { infoPtr->bCalDepressed = FALSE; InvalidateRect(hwnd, &(infoPtr->calbutton), TRUE); @@ -927,7 +927,7 @@ DATETIME_Paint (HWND hwnd, WPARAM wParam) static LRESULT DATETIME_ParentNotify (HWND hwnd, WPARAM wParam, LPARAM lParam) { - DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); + DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); LPNMHDR lpnmh = (LPNMHDR) lParam; TRACE ("%x,%lx\n",wParam, lParam); @@ -941,7 +941,7 @@ static LRESULT DATETIME_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam) { - DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); + DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); LPNMHDR lpnmh = (LPNMHDR) lParam; TRACE ("%x,%lx\n",wParam, lParam); @@ -951,7 +951,7 @@ DATETIME_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT DATETIME_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam) { DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); @@ -970,7 +970,7 @@ DATETIME_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam) switch (wParam) { case VK_ADD: - case VK_UP: + case VK_UP: DATETIME_IncreaseField (infoPtr,FieldNum); DATETIME_SendDateTimeChangeNotify (hwnd); break; @@ -987,17 +987,17 @@ DATETIME_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam) DATETIME_ResetFieldUp(infoPtr,FieldNum); DATETIME_SendDateTimeChangeNotify (hwnd); break; - case VK_LEFT: + case VK_LEFT: do { if (infoPtr->select==0) { infoPtr->select = infoPtr->nrFields - 1; wrap++; - } else + } else infoPtr->select--; } while ((infoPtr->fieldspec[infoPtr->select] & DT_STRING) && (wrap<2)); break; - case VK_RIGHT: + case VK_RIGHT: do { infoPtr->select++; if (infoPtr->select==infoPtr->nrFields) { @@ -1018,7 +1018,7 @@ DATETIME_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam) static LRESULT DATETIME_KillFocus (HWND hwnd, WPARAM wParam, LPARAM lParam) { - DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); + DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); TRACE ("\n"); @@ -1036,12 +1036,12 @@ DATETIME_KillFocus (HWND hwnd, WPARAM wParam, LPARAM lParam) static LRESULT DATETIME_SetFocus (HWND hwnd, WPARAM wParam, LPARAM lParam) { - DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); + DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); TRACE ("\n"); if (infoPtr->haveFocus==0) { - DATETIME_SendSimpleNotify (hwnd, NM_SETFOCUS); + DATETIME_SendSimpleNotify (hwnd, NM_SETFOCUS); infoPtr->haveFocus = DTHT_GOTFOCUS; } @@ -1055,7 +1055,7 @@ static BOOL DATETIME_SendDateTimeChangeNotify (HWND hwnd) { - DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); + DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); NMDATETIMECHANGE dtdtc; TRACE ("\n"); @@ -1123,7 +1123,7 @@ DATETIME_Size (HWND hwnd, WPARAM wParam, LPARAM lParam) if(dwStyle & DTS_RIGHTALIGN) infoPtr->monthcal_pos.x = infoPtr->rcClient.right - ((infoPtr->calbutton.right - infoPtr->calbutton.left) + 145); - else + else infoPtr->monthcal_pos.x = 8; infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom; @@ -1155,10 +1155,10 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) SetWindowLongA (hwnd, 0, (DWORD)infoPtr); if (dwStyle & DTS_SHOWNONE) { - infoPtr->hwndCheckbut=CreateWindowExA (0,"button", 0, - WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, + infoPtr->hwndCheckbut=CreateWindowExA (0,"button", 0, + WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 2,2,13,13, - hwnd, + hwnd, 0, GetWindowLongA (hwnd, GWL_HINSTANCE), 0); SendMessageA (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0); } @@ -1179,10 +1179,10 @@ DATETIME_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) DATETIME_SetFormat (hwnd, 0, 0); /* create the monthcal control */ - infoPtr->hMonthCal = CreateWindowExA (0,"SysMonthCal32", 0, + infoPtr->hMonthCal = CreateWindowExA (0,"SysMonthCal32", 0, WS_BORDER | WS_POPUP | WS_CLIPSIBLINGS, 0, 0, 0, 0, - GetParent(hwnd), + GetParent(hwnd), 0, 0, 0); /* initialize info structure */ @@ -1197,7 +1197,7 @@ static LRESULT DATETIME_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) { DATETIME_INFO *infoPtr = DATETIME_GetInfoPtr (hwnd); - + TRACE("\n"); COMCTL32_Free (infoPtr); SetWindowLongA( hwnd, 0, 0 ); @@ -1210,7 +1210,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (!DATETIME_GetInfoPtr(hwnd) && (uMsg != WM_CREATE)) return DefWindowProcA( hwnd, uMsg, wParam, lParam ); - + switch (uMsg) { @@ -1307,7 +1307,7 @@ DATETIME_Register (void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wndClass.lpszClassName = DATETIMEPICK_CLASSA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/flatsb.c b/dlls/comctl32/flatsb.c index a4bdb3fd925..12bfb01422e 100644 --- a/dlls/comctl32/flatsb.c +++ b/dlls/comctl32/flatsb.c @@ -79,10 +79,10 @@ HRESULT WINAPI UninitializeFlatSB(HWND hwnd) * * Returns nonzero if successful, or zero otherwise. If index is WSB_PROP_HSTYLE, * the return is nonzero if InitializeFlatSB has been called for this window, or - * zero otherwise. + * zero otherwise. * */ -BOOL WINAPI +BOOL WINAPI FlatSB_GetScrollProp(HWND hwnd, INT propIndex, LPINT prop) { TRACE("[%04x] propIndex=%d\n", hwnd, propIndex); @@ -93,7 +93,7 @@ FlatSB_GetScrollProp(HWND hwnd, INT propIndex, LPINT prop) /*********************************************************************** * FlatSB_SetScrollProp (COMCTL32.36) */ -BOOL WINAPI +BOOL WINAPI FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag) { TRACE("[%04x] index=%u newValue=%d flag=%d\n", hwnd, index, newValue, flag); @@ -109,7 +109,7 @@ FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag) * bars on and off without having to write conditional code." * * So, if we just call the standard functions until we implement - * the flat scroll bar functions, flat scroll bars will show up and + * the flat scroll bar functions, flat scroll bars will show up and * behave properly, as though they had simply not been setup to * have flat properties. * @@ -120,7 +120,7 @@ FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag) /*********************************************************************** * FlatSB_EnableScrollBar (COMCTL32.29) */ -BOOL WINAPI +BOOL WINAPI FlatSB_EnableScrollBar(HWND hwnd, int nBar, UINT flags) { return EnableScrollBar(hwnd, nBar, flags); @@ -129,7 +129,7 @@ FlatSB_EnableScrollBar(HWND hwnd, int nBar, UINT flags) /*********************************************************************** * FlatSB_ShowScrollBar (COMCTL32.38) */ -BOOL WINAPI +BOOL WINAPI FlatSB_ShowScrollBar(HWND hwnd, int nBar, BOOL fShow) { return ShowScrollBar(hwnd, nBar, fShow); @@ -138,7 +138,7 @@ FlatSB_ShowScrollBar(HWND hwnd, int nBar, BOOL fShow) /*********************************************************************** * FlatSB_GetScrollRange (COMCTL32.33) */ -BOOL WINAPI +BOOL WINAPI FlatSB_GetScrollRange(HWND hwnd, int nBar, LPINT min, LPINT max) { return GetScrollRange(hwnd, nBar, min, max); @@ -147,7 +147,7 @@ FlatSB_GetScrollRange(HWND hwnd, int nBar, LPINT min, LPINT max) /*********************************************************************** * FlatSB_GetScrollInfo (COMCTL32.30) */ -BOOL WINAPI +BOOL WINAPI FlatSB_GetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info) { return GetScrollInfo(hwnd, nBar, info); @@ -156,7 +156,7 @@ FlatSB_GetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info) /*********************************************************************** * FlatSB_GetScrollPos (COMCTL32.31) */ -INT WINAPI +INT WINAPI FlatSB_GetScrollPos(HWND hwnd, int nBar) { return GetScrollPos(hwnd, nBar); @@ -165,7 +165,7 @@ FlatSB_GetScrollPos(HWND hwnd, int nBar) /*********************************************************************** * FlatSB_SetScrollPos (COMCTL32.35) */ -INT WINAPI +INT WINAPI FlatSB_SetScrollPos(HWND hwnd, int nBar, INT pos, BOOL bRedraw) { return SetScrollPos(hwnd, nBar, pos, bRedraw); @@ -174,7 +174,7 @@ FlatSB_SetScrollPos(HWND hwnd, int nBar, INT pos, BOOL bRedraw) /*********************************************************************** * FlatSB_SetScrollInfo (COMCTL32.34) */ -INT WINAPI +INT WINAPI FlatSB_SetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info, BOOL bRedraw) { return SetScrollInfo(hwnd, nBar, info, bRedraw); @@ -183,7 +183,7 @@ FlatSB_SetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info, BOOL bRedraw) /*********************************************************************** * FlatSB_SetScrollRange (COMCTL32.37) */ -INT WINAPI +INT WINAPI FlatSB_SetScrollRange(HWND hwnd, int nBar, INT min, INT max, BOOL bRedraw) { return SetScrollRange(hwnd, nBar, min, max, bRedraw); @@ -211,7 +211,7 @@ FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (!FlatSB_GetInfoPtr(hwnd) && (uMsg != WM_CREATE)) return DefWindowProcA( hwnd, uMsg, wParam, lParam ); - + switch (uMsg) { case WM_CREATE: @@ -243,7 +243,7 @@ FLATSB_Register (void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wndClass.lpszClassName = FLATSB_CLASSA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index f034c0676ae..228f21472e5 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -42,7 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(header); -typedef struct +typedef struct { INT cxy; HBITMAP hbm; @@ -98,13 +98,13 @@ HEADER_IndexToOrder (HWND hwnd, INT iItem) } -static INT +static INT HEADER_OrderToIndex(HWND hwnd, WPARAM wParam) { HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); INT i,iorder = (INT)wParam; - - + + if ((iorder <0) || iorder >infoPtr->uNumItem) return iorder; for (i=0; iuNumItem; i++) @@ -162,7 +162,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack) if (!infoPtr->bRectsValid) HEADER_SetItemBounds(hwnd); - + r = phdi->rect; if (r.right - r.left == 0) return phdi->rect.right; @@ -329,7 +329,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack) } -static void +static void HEADER_Refresh (HWND hwnd, HDC hdc) { HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); @@ -594,7 +594,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam) INT iItem = (INT)wParam; TRACE("[iItem=%d]\n", iItem); - + if ((iItem < 0) || (iItem >= (INT)infoPtr->uNumItem)) return FALSE; @@ -633,7 +633,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam) HEADER_SetItemBounds (hwnd); InvalidateRect(hwnd, NULL, FALSE); - + return TRUE; } @@ -685,7 +685,7 @@ HEADER_GetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) phdi->pszText, phdi->cchTextMax, NULL, NULL); else *phdi->pszText = 0; - } + } else phdi->pszText = LPSTR_TEXTCALLBACKA; } @@ -779,7 +779,7 @@ HEADER_GetItemRect (HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT HEADER_GetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam) { int i; @@ -793,7 +793,7 @@ HEADER_GetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam) return TRUE; } -static LRESULT +static LRESULT HEADER_SetOrderArray(HWND hwnd, WPARAM wParam, LPARAM lParam) { int i; @@ -877,7 +877,7 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) (infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM)); } } - + COMCTL32_Free (oldItems); } @@ -924,7 +924,7 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) } else lpItem->iOrder=nItem; - + HEADER_SetItemBounds (hwnd); @@ -976,7 +976,7 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam) (infoPtr->uNumItem - nItem - 1) * sizeof(HEADER_ITEM)); } } - + COMCTL32_Free (oldItems); } @@ -989,7 +989,7 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam) if (phdi->mask & HDI_TEXT) { WCHAR wide_null_char = 0; if (!phdi->pszText) /* null pointer check */ - phdi->pszText = &wide_null_char; + phdi->pszText = &wide_null_char; if (phdi->pszText != LPSTR_TEXTCALLBACKW) { len = strlenW (phdi->pszText); lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); @@ -1304,7 +1304,7 @@ HEADER_LButtonDblClk (HWND hwnd, WPARAM wParam, LPARAM lParam) UINT flags; INT nItem; - pt.x = (INT)LOWORD(lParam); + pt.x = (INT)LOWORD(lParam); pt.y = (INT)HIWORD(lParam); HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem); @@ -1327,13 +1327,13 @@ HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) INT nItem; HDC hdc; - pt.x = (INT)LOWORD(lParam); + pt.x = (INT)LOWORD(lParam); pt.y = (INT)HIWORD(lParam); HEADER_InternalHitTest (hwnd, &pt, &flags, &nItem); if ((dwStyle & HDS_BUTTONS) && (flags == HHT_ONHEADER)) { SetCapture (hwnd); - infoPtr->bCaptured = TRUE; + infoPtr->bCaptured = TRUE; infoPtr->bPressed = TRUE; infoPtr->iMoveItem = nItem; @@ -1345,11 +1345,11 @@ HEADER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) ReleaseDC (hwnd, hdc); TRACE("Pressed item %d!\n", nItem); - } + } else if ((flags == HHT_ONDIVIDER) || (flags == HHT_ONDIVOPEN)) { if (!(HEADER_SendHeaderNotify (hwnd, HDN_BEGINTRACKA, nItem,0))) { SetCapture (hwnd); - infoPtr->bCaptured = TRUE; + infoPtr->bCaptured = TRUE; infoPtr->bTracking = TRUE; infoPtr->iMoveItem = nItem; infoPtr->nOldWidth = infoPtr->items[nItem].cxy; @@ -1412,7 +1412,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->bRectsValid = FALSE; InvalidateRect(hwnd, NULL, FALSE); /* FIXME: Should some WM_NOTIFY be sent */ - } + } TRACE("Released item %d!\n", infoPtr->iMoveItem); infoPtr->bPressed = FALSE; @@ -1447,7 +1447,7 @@ HEADER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_SendHeaderNotify(hwnd, HDN_ITEMCHANGINGA, infoPtr->iMoveItem, HDI_WIDTH); HEADER_SetItemBounds (hwnd); InvalidateRect(hwnd, NULL, FALSE); - /* + /* * } */ } @@ -1536,7 +1536,7 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->xOldTrack = pt.x + infoPtr->xTrackOffset; if (infoPtr->xOldTrack < infoPtr->items[infoPtr->iMoveItem].rect.left) infoPtr->xOldTrack = infoPtr->items[infoPtr->iMoveItem].rect.left; - infoPtr->items[infoPtr->iMoveItem].cxy = + infoPtr->items[infoPtr->iMoveItem].cxy = infoPtr->xOldTrack - infoPtr->items[infoPtr->iMoveItem].rect.left; HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack); ReleaseDC (hwnd, hdc); @@ -1586,7 +1586,7 @@ HEADER_RButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) /* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */ SendMessageA( hwnd, WM_CONTEXTMENU, (WPARAM) hwnd, MAKELPARAM(pt.x, pt.y)); - + return bRet; } @@ -1637,7 +1637,7 @@ HEADER_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam) ReleaseDC (0, hdc); infoPtr->bRectsValid = FALSE; - + if (lParam) { InvalidateRect(hwnd, NULL, FALSE); } @@ -1680,7 +1680,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case HDM_GETITEMRECT: return HEADER_GetItemRect (hwnd, wParam, lParam); - case HDM_GETORDERARRAY: + case HDM_GETORDERARRAY: return HEADER_GetOrderArray(hwnd, wParam, lParam); case HDM_GETUNICODEFORMAT: @@ -1754,7 +1754,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_SIZE: return HEADER_Size (hwnd, wParam); - + case WM_PAINT: return HEADER_Paint (hwnd, wParam); @@ -1768,7 +1768,7 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return HEADER_SetFont (hwnd, wParam, lParam); default: - if (msg >= WM_USER) + if (msg >= WM_USER) ERR("unknown msg %04x wp=%04x lp=%08lx\n", msg, wParam, lParam ); return DefWindowProcA (hwnd, msg, wParam, lParam); @@ -1789,7 +1789,7 @@ HEADER_Register (void) wndClass.cbWndExtra = sizeof(HEADER_INFO *); wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.lpszClassName = WC_HEADERA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/hotkey.c b/dlls/comctl32/hotkey.c index 55aa230276a..6f0c43a54ef 100644 --- a/dlls/comctl32/hotkey.c +++ b/dlls/comctl32/hotkey.c @@ -365,7 +365,7 @@ HOTKEY_Register (void) wndClass.hCursor = 0; wndClass.hbrBackground = 0; wndClass.lpszClassName = HOTKEY_CLASSA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 39e943dcd11..9697813b559 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -33,7 +33,7 @@ * Comments: * - ImageList_Draw, ImageList_DrawEx and ImageList_GetIcon use * ImageList_DrawIndirect. Since ImageList_DrawIndirect is still - * partially implemented, the functions mentioned above will be + * partially implemented, the functions mentioned above will be * limited in functionality too. * * - Hotspot handling still not correct. The Hotspot passed to BeginDrag @@ -80,7 +80,7 @@ static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0, FALSE }; /************************************************************************* - * IMAGELIST_InternalExpandBitmaps [Internal] + * IMAGELIST_InternalExpandBitmaps [Internal] * * Expands the bitmaps of an image list by the given number of images. * @@ -127,7 +127,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c himl->hbmImage = hbmNewBitmap; if (himl->hbmMask) { - hbmNewBitmap = + hbmNewBitmap = CreateBitmap (nNewWidth, cy, 1, 1, NULL); if (hbmNewBitmap == 0) @@ -149,7 +149,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c /************************************************************************* - * IMAGELIST_InternalDraw [Internal] + * IMAGELIST_InternalDraw [Internal] * * Draws the image in the ImageList (without the mask) * @@ -162,7 +162,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c * nothing * * NOTES - * This function is used by ImageList_DrawIndirect, when it is + * This function is used by ImageList_DrawIndirect, when it is * required to draw only the Image (without the mask) to the screen. * * Blending and Overlays styles are accomplished by another function @@ -175,10 +175,10 @@ IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) hImageDC = CreateCompatibleDC(0); hOldBitmap = SelectObject(hImageDC, pimldp->himl->hbmImage); - BitBlt(pimldp->hdcDst, + BitBlt(pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, - hImageDC, - pimldp->himl->cx * pimldp->i, 0, + hImageDC, + pimldp->himl->cx * pimldp->i, 0, SRCCOPY); SelectObject(hImageDC, hOldBitmap); @@ -187,7 +187,7 @@ IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) /************************************************************************* - * IMAGELIST_InternalDrawMask [Internal] + * IMAGELIST_InternalDrawMask [Internal] * * Draws the image in the ImageList with the mask * @@ -200,7 +200,7 @@ IMAGELIST_InternalDraw(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) * nothing * * NOTES - * This function is used by ImageList_DrawIndirect, when it is + * This function is used by ImageList_DrawIndirect, when it is * required to draw the Image with the mask to the screen. * * Blending and Overlays styles are accomplished by another function. @@ -216,8 +216,8 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) COLORREF oldBkColor, oldFgColor; UINT fStyle = pimldp->fStyle & (~ILD_OVERLAYMASK); - /* - * We need a dc and bitmap to draw on that is + /* + * We need a dc and bitmap to draw on that is * not on the screen. */ HDC hOffScreenDC = 0; @@ -232,11 +232,11 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) /* Create a compatible DC. */ hOffScreenDC = CreateCompatibleDC( pimldp->hdcDst ); - if ( hOffScreenDC ) + if ( hOffScreenDC ) { hOffScreenBmp = CreateCompatibleBitmap( pimldp->hdcDst, cx, cy ); - if ( hOffScreenBmp ) + if ( hOffScreenBmp ) SelectObject( hOffScreenDC, hOffScreenBmp ); else goto cleanup; @@ -246,43 +246,43 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) hOldBitmapImage = SelectObject(hImageDC, himlLocal->hbmImage); hOldBitmapMask = SelectObject(hMaskDC, himlLocal->hbmMask); - - /* - * Get a copy of the image for the masking operations. + + /* + * Get a copy of the image for the masking operations. * We will use the copy, and this dc for all the various * blitting, and then do one final blit to the screen dc. * This should clean up most of the flickering. */ - BitBlt( hOffScreenDC, 0, 0, cx, cy, pimldp->hdcDst, pimldp->x, + BitBlt( hOffScreenDC, 0, 0, cx, cy, pimldp->hdcDst, pimldp->x, pimldp->y, SRCCOPY); - /* + /* * Draw the Background for the appropriate Styles */ - if( bUseCustomBackground && (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE + if( bUseCustomBackground && (fStyle == ILD_NORMAL || fStyle & ILD_IMAGE || bBlendFlag) ) { - + hBrush = CreateSolidBrush (himlLocal->clrBk); hOldBrush = SelectObject (pimldp->hdcDst, hBrush); - + PatBlt( hOffScreenDC, pimldp->x, pimldp->y, cx, cy, PATCOPY ); DeleteObject (SelectObject (pimldp->hdcDst, hOldBrush)); } - /* + /* * Draw Image Transparently over the current background */ - if(fStyle == ILD_NORMAL || (fStyle & ILD_TRANSPARENT) || - ((fStyle & ILD_IMAGE) && bUseCustomBackground) || bBlendFlag) - { /* + if(fStyle == ILD_NORMAL || (fStyle & ILD_TRANSPARENT) || + ((fStyle & ILD_IMAGE) && bUseCustomBackground) || bBlendFlag) + { /* * To obtain a transparent look, background color should be set - * to white and foreground color to black when blting the - * monochrome mask. + * to white and foreground color to black when blting the + * monochrome mask. */ - - oldBkColor = SetBkColor( hOffScreenDC, RGB( 0xff, 0xff, 0xff ) ); + + oldBkColor = SetBkColor( hOffScreenDC, RGB( 0xff, 0xff, 0xff ) ); oldFgColor = SetTextColor( hOffScreenDC, RGB( 0, 0, 0 ) ); BitBlt( hOffScreenDC, 0, 0, cx, cy,hMaskDC, himlLocal->cx * pimldp->i, @@ -290,18 +290,18 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC,himlLocal->cx * pimldp->i, 0, SRCPAINT ); - + } - + /* * Draw the image when no Background is specified */ else if((fStyle & ILD_IMAGE) && !bUseCustomBackground) { - BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC, + BitBlt( hOffScreenDC, 0, 0, cx, cy, hImageDC, himlLocal->cx * pimldp->i, 0, SRCCOPY); } - /* + /* * Draw the mask with or without a background */ else if(fStyle & ILD_MASK) @@ -309,32 +309,32 @@ IMAGELIST_InternalDrawMask(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) BitBlt( hOffScreenDC, 0, 0, cx, cy, hMaskDC, himlLocal->cx * pimldp->i, 0, bUseCustomBackground ? SRCCOPY : SRCAND); } - + /* * Blit the bitmap to the screen now. */ BitBlt( pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hOffScreenDC, 0, 0, SRCCOPY); - + SelectObject(hImageDC, hOldBitmapImage); SelectObject(hMaskDC, hOldBitmapMask); - + cleanup: - + DeleteDC(hImageDC); DeleteDC(hMaskDC); - + DeleteDC( hOffScreenDC ); DeleteObject( hOffScreenBmp ); - + return; } /************************************************************************* - * IMAGELIST_InternalDrawBlend [Internal] + * IMAGELIST_InternalDrawBlend [Internal] * - * Draws the Blend over the current image + * Draws the Blend over the current image * * PARAMS * pimldp [I] pointer to IMAGELISTDRAWPARAMS structure. @@ -345,9 +345,9 @@ cleanup: * nothing * * NOTES - * This functions is used by ImageList_DrawIndirect, when it is - * required to add the blend to the current image. - * + * This functions is used by ImageList_DrawIndirect, when it is + * required to add the blend to the current image. + * */ static VOID IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) @@ -386,15 +386,15 @@ IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) hOldMaskBitmap = (HBITMAP) SelectObject(hMaskDC, himlLocal->hbmMask); BitBlt(hBlendMaskDC, - 0,0, cx, cy, + 0,0, cx, cy, hMaskDC, himlLocal->cx * pimldp->i,0, 0x220326); /* NOTSRCAND */ BitBlt(hBlendMaskDC, - 0,0, cx, cy, + 0,0, cx, cy, hBlendMaskDC, - 0,0, + 0,0, NOTSRCCOPY); SelectObject(hMaskDC, hOldMaskBitmap); @@ -408,10 +408,10 @@ IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) hBlendColorBrush = CreateSolidBrush(clrBlend); hOldBrush = (HBRUSH) SelectObject (pimldp->hdcDst, hBlendColorBrush); - BitBlt (pimldp->hdcDst, - pimldp->x, pimldp->y, cx, cy, - hBlendMaskDC, - 0, 0, + BitBlt (pimldp->hdcDst, + pimldp->x, pimldp->y, cx, cy, + hBlendMaskDC, + 0, 0, 0xB8074A); /* PSDPxax */ SelectObject(pimldp->hdcDst, hOldBrush); @@ -424,9 +424,9 @@ IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) } /************************************************************************* - * IMAGELIST_InternalDrawOverlay [Internal] + * IMAGELIST_InternalDrawOverlay [Internal] * - * Draws the overlay image + * Draws the overlay image * * PARAMS * pimldp [I] pointer to IMAGELISTDRAWPARAMS structure. @@ -437,12 +437,12 @@ IMAGELIST_InternalDrawBlend(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) * nothing * * NOTES - * This functions is used by ImageList_DrawIndirect, when it is + * This functions is used by ImageList_DrawIndirect, when it is * required to draw the overlay * - * + * */ -static VOID +static VOID IMAGELIST_InternalDrawOverlay(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) { INT nOvlIdx; @@ -458,21 +458,21 @@ IMAGELIST_InternalDrawOverlay(IMAGELISTDRAWPARAMS *pimldp, INT cx, INT cy) hImageDC = CreateCompatibleDC(0); if (pimldp->himl->hbmMask) { - hOldBitmap = (HBITMAP) SelectObject (hImageDC, + hOldBitmap = (HBITMAP) SelectObject (hImageDC, pimldp->himl->hbmMask); - BitBlt (pimldp->hdcDst, + BitBlt (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hImageDC, pimldp->himl->cx * nOvlIdx, 0, SRCAND); SelectObject(hImageDC, hOldBitmap); } - hOldBitmap = (HBITMAP) SelectObject (hImageDC, + hOldBitmap = (HBITMAP) SelectObject (hImageDC, pimldp->himl->hbmImage); - BitBlt (pimldp->hdcDst, - pimldp->x, pimldp->y, cx, cy, + BitBlt (pimldp->hdcDst, + pimldp->x, pimldp->y, cx, cy, hImageDC, pimldp->himl->cx * nOvlIdx, 0, SRCPAINT); @@ -539,10 +539,10 @@ ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask) hOldBitmapMask = (HBITMAP) SelectObject(hdcMask, himl->hbmMask); hOldBitmapTemp = (HBITMAP) SelectObject(hdcTemp, hbmMask); - BitBlt (hdcMask, + BitBlt (hdcMask, nStartX, 0, bmp.bmWidth, bmp.bmHeight, - hdcTemp, - 0, 0, + hdcTemp, + 0, 0, SRCCOPY); SelectObject(hdcTemp, hOldBitmapTemp); @@ -550,10 +550,10 @@ ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask) /* Remove the background from the image */ - BitBlt (hdcImage, + BitBlt (hdcImage, nStartX, 0, bmp.bmWidth, bmp.bmHeight, - hdcMask, - nStartX, 0, + hdcMask, + nStartX, 0, 0x220326); /* NOTSRCAND */ SelectObject(hdcMask, hOldBitmapMask); @@ -594,7 +594,7 @@ ImageList_AddIcon (HIMAGELIST himl, HICON hIcon) /************************************************************************* - * ImageList_AddMasked [COMCTL32.42] + * ImageList_AddMasked [COMCTL32.42] * * Adds an image or images to an image list and creates a mask from the * specified bitmap using the mask color. @@ -659,9 +659,9 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask) bkColor = (clrMask != CLR_DEFAULT) ? clrMask : GetPixel (hdcBitmap, 0, 0); SetBkColor (hdcBitmap, bkColor); - BitBlt (hdcMask, + BitBlt (hdcMask, nMaskXOffset, 0, bmp.bmWidth, bmp.bmHeight, - hdcBitmap, 0, 0, + hdcBitmap, 0, 0, SRCCOPY); SetBkColor(hdcBitmap, RGB(255,255,255)); @@ -676,17 +676,17 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask) on windows where it failed (BUT ImageList_Add is OK) This is here in case some apps rely on this bug */ - BitBlt(hdcBitmap, + BitBlt(hdcBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, - hdcMask, - nMaskXOffset, 0, + hdcMask, + nMaskXOffset, 0, 0x220326); /* NOTSRCAND */ /* Copy result to the imagelist */ - BitBlt (hdcImage, + BitBlt (hdcImage, nIndex * himl->cx, 0, bmp.bmWidth, bmp.bmHeight, - hdcBitmap, - 0, 0, + hdcBitmap, + 0, 0, SRCCOPY); /* Clean up */ @@ -706,7 +706,7 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask) /************************************************************************* - * ImageList_BeginDrag [COMCTL32.43] + * ImageList_BeginDrag [COMCTL32.43] * * Creates a temporary image list that contains one image. It will be used * as a drag image. @@ -774,9 +774,9 @@ ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack, /************************************************************************* - * ImageList_Copy [COMCTL32.44] + * ImageList_Copy [COMCTL32.44] * - * Copies an image of the source image list to an image of the + * Copies an image of the source image list to an image of the * destination image list. Images can be copied or swapped. * * PARAMS @@ -800,7 +800,7 @@ BOOL WINAPI ImageList_Copy (HIMAGELIST himlDst, INT iDst, HIMAGELIST himlSrc, INT iSrc, INT uFlags) { - HDC hdcSrc, hdcDst; + HDC hdcSrc, hdcDst; TRACE("iDst=%d iSrc=%d\n", iDst, iSrc); @@ -924,7 +924,7 @@ ImageList_Create (INT cx, INT cy, UINT flags, HDC hdc; INT nCount; HBITMAP hbmTemp; - static WORD aBitBlend25[] = + static WORD aBitBlend25[] = {0xAA, 0x00, 0x55, 0x00, 0xAA, 0x00, 0x55, 0x00}; static WORD aBitBlend50[] = @@ -967,7 +967,7 @@ ImageList_Create (INT cx, INT cy, UINT flags, } else himl->hbmImage = 0; - + if ( (himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) { himl->hbmMask = CreateBitmap (himl->cx * himl->cMaxImage, himl->cy, 1, 1, NULL); @@ -996,7 +996,7 @@ ImageList_Create (INT cx, INT cy, UINT flags, /************************************************************************* - * ImageList_Destroy [COMCTL32.46] + * ImageList_Destroy [COMCTL32.46] * * Destroys an image list. * @@ -1010,7 +1010,7 @@ ImageList_Create (INT cx, INT cy, UINT flags, BOOL WINAPI ImageList_Destroy (HIMAGELIST himl) -{ +{ if (!himl) return FALSE; @@ -1025,7 +1025,7 @@ ImageList_Destroy (HIMAGELIST himl) DeleteObject (himl->hbrBlend25); if (himl->hbrBlend50) DeleteObject (himl->hbrBlend50); - + COMCTL32_Free (himl); return TRUE; @@ -1033,7 +1033,7 @@ ImageList_Destroy (HIMAGELIST himl) /************************************************************************* - * ImageList_DragEnter [COMCTL32.47] + * ImageList_DragEnter [COMCTL32.47] * * Locks window update and displays the drag image at the given position. * @@ -1077,7 +1077,7 @@ ImageList_DragEnter (HWND hwndLock, INT x, INT y) /************************************************************************* - * ImageList_DragLeave [COMCTL32.48] + * ImageList_DragLeave [COMCTL32.48] * * Unlocks window update and hides the drag image. * @@ -1110,7 +1110,7 @@ ImageList_DragLeave (HWND hwndLock) /************************************************************************* - * ImageList_DragMove [COMCTL32.49] + * ImageList_DragMove [COMCTL32.49] * * Moves the drag image. * @@ -1149,7 +1149,7 @@ ImageList_DragMove (INT x, INT y) INT origOldX, origOldY; INT origRegX, origRegY; INT sizeRegX, sizeRegY; - + /* calculate the update region */ origNewX = x - InternalDrag.dxHotspot; @@ -1203,7 +1203,7 @@ ImageList_DragMove (INT x, INT y) /************************************************************************* - * ImageList_DragShowNolock [COMCTL32.50] + * ImageList_DragShowNolock [COMCTL32.50] * * Shows or hides the drag image. * @@ -1248,7 +1248,7 @@ ImageList_DragShowNolock (BOOL bShow) InternalDrag.himl->cx, InternalDrag.himl->cy); } SelectObject(hdcBg, InternalDrag.hbmBg); - + if (bShow) { /* save the background */ BitBlt(hdcBg, 0, 0, InternalDrag.himl->cx, InternalDrag.himl->cy, @@ -1256,7 +1256,7 @@ ImageList_DragShowNolock (BOOL bShow) /* show the image */ /* FIXME: this should be drawn semitransparent */ ImageList_Draw(InternalDrag.himl, 0, hdcDrag, x, y, ILD_NORMAL); - } else { + } else { /* hide the image */ BitBlt(hdcDrag, x, y, InternalDrag.himl->cx, InternalDrag.himl->cy, hdcBg, 0, 0, SRCCOPY); @@ -1372,7 +1372,7 @@ ImageList_DrawEx (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, /************************************************************************* - * ImageList_DrawIndirect [COMCTL32.53] + * ImageList_DrawIndirect [COMCTL32.53] * * Draws an image using ... * @@ -1387,8 +1387,8 @@ ImageList_DrawEx (HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, BOOL WINAPI ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp) { - INT cx, cy; - /* + INT cx, cy; + /* Do some Error Checking */ if (pimldp == NULL) @@ -1417,7 +1417,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp) { IMAGELIST_InternalDraw(pimldp, cx, cy); } - /* + /* Apply the blend if needed to the Image */ if((pimldp->fStyle & ILD_BLEND50) @@ -1594,7 +1594,7 @@ ImageList_GetFlags(HIMAGELIST himl) /************************************************************************* - * ImageList_GetIcon [COMCTL32.59] + * ImageList_GetIcon [COMCTL32.59] * * Creates an icon from a masked image of an image list. * @@ -1646,12 +1646,12 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle) /* * CreateIconIndirect requires us to deselect the bitmaps from - * the DCs before calling + * the DCs before calling */ SelectObject(hdcSrc, hOldSrcBitmap); SelectObject(hdcDst, hOldDstBitmap); - hIcon = CreateIconIndirect (&ii); + hIcon = CreateIconIndirect (&ii); DeleteDC (hdcSrc); DeleteDC (hdcDst); @@ -1745,18 +1745,18 @@ ImageList_GetImageInfo (HIMAGELIST himl, INT i, IMAGEINFO *pImageInfo) pImageInfo->hbmImage = himl->hbmImage; pImageInfo->hbmMask = himl->hbmMask; - + pImageInfo->rcImage.top = 0; pImageInfo->rcImage.bottom = himl->cy; pImageInfo->rcImage.left = i * himl->cx; pImageInfo->rcImage.right = (i+1) * himl->cx; - + return TRUE; } /************************************************************************* - * ImageList_GetImageRect [COMCTL32.63] + * ImageList_GetImageRect [COMCTL32.63] * * Retrieves the rectangle of the specified image in an image list. * @@ -1855,7 +1855,7 @@ ImageList_LoadImageA (HINSTANCE hi, LPCSTR lpbmp, INT cx, INT cGrow, GetIconInfo (handle, &ii); GetObjectA (ii.hbmColor, sizeof(BITMAP), (LPVOID)&bmp); - himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, + himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, ILC_MASK | ILC_COLOR, 1, cGrow); ImageList_Add (himl, ii.hbmColor, ii.hbmMask); DeleteObject (ii.hbmColor); @@ -1863,7 +1863,7 @@ ImageList_LoadImageA (HINSTANCE hi, LPCSTR lpbmp, INT cx, INT cGrow, } DeleteObject (handle); - + return himl; } @@ -1932,7 +1932,7 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, GetIconInfo (handle, &ii); GetObjectA (ii.hbmMask, sizeof(BITMAP), (LPVOID)&bmp); - himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, + himl = ImageList_Create (bmp.bmWidth, bmp.bmHeight, ILC_MASK | ILC_COLOR, 1, cGrow); ImageList_Add (himl, ii.hbmColor, ii.hbmMask); DeleteObject (ii.hbmColor); @@ -1940,13 +1940,13 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, } DeleteObject (handle); - + return himl; } /************************************************************************* - * ImageList_Merge [COMCTL32.67] + * ImageList_Merge [COMCTL32.67] * * Creates a new image list that contains a merged image from the specified * images of both source image lists. @@ -2030,40 +2030,40 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2, hdcDstImage = CreateCompatibleDC (0); nX1 = i1 * himl1->cx; nX2 = i2 * himl2->cx; - + /* copy image */ SelectObject (hdcSrcImage, himl1->hbmImage); SelectObject (hdcDstImage, himlDst->hbmImage); - BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, + BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, hdcSrcImage, 0, 0, BLACKNESS); - BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, + BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, hdcSrcImage, nX1, 0, SRCCOPY); SelectObject (hdcSrcImage, himl2->hbmMask); - BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, + BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, hdcSrcImage, nX2, 0, SRCAND); SelectObject (hdcSrcImage, himl2->hbmImage); - BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, + BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, hdcSrcImage, nX2, 0, SRCPAINT); /* copy mask */ SelectObject (hdcSrcImage, himl1->hbmMask); SelectObject (hdcDstImage, himlDst->hbmMask); - BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, + BitBlt (hdcDstImage, 0, 0, cxDst, cyDst, hdcSrcImage, 0, 0, WHITENESS); - BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, + BitBlt (hdcDstImage, xOff1, yOff1, himl1->cx, himl1->cy, hdcSrcImage, nX1, 0, SRCCOPY); SelectObject (hdcSrcImage, himl2->hbmMask); - BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, + BitBlt (hdcDstImage, xOff2, yOff2, himl2->cx, himl2->cy, hdcSrcImage, nX2, 0, SRCAND); DeleteDC (hdcSrcImage); DeleteDC (hdcDstImage); himlDst->cCurImage = 1; } - + return himlDst; } @@ -2193,10 +2193,10 @@ ret1: * ILHEAD ilheadstruct; * * for the color image part: - * BITMAPFILEHEADER bmfh; + * BITMAPFILEHEADER bmfh; * BITMAPINFOHEADER bmih; * only if it has a palette: - * RGBQUAD rgbs[nr_of_paletted_colors]; + * RGBQUAD rgbs[nr_of_paletted_colors]; * * BYTE colorbits[imagesize]; * @@ -2204,7 +2204,7 @@ ret1: * BITMAPFILEHEADER bmfh_mask; * BITMAPINFOHEADER bmih_mask; * only if it has a palette (it usually does not): - * RGBQUAD rgbs[nr_of_paletted_colors]; + * RGBQUAD rgbs[nr_of_paletted_colors]; * * BYTE maskbits[imagesize]; * @@ -2296,7 +2296,7 @@ ImageList_Remove (HIMAGELIST himl, INT i) ERR("Invalid image list handle!\n"); return FALSE; } - + if ((i < -1) || (i >= himl->cCurImage)) { ERR("index out of range! %d\n", i); return FALSE; @@ -2339,7 +2339,7 @@ ImageList_Remove (HIMAGELIST himl, INT i) himl->cCurImage, himl->cCurImage - 1); TRACE(" - Max. number of images: %d / %d (Old/New)\n", himl->cMaxImage, himl->cCurImage + himl->cGrow - 1); - + hbmNewImage = CreateBitmap (cxNew, himl->cy, 1, himl->uBitsPixel, NULL); @@ -2354,7 +2354,7 @@ ImageList_Remove (HIMAGELIST himl, INT i) /* copy all images and masks prior to the "removed" image */ if (i > 0) { TRACE("Pre image copy: Copy %d images\n", i); - + SelectObject (hdcSrc, himl->hbmImage); SelectObject (hdcDst, hbmNewImage); BitBlt (hdcDst, 0, 0, i * himl->cx, himl->cy, @@ -2405,7 +2405,7 @@ ImageList_Remove (HIMAGELIST himl, INT i) /************************************************************************* - * ImageList_Replace [COMCTL32.70] + * ImageList_Replace [COMCTL32.70] * * Replaces an image in an image list with a new image. * @@ -2431,7 +2431,7 @@ ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage, ERR("Invalid image list handle!\n"); return FALSE; } - + if ((i >= himl->cMaxImage) || (i < 0)) { ERR("Invalid image index!\n"); return FALSE; @@ -2461,10 +2461,10 @@ ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage, /* Remove the background from the image */ SelectObject (hdcImageList, himl->hbmImage); - StretchBlt (hdcImageList, + StretchBlt (hdcImageList, i*himl->cx, 0, himl->cx, himl->cy, - hdcImage, - 0, 0, bmp.bmWidth, bmp.bmHeight, + hdcImage, + 0, 0, bmp.bmWidth, bmp.bmHeight, 0x220326); /* NOTSRCAND */ } @@ -2508,8 +2508,8 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon) return -1; hBestFitIcon = CopyImage( - hIcon, IMAGE_ICON, - himl->cx, himl->cy, + hIcon, IMAGE_ICON, + himl->cx, himl->cy, LR_COPYFROMRESOURCE); GetIconInfo (hBestFitIcon, &ii); @@ -2572,7 +2572,7 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon) /************************************************************************* - * ImageList_SetBkColor [COMCTL32.76] + * ImageList_SetBkColor [COMCTL32.76] * * Sets the background color of an image list. * @@ -2682,7 +2682,7 @@ ImageList_SetDragCursorImage (HIMAGELIST himlDrag, INT iDrag, /************************************************************************* - * ImageList_SetFilter [COMCTL32.78] + * ImageList_SetFilter [COMCTL32.78] * * Sets a filter (or does something completely different)!!??? * @@ -2822,7 +2822,7 @@ ImageList_SetImageCount (HIMAGELIST himl, INT iImageCount) /* delete 'empty' image space */ SetBkColor (hdcBitmap, RGB(255, 255, 255)); SetTextColor (hdcBitmap, RGB(0, 0, 0)); - PatBlt (hdcBitmap, nCopyCount * himl->cx, 0, + PatBlt (hdcBitmap, nCopyCount * himl->cx, 0, (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS); #endif DeleteObject (himl->hbmImage); @@ -2847,7 +2847,7 @@ ImageList_SetImageCount (HIMAGELIST himl, INT iImageCount) /* delete 'empty' image space */ SetBkColor (hdcBitmap, RGB(255, 255, 255)); SetTextColor (hdcBitmap, RGB(0, 0, 0)); - PatBlt (hdcBitmap, nCopyCount * himl->cx, 0, + PatBlt (hdcBitmap, nCopyCount * himl->cx, 0, (nNewCount - nCopyCount) * himl->cx, himl->cy, BLACKNESS); #endif DeleteObject (himl->hbmMask); @@ -2899,10 +2899,10 @@ ImageList_SetOverlayImage (HIMAGELIST himl, INT iImage, INT iOverlay) -/* helper for ImageList_Write - write bitmap to pstm +/* helper for ImageList_Write - write bitmap to pstm * currently everything is written as 24 bit RGB, except masks */ -static BOOL +static BOOL _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy) { LPBITMAPFILEHEADER bmfh; @@ -2917,7 +2917,7 @@ _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy) xdc = GetDC(0); GetObjectA(hBitmap, sizeof(BITMAP), (LPVOID)&bm); - + /* XXX is this always correct? */ icount = bm.bmWidth / cx; nwidth = cx << 2; @@ -2959,21 +2959,21 @@ _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy) bmih->biClrImportant = 0; lpBitsOrg = (LPBYTE)LocalAlloc(LMEM_ZEROINIT, nsizeImage); - if(!GetDIBits(xdc, hBitmap, 0, bm.bmHeight, lpBitsOrg, + if(!GetDIBits(xdc, hBitmap, 0, bm.bmHeight, lpBitsOrg, (BITMAPINFO *)bmih, DIB_RGB_COLORS)) goto failed; else { int i; int obpl = (((bm.bmWidth*bitCount+31) & ~31)>>3); int nbpl = (((nwidth*bitCount+31) & ~31)>>3); - + for(i = 0; i < nheight; i++) { int ooff = ((nheight-1-i)%cy) * obpl + ((i/cy) * nbpl); int noff = (nbpl * (nheight-1-i)); memcpy(lpBits + noff, lpBitsOrg + ooff, nbpl); } } - + bmih->biWidth = nwidth; bmih->biHeight = nheight; diff --git a/dlls/comctl32/imagelist.h b/dlls/comctl32/imagelist.h index d23166f72c9..fe6666fe1cc 100644 --- a/dlls/comctl32/imagelist.h +++ b/dlls/comctl32/imagelist.h @@ -17,7 +17,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + #ifndef __WINE_IMAGELIST_H #define __WINE_IMAGELIST_H diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index fd97f289e30..00431730036 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -64,9 +64,9 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT IPADDRESS_Notify (IPADDRESS_INFO *infoPtr, UINT command) { HWND hwnd = infoPtr->Self; - + TRACE("(command=%x)\n", command); - + return SendMessageW (GetParent (hwnd), WM_COMMAND, MAKEWPARAM (GetWindowLongW (hwnd, GWL_ID), command), (LPARAM)hwnd); } @@ -76,7 +76,7 @@ static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value) NMIPADDRESS nmip; TRACE("(field=%x, value=%d)\n", field, value); - + nmip.hdr.hwndFrom = infoPtr->Self; nmip.hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID); nmip.hdr.code = IPN_FIELDCHANGED; @@ -88,7 +88,7 @@ static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value) (WPARAM)nmip.hdr.idFrom, (LPARAM)&nmip); TRACE("<-- %d\n", nmip.iValue); - + return nmip.iValue; } @@ -96,12 +96,12 @@ static INT IPADDRESS_IPNotify (IPADDRESS_INFO *infoPtr, INT field, INT value) static int IPADDRESS_GetPartIndex(IPADDRESS_INFO *infoPtr, HWND hwnd) { int i; - + TRACE("(hwnd=%x)\n", hwnd); - - for (i = 0; i < 4; i++) + + for (i = 0; i < 4; i++) if (infoPtr->Part[i].EditHwnd == hwnd) return i; - + ERR("We subclassed the wrong window! (hwnd=%x)\n", hwnd); return -1; } @@ -114,7 +114,7 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc) int i; TRACE("\n"); - + GetClientRect (infoPtr->Self, &rect); DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); @@ -122,7 +122,7 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc) GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart); pt.x = rcPart.right; ScreenToClient(infoPtr->Self, &pt); - rect.left = pt.x; + rect.left = pt.x; GetWindowRect (infoPtr->Part[i+1].EditHwnd, &rcPart); pt.x = rcPart.left; ScreenToClient(infoPtr->Self, &pt); @@ -142,10 +142,10 @@ static LRESULT IPADDRESS_Create (HWND hwnd) WCHAR EDIT[] = { 'E', 'd', 'i', 't', 0 }; TRACE("\n"); - + SetWindowLongW (hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) & ~WS_BORDER); - + infoPtr = (IPADDRESS_INFO *)COMCTL32_Alloc (sizeof(IPADDRESS_INFO)); if (!infoPtr) return -1; SetWindowLongW (hwnd, 0, (DWORD)infoPtr); @@ -158,22 +158,22 @@ static LRESULT IPADDRESS_Create (HWND hwnd) edit.bottom = rcClient.bottom - 2; infoPtr->Self = hwnd; - + for (i = 0; i < 4; i++) { IPPART_INFO* part = &infoPtr->Part[i]; - + part->LowerLimit = 0; part->UpperLimit = 255; edit.left = rcClient.left + i*fieldsize + 6; edit.right = rcClient.left + (i+1)*fieldsize - 2; part->EditHwnd = CreateWindowW (EDIT, NULL, WS_CHILD | WS_VISIBLE | ES_CENTER, - edit.left, edit.top, edit.right - edit.left, - edit.bottom - edit.top, hwnd, (HMENU) 1, + edit.left, edit.top, edit.right - edit.left, + edit.bottom - edit.top, hwnd, (HMENU) 1, GetWindowLongW (hwnd, GWL_HINSTANCE), NULL); SetPropA(part->EditHwnd, IP_SUBCLASS_PROP, hwnd); part->OrigProc = (WNDPROC) - SetWindowLongW (part->EditHwnd, GWL_WNDPROC, + SetWindowLongW (part->EditHwnd, GWL_WNDPROC, (LONG)IPADDRESS_SubclassProc); } @@ -186,7 +186,7 @@ static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr) int i; TRACE("\n"); - + for (i = 0; i < 4; i++) { IPPART_INFO* part = &infoPtr->Part[i]; SetWindowLongW (part->EditHwnd, GWL_WNDPROC, (LONG)part->OrigProc); @@ -203,9 +203,9 @@ static LRESULT IPADDRESS_Paint (IPADDRESS_INFO *infoPtr, HDC hdc) PAINTSTRUCT ps; TRACE("\n"); - + if (hdc) return IPADDRESS_Draw (infoPtr, hdc); - + hdc = BeginPaint (infoPtr->Self, &ps); IPADDRESS_Draw (infoPtr, hdc); EndPaint (infoPtr->Self, &ps); @@ -236,7 +236,7 @@ static int IPADDRESS_GetAddress (IPADDRESS_INFO *infoPtr, LPDWORD ip_address) for (i = 0; i < 4; i++) { ip_addr *= 256; - if (GetWindowTextW (infoPtr->Part[i].EditHwnd, field, 4)) + if (GetWindowTextW (infoPtr->Part[i].EditHwnd, field, 4)) ip_addr += atolW(field); else invalid++; @@ -267,7 +267,7 @@ static void IPADDRESS_ClearAddress (IPADDRESS_INFO *infoPtr) TRACE("\n"); - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) SetWindowTextW (infoPtr->Part[i].EditHwnd, nil); } @@ -297,13 +297,13 @@ static LRESULT IPADDRESS_SetAddress (IPADDRESS_INFO *infoPtr, DWORD ip_address) static void IPADDRESS_SetFocusToField (IPADDRESS_INFO *infoPtr, INT index) { TRACE("(index=%d)\n", index); - + if (index > 3) { for (index = 0; index < 4; index++) if (!GetWindowTextLengthW(infoPtr->Part[index].EditHwnd)) break; } if (index < 9 || index > 3) index = 0; - + SetFocus (infoPtr->Part[index].EditHwnd); } @@ -317,20 +317,20 @@ static BOOL IPADDRESS_ConstrainField (IPADDRESS_INFO *infoPtr, int currentfield) TRACE("(currentfield=%d)\n", currentfield); if (currentfield < 0 || currentfield > 3) return FALSE; - + if (!GetWindowTextW (part->EditHwnd, field, 4)) return FALSE; - + curValue = atoiW(field); TRACE(" curValue=%d\n", curValue); - + newValue = IPADDRESS_IPNotify(infoPtr, currentfield, curValue); TRACE(" newValue=%d\n", newValue); if (newValue < part->LowerLimit) newValue = part->LowerLimit; if (newValue > part->UpperLimit) newValue = part->UpperLimit; - + if (newValue == curValue) return FALSE; - + wsprintfW (field, fmt, newValue); TRACE(" field='%s'\n", debugstr_w(field)); return SetWindowTextW (part->EditHwnd, field); @@ -343,7 +343,7 @@ static BOOL IPADDRESS_GotoNextField (IPADDRESS_INFO *infoPtr, int cur, int sel) if(cur >= -1 && cur < 4) { IPADDRESS_ConstrainField(infoPtr, cur); - + if(cur < 3) { IPPART_INFO *next = &infoPtr->Part[cur + 1]; int start = 0, end = 0; @@ -357,7 +357,7 @@ static BOOL IPADDRESS_GotoNextField (IPADDRESS_INFO *infoPtr, int cur, int sel) } return TRUE; } - + } return FALSE; } @@ -372,30 +372,30 @@ static BOOL IPADDRESS_GotoNextField (IPADDRESS_INFO *infoPtr, int cur, int sel) * * alpha characters: completely ignored * - * digits: accepted when field text length < 2 ignored otherwise. - * when 3 numbers have been entered into the field the value - * of the field is checked, if the field value exceeds the - * maximum value and is changed the field remains the current - * field, otherwise focus moves to the field to the right + * digits: accepted when field text length < 2 ignored otherwise. + * when 3 numbers have been entered into the field the value + * of the field is checked, if the field value exceeds the + * maximum value and is changed the field remains the current + * field, otherwise focus moves to the field to the right * - * tab: change focus from the current ipaddress control to the next - * control in the tab order + * tab: change focus from the current ipaddress control to the next + * control in the tab order * - * right arrow: move to the field on the right to the left most - * position in that field if no text is selected, - * we are in the right most position in the field, - * we are not in the right most field + * right arrow: move to the field on the right to the left most + * position in that field if no text is selected, + * we are in the right most position in the field, + * we are not in the right most field * - * left arrow: move to the field on the left to the right most - * position in that field if no text is selected, - * we are in the left most position in the current field - * and we are not in the left most field + * left arrow: move to the field on the left to the right most + * position in that field if no text is selected, + * we are in the left most position in the current field + * and we are not in the left most field * - * backspace: delete the character to the left of the cursor position, - * if none are present move to the field on the left if - * we are not in the left most field and delete the right - * most digit in that field while keeping the cursor - * on the right side of the field + * backspace: delete the character to the left of the cursor position, + * if none are present move to the field on the left if + * we are not in the left most field and delete the right + * most digit in that field while keeping the cursor + * on the right side of the field */ LRESULT CALLBACK IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -414,14 +414,14 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (uMsg == WM_CHAR || uMsg == WM_KEYDOWN) { len = GetWindowTextLengthW (hwnd); SendMessageW(hwnd, EM_GETSEL, (WPARAM)&startsel, (LPARAM)&endsel); - } + } switch (uMsg) { - case WM_CHAR: + case WM_CHAR: if(isdigit(c)) { if(len == 2 && startsel==endsel && endsel==len) { /* process the digit press before we check the field */ int return_val = CallWindowProcW (part->OrigProc, hwnd, uMsg, wParam, lParam); - + /* if the field value was changed stay at the current field */ if(!IPADDRESS_ConstrainField(infoPtr, index)) IPADDRESS_GotoNextField (infoPtr, index, POS_DEFAULT); @@ -429,14 +429,14 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return return_val; } else if (len == 3 && startsel==endsel && endsel==len) IPADDRESS_GotoNextField (infoPtr, index, POS_SELALL); - else if (len < 3) break; + else if (len < 3) break; } else if(c == '.' || c == ' ') { if(len && startsel==endsel && startsel != 0) { - IPADDRESS_GotoNextField(infoPtr, index, POS_SELALL); + IPADDRESS_GotoNextField(infoPtr, index, POS_SELALL); } } else if (c == VK_BACK) break; return 0; - + case WM_KEYDOWN: switch(c) { case VK_RIGHT: @@ -455,17 +455,17 @@ IPADDRESS_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if(startsel==endsel && startsel==0 && index > 0) { IPPART_INFO *prev = &infoPtr->Part[index-1]; WCHAR val[10]; - + if(GetWindowTextW(prev->EditHwnd, val, 5)) { val[lstrlenW(val) - 1] = 0; SetWindowTextW(prev->EditHwnd, val); } - + IPADDRESS_GotoNextField(infoPtr, index - 2, POS_RIGHT); return 0; } break; - } + } break; case WM_KILLFOCUS: if (IPADDRESS_GetPartIndex(infoPtr, (HWND)wParam) < 0) @@ -484,12 +484,12 @@ static LRESULT WINAPI IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { IPADDRESS_INFO *infoPtr = IPADDRESS_GetInfoPtr (hwnd); - + TRACE("(hwnd=0x%x msg=0x%x wparam=0x%x lparam=0x%lx)\n", hwnd, uMsg, wParam, lParam); - + if (!infoPtr && (uMsg != WM_CREATE)) return DefWindowProcW (hwnd, uMsg, wParam, lParam); - + switch (uMsg) { case WM_CREATE: @@ -553,7 +553,7 @@ void IPADDRESS_Register (void) wndClass.hCursor = LoadCursorW (0, IDC_IBEAMW); wndClass.hbrBackground = GetStockObject(WHITE_BRUSH); wndClass.lpszClassName = WC_IPADDRESSW; - + RegisterClassW (&wndClass); } diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index ea2a7b4f356..88fa902222f 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -22,7 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * NOTES - * Listview control implementation. + * Listview control implementation. * * TODO: * 1. No horizontal scrolling when header is larger than the client area. @@ -34,18 +34,18 @@ * * Data structure: * LISTVIEW_SetItemCount : not completed for non OWNERDATA - * + * * Advanced functionality: * LISTVIEW_GetNumberOfWorkAreas : not implemented * LISTVIEW_GetHotCursor : not implemented - * LISTVIEW_GetISearchString : not implemented + * LISTVIEW_GetISearchString : not implemented * LISTVIEW_GetBkImage : not implemented * LISTVIEW_SetBkImage : not implemented * LISTVIEW_GetColumnOrderArray : simple hack only * LISTVIEW_SetColumnOrderArray : simple hack only * LISTVIEW_Arrange : empty stub * LISTVIEW_ApproximateViewRect : incomplete - * LISTVIEW_Scroll : not implemented + * LISTVIEW_Scroll : not implemented * LISTVIEW_Update : not completed * * Known differences in message stream from native control (not known if @@ -76,7 +76,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(listview); -/* Some definitions for inline edit control */ +/* Some definitions for inline edit control */ typedef BOOL (*EditlblCallbackW)(HWND, LPWSTR, DWORD); typedef BOOL (*EditlblCallbackA)(HWND, LPWSTR, DWORD); @@ -86,7 +86,7 @@ typedef struct tagLV_INTHIT DWORD distance; /* distance to closest item */ INT iDistItem; /* item number that is closest */ } LV_INTHIT, *LPLV_INTHIT; - + typedef struct tagEDITLABEL_ITEM { @@ -166,7 +166,7 @@ typedef struct tagLISTVIEW_INFO } LISTVIEW_INFO; /* - * constants + * constants */ /* maximum size of a label */ @@ -199,7 +199,7 @@ typedef struct tagLISTVIEW_INFO #define DEFAULT_LABEL_WIDTH 40 /* default column width for items in list display mode */ -#define DEFAULT_COLUMN_WIDTH 96 +#define DEFAULT_COLUMN_WIDTH 96 /* Increment size of the horizontal scroll bar */ #define LISTVIEW_SCROLL_DIV_SIZE 10 @@ -212,19 +212,19 @@ typedef struct tagLISTVIEW_INFO /* Border for the icon caption */ #define CAPTION_BORDER 2 -/* +/* * macros */ /* retrieve the number of items in the listview */ #define GETITEMCOUNT(infoPtr) ((infoPtr)->hdpaItems->nItemCount) #define HDM_INSERTITEMT(isW) ( (isW) ? HDM_INSERTITEMW : HDM_INSERTITEMA ) -HWND CreateEditLabelT(LPCWSTR text, DWORD style, INT x, INT y, - INT width, INT height, HWND parent, HINSTANCE hinst, +HWND CreateEditLabelT(LPCWSTR text, DWORD style, INT x, INT y, + INT width, INT height, HWND parent, HINSTANCE hinst, EditlblCallbackW EditLblCb, DWORD param, BOOL isW); - -/* - * forward declarations + +/* + * forward declarations */ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, BOOL isW); static INT LISTVIEW_SuperHitTestItem(HWND, LPLV_INTHIT, BOOL); @@ -325,8 +325,8 @@ static inline LPCSTR debugstr_tn(LPCWSTR text, BOOL isW, INT n) static inline LPWSTR textdupTtoW(LPCWSTR text, BOOL isW) { LPWSTR wstr = (LPWSTR)text; - - TRACE("(text=%s, isW=%d)\n", debugstr_t(text, isW), isW); + + TRACE("(text=%s, isW=%d)\n", debugstr_t(text, isW), isW); if (!isW && text) { INT len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)text, -1, NULL, 0); @@ -356,7 +356,7 @@ static inline BOOL textsetptrT(LPWSTR *dest, LPWSTR src, BOOL isW) return bResult; } -static inline LRESULT CallWindowProcT(WNDPROC proc, HWND hwnd, UINT uMsg, +static inline LRESULT CallWindowProcT(WNDPROC proc, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL isW) { if (isW) @@ -370,7 +370,7 @@ static inline BOOL notify(HWND self, INT code, LPNMHDR pnmh) pnmh->hwndFrom = self; pnmh->idFrom = GetWindowLongW(self, GWL_ID); pnmh->code = code; - return (BOOL)SendMessageW(GetParent(self), WM_NOTIFY, + return (BOOL)SendMessageW(GetParent(self), WM_NOTIFY, (WPARAM)pnmh->idFrom, (LPARAM)pnmh); } @@ -386,7 +386,7 @@ static inline BOOL listview_notify(HWND self, INT code, LPNMLISTVIEW plvnm) } static int tabNotification[] = { - LVN_BEGINLABELEDITW, LVN_BEGINLABELEDITA, + LVN_BEGINLABELEDITW, LVN_BEGINLABELEDITA, LVN_ENDLABELEDITW, LVN_ENDLABELEDITA, LVN_GETDISPINFOW, LVN_GETDISPINFOA, LVN_SETDISPINFOW, LVN_SETDISPINFOA, @@ -405,7 +405,7 @@ static int get_ansi_notification(INT unicodeNotificationCode) } /* - Send notification. depends on dispinfoW having same + Send notification. depends on dispinfoW having same structure as dispinfoA. self : listview handle notificationCode : *Unicode* notification code @@ -437,7 +437,7 @@ static BOOL dispinfo_notifyT(HWND self, INT notificationCode, LPNMLVDISPINFOW pd if (!isW && infoPtr->notifyFormat == NFR_UNICODE) convertToUnicode = TRUE; } - + if (convertToAnsi || convertToUnicode) { TRACE(" we have to convert the text to the correct format\n"); @@ -450,11 +450,11 @@ static BOOL dispinfo_notifyT(HWND self, INT notificationCode, LPNMLVDISPINFOW pd else cchTempBufMax = pdi->item.cchTextMax; - pszTempBuf = HeapAlloc(GetProcessHeap(), 0, + pszTempBuf = HeapAlloc(GetProcessHeap(), 0, (convertToUnicode ? sizeof(WCHAR) : sizeof(CHAR)) * cchTempBufMax); if (!pszTempBuf) return FALSE; if (convertToUnicode) - MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pdi->item.pszText, -1, + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pdi->item.pszText, -1, pszTempBuf, cchTempBufMax); else WideCharToMultiByte(CP_ACP, 0, pdi->item.pszText, -1, (LPSTR) pszTempBuf, @@ -464,10 +464,10 @@ static BOOL dispinfo_notifyT(HWND self, INT notificationCode, LPNMLVDISPINFOW pd savPszText = pdi->item.pszText; pdi->item.pszText = pszTempBuf; pdi->item.cchTextMax = cchTempBufMax; - } - + } + bResult = notify(self, realNotifCode, (LPNMHDR)pdi); - + if (convertToUnicode || convertToAnsi) { /* convert back result */ TRACE(" returned text=%s\n", debugstr_t(pdi->item.pszText, convertToUnicode)); @@ -505,12 +505,12 @@ static char* debuglvitem_t(LPLVITEMW lpLVItem, BOOL isW) char* buf = buffers[index++ % 20]; if (lpLVItem == NULL) return "(null)"; snprintf(buf, 256, "{mask=%x, iItem=%d, iSubItem=%d, state=%x, stateMask=%x," - " pszText=%s, cchTextMax=%d, iImage=%d, lParam=%lx, iIndent=%d}", - lpLVItem->mask, lpLVItem->iItem, lpLVItem->iSubItem, - lpLVItem->state, lpLVItem->stateMask, + " pszText=%s, cchTextMax=%d, iImage=%d, lParam=%lx, iIndent=%d}", + lpLVItem->mask, lpLVItem->iItem, lpLVItem->iSubItem, + lpLVItem->state, lpLVItem->stateMask, lpLVItem->pszText == LPSTR_TEXTCALLBACKW ? "(callback)" : - debugstr_tn(lpLVItem->pszText, isW, 80), - lpLVItem->cchTextMax, lpLVItem->iImage, lpLVItem->lParam, + debugstr_tn(lpLVItem->pszText, isW, 80), + lpLVItem->cchTextMax, lpLVItem->iImage, lpLVItem->lParam, lpLVItem->iIndent); return buf; } @@ -522,10 +522,10 @@ static char* debuglvcolumn_t(LPLVCOLUMNW lpColumn, BOOL isW) char* buf = buffers[index++ % 20]; if (lpColumn == NULL) return "(null)"; snprintf(buf, 256, "{mask=%x, fmt=%x, cx=%d," - " pszText=%s, cchTextMax=%d, iSubItem=%d}", - lpColumn->mask, lpColumn->fmt, lpColumn->cx, + " pszText=%s, cchTextMax=%d, iSubItem=%d}", + lpColumn->mask, lpColumn->fmt, lpColumn->cx, lpColumn->mask & LVCF_TEXT ? lpColumn->pszText == LPSTR_TEXTCALLBACKW ? "(callback)" : - debugstr_tn(lpColumn->pszText, isW, 80): "", + debugstr_tn(lpColumn->pszText, isW, 80): "", lpColumn->mask & LVCF_TEXT ? lpColumn->cchTextMax: 0, lpColumn->iSubItem); return buf; } @@ -573,7 +573,7 @@ LISTVIEW_SendCustomDrawNotify (HWND hwnd, DWORD dwDrawStage, HDC hdc, static BOOL LISTVIEW_SendCustomDrawItemNotify (HWND hwnd, HDC hdc, - UINT iItem, UINT iSubItem, + UINT iItem, UINT iSubItem, UINT uItemDrawState) { LISTVIEW_INFO *infoPtr; @@ -636,20 +636,20 @@ LISTVIEW_SendCustomDrawItemNotify (HWND hwnd, HDC hdc, /************************************************************************* * LISTVIEW_ProcessLetterKeys * - * Processes keyboard messages generated by pressing the letter keys + * Processes keyboard messages generated by pressing the letter keys * on the keyboard. - * What this does is perform a case insensitive search from the + * What this does is perform a case insensitive search from the * current position with the following quirks: - * - If two chars or more are pressed in quick succession we search + * - If two chars or more are pressed in quick succession we search * for the corresponding string (e.g. 'abc'). - * - If there is a delay we wipe away the current search string and + * - If there is a delay we wipe away the current search string and * restart with just that char. - * - If the user keeps pressing the same character, whether slowly or - * fast, so that the search string is entirely composed of this - * character ('aaaaa' for instance), then we search for first item + * - If the user keeps pressing the same character, whether slowly or + * fast, so that the search string is entirely composed of this + * character ('aaaaa' for instance), then we search for first item * that starting with that character. - * - If the user types the above character in quick succession, then - * we must also search for the corresponding string ('aaaaa'), and + * - If the user types the above character in quick succession, then + * we must also search for the corresponding string ('aaaaa'), and * go to that string if there is a match. * * RETURNS @@ -658,10 +658,10 @@ LISTVIEW_SendCustomDrawItemNotify (HWND hwnd, HDC hdc, * * BUGS * - * - The current implementation has a list of characters it will - * accept and it ignores averything else. In particular it will - * ignore accentuated characters which seems to match what - * Windows does. But I'm not sure it makes sense to follow + * - The current implementation has a list of characters it will + * accept and it ignores averything else. In particular it will + * ignore accentuated characters which seems to match what + * Windows does. But I'm not sure it makes sense to follow * Windows there. * - We don't sound a beep when the search fails. * @@ -788,7 +788,7 @@ static INT LISTVIEW_ProcessLetterKeys( } /************************************************************************* - * LISTVIEW_UpdateHeaderSize [Internal] + * LISTVIEW_UpdateHeaderSize [Internal] * * Function to resize the header control * @@ -824,9 +824,9 @@ static VOID LISTVIEW_UpdateHeaderSize(HWND hwnd, INT nNewScrollPos) /*** * DESCRIPTION: - * Update the scrollbars. This functions should be called whenever + * Update the scrollbars. This functions should be called whenever * the content, size or view changes. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -835,7 +835,7 @@ static VOID LISTVIEW_UpdateHeaderSize(HWND hwnd, INT nNewScrollPos) */ static VOID LISTVIEW_UpdateScroll(HWND hwnd) { - LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); + LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); UINT uView = lStyle & LVS_TYPEMASK; INT nListHeight = infoPtr->rcList.bottom - infoPtr->rcList.top; @@ -843,7 +843,7 @@ static VOID LISTVIEW_UpdateScroll(HWND hwnd) SCROLLINFO scrollInfo; if (lStyle & LVS_NOSCROLL) return; - + ZeroMemory(&scrollInfo, sizeof(SCROLLINFO)); scrollInfo.cbSize = sizeof(SCROLLINFO); @@ -882,16 +882,16 @@ static VOID LISTVIEW_UpdateScroll(HWND hwnd) /* update horizontal scrollbar */ nListWidth = infoPtr->rcList.right - infoPtr->rcList.left; - if (GetScrollInfo(hwnd, SB_HORZ, &scrollInfo) == FALSE + if (GetScrollInfo(hwnd, SB_HORZ, &scrollInfo) == FALSE || GETITEMCOUNT(infoPtr) == 0) { scrollInfo.nPos = 0; - } + } scrollInfo.nMin = 0; - scrollInfo.fMask = SIF_RANGE | SIF_POS | SIF_PAGE ; + scrollInfo.fMask = SIF_RANGE | SIF_POS | SIF_PAGE ; scrollInfo.nPage = nListWidth / LISTVIEW_SCROLL_DIV_SIZE; scrollInfo.nMax = max(infoPtr->nItemWidth / LISTVIEW_SCROLL_DIV_SIZE, 0)-1; - SetScrollInfo(hwnd, SB_HORZ, &scrollInfo, TRUE); + SetScrollInfo(hwnd, SB_HORZ, &scrollInfo, TRUE); /* Update the Header Control */ scrollInfo.fMask = SIF_POS; @@ -942,7 +942,7 @@ static VOID LISTVIEW_UpdateScroll(HWND hwnd) * DESCRIPTION: * Prints a message for unsupported window styles. * A kind of TODO list for window styles. - * + * * PARAMETER(S): * [I] LONG : window style * @@ -973,7 +973,7 @@ static VOID LISTVIEW_UnsupportedStyles(LONG lStyle) /*** * DESCRIPTION: * Aligns the items with the top edge of the window. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -988,12 +988,12 @@ static VOID LISTVIEW_AlignTop(HWND hwnd) POINT ptItem; RECT rcView; INT i, off_x=0, off_y=0; - + if ((uView == LVS_SMALLICON) || (uView == LVS_ICON)) { /* Since SetItemPosition uses upper-left of icon, and for style=LVS_ICON the icon is not left adjusted, get the offset */ - if (uView == LVS_ICON) + if (uView == LVS_ICON) { off_y = ICON_TOP_PADDING; off_x = (infoPtr->iconSpacing.cx - infoPtr->iconSize.cx) / 2; @@ -1011,7 +1011,7 @@ static VOID LISTVIEW_AlignTop(HWND hwnd) ptItem.x = off_x; ptItem.y += infoPtr->nItemHeight; } - + LISTVIEW_SetItemPosition(hwnd, i, ptItem.x, ptItem.y); ptItem.x += infoPtr->nItemWidth; rcView.right = max(rcView.right, ptItem.x); @@ -1038,7 +1038,7 @@ static VOID LISTVIEW_AlignTop(HWND hwnd) /*** * DESCRIPTION: * Aligns the items with the left edge of the window. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -1053,12 +1053,12 @@ static VOID LISTVIEW_AlignLeft(HWND hwnd) POINT ptItem; RECT rcView; INT i, off_x=0, off_y=0; - + if ((uView == LVS_SMALLICON) || (uView == LVS_ICON)) { /* Since SetItemPosition uses upper-left of icon, and for style=LVS_ICON the icon is not left adjusted, get the offset */ - if (uView == LVS_ICON) + if (uView == LVS_ICON) { off_y = ICON_TOP_PADDING; off_x = (infoPtr->iconSpacing.cx - infoPtr->iconSize.cx) / 2; @@ -1103,7 +1103,7 @@ static VOID LISTVIEW_AlignLeft(HWND hwnd) /*** * DESCRIPTION: * Set the bounding rectangle of all the items. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] LPRECT : bounding rectangle @@ -1117,9 +1117,9 @@ static LRESULT LISTVIEW_SetViewRect(HWND hwnd, LPRECT lprcView) LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)GetWindowLongW(hwnd, 0); BOOL bResult = FALSE; - TRACE("(hwnd=%x, left=%d, top=%d, right=%d, bottom=%d)\n", hwnd, + TRACE("(hwnd=%x, left=%d, top=%d, right=%d, bottom=%d)\n", hwnd, lprcView->left, lprcView->top, lprcView->right, lprcView->bottom); - + if (lprcView != NULL) { bResult = TRUE; @@ -1135,7 +1135,7 @@ static LRESULT LISTVIEW_SetViewRect(HWND hwnd, LPRECT lprcView) /*** * DESCRIPTION: * Retrieves the bounding rectangle of all the items. - * + * * PARAMETER(S): * [I] HWND : window handle * [O] LPRECT : bounding rectangle @@ -1163,7 +1163,7 @@ static LRESULT LISTVIEW_GetViewRect(HWND hwnd, LPRECT lprcView) lprcView->bottom = infoPtr->rcView.bottom + ptOrigin.y; } - TRACE("(left=%d, top=%d, right=%d, bottom=%d)\n", + TRACE("(left=%d, top=%d, right=%d, bottom=%d)\n", lprcView->left, lprcView->top, lprcView->right, lprcView->bottom); } @@ -1173,7 +1173,7 @@ static LRESULT LISTVIEW_GetViewRect(HWND hwnd, LPRECT lprcView) /*** * DESCRIPTION: * Retrieves the subitem pointer associated with the subitem index. - * + * * PARAMETER(S): * [I] HDPA : DPA handle for a specific item * [I] INT : index of subitem @@ -1182,7 +1182,7 @@ static LRESULT LISTVIEW_GetViewRect(HWND hwnd, LPRECT lprcView) * SUCCESS : subitem pointer * FAILURE : NULL */ -static LISTVIEW_SUBITEM* LISTVIEW_GetSubItemPtr(HDPA hdpaSubItems, +static LISTVIEW_SUBITEM* LISTVIEW_GetSubItemPtr(HDPA hdpaSubItems, INT nSubItem) { LISTVIEW_SUBITEM *lpSubItem; @@ -1206,7 +1206,7 @@ static LISTVIEW_SUBITEM* LISTVIEW_GetSubItemPtr(HDPA hdpaSubItems, /*** * DESCRIPTION: * Calculates the width of an item. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] LONG : window style @@ -1217,8 +1217,8 @@ static LISTVIEW_SUBITEM* LISTVIEW_GetSubItemPtr(HDPA hdpaSubItems, static INT LISTVIEW_GetItemWidth(HWND hwnd) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); - LONG style = GetWindowLongW(hwnd, GWL_STYLE); - UINT uView = style & LVS_TYPEMASK; + LONG style = GetWindowLongW(hwnd, GWL_STYLE); + UINT uView = style & LVS_TYPEMASK; INT nHeaderItemCount; RECT rcHeaderItem; INT nItemWidth = 0; @@ -1246,11 +1246,11 @@ static INT LISTVIEW_GetItemWidth(HWND hwnd) else { for (i = 0; i < GETITEMCOUNT(infoPtr); i++) - { + { nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, i); nItemWidth = max(nItemWidth, nLabelWidth); } - + /* default label size */ if (GETITEMCOUNT(infoPtr) == 0) { @@ -1266,7 +1266,7 @@ static INT LISTVIEW_GetItemWidth(HWND hwnd) { /* add padding */ nItemWidth += WIDTH_PADDING; - + if (infoPtr->himlSmall != NULL) { nItemWidth += infoPtr->iconSize.cx; @@ -1290,10 +1290,10 @@ static INT LISTVIEW_GetItemWidth(HWND hwnd) /*** * DESCRIPTION: * Calculates the width of a specific item. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] LPSTR : string + * [I] LPSTR : string * * RETURN: * Returns the width of an item width a specified string. @@ -1345,7 +1345,7 @@ static INT LISTVIEW_CalculateWidth(HWND hwnd, INT nItem) { /* add padding */ nItemWidth += WIDTH_PADDING; - + if (infoPtr->himlSmall != NULL) { nItemWidth += infoPtr->iconSize.cx; @@ -1358,7 +1358,7 @@ static INT LISTVIEW_CalculateWidth(HWND hwnd, INT nItem) } } } - + return nItemWidth; } @@ -1396,7 +1396,7 @@ static VOID LISTVIEW_SaveTextMetrics(HWND hwnd) /*** * DESCRIPTION: * Calculates the height of an item. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -1454,18 +1454,18 @@ static void LISTVIEW_PrintSelectionRanges(HWND hwnd) * <0 : if Item 2 > Item 1 * 0 : if Item 1 == Item 2 */ -static INT CALLBACK LISTVIEW_CompareSelectionRanges(LPVOID range1, LPVOID range2, +static INT CALLBACK LISTVIEW_CompareSelectionRanges(LPVOID range1, LPVOID range2, LPARAM flags) { int l1 = ((LISTVIEW_SELECTION*)(range1))->lower; int l2 = ((LISTVIEW_SELECTION*)(range2))->lower; int u1 = ((LISTVIEW_SELECTION*)(range1))->upper; - int u2 = ((LISTVIEW_SELECTION*)(range2))->upper; + int u2 = ((LISTVIEW_SELECTION*)(range2))->upper; int rc=0; if (u1 < l2) rc= -1; - + if (u2 < l1) rc= 1; @@ -1475,11 +1475,11 @@ static INT CALLBACK LISTVIEW_CompareSelectionRanges(LPVOID range1, LPVOID range2 /** * DESCRIPTION: * Adds a selection range. -* +* * PARAMETER(S): * [I] HWND : window handle * [I] INT : lower item index -* [I] INT : upper item index +* [I] INT : upper item index * * RETURN: * None @@ -1513,7 +1513,7 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) index = DPA_Search(infoPtr->hdpaSelectionRanges, selection, 0, LISTVIEW_CompareSelectionRanges, 0,0); - selection->upper --; + selection->upper --; if (lowerzero) lowerzero=FALSE; else @@ -1524,25 +1524,25 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) checkselection = DPA_GetPtr(infoPtr->hdpaSelectionRanges,index); TRACE("Merge with index %i (%lu - %lu)\n",index,checkselection->lower, checkselection->upper); - + checkselection->lower = min(selection->lower,checkselection->lower); checkselection->upper = max(selection->upper,checkselection->upper); - - TRACE("New range (%lu - %lu)\n", checkselection->lower, + + TRACE("New range (%lu - %lu)\n", checkselection->lower, checkselection->upper); - COMCTL32_Free(selection); - + COMCTL32_Free(selection); + /* merge now common selection ranges in the lower group*/ do { - checkselection->upper ++; + checkselection->upper ++; if (checkselection->lower == 0) lowerzero = TRUE; else checkselection->lower --; - TRACE("search lower range (%lu - %lu)\n", checkselection->lower, + TRACE("search lower range (%lu - %lu)\n", checkselection->lower, checkselection->upper); /* not sorted yet */ @@ -1550,7 +1550,7 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) LISTVIEW_CompareSelectionRanges, 0, 0); - checkselection->upper --; + checkselection->upper --; if (lowerzero) lowerzero = FALSE; else @@ -1561,7 +1561,7 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) TRACE("Merge with index %i\n",mergeindex); checkselection2 = DPA_GetPtr(infoPtr->hdpaSelectionRanges, mergeindex); - checkselection->lower = min(checkselection->lower, + checkselection->lower = min(checkselection->lower, checkselection2->lower); checkselection->upper = max(checkselection->upper, checkselection2->upper); @@ -1578,10 +1578,10 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) checkselection->upper ++; if (checkselection->lower == 0) lowerzero = TRUE; - else + else checkselection->lower --; - TRACE("search upper range %i (%lu - %lu)\n",index, + TRACE("search upper range %i (%lu - %lu)\n",index, checkselection->lower, checkselection->upper); /* not sorted yet */ @@ -1590,7 +1590,7 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) LISTVIEW_CompareSelectionRanges, 0, 0); - checkselection->upper --; + checkselection->upper --; if (lowerzero) lowerzero = FALSE; else @@ -1601,7 +1601,7 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) TRACE("Merge with index %i\n",mergeindex); checkselection2 = DPA_GetPtr(infoPtr->hdpaSelectionRanges, mergeindex); - checkselection->lower = min(checkselection->lower, + checkselection->lower = min(checkselection->lower, checkselection2->lower); checkselection->upper = max(checkselection->upper, checkselection2->upper); @@ -1615,21 +1615,21 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) { index = DPA_Search(infoPtr->hdpaSelectionRanges, selection, 0, - LISTVIEW_CompareSelectionRanges, 0, + LISTVIEW_CompareSelectionRanges, 0, DPAS_INSERTAFTER); TRACE("Insert before index %i\n",index); if (index == -1) index = 0; - DPA_InsertPtr(infoPtr->hdpaSelectionRanges,index,selection); + DPA_InsertPtr(infoPtr->hdpaSelectionRanges,index,selection); } - } + } else { DPA_InsertPtr(infoPtr->hdpaSelectionRanges,0,selection); } /* - * Incase of error + * Incase of error */ DPA_Sort(infoPtr->hdpaSelectionRanges,LISTVIEW_CompareSelectionRanges,0); LISTVIEW_PrintSelectionRanges(hwnd); @@ -1638,10 +1638,10 @@ static VOID LISTVIEW_AddSelectionRange(HWND hwnd, INT lItem, INT uItem) /** * DESCRIPTION: * check if a specified index is selected. -* +* * PARAMETER(S): * [I] HWND : window handle -* [I] INT : item index +* [I] INT : item index * * RETURN: * None @@ -1681,7 +1681,7 @@ static LRESULT LISTVIEW_RemoveAllSelections(HWND hwnd) LISTVIEW_SELECTION *selection; INT i; LVITEMW item; - + TRACE("(0x%x)\n",hwnd); ZeroMemory(&item,sizeof(item)); @@ -1697,21 +1697,21 @@ static LRESULT LISTVIEW_RemoveAllSelections(HWND hwnd) LISTVIEW_SetItemState(hwnd,i,&item); LISTVIEW_RemoveSelectionRange(hwnd,selection->lower,selection->upper); } - } + } while (infoPtr->hdpaSelectionRanges->nItemCount>0); TRACE("done\n"); - return TRUE; + return TRUE; } /** * DESCRIPTION: * Removes a range selections. -* +* * PARAMETER(S): * [I] HWND : window handle * [I] INT : lower item index -* [I] INT : upper item index +* [I] INT : upper item index * * RETURN: * None @@ -1731,11 +1731,11 @@ static VOID LISTVIEW_RemoveSelectionRange(HWND hwnd, INT lItem, INT uItem) index = DPA_Search(infoPtr->hdpaSelectionRanges, &removeselection, 0, LISTVIEW_CompareSelectionRanges, 0,0); - + if (index == -1) return; - + checkselection = DPA_GetPtr(infoPtr->hdpaSelectionRanges, index); @@ -1743,14 +1743,14 @@ static VOID LISTVIEW_RemoveSelectionRange(HWND hwnd, INT lItem, INT uItem) checkselection->upper); /* case 1: Same */ - if ((checkselection->upper == removeselection.upper) && + if ((checkselection->upper == removeselection.upper) && (checkselection->lower == removeselection.lower)) { DPA_DeletePtr(infoPtr->hdpaSelectionRanges,index); TRACE("Case 1\n"); } /* case 2: engulf */ - else if (((checkselection->upper < removeselection.upper) && + else if (((checkselection->upper < removeselection.upper) && (checkselection->lower > removeselection.lower))|| ((checkselection->upper <= removeselection.upper) && (checkselection->lower > removeselection.lower)) || @@ -1788,7 +1788,7 @@ static VOID LISTVIEW_RemoveSelectionRange(HWND hwnd, INT lItem, INT uItem) { /* bisect the range */ LISTVIEW_SELECTION *newselection; - + newselection = (LISTVIEW_SELECTION *) COMCTL32_Alloc(sizeof(LISTVIEW_SELECTION)); newselection -> lower = checkselection->lower; @@ -1804,10 +1804,10 @@ static VOID LISTVIEW_RemoveSelectionRange(HWND hwnd, INT lItem, INT uItem) /** * DESCRIPTION: * Updates the various indices after an item has been inserted or deleted. -* +* * PARAMETER(S): * [I] HWND : window handle -* [I] INT : item index +* [I] INT : item index * [I] INT : Direction of shift, +1 or -1. * * RETURN: @@ -1828,7 +1828,7 @@ static VOID LISTVIEW_ShiftIndices(HWND hwnd, INT nItem, INT direction) LISTVIEW_CompareSelectionRanges, 0,DPAS_SORTED|DPAS_INSERTAFTER); - while ((index < infoPtr->hdpaSelectionRanges->nItemCount)&&(index != -1)) + while ((index < infoPtr->hdpaSelectionRanges->nItemCount)&&(index != -1)) { checkselection = DPA_GetPtr(infoPtr->hdpaSelectionRanges,index); if ((checkselection->lower >= nItem)&& @@ -1872,10 +1872,10 @@ static VOID LISTVIEW_ShiftIndices(HWND hwnd, INT nItem, INT direction) /** * DESCRIPTION: * Adds a block of selections. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : item index + * [I] INT : item index * * RETURN: * None @@ -1906,10 +1906,10 @@ static VOID LISTVIEW_AddGroupSelection(HWND hwnd, INT nItem) /*** * DESCRIPTION: * Adds a single selection. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : item index + * [I] INT : item index * * RETURN: * None @@ -1932,13 +1932,13 @@ static VOID LISTVIEW_AddSelection(HWND hwnd, INT nItem) /*** * DESCRIPTION: * Selects or unselects an item. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : item index + * [I] INT : item index * * RETURN: - * SELECT: TRUE + * SELECT: TRUE * UNSELECT : FALSE */ static BOOL LISTVIEW_ToggleSelection(HWND hwnd, INT nItem) @@ -1970,11 +1970,11 @@ static BOOL LISTVIEW_ToggleSelection(HWND hwnd, INT nItem) /*** * DESCRIPTION: - * Selects items based on view coordinates. - * + * Selects items based on view coordinates. + * * PARAMETER(S): * [I] HWND : window handle - * [I] RECT : selection rectangle + * [I] RECT : selection rectangle * * RETURN: * None @@ -2004,13 +2004,13 @@ static VOID LISTVIEW_SetSelectionRect(HWND hwnd, RECT rcSelRect) /*** * DESCRIPTION: * Sets a single group selection. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : item index + * [I] INT : item index * * RETURN: - * None + * None */ static VOID LISTVIEW_SetGroupSelection(HWND hwnd, INT nItem) { @@ -2071,10 +2071,10 @@ static VOID LISTVIEW_SetGroupSelection(HWND hwnd, INT nItem) /*** * DESCRIPTION: * Manages the item focus. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : item index + * [I] INT : item index * * RETURN: * TRUE : focused item changed @@ -2095,7 +2095,7 @@ static BOOL LISTVIEW_SetItemFocus(HWND hwnd, INT nItem) infoPtr->nFocusedItem = -1; ZeroMemory(&lvItem, sizeof(lvItem)); lvItem.stateMask = LVIS_FOCUSED; - ListView_SetItemState(hwnd, oldFocus, &lvItem); + ListView_SetItemState(hwnd, oldFocus, &lvItem); } @@ -2106,17 +2106,17 @@ static BOOL LISTVIEW_SetItemFocus(HWND hwnd, INT nItem) infoPtr->nFocusedItem = nItem; ListView_EnsureVisible(hwnd, nItem, FALSE); } - - return bResult; + + return bResult; } /*** * DESCRIPTION: * Sets a single selection. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : item index + * [I] INT : item index * * RETURN: * None @@ -2128,7 +2128,7 @@ static VOID LISTVIEW_SetSelection(HWND hwnd, INT nItem) ZeroMemory(&lvItem, sizeof(lvItem)); lvItem.stateMask = LVIS_FOCUSED; - ListView_SetItemState(hwnd, infoPtr->nFocusedItem, &lvItem); + ListView_SetItemState(hwnd, infoPtr->nFocusedItem, &lvItem); LISTVIEW_RemoveAllSelections(hwnd); @@ -2143,10 +2143,10 @@ static VOID LISTVIEW_SetSelection(HWND hwnd, INT nItem) /*** * DESCRIPTION: * Set selection(s) with keyboard. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : item index + * [I] INT : item index * * RETURN: * SUCCESS : TRUE (needs to be repainted) @@ -2165,7 +2165,7 @@ static BOOL LISTVIEW_KeySelection(HWND hwnd, INT nItem) if (lStyle & LVS_SINGLESEL) { bResult = TRUE; - LISTVIEW_SetSelection(hwnd, nItem); + LISTVIEW_SetSelection(hwnd, nItem); ListView_EnsureVisible(hwnd, nItem, FALSE); } else @@ -2173,7 +2173,7 @@ static BOOL LISTVIEW_KeySelection(HWND hwnd, INT nItem) if (wShift) { bResult = TRUE; - LISTVIEW_SetGroupSelection(hwnd, nItem); + LISTVIEW_SetGroupSelection(hwnd, nItem); } else if (wCtrl) { @@ -2182,7 +2182,7 @@ static BOOL LISTVIEW_KeySelection(HWND hwnd, INT nItem) else { bResult = TRUE; - LISTVIEW_SetSelection(hwnd, nItem); + LISTVIEW_SetSelection(hwnd, nItem); ListView_EnsureVisible(hwnd, nItem, FALSE); } } @@ -2207,7 +2207,7 @@ static BOOL LISTVIEW_KeySelection(HWND hwnd, INT nItem) * INFO: * LVS_EX_TRACKSELECT: An item is automatically selected when the cursor remains * over the item for a certain period of time. - * + * */ static LRESULT LISTVIEW_MouseHover(HWND hwnd, WPARAM wParam, LPARAM lParam) { @@ -2241,7 +2241,7 @@ static LRESULT LISTVIEW_MouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); TRACKMOUSEEVENT trackinfo; - + /* see if we are supposed to be tracking mouse hovering */ if(infoPtr->dwExStyle & LVS_EX_TRACKSELECT) { /* fill in the trackinfo struct */ @@ -2260,14 +2260,14 @@ static LRESULT LISTVIEW_MouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam) _TrackMouseEvent(&trackinfo); } } - + return 0; } /*** * DESCRIPTION: * Selects an item based on coordinates. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] POINT : mouse click ccordinates @@ -2287,7 +2287,7 @@ static LRESULT LISTVIEW_MouseSelection(HWND hwnd, POINT pt) topindex = ListView_GetTopIndex(hwnd); if (uView == LVS_REPORT) { - bottomindex = topindex + LISTVIEW_GetCountPerColumn(hwnd) + 1; + bottomindex = topindex + LISTVIEW_GetCountPerColumn(hwnd) + 1; bottomindex = min(bottomindex,GETITEMCOUNT(infoPtr)); } else @@ -2295,7 +2295,7 @@ static LRESULT LISTVIEW_MouseSelection(HWND hwnd, POINT pt) bottomindex = GETITEMCOUNT(infoPtr); } - for (i = topindex; i < bottomindex; i++) + for (i = topindex; i < bottomindex; i++) { rcItem.left = LVIR_SELECTBOUNDS; if (LISTVIEW_GetItemRect(hwnd, i, &rcItem) == TRUE) @@ -2313,7 +2313,7 @@ static LRESULT LISTVIEW_MouseSelection(HWND hwnd, POINT pt) /*** * DESCRIPTION: * Removes a column. - * + * * PARAMETER(S): * [IO] HDPA : dynamic pointer array handle * [I] INT : column index (subitem index) @@ -2339,14 +2339,14 @@ static BOOL LISTVIEW_RemoveColumn(HDPA hdpaItems, INT nSubItem) } } } - + return bResult; } /*** * DESCRIPTION: * Removes a subitem at a given position. - * + * * PARAMETER(S): * [IO] HDPA : dynamic pointer array handle * [I] INT : subitem index @@ -2370,7 +2370,7 @@ static BOOL LISTVIEW_RemoveSubItem(HDPA hdpaSubItems, INT nSubItem) /* free string */ if (is_textW(lpSubItem->pszText)) COMCTL32_Free(lpSubItem->pszText); - + /* free item */ COMCTL32_Free(lpSubItem); @@ -2381,17 +2381,17 @@ static BOOL LISTVIEW_RemoveSubItem(HDPA hdpaSubItems, INT nSubItem) else if (lpSubItem->iSubItem > nSubItem) return TRUE; } - } - + } + return TRUE; } /*** * DESCRIPTION: * Compares the item information. - * + * * PARAMETER(S): - * [I] LISTVIEW_ITEM *: destination item + * [I] LISTVIEW_ITEM *: destination item * [I] LPLVITEM : source item * [I] isW : TRUE if lpLVItem is Unicode, FALSE it it's ANSI * @@ -2407,41 +2407,41 @@ static UINT LISTVIEW_GetItemChangesT(LISTVIEW_ITEM *lpItem, LPLVITEMW lpLVItem, { if (lpLVItem->mask & LVIF_STATE) { - if ((lpItem->state & lpLVItem->stateMask) != + if ((lpItem->state & lpLVItem->stateMask) != (lpLVItem->state & lpLVItem->stateMask)) - uChanged |= LVIF_STATE; + uChanged |= LVIF_STATE; } if (lpLVItem->mask & LVIF_IMAGE) { if (lpItem->iImage != lpLVItem->iImage) - uChanged |= LVIF_IMAGE; + uChanged |= LVIF_IMAGE; } - + if (lpLVItem->mask & LVIF_PARAM) { if (lpItem->lParam != lpLVItem->lParam) - uChanged |= LVIF_PARAM; + uChanged |= LVIF_PARAM; } - + if (lpLVItem->mask & LVIF_INDENT) { if (lpItem->iIndent != lpLVItem->iIndent) - uChanged |= LVIF_INDENT; + uChanged |= LVIF_INDENT; } - if (lpLVItem->mask & LVIF_TEXT) + if (lpLVItem->mask & LVIF_TEXT) { - if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) + if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) { if (lpItem->pszText != LPSTR_TEXTCALLBACKW) - uChanged |= LVIF_TEXT; + uChanged |= LVIF_TEXT; } else { if (lpItem->pszText == LPSTR_TEXTCALLBACKW) { - uChanged |= LVIF_TEXT; + uChanged |= LVIF_TEXT; } else { @@ -2474,18 +2474,18 @@ static UINT LISTVIEW_GetItemChangesT(LISTVIEW_ITEM *lpItem, LPLVITEMW lpLVItem, /*** * DESCRIPTION: * Initializes item attributes. - * + * * PARAMETER(S): * [I] HWND : window handle - * [O] LISTVIEW_ITEM *: destination item - * [I] LPLVITEM : source item + * [O] LISTVIEW_ITEM *: destination item + * [I] LPLVITEM : source item * [I] isW : TRUE if lpLVItem is Unicode, FALSE if it's ANSI * * RETURN: * SUCCCESS : TRUE * FAILURE : FALSE */ -static BOOL LISTVIEW_InitItemT(HWND hwnd, LISTVIEW_ITEM *lpItem, +static BOOL LISTVIEW_InitItemT(HWND hwnd, LISTVIEW_ITEM *lpItem, LPLVITEMW lpLVItem, BOOL isW) { LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); @@ -2494,35 +2494,35 @@ static BOOL LISTVIEW_InitItemT(HWND hwnd, LISTVIEW_ITEM *lpItem, if ((lpItem != NULL) && (lpLVItem != NULL)) { bResult = TRUE; - + if (lpLVItem->mask & LVIF_STATE) { lpItem->state &= ~lpLVItem->stateMask; lpItem->state |= (lpLVItem->state & lpLVItem->stateMask); } - + if (lpLVItem->mask & LVIF_IMAGE) lpItem->iImage = lpLVItem->iImage; - + if (lpLVItem->mask & LVIF_PARAM) lpItem->lParam = lpLVItem->lParam; - + if (lpLVItem->mask & LVIF_INDENT) lpItem->iIndent = lpLVItem->iIndent; - if (lpLVItem->mask & LVIF_TEXT) + if (lpLVItem->mask & LVIF_TEXT) { - if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) + if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) { if ((lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING)) return FALSE; if (is_textW(lpItem->pszText)) COMCTL32_Free(lpItem->pszText); - + lpItem->pszText = LPSTR_TEXTCALLBACKW; } - else + else bResult = textsetptrT(&lpItem->pszText, lpLVItem->pszText, isW); } } @@ -2547,15 +2547,15 @@ static BOOL LISTVIEW_InitItemT(HWND hwnd, LISTVIEW_ITEM *lpItem, * SUCCCESS : TRUE * FAILURE : FALSE */ -static BOOL LISTVIEW_InitSubItemT(HWND hwnd, LISTVIEW_SUBITEM *lpSubItem, +static BOOL LISTVIEW_InitSubItemT(HWND hwnd, LISTVIEW_SUBITEM *lpSubItem, LPLVITEMW lpLVItem, BOOL isW) { LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); BOOL bResult = FALSE; - - TRACE("(hwnd=%x, lpSubItem=%p, lpLVItem=%s, isW=%d)\n", + + TRACE("(hwnd=%x, lpSubItem=%p, lpLVItem=%s, isW=%d)\n", hwnd, lpSubItem, debuglvitem_t(lpLVItem, isW), isW); - + if ((lpSubItem != NULL) && (lpLVItem != NULL)) { if (!(lpLVItem->mask & LVIF_INDENT)) @@ -2566,20 +2566,20 @@ static BOOL LISTVIEW_InitSubItemT(HWND hwnd, LISTVIEW_SUBITEM *lpSubItem, if (lpLVItem->mask & LVIF_IMAGE) lpSubItem->iImage = lpLVItem->iImage; - - if (lpLVItem->mask & LVIF_TEXT) + + if (lpLVItem->mask & LVIF_TEXT) { - if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) + if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW) { if ((lStyle & LVS_SORTASCENDING) || (lStyle & LVS_SORTDESCENDING)) return FALSE; if (is_textW(lpSubItem->pszText)) COMCTL32_Free(lpSubItem->pszText); - + lpSubItem->pszText = LPSTR_TEXTCALLBACKW; } - else + else bResult = textsetptrT(&lpSubItem->pszText, lpLVItem->pszText, isW); } } @@ -2591,10 +2591,10 @@ static BOOL LISTVIEW_InitSubItemT(HWND hwnd, LISTVIEW_SUBITEM *lpSubItem, /*** * DESCRIPTION: * Adds a subitem at a given position (column index). - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] LPLVITEM : new subitem atttributes + * [I] LPLVITEM : new subitem atttributes * [I] isW : TRUE if lpLVItem is Unicode, FALSE if it's ANSI * * RETURN: @@ -2611,7 +2611,7 @@ static BOOL LISTVIEW_AddSubItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); TRACE("(hwnd=%x, lpLVItem=%s, isW=%d)\n", hwnd, debuglvitem_t(lpLVItem, isW), isW); - + if (lStyle & LVS_OWNERDATA) return FALSE; @@ -2626,7 +2626,7 @@ static BOOL LISTVIEW_AddSubItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) ZeroMemory(lpSubItem, sizeof(LISTVIEW_SUBITEM)); if (LISTVIEW_InitSubItemT(hwnd, lpSubItem, lpLVItem, isW)) { - nPosition = LISTVIEW_FindInsertPosition(hdpaSubItems, + nPosition = LISTVIEW_FindInsertPosition(hdpaSubItems, lpSubItem->iSubItem); nItem = DPA_InsertPtr(hdpaSubItems, nPosition, lpSubItem); if (nItem != -1) bResult = TRUE; @@ -2634,17 +2634,17 @@ static BOOL LISTVIEW_AddSubItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) } } } - - /* cleanup if unsuccessful */ + + /* cleanup if unsuccessful */ if (!bResult && lpSubItem) COMCTL32_Free(lpSubItem); - + return bResult; } /*** * DESCRIPTION: * Finds the dpa insert position (array index). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : subitem index @@ -2671,7 +2671,7 @@ static INT LISTVIEW_FindInsertPosition(HDPA hdpaSubItems, INT nSubItem) /*** * DESCRIPTION: * Retrieves a listview subitem at a given position (column index). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : subitem index @@ -2696,17 +2696,17 @@ static LISTVIEW_SUBITEM* LISTVIEW_GetSubItem(HDPA hdpaSubItems, INT nSubItem) return NULL; } } - + return NULL; } /*** * DESCRIPTION: * Sets item attributes. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] LPLVITEM : new item atttributes + * [I] LPLVITEM : new item atttributes * [I] isW : TRUE if lpLVItem is Unicode, FALSE if it's ANSI * * RETURN: @@ -2727,7 +2727,7 @@ static BOOL LISTVIEW_SetMainItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) RECT rcItem; TRACE("(hwnd=%x, lpLVItem=%s, isW=%d)\n", hwnd, debuglvitem_t(lpLVItem, isW), isW); - + if (lStyle & LVS_OWNERDATA) { if ((lpLVItem->iSubItem == 0)&&(lpLVItem->mask == LVIF_STATE)) @@ -2740,7 +2740,7 @@ static BOOL LISTVIEW_SetMainItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) itm.iItem = lpLVItem->iItem; itm.iSubItem = 0; ListView_GetItemW(hwnd, &itm); - + ZeroMemory(&nmlv, sizeof(NMLISTVIEW)); nmlv.uNewState = lpLVItem->state; @@ -2749,10 +2749,10 @@ static BOOL LISTVIEW_SetMainItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) nmlv.lParam = itm.lParam; nmlv.iItem = lpLVItem->iItem; - if ((itm.state & lpLVItem->stateMask) != + if ((itm.state & lpLVItem->stateMask) != (lpLVItem->state & lpLVItem->stateMask)) { - /* + /* * As per MSDN LVN_ITEMCHANGING notifications are _NOT_ sent * by LVS_OWERNDATA list controls */ @@ -2831,14 +2831,14 @@ static BOOL LISTVIEW_SetMainItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) /* * This is a fun hoop to jump to try to catch if * the user is calling us directly to call focus or if - * this function is being called as a result of a - * SetItemFocus call. + * this function is being called as a result of a + * SetItemFocus call. */ if (infoPtr->nFocusedItem >= 0) LISTVIEW_SetItemFocus(hwnd, lpLVItem->iItem); - } + } } - + nmlv.uChanged = uChanged; nmlv.iItem = lpLVItem->iItem; nmlv.lParam = lpItem->lParam; @@ -2865,7 +2865,7 @@ static BOOL LISTVIEW_SetMainItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) { bResult = TRUE; } - + if (uChanged) { rcItem.left = LVIR_BOUNDS; @@ -2884,10 +2884,10 @@ static BOOL LISTVIEW_SetMainItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) /*** * DESCRIPTION: * Sets subitem attributes. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] LPLVITEM : new subitem atttributes + * [I] LPLVITEM : new subitem atttributes * [I] isW : TRUE if lpLVItem is Unicode, FALSE if it's ANSI * * RETURN: @@ -2904,7 +2904,7 @@ static BOOL LISTVIEW_SetSubItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) RECT rcItem; TRACE("(hwnd=%x, lpLVItem=%s, isW=%d)\n", hwnd, debuglvitem_t(lpLVItem, isW), isW); - + if (lStyle & LVS_OWNERDATA) return FALSE; @@ -2923,11 +2923,11 @@ static BOOL LISTVIEW_SetSubItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) bResult = LISTVIEW_InitSubItemT(hwnd, lpSubItem, lpLVItem, isW); else bResult = LISTVIEW_AddSubItemT(hwnd, lpLVItem, isW); - + rcItem.left = LVIR_BOUNDS; LISTVIEW_GetItemRect(hwnd, lpLVItem->iItem, &rcItem); InvalidateRect(hwnd, &rcItem, FALSE); - } + } } } } @@ -2938,10 +2938,10 @@ static BOOL LISTVIEW_SetSubItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) /*** * DESCRIPTION: * Sets item attributes. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] LPLVITEM : new item atttributes + * [I] LPLVITEM : new item atttributes * [I] isW : TRUE if lpLVItem is Unicode, FALSE if it's ANSI * * RETURN: @@ -2952,7 +2952,7 @@ static BOOL LISTVIEW_SetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); - if (!lpLVItem || lpLVItem->iItem < 0 || + if (!lpLVItem || lpLVItem->iItem < 0 || lpLVItem->iItem>=GETITEMCOUNT(infoPtr)) return FALSE; if (lpLVItem->iSubItem == 0) @@ -2964,7 +2964,7 @@ static BOOL LISTVIEW_SetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) /*** * DESCRIPTION: * Retrieves the index of the item at coordinate (0, 0) of the client area. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -2981,7 +2981,7 @@ static INT LISTVIEW_GetTopIndex(HWND hwnd) ZeroMemory(&scrollInfo, sizeof(SCROLLINFO)); scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.fMask = SIF_POS; - + if (uView == LVS_LIST) { if ((lStyle & WS_HSCROLL) && GetScrollInfo(hwnd, SB_HORZ, &scrollInfo)) @@ -2992,14 +2992,14 @@ static INT LISTVIEW_GetTopIndex(HWND hwnd) if ((lStyle & WS_VSCROLL) && GetScrollInfo(hwnd, SB_VERT, &scrollInfo)) nItem = scrollInfo.nPos; } - + return nItem; } /*** * DESCRIPTION: * Draws a subitem. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] HDC : device context handle @@ -3010,10 +3010,10 @@ static INT LISTVIEW_GetTopIndex(HWND hwnd) * RETURN: * None */ -static VOID LISTVIEW_DrawSubItem(HWND hwnd, HDC hdc, INT nItem, INT nSubItem, +static VOID LISTVIEW_DrawSubItem(HWND hwnd, HDC hdc, INT nItem, INT nSubItem, RECT rcItem, BOOL Selected) { - LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); + LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); WCHAR szDispText[DISP_TEXT_SIZE]; LVITEMW lvItem; LVCOLUMNW lvColumn; @@ -3035,7 +3035,7 @@ static VOID LISTVIEW_DrawSubItem(HWND hwnd, HDC hdc, INT nItem, INT nSubItem, *lvItem.pszText = '\0'; LISTVIEW_GetItemW(hwnd, &lvItem, TRUE); TRACE(" lvItem=%s\n", debuglvitem_t(&lvItem, TRUE)); - + ZeroMemory(&lvColumn, sizeof(lvColumn)); lvColumn.mask = LVCF_FMT; LISTVIEW_GetColumnT(hwnd, nSubItem, &lvColumn, TRUE); @@ -3050,7 +3050,7 @@ static VOID LISTVIEW_DrawSubItem(HWND hwnd, HDC hdc, INT nItem, INT nSubItem, textLeft = rcItem.left + (rcItem.right-rcItem.left-nLabelWidth)/2; } } - + /* redraw the background of the item */ rcTemp = rcItem; @@ -3091,7 +3091,7 @@ static VOID LISTVIEW_DrawSubItem(HWND hwnd, HDC hdc, INT nItem, INT nSubItem, SetTextColor(hdc, infoPtr->clrText); } - ExtTextOutW(hdc, textLeft, rcItem.top, textoutOptions, + ExtTextOutW(hdc, textLeft, rcItem.top, textoutOptions, &rcItem, lvItem.pszText, lstrlenW(lvItem.pszText), NULL); if (Selected) @@ -3118,7 +3118,7 @@ static VOID LISTVIEW_DrawSubItem(HWND hwnd, HDC hdc, INT nItem, INT nSubItem, /*** * DESCRIPTION: * Draws an item. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] HDC : device context handle @@ -3130,7 +3130,7 @@ static VOID LISTVIEW_DrawSubItem(HWND hwnd, HDC hdc, INT nItem, INT nSubItem, */ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL FullSelect, RECT* SuggestedFocus) { - LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); + LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); WCHAR szDispText[DISP_TEXT_SIZE]; INT nLabelWidth; LVITEMW lvItem; @@ -3169,28 +3169,28 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F /* do indent */ if (lvItem.iIndent>0 && infoPtr->iconSize.cx > 0) { - rcItem.left += infoPtr->iconSize.cx * lvItem.iIndent; + rcItem.left += infoPtr->iconSize.cx * lvItem.iIndent; if (SuggestedFocus) SuggestedFocus->left += infoPtr->iconSize.cx * lvItem.iIndent; - } + } /* state icons */ if (infoPtr->himlState != NULL) { - UINT uStateImage = (lvItem.state & LVIS_STATEIMAGEMASK) >> 12; + UINT uStateImage = (lvItem.state & LVIS_STATEIMAGEMASK) >> 12; if (uStateImage > 0) { - ImageList_Draw(infoPtr->himlState, uStateImage - 1, hdc, rcItem.left, + ImageList_Draw(infoPtr->himlState, uStateImage - 1, hdc, rcItem.left, rcItem.top, ILD_NORMAL); } - - rcItem.left += infoPtr->iconSize.cx; + + rcItem.left += infoPtr->iconSize.cx; if (SuggestedFocus) SuggestedFocus->left += infoPtr->iconSize.cx; bImage = TRUE; } - + /* small icons */ if (infoPtr->himlSmall != NULL) { @@ -3198,17 +3198,17 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F (lvItem.iImage>=0)) { ImageList_SetBkColor(infoPtr->himlSmall, CLR_NONE); - ImageList_Draw(infoPtr->himlSmall, lvItem.iImage, hdc, rcItem.left, + ImageList_Draw(infoPtr->himlSmall, lvItem.iImage, hdc, rcItem.left, rcItem.top, ILD_SELECTED); } else if (lvItem.iImage>=0) { ImageList_SetBkColor(infoPtr->himlSmall, CLR_NONE); - ImageList_Draw(infoPtr->himlSmall, lvItem.iImage, hdc, rcItem.left, + ImageList_Draw(infoPtr->himlSmall, lvItem.iImage, hdc, rcItem.left, rcItem.top, ILD_NORMAL); } - - rcItem.left += infoPtr->iconSize.cx; + + rcItem.left += infoPtr->iconSize.cx; if (SuggestedFocus) SuggestedFocus->left += infoPtr->iconSize.cx; @@ -3221,13 +3221,13 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F if ((lvItem.state & LVIS_SELECTED) && (infoPtr->bFocus != FALSE)) { - /* set item colors */ + /* set item colors */ dwBkColor = SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); dwTextColor = SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); /* set raster mode */ nMixMode = SetROP2(hdc, R2_XORPEN); } - else if ((GetWindowLongW(hwnd, GWL_STYLE) & LVS_SHOWSELALWAYS) && + else if ((GetWindowLongW(hwnd, GWL_STYLE) & LVS_SHOWSELALWAYS) && (lvItem.state & LVIS_SELECTED) && (infoPtr->bFocus == FALSE)) { dwBkColor = SetBkColor(hdc, GetSysColor(COLOR_3DFACE)); @@ -3254,7 +3254,7 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F /* set raster mode */ nMixMode = SetROP2(hdc, R2_COPYPEN); } - + nLabelWidth = ListView_GetStringWidthW(hwnd, lvItem.pszText); if (rcItem.left + nLabelWidth < rcItem.right) { @@ -3263,8 +3263,8 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F if (bImage) rcItem.right += IMAGE_PADDING; } - - /* draw label */ + + /* draw label */ dwTextX = rcItem.left + 1; if (bImage) dwTextX += IMAGE_PADDING; @@ -3280,10 +3280,10 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F CopyRect(&rec,&rcItem); rec.left = rec.right; rec.right = rec.left+REPORT_MARGINX; - ExtTextOutW(hdc, rec.left , rec.top, textoutOptions, + ExtTextOutW(hdc, rec.left , rec.top, textoutOptions, &rec, NULL, 0, NULL); } - + if (!FullSelect) CopyRect(SuggestedFocus,&rcItem); @@ -3300,7 +3300,7 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F /*** * DESCRIPTION: * Draws an item when in large icon display mode. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] HDC : device context handle @@ -3314,7 +3314,7 @@ static VOID LISTVIEW_DrawItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, BOOL F static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, RECT *SuggestedFocus) { - LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); + LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' }; LVITEMW lvItem; UINT uFormat = DT_TOP | DT_CENTER | DT_WORDBREAK | DT_NOPREFIX | @@ -3344,10 +3344,10 @@ static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, else rcTemp.right+=WIDTH_PADDING; /* The comment doesn't say WIDTH_PADDING applies to large icons */ - + TRACE("background rect (%d,%d)-(%d,%d)\n", rcTemp.left, rcTemp.top, rcTemp.right, rcTemp.bottom); - + LISTVIEW_FillBackground(hwnd, hdc, &rcTemp); @@ -3357,7 +3357,7 @@ static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, * At most one item may have the focus * The application may not actually be active currently * 1. The item is not selected in any way - * 2. The cursor is flying over the icon or text and the text is being + * 2. The cursor is flying over the icon or text and the text is being * expanded because it is not fully displayed currently. * 3. The item is selected and is focussed, i.e. the user has not clicked * in the blank area of the window, and the window (or application?) @@ -3372,7 +3372,7 @@ static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, if (lvItem.state & LVIS_SELECTED) { - /* set item colors */ + /* set item colors */ SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); SetBkMode (hdc, OPAQUE); @@ -3414,7 +3414,7 @@ static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, { if (lvItem.iImage >= 0) { - ImageList_Draw (infoPtr->himlNormal, lvItem.iImage, hdc, rcItem.left, + ImageList_Draw (infoPtr->himlNormal, lvItem.iImage, hdc, rcItem.left, rcItem.top, (lvItem.state & LVIS_SELECTED) ? ILD_SELECTED : ILD_NORMAL); } @@ -3442,17 +3442,17 @@ static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, infoPtr->rcList.right, infoPtr->rcList.bottom, infoPtr->rcView.left, infoPtr->rcView.top, infoPtr->rcView.right, infoPtr->rcView.bottom); - + InflateRect(&rcItem, -(2*CAPTION_BORDER), 0); - rcItem.top += infoPtr->iconSize.cy + ICON_BOTTOM_PADDING; + rcItem.top += infoPtr->iconSize.cy + ICON_BOTTOM_PADDING; - /* draw label */ + /* draw label */ /* I am sure of most of the uFormat values. However I am not sure about * whether we need or do not need the following: * DT_EXTERNALLEADING, DT_INTERNAL, DT_CALCRECT, DT_NOFULLWIDTHCHARBREAK, - * DT_PATH_ELLIPSIS, DT_RTLREADING, + * DT_PATH_ELLIPSIS, DT_RTLREADING, * We certainly do not need * DT_BOTTOM, DT_VCENTER, DT_MODIFYSTRING, DT_LEFT, DT_RIGHT, DT_PREFIXONLY, * DT_SINGLELINE, DT_TABSTOP, DT_EXPANDTABS @@ -3481,7 +3481,7 @@ static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, FillRect(hdc, &rcItem, hBrush); DeleteObject(hBrush); } - /* else ? What if we are losing the focus? will we not get a complete + /* else ? What if we are losing the focus? will we not get a complete * background? */ DrawTextW (hdc, lvItem.pszText, -1, &rcItem, uFormat); @@ -3492,10 +3492,10 @@ static VOID LISTVIEW_DrawLargeItem(HWND hwnd, HDC hdc, INT nItem, RECT rcItem, /*** * DESCRIPTION: * Draws listview items when in report display mode. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] HDC : device context handle + * [I] HDC : device context handle * * RETURN: * None @@ -3568,13 +3568,13 @@ static VOID LISTVIEW_RefreshReport(HWND hwnd, HDC hdc, DWORD cdmode) LVITEMW item; RECT br; - TRACE("Owner Drawn\n"); + TRACE("Owner Drawn\n"); dis.CtlType = ODT_LISTVIEW; dis.CtlID = uID; dis.itemID = nItem; dis.itemAction = ODA_DRAWENTIRE; dis.itemState = 0; - + if (LISTVIEW_IsSelected(hwnd,nItem)) dis.itemState|=ODS_SELECTED; if (nItem==infoPtr->nFocusedItem) dis.itemState|=ODS_FOCUS; @@ -3583,11 +3583,11 @@ static VOID LISTVIEW_RefreshReport(HWND hwnd, HDC hdc, DWORD cdmode) Header_GetItemRect(infoPtr->hwndHeader, nColumnCount-1, &br); - dis.rcItem.left = -scrollOffset; + dis.rcItem.left = -scrollOffset; dis.rcItem.right = max(dis.rcItem.left, br.right - scrollOffset); dis.rcItem.top = nDrawPosY; dis.rcItem.bottom = dis.rcItem.top + infoPtr->nItemHeight; - + ZeroMemory(&item,sizeof(item)); item.iItem = nItem; item.mask = LVIF_PARAM; @@ -3613,7 +3613,7 @@ static VOID LISTVIEW_RefreshReport(HWND hwnd, HDC hdc, DWORD cdmode) ir.right = max(ir.left, br.right - REPORT_MARGINX); ir.top = nDrawPosY; ir.bottom = ir.top + infoPtr->nItemHeight; - + CopyRect(&SuggestedFocusRect,&ir); } @@ -3639,15 +3639,15 @@ static VOID LISTVIEW_RefreshReport(HWND hwnd, HDC hdc, DWORD cdmode) if (j == 0) { LISTVIEW_DrawItem(hwnd, hdc, nItem, rcItem, FullSelected, - &SuggestedFocusRect); + &SuggestedFocusRect); } - else + else { LISTVIEW_DrawSubItem(hwnd, hdc, nItem, j, rcItem, FullSelected); } if (cditemmode & CDRF_NOTIFYPOSTPAINT) - LISTVIEW_SendCustomDrawItemNotify(hwnd, hdc, nItem, 0, + LISTVIEW_SendCustomDrawItemNotify(hwnd, hdc, nItem, 0, CDDS_ITEMPOSTPAINT); } /* @@ -3659,8 +3659,8 @@ static VOID LISTVIEW_RefreshReport(HWND hwnd, HDC hdc, DWORD cdmode) if (FullSelected && LISTVIEW_GetItemState(hwnd,nItem,LVIS_SELECTED)) rop = SetROP2(hdc, R2_XORPEN); - Rectangle(hdc, SuggestedFocusRect.left, SuggestedFocusRect.top, - SuggestedFocusRect.right,SuggestedFocusRect.bottom); + Rectangle(hdc, SuggestedFocusRect.left, SuggestedFocusRect.top, + SuggestedFocusRect.right,SuggestedFocusRect.bottom); if (rop) SetROP2(hdc, R2_COPYPEN); @@ -3672,7 +3672,7 @@ static VOID LISTVIEW_RefreshReport(HWND hwnd, HDC hdc, DWORD cdmode) /*** * DESCRIPTION: * Retrieves the number of items that can fit vertically in the client area. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -3700,9 +3700,9 @@ static INT LISTVIEW_GetCountPerRow(HWND hwnd) /*** * DESCRIPTION: - * Retrieves the number of items that can fit horizontally in the client + * Retrieves the number of items that can fit horizontally in the client * area. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -3726,9 +3726,9 @@ static INT LISTVIEW_GetCountPerColumn(HWND hwnd) /*** * DESCRIPTION: - * Retrieves the number of columns needed to display all the items when in + * Retrieves the number of columns needed to display all the items when in * list display mode. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -3748,16 +3748,16 @@ static INT LISTVIEW_GetColumnCount(HWND hwnd) } return nColumnCount; -} - +} + /*** * DESCRIPTION: * Draws listview items when in list display mode. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] HDC : device context handle + * [I] HDC : device context handle * * RETURN: * None @@ -3810,13 +3810,13 @@ static VOID LISTVIEW_RefreshList(HWND hwnd, HDC hdc, DWORD cdmode) * Draw Focus Rect */ if (LISTVIEW_GetItemState(hwnd,nItem,LVIS_FOCUSED) && infoPtr->bFocus) - Rectangle(hdc, FocusRect.left, FocusRect.top, + Rectangle(hdc, FocusRect.left, FocusRect.top, FocusRect.right,FocusRect.bottom); if (cditemmode & CDRF_NOTIFYPOSTPAINT) - LISTVIEW_SendCustomDrawItemNotify(hwnd, hdc, nItem, 0, + LISTVIEW_SendCustomDrawItemNotify(hwnd, hdc, nItem, 0, CDDS_ITEMPOSTPAINT); - + } } } @@ -3824,10 +3824,10 @@ static VOID LISTVIEW_RefreshList(HWND hwnd, HDC hdc, DWORD cdmode) /*** * DESCRIPTION: * Draws listview items when in icon or small icon display mode. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] HDC : device context handle + * [I] HDC : device context handle * * RETURN: * None @@ -3864,7 +3864,7 @@ static VOID LISTVIEW_RefreshIcon(HWND hwnd, HDC hdc, BOOL bSmall, DWORD cdmode) LISTVIEW_GetItemPosition(hwnd, i, &ptPosition); ptPosition.x += ptOrigin.x; ptPosition.y += ptOrigin.y; - + if (ptPosition.y + infoPtr->nItemHeight > infoPtr->rcList.top) { if (ptPosition.x + infoPtr->nItemWidth > infoPtr->rcList.left) @@ -3884,16 +3884,16 @@ static VOID LISTVIEW_RefreshIcon(HWND hwnd, HDC hdc, BOOL bSmall, DWORD cdmode) /* * Draw Focus Rect */ - if (LISTVIEW_GetItemState(hwnd,i,LVIS_FOCUSED) && + if (LISTVIEW_GetItemState(hwnd,i,LVIS_FOCUSED) && infoPtr->bFocus && !IsRectEmpty(&SuggestedFocus)) - Rectangle(hdc, SuggestedFocus.left, SuggestedFocus.top, - SuggestedFocus.right,SuggestedFocus.bottom); + Rectangle(hdc, SuggestedFocus.left, SuggestedFocus.top, + SuggestedFocus.right,SuggestedFocus.bottom); } } } } if (cditemmode & CDRF_NOTIFYPOSTPAINT) - LISTVIEW_SendCustomDrawItemNotify(hwnd, hdc, i, 0, + LISTVIEW_SendCustomDrawItemNotify(hwnd, hdc, i, 0, CDDS_ITEMPOSTPAINT); } } @@ -3901,10 +3901,10 @@ static VOID LISTVIEW_RefreshIcon(HWND hwnd, HDC hdc, BOOL bSmall, DWORD cdmode) /*** * DESCRIPTION: * Draws listview items. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] HDC : device context handle + * [I] HDC : device context handle * * RETURN: * NoneX @@ -3934,10 +3934,10 @@ static VOID LISTVIEW_Refresh(HWND hwnd, HDC hdc) hOldPen = SelectObject(hdc, hPen); /* select transparent brush (for drawing the focus box) */ - SelectObject(hdc, GetStockObject(NULL_BRUSH)); + SelectObject(hdc, GetStockObject(NULL_BRUSH)); if (uView == LVS_LIST) - LISTVIEW_RefreshList(hwnd, hdc, cdmode); + LISTVIEW_RefreshList(hwnd, hdc, cdmode); else if (uView == LVS_REPORT) LISTVIEW_RefreshReport(hwnd, hdc, cdmode); else if (uView == LVS_SMALLICON) @@ -3948,10 +3948,10 @@ static VOID LISTVIEW_Refresh(HWND hwnd, HDC hdc) /* unselect objects */ SelectObject(hdc, hOldFont); SelectObject(hdc, hOldPen); - + /* delete pen */ DeleteObject(hPen); - + if (cdmode & CDRF_NOTIFYPOSTPAINT) LISTVIEW_SendCustomDrawNotify(hwnd, CDDS_POSTPAINT, hdc, rect); @@ -3962,7 +3962,7 @@ static VOID LISTVIEW_Refresh(HWND hwnd, HDC hdc) /*** * DESCRIPTION: * Calculates the approximate width and height of a given number of items. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : number of items @@ -3972,7 +3972,7 @@ static VOID LISTVIEW_Refresh(HWND hwnd, HDC hdc) * RETURN: * Returns a DWORD. The width in the low word and the height in high word. */ -static LRESULT LISTVIEW_ApproximateViewRect(HWND hwnd, INT nItemCount, +static LRESULT LISTVIEW_ApproximateViewRect(HWND hwnd, INT nItemCount, WORD wWidth, WORD wHeight) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); @@ -4002,7 +4002,7 @@ static LRESULT LISTVIEW_ApproximateViewRect(HWND hwnd, INT nItemCount, nItemCountPerColumn = wHeight / infoPtr->nItemHeight; if (nItemCountPerColumn == 0) nItemCountPerColumn = 1; - + if (nItemCount % nItemCountPerColumn != 0) nColumnCount = nItemCount / nItemCountPerColumn; else @@ -4017,19 +4017,19 @@ static LRESULT LISTVIEW_ApproximateViewRect(HWND hwnd, INT nItemCount, dwViewRect = MAKELONG(wWidth, wHeight); } else if (uView == LVS_REPORT) - FIXME("uView == LVS_REPORT: not implemented\n"); + FIXME("uView == LVS_REPORT: not implemented\n"); else if (uView == LVS_SMALLICON) - FIXME("uView == LVS_SMALLICON: not implemented\n"); + FIXME("uView == LVS_SMALLICON: not implemented\n"); else if (uView == LVS_ICON) - FIXME("uView == LVS_ICON: not implemented\n"); - + FIXME("uView == LVS_ICON: not implemented\n"); + return dwViewRect; } /*** * DESCRIPTION: * Arranges listview items in icon display mode. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : alignment code @@ -4040,7 +4040,7 @@ static LRESULT LISTVIEW_ApproximateViewRect(HWND hwnd, INT nItemCount, */ static LRESULT LISTVIEW_Arrange(HWND hwnd, INT nAlignCode) { - UINT uView = GetWindowLongW(hwnd, GWL_STYLE) & LVS_TYPEMASK; + UINT uView = GetWindowLongW(hwnd, GWL_STYLE) & LVS_TYPEMASK; BOOL bResult = FALSE; if ((uView == LVS_ICON) || (uView == LVS_SMALLICON)) @@ -4048,16 +4048,16 @@ static LRESULT LISTVIEW_Arrange(HWND hwnd, INT nAlignCode) switch (nAlignCode) { case LVA_ALIGNLEFT: - FIXME("nAlignCode=LVA_ALIGNLEFT: not implemented\n"); + FIXME("nAlignCode=LVA_ALIGNLEFT: not implemented\n"); break; case LVA_ALIGNTOP: - FIXME("nAlignCode=LVA_ALIGNTOP: not implemented\n"); + FIXME("nAlignCode=LVA_ALIGNTOP: not implemented\n"); break; case LVA_DEFAULT: - FIXME("nAlignCode=LVA_DEFAULT: not implemented\n"); + FIXME("nAlignCode=LVA_DEFAULT: not implemented\n"); break; case LVA_SNAPTOGRID: - FIXME("nAlignCode=LVA_SNAPTOGRID: not implemented\n"); + FIXME("nAlignCode=LVA_SNAPTOGRID: not implemented\n"); break; } } @@ -4071,7 +4071,7 @@ static LRESULT LISTVIEW_Arrange(HWND hwnd, INT nAlignCode) /*** * DESCRIPTION: * Removes all listview items and subitems. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -4108,9 +4108,9 @@ static LRESULT LISTVIEW_DeleteAllItems(HWND hwnd) if (GETITEMCOUNT(infoPtr) > 0) { INT i, j; - + /* send LVN_DELETEALLITEMS notification */ - /* verify if subsequent LVN_DELETEITEM notifications should be + /* verify if subsequent LVN_DELETEITEM notifications should be suppressed */ ZeroMemory(&nmlv, sizeof(NMLISTVIEW)); nmlv.iItem = -1; @@ -4127,12 +4127,12 @@ static LRESULT LISTVIEW_DeleteAllItems(HWND hwnd) if (lpSubItem != NULL) { /* free subitem string */ - if (is_textW(lpSubItem->pszText)) + if (is_textW(lpSubItem->pszText)) COMCTL32_Free(lpSubItem->pszText); - + /* free subitem */ COMCTL32_Free(lpSubItem); - } + } } lpItem = (LISTVIEW_ITEM *)DPA_GetPtr(hdpaSubItems, 0); @@ -4149,18 +4149,18 @@ static LRESULT LISTVIEW_DeleteAllItems(HWND hwnd) /* free item string */ if (is_textW(lpItem->pszText)) COMCTL32_Free(lpItem->pszText); - + /* free item */ COMCTL32_Free(lpItem); } - + DPA_Destroy(hdpaSubItems); } } /* reinitialize listview memory */ bResult = DPA_DeleteAllPtrs(infoPtr->hdpaItems); - + /* align items (set position of each item) */ if ((uView == LVS_ICON) || (uView == LVS_SMALLICON)) { @@ -4173,20 +4173,20 @@ static LRESULT LISTVIEW_DeleteAllItems(HWND hwnd) LISTVIEW_AlignTop(hwnd); } } - + LISTVIEW_UpdateScroll(hwnd); /* invalidate client area (optimization needed) */ InvalidateRect(hwnd, NULL, TRUE); } - + return bResult; } /*** * DESCRIPTION: * Removes a column from the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : column index @@ -4227,10 +4227,10 @@ static LRESULT LISTVIEW_DeleteColumn(HWND hwnd, INT nColumn) /*** * DESCRIPTION: * Removes an item from the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : item index + * [I] INT : item index * * RETURN: * SUCCESS : TRUE @@ -4251,15 +4251,15 @@ static LRESULT LISTVIEW_DeleteItem(HWND hwnd, INT nItem) LVITEMW item; TRACE("(hwnd=%x, nItem=%d)\n", hwnd, nItem); - - + + /* First, send LVN_DELETEITEM notification. */ memset(&nmlv, 0, sizeof (NMLISTVIEW)); nmlv.hdr.hwndFrom = hwnd; nmlv.hdr.idFrom = lCtrlId; nmlv.hdr.code = LVN_DELETEITEM; nmlv.iItem = nItem; - SendMessageW(GetParent(hwnd), WM_NOTIFY, (WPARAM)lCtrlId, + SendMessageW(GetParent(hwnd), WM_NOTIFY, (WPARAM)lCtrlId, (LPARAM)&nmlv); @@ -4291,23 +4291,23 @@ static LRESULT LISTVIEW_DeleteItem(HWND hwnd, INT nItem) /* free item string */ if (is_textW(lpSubItem->pszText)) COMCTL32_Free(lpSubItem->pszText); - + /* free item */ COMCTL32_Free(lpSubItem); - } + } } - + lpItem = (LISTVIEW_ITEM *)DPA_GetPtr(hdpaSubItems, 0); if (lpItem != NULL) { /* free item string */ if (is_textW(lpItem->pszText)) COMCTL32_Free(lpItem->pszText); - + /* free item */ COMCTL32_Free(lpItem); } - + bResult = DPA_Destroy(hdpaSubItems); } @@ -4327,7 +4327,7 @@ static LRESULT LISTVIEW_DeleteItem(HWND hwnd, INT nItem) /* refresh client area */ InvalidateRect(hwnd, NULL, TRUE); } - + return bResult; } @@ -4376,7 +4376,7 @@ static BOOL LISTVIEW_EndEditLabelT(HWND hwnd, LPWSTR pszText, DWORD nItem, BOOL BOOL bResult = TRUE; TRACE("(hwnd=%x, pszText=%s, nItem=%ld, isW=%d)\n", hwnd, debugstr_t(pszText, isW), nItem, isW); - + if (!(lStyle & LVS_OWNERDATA)) { if (!(hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem))) @@ -4414,7 +4414,7 @@ static BOOL LISTVIEW_EndEditLabelT(HWND hwnd, LPWSTR pszText, DWORD nItem, BOOL if(dispinfo_notifyT(hwnd, LVN_ENDLABELEDITW, &dispInfo, isW)) if (lpItem->pszText != LPSTR_TEXTCALLBACKW && !(lStyle & LVS_OWNERDATA)) bResult = textsetptrT(&lpItem->pszText, pszText, isW); - + return bResult; } @@ -4472,7 +4472,7 @@ static HWND LISTVIEW_EditLabelT(HWND hwnd, INT nItem, BOOL isW) NMLVDISPINFOW dispInfo; RECT rect; LISTVIEW_ITEM *lpItem; - HWND hedit; + HWND hedit; HINSTANCE hinst = GetWindowLongW(hwnd, GWL_HINSTANCE); LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); HDPA hdpaSubItems; @@ -4480,7 +4480,7 @@ static HWND LISTVIEW_EditLabelT(HWND hwnd, INT nItem, BOOL isW) LVITEMW lvItem; LISTVIEW_ITEM lvItemRef; LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); - + if (~GetWindowLongW(hwnd, GWL_STYLE) & LVS_EDITLABELS) return FALSE; @@ -4498,7 +4498,7 @@ static HWND LISTVIEW_EditLabelT(HWND hwnd, INT nItem, BOOL isW) if (NULL == (lpItem = (LISTVIEW_ITEM *)DPA_GetPtr(hdpaSubItems, 0))) return 0; - } + } else { LVITEMW item; @@ -4540,15 +4540,15 @@ static HWND LISTVIEW_EditLabelT(HWND hwnd, INT nItem, BOOL isW) rect.left = LVIR_LABEL; if (!LISTVIEW_GetItemRect(hwnd, nItem, &rect)) return 0; - - if (!(hedit = CreateEditLabelT(szDispText , WS_VISIBLE, - rect.left-2, rect.top-1, 0, rect.bottom - rect.top+2, hwnd, hinst, + + if (!(hedit = CreateEditLabelT(szDispText , WS_VISIBLE, + rect.left-2, rect.top-1, 0, rect.bottom - rect.top+2, hwnd, hinst, isW ? LISTVIEW_EndEditLabelW : (EditlblCallbackW)LISTVIEW_EndEditLabelA, nItem, isW))) return 0; infoPtr->hwndEdit = hedit; - SetFocus(hedit); + SetFocus(hedit); SendMessageW(hedit, EM_SETSEL, 0, -1); return hedit; @@ -4558,7 +4558,7 @@ static HWND LISTVIEW_EditLabelT(HWND hwnd, INT nItem, BOOL isW) /*** * DESCRIPTION: * Ensures the specified item is visible, scrolling into view if necessary. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : item index @@ -4603,8 +4603,8 @@ static BOOL LISTVIEW_EnsureVisible(HWND hwnd, INT nItem, BOOL bPartial) nScrollPosWidth = LISTVIEW_SCROLL_DIV_SIZE; rcItem.left += infoPtr->rcList.left; } - - /* When in LVS_REPORT view, the scroll position should + + /* When in LVS_REPORT view, the scroll position should not be updated. */ if (nScrollPosWidth != 0) { @@ -4612,7 +4612,7 @@ static BOOL LISTVIEW_EnsureVisible(HWND hwnd, INT nItem, BOOL bPartial) scrollInfo.nPos += rcItem.left / nScrollPosWidth; else scrollInfo.nPos += rcItem.left / nScrollPosWidth - 1; - + SetScrollInfo(hwnd, SB_HORZ, &scrollInfo, TRUE); } } @@ -4634,7 +4634,7 @@ static BOOL LISTVIEW_EnsureVisible(HWND hwnd, INT nItem, BOOL bPartial) nScrollPosWidth = LISTVIEW_SCROLL_DIV_SIZE; } - /* When in LVS_REPORT view, the scroll position should + /* When in LVS_REPORT view, the scroll position should not be updated. */ if (nScrollPosWidth != 0) { @@ -4647,7 +4647,7 @@ static BOOL LISTVIEW_EnsureVisible(HWND hwnd, INT nItem, BOOL bPartial) } } } - + if (rcItem.top < infoPtr->rcList.top) { /* scroll up */ @@ -4656,7 +4656,7 @@ static BOOL LISTVIEW_EnsureVisible(HWND hwnd, INT nItem, BOOL bPartial) { if (uView == LVS_REPORT) { - rcItem.top -= infoPtr->rcList.top; + rcItem.top -= infoPtr->rcList.top; nScrollPosHeight = infoPtr->nItemHeight; } else if ((uView == LVS_ICON) || (uView == LVS_SMALLICON)) @@ -4669,7 +4669,7 @@ static BOOL LISTVIEW_EnsureVisible(HWND hwnd, INT nItem, BOOL bPartial) scrollInfo.nPos += rcItem.top / nScrollPosHeight; else scrollInfo.nPos += rcItem.top / nScrollPosHeight - 1; - + SetScrollInfo(hwnd, SB_VERT, &scrollInfo, TRUE); } } @@ -4694,21 +4694,21 @@ static BOOL LISTVIEW_EnsureVisible(HWND hwnd, INT nItem, BOOL bPartial) scrollInfo.nPos += rcItem.bottom / nScrollPosHeight; else scrollInfo.nPos += rcItem.bottom / nScrollPosHeight + 1; - + SetScrollInfo(hwnd, SB_VERT, &scrollInfo, TRUE); } } } - + if(bRedraw) - InvalidateRect(hwnd,NULL,TRUE); + InvalidateRect(hwnd,NULL,TRUE); return TRUE; } /*** * DESCRIPTION: * Retrieves the nearest item, given a position and a direction. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] POINT : start position @@ -4735,7 +4735,7 @@ static INT LISTVIEW_GetNearestItem(HWND hwnd, POINT pt, UINT vkDirection) LISTVIEW_GetOrigin(hwnd, &lvIntHit.ht.pt); lvIntHit.ht.pt.x += pt.x; lvIntHit.ht.pt.y += pt.y; - + if (vkDirection == VK_DOWN) lvIntHit.ht.pt.y += infoPtr->nItemHeight; else if (vkDirection == VK_UP) @@ -4755,22 +4755,22 @@ static INT LISTVIEW_GetNearestItem(HWND hwnd, POINT pt, UINT vkDirection) } return nItem; -} +} /*** * DESCRIPTION: * Searches for an item with specific characteristics. - * + * * PARAMETER(S): * [I] hwnd : window handle * [I] nStart : base item index * [I] lpFindInfo : item information to look for - * + * * RETURN: * SUCCESS : index of item * FAILURE : -1 */ -static LRESULT LISTVIEW_FindItemW(HWND hwnd, INT nStart, +static LRESULT LISTVIEW_FindItemW(HWND hwnd, INT nStart, LPLVFINDINFOW lpFindInfo) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); @@ -4789,7 +4789,7 @@ static LRESULT LISTVIEW_FindItemW(HWND hwnd, INT nStart, { lvItem.mask |= LVIF_PARAM; } - + if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL)) { lvItem.mask |= LVIF_TEXT; @@ -4812,7 +4812,7 @@ static LRESULT LISTVIEW_FindItemW(HWND hwnd, INT nStart, { if (lpFindInfo->flags & LVFI_NEARESTXY) { - nItem = LISTVIEW_GetNearestItem(hwnd, ptItem, + nItem = LISTVIEW_GetNearestItem(hwnd, ptItem, lpFindInfo->vkDirection); if (nItem != -1) { @@ -4827,7 +4827,7 @@ static LRESULT LISTVIEW_FindItemW(HWND hwnd, INT nStart, { nItem++; } - + lvItem.iItem = nItem; lvItem.iSubItem = 0; if (LISTVIEW_GetItemW(hwnd, &lvItem, TRUE)) @@ -4845,13 +4845,13 @@ static LRESULT LISTVIEW_FindItemW(HWND hwnd, INT nStart, continue; } } - + if (lvItem.mask & LVIF_PARAM) { if (lpFindInfo->lParam != lvItem.lParam) continue; } - + return nItem; } } @@ -4865,33 +4865,33 @@ static LRESULT LISTVIEW_FindItemW(HWND hwnd, INT nStart, else { return -1; - } + } } } - return -1; + return -1; } /*** * DESCRIPTION: * Searches for an item with specific characteristics. - * + * * PARAMETER(S): * [I] hwnd : window handle * [I] nStart : base item index * [I] lpFindInfo : item information to look for - * + * * RETURN: * SUCCESS : index of item * FAILURE : -1 */ -static LRESULT LISTVIEW_FindItemA(HWND hwnd, INT nStart, +static LRESULT LISTVIEW_FindItemA(HWND hwnd, INT nStart, LPLVFINDINFOA lpFindInfo) { BOOL hasText = lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL); LVFINDINFOW fiw; LRESULT res; - + memcpy(&fiw, lpFindInfo, sizeof(fiw)); if (hasText) fiw.psz = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE); res = LISTVIEW_FindItemW(hwnd, nStart, &fiw); @@ -4902,7 +4902,7 @@ static LRESULT LISTVIEW_FindItemA(HWND hwnd, INT nStart, /*** * DESCRIPTION: * Retrieves the background color of the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -4919,7 +4919,7 @@ static LRESULT LISTVIEW_GetBkColor(HWND hwnd) /*** * DESCRIPTION: * Retrieves the background image of the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle * [O] LPLVMKBIMAGE : background image attributes @@ -4937,7 +4937,7 @@ static LRESULT LISTVIEW_GetBkColor(HWND hwnd) /*** * DESCRIPTION: * Retrieves the callback mask. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -4954,7 +4954,7 @@ static UINT LISTVIEW_GetCallbackMask(HWND hwnd) /*** * DESCRIPTION: * Retrieves column attributes. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : column index @@ -4971,16 +4971,16 @@ static LRESULT LISTVIEW_GetColumnT(HWND hwnd, INT nItem, LPLVCOLUMNW lpColumn, B LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); HDITEMW hdi; BOOL bResult = FALSE; - + if (lpColumn != NULL) { - TRACE("(hwnd=%x, col=%d, lpColumn=%s, isW=%d)\n", + TRACE("(hwnd=%x, col=%d, lpColumn=%s, isW=%d)\n", hwnd, nItem, debuglvcolumn_t(lpColumn, isW), isW); /* initialize memory */ ZeroMemory(&hdi, sizeof(hdi)); - + if (lpColumn->mask & LVCF_FMT) hdi.mask |= HDI_FORMAT; @@ -5007,7 +5007,7 @@ static LRESULT LISTVIEW_GetColumnT(HWND hwnd, INT nItem, LPLVCOLUMNW lpColumn, B if (bResult != FALSE) { - if (lpColumn->mask & LVCF_FMT) + if (lpColumn->mask & LVCF_FMT) { lpColumn->fmt = 0; @@ -5027,7 +5027,7 @@ static LRESULT LISTVIEW_GetColumnT(HWND hwnd, INT nItem, LPLVCOLUMNW lpColumn, B if (lpColumn->mask & LVCF_WIDTH) lpColumn->cx = hdi.cxy; - + if (lpColumn->mask & LVCF_IMAGE) lpColumn->iImage = hdi.iImage; @@ -5058,14 +5058,14 @@ static LRESULT LISTVIEW_GetColumnOrderArray(HWND hwnd, INT iCount, LPINT lpiArra /*** * DESCRIPTION: * Retrieves the column width. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] int : column index * * RETURN: * SUCCESS : column width - * FAILURE : zero + * FAILURE : zero */ static LRESULT LISTVIEW_GetColumnWidth(HWND hwnd, INT nColumn) { @@ -5092,10 +5092,10 @@ static LRESULT LISTVIEW_GetColumnWidth(HWND hwnd, INT nColumn) /*** * DESCRIPTION: - * In list or report display mode, retrieves the number of items that can fit - * vertically in the visible area. In icon or small icon display mode, + * In list or report display mode, retrieves the number of items that can fit + * vertically in the visible area. In icon or small icon display mode, * retrieves the total number of visible items. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -5112,7 +5112,7 @@ static LRESULT LISTVIEW_GetCountPerPage(HWND hwnd) { if (infoPtr->rcList.right > infoPtr->nItemWidth) { - nItemCount = LISTVIEW_GetCountPerRow(hwnd) * + nItemCount = LISTVIEW_GetCountPerRow(hwnd) * LISTVIEW_GetCountPerColumn(hwnd); } } @@ -5155,7 +5155,7 @@ static LRESULT LISTVIEW_GetExtendedListViewStyle(HWND hwnd) /*** * DESCRIPTION: * Retrieves the handle to the header control. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -5193,11 +5193,11 @@ static LRESULT LISTVIEW_GetHoverTime(HWND hwnd) /*** * DESCRIPTION: * Retrieves an image list handle. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : image list identifier - * + * [I] INT : image list identifier + * * RETURN: * SUCCESS : image list handle * FAILURE : NULL @@ -5207,7 +5207,7 @@ static LRESULT LISTVIEW_GetImageList(HWND hwnd, INT nImageList) LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); HIMAGELIST himl = NULL; - switch (nImageList) + switch (nImageList) { case LVSIL_NORMAL: himl = infoPtr->himlNormal; @@ -5228,17 +5228,17 @@ static LRESULT LISTVIEW_GetImageList(HWND hwnd, INT nImageList) /*** * DESCRIPTION: * Retrieves item attributes. - * + * * PARAMETER(S): * [I] hwnd : window handle * [IO] lpLVItem : item info * [I] internal : if true then we will use tricks that avoid copies * but are not compatible with the regular interface - * [I] isW : if TRUE, then lpLVItem is a LPLVITEMW, + * [I] isW : if TRUE, then lpLVItem is a LPLVITEMW, * if FALSE, the lpLVItem is a LPLVITEMA. - * + * * RETURN: - * SUCCESS : TRUE + * SUCCESS : TRUE * FAILURE : FALSE */ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, BOOL isW) @@ -5259,15 +5259,15 @@ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, B ERR("We can't have internal non-Unicode GetItem!\n"); return FALSE; } - + /* In the following: * lpLVItem describes the information requested by the user * lpItem/lpSubItem is what we have - * dispInfo is a structure we use to request the missing + * dispInfo is a structure we use to request the missing * information from the application */ - TRACE("(hwnd=%x, lpLVItem=%s, internal=%d, isW=%d)\n", + TRACE("(hwnd=%x, lpLVItem=%s, internal=%d, isW=%d)\n", hwnd, debuglvitem_t(lpLVItem, isW), internal, isW); if ((lpLVItem == NULL) || (lpLVItem->iItem < 0) || @@ -5288,7 +5288,7 @@ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, B if ((lpLVItem->mask & LVIF_STATE)&&(lpLVItem->iSubItem == 0)) { - lpLVItem->state = 0; + lpLVItem->state = 0; if (infoPtr->nFocusedItem == lpLVItem->iItem) lpLVItem->state |= LVIS_FOCUSED; if (LISTVIEW_IsSelected(hwnd,lpLVItem->iItem)) @@ -5311,9 +5311,9 @@ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, B ppszText=&lpItem->pszText; plParam=&lpItem->lParam; if ((lpLVItem->mask & LVIF_STATE) && infoPtr->uCallbackMask) - { + { dispInfo.item.mask |= LVIF_STATE; - dispInfo.item.stateMask = infoPtr->uCallbackMask; + dispInfo.item.stateMask = infoPtr->uCallbackMask; } } else @@ -5336,7 +5336,7 @@ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, B dispInfo.item.mask |= LVIF_TEXT; dispInfo.item.pszText = lpLVItem->pszText; dispInfo.item.cchTextMax = lpLVItem->cchTextMax; - if (dispInfo.item.pszText && lpLVItem->cchTextMax > 0) + if (dispInfo.item.pszText && lpLVItem->cchTextMax > 0) *dispInfo.item.pszText = '\0'; if (dispInfo.item.pszText && (*ppszText == NULL)) *dispInfo.item.pszText = '\0'; @@ -5374,14 +5374,14 @@ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, B if (dispInfo.item.mask & LVIF_TEXT) { - if ((dispInfo.item.mask & LVIF_DI_SETITEM) && *ppszText) + if ((dispInfo.item.mask & LVIF_DI_SETITEM) && *ppszText) textsetptrT(ppszText, dispInfo.item.pszText, isW); - + /* If lpLVItem->pszText==dispInfo.item.pszText a copy is unnecessary, but */ /* some apps give a new pointer in ListView_Notify so we can't be sure. */ - if (lpLVItem->pszText != dispInfo.item.pszText) + if (lpLVItem->pszText != dispInfo.item.pszText) textcpynT(lpLVItem->pszText, isW, dispInfo.item.pszText, isW, lpLVItem->cchTextMax); - + } else if (lpLVItem->mask & LVIF_TEXT) { @@ -5398,7 +5398,7 @@ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, B lpLVItem->state |= (dispInfo.item.state & dispInfo.item.stateMask); lpLVItem->state &= ~LVIS_SELECTED; - if ((dispInfo.item.stateMask & LVIS_SELECTED) && + if ((dispInfo.item.stateMask & LVIS_SELECTED) && LISTVIEW_IsSelected(hwnd,dispInfo.item.iItem)) lpLVItem->state |= LVIS_SELECTED; } @@ -5407,7 +5407,7 @@ static LRESULT LISTVIEW_GetItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL internal, B lpLVItem->state = lpItem->state & lpLVItem->stateMask; lpLVItem->state &= ~LVIS_SELECTED; - if ((lpLVItem->stateMask & LVIS_SELECTED) && + if ((lpLVItem->stateMask & LVIS_SELECTED) && LISTVIEW_IsSelected(hwnd,lpLVItem->iItem)) lpLVItem->state |= LVIS_SELECTED; } @@ -5447,10 +5447,10 @@ static LRESULT LISTVIEW_GetHotItem(HWND hwnd) /*** * DESCRIPTION: * Retrieves the number of items in the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle - * + * * RETURN: * Number of items. */ @@ -5464,7 +5464,7 @@ static LRESULT LISTVIEW_GetItemCount(HWND hwnd) /*** * DESCRIPTION: * Retrieves the rectangle enclosing the item icon and text. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : item index @@ -5486,8 +5486,8 @@ static BOOL LISTVIEW_GetItemBoundBox(HWND hwnd, INT nItem, LPRECT lpRect) INT nRow; TRACE("(hwnd=%x,nItem=%d,lpRect=%p)\n", hwnd, nItem, lpRect); - - if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr)) && + + if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr)) && (lpRect != NULL)) { if (uView == LVS_LIST) @@ -5519,7 +5519,7 @@ static BOOL LISTVIEW_GetItemBoundBox(HWND hwnd, INT nItem, LPRECT lpRect) { bResult = TRUE; lpRect->left = REPORT_MARGINX; - lpRect->top = ((nItem - ListView_GetTopIndex(hwnd)) * + lpRect->top = ((nItem - ListView_GetTopIndex(hwnd)) * infoPtr->nItemHeight) + infoPtr->rcList.top; if (!(lStyle & LVS_NOSCROLL)) @@ -5583,7 +5583,7 @@ static BOOL LISTVIEW_GetItemPosition(HWND hwnd, INT nItem, LPPOINT lpptPosition) bResult = LISTVIEW_GetItemBoundBox(hwnd, nItem, &rcBounding); lpptPosition->x = rcBounding.left; lpptPosition->y = rcBounding.top; - if (uView == LVS_ICON) + if (uView == LVS_ICON) { lpptPosition->y += ICON_TOP_PADDING; lpptPosition->x += (infoPtr->iconSpacing.cx - infoPtr->iconSize.cx) / 2; @@ -5598,7 +5598,7 @@ static BOOL LISTVIEW_GetItemPosition(HWND hwnd, INT nItem, LPPOINT lpptPosition) * Update the bounding rectangle around the text under a large icon. * This depends on whether it has the focus or not. * On entry the rectangle's top, left and right should be set. - * On return the bottom will also be set and the width may have been + * On return the bottom will also be set and the width may have been * modified. * * This appears to be weird, even in the Microsoft implementation. @@ -5615,11 +5615,11 @@ static void ListView_UpdateLargeItemLabelRect ( if (infoPtr->bFocus && infoPtr->nFocusedItem == nItem) { - /* We (aim to) display the full text. In Windows 95 it appears to + /* We (aim to) display the full text. In Windows 95 it appears to * calculate the size assuming the specified font and then it draws - * the text in that region with the specified font except scaled to + * the text in that region with the specified font except scaled to * 10 point (or the height of the system font or ...). Thus if the - * window has 24 point Helvetica the highlit rectangle will be + * window has 24 point Helvetica the highlit rectangle will be * taller than the text and if it is 7 point Helvetica then the text * will be clipped. * For now we will simply say that it is the correct size to display @@ -5646,8 +5646,8 @@ static void ListView_UpdateLargeItemLabelRect ( * 5.81?) it measures this on the basis of the selected font and then * draws it with the same font except in 10 point size. This can lead * to more or less than the two rows appearing. - * Question; are we supposed to be including DT_EXTERNALLEADING? - * Question; should the width be shrunk to the space required to + * Question; are we supposed to be including DT_EXTERNALLEADING? + * Question; should the width be shrunk to the space required to * display the two lines? */ rect->bottom = rect->top + 2 * infoPtr->ntmHeight; @@ -5660,7 +5660,7 @@ static void ListView_UpdateLargeItemLabelRect ( /*** * DESCRIPTION: * Retrieves the bounding rectangle for a listview control item. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : item index @@ -5674,7 +5674,7 @@ static void ListView_UpdateLargeItemLabelRect ( * LVIR_LABEL Returns the bounding rectangle of the item text. * LVIR_SELECTBOUNDS Returns the union of the LVIR_ICON and LVIR_LABEL * rectangles, but excludes columns in report view. - * + * * RETURN: * SUCCESS : TRUE * FAILURE : FALSE @@ -5682,7 +5682,7 @@ static void ListView_UpdateLargeItemLabelRect ( * NOTES * Note that the bounding rectangle of the label in the LVS_ICON view depends * upon whether the window has the focus currently and on whether the item - * is the one with the focus. Ensure that the control's record of which + * is the one with the focus. Ensure that the control's record of which * item has the focus agrees with the items' records. */ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) @@ -5710,19 +5710,19 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) /* do indent */ if (lvItem.iIndent>0 && infoPtr->iconSize.cx > 0) - nIndent = infoPtr->iconSize.cx * lvItem.iIndent; + nIndent = infoPtr->iconSize.cx * lvItem.iIndent; else nIndent = 0; } else nIndent = 0; - + if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr)) && (lprc != NULL)) { - switch(lprc->left) - { + switch(lprc->left) + { case LVIR_ICON: - if (!ListView_GetItemPosition(hwnd, nItem, &ptItem)) break; + if (!ListView_GetItemPosition(hwnd, nItem, &ptItem)) break; if (uView == LVS_ICON) { if (infoPtr->himlNormal != NULL) @@ -5733,7 +5733,7 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) lprc->left = ptItem.x + ptOrigin.x; lprc->top = ptItem.y + ptOrigin.y; lprc->right = lprc->left + infoPtr->iconSize.cx; - lprc->bottom = (lprc->top + infoPtr->iconSize.cy + + lprc->bottom = (lprc->top + infoPtr->iconSize.cy + ICON_BOTTOM_PADDING + ICON_TOP_PADDING); } } @@ -5749,14 +5749,14 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) if (infoPtr->himlState != NULL) lprc->left += infoPtr->iconSize.cx; - + if (infoPtr->himlSmall != NULL) lprc->right = lprc->left + infoPtr->iconSize.cx; else lprc->right = lprc->left; } } - else + else { bResult = TRUE; lprc->left = ptItem.x; @@ -5767,7 +5767,7 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) if (infoPtr->himlState != NULL) lprc->left += infoPtr->iconSize.cx; - + if (infoPtr->himlSmall != NULL) lprc->right = lprc->left + infoPtr->iconSize.cx; else @@ -5799,7 +5799,7 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) lprc->right = lprc->left + infoPtr->iconSpacing.cx - 1; ListView_UpdateLargeItemLabelRect (hwnd, infoPtr, nItem, lprc); } - } + } } } else if (uView == LVS_SMALLICON) @@ -5807,16 +5807,16 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE) { bResult = TRUE; - nLeftPos = lprc->left = ptItem.x + ptOrigin.x; + nLeftPos = lprc->left = ptItem.x + ptOrigin.x; lprc->top = ptItem.y + ptOrigin.y; lprc->bottom = lprc->top + infoPtr->nItemHeight; - + if (infoPtr->himlState != NULL) lprc->left += infoPtr->iconSize.cx; - + if (infoPtr->himlSmall != NULL) lprc->left += infoPtr->iconSize.cx; - + nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); nLabelWidth += TRAILING_PADDING; if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth) @@ -5830,8 +5830,8 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) bResult = TRUE; if (uView == LVS_REPORT) nLeftPos = lprc->left = ptItem.x + nIndent; - else - nLeftPos = lprc->left = ptItem.x; + else + nLeftPos = lprc->left = ptItem.x; lprc->top = ptItem.y; lprc->bottom = lprc->top + infoPtr->nItemHeight; @@ -5877,11 +5877,11 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) */ bResult = TRUE; icon_left = text_left = ptItem.x; - + /* Correct ptItem to icon upper-left */ icon_left += (infoPtr->nItemWidth - infoPtr->iconSize.cx)/2; ptItem.y += ICON_TOP_PADDING; - + /* Compute the label left and right */ nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); text_pos_x = infoPtr->iconSpacing.cx - 2*CAPTION_BORDER - nLabelWidth; @@ -5895,7 +5895,7 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) text_left += 1; text_right = text_left + infoPtr->iconSpacing.cx - 1; } - + /* Compute rectangle w/o the text height */ lprc->left = min(icon_left, text_left) + ptOrigin.x; lprc->right = max(icon_left + infoPtr->iconSize.cx, @@ -5904,20 +5904,20 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) lprc->bottom = lprc->top + ICON_TOP_PADDING_HITABLE + infoPtr->iconSize.cy + 1 + ICON_BOTTOM_PADDING; - + CopyRect (&label_rect, lprc); label_rect.top = lprc->bottom; ListView_UpdateLargeItemLabelRect (hwnd, infoPtr, nItem, &label_rect); UnionRect (lprc, lprc, &label_rect); } - } + } } else if (uView == LVS_SMALLICON) { if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE) { bResult = TRUE; - lprc->left = ptItem.x + ptOrigin.x; + lprc->left = ptItem.x + ptOrigin.x; lprc->right = lprc->left; lprc->top = ptItem.y + ptOrigin.y; lprc->bottom = lprc->top + infoPtr->nItemHeight; @@ -5939,7 +5939,7 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) else { bResult = TRUE; - lprc->left = ptItem.x; + lprc->left = ptItem.x; if (!(infoPtr->dwExStyle&LVS_EX_FULLROWSELECT) && uView&LVS_REPORT) lprc->left += nIndent; lprc->right = lprc->left; @@ -5971,7 +5971,7 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) } } break; - + case LVIR_SELECTBOUNDS: if (!ListView_GetItemPosition(hwnd, nItem, &ptItem)) break; if (uView == LVS_ICON) @@ -5986,25 +5986,25 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) lprc->right = lprc->left + infoPtr->iconSpacing.cx; lprc->bottom = lprc->top + infoPtr->iconSpacing.cy; } - } + } } else if (uView == LVS_SMALLICON) { if (LISTVIEW_GetOrigin(hwnd, &ptOrigin) != FALSE) { bResult = TRUE; - nLeftPos= lprc->left = ptItem.x + ptOrigin.x; + nLeftPos= lprc->left = ptItem.x + ptOrigin.x; lprc->top = ptItem.y + ptOrigin.y; lprc->bottom = lprc->top + infoPtr->nItemHeight; - + if (infoPtr->himlState != NULL) lprc->left += infoPtr->iconSize.cx; - + lprc->right = lprc->left; - + if (infoPtr->himlSmall != NULL) lprc->right += infoPtr->iconSize.cx; - + nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); nLabelWidth += TRAILING_PADDING; if (lprc->right + nLabelWidth < nLeftPos + infoPtr->nItemWidth) @@ -6017,17 +6017,17 @@ static LRESULT LISTVIEW_GetItemRect(HWND hwnd, INT nItem, LPRECT lprc) { bResult = TRUE; if (!(infoPtr->dwExStyle&LVS_EX_FULLROWSELECT) && (uView&LVS_REPORT)) - nLeftPos = lprc->left = ptItem.x + nIndent; + nLeftPos = lprc->left = ptItem.x + nIndent; else - nLeftPos = lprc->left = ptItem.x; + nLeftPos = lprc->left = ptItem.x; lprc->top = ptItem.y; lprc->bottom = lprc->top + infoPtr->nItemHeight; if (infoPtr->himlState != NULL) lprc->left += infoPtr->iconSize.cx; - + lprc->right = lprc->left; - + if (infoPtr->dwExStyle & LVS_EX_FULLROWSELECT) { RECT br; @@ -6068,7 +6068,7 @@ flags, LPRECT lprc) UINT uView = GetWindowLongW(hwnd, GWL_STYLE) & LVS_TYPEMASK; INT count; - TRACE("(hwnd=%x, nItem=%d, nSubItem=%d lprc=%p)\n", hwnd, nItem, nSubItem, + TRACE("(hwnd=%x, nItem=%d, nSubItem=%d lprc=%p)\n", hwnd, nItem, nSubItem, lprc); if (!(uView & LVS_REPORT)) @@ -6093,17 +6093,17 @@ flags, LPRECT lprc) lprc->left; } - return TRUE; + return TRUE; } /*** * DESCRIPTION: * Retrieves the width of a label. - * + * * PARAMETER(S): * [I] HWND : window handle - * + * * RETURN: * SUCCESS : string width (in pixels) * FAILURE : zero @@ -6122,18 +6122,18 @@ static INT LISTVIEW_GetLabelWidth(HWND hwnd, INT nItem) lvItem.cchTextMax = DISP_TEXT_SIZE; lvItem.pszText = szDispText; if (LISTVIEW_GetItemW(hwnd, &lvItem, TRUE)) - nLabelWidth = ListView_GetStringWidthW(hwnd, lvItem.pszText); - + nLabelWidth = ListView_GetStringWidthW(hwnd, lvItem.pszText); + return nLabelWidth; } /*** * DESCRIPTION: * Retrieves the spacing between listview control items. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] BOOL : flag for small or large icon + * [I] BOOL : flag for small or large icon * * RETURN: * Horizontal + vertical spacing @@ -6161,12 +6161,12 @@ static LRESULT LISTVIEW_GetItemSpacing(HWND hwnd, BOOL bSmall) /*** * DESCRIPTION: * Retrieves the state of a listview control item. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : item index * [I] UINT : state mask - * + * * RETURN: * State specified by the mask. */ @@ -6191,14 +6191,14 @@ static LRESULT LISTVIEW_GetItemState(HWND hwnd, INT nItem, UINT uMask) /*** * DESCRIPTION: - * Retrieves the text of a listview control item or subitem. - * + * Retrieves the text of a listview control item or subitem. + * * PARAMETER(S): * [I] hwnd : window handle * [I] nItem : item index * [IO] lpLVItem : item information * [I] isW : TRUE if lpLVItem is Unicode - * + * * RETURN: * SUCCESS : string length * FAILURE : 0 @@ -6207,7 +6207,7 @@ static LRESULT LISTVIEW_GetItemTextT(HWND hwnd, INT nItem, LPLVITEMW lpLVItem, B { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); INT nLength = 0; - + if (lpLVItem != NULL) { if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr))) @@ -6225,12 +6225,12 @@ static LRESULT LISTVIEW_GetItemTextT(HWND hwnd, INT nItem, LPLVITEMW lpLVItem, B /*** * DESCRIPTION: * Searches for an item based on properties + relationships. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : item index * [I] INT : relationship flag - * + * * RETURN: * SUCCESS : item index * FAILURE : -1 @@ -6243,17 +6243,17 @@ static LRESULT LISTVIEW_GetNextItem(HWND hwnd, INT nItem, UINT uFlags) LVFINDINFOW lvFindInfo; INT nCountPerColumn; INT i; - + if ((nItem >= -1) && (nItem < GETITEMCOUNT(infoPtr))) - { + { ZeroMemory(&lvFindInfo, sizeof(lvFindInfo)); if (uFlags & LVNI_CUT) uMask |= LVIS_CUT; - + if (uFlags & LVNI_DROPHILITED) uMask |= LVIS_DROPHILITED; - + if (uFlags & LVNI_FOCUSED) uMask |= LVIS_FOCUSED; @@ -6375,11 +6375,11 @@ static LRESULT LISTVIEW_GetNextItem(HWND hwnd, INT nItem, UINT uFlags) /*** * DESCRIPTION: * Retrieves the origin coordinates when in icon or small icon display mode. - * + * * PARAMETER(S): * [I] HWND : window handle * [O] LPPOINT : coordinate information - * + * * RETURN: * SUCCESS : TRUE * FAILURE : FALSE @@ -6389,7 +6389,7 @@ static LRESULT LISTVIEW_GetOrigin(HWND hwnd, LPPOINT lpptOrigin) LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); UINT uView = lStyle & LVS_TYPEMASK; BOOL bResult = FALSE; - + TRACE("(hwnd=%x, lpptOrigin=%p)\n", hwnd, lpptOrigin); if ((uView == LVS_SMALLICON) || (uView == LVS_ICON)) @@ -6402,8 +6402,8 @@ static LRESULT LISTVIEW_GetOrigin(HWND hwnd, LPPOINT lpptOrigin) if (lStyle & WS_HSCROLL) { scrollInfo.fMask = SIF_POS; - if (GetScrollInfo(hwnd, SB_HORZ, &scrollInfo) != FALSE) - lpptOrigin->x = -scrollInfo.nPos * LISTVIEW_SCROLL_DIV_SIZE; + if (GetScrollInfo(hwnd, SB_HORZ, &scrollInfo) != FALSE) + lpptOrigin->x = -scrollInfo.nPos * LISTVIEW_SCROLL_DIV_SIZE; } if (lStyle & WS_VSCROLL) @@ -6412,20 +6412,20 @@ static LRESULT LISTVIEW_GetOrigin(HWND hwnd, LPPOINT lpptOrigin) if (GetScrollInfo(hwnd, SB_VERT, &scrollInfo) != FALSE) lpptOrigin->y = -scrollInfo.nPos * LISTVIEW_SCROLL_DIV_SIZE; } - + bResult = TRUE; } - + return bResult; } /*** * DESCRIPTION: * Retrieves the number of items that are marked as selected. - * + * * PARAMETER(S): * [I] HWND : window handle - * + * * RETURN: * Number of items selected. */ @@ -6441,17 +6441,17 @@ static LRESULT LISTVIEW_GetSelectedCount(HWND hwnd) if (ListView_GetItemState(hwnd, i, LVIS_SELECTED) & LVIS_SELECTED) nSelectedCount++; } - + return nSelectedCount; } /*** * DESCRIPTION: * Retrieves item index that marks the start of a multiple selection. - * + * * PARAMETER(S): * [I] HWND : window handle - * + * * RETURN: * Index number or -1 if there is no selection mark. */ @@ -6466,12 +6466,12 @@ static LRESULT LISTVIEW_GetSelectionMark(HWND hwnd) /*** * DESCRIPTION: * Retrieves the width of a string. - * + * * PARAMETER(S): * [I] hwnd : window handle * [I] lpszText : text string to process * [I] isW : TRUE if lpszText is Unicode, FALSE otherwise - * + * * RETURN: * SUCCESS : string width (in pixels) * FAILURE : zero @@ -6500,10 +6500,10 @@ static LRESULT LISTVIEW_GetStringWidthT(HWND hwnd, LPCWSTR lpszText, BOOL isW) /*** * DESCRIPTION: * Retrieves the text backgound color. - * + * * PARAMETER(S): * [I] HWND : window handle - * + * * RETURN: * COLORREF associated with the the background. */ @@ -6517,10 +6517,10 @@ static LRESULT LISTVIEW_GetTextBkColor(HWND hwnd) /*** * DESCRIPTION: * Retrieves the text color. - * + * * PARAMETER(S): * [I] HWND : window handle - * + * * RETURN: * COLORREF associated with the text. */ @@ -6534,7 +6534,7 @@ static LRESULT LISTVIEW_GetTextColor(HWND hwnd) /*** * DESCRIPTION: * Determines item if a hit or closest if not - * + * * PARAMETER(S): * [I] HWND : window handle * [IO] LPLV_INTHIT : hit test information @@ -6558,7 +6558,7 @@ static INT LISTVIEW_SuperHitTestItem(HWND hwnd, LPLV_INTHIT lpInt, BOOL subitem) topindex = ListView_GetTopIndex(hwnd); if (uView == LVS_REPORT) { - bottomindex = topindex + LISTVIEW_GetCountPerColumn(hwnd) + 1; + bottomindex = topindex + LISTVIEW_GetCountPerColumn(hwnd) + 1; bottomindex = min(bottomindex,GETITEMCOUNT(infoPtr)); } else @@ -6587,7 +6587,7 @@ static INT LISTVIEW_SuperHitTestItem(HWND hwnd, LPLV_INTHIT lpInt, BOOL subitem) return i; } } - + rcItem.left = LVIR_LABEL; if (LISTVIEW_GetItemRect(hwnd, i, &rcItem)) { @@ -6599,7 +6599,7 @@ static INT LISTVIEW_SuperHitTestItem(HWND hwnd, LPLV_INTHIT lpInt, BOOL subitem) return i; } } - + lpInt->ht.flags = LVHT_ONITEMSTATEICON; lpInt->ht.iItem = i; if (subitem) lpInt->ht.iSubItem = 0; @@ -6615,7 +6615,7 @@ static INT LISTVIEW_SuperHitTestItem(HWND hwnd, LPLV_INTHIT lpInt, BOOL subitem) xterm = rcItem.left + (rcItem.right - rcItem.left)/2 - lpInt->ht.pt.x; yterm = rcItem.top + (rcItem.bottom - rcItem.top)/2 - lpInt->ht.pt.y; dist = xterm * xterm + yterm * yterm; - if (dist < lpInt->distance) + if (dist < lpInt->distance) { lpInt->distance = dist; lpInt->iDistItem = i; @@ -6623,7 +6623,7 @@ static INT LISTVIEW_SuperHitTestItem(HWND hwnd, LPLV_INTHIT lpInt, BOOL subitem) } } } - + lpInt->ht.flags = LVHT_NOWHERE; TRACE("no hit, closest item %d, distance %ld\n", lpInt->iDistItem, lpInt->distance); @@ -6660,7 +6660,7 @@ static INT LISTVIEW_HitTestItem(HWND hwnd, LPLVHITTESTINFO lpHitTestInfo, BOOL s /*** * DESCRIPTION: * Determines which listview item is located at the specified position. - * + * * PARAMETER(S): * [I] HWND : window handle * [IO} LPLVHITTESTINFO : hit test information @@ -6678,29 +6678,29 @@ static LRESULT LISTVIEW_HitTest(HWND hwnd, LPLVHITTESTINFO lpHitTestInfo) if (infoPtr->rcList.left > lpHitTestInfo->pt.x) lpHitTestInfo->flags = LVHT_TOLEFT; - else if (infoPtr->rcList.right < lpHitTestInfo->pt.x) + else if (infoPtr->rcList.right < lpHitTestInfo->pt.x) lpHitTestInfo->flags = LVHT_TORIGHT; if (infoPtr->rcList.top > lpHitTestInfo->pt.y) lpHitTestInfo->flags |= LVHT_ABOVE; - else if (infoPtr->rcList.bottom < lpHitTestInfo->pt.y) + else if (infoPtr->rcList.bottom < lpHitTestInfo->pt.y) lpHitTestInfo->flags |= LVHT_BELOW; if (lpHitTestInfo->flags == 0) { - /* NOTE (mm 20001022): We must not allow iSubItem to be touched, for + /* NOTE (mm 20001022): We must not allow iSubItem to be touched, for * an app might pass only a structure with space up to iItem! * (MS Office 97 does that for instance in the file open dialog) */ nItem = LISTVIEW_HitTestItem(hwnd, lpHitTestInfo, FALSE); } - + return nItem; } /*** * DESCRIPTION: * Inserts a new column. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : column index @@ -6710,7 +6710,7 @@ static LRESULT LISTVIEW_HitTest(HWND hwnd, LPLVHITTESTINFO lpHitTestInfo) * SUCCESS : new column index * FAILURE : -1 */ -static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, +static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, LPLVCOLUMNW lpColumn, BOOL isW) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); @@ -6719,12 +6719,12 @@ static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, TRACE("(hwnd=%x, nColumn=%d, lpColumn=%p)\n",hwnd, nColumn, lpColumn); - if (lpColumn != NULL) + if (lpColumn != NULL) { /* initialize memory */ ZeroMemory(&hdi, sizeof(hdi)); - if (lpColumn->mask & LVCF_FMT) + if (lpColumn->mask & LVCF_FMT) { /* format member is valid */ hdi.mask |= HDI_FORMAT; @@ -6749,7 +6749,7 @@ static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, hdi.fmt |= HDF_CENTER; } } - + if (lpColumn->fmt & LVCFMT_BITMAP_ON_RIGHT) { hdi.fmt |= HDF_BITMAP_ON_RIGHT; @@ -6760,7 +6760,7 @@ static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, { /* ??? */ } - + if (lpColumn->fmt & LVCFMT_IMAGE) { hdi.fmt |= HDF_IMAGE; @@ -6768,7 +6768,7 @@ static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, } } - if (lpColumn->mask & LVCF_WIDTH) + if (lpColumn->mask & LVCF_WIDTH) { hdi.mask |= HDI_WIDTH; if(lpColumn->cx == LVSCW_AUTOSIZE_USEHEADER) @@ -6777,13 +6777,13 @@ static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, HDITEMW hdit; RECT rcHeader; INT item_index; - + ZeroMemory(&hdit, sizeof(hdit)); - + /* get the width of every item except the current one */ hdit.mask = HDI_WIDTH; hdi.cxy = 0; - + for(item_index = 0; item_index < (nColumn - 1); item_index++) { Header_GetItemW(infoPtr->hwndHeader, item_index, (LPARAM)(&hdit)); hdi.cxy+=hdit.cxy; @@ -6799,22 +6799,22 @@ static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, else hdi.cxy = lpColumn->cx; } - - if (lpColumn->mask & LVCF_TEXT) + + if (lpColumn->mask & LVCF_TEXT) { hdi.mask |= HDI_TEXT | HDI_FORMAT; hdi.pszText = lpColumn->pszText; hdi.cchTextMax = textlenT(lpColumn->pszText, isW); hdi.fmt |= HDF_STRING; } - - if (lpColumn->mask & LVCF_IMAGE) + + if (lpColumn->mask & LVCF_IMAGE) { hdi.mask |= HDI_IMAGE; hdi.iImage = lpColumn->iImage; } - if (lpColumn->mask & LVCF_ORDER) + if (lpColumn->mask & LVCF_ORDER) { hdi.mask |= HDI_ORDER; hdi.iOrder = lpColumn->iOrder; @@ -6823,7 +6823,7 @@ static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, /* insert item in header control */ nNewColumn = SendMessageW(infoPtr->hwndHeader, HDM_INSERTITEMT(isW), (WPARAM)nColumn, (LPARAM)&hdi); - + /* Need to reset the item width when inserting a new column */ infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); @@ -6843,12 +6843,12 @@ static LRESULT LISTVIEW_InsertColumnT(HWND hwnd, INT nColumn, /* Platform SDK: (remarks on LVITEM: LVM_INSERTITEM will insert the new item in the proper sort postion... if: - LVS_SORTXXX must be specified, - LVS_OWNERDRAW is not set, + LVS_SORTXXX must be specified, + LVS_OWNERDRAW is not set, .pszText is not LPSTR_TEXTCALLBACK. - (LVS_SORT* flags): "For the LVS_SORTASCENDING... styles, item indices - are sorted based on item text..." + (LVS_SORT* flags): "For the LVS_SORTASCENDING... styles, item indices + are sorted based on item text..." */ static INT WINAPI LISTVIEW_InsertCompare( LPVOID first, LPVOID second, LPARAM lParam) { @@ -6863,7 +6863,7 @@ static INT WINAPI LISTVIEW_InsertCompare( LPVOID first, LPVOID second, LPARAM /*** * nESCRIPTION: * Inserts a new item in the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] LPLVITEMW : item information @@ -6883,7 +6883,7 @@ static LRESULT LISTVIEW_InsertItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) INT nItemWidth = 0; LISTVIEW_ITEM *lpItem = NULL; - TRACE("(hwnd=%x, lpLVItem=%s, isW=%d)\n", + TRACE("(hwnd=%x, lpLVItem=%s, isW=%d)\n", hwnd, debuglvitem_t(lpLVItem, isW), isW); if (lStyle & LVS_OWNERDATA) @@ -6914,14 +6914,14 @@ static LRESULT LISTVIEW_InsertItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) { /* Insert the item in the proper sort order based on the pszText member. See comments for LISTVIEW_InsertCompare() for greater detail */ - nItem = DPA_InsertPtr( infoPtr->hdpaItems, + nItem = DPA_InsertPtr( infoPtr->hdpaItems, GETITEMCOUNT( infoPtr ) + 1, hdpaSubItems ); DPA_Sort( infoPtr->hdpaItems, LISTVIEW_InsertCompare, hwnd ); nItem = DPA_GetPtrIndex( infoPtr->hdpaItems, hdpaSubItems ); } else { - nItem = DPA_InsertPtr(infoPtr->hdpaItems, lpLVItem->iItem, + nItem = DPA_InsertPtr(infoPtr->hdpaItems, lpLVItem->iItem, hdpaSubItems); } if (nItem != -1) @@ -6939,16 +6939,16 @@ static LRESULT LISTVIEW_InsertItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) else if (lpLVItem->stateMask & LVIS_FOCUSED) LISTVIEW_SetItemFocus(hwnd, nItem); } - + /* send LVN_INSERTITEM notification */ ZeroMemory(&nmlv, sizeof(NMLISTVIEW)); nmlv.iItem = nItem; nmlv.lParam = lpItem->lParam; listview_notify(hwnd, LVN_INSERTITEM, &nmlv); - + if ((uView == LVS_SMALLICON) || (uView == LVS_LIST)) { - nItemWidth = LISTVIEW_CalculateWidth(hwnd, lpLVItem->iItem); + nItemWidth = LISTVIEW_CalculateWidth(hwnd, lpLVItem->iItem); if (nItemWidth > infoPtr->nItemWidth) infoPtr->nItemWidth = nItemWidth; } @@ -6961,7 +6961,7 @@ static LRESULT LISTVIEW_InsertItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) else LISTVIEW_AlignTop(hwnd); } - + LISTVIEW_UpdateScroll(hwnd); /* refresh client area */ InvalidateRect(hwnd, NULL, FALSE); @@ -6976,14 +6976,14 @@ static LRESULT LISTVIEW_InsertItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) /* free memory if unsuccessful */ if ((nItem == -1) && (lpItem != NULL)) COMCTL32_Free(lpItem); - + return nItem; } /*** * DESCRIPTION: * Redraws a range of items. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : first item @@ -6995,7 +6995,7 @@ static LRESULT LISTVIEW_InsertItemT(HWND hwnd, LPLVITEMW lpLVItem, BOOL isW) */ static LRESULT LISTVIEW_RedrawItems(HWND hwnd, INT nFirst, INT nLast) { - LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); + LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); BOOL bResult = FALSE; RECT rcItem; INT i; @@ -7024,7 +7024,7 @@ static LRESULT LISTVIEW_RedrawItems(HWND hwnd, INT nFirst, INT nLast) /*** * DESCRIPTION: * Sets the background color. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] COLORREF : background color @@ -7041,7 +7041,7 @@ static LRESULT LISTVIEW_SetBkColor(HWND hwnd, COLORREF clrBk) infoPtr->clrBk = clrBk; InvalidateRect(hwnd, NULL, TRUE); } - + return TRUE; } @@ -7051,7 +7051,7 @@ static LRESULT LISTVIEW_SetBkColor(HWND hwnd, COLORREF clrBk) * DESCRIPTION: * Sets the callback mask. This mask will be used when the parent * window stores state information (some or all). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] UINT : state mask @@ -7072,32 +7072,32 @@ static BOOL LISTVIEW_SetCallbackMask(HWND hwnd, UINT uMask) /*** * DESCRIPTION: * Sets the attributes of a header item. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : column index * [I] LPLVCOLUMNW : column attributes - * [I] isW: if TRUE, the lpColumn is a LPLVCOLUMNW, + * [I] isW: if TRUE, the lpColumn is a LPLVCOLUMNW, * otherwise it is in fact a LPLVCOLUMNA * * RETURN: * SUCCESS : TRUE * FAILURE : FALSE */ -static LRESULT LISTVIEW_SetColumnT(HWND hwnd, INT nColumn, +static LRESULT LISTVIEW_SetColumnT(HWND hwnd, INT nColumn, LPLVCOLUMNW lpColumn, BOOL isW) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); BOOL bResult = FALSE; HDITEMW hdi, hdiget; - if ((lpColumn != NULL) && (nColumn >= 0) && + if ((lpColumn != NULL) && (nColumn >= 0) && (nColumn < Header_GetItemCount(infoPtr->hwndHeader))) { /* initialize memory */ ZeroMemory(&hdi, sizeof(hdi)); - if (lpColumn->mask & LVCF_FMT) + if (lpColumn->mask & LVCF_FMT) { /* format member is valid */ hdi.mask |= HDI_FORMAT; @@ -7122,13 +7122,13 @@ static LRESULT LISTVIEW_SetColumnT(HWND hwnd, INT nColumn, else if (lpColumn->fmt & LVCFMT_CENTER) hdi.fmt |= HDF_CENTER; } - + if (lpColumn->fmt & LVCFMT_BITMAP_ON_RIGHT) hdi.fmt |= HDF_BITMAP_ON_RIGHT; if (lpColumn->fmt & LVCFMT_COL_HAS_IMAGES) hdi.fmt |= HDF_IMAGE; - + if (lpColumn->fmt & LVCFMT_IMAGE) { hdi.fmt |= HDF_IMAGE; @@ -7136,27 +7136,27 @@ static LRESULT LISTVIEW_SetColumnT(HWND hwnd, INT nColumn, } } - if (lpColumn->mask & LVCF_WIDTH) + if (lpColumn->mask & LVCF_WIDTH) { hdi.mask |= HDI_WIDTH; hdi.cxy = lpColumn->cx; } - - if (lpColumn->mask & LVCF_TEXT) + + if (lpColumn->mask & LVCF_TEXT) { hdi.mask |= HDI_TEXT | HDI_FORMAT; hdi.pszText = lpColumn->pszText; hdi.cchTextMax = textlenT(lpColumn->pszText, isW); hdi.fmt |= HDF_STRING; } - - if (lpColumn->mask & LVCF_IMAGE) + + if (lpColumn->mask & LVCF_IMAGE) { hdi.mask |= HDI_IMAGE; hdi.iImage = lpColumn->iImage; } - if (lpColumn->mask & LVCF_ORDER) + if (lpColumn->mask & LVCF_ORDER) { hdi.mask |= HDI_ORDER; hdi.iOrder = lpColumn->iOrder; @@ -7168,7 +7168,7 @@ static LRESULT LISTVIEW_SetColumnT(HWND hwnd, INT nColumn, else bResult = Header_SetItemA(infoPtr->hwndHeader, nColumn, &hdi); } - + return bResult; } @@ -7217,7 +7217,7 @@ static LRESULT LISTVIEW_SetColumnWidth(HWND hwnd, INT iCol, INT cx) HDITEMW hdi; LRESULT lret; LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); - UINT uView = lStyle & LVS_TYPEMASK; + UINT uView = lStyle & LVS_TYPEMASK; HDC hdc; HFONT header_font; HFONT old_font; @@ -7239,16 +7239,16 @@ static LRESULT LISTVIEW_SetColumnWidth(HWND hwnd, INT iCol, INT cx) /* set column width only if in report or list mode */ if ((uView != LVS_REPORT) && (uView != LVS_LIST)) - return (FALSE); + return (FALSE); TRACE("(hwnd=%x, iCol=%d, cx=%d\n", hwnd, iCol, cx); - + /* take care of invalid cx values */ if((uView == LVS_REPORT) && (cx < -2)) cx = LVSCW_AUTOSIZE; else if (uView == LVS_LIST && (cx < 1)) return FALSE; - + /* resize all columns if in LVS_LIST mode */ if(uView == LVS_LIST) { infoPtr->nItemWidth = cx; @@ -7293,23 +7293,23 @@ static LRESULT LISTVIEW_SetColumnWidth(HWND hwnd, INT iCol, INT cx) else if(cx == LVSCW_AUTOSIZE_USEHEADER) { header_item_count = Header_GetItemCount(infoPtr->hwndHeader); - + /* if iCol is the last column make it fill the remainder of the controls width */ if(iCol == (header_item_count - 1)) { /* get the width of every item except the current one */ hdi.mask = HDI_WIDTH; cx = 0; - + for(item_index = 0; item_index < (header_item_count - 1); item_index++) { Header_GetItemW(infoPtr->hwndHeader, item_index, (LPARAM)(&hdi)); cx+=hdi.cxy; } - + /* retrieve the layout of the header */ GetWindowRect(infoPtr->hwndHeader, &rcHeader); cx = (rcHeader.right - rcHeader.left) - cx; - } + } else { /* Despite what the MS docs say, if this is not the last @@ -7318,26 +7318,26 @@ static LRESULT LISTVIEW_SetColumnWidth(HWND hwnd, INT iCol, INT cx) and items. This is different from LVSCW_AUTOSIZE in that LVSCW_AUTOSIZE ignores the header string length. */ - + /* retrieve header font */ header_font = SendMessageW(infoPtr->hwndHeader, WM_GETFONT, 0L, 0L); - + /* retrieve header text */ hdi.mask = HDI_TEXT; hdi.cchTextMax = sizeof(text_buffer)/sizeof(text_buffer[0]); - hdi.pszText = text_buffer; - + hdi.pszText = text_buffer; + Header_GetItemW(infoPtr->hwndHeader, iCol, (LPARAM)(&hdi)); - + /* determine the width of the text in the header */ hdc = GetDC(hwnd); old_font = SelectObject(hdc, header_font); /* select the font into hdc */ GetTextExtentPoint32W(hdc, text_buffer, lstrlenW(text_buffer), &size); - - SelectObject(hdc, old_font); /* restore the old font */ + + SelectObject(hdc, old_font); /* restore the old font */ ReleaseDC(hwnd, hdc); - + ZeroMemory(&lvItem, sizeof(lvItem)); lvItem.iSubItem = iCol; lvItem.mask = LVIF_TEXT; @@ -7362,13 +7362,13 @@ static LRESULT LISTVIEW_SetColumnWidth(HWND hwnd, INT iCol, INT cx) } /* call header to update the column change */ - hdi.mask = HDI_WIDTH; + hdi.mask = HDI_WIDTH; hdi.cxy = cx; lret = Header_SetItemW(infoPtr->hwndHeader, (WPARAM)iCol, (LPARAM)&hdi); - + InvalidateRect(hwnd, NULL, TRUE); /* force redraw of the listview */ - + return lret; } @@ -7473,7 +7473,7 @@ static LRESULT LISTVIEW_SetIconSpacing(HWND hwnd, DWORD spacing) if (cx) infoPtr->iconSpacing.cx = cx; - else + else { /* if 0 then compute width */ if (uView == LVS_ICON) FIXME("width computation not yet done\n"); @@ -7486,9 +7486,9 @@ static LRESULT LISTVIEW_SetIconSpacing(HWND hwnd, DWORD spacing) } if (cy) infoPtr->iconSpacing.cy = cy; - else + else { /* if 0 then compute height */ - if (uView == LVS_ICON) + if (uView == LVS_ICON) infoPtr->iconSpacing.cy = infoPtr->iconSize.cy + infoPtr->ntmHeight + ICON_BOTTOM_PADDING + ICON_TOP_PADDING + LABEL_VERT_OFFSET; /* FIXME. I don't think so; I think it is based on twice the ntmHeight */ @@ -7509,10 +7509,10 @@ static LRESULT LISTVIEW_SetIconSpacing(HWND hwnd, DWORD spacing) /*** * DESCRIPTION: * Sets image lists. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : image list type + * [I] INT : image list type * [I] HIMAGELIST : image list handle * * RETURN: @@ -7525,7 +7525,7 @@ static HIMAGELIST LISTVIEW_SetImageList(HWND hwnd, INT nType, HIMAGELIST himl) HIMAGELIST himlOld = 0; INT oldHeight; - switch (nType) + switch (nType) { case LVSIL_NORMAL: himlOld = infoPtr->himlNormal; @@ -7555,7 +7555,7 @@ static HIMAGELIST LISTVIEW_SetImageList(HWND hwnd, INT nType, HIMAGELIST himl) /*** * DESCRIPTION: * Preallocates memory (does *not* set the actual count of items !) - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : item count (projected number of items to allocate) @@ -7583,7 +7583,7 @@ static BOOL LISTVIEW_SetItemCount(HWND hwnd, INT nItems, DWORD dwFlags) (dwFlags & LVSICF_NOSCROLL) ? "LVSICF_NOSCROLL" : ""); /* - * Internally remove all the selections. + * Internally remove all the selections. */ do { @@ -7594,7 +7594,7 @@ static BOOL LISTVIEW_SetItemCount(HWND hwnd, INT nItems, DWORD dwFlags) selection->upper); } while (infoPtr->hdpaSelectionRanges->nItemCount>0); - + precount = infoPtr->hdpaItems->nItemCount; topvisible = ListView_GetTopIndex(hwnd) + LISTVIEW_GetCountPerColumn(hwnd) + 1; @@ -7607,7 +7607,7 @@ static BOOL LISTVIEW_SetItemCount(HWND hwnd, INT nItems, DWORD dwFlags) LISTVIEW_UpdateSize(hwnd); LISTVIEW_UpdateScroll(hwnd); - if (min(precount,infoPtr->hdpaItems->nItemCount)hdpaItems->nItemCount)ptPosition; - if ((nPosX == -1) && (nPosY == -1)) + if ((nPosX == -1) && (nPosY == -1)) { /* This point value seems to be an undocumented feature. The * best guess is that it means either at the origin, or at * the true beginning of the list. I will assume the origin. */ POINT pt1; - if (!LISTVIEW_GetOrigin(hwnd, &pt1)) + if (!LISTVIEW_GetOrigin(hwnd, &pt1)) { pt1.x = 0; pt1.y = 0; } nPosX = pt1.x; nPosY = pt1.y; - if (uView == LVS_ICON) + if (uView == LVS_ICON) { nPosX += (infoPtr->iconSpacing.cx - infoPtr->iconSize.cx) / 2; nPosY += ICON_TOP_PADDING; @@ -7693,17 +7693,17 @@ static BOOL LISTVIEW_SetItemPosition(HWND hwnd, INT nItem, { lpItem->ptPosition.y -= ICON_TOP_PADDING; lpItem->ptPosition.x -= (infoPtr->iconSpacing.cx - infoPtr->iconSize.cx) / 2; - if ((lpItem->ptPosition.y < 0) || (lpItem->ptPosition.x < 0)) + if ((lpItem->ptPosition.y < 0) || (lpItem->ptPosition.x < 0)) { FIXME("failed orig (%ld,%ld), intent (%ld,%ld), is (%ld, %ld), setting neg to 0\n", orig.x, orig.y, nPosX, nPosY, lpItem->ptPosition.x, lpItem->ptPosition.y); - + /* if (lpItem->ptPosition.x < 0) lpItem->ptPosition.x = 0; if (lpItem->ptPosition.y < 0) lpItem->ptPosition.y = 0; */ } - else + else { TRACE("orig (%ld,%ld), intent (%ld,%ld), is (%ld,%ld)\n", orig.x, orig.y, nPosX, nPosY, lpItem->ptPosition.x, lpItem->ptPosition.y); @@ -7720,7 +7720,7 @@ static BOOL LISTVIEW_SetItemPosition(HWND hwnd, INT nItem, /*** * DESCRIPTION: * Sets the state of one or many items. - * + * * PARAMETER(S): * [I] HWND : window handle * [I]INT : item index @@ -7736,7 +7736,7 @@ static LRESULT LISTVIEW_SetItemState(HWND hwnd, INT nItem, LPLVITEMW lpLVItem) BOOL bResult = TRUE; LVITEMW lvItem; - TRACE("(hwnd=%x, nItem=%d, lpLVItem=%s)\n", + TRACE("(hwnd=%x, nItem=%d, lpLVItem=%s)\n", hwnd, nItem, debuglvitem_t(lpLVItem, TRUE)); ZeroMemory(&lvItem, sizeof(lvItem)); @@ -7760,7 +7760,7 @@ static LRESULT LISTVIEW_SetItemState(HWND hwnd, INT nItem, LPLVITEMW lpLVItem) /*** * DESCRIPTION: * Sets the text of an item or subitem. - * + * * PARAMETER(S): * [I] hwnd : window handle * [I] nItem : item index @@ -7777,9 +7777,9 @@ static BOOL LISTVIEW_SetItemTextT(HWND hwnd, INT nItem, LPLVITEMW lpLVItem, BOOL BOOL bResult = FALSE; LVITEMW lvItem; - TRACE("(hwnd=%x, nItem=%d, lpLVItem=%s, isW=%d)\n", + TRACE("(hwnd=%x, nItem=%d, lpLVItem=%s, isW=%d)\n", hwnd, nItem, debuglvitem_t(lpLVItem, isW), isW); - + if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr))) { ZeroMemory(&lvItem, sizeof(LVITEMW)); @@ -7790,7 +7790,7 @@ static BOOL LISTVIEW_SetItemTextT(HWND hwnd, INT nItem, LPLVITEMW lpLVItem, BOOL if(isW) bResult = ListView_SetItemW(hwnd, &lvItem); else bResult = ListView_SetItemA(hwnd, &lvItem); } - + return bResult; } @@ -7820,7 +7820,7 @@ static LRESULT LISTVIEW_SetSelectionMark(HWND hwnd, INT nIndex) /*** * DESCRIPTION: * Sets the text background color. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] COLORREF : text background color @@ -7834,7 +7834,7 @@ static LRESULT LISTVIEW_SetTextBkColor(HWND hwnd, COLORREF clrTextBk) LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); TRACE("(hwnd=%x, clrTextBk=%lx)\n", hwnd, clrTextBk); - + infoPtr->clrTextBk = clrTextBk; InvalidateRect(hwnd, NULL, TRUE); @@ -7844,10 +7844,10 @@ static LRESULT LISTVIEW_SetTextBkColor(HWND hwnd, COLORREF clrTextBk) /*** * DESCRIPTION: * Sets the text foreground color. - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] COLORREF : text color + * [I] COLORREF : text color * * RETURN: * SUCCESS : TRUE @@ -7872,7 +7872,7 @@ static LRESULT LISTVIEW_SetTextColor (HWND hwnd, COLORREF clrText) /*** * DESCRIPTION: * Callback internally used by LISTVIEW_SortItems() - * + * * PARAMETER(S): * [I] LPVOID : first LISTVIEW_ITEM to compare * [I] LPVOID : second LISTVIEW_ITEM to compare @@ -7896,7 +7896,7 @@ static INT WINAPI LISTVIEW_CallBackCompare(LPVOID first, LPVOID second, LPARAM l /*** * DESCRIPTION: * Sorts the listview items. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WPARAM : application-defined value @@ -7916,11 +7916,11 @@ static LRESULT LISTVIEW_SortItems(HWND hwnd, PFNLVCOMPARE pfnCompare, LPARAM lPa int nCount, i; TRACE("(hwnd=%x, pfnCompare=%p, lParamSort=%lx)\n", hwnd, pfnCompare, lParamSort); - + if (lStyle & LVS_OWNERDATA) return FALSE; if (!infoPtr || !infoPtr->hdpaItems) return FALSE; - + nCount = GETITEMCOUNT(infoPtr); /* if there are 0 or 1 items, there is no need to sort */ if (nCount < 2) @@ -7930,9 +7930,9 @@ static LRESULT LISTVIEW_SortItems(HWND hwnd, PFNLVCOMPARE pfnCompare, LPARAM lPa infoPtr->lParamSort = lParamSort; DPA_Sort(infoPtr->hdpaItems, LISTVIEW_CallBackCompare, hwnd); - /* Adjust selections and indices so that they are the way they should - * be after the sort (otherwise, the list items move around, but - * whatever is at the item's previous original position will be + /* Adjust selections and indices so that they are the way they should + * be after the sort (otherwise, the list items move around, but + * whatever is at the item's previous original position will be * selected instead) */ selectionMarkItem=(infoPtr->nSelectionMark>=0)?DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nSelectionMark):NULL; @@ -7966,7 +7966,7 @@ static LRESULT LISTVIEW_SortItems(HWND hwnd, PFNLVCOMPARE pfnCompare, LPARAM lPa /*** * DESCRIPTION: * Updates an items or rearranges the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : item index @@ -7983,7 +7983,7 @@ static LRESULT LISTVIEW_Update(HWND hwnd, INT nItem) RECT rc; TRACE("(hwnd=%x, nItem=%d)\n", hwnd, nItem); - + if ((nItem >= 0) && (nItem < GETITEMCOUNT(infoPtr))) { bResult = TRUE; @@ -8008,7 +8008,7 @@ static LRESULT LISTVIEW_Update(HWND hwnd, INT nItem) /*** * DESCRIPTION: * Creates the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -8027,9 +8027,9 @@ static LRESULT LISTVIEW_Create(HWND hwnd, LPCREATESTRUCTW lpcs) ZeroMemory(infoPtr, sizeof(LISTVIEW_INFO)); /* determine the type of structures to use */ - infoPtr->notifyFormat = SendMessageW(GetParent(hwnd), WM_NOTIFYFORMAT, + infoPtr->notifyFormat = SendMessageW(GetParent(hwnd), WM_NOTIFYFORMAT, (WPARAM)hwnd, (LPARAM)NF_QUERY); - + /* initialize color information */ infoPtr->clrBk = GetSysColor(COLOR_WINDOW); infoPtr->clrText = GetSysColor(COLOR_WINDOWTEXT); @@ -8054,20 +8054,20 @@ static LRESULT LISTVIEW_Create(HWND hwnd, LPCREATESTRUCTW lpcs) infoPtr->hDefaultFont = CreateFontIndirectW(&logFont); infoPtr->hFont = infoPtr->hDefaultFont; LISTVIEW_SaveTextMetrics(hwnd); - + /* create header */ - infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, (LPCWSTR)NULL, - WS_CHILD | HDS_HORZ | (DWORD)((LVS_NOSORTHEADER & lpcs->style)?0:HDS_BUTTONS), - 0, 0, 0, 0, hwnd, (HMENU)0, + infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, (LPCWSTR)NULL, + WS_CHILD | HDS_HORZ | (DWORD)((LVS_NOSORTHEADER & lpcs->style)?0:HDS_BUTTONS), + 0, 0, 0, 0, hwnd, (HMENU)0, lpcs->hInstance, NULL); /* set header unicode format */ SendMessageW(infoPtr->hwndHeader, HDM_SETUNICODEFORMAT,(WPARAM)TRUE,(LPARAM)NULL); /* set header font */ - SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, + SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, (LPARAM)TRUE); - + if (uView == LVS_ICON) { infoPtr->iconSize.cx = GetSystemMetrics(SM_CXICON); @@ -8082,10 +8082,10 @@ static LRESULT LISTVIEW_Create(HWND hwnd, LPCREATESTRUCTW lpcs) else { /* set HDS_HIDDEN flag to hide the header bar */ - SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, + SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE) | HDS_HIDDEN); } - + infoPtr->iconSize.cx = GetSystemMetrics(SM_CXSMICON); infoPtr->iconSize.cy = GetSystemMetrics(SM_CYSMICON); @@ -8110,7 +8110,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, LPCREATESTRUCTW lpcs) infoPtr->nItemHeight = LISTVIEW_GetItemHeight(hwnd); /* initialize the hover time to -1(indicating the default system hover time) */ - infoPtr->dwHoverTime = -1; + infoPtr->dwHoverTime = -1; return 0; } @@ -8118,29 +8118,29 @@ static LRESULT LISTVIEW_Create(HWND hwnd, LPCREATESTRUCTW lpcs) /*** * DESCRIPTION: * Erases the background of the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WPARAM : device context handle * [I] LPARAM : not used - * + * * RETURN: * SUCCESS : TRUE * FAILURE : FALSE */ -static LRESULT LISTVIEW_EraseBackground(HWND hwnd, WPARAM wParam, +static LRESULT LISTVIEW_EraseBackground(HWND hwnd, WPARAM wParam, LPARAM lParam) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); BOOL bResult; TRACE("(hwnd=%x, wParam=%x, lParam=%lx)\n", hwnd, wParam, lParam); - - if (infoPtr->clrBk == CLR_NONE) + + if (infoPtr->clrBk == CLR_NONE) { bResult = SendMessageW(GetParent(hwnd), WM_ERASEBKGND, wParam, lParam); } - else + else { RECT rc; HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk); @@ -8160,7 +8160,7 @@ static void LISTVIEW_FillBackground(HWND hwnd, HDC hdc, LPRECT rc) TRACE("(hwnd=%x, hdc=%x, rc=%p)\n", hwnd, hdc, rc); - if (infoPtr->clrBk != CLR_NONE) + if (infoPtr->clrBk != CLR_NONE) { HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk); FillRect(hdc, rc, hBrush); @@ -8171,7 +8171,7 @@ static void LISTVIEW_FillBackground(HWND hwnd, HDC hdc, LPRECT rc) /*** * DESCRIPTION: * Retrieves the listview control font. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -8190,11 +8190,11 @@ static LRESULT LISTVIEW_GetFont(HWND hwnd) /*** * DESCRIPTION: * Performs vertical scrolling. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : scroll code - * [I] SHORT : current scroll position if scroll code is SB_THUMBPOSITION + * [I] SHORT : current scroll position if scroll code is SB_THUMBPOSITION * or SB_THUMBTRACK. * [I] HWND : scrollbar control window handle * @@ -8207,7 +8207,7 @@ static LRESULT LISTVIEW_VScroll(HWND hwnd, INT nScrollCode, SHORT nCurrentPos, LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); SCROLLINFO scrollInfo; - TRACE("(hwnd=%x, nScrollCode=%d, nCurrentPos=%d, hScrollWnd=%x)\n", + TRACE("(hwnd=%x, nScrollCode=%d, nCurrentPos=%d, hScrollWnd=%x)\n", hwnd, nScrollCode, nCurrentPos, hScrollWnd); SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0); @@ -8225,12 +8225,12 @@ static LRESULT LISTVIEW_VScroll(HWND hwnd, INT nScrollCode, SHORT nCurrentPos, if (scrollInfo.nPos > scrollInfo.nMin) scrollInfo.nPos--; break; - + case SB_LINEDOWN: if (scrollInfo.nPos < scrollInfo.nMax) scrollInfo.nPos++; break; - + case SB_PAGEUP: if (scrollInfo.nPos > scrollInfo.nMin) { @@ -8240,7 +8240,7 @@ static LRESULT LISTVIEW_VScroll(HWND hwnd, INT nScrollCode, SHORT nCurrentPos, scrollInfo.nPos = scrollInfo.nMin; } break; - + case SB_PAGEDOWN: if (scrollInfo.nPos < scrollInfo.nMax) { @@ -8280,18 +8280,18 @@ static LRESULT LISTVIEW_VScroll(HWND hwnd, INT nScrollCode, SHORT nCurrentPos, InvalidateRect(hwnd, NULL, TRUE); } } - + return 0; } /*** * DESCRIPTION: * Performs horizontal scrolling. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : scroll code - * [I] SHORT : current scroll position if scroll code is SB_THUMBPOSITION + * [I] SHORT : current scroll position if scroll code is SB_THUMBPOSITION * or SB_THUMBTRACK. * [I] HWND : scrollbar control window handle * @@ -8304,15 +8304,15 @@ static LRESULT LISTVIEW_HScroll(HWND hwnd, INT nScrollCode, SHORT nCurrentPos, LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); SCROLLINFO scrollInfo; - TRACE("(hwnd=%x, nScrollCode=%d, nCurrentPos=%d, hScrollWnd=%x)\n", + TRACE("(hwnd=%x, nScrollCode=%d, nCurrentPos=%d, hScrollWnd=%x)\n", hwnd, nScrollCode, nCurrentPos, hScrollWnd); - + SendMessageW(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0); ZeroMemory(&scrollInfo, sizeof(SCROLLINFO)); scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.fMask = SIF_PAGE | SIF_POS | SIF_RANGE; - + if (GetScrollInfo(hwnd, SB_HORZ, &scrollInfo) != FALSE) { INT nOldScrollPos = scrollInfo.nPos; @@ -8323,12 +8323,12 @@ static LRESULT LISTVIEW_HScroll(HWND hwnd, INT nScrollCode, SHORT nCurrentPos, if (scrollInfo.nPos > scrollInfo.nMin) scrollInfo.nPos--; break; - + case SB_LINERIGHT: if (scrollInfo.nPos < scrollInfo.nMax) scrollInfo.nPos++; break; - + case SB_PAGELEFT: if (scrollInfo.nPos > scrollInfo.nMin) { @@ -8338,7 +8338,7 @@ static LRESULT LISTVIEW_HScroll(HWND hwnd, INT nScrollCode, SHORT nCurrentPos, scrollInfo.nPos = scrollInfo.nMin; } break; - + case SB_PAGERIGHT: if (scrollInfo.nPos < scrollInfo.nMax) { @@ -8375,7 +8375,7 @@ static LRESULT LISTVIEW_HScroll(HWND hwnd, INT nScrollCode, SHORT nCurrentPos, InvalidateRect(hwnd, NULL, TRUE); } } - + return 0; } @@ -8428,11 +8428,11 @@ static LRESULT LISTVIEW_MouseWheel(HWND hwnd, INT wheelDelta) /*** * DESCRIPTION: - * ??? - * + * ??? + * * PARAMETER(S): * [I] HWND : window handle - * [I] INT : virtual key + * [I] INT : virtual key * [I] LONG : key data * * RETURN: @@ -8443,15 +8443,15 @@ static LRESULT LISTVIEW_KeyDown(HWND hwnd, INT nVirtualKey, LONG lKeyData) LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); UINT uView = GetWindowLongW(hwnd, GWL_STYLE) & LVS_TYPEMASK; INT nItem = -1; - NMLVKEYDOWN nmKeyDown; + NMLVKEYDOWN nmKeyDown; TRACE("(hwnd=%x, nVirtualKey=%d, lKeyData=%ld)\n", hwnd, nVirtualKey, lKeyData); /* send LVN_KEYDOWN notification */ - nmKeyDown.wVKey = nVirtualKey; + nmKeyDown.wVKey = nVirtualKey; nmKeyDown.flags = 0; notify(hwnd, LVN_KEYDOWN, &nmKeyDown.hdr); - + switch (nVirtualKey) { case VK_RETURN: @@ -8479,7 +8479,7 @@ static LRESULT LISTVIEW_KeyDown(HWND hwnd, INT nVirtualKey, LONG lKeyData) case VK_UP: nItem = ListView_GetNextItem(hwnd, infoPtr->nFocusedItem, LVNI_ABOVE); break; - + case VK_RIGHT: nItem = ListView_GetNextItem(hwnd, infoPtr->nFocusedItem, LVNI_TORIGHT); break; @@ -8492,7 +8492,7 @@ static LRESULT LISTVIEW_KeyDown(HWND hwnd, INT nVirtualKey, LONG lKeyData) if (uView == LVS_REPORT) nItem = infoPtr->nFocusedItem - LISTVIEW_GetCountPerColumn(hwnd); else - nItem = infoPtr->nFocusedItem - LISTVIEW_GetCountPerColumn(hwnd) + nItem = infoPtr->nFocusedItem - LISTVIEW_GetCountPerColumn(hwnd) * LISTVIEW_GetCountPerRow(hwnd); if(nItem < 0) nItem = 0; break; @@ -8519,7 +8519,7 @@ static LRESULT LISTVIEW_KeyDown(HWND hwnd, INT nVirtualKey, LONG lKeyData) /*** * DESCRIPTION: * Kills the focus. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -8531,7 +8531,7 @@ static LRESULT LISTVIEW_KillFocus(HWND hwnd) LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)GetWindowLongW(hwnd, 0); UINT uView = GetWindowLongW(hwnd, GWL_STYLE) & LVS_TYPEMASK; INT i,nTop,nBottom; - + TRACE("(hwnd=%x)\n", hwnd); /* send NM_KILLFOCUS notification */ @@ -8542,9 +8542,9 @@ static LRESULT LISTVIEW_KillFocus(HWND hwnd) /* NEED drawing optimization ; redraw the selected items */ if (uView & LVS_REPORT) - { + { nTop = LISTVIEW_GetTopIndex(hwnd); - nBottom = nTop + + nBottom = nTop + LISTVIEW_GetCountPerColumn(hwnd) + 1; } else @@ -8569,7 +8569,7 @@ static LRESULT LISTVIEW_KillFocus(HWND hwnd) /*** * DESCRIPTION: * Processes double click messages (left mouse button). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WORD : key flag @@ -8579,7 +8579,7 @@ static LRESULT LISTVIEW_KillFocus(HWND hwnd) * RETURN: * Zero */ -static LRESULT LISTVIEW_LButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, +static LRESULT LISTVIEW_LButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, WORD wPosY) { LVHITTESTINFO htInfo; @@ -8601,7 +8601,7 @@ static LRESULT LISTVIEW_LButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, { nmlv.iItem = -1; nmlv.iSubItem = 0; - } + } nmlv.ptAction.x = wPosX; nmlv.ptAction.y = wPosY; listview_notify(hwnd, NM_DBLCLK, &nmlv); @@ -8617,7 +8617,7 @@ static LRESULT LISTVIEW_LButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, /*** * DESCRIPTION: * Processes mouse down messages (left mouse button). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WORD : key flag @@ -8627,7 +8627,7 @@ static LRESULT LISTVIEW_LButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, * RETURN: * Zero */ -static LRESULT LISTVIEW_LButtonDown(HWND hwnd, WORD wKey, WORD wPosX, +static LRESULT LISTVIEW_LButtonDown(HWND hwnd, WORD wKey, WORD wPosX, WORD wPosY) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); @@ -8640,13 +8640,13 @@ static LRESULT LISTVIEW_LButtonDown(HWND hwnd, WORD wKey, WORD wPosX, /* send NM_RELEASEDCAPTURE notification */ hdr_notify(hwnd, NM_RELEASEDCAPTURE); - + if (infoPtr->bFocus == FALSE) SetFocus(hwnd); /* set left button down flag */ infoPtr->bLButtonDown = TRUE; - + ptPosition.x = wPosX; ptPosition.y = wPosY; nItem = LISTVIEW_MouseSelection(hwnd, ptPosition); @@ -8655,7 +8655,7 @@ static LRESULT LISTVIEW_LButtonDown(HWND hwnd, WORD wKey, WORD wPosX, if (lStyle & LVS_SINGLESEL) { if ((ListView_GetItemState(hwnd, nItem, LVIS_SELECTED) & LVIS_SELECTED) - && infoPtr->nEditLabelItem == -1) + && infoPtr->nEditLabelItem == -1) infoPtr->nEditLabelItem = nItem; else LISTVIEW_SetSelection(hwnd, nItem); @@ -8705,7 +8705,7 @@ static LRESULT LISTVIEW_LButtonDown(HWND hwnd, WORD wKey, WORD wPosX, /*** * DESCRIPTION: * Processes mouse up messages (left mouse button). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WORD : key flag @@ -8715,14 +8715,14 @@ static LRESULT LISTVIEW_LButtonDown(HWND hwnd, WORD wKey, WORD wPosX, * RETURN: * Zero */ -static LRESULT LISTVIEW_LButtonUp(HWND hwnd, WORD wKey, WORD wPosX, +static LRESULT LISTVIEW_LButtonUp(HWND hwnd, WORD wKey, WORD wPosX, WORD wPosY) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); TRACE("(hwnd=%x, key=%hu, X=%hu, Y=%hu)\n", hwnd, wKey, wPosX, wPosY); - if (infoPtr->bLButtonDown != FALSE) + if (infoPtr->bLButtonDown != FALSE) { LVHITTESTINFO lvHitTestInfo; NMLISTVIEW nmlv; @@ -8763,12 +8763,12 @@ static LRESULT LISTVIEW_LButtonUp(HWND hwnd, WORD wKey, WORD wPosX, /*** * DESCRIPTION: * Creates the listview control (called before WM_CREATE). - * + * * PARAMETER(S): * [I] HWND : window handle - * [I] WPARAM : unhandled + * [I] WPARAM : unhandled * [I] LPARAM : widow creation info - * + * * RETURN: * Zero */ @@ -8780,14 +8780,14 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, WPARAM wParam, LPARAM lParam) /* allocate memory for info structure */ infoPtr = (LISTVIEW_INFO *)COMCTL32_Alloc(sizeof(LISTVIEW_INFO)); - if (infoPtr == NULL) + if (infoPtr == NULL) { ERR("could not allocate info memory!\n"); return 0; } SetWindowLongW(hwnd, 0, (LONG)infoPtr); - if ((LISTVIEW_INFO *)GetWindowLongW(hwnd, 0) != infoPtr) + if ((LISTVIEW_INFO *)GetWindowLongW(hwnd, 0) != infoPtr) { ERR("pointer assignment error!\n"); return 0; @@ -8799,10 +8799,10 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, WPARAM wParam, LPARAM lParam) /*** * DESCRIPTION: * Destroys the listview control (called after WM_DESTROY). - * + * * PARAMETER(S): * [I] HWND : window handle - * + * * RETURN: * Zero */ @@ -8836,22 +8836,22 @@ static LRESULT LISTVIEW_NCDestroy(HWND hwnd) /*** * DESCRIPTION: * Handles notifications from children. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] INT : control identifier * [I] LPNMHDR : notification information - * + * * RETURN: * Zero */ static LRESULT LISTVIEW_Notify(HWND hwnd, INT nCtrlId, LPNMHDR lpnmh) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); - + TRACE("(hwnd=%x, nCtrlId=%d, lpnmh=%p)\n", hwnd, nCtrlId, lpnmh); - - if (lpnmh->hwndFrom == infoPtr->hwndHeader) + + if (lpnmh->hwndFrom == infoPtr->hwndHeader) { /* handle notification from header control */ if (lpnmh->code == HDN_ENDTRACKW) @@ -8890,10 +8890,10 @@ static LRESULT LISTVIEW_Notify(HWND hwnd, INT nCtrlId, LPNMHDR lpnmh) /*** * DESCRIPTION: * Determines the type of structure to use. - * + * * PARAMETER(S): * [I] HWND : window handle of the sender - * [I] HWND : listview window handle + * [I] HWND : listview window handle * [I] INT : command specifying the nature of the WM_NOTIFYFORMAT * * RETURN: @@ -8904,9 +8904,9 @@ static LRESULT LISTVIEW_NotifyFormat(HWND hwndFrom, HWND hwnd, INT nCommand) LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); TRACE("(hwndFrom=%x, hwnd=%x, nCommand=%d)\n", hwndFrom, hwnd, nCommand); - + if (nCommand == NF_REQUERY) - infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, + infoPtr->notifyFormat = SendMessageW(hwndFrom, WM_NOTIFYFORMAT, (WPARAM)hwnd, (LPARAM)NF_QUERY); return 0; } @@ -8914,7 +8914,7 @@ static LRESULT LISTVIEW_NotifyFormat(HWND hwndFrom, HWND hwnd, INT nCommand) /*** * DESCRIPTION: * Paints/Repaints the listview control. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] HDC : device context handle @@ -8945,7 +8945,7 @@ static LRESULT LISTVIEW_Paint(HWND hwnd, HDC hdc) /*** * DESCRIPTION: * Processes double click messages (right mouse button). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WORD : key flag @@ -8955,12 +8955,12 @@ static LRESULT LISTVIEW_Paint(HWND hwnd, HDC hdc) * RETURN: * Zero */ -static LRESULT LISTVIEW_RButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, +static LRESULT LISTVIEW_RButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, WORD wPosY) { TRACE("(hwnd=%x,key=%hu,X=%hu,Y=%hu)\n", hwnd, wKey, wPosX, wPosY); - /* send NM_RELEASEDCAPTURE notification */ + /* send NM_RELEASEDCAPTURE notification */ hdr_notify(hwnd, NM_RELEASEDCAPTURE); /* send NM_RDBLCLK notification */ @@ -8972,7 +8972,7 @@ static LRESULT LISTVIEW_RButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, /*** * DESCRIPTION: * Processes mouse down messages (right mouse button). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WORD : key flag @@ -8982,7 +8982,7 @@ static LRESULT LISTVIEW_RButtonDblClk(HWND hwnd, WORD wKey, WORD wPosX, * RETURN: * Zero */ -static LRESULT LISTVIEW_RButtonDown(HWND hwnd, WORD wKey, WORD wPosX, +static LRESULT LISTVIEW_RButtonDown(HWND hwnd, WORD wKey, WORD wPosX, WORD wPosY) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); @@ -8995,7 +8995,7 @@ static LRESULT LISTVIEW_RButtonDown(HWND hwnd, WORD wKey, WORD wPosX, /* send NM_RELEASEDCAPTURE notification */ hdr_notify(hwnd, NM_RELEASEDCAPTURE); - + /* make sure the listview control window has the focus */ if (infoPtr->bFocus == FALSE) SetFocus(hwnd); @@ -9037,14 +9037,14 @@ static LRESULT LISTVIEW_RButtonDown(HWND hwnd, WORD wKey, WORD wPosX, nmlv.ptAction.x = wPosX; nmlv.ptAction.y = wPosY; listview_notify(hwnd, NM_RCLICK, &nmlv); - + return 0; } /*** * DESCRIPTION: * Processes mouse up messages (right mouse button). - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WORD : key flag @@ -9054,14 +9054,14 @@ static LRESULT LISTVIEW_RButtonDown(HWND hwnd, WORD wKey, WORD wPosX, * RETURN: * Zero */ -static LRESULT LISTVIEW_RButtonUp(HWND hwnd, WORD wKey, WORD wPosX, +static LRESULT LISTVIEW_RButtonUp(HWND hwnd, WORD wKey, WORD wPosX, WORD wPosY) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); TRACE("(hwnd=%x,key=%hu,X=%hu,Y=%hu)\n", hwnd, wKey, wPosX, wPosY); - if (infoPtr->bRButtonDown) + if (infoPtr->bRButtonDown) { POINT pt; @@ -9070,21 +9070,21 @@ static LRESULT LISTVIEW_RButtonUp(HWND hwnd, WORD wKey, WORD wPosX, /* set button flag */ infoPtr->bRButtonDown = FALSE; - + /* Change to screen coordinate for WM_CONTEXTMENU */ ClientToScreen(hwnd, &pt); - + /* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */ SendMessageW( hwnd, WM_CONTEXTMENU, (WPARAM) hwnd, MAKELPARAM(pt.x, pt.y)); } - + return 0; } /*** * DESCRIPTION: - * Sets the focus. - * + * Sets the focus. + * * PARAMETER(S): * [I] HWND : window handle * [I] HWND : window handle of previously focused window @@ -9111,8 +9111,8 @@ static LRESULT LISTVIEW_SetFocus(HWND hwnd, HWND hwndLoseFocus) /*** * DESCRIPTION: - * Sets the font. - * + * Sets the font. + * * PARAMETER(S): * [I] HWND : window handle * [I] HFONT : font handle @@ -9134,13 +9134,13 @@ static LRESULT LISTVIEW_SetFont(HWND hwnd, HFONT hFont, WORD fRedraw) if (uView == LVS_REPORT) { /* set header font */ - SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, + SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(fRedraw, 0)); } /* invalidate listview control client area */ InvalidateRect(hwnd, NULL, TRUE); - + if (fRedraw != FALSE) UpdateWindow(hwnd); @@ -9149,9 +9149,9 @@ static LRESULT LISTVIEW_SetFont(HWND hwnd, HFONT hFont, WORD fRedraw) /*** * DESCRIPTION: - * Message handling for WM_SETREDRAW. + * Message handling for WM_SETREDRAW. * For the Listview, it invalidates the entire window (the doc specifies otherwise) - * + * * PARAMETER(S): * [I] HWND : window handle * [I] bRedraw: state of redraw flag @@ -9163,7 +9163,7 @@ static LRESULT LISTVIEW_SetRedraw(HWND hwnd, BOOL bRedraw) { LRESULT lResult = DefWindowProcW(hwnd, WM_SETREDRAW, bRedraw, 0); if(bRedraw) - RedrawWindow(hwnd, NULL, 0, + RedrawWindow(hwnd, NULL, 0, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ALLCHILDREN | RDW_ERASENOW); return lResult; } @@ -9172,7 +9172,7 @@ static LRESULT LISTVIEW_SetRedraw(HWND hwnd, BOOL bRedraw) * DESCRIPTION: * Resizes the listview control. This function processes WM_SIZE * messages. At this time, the width and height are not used. - * + * * PARAMETER(S): * [I] HWND : window handle * [I] WORD : new width @@ -9183,7 +9183,7 @@ static LRESULT LISTVIEW_SetRedraw(HWND hwnd, BOOL bRedraw) */ static LRESULT LISTVIEW_Size(HWND hwnd, int Width, int Height) { - LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); + LONG lStyle = GetWindowLongW(hwnd, GWL_STYLE); UINT uView = lStyle & LVS_TYPEMASK; TRACE("(hwnd=%x, width=%d, height=%d)\n", hwnd, Width, Height); @@ -9199,7 +9199,7 @@ static LRESULT LISTVIEW_Size(HWND hwnd, int Width, int Height) } LISTVIEW_UpdateScroll(hwnd); - + /* invalidate client area + erase background */ InvalidateRect(hwnd, NULL, TRUE); } @@ -9210,7 +9210,7 @@ static LRESULT LISTVIEW_Size(HWND hwnd, int Width, int Height) /*** * DESCRIPTION: * Sets the size information. - * + * * PARAMETER(S): * [I] HWND : window handle * @@ -9225,16 +9225,16 @@ static BOOL LISTVIEW_UpdateSize(HWND hwnd) UINT uView = lStyle & LVS_TYPEMASK; RECT rcList; RECT rcOld; - + TRACE("(hwnd=%x)\n", hwnd); - + GetClientRect(hwnd, &rcList); CopyRect(&rcOld,&(infoPtr->rcList)); infoPtr->rcList.left = 0; infoPtr->rcList.right = max(rcList.right - rcList.left, 1); infoPtr->rcList.top = 0; infoPtr->rcList.bottom = max(rcList.bottom - rcList.top, 1); - + if (uView == LVS_LIST) { if (lStyle & WS_HSCROLL) @@ -9263,8 +9263,8 @@ static BOOL LISTVIEW_UpdateSize(HWND hwnd) /*** * DESCRIPTION: - * Processes WM_STYLECHANGED messages. - * + * Processes WM_STYLECHANGED messages. + * * PARAMETER(S): * [I] HWND : window handle * [I] WPARAM : window style type (normal or extended) @@ -9273,7 +9273,7 @@ static BOOL LISTVIEW_UpdateSize(HWND hwnd) * RETURN: * Zero */ -static INT LISTVIEW_StyleChanged(HWND hwnd, WPARAM wStyleType, +static INT LISTVIEW_StyleChanged(HWND hwnd, WPARAM wStyleType, LPSTYLESTRUCT lpss) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); @@ -9281,22 +9281,22 @@ static INT LISTVIEW_StyleChanged(HWND hwnd, WPARAM wStyleType, UINT uOldView = lpss->styleOld & LVS_TYPEMASK; RECT rcList = infoPtr->rcList; - TRACE("(hwnd=%x, styletype=%x, stylestruct=%p)\n", + TRACE("(hwnd=%x, styletype=%x, stylestruct=%p)\n", hwnd, wStyleType, lpss); if (wStyleType == GWL_STYLE) { if (uOldView == LVS_REPORT) ShowWindow(infoPtr->hwndHeader, SW_HIDE); - + if (((lpss->styleOld & WS_HSCROLL) != 0)&& ((lpss->styleNew & WS_HSCROLL) == 0)) ShowScrollBar(hwnd, SB_HORZ, FALSE); - + if (((lpss->styleOld & WS_VSCROLL) != 0)&& ((lpss->styleNew & WS_VSCROLL) == 0)) ShowScrollBar(hwnd, SB_VERT, FALSE); - + if (uNewView == LVS_ICON) { infoPtr->iconSize.cx = GetSystemMetrics(SM_CXICON); @@ -9316,11 +9316,11 @@ static INT LISTVIEW_StyleChanged(HWND hwnd, WPARAM wStyleType, hl.prc = &rcList; hl.pwpos = ℘ Header_Layout(infoPtr->hwndHeader, &hl); - SetWindowPos(infoPtr->hwndHeader, hwnd, wp.x, wp.y, wp.cx, wp.cy, + SetWindowPos(infoPtr->hwndHeader, hwnd, wp.x, wp.y, wp.cx, wp.cy, wp.flags); if (!(LVS_NOCOLUMNHEADER & lpss->styleNew)) ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL); - + infoPtr->iconSize.cx = GetSystemMetrics(SM_CXSMICON); infoPtr->iconSize.cy = GetSystemMetrics(SM_CYSMICON); infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); @@ -9350,7 +9350,7 @@ static INT LISTVIEW_StyleChanged(HWND hwnd, WPARAM wStyleType, /* add scrollbars if needed */ LISTVIEW_UpdateScroll(hwnd); - + /* invalidate client area + erase background */ InvalidateRect(hwnd, NULL, TRUE); @@ -9358,7 +9358,7 @@ static INT LISTVIEW_StyleChanged(HWND hwnd, WPARAM wStyleType, LISTVIEW_UnsupportedStyles(lpss->styleNew); } - /* If they change the view and we have an active edit control + /* If they change the view and we have an active edit control we will need to kill the control since the redraw will misplace the edit control. */ @@ -9385,10 +9385,10 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, return DefWindowProcW( hwnd, uMsg, wParam, lParam ); switch (uMsg) { - case LVM_APPROXIMATEVIEWRECT: - return LISTVIEW_ApproximateViewRect(hwnd, (INT)wParam, + case LVM_APPROXIMATEVIEWRECT: + return LISTVIEW_ApproximateViewRect(hwnd, (INT)wParam, LOWORD(lParam), HIWORD(lParam)); - case LVM_ARRANGE: + case LVM_ARRANGE: return LISTVIEW_Arrange(hwnd, (INT)wParam); /* case LVM_CREATEDRAGIMAGE: */ @@ -9404,7 +9404,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case LVM_EDITLABELW: return LISTVIEW_EditLabelT(hwnd, (INT)wParam, TRUE); - + case LVM_EDITLABELA: return LISTVIEW_EditLabelT(hwnd, (INT)wParam, FALSE); @@ -9479,15 +9479,15 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case LVM_GETITEMPOSITION: return LISTVIEW_GetItemPosition(hwnd, (INT)wParam, (LPPOINT)lParam); - case LVM_GETITEMRECT: + case LVM_GETITEMRECT: return LISTVIEW_GetItemRect(hwnd, (INT)wParam, (LPRECT)lParam); - case LVM_GETITEMSPACING: + case LVM_GETITEMSPACING: return LISTVIEW_GetItemSpacing(hwnd, (BOOL)wParam); - case LVM_GETITEMSTATE: + case LVM_GETITEMSTATE: return LISTVIEW_GetItemState(hwnd, (INT)wParam, (UINT)lParam); - + case LVM_GETITEMTEXTA: return LISTVIEW_GetItemTextT(hwnd, (INT)wParam, (LPLVITEMW)lParam, FALSE); @@ -9507,7 +9507,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case LVM_GETSELECTEDCOUNT: return LISTVIEW_GetSelectedCount(hwnd); - case LVM_GETSELECTIONMARK: + case LVM_GETSELECTIONMARK: return LISTVIEW_GetSelectionMark(hwnd); case LVM_GETSTRINGWIDTHA: @@ -9515,7 +9515,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case LVM_GETSTRINGWIDTHW: return LISTVIEW_GetStringWidthT(hwnd, (LPCWSTR)lParam, TRUE); - + case LVM_GETSUBITEMRECT: return LISTVIEW_GetSubItemRect(hwnd, (UINT)wParam, ((LPRECT)lParam)->top, ((LPRECT)lParam)->left, (LPRECT)lParam); @@ -9598,7 +9598,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case LVM_SETICONSPACING: return LISTVIEW_SetIconSpacing(hwnd, (DWORD)lParam); - + case LVM_SETIMAGELIST: return (LRESULT)LISTVIEW_SetImageList(hwnd, (INT)wParam, (HIMAGELIST)lParam); @@ -9608,9 +9608,9 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case LVM_SETITEMW: return LISTVIEW_SetItemT(hwnd, (LPLVITEMW)lParam, TRUE); - case LVM_SETITEMCOUNT: + case LVM_SETITEMCOUNT: return LISTVIEW_SetItemCount(hwnd, (INT)wParam, (DWORD)lParam); - + case LVM_SETITEMPOSITION: return LISTVIEW_SetItemPosition(hwnd, (INT)wParam, (INT)LOWORD(lParam), (INT)HIWORD(lParam)); @@ -9646,7 +9646,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, /* case LVM_SUBITEMHITTEST: */ - case LVM_UPDATE: + case LVM_UPDATE: return LISTVIEW_Update(hwnd, (INT)wParam); case WM_CHAR: @@ -9657,7 +9657,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case WM_CREATE: return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam); - + case WM_ERASEBKGND: return LISTVIEW_EraseBackground(hwnd, wParam, lParam); @@ -9668,7 +9668,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, return LISTVIEW_GetFont(hwnd); case WM_HSCROLL: - return LISTVIEW_HScroll(hwnd, (INT)LOWORD(wParam), + return LISTVIEW_HScroll(hwnd, (INT)LOWORD(wParam), (INT)HIWORD(wParam), (HWND)lParam); case WM_KEYDOWN: @@ -9678,14 +9678,14 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, return LISTVIEW_KillFocus(hwnd); case WM_LBUTTONDBLCLK: - return LISTVIEW_LButtonDblClk(hwnd, (WORD)wParam, LOWORD(lParam), + return LISTVIEW_LButtonDblClk(hwnd, (WORD)wParam, LOWORD(lParam), HIWORD(lParam)); - + case WM_LBUTTONDOWN: - return LISTVIEW_LButtonDown(hwnd, (WORD)wParam, LOWORD(lParam), + return LISTVIEW_LButtonDown(hwnd, (WORD)wParam, LOWORD(lParam), HIWORD(lParam)); case WM_LBUTTONUP: - return LISTVIEW_LButtonUp(hwnd, (WORD)wParam, LOWORD(lParam), + return LISTVIEW_LButtonUp(hwnd, (WORD)wParam, LOWORD(lParam), HIWORD(lParam)); case WM_MOUSEMOVE: return LISTVIEW_MouseMove (hwnd, wParam, lParam); @@ -9705,19 +9705,19 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case WM_NOTIFYFORMAT: return LISTVIEW_NotifyFormat(hwnd, (HWND)wParam, (INT)lParam); - case WM_PAINT: - return LISTVIEW_Paint(hwnd, (HDC)wParam); + case WM_PAINT: + return LISTVIEW_Paint(hwnd, (HDC)wParam); case WM_RBUTTONDBLCLK: - return LISTVIEW_RButtonDblClk(hwnd, (WORD)wParam, LOWORD(lParam), + return LISTVIEW_RButtonDblClk(hwnd, (WORD)wParam, LOWORD(lParam), HIWORD(lParam)); case WM_RBUTTONDOWN: - return LISTVIEW_RButtonDown(hwnd, (WORD)wParam, LOWORD(lParam), + return LISTVIEW_RButtonDown(hwnd, (WORD)wParam, LOWORD(lParam), HIWORD(lParam)); case WM_RBUTTONUP: - return LISTVIEW_RButtonUp(hwnd, (WORD)wParam, LOWORD(lParam), + return LISTVIEW_RButtonUp(hwnd, (WORD)wParam, LOWORD(lParam), HIWORD(lParam)); case WM_SETFOCUS: @@ -9726,7 +9726,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case WM_SETFONT: return LISTVIEW_SetFont(hwnd, (HFONT)wParam, (WORD)lParam); - case WM_SETREDRAW: + case WM_SETREDRAW: return LISTVIEW_SetRedraw(hwnd, (BOOL)wParam); case WM_SIZE: @@ -9738,7 +9738,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, /* case WM_TIMER: */ case WM_VSCROLL: - return LISTVIEW_VScroll(hwnd, (INT)LOWORD(wParam), + return LISTVIEW_VScroll(hwnd, (INT)LOWORD(wParam), (INT)HIWORD(wParam), (HWND)lParam); case WM_MOUSEWHEEL: @@ -9751,7 +9751,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, default: if (uMsg >= WM_USER) { - ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, + ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam); } @@ -9765,7 +9765,7 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, /*** * DESCRIPTION: * Registers the window class. - * + * * PARAMETER(S): * None * @@ -9790,7 +9790,7 @@ VOID LISTVIEW_Register(void) /*** * DESCRIPTION: * Unregisters the window class. - * + * * PARAMETER(S): * None * @@ -9805,7 +9805,7 @@ VOID LISTVIEW_Unregister(void) /*** * DESCRIPTION: * Handle any WM_COMMAND messages - * + * * PARAMETER(S): * * RETURN: @@ -9816,8 +9816,8 @@ static LRESULT LISTVIEW_Command(HWND hwnd, WPARAM wParam, LPARAM lParam) { case EN_UPDATE: { - /* - * Adjust the edit window size + /* + * Adjust the edit window size */ WCHAR buffer[1024]; LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(hwnd, 0); @@ -9845,10 +9845,10 @@ static LRESULT LISTVIEW_Command(HWND hwnd, WPARAM wParam, LPARAM lParam) GetTextMetricsW(hdc, &textMetric); sz.cx += (textMetric.tmMaxCharWidth * 2); - SetWindowPos ( + SetWindowPos ( infoPtr->hwndEdit, - HWND_TOP, - 0, + HWND_TOP, + 0, 0, sz.cx, rect.bottom - rect.top, @@ -9878,7 +9878,7 @@ static LRESULT LISTVIEW_Command(HWND hwnd, WPARAM wParam, LPARAM lParam) * * RETURN: */ -static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, +static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL isW) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(GetParent(hwnd), 0); @@ -9888,12 +9888,12 @@ static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, TRACE("(hwnd=%x, uMsg=%x, wParam=%x, lParam=%lx, isW=%d)\n", hwnd, uMsg, wParam, lParam, isW); - + switch (uMsg) { case WM_GETDLGCODE: return DLGC_WANTARROWS | DLGC_WANTALLKEYS; - + case WM_KILLFOCUS: if(bIgnoreKillFocus) return TRUE; break; @@ -9923,7 +9923,7 @@ static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, if (einfo->EditLblCb) { LPWSTR buffer = NULL; - + if (!cancel) { DWORD len = isW ? GetWindowTextLengthW(hwnd) : GetWindowTextLengthA(hwnd); @@ -9986,8 +9986,8 @@ LRESULT CALLBACK EditLblWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa * * RETURN: */ -HWND CreateEditLabelT(LPCWSTR text, DWORD style, INT x, INT y, - INT width, INT height, HWND parent, HINSTANCE hinst, +HWND CreateEditLabelT(LPCWSTR text, DWORD style, INT x, INT y, + INT width, INT height, HWND parent, HINSTANCE hinst, EditlblCallbackW EditLblCb, DWORD param, BOOL isW) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongW(parent, 0); @@ -9999,7 +9999,7 @@ HWND CreateEditLabelT(LPCWSTR text, DWORD style, INT x, INT y, TEXTMETRICW textMetric; TRACE("(text=%s, ..., isW=%d)\n", debugstr_t(text, isW), isW); - + if (NULL == (infoPtr->pedititem = COMCTL32_Alloc(sizeof(EDITLABEL_ITEM)))) return 0; @@ -10021,7 +10021,7 @@ HWND CreateEditLabelT(LPCWSTR text, DWORD style, INT x, INT y, SelectObject(hdc, hOldFont); ReleaseDC(parent, hdc); - if (isW) + if (isW) hedit = CreateWindowW(editName, text, style, x, y, sz.cx, height, parent, 0, hinst, 0); else hedit = CreateWindowA("Edit", (LPCSTR)text, style, x, y, sz.cx, height, parent, 0, hinst, 0); @@ -10034,7 +10034,7 @@ HWND CreateEditLabelT(LPCWSTR text, DWORD style, INT x, INT y, infoPtr->pedititem->param = param; infoPtr->pedititem->EditLblCb = EditLblCb; - infoPtr->pedititem->EditWndProc = (WNDPROC) + infoPtr->pedititem->EditWndProc = (WNDPROC) (isW ? SetWindowLongW(hedit, GWL_WNDPROC, (LONG)EditLblWndProcW) : SetWindowLongA(hedit, GWL_WNDPROC, (LONG)EditLblWndProcA) ); diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index ec1b87d19f0..649044cfcb4 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -26,7 +26,7 @@ * * * FIXME: handle resources better (doesn't work now); also take care - of internationalization. + of internationalization. * FIXME: keyboard handling. */ @@ -54,7 +54,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(monthcal); /* month', wait 500 ms before going */ /* to the next month */ #define MC_NEXTMONTHTIMER 1 /* Timer ID's */ -#define MC_PREVMONTHTIMER 2 +#define MC_PREVMONTHTIMER 2 typedef struct { @@ -91,12 +91,12 @@ typedef struct DWORD rangeValid; SYSTEMTIME minDate; SYSTEMTIME maxDate; - + RECT rcClient; /* rect for whole client area */ RECT rcDraw; /* rect for drawable portion of client area */ RECT title; /* rect for the header above the calendar */ RECT titlebtnnext; /* the `next month' button in the header */ - RECT titlebtnprev; /* the `prev month' button in the header */ + RECT titlebtnprev; /* the `prev month' button in the header */ RECT titlemonth; /* the `month name' txt in the header */ RECT titleyear; /* the `year number' txt in the header */ RECT wdays; /* week days at top */ @@ -141,7 +141,7 @@ const int mdays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0}; /* make sure that time is valid */ -static int MONTHCAL_ValidateTime(SYSTEMTIME time) +static int MONTHCAL_ValidateTime(SYSTEMTIME time) { if(time.wMonth > 12) return FALSE; if(time.wDayOfWeek > 6) return FALSE; @@ -156,7 +156,7 @@ static int MONTHCAL_ValidateTime(SYSTEMTIME time) } -void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to) +void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to) { to->wYear = from->wYear; to->wMonth = from->wMonth; @@ -169,7 +169,7 @@ void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to) } -/* Note:Depending on DST, this may be offset by a day. +/* Note:Depending on DST, this may be offset by a day. Need to find out if we're on a DST place & adjust the clock accordingly. Above function assumes we have a valid data. Valid for year>1752; 1 <= d <= 31, 1 <= m <= 12. @@ -182,15 +182,15 @@ static int MONTHCAL_CalculateDayOfWeek(DWORD day, DWORD month, DWORD year) { year-=(month < 3); - return((year + year/4 - year/100 + year/400 + + return((year + year/4 - year/100 + year/400 + DayOfWeekTable[month-1] + day - 1 ) % 7); } /* From a given point, calculate the row (weekpos), column(daypos) and day in the calendar. day== 0 mean the last day of tha last month */ -static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y, - int *daypos,int *weekpos) +static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y, + int *daypos,int *weekpos) { int retval, firstDay; @@ -202,7 +202,7 @@ static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y, *daypos = (x - infoPtr->days.left ) / infoPtr->width_increment; *weekpos = (y - infoPtr->days.top ) / infoPtr->height_increment; - + firstDay = (MONTHCAL_CalculateDayOfWeek(1, infoPtr->currentMonth, infoPtr->currentYear)+6 - infoPtr->firstDay)%7; retval = *daypos + (7 * *weekpos) - firstDay; return retval; @@ -211,7 +211,7 @@ static int MONTHCAL_CalcDayFromPos(MONTHCAL_INFO *infoPtr, int x, int y, /* day is the day of the month, 1 == 1st day of the month */ /* sets x and y to be the position of the day */ /* x == day, y == week where(0,0) == firstDay, 1st week */ -static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month, +static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month, int *x, int *y) { int firstDay, prevMonth; @@ -227,7 +227,7 @@ static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month, prevMonth = month - 1; if(prevMonth==0) prevMonth = 12; - + *x = (MONTHCAL_MonthLength(prevMonth, infoPtr->currentYear) - firstDay) % 7; *y = 0; return; @@ -240,7 +240,7 @@ static void MONTHCAL_CalcDayXY(MONTHCAL_INFO *infoPtr, int day, int month, /* x: column(day), y: row(week) */ -static void MONTHCAL_CalcDayRect(MONTHCAL_INFO *infoPtr, RECT *r, int x, int y) +static void MONTHCAL_CalcDayRect(MONTHCAL_INFO *infoPtr, RECT *r, int x, int y) { r->left = infoPtr->days.left + x * infoPtr->width_increment; r->right = r->left + infoPtr->width_increment; @@ -252,7 +252,7 @@ static void MONTHCAL_CalcDayRect(MONTHCAL_INFO *infoPtr, RECT *r, int x, int y) /* sets the RECT struct r to the rectangle around the day and month */ /* day is the day value of the month(1 == 1st), month is the month */ /* value(january == 1, december == 12) */ -static inline void MONTHCAL_CalcPosFromDay(MONTHCAL_INFO *infoPtr, +static inline void MONTHCAL_CalcPosFromDay(MONTHCAL_INFO *infoPtr, int day, int month, RECT *r) { int x, y; @@ -278,7 +278,7 @@ int month) x = day_rect.left; y = day_rect.top; - + points[0].x = x; points[0].y = y - 1; points[1].x = x + 0.8 * infoPtr->width_increment; @@ -287,7 +287,7 @@ int month) points[2].y = y; points[3].x = x + infoPtr->width_increment; points[3].y = y + 0.5 * infoPtr->height_increment; - + points[4].x = x + infoPtr->width_increment; points[4].y = y + 0.9 * infoPtr->height_increment; points[5].x = x + 0.6 * infoPtr->width_increment; @@ -295,7 +295,7 @@ int month) points[6].x = x + 0.5 * infoPtr->width_increment; points[6].y = y + 0.9 * infoPtr->height_increment; /* bring the bottom up just a hair to fit inside the day rectangle */ - + points[7].x = x + 0.2 * infoPtr->width_increment; points[7].y = y + 0.8 * infoPtr->height_increment; points[8].x = x + 0.1 * infoPtr->width_increment; @@ -309,7 +309,7 @@ int month) points[11].y = y + 0.3 * infoPtr->height_increment; points[12].x = x + 0.4 * infoPtr->width_increment; points[12].y = y + 0.2 * infoPtr->height_increment; - + PolyBezier(hdc, points, 13); DeleteObject(hRedPen); SelectObject(hdc, hOldPen2); @@ -329,7 +329,7 @@ static void MONTHCAL_DrawDay(HDC hdc, MONTHCAL_INFO *infoPtr, int day, int month sprintf(buf, "%d", day); -/* No need to check styles: when selection is not valid, it is set to zero. +/* No need to check styles: when selection is not valid, it is set to zero. * 1rcClient; @@ -425,7 +425,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) /* fill background */ hbr = CreateSolidBrush (infoPtr->bk); FillRect(hdc, rcClient, hbr); - DeleteObject(hbr); + DeleteObject(hbr); /* draw header */ if(IntersectRect(&rcTemp, &(ps->rcPaint), title)) @@ -434,10 +434,10 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) FillRect(hdc, title, hbr); DeleteObject(hbr); } - + /* if the previous button is pressed draw it depressed */ if(IntersectRect(&rcTemp, &(ps->rcPaint), prev)) - { + { if((infoPtr->status & MC_PREVPRESSED)) DrawFrameControl(hdc, prev, DFC_SCROLL, DFCS_SCROLLLEFT | DFCS_PUSHED | @@ -447,7 +447,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) DFCS_SCROLLLEFT |(dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0)); } - /* if next button is depressed draw it depressed */ + /* if next button is depressed draw it depressed */ if(IntersectRect(&rcTemp, &(ps->rcPaint), next)) { if((infoPtr->status & MC_NEXTPRESSED)) @@ -466,14 +466,14 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) /* titlemonth->left and right are set in MONTHCAL_UpdateSize */ titlemonth->left = title->left; titlemonth->right = title->right; - + GetLocaleInfoA( LOCALE_USER_DEFAULT,LOCALE_SMONTHNAME1+infoPtr->currentMonth -1, buf1,sizeof(buf1)); sprintf(buf, "%s %ld", buf1, infoPtr->currentYear); - + if(IntersectRect(&rcTemp, &(ps->rcPaint), titlemonth)) { - DrawTextA(hdc, buf, strlen(buf), titlemonth, + DrawTextA(hdc, buf, strlen(buf), titlemonth, DT_CENTER | DT_VCENTER | DT_SINGLELINE); } @@ -481,7 +481,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) /* titlemonth left/right contained rect for whole titletxt('June 1999') * MCM_HitTestInfo wants month & year rects, so prepare these now. - *(no, we can't draw them separately; the whole text is centered) + *(no, we can't draw them separately; the whole text is centered) */ GetTextExtentPoint32A(hdc, buf, strlen(buf), &size); titlemonth->left = title->right / 2 - size.cx / 2; @@ -489,7 +489,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) GetTextExtentPoint32A(hdc, buf1, strlen(buf1), &size); titlemonth->right = titlemonth->left + size.cx; titleyear->left = titlemonth->right; - + /* draw month area */ rcTemp.top=infoPtr->wdays.top; rcTemp.left=infoPtr->wdays.left; @@ -501,13 +501,13 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) FillRect(hdc, &rcTemp, hbr); DeleteObject(hbr); } - + /* draw line under day abbreviatons */ MoveToEx(hdc, infoPtr->days.left + 3, title->bottom + textHeight + 1, NULL); - + LineTo(hdc, rcDraw->right - 3, title->bottom + textHeight + 1); - + prevMonth = infoPtr->currentMonth - 1; if(prevMonth == 0) /* if currentMonth is january(1) prevMonth is */ prevMonth = 12; /* december(12) of the previous year */ @@ -537,10 +537,10 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) } /* draw day numbers; first, the previous month */ - + firstDay = MONTHCAL_CalculateDayOfWeek(1, infoPtr->currentMonth, infoPtr->currentYear); - - day = MONTHCAL_MonthLength(prevMonth, infoPtr->currentYear) + + + day = MONTHCAL_MonthLength(prevMonth, infoPtr->currentYear) + (infoPtr->firstDay + 7 - firstDay)%7 + 1; if (day > MONTHCAL_MonthLength(prevMonth, infoPtr->currentYear)) day -=7; @@ -553,7 +553,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) MONTHCAL_CalcDayRect(infoPtr, &rcDay, i, 0); if(IntersectRect(&rcTemp, &(ps->rcPaint), &rcDay)) { - MONTHCAL_DrawDay(hdc, infoPtr, day, prevMonth, i, 0, + MONTHCAL_DrawDay(hdc, infoPtr, day, prevMonth, i, 0, infoPtr->monthdayState[m] & mask); } @@ -577,7 +577,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) if(IntersectRect(&rcTemp, &(ps->rcPaint), &rcDay)) { - MONTHCAL_DrawDay(hdc, infoPtr, day, infoPtr->currentMonth, i, 0, + MONTHCAL_DrawDay(hdc, infoPtr, day, infoPtr->currentMonth, i, 0, infoPtr->monthdayState[m] & mask); if((infoPtr->currentMonth==infoPtr->todaysDate.wMonth) && @@ -595,7 +595,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) j = 1; /* move to the 2nd week of the current month */ i = 0; /* move back to sunday */ - while(day <= MONTHCAL_MonthLength(infoPtr->currentMonth, infoPtr->currentYear)) { + while(day <= MONTHCAL_MonthLength(infoPtr->currentMonth, infoPtr->currentYear)) { MONTHCAL_CalcDayRect(infoPtr, &rcDay, i, j); if(IntersectRect(&rcTemp, &(ps->rcPaint), &rcDay)) { @@ -604,8 +604,8 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) if((infoPtr->currentMonth==infoPtr->todaysDate.wMonth) && (day==infoPtr->todaysDate.wDay) && - (infoPtr->currentYear == infoPtr->todaysDate.wYear)) - if(!(dwStyle & MCS_NOTODAYCIRCLE)) + (infoPtr->currentYear == infoPtr->todaysDate.wYear)) + if(!(dwStyle & MCS_NOTODAYCIRCLE)) MONTHCAL_CircleDay(hdc, infoPtr, day, infoPtr->currentMonth); } mask<<=1; @@ -627,14 +627,14 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) while((i<7) &&(j<6)) { MONTHCAL_CalcDayRect(infoPtr, &rcDay, i, j); if(IntersectRect(&rcTemp, &(ps->rcPaint), &rcDay)) - { + { MONTHCAL_DrawDay(hdc, infoPtr, day, infoPtr->currentMonth + 1, i, j, infoPtr->monthdayState[m] & mask); } mask<<=1; day++; - i++; + i++; if(i==7) { /* past saturday, go to next week's sunday */ i = 0; j++; @@ -650,8 +650,8 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) int offset = 0; if(!(dwStyle & MCS_NOTODAYCIRCLE)) { /*day is the number of days from nextmonth we put on the calendar */ - MONTHCAL_CircleDay(hdc, infoPtr, - day+MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear), + MONTHCAL_CircleDay(hdc, infoPtr, + day+MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear), infoPtr->currentMonth); offset+=textWidth; } @@ -674,7 +674,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) SelectObject(hdc, infoPtr->hFont); } -/*eventually draw week numbers*/ +/*eventually draw week numbers*/ if(dwStyle & MCS_WEEKNUMBERS) { /* display weeknumbers*/ int mindays; @@ -682,7 +682,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) /* Rules what week to call the first week of a new year: LOCALE_IFIRSTWEEKOFYEAR == 0 (e.g US?): The week containing Jan 1 is the first week of year - LOCALE_IFIRSTWEEKOFYEAR == 2 (e.g. Germany): + LOCALE_IFIRSTWEEKOFYEAR == 2 (e.g. Germany): First week of year must contain 4 days of the new year LOCALE_IFIRSTWEEKOFYEAR == 1 (what contries?) The first week of the year must contain only days of the new year @@ -704,12 +704,12 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) { /* calculate all those exceptions for january */ weeknum1=MONTHCAL_CalculateDayOfWeek(1,1,infoPtr->currentYear); - if ((infoPtr->firstDay +7 - weeknum1)%7 > mindays) + if ((infoPtr->firstDay +7 - weeknum1)%7 > mindays) weeknum =1; else { weeknum = 0; - for(i=0; i<11; i++) + for(i=0; i<11; i++) weeknum+=MONTHCAL_MonthLength(i+1, infoPtr->currentYear-1); weeknum +=startofprescal+ 7; weeknum /=7; @@ -721,7 +721,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) else { weeknum = 0; - for(i=0; icurrentYear); weeknum +=startofprescal+ 7; weeknum /=7; @@ -749,26 +749,26 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) days->top+=infoPtr->height_increment; days->bottom+=infoPtr->height_increment; } - + MoveToEx(hdc, infoPtr->weeknums.right, infoPtr->weeknums.top + 3 , NULL); LineTo(hdc, infoPtr->weeknums.right, infoPtr->weeknums.bottom ); - + } /* currentFont was font at entering Refresh */ SetBkColor(hdc, oldBkColor); - SelectObject(hdc, currentFont); + SelectObject(hdc, currentFont); SetTextColor(hdc, oldTextColor); } -static LRESULT +static LRESULT MONTHCAL_GetMinReqRect(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); LPRECT lpRect = (LPRECT) lParam; TRACE("%x %lx\n", wParam, lParam); - + /* validate parameters */ if((infoPtr==NULL) ||(lpRect == NULL) ) return FALSE; @@ -781,7 +781,7 @@ MONTHCAL_GetMinReqRect(HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT MONTHCAL_GetColor(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -807,7 +807,7 @@ MONTHCAL_GetColor(HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT MONTHCAL_SetColor(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -847,13 +847,13 @@ MONTHCAL_SetColor(HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT MONTHCAL_GetMonthDelta(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); TRACE("%x %lx\n", wParam, lParam); - + if(infoPtr->delta) return infoPtr->delta; else @@ -861,24 +861,24 @@ MONTHCAL_GetMonthDelta(HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT MONTHCAL_SetMonthDelta(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); int prev = infoPtr->delta; TRACE("%x %lx\n", wParam, lParam); - + infoPtr->delta = (int)wParam; return prev; } -static LRESULT +static LRESULT MONTHCAL_GetFirstDayOfWeek(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); - + return infoPtr->firstDay; } @@ -887,7 +887,7 @@ MONTHCAL_GetFirstDayOfWeek(HWND hwnd, WPARAM wParam, LPARAM lParam) /* 0 == Monday, 6 == Sunday */ /* FIXME: this needs to be implemented properly in MONTHCAL_Refresh() */ /* FIXME: we need more error checking here */ -static LRESULT +static LRESULT MONTHCAL_SetFirstDayOfWeek(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -916,7 +916,7 @@ MONTHCAL_SetFirstDayOfWeek(HWND hwnd, WPARAM wParam, LPARAM lParam) /* FIXME: fill this in */ static LRESULT -MONTHCAL_GetMonthRange(HWND hwnd, WPARAM wParam, LPARAM lParam) +MONTHCAL_GetMonthRange(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -937,7 +937,7 @@ MONTHCAL_GetMaxTodayWidth(HWND hwnd) /* FIXME: are validated times taken from current date/time or simply - * copied? + * copied? * FIXME: check whether MCM_GETMONTHRANGE shows correct result after * adjusting range with MCM_SETRANGE */ @@ -950,7 +950,7 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam) int prev; TRACE("%x %lx\n", wParam, lParam); - + if(wParam & GDTR_MAX) { if(MONTHCAL_ValidateTime(lprgSysTimeArray[1])){ MONTHCAL_CopyTime(&lprgSysTimeArray[1], &infoPtr->maxDate); @@ -973,8 +973,8 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam) prev = infoPtr->monthRange; infoPtr->monthRange = infoPtr->maxDate.wMonth - infoPtr->minDate.wMonth; - if(infoPtr->monthRange!=prev) { - COMCTL32_ReAlloc(infoPtr->monthdayState, + if(infoPtr->monthRange!=prev) { + COMCTL32_ReAlloc(infoPtr->monthdayState, infoPtr->monthRange * sizeof(MONTHDAYSTATE)); } @@ -983,7 +983,7 @@ MONTHCAL_SetRange(HWND hwnd, WPARAM wParam, LPARAM lParam) /* CHECKME: At the moment, we copy ranges anyway,regardless of - * infoPtr->rangeValid; a invalid range is simply filled with zeros in + * infoPtr->rangeValid; a invalid range is simply filled with zeros in * SetRange. Is this the right behavior? */ @@ -1015,12 +1015,12 @@ MONTHCAL_SetDayState(HWND hwnd, WPARAM wParam, LPARAM lParam) TRACE("%x %lx\n", wParam, lParam); if(iMonths!=infoPtr->monthRange) return 0; - for(i=0; imonthdayState[i] = dayStates[i]; return 1; } -static LRESULT +static LRESULT MONTHCAL_GetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -1036,7 +1036,7 @@ MONTHCAL_GetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam) /* FIXME: if the specified date is not visible, make it visible */ /* FIXME: redraw? */ -static LRESULT +static LRESULT MONTHCAL_SetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -1057,7 +1057,7 @@ MONTHCAL_SetCurSel(HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT MONTHCAL_GetMaxSelCount(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -1067,7 +1067,7 @@ MONTHCAL_GetMaxSelCount(HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT MONTHCAL_SetMaxSelCount(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -1081,7 +1081,7 @@ MONTHCAL_SetMaxSelCount(HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT MONTHCAL_GetSelRange(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -1100,12 +1100,12 @@ MONTHCAL_GetSelRange(HWND hwnd, WPARAM wParam, LPARAM lParam) TRACE("[min,max]=[%d %d]\n", infoPtr->minSel.wDay, infoPtr->maxSel.wDay); return TRUE; } - + return FALSE; } -static LRESULT +static LRESULT MONTHCAL_SetSelRange(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -1124,12 +1124,12 @@ MONTHCAL_SetSelRange(HWND hwnd, WPARAM wParam, LPARAM lParam) TRACE("[min,max]=[%d %d]\n", infoPtr->minSel.wDay, infoPtr->maxSel.wDay); return TRUE; } - + return FALSE; } -static LRESULT +static LRESULT MONTHCAL_GetToday(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -1145,7 +1145,7 @@ MONTHCAL_GetToday(HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT MONTHCAL_SetToday(HWND hwnd, WPARAM wParam, LPARAM lParam) { MONTHCAL_INFO *infoPtr = MONTHCAL_GetInfoPtr(hwnd); @@ -1170,15 +1170,15 @@ MONTHCAL_HitTest(HWND hwnd, LPARAM lParam) UINT x,y; DWORD retval; int day,wday,wnum; - - + + x = lpht->pt.x; y = lpht->pt.y; retval = MCHT_NOWHERE; - - /* Comment in for debugging... - TRACE("%d %d wd[%d %d %d %d] d[%d %d %d %d] t[%d %d %d %d] wn[%d %d %d %d]\n", x, y, + + /* Comment in for debugging... + TRACE("%d %d wd[%d %d %d %d] d[%d %d %d %d] t[%d %d %d %d] wn[%d %d %d %d]\n", x, y, infoPtr->wdays.left, infoPtr->wdays.right, infoPtr->wdays.top, infoPtr->wdays.bottom, infoPtr->days.left, infoPtr->days.right, @@ -1190,7 +1190,7 @@ MONTHCAL_HitTest(HWND hwnd, LPARAM lParam) */ /* are we in the header? */ - + if(PtInRect(&infoPtr->title, lpht->pt)) { if(PtInRect(&infoPtr->titlebtnprev, lpht->pt)) { retval = MCHT_TITLEBTNPREV; @@ -1208,36 +1208,36 @@ MONTHCAL_HitTest(HWND hwnd, LPARAM lParam) retval = MCHT_TITLEYEAR; goto done; } - + retval = MCHT_TITLE; goto done; } - + day = MONTHCAL_CalcDayFromPos(infoPtr,x,y,&wday,&wnum); if(PtInRect(&infoPtr->wdays, lpht->pt)) { retval = MCHT_CALENDARDAY; lpht->st.wYear = infoPtr->currentYear; lpht->st.wMonth = (day < 1)? infoPtr->currentMonth -1 : infoPtr->currentMonth; - lpht->st.wDay = (day < 1)? + lpht->st.wDay = (day < 1)? MONTHCAL_MonthLength(infoPtr->currentMonth-1,infoPtr->currentYear) -day : day; goto done; } - if(PtInRect(&infoPtr->weeknums, lpht->pt)) { - retval = MCHT_CALENDARWEEKNUM; + if(PtInRect(&infoPtr->weeknums, lpht->pt)) { + retval = MCHT_CALENDARWEEKNUM; lpht->st.wYear = infoPtr->currentYear; - lpht->st.wMonth = (day < 1) ? infoPtr->currentMonth -1 : - (day > MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear)) ? + lpht->st.wMonth = (day < 1) ? infoPtr->currentMonth -1 : + (day > MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear)) ? infoPtr->currentMonth +1 :infoPtr->currentMonth; - lpht->st.wDay = (day < 1 ) ? - MONTHCAL_MonthLength(infoPtr->currentMonth-1,infoPtr->currentYear) -day : - (day > MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear)) ? + lpht->st.wDay = (day < 1 ) ? + MONTHCAL_MonthLength(infoPtr->currentMonth-1,infoPtr->currentYear) -day : + (day > MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear)) ? day - MONTHCAL_MonthLength(infoPtr->currentMonth,infoPtr->currentYear) : day; - goto done; + goto done; } - if(PtInRect(&infoPtr->days, lpht->pt)) + if(PtInRect(&infoPtr->days, lpht->pt)) { lpht->st.wYear = infoPtr->currentYear; - if ( day < 1) + if ( day < 1) { retval = MCHT_CALENDARDATEPREV; lpht->st.wMonth = infoPtr->currentMonth - 1; @@ -1267,15 +1267,15 @@ MONTHCAL_HitTest(HWND hwnd, LPARAM lParam) goto done; } if(PtInRect(&infoPtr->todayrect, lpht->pt)) { - retval = MCHT_TODAYLINK; + retval = MCHT_TODAYLINK; goto done; } - - + + /* Hit nothing special? What's left must be background :-) */ - - retval = MCHT_CALENDARBK; - done: + + retval = MCHT_CALENDARBK; + done: lpht->uHit = retval; return retval; } @@ -1331,7 +1331,7 @@ static void MONTHCAL_GoToPrevMonth(HWND hwnd, MONTHCAL_INFO *infoPtr) nmds.nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID); nmds.nmhdr.code = MCN_GETDAYSTATE; nmds.cDayState = infoPtr->monthRange; - nmds.prgDayState = COMCTL32_Alloc + nmds.prgDayState = COMCTL32_Alloc (infoPtr->monthRange * sizeof(MONTHDAYSTATE)); SendMessageA(GetParent(hwnd), WM_NOTIFY, @@ -1348,7 +1348,7 @@ MONTHCAL_RButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) HMENU hMenu; POINT menupoint; char buf[32]; - + hMenu = CreatePopupMenu(); if (!LoadStringA(COMCTL32_hModule,IDM_GOTODAY,buf,sizeof(buf))) { @@ -1365,7 +1365,7 @@ MONTHCAL_RButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->currentMonth=infoPtr->todaysDate.wMonth; infoPtr->currentYear=infoPtr->todaysDate.wYear; InvalidateRect(hwnd, NULL, FALSE); - } + } return 0; } @@ -1381,7 +1381,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) int i; POINT menupoint; TRACE("%x %lx\n", wParam, lParam); - + if (infoPtr->hWndYearUpDown) { infoPtr->currentYear=SendMessageA( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)0); @@ -1399,7 +1399,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->hWndYearEdit=0; InvalidateRect(hwnd, NULL, FALSE); } - + ht.pt.x = (INT)LOWORD(lParam); ht.pt.y = (INT)HIWORD(lParam); hit = MONTHCAL_HitTest(hwnd, (LPARAM)&ht); @@ -1414,7 +1414,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) InvalidateRect(hwnd, NULL, FALSE); return TRUE; } - if(hit == MCHT_TITLEBTNPREV){ + if(hit == MCHT_TITLEBTNPREV){ MONTHCAL_GoToPrevMonth(hwnd, infoPtr); infoPtr->status = MC_PREVPRESSED; SetTimer(hwnd, MC_PREVMONTHTIMER, MC_NEXTMONTHDELAY, 0); @@ -1424,7 +1424,7 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) if(hit == MCHT_TITLEMONTH) { hMenu = CreatePopupMenu(); - + for (i=0; i<12;i++) { GetLocaleInfoA( LOCALE_USER_DEFAULT,LOCALE_SMONTHNAME1+i, @@ -1451,8 +1451,8 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->titleyear.right-infoPtr->titleyear.left, infoPtr->textHeight, hwnd, - (HMENU)NULL, - (HINSTANCE)NULL, + (HMENU)NULL, + (HINSTANCE)NULL, NULL); infoPtr->hWndYearUpDown=CreateWindowExA(0, UPDOWN_CLASSA, @@ -1462,14 +1462,14 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) 20, infoPtr->textHeight, hwnd, - (HMENU)NULL, - (HINSTANCE)NULL, + (HMENU)NULL, + (HINSTANCE)NULL, NULL); SendMessageA( infoPtr->hWndYearUpDown, UDM_SETRANGE, (WPARAM) 0, MAKELONG (9999, 1753)); SendMessageA( infoPtr->hWndYearUpDown, UDM_SETBUDDY, (WPARAM) infoPtr->hWndYearEdit, (LPARAM)0 ); SendMessageA( infoPtr->hWndYearUpDown, UDM_SETPOS, (WPARAM) 0,(LPARAM)infoPtr->currentYear ); return TRUE; - + } if(hit == MCHT_TODAYLINK) { infoPtr->currentMonth=infoPtr->todaysDate.wMonth; @@ -1487,13 +1487,13 @@ MONTHCAL_LButtonDown(HWND hwnd, WPARAM wParam, LPARAM lParam) nmsc.nmhdr.code = MCN_SELCHANGE; MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel); MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel); - + SendMessageA(GetParent(hwnd), WM_NOTIFY, (WPARAM)nmsc.nmhdr.idFrom,(LPARAM)&nmsc); MONTHCAL_CopyTime(&ht.st, &selArray[0]); MONTHCAL_CopyTime(&ht.st, &selArray[1]); - MONTHCAL_SetSelRange(hwnd,0,(LPARAM) &selArray); + MONTHCAL_SetSelRange(hwnd,0,(LPARAM) &selArray); /* redraw both old and new days if the selected day changed */ if(infoPtr->curSelDay != ht.st.wDay) { @@ -1546,7 +1546,7 @@ MONTHCAL_LButtonUp(HWND hwnd, WPARAM wParam, LPARAM lParam) InvalidateRect(hwnd, NULL, FALSE); return TRUE; } - if(hit == MCHT_CALENDARDATEPREV){ + if(hit == MCHT_CALENDARDATEPREV){ MONTHCAL_GoToPrevMonth(hwnd, infoPtr); InvalidateRect(hwnd, NULL, FALSE); return TRUE; @@ -1564,14 +1564,14 @@ MONTHCAL_LButtonUp(HWND hwnd, WPARAM wParam, LPARAM lParam) nmsc.nmhdr.code = MCN_SELECT; MONTHCAL_CopyTime(&nmsc.stSelStart, &infoPtr->minSel); MONTHCAL_CopyTime(&nmsc.stSelEnd, &infoPtr->maxSel); - + SendMessageA(GetParent(hwnd), WM_NOTIFY, (WPARAM)nmsc.nmhdr.idFrom, (LPARAM)&nmsc); - + /* redraw if necessary */ if(redraw) InvalidateRect(hwnd, NULL, FALSE); - + return 0; } @@ -1586,7 +1586,7 @@ MONTHCAL_Timer(HWND hwnd, WPARAM wParam, LPARAM lParam) if(!infoPtr) return 0; switch(wParam) { - case MC_NEXTMONTHTIMER: + case MC_NEXTMONTHTIMER: redraw = TRUE; MONTHCAL_GoToNextMonth(hwnd, infoPtr); break; @@ -1618,9 +1618,9 @@ MONTHCAL_MouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam) ht.pt.x = LOWORD(lParam); ht.pt.y = HIWORD(lParam); - + hit = MONTHCAL_HitTest(hwnd, (LPARAM)&ht); - + /* not on the calendar date numbers? bail out */ TRACE("hit:%x\n",hit); if((hit & MCHT_CALENDARDATE) != MCHT_CALENDARDATE) return 0; @@ -1638,23 +1638,23 @@ MONTHCAL_MouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam) i = 0; if(infoPtr->firstSelDay==selArray[0].wDay) i=1; TRACE("oldRange:%d %d %d %d\n", infoPtr->firstSelDay, selArray[0].wDay, selArray[1].wDay, i); - if(infoPtr->firstSelDay==selArray[1].wDay) { + if(infoPtr->firstSelDay==selArray[1].wDay) { /* 1st time we get here: selArray[0]=selArray[1]) */ /* if we're still at the first selected date, return */ if(infoPtr->firstSelDay==selday) goto done; if(seldayfirstSelDay) i = 0; } - + if(abs(infoPtr->firstSelDay - selday) >= infoPtr->maxSelCount) { if(selday>infoPtr->firstSelDay) selday = infoPtr->firstSelDay + infoPtr->maxSelCount; else selday = infoPtr->firstSelDay - infoPtr->maxSelCount; } - + if(selArray[i].wDay!=selday) { TRACE("newRange:%d %d %d %d\n", infoPtr->firstSelDay, selArray[0].wDay, selArray[1].wDay, i); - + selArray[i].wDay = selday; if(selArray[0].wDay>selArray[1].wDay) { @@ -1712,7 +1712,7 @@ static LRESULT MONTHCAL_SetFocus(HWND hwnd, WPARAM wParam, LPARAM lParam) { TRACE("\n"); - + InvalidateRect(hwnd, NULL, FALSE); return 0; @@ -1769,15 +1769,15 @@ static void MONTHCAL_UpdateSize(HWND hwnd) rcDraw->bottom = rcClient->bottom; /* recalculate the height and width increments and offsets */ - /* FIXME: We use up all available width. This will inhibit having multiple - calendars in a row, like win doesn + /* FIXME: We use up all available width. This will inhibit having multiple + calendars in a row, like win doesn */ if(dwStyle & MCS_WEEKNUMBERS) xdiv=8.0; else xdiv=7.0; - infoPtr->width_increment = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) / xdiv; - infoPtr->height_increment = (infoPtr->rcDraw.bottom - infoPtr->rcDraw.top) / 10.0; + infoPtr->width_increment = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) / xdiv; + infoPtr->height_increment = (infoPtr->rcDraw.bottom - infoPtr->rcDraw.top) / 10.0; infoPtr->left_offset = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) - (infoPtr->width_increment * xdiv); infoPtr->top_offset = (infoPtr->rcDraw.bottom - infoPtr->rcDraw.top) - (infoPtr->height_increment * 10.0); @@ -1790,7 +1790,7 @@ static void MONTHCAL_UpdateSize(HWND hwnd) /*if((rcDraw->top + 9 * infoPtr->textHeight + 5) < rcDraw->bottom) { rcDraw->bottom = rcDraw->top + 9 * infoPtr->textHeight + 5; }*/ - + /* calculate title area */ title->top = rcClient->top; title->bottom = title->top + 2 * infoPtr->height_increment; @@ -1805,17 +1805,17 @@ static void MONTHCAL_UpdateSize(HWND hwnd) prev->right = prev->left + (title->bottom - title->top) ; next->right = title->right - 6; next->left = next->right - (title->bottom - title->top); - + /* titlemonth->left and right change based upon the current month */ /* and are recalculated in refresh as the current month may change */ /* without the control being resized */ titlemonth->top = titleyear->top = title->top + (infoPtr->height_increment)/2; titlemonth->bottom = titleyear->bottom = title->bottom - (infoPtr->height_increment)/2; - + /* setup the dimensions of the rectangle we draw the names of the */ /* days of the week in */ weeknumrect->left =infoPtr->left_offset; - if(dwStyle & MCS_WEEKNUMBERS) + if(dwStyle & MCS_WEEKNUMBERS) weeknumrect->right=prev->right; else weeknumrect->right=weeknumrect->left; @@ -1823,16 +1823,16 @@ static void MONTHCAL_UpdateSize(HWND hwnd) wdays->right = days->right = wdays->left + 7 * infoPtr->width_increment; wdays->top = title->bottom ; wdays->bottom = wdays->top + infoPtr->height_increment; - + days->top = weeknumrect->top = wdays->bottom ; days->bottom = weeknumrect->bottom = days->top + 6 * infoPtr->height_increment; - + todayrect->left = rcClient->left; todayrect->right = rcClient->right; todayrect->top = days->bottom; todayrect->bottom = days->bottom + infoPtr->height_increment; - /* uncomment for excessive debugging + /* uncomment for excessive debugging TRACE("dx=%d dy=%d rcC[%d %d %d %d] t[%d %d %d %d] wd[%d %d %d %d] w[%d %d %d %d] t[%d %d %d %d]\n", infoPtr->width_increment,infoPtr->height_increment, rcClient->left, rcClient->right, rcClient->top, rcClient->bottom, @@ -1841,9 +1841,9 @@ static void MONTHCAL_UpdateSize(HWND hwnd) days->left, days->right, days->top, days->bottom, todayrect->left,todayrect->right,todayrect->top,todayrect->bottom); */ - + /* restore the originally selected font */ - SelectObject(hdc, currentFont); + SelectObject(hdc, currentFont); ReleaseDC(hwnd, hdc); } @@ -1896,7 +1896,7 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam) MONTHCAL_CopyTime(&infoPtr->todaysDate, &infoPtr->maxDate); infoPtr->maxSelCount = 7; infoPtr->monthRange = 3; - infoPtr->monthdayState = COMCTL32_Alloc + infoPtr->monthdayState = COMCTL32_Alloc (infoPtr->monthRange * sizeof(MONTHDAYSTATE)); infoPtr->titlebk = GetSysColor(COLOR_ACTIVECAPTION); infoPtr->titletxt = GetSysColor(COLOR_WINDOW); @@ -2054,7 +2054,7 @@ MONTHCAL_Register(void) wndClass.hCursor = LoadCursorA(0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wndClass.lpszClassName = MONTHCAL_CLASSA; - + RegisterClassA(&wndClass); } diff --git a/dlls/comctl32/nativefont.c b/dlls/comctl32/nativefont.c index bc9e4f883b0..2202adce921 100644 --- a/dlls/comctl32/nativefont.c +++ b/dlls/comctl32/nativefont.c @@ -123,7 +123,7 @@ NATIVEFONT_Register (void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wndClass.lpszClassName = WC_NATIVEFONTCTLA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c index fa4a1bbea06..1581dc8fccb 100644 --- a/dlls/comctl32/pager.c +++ b/dlls/comctl32/pager.c @@ -44,7 +44,7 @@ typedef struct INT nButtonSize;/* size of the pager btns */ INT nPos; /* scroll position */ INT nWidth; /* from child wnd's response to PGN_CALCSIZE */ - INT nHeight; /* from child wnd's response to PGN_CALCSIZE */ + INT nHeight; /* from child wnd's response to PGN_CALCSIZE */ BOOL bForward; /* forward WM_MOUSEMOVE msgs to the contained wnd */ BOOL bCapture; /* we have captured the mouse */ INT TLbtnState; /* state of top or left btn */ @@ -63,7 +63,7 @@ typedef struct #define INITIAL_DELAY 500 #define REPEAT_DELAY 50 -/* the horizontal arrows are: +/* the horizontal arrows are: * * 01234 01234 * 1 * * @@ -72,7 +72,7 @@ typedef struct * 4*** *** * 5 ** ** * 6 * * - * 7 + * 7 * */ static void @@ -115,10 +115,10 @@ PAGER_DrawHorzArrow (HDC hdc, RECT r, INT colorRef, BOOL left) DeleteObject( hPen ); } -/* the vertical arrows are: +/* the vertical arrows are: * * 01234567 01234567 - * 1****** ** + * 1****** ** * 2 **** **** * 3 ** ****** * 4 @@ -175,14 +175,14 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect, return; if ((rc.right - rc.left <= 0) || (rc.bottom - rc.top <= 0)) - return; + return; hBrush = CreateSolidBrush(clrBk); hOldBrush = (HBRUSH)SelectObject(hdc, hBrush); FillRect(hdc, &rc, hBrush); - if (btnState == PGF_HOT) + if (btnState == PGF_HOT) { DrawEdge( hdc, &rc, BDR_RAISEDINNER, BF_RECT); if (horz) @@ -190,7 +190,7 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect, else PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); } - else if (btnState == PGF_NORMAL) + else if (btnState == PGF_NORMAL) { DrawEdge (hdc, &rc, BDR_OUTER, BF_FLAT); if (horz) @@ -198,7 +198,7 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect, else PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); } - else if (btnState == PGF_DEPRESSED) + else if (btnState == PGF_DEPRESSED) { DrawEdge( hdc, &rc, BDR_SUNKENOUTER, BF_RECT); if (horz) @@ -206,7 +206,7 @@ PAGER_DrawButton(HDC hdc, COLORREF clrBk, RECT arrowRect, else PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); } - else if (btnState == PGF_GRAYED) + else if (btnState == PGF_GRAYED) { DrawEdge (hdc, &rc, BDR_OUTER, BF_FLAT); if (horz) @@ -246,7 +246,7 @@ static void PAGER_CaptureandTrack(PAGER_INFO *infoPtr, HWND hwnd) /* Make sure tracking is enabled so we receive a WM_MOUSELEAVE message */ if(!(trackinfo.dwFlags & TME_LEAVE)) { trackinfo.dwFlags = TME_LEAVE; /* notify upon leaving */ - + /* call TRACKMOUSEEVENT so we receive a WM_MOUSELEAVE message */ /* and can properly deactivate the hot button */ _TrackMouseEvent(&trackinfo); @@ -270,7 +270,7 @@ PAGER_ForwardMouse (HWND hwnd, WPARAM wParam) static inline LRESULT PAGER_GetButtonState (HWND hwnd, WPARAM wParam, LPARAM lParam) { - PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); + PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); LRESULT btnState = PGF_INVISIBLE; INT btn = (INT)lParam; TRACE("[%08x]\n", hwnd); @@ -287,7 +287,7 @@ PAGER_GetButtonState (HWND hwnd, WPARAM wParam, LPARAM lParam) static inline LRESULT PAGER_GetPos(HWND hwnd) { - PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); + PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); TRACE("[%08x] returns %d\n", hwnd, infoPtr->nPos); return (LRESULT)infoPtr->nPos; } @@ -295,7 +295,7 @@ PAGER_GetPos(HWND hwnd) static inline LRESULT PAGER_GetButtonSize(HWND hwnd) { - PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); + PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); TRACE("[%08x] returns %d\n", hwnd, infoPtr->nButtonSize); return (LRESULT)infoPtr->nButtonSize; } @@ -303,7 +303,7 @@ PAGER_GetButtonSize(HWND hwnd) static inline LRESULT PAGER_GetBorder(HWND hwnd) { - PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); + PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); TRACE("[%08x] returns %d\n", hwnd, infoPtr->nBorder); return (LRESULT)infoPtr->nBorder; } @@ -311,13 +311,13 @@ PAGER_GetBorder(HWND hwnd) static inline LRESULT PAGER_GetBkColor(HWND hwnd) { - PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); + PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); TRACE("[%08x] returns %06lx\n", hwnd, infoPtr->clrBk); return (LRESULT)infoPtr->clrBk; } -static void -PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth) +static void +PAGER_CalcSize (HWND hwnd, INT* size, BOOL getWidth) { NMPGCALCSIZE nmpgcs; ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE)); @@ -370,7 +370,7 @@ PAGER_PositionChildWnd(HWND hwnd, PAGER_INFO* infoPtr) if (infoPtr->nHeight < wndSize) infoPtr->nHeight = wndSize; - TRACE("[%08x] SWP %dx%d at (%d,%d)\n", hwnd, + TRACE("[%08x] SWP %dx%d at (%d,%d)\n", hwnd, infoPtr->nWidth, infoPtr->nHeight, 0, -nPos); SetWindowPos(infoPtr->hwndChild, 0, @@ -416,7 +416,7 @@ PAGER_GetScrollRange(HWND hwnd, PAGER_INFO* infoPtr) return scrollRange; } -static void +static void PAGER_GrayAndRestoreBtns(PAGER_INFO* infoPtr, INT scrollRange, BOOL* needsResize, BOOL* needsRepaint) { @@ -453,7 +453,7 @@ PAGER_GrayAndRestoreBtns(PAGER_INFO* infoPtr, INT scrollRange, } -static void +static void PAGER_NormalizeBtns(PAGER_INFO* infoPtr, BOOL* needsRepaint) { if (infoPtr->TLbtnState & (PGF_HOT | PGF_DEPRESSED)) @@ -469,7 +469,7 @@ PAGER_NormalizeBtns(PAGER_INFO* infoPtr, BOOL* needsRepaint) } } -static void +static void PAGER_HideGrayBtns(PAGER_INFO* infoPtr, BOOL* needsResize) { if (infoPtr->TLbtnState == PGF_GRAYED) @@ -501,16 +501,16 @@ PAGER_UpdateBtns(HWND hwnd, PAGER_INFO *infoPtr, PAGER_HideGrayBtns(infoPtr, &resizeClient); if (resizeClient) /* initiate NCCalcSize to resize client wnd */ { - SetWindowPos(hwnd, 0,0,0,0,0, + SetWindowPos(hwnd, 0,0,0,0,0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); } if (repaintBtns) - SendMessageA(hwnd, WM_NCPAINT, 0, 0); + SendMessageA(hwnd, WM_NCPAINT, 0, 0); } -static LRESULT +static LRESULT PAGER_SetPos(HWND hwnd, INT newPos, BOOL fromBtnPress) { PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); @@ -568,7 +568,7 @@ PAGER_HandleWindowPosChanging(HWND hwnd, WPARAM wParam, WINDOWPOS *winpos) return 1; } -static INT +static INT PAGER_SetFixedWidth(HWND hwnd, PAGER_INFO* infoPtr) { /* Must set the non-scrollable dimension to be less than the full height/width @@ -599,7 +599,7 @@ PAGER_SetFixedWidth(HWND hwnd, PAGER_INFO* infoPtr) return h; } -static INT +static INT PAGER_SetFixedHeight(HWND hwnd, PAGER_INFO* infoPtr) { /* Must set the non-scrollable dimension to be less than the full height/width @@ -658,7 +658,7 @@ PAGER_RecalcSize(HWND hwnd) infoPtr->nPos = -1; PAGER_SetPos(hwnd, 0, FALSE); } - else + else { PAGER_UpdateBtns(hwnd, infoPtr, scrollRange, TRUE); PAGER_PositionChildWnd(hwnd, infoPtr); @@ -679,7 +679,7 @@ PAGER_SetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam) TRACE("[%08x] %06lx\n", hwnd, infoPtr->clrBk); /* the native control seems to do things this way */ - SetWindowPos(hwnd, 0,0,0,0,0, + SetWindowPos(hwnd, 0,0,0,0,0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); @@ -734,14 +734,14 @@ PAGER_SetChild (HWND hwnd, WPARAM wParam, LPARAM lParam) if (PAGER_IsHorizontal(hwnd)) { hw = PAGER_SetFixedHeight(hwnd, infoPtr); /* adjust non-scrollable dimension to fit the child */ - SetWindowPos(hwnd, 0, 0,0, hw, infoPtr->nHeight, + SetWindowPos(hwnd, 0, 0,0, hw, infoPtr->nHeight, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); } else { hw = PAGER_SetFixedWidth(hwnd, infoPtr); /* adjust non-scrollable dimension to fit the child */ - SetWindowPos(hwnd, 0, 0,0, infoPtr->nWidth, hw, + SetWindowPos(hwnd, 0, 0,0, infoPtr->nWidth, hw, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); } @@ -772,8 +772,8 @@ PAGER_Scroll(HWND hwnd, INT dir) nmpgScroll.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID); nmpgScroll.hdr.code = PGN_SCROLL; - GetWindowRect(hwnd, &rcWnd); - GetClientRect(hwnd, &nmpgScroll.rcParent); + GetWindowRect(hwnd, &rcWnd); + GetClientRect(hwnd, &nmpgScroll.rcParent); nmpgScroll.iXpos = nmpgScroll.iYpos = 0; nmpgScroll.iDir = dir; @@ -788,10 +788,10 @@ PAGER_Scroll(HWND hwnd, INT dir) nmpgScroll.iYpos = infoPtr->nPos; } nmpgScroll.iScroll -= 2*infoPtr->nButtonSize; - + SendMessageA (GetParent(hwnd), WM_NOTIFY, (WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll); - + TRACE("[%08x] PGN_SCROLL returns iScroll=%d\n", hwnd, nmpgScroll.iScroll); if (nmpgScroll.iScroll > 0) @@ -814,12 +814,12 @@ PAGER_FmtLines(HWND hwnd) PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); /* initiate NCCalcSize to resize client wnd and get size */ - SetWindowPos(hwnd, 0, 0,0,0,0, + SetWindowPos(hwnd, 0, 0,0,0,0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); - SetWindowPos(infoPtr->hwndChild, 0, - 0,0,infoPtr->nWidth,infoPtr->nHeight, + SetWindowPos(infoPtr->hwndChild, 0, + 0,0,infoPtr->nWidth,infoPtr->nHeight, 0); return DefWindowProcA (hwnd, EM_FMTLINES, 0, 0); @@ -890,11 +890,11 @@ PAGER_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam) /* * lParam points to a RECT struct. On entry, the struct - * contains the proposed wnd rectangle for the window. + * contains the proposed wnd rectangle for the window. * On exit, the struct should contain the screen * coordinates of the corresponding window's client area. */ - + DefWindowProcA (hwnd, WM_NCCALCSIZE, wParam, lParam); TRACE("orig rect=(%d,%d)-(%d,%d)\n", @@ -941,7 +941,7 @@ PAGER_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam) } else { - /* native does: (from trace of IE4 opening "Favorites" frame) + /* native does: (from trace of IE4 opening "Favorites" frame) * DefWindowProc * WM_NOITFY PGN_CALCSIZE w/ dwFlag=2 * GetWindowRect (child, &rc) @@ -1003,7 +1003,7 @@ PAGER_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam) lpRect->bottom = infoPtr->nHeight; } - TRACE("[%08x] client rect set to %dx%d at (%d,%d) BtnState[%d,%d]\n", + TRACE("[%08x] client rect set to %dx%d at (%d,%d) BtnState[%d,%d]\n", hwnd, lpRect->right-lpRect->left, lpRect->bottom-lpRect->top, lpRect->left, lpRect->top, infoPtr->TLbtnState, infoPtr->BRbtnState); @@ -1046,13 +1046,13 @@ PAGER_NCPaint (HWND hwnd, WPARAM wParam, LPARAM lParam) PAGER_DrawButton(hdc, infoPtr->clrBk, rcTopLeft, bHorizontal, TRUE, infoPtr->TLbtnState); PAGER_DrawButton(hdc, infoPtr->clrBk, rcBottomRight, - bHorizontal, FALSE, infoPtr->BRbtnState); + bHorizontal, FALSE, infoPtr->BRbtnState); ReleaseDC( hwnd, hdc ); return 0; } -static INT +static INT PAGER_HitTest (HWND hwnd, LPPOINT pt) { PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); @@ -1145,7 +1145,7 @@ PAGER_SetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) { PAGER_CaptureandTrack(infoPtr, hwnd); - SendMessageA(hwnd, WM_NCPAINT, 0, 0); + SendMessageA(hwnd, WM_NCPAINT, 0, 0); } return TRUE; @@ -1226,7 +1226,7 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) /* If in one of the buttons the capture and draw buttons */ if (btnrect) { TRACE("[%08x] draw btn (%d,%d)-(%d,%d), Capture %s, style %08lx\n", - hwnd, btnrect->left, btnrect->top, + hwnd, btnrect->left, btnrect->top, btnrect->right, btnrect->bottom, (infoPtr->bCapture) ? "TRUE" : "FALSE", dwStyle); @@ -1276,7 +1276,7 @@ PAGER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) INT hit; TRACE("[%08x] at (%d,%d)\n", hwnd, SLOWORD(lParam), SHIWORD(lParam)); - + hit = PAGER_HitTest(hwnd, &pt); /* put btn in DEPRESSED state */ @@ -1284,17 +1284,17 @@ PAGER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) { repaintBtns = infoPtr->TLbtnState != PGF_DEPRESSED; infoPtr->TLbtnState = PGF_DEPRESSED; - SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0); + SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0); } else if (hit == HTRIGHT || hit == HTBOTTOM) { repaintBtns = infoPtr->BRbtnState != PGF_DEPRESSED; infoPtr->BRbtnState = PGF_DEPRESSED; - SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0); + SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0); } if (repaintBtns) - SendMessageA(hwnd, WM_NCPAINT, 0, 0); + SendMessageA(hwnd, WM_NCPAINT, 0, 0); switch(hit) { @@ -1357,11 +1357,11 @@ PAGER_Timer (HWND hwnd, WPARAM wParam) /* if initial timer, kill it and start the repeat timer */ if (wParam == TIMERID1) { if (PAGER_IsHorizontal(hwnd)) { - dir = (infoPtr->TLbtnState & PGF_DEPRESSED) ? + dir = (infoPtr->TLbtnState & PGF_DEPRESSED) ? PGF_SCROLLLEFT : PGF_SCROLLRIGHT; } else { - dir = (infoPtr->TLbtnState & PGF_DEPRESSED) ? + dir = (infoPtr->TLbtnState & PGF_DEPRESSED) ? PGF_SCROLLUP : PGF_SCROLLDOWN; } TRACE("[%08x] TIMERID1: style=%08lx, dir=%d\n", hwnd, dwStyle, dir); @@ -1369,7 +1369,7 @@ PAGER_Timer (HWND hwnd, WPARAM wParam) SetTimer(hwnd, TIMERID1, REPEAT_DELAY, 0); if (dwStyle & PGS_AUTOSCROLL) { PAGER_Scroll(hwnd, dir); - SetWindowPos(hwnd, 0,0,0,0,0, + SetWindowPos(hwnd, 0,0,0,0,0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); } @@ -1381,7 +1381,7 @@ PAGER_Timer (HWND hwnd, WPARAM wParam) KillTimer(hwnd, TIMERID2); if (infoPtr->direction > 0) { PAGER_Scroll(hwnd, infoPtr->direction); - SetTimer(hwnd, TIMERID2, REPEAT_DELAY, 0); + SetTimer(hwnd, TIMERID2, REPEAT_DELAY, 0); } return 0; } @@ -1485,7 +1485,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case PGM_RECALCSIZE: return PAGER_RecalcSize(hwnd); - + case PGM_SETBKCOLOR: return PAGER_SetBkColor (hwnd, wParam, lParam); @@ -1536,7 +1536,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return PAGER_MouseMove (hwnd, wParam, lParam); case WM_MOUSELEAVE: - return PAGER_MouseLeave (hwnd, wParam, lParam); + return PAGER_MouseLeave (hwnd, wParam, lParam); case WM_NCLBUTTONDOWN: return PAGER_NCLButtonDown (hwnd, wParam, lParam); @@ -1552,7 +1552,7 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return PAGER_EraseBackground (hwnd, wParam, lParam); /* case WM_PAINT: - return PAGER_Paint (hwnd, wParam); + return PAGER_Paint (hwnd, wParam); */ case WM_TIMER: return PAGER_Timer (hwnd, wParam); @@ -1582,7 +1582,7 @@ PAGER_Register (void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = 0; wndClass.lpszClassName = WC_PAGESCROLLERA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/progress.c b/dlls/comctl32/progress.c index 9b83fef5d41..5f9aee37b39 100644 --- a/dlls/comctl32/progress.c +++ b/dlls/comctl32/progress.c @@ -1,4 +1,4 @@ -/* +/* * Progress control * * Copyright 1997, 2002 Dimitrie O. Paun @@ -44,7 +44,7 @@ typedef struct #define UNKNOWN_PARAM(msg, wParam, lParam) WARN( \ "Unknown parameter(s) for message " #msg \ - "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); + "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); /*********************************************************************** * PROGRESS_EraseBackground @@ -103,14 +103,14 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) /* compute extent of progress bar */ if (dwStyle & PBS_VERTICAL) { - rightBar = rect.bottom - + rightBar = rect.bottom - MulDiv (infoPtr->CurVal - infoPtr->MinVal, rect.bottom - rect.top, infoPtr->MaxVal - infoPtr->MinVal); ledWidth = MulDiv (rect.right - rect.left, 2, 3); rightMost = rect.top; } else { - rightBar = rect.left + + rightBar = rect.left + MulDiv (infoPtr->CurVal - infoPtr->MinVal, rect.right - rect.left, infoPtr->MaxVal - infoPtr->MinVal); @@ -120,14 +120,14 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) /* now draw the bar */ if (dwStyle & PBS_SMOOTH) { - if (dwStyle & PBS_VERTICAL) + if (dwStyle & PBS_VERTICAL) rect.top = rightBar; - else + else rect.right = rightBar; FillRect(hdc, &rect, hbrBar); } else { if (dwStyle & PBS_VERTICAL) { - while(rect.bottom > rightBar) { + while(rect.bottom > rightBar) { rect.top = rect.bottom - ledWidth; if (rect.top < rightMost) rect.top = rightMost; @@ -135,7 +135,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) rect.bottom = rect.top - LED_GAP; } } else { - while(rect.left < rightBar) { + while(rect.left < rightBar) { rect.right = rect.left + ledWidth; if (rect.right > rightMost) rect.right = rightMost; @@ -200,7 +200,7 @@ static DWORD PROGRESS_SetRange (PROGRESS_INFO *infoPtr, int low, int high) /* if nothing changes, simply return */ if(infoPtr->MinVal == low && infoPtr->MaxVal == high) return res; - + infoPtr->MinVal = low; infoPtr->MaxVal = high; PROGRESS_CoercePos(infoPtr); @@ -210,7 +210,7 @@ static DWORD PROGRESS_SetRange (PROGRESS_INFO *infoPtr, int low, int high) /*********************************************************************** * ProgressWindowProc */ -static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, +static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { PROGRESS_INFO *infoPtr; @@ -220,7 +220,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, infoPtr = (PROGRESS_INFO *)GetWindowLongW(hwnd, 0); if (!infoPtr && message != WM_CREATE) - return DefWindowProcW( hwnd, message, wParam, lParam ); + return DefWindowProcW( hwnd, message, wParam, lParam ); switch(message) { case WM_CREATE: @@ -240,9 +240,9 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, /* initialize the info struct */ infoPtr->Self = hwnd; - infoPtr->MinVal = 0; + infoPtr->MinVal = 0; infoPtr->MaxVal = 100; - infoPtr->CurVal = 0; + infoPtr->CurVal = 0; infoPtr->Step = 10; infoPtr->ColorBar = CLR_DEFAULT; infoPtr->ColorBk = CLR_DEFAULT; @@ -250,7 +250,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, TRACE("Progress Ctrl creation, hwnd=%04x\n", hwnd); return 0; } - + case WM_DESTROY: TRACE("Progress Ctrl destruction, hwnd=%04x\n", hwnd); COMCTL32_Free (infoPtr); @@ -260,7 +260,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case WM_ERASEBKGND: PROGRESS_EraseBackground(infoPtr, wParam); return TRUE; - + case WM_GETFONT: return (LRESULT)infoPtr->Font; @@ -269,7 +269,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case WM_PAINT: return PROGRESS_Paint (infoPtr, (HDC)wParam); - + case PBM_DELTAPOS: { INT oldVal; @@ -301,7 +301,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, } return oldVal; } - + case PBM_SETRANGE: if (wParam) UNKNOWN_PARAM(PBM_SETRANGE, wParam, lParam); return PROGRESS_SetRange (infoPtr, (int)LOWORD(lParam), (int)HIWORD(lParam)); @@ -319,7 +319,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, { INT oldVal; if (wParam || lParam) UNKNOWN_PARAM(PBM_STEPIT, wParam, lParam); - oldVal = infoPtr->CurVal; + oldVal = infoPtr->CurVal; infoPtr->CurVal += infoPtr->Step; if(infoPtr->CurVal > infoPtr->MaxVal) infoPtr->CurVal = infoPtr->MinVal; @@ -335,7 +335,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, case PBM_SETRANGE32: return PROGRESS_SetRange (infoPtr, (int)wParam, (int)lParam); - + case PBM_GETRANGE: if (lParam) { ((PPBRANGE)lParam)->iLow = infoPtr->MinVal; @@ -359,11 +359,11 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, InvalidateRect(hwnd, NULL, TRUE); return 0; - default: - if (message >= WM_USER) + default: + if (message >= WM_USER) ERR("unknown msg %04x wp=%04x lp=%08lx\n", message, wParam, lParam ); - return DefWindowProcW( hwnd, message, wParam, lParam ); - } + return DefWindowProcW( hwnd, message, wParam, lParam ); + } } diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index ae3e929e525..60ad2cd3a25 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -88,7 +88,7 @@ typedef struct * Defines and global variables */ -const WCHAR PropSheetInfoStr[] = +const WCHAR PropSheetInfoStr[] = {'P','r','o','p','e','r','t','y','S','h','e','e','t','I','n','f','o',0 }; #define MAX_CAPTION_LENGTH 255 @@ -442,7 +442,7 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, default: p += lstrlenW( (LPCWSTR)p ) + 1; break; - } + } /* class */ switch ((WORD)*p) @@ -491,14 +491,14 @@ BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, /* * Build the image list for icons */ - if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID)) + if ((dwFlags & PSP_USEHICON) || (dwFlags & PSP_USEICONID)) { HICON hIcon; int icon_cx = GetSystemMetrics(SM_CXSMICON); int icon_cy = GetSystemMetrics(SM_CYSMICON); if (dwFlags & PSP_USEICONID) - hIcon = LoadImageW(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON, + hIcon = LoadImageW(lppsp->hInstance, lppsp->u2.pszIcon, IMAGE_ICON, icon_cx, icon_cy, LR_DEFAULTCOLOR); else hIcon = lppsp->u2.hIcon; @@ -577,7 +577,7 @@ BOOL PROPSHEET_CreateDialog(PropSheetInfo* psInfo) /****************************************************************************** * PROPSHEET_SizeMismatch - * + * * Verify that the tab control and the "largest" property sheet page dlg. template * match in size. */ @@ -701,7 +701,7 @@ static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo) rc.bottom = rc.top + tabRect.bottom - tabRect.top; psInfo->height = MulDiv((rc.bottom - rc.top),8,units.top); } - + if ((rc.right - rc.left) < (tabRect.right - tabRect.left)) { rc.right = rc.left + tabRect.right - tabRect.left; @@ -778,7 +778,7 @@ static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, PropSheetInfo* psInfo) rc.bottom = rc.top + tabRect.bottom - tabRect.top; psInfo->height = MulDiv((rc.bottom - rc.top), 8, units.top); } - + if ((rc.right - rc.left) < (tabRect.right - tabRect.left)) { rc.right = rc.left + tabRect.right - tabRect.left; @@ -828,10 +828,10 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo) /* * Get the size of the property sheet. - */ + */ GetClientRect(hwndParent, &rcSheet); - /* + /* * All buttons will be at this y coordinate. */ y = rcSheet.bottom - (padding.y + buttonHeight); @@ -867,7 +867,7 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo) x = rcSheet.right - ((padding.x + buttonWidth) * 2); else x = rcSheet.right - (padding.x + buttonWidth); - + SetWindowPos(hwndButton, 0, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); @@ -884,7 +884,7 @@ static BOOL PROPSHEET_AdjustButtons(HWND hwndParent, PropSheetInfo* psInfo) if (psInfo->hasHelp) { x = rcSheet.right - (padding.x + buttonWidth); - + SetWindowPos(hwndButton, 0, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); } @@ -1063,7 +1063,7 @@ static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheet idButton = IDCANCEL; } } - + hwndControl = GetDlgItem(hwndDlg, idButton); GetWindowRect(hwndControl, &rc); @@ -1325,7 +1325,7 @@ static BOOL PROPSHEET_Back(HWND hwndDlg) psn.hdr.hwndFrom = hwndDlg; psn.hdr.idFrom = 0; psn.lParam = 0; - + hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; result = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); @@ -1364,7 +1364,7 @@ static BOOL PROPSHEET_Next(HWND hwndDlg) psn.hdr.hwndFrom = hwndDlg; psn.hdr.idFrom = 0; psn.lParam = 0; - + hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); @@ -1403,7 +1403,7 @@ static BOOL PROPSHEET_Finish(HWND hwndDlg) psn.hdr.hwndFrom = hwndDlg; psn.hdr.idFrom = 0; psn.lParam = 0; - + hwndPage = psInfo->proppage[psInfo->active_page].hwndPage; msgResult = SendMessageW(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); @@ -1440,7 +1440,7 @@ static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam) psn.hdr.hwndFrom = hwndDlg; psn.hdr.idFrom = 0; psn.lParam = 0; - + /* * Send PSN_KILLACTIVE to the current page. @@ -1457,7 +1457,7 @@ static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam) */ psn.hdr.code = PSN_APPLY; psn.lParam = lParam; - + for (i = 0; i < psInfo->nPages; i++) { hwndPage = psInfo->proppage[i].hwndPage; @@ -1504,13 +1504,13 @@ static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam) psn.hdr.hwndFrom = hwndDlg; psn.hdr.idFrom = 0; psn.lParam = 0; - + if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn)) return; psn.hdr.code = PSN_RESET; psn.lParam = lParam; - + for (i = 0; i < psInfo->nPages; i++) { hwndPage = psInfo->proppage[i].hwndPage; @@ -1547,7 +1547,7 @@ static void PROPSHEET_Help(HWND hwndDlg) psn.hdr.hwndFrom = hwndDlg; psn.hdr.idFrom = 0; psn.lParam = 0; - + SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); } @@ -1649,7 +1649,7 @@ static void PROPSHEET_PressButton(HWND hwndDlg, int buttonID) /************************************************************************* - * BOOL PROPSHEET_CanSetCurSel [Internal] + * BOOL PROPSHEET_CanSetCurSel [Internal] * * Test whether the current page can be changed by sending a PSN_KILLACTIVE * @@ -1778,7 +1778,7 @@ static void PROPSHEET_SetTitleA(HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText) if(HIWORD(lpszText)) { WCHAR szTitle[256]; - MultiByteToWideChar(CP_ACP, 0, lpszText, -1, + MultiByteToWideChar(CP_ACP, 0, lpszText, -1, szTitle, sizeof szTitle); PROPSHEET_SetTitleW(hwndDlg, dwStyle, szTitle); } @@ -1798,7 +1798,7 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText) TRACE("'%s' (style %08lx)\n", debugstr_w(lpszText), dwStyle); if (HIWORD(lpszText) == 0) { - if (!LoadStringW(psInfo->ppshheader.hInstance, + if (!LoadStringW(psInfo->ppshheader.hInstance, LOWORD(lpszText), szTitle, sizeof(szTitle)-sizeof(WCHAR))) return; lpszText = szTitle; @@ -2020,14 +2020,14 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg, DestroyPropertySheetPage(psInfo->proppage[index].hpage); } - + /* Remove the tab */ SendMessageW(hwndTabControl, TCM_DELETEITEM, index, 0); psInfo->nPages--; psInfo->proppage = COMCTL32_Alloc(sizeof(PropPageInfo) * psInfo->nPages); - if (index > 0) + if (index > 0) memcpy(&psInfo->proppage[0], &oldPages[0], index * sizeof(PropPageInfo)); if (index < psInfo->nPages) @@ -2256,16 +2256,16 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) && HIWORD( ppsp->u.pszTemplate ) ) { - PROPSHEET_AtoW(&ppsp->u.pszTemplate, lpPropSheetPage->u.pszTemplate); + PROPSHEET_AtoW(&ppsp->u.pszTemplate, lpPropSheetPage->u.pszTemplate); } if ( (ppsp->dwFlags & PSP_USEICONID) && HIWORD( ppsp->u2.pszIcon ) ) { - PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon); + PROPSHEET_AtoW(&ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon); } if ((ppsp->dwFlags & PSP_USETITLE) && HIWORD( ppsp->pszTitle )) { - PROPSHEET_AtoW(&ppsp->pszTitle, lpPropSheetPage->pszTitle); + PROPSHEET_AtoW(&ppsp->pszTitle, lpPropSheetPage->pszTitle); } else if ( !(ppsp->dwFlags & PSP_USETITLE) ) ppsp->pszTitle = NULL; @@ -2455,7 +2455,7 @@ static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID) BOOL WINAPI PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", + TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", hwnd, uMsg, wParam, lParam); switch (uMsg) @@ -2471,8 +2471,8 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) SetPropW(hwnd, PropSheetInfoStr, (HANDLE)psInfo); /* - * psInfo->hwnd is not being used by WINE code - it exists - * for compatibility with "real" Windoze. The same about + * psInfo->hwnd is not being used by WINE code - it exists + * for compatibility with "real" Windoze. The same about * SetWindowLong - WINE is only using the PropSheetInfoStr * property. */ @@ -2500,7 +2500,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) SendMessageW(hwnd, WM_SETICON, 0, hIcon); } - + if (psInfo->ppshheader.dwFlags & PSH_USEHICON) SendMessageW(hwnd, WM_SETICON, 0, psInfo->ppshheader.u.hIcon); @@ -2527,14 +2527,14 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } } - if (psInfo->useCallback) - (*(psInfo->ppshheader.pfnCallback))(hwnd, - PSCB_INITIALIZED, (LPARAM)0); + if (psInfo->useCallback) + (*(psInfo->ppshheader.pfnCallback))(hwnd, + PSCB_INITIALIZED, (LPARAM)0); idx = psInfo->active_page; ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[idx].hpage; psInfo->active_page = -1; - + PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage); /* doing TCM_SETCURSEL seems to be needed even in case of PSH_WIZARD, @@ -2547,7 +2547,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { WCHAR szText[256]; - if (LoadStringW(psInfo->ppshheader.hInstance, + if (LoadStringW(psInfo->ppshheader.hInstance, (UINT)psInfo->ppshheader.pszCaption, szText, 255)) PROPSHEET_SetTitleW(hwnd, psInfo->ppshheader.dwFlags, szText); } @@ -2649,7 +2649,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) EnableWindow(hwndCancel, FALSE); if (LoadStringW(COMCTL32_hModule, IDS_CLOSE, buf, sizeof(buf))) SetWindowTextW(hwndOK, buf); - + return FALSE; } @@ -2664,7 +2664,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case PSM_REBOOTSYSTEM: { - PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, + PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr); psInfo->rebootSystem = TRUE; @@ -2674,7 +2674,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case PSM_SETTITLEA: PROPSHEET_SetTitleA(hwnd, (DWORD) wParam, (LPCSTR) lParam); return TRUE; - + case PSM_SETTITLEW: PROPSHEET_SetTitleW(hwnd, (DWORD) wParam, (LPCWSTR) lParam); return TRUE; @@ -2730,7 +2730,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; case PSM_SETFINISHTEXTA: - PROPSHEET_SetFinishTextA(hwnd, (LPCSTR) lParam); + PROPSHEET_SetFinishTextA(hwnd, (LPCSTR) lParam); return TRUE; case PSM_SETWIZBUTTONS: @@ -2742,13 +2742,13 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return FALSE; case PSM_SETFINISHTEXTW: - PROPSHEET_SetFinishTextW(hwnd, (LPCWSTR) lParam); + PROPSHEET_SetFinishTextW(hwnd, (LPCWSTR) lParam); return FALSE; default: return FALSE; } - + return FALSE; } diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 94d934e9251..afe943138e1 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -46,7 +46,7 @@ * TODO: * - vertical placement * - ComboBox and ComboBoxEx placement - * - center image + * - center image * - Layout code. * - Display code. * - Some messages. @@ -55,11 +55,11 @@ * Changes Guy Albertelli * rev 2,3,4 * - Implement initial version of row grouping, row separators, - * text and background colors. Support additional messages. + * text and background colors. Support additional messages. * Support RBBS_BREAK. Implement ERASEBKGND and improve painting. * rev 5 * - implement support for dragging Gripper left or right in a row. Supports - * WM_LBUTTONDOWN, WM_LBUTTONUP, and WM_MOUSEMOVE. Also support + * WM_LBUTTONDOWN, WM_LBUTTONUP, and WM_MOUSEMOVE. Also support * RBS_BANDBORDERS. * rev 6 * - Fix or implement notifications for RBN_HEIGHTCHANGE, RBN_CHILDSIZE. @@ -68,7 +68,7 @@ * * rev 7 * - Fix algorithm for _Layout and _AdjustBand. - * - Fix or implement RBN_ENDDRAG, RB_MOVEBAND, WM_SETREDRAW, + * - Fix or implement RBN_ENDDRAG, RB_MOVEBAND, WM_SETREDRAW, * WM_STYLECHANGED, RB_MINIMIZEBAND, RBBS_VARIABLEHEIGHT, RBS_VARHEIGHT, * RBBS_HIDDEN, WM_NOTIFYFORMAT, NM_NCHITTEST, WM_SETREDRAW, RBS_AUTOSIZE, * WM_SETFONT, RBS_BORDERS @@ -87,7 +87,7 @@ * 7. Invalidate window rectangles after SetBandInfo, InsertBand, ShowBand * so that repainting is correct. * 8. Implement RB_MAXIMIZEBAND for the "ideal=TRUE" case. - * 9. Implement item custom draw notifications partially. Only done for + * 9. Implement item custom draw notifications partially. Only done for * ITEMPREPAINT and ITEMPOSTPAINT. (Used by IE4 for "Favorites" frame * to draw the word "Favorites"). * rev 8a @@ -96,7 +96,7 @@ * number (0) to indicate *no* band. * 12. Fix CCS_VERT errors in _ForceResize, _NCCalcSize, and _NCPaint. * 13. Support some special cases of CCS_TOP (and therefore CCS_LEFT), - * CCS_BOTTOM (and therefore CCS_RIGHT) and CCS_NOPARENTALIGN. Not + * CCS_BOTTOM (and therefore CCS_RIGHT) and CCS_NOPARENTALIGN. Not * at all sure whether this is all cases. * 14. Handle returned value for the RBN_CHILDSIZE notify. * 15. Implement RBBS_CHILDEDGE, and set each bands "offChild" at _Layout @@ -121,10 +121,10 @@ * 2. Following still not handled: RBBS_FIXEDBMP, * RBBS_USECHEVRON, CCS_NORESIZE, * CCS_NOMOVEX, CCS_NOMOVEY - * 3. Following are only partially handled: + * 3. Following are only partially handled: * RBS_AUTOSIZE, RBBS_VARIABLEHEIGHT * 5. Native uses (on each draw!!) SM_CYBORDER (or SM_CXBORDER for CCS_VERT) - * to set the size of the separator width (the value SEP_WIDTH_SIZE + * to set the size of the separator width (the value SEP_WIDTH_SIZE * in here). Should be fixed!! * 6. The following messages are not implemented: * RB_BEGINDRAG, RB_DRAGMOVE, RB_ENDDRAG, RB_GETCOLORSCHEME, @@ -236,7 +236,7 @@ typedef struct BOOL bUnicode; /* TRUE if this window is W type */ BOOL NtfUnicode; /* TRUE if parent wants notify in W format */ BOOL DoRedraw; /* TRUE to acutally draw bands */ - UINT fStatus; /* Status flags (see below) */ + UINT fStatus; /* Status flags (see below) */ HCURSOR hcurArrow; /* handle to the arrow cursor */ HCURSOR hcurHorz; /* handle to the EW cursor */ HCURSOR hcurVert; /* handle to the NS cursor */ @@ -400,7 +400,7 @@ REBAR_DumpBandInfo( LPREBARBANDINFOA pB) { if( !TRACE_ON(rebar) ) return; TRACE("band info: ID=%u, size=%u, child=%04x, clrF=0x%06lx, clrB=0x%06lx\n", - pB->wID, pB->cbSize, pB->hwndChild, pB->clrFore, pB->clrBack); + pB->wID, pB->cbSize, pB->hwndChild, pB->clrFore, pB->clrBack); TRACE("band info: mask=0x%08x (%s)\n", pB->fMask, REBAR_FmtMask(pB->fMask)); if (pB->fMask & RBBIM_STYLE) TRACE("band info: style=0x%08x (%s)\n", pB->fStyle, REBAR_FmtStyle(pB->fStyle)); @@ -418,7 +418,7 @@ REBAR_DumpBandInfo( LPREBARBANDINFOA pB) } if (pB->fMask & RBBIM_CHILDSIZE) TRACE("band info: xMin=%u, yMin=%u, yChild=%u, yMax=%u, yIntgl=%u\n", - pB->cxMinChild, + pB->cxMinChild, pB->cyMinChild, pB->cyChild, pB->cyMaxChild, pB->cyIntegral); } @@ -430,7 +430,7 @@ REBAR_DumpBand (REBAR_INFO *iP) if(! TRACE_ON(rebar) ) return; - TRACE("hwnd=%04x: color=%08lx/%08lx, bands=%u, rows=%u, cSize=%ld,%ld\n", + TRACE("hwnd=%04x: color=%08lx/%08lx, bands=%u, rows=%u, cSize=%ld,%ld\n", iP->hwndSelf, iP->clrText, iP->clrBk, iP->uNumBands, iP->uNumRows, iP->calcSize.cx, iP->calcSize.cy); TRACE("hwnd=%04x: flags=%08x, dragStart=%d,%d, dragNow=%d,%d, ihitBand=%d\n", @@ -446,9 +446,9 @@ REBAR_DumpBand (REBAR_INFO *iP) i, pB->wID, pB->hwndChild, pB->iRow, pB->clrFore, pB->clrBack); TRACE("band # %u: mask=0x%08x (%s)\n", i, pB->fMask, REBAR_FmtMask(pB->fMask)); if (pB->fMask & RBBIM_STYLE) - TRACE("band # %u: style=0x%08x (%s)\n", + TRACE("band # %u: style=0x%08x (%s)\n", i, pB->fStyle, REBAR_FmtStyle(pB->fStyle)); - TRACE("band # %u: uMinH=%u xHeader=%u", + TRACE("band # %u: uMinH=%u xHeader=%u", i, pB->uMinHeight, pB->cxHeader); if (pB->fMask & (RBBIM_SIZE | RBBIM_IDEALSIZE | RBBIM_LPARAM )) { if (pB->fMask & RBBIM_SIZE) @@ -604,7 +604,7 @@ REBAR_DrawBand (HDC hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand) DT_CENTER | DT_VCENTER | DT_SINGLELINE); if (oldBkMode != TRANSPARENT) SetBkMode (hdc, oldBkMode); - if (lpBand->clrFore != CLR_NONE) + if (lpBand->clrFore != CLR_NONE) SetTextColor (hdc, oldcolor); SelectObject (hdc, hOldFont); } @@ -635,10 +635,10 @@ REBAR_Refresh (REBAR_INFO *infoPtr, HDC hdc) for (i = 0; i < infoPtr->uNumBands; i++) { lpBand = &infoPtr->bands[i]; - if (HIDDENBAND(lpBand)) continue; + if (HIDDENBAND(lpBand)) continue; /* now draw the band */ - TRACE("[%04x] drawing band %i, flags=%08x\n", + TRACE("[%04x] drawing band %i, flags=%08x\n", infoPtr->hwndSelf, i, lpBand->fDraw); REBAR_DrawBand (hdc, infoPtr, lpBand); @@ -649,7 +649,7 @@ REBAR_Refresh (REBAR_INFO *infoPtr, HDC hdc) static void REBAR_FixVert (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend, INT mcy) - /* Function: */ + /* Function: */ /* Cycle through bands in row and fix height of each band. */ /* Also determine whether each band has changed. */ /* On entry: */ @@ -718,7 +718,7 @@ REBAR_AdjustBands (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend, /* a. inflate band till either all extra space used */ /* or band's ->ccx reached. */ /* If any band modified, add any space left to last band */ - /* adjusted. */ + /* adjusted. */ /* */ /* ****************************************************** */ lpBand = &infoPtr->bands[rowend]; @@ -771,7 +771,7 @@ REBAR_AdjustBands (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend, } if ((x >= maxx) || (last_adjusted != -1)) { if (x > maxx) { - ERR("Phase 1 failed, x=%d, maxx=%d, start=%u, end=%u\n", + ERR("Phase 1 failed, x=%d, maxx=%d, start=%u, end=%u\n", x, maxx, rowstart, rowend); } /* done, so spread extra space */ @@ -841,7 +841,7 @@ REBAR_AdjustBands (REBAR_INFO *infoPtr, UINT rowstart, UINT rowend, } if (x >= maxx) { if (x > maxx) { - ERR("Phase 2 failed, x=%d, maxx=%d, start=%u, end=%u\n", + ERR("Phase 2 failed, x=%d, maxx=%d, start=%u, end=%u\n", x, maxx, rowstart, rowend); } /* done, so spread extra space */ @@ -909,7 +909,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) if (lpBand->fStatus & (HAS_IMAGE | HAS_TEXT)) /* if no gripper but either image or text, then leave space */ xoff = REBAR_ALWAYS_SPACE; - SetRect (&lpBand->rcCapImage, + SetRect (&lpBand->rcCapImage, lpBand->rcBand.left+xoff, lpBand->rcBand.top, lpBand->rcBand.left+xoff, lpBand->rcBand.bottom); } @@ -924,7 +924,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) SetRect (&lpBand->rcCapText, lpBand->rcCapImage.right+REBAR_POST_IMAGE, lpBand->rcBand.top+1, lpBand->rcBand.left+lpBand->cxHeader, lpBand->rcBand.bottom-1); - /* update band height + /* update band height if (lpBand->uMinHeight < infoPtr->imageSize.cy + 2) { lpBand->uMinHeight = infoPtr->imageSize.cy + 2; lpBand->rcBand.bottom = lpBand->rcBand.top + lpBand->uMinHeight; @@ -939,7 +939,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) /* text is visible */ if (lpBand->fStatus & HAS_TEXT) { lpBand->fDraw |= DRAW_TEXT; - lpBand->rcCapText.right = max(lpBand->rcCapText.left, + lpBand->rcCapText.right = max(lpBand->rcCapText.left, lpBand->rcCapText.right-REBAR_POST_TEXT); } @@ -958,7 +958,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) } /* flag if notify required and invalidate rectangle */ - if (notify && + if (notify && ((oldChild.right-oldChild.left != lpBand->rcChild.right-lpBand->rcChild.left) || (oldChild.bottom-oldChild.top != lpBand->rcChild.bottom-lpBand->rcChild.top))) { TRACE("Child rectangle changed for band %u\n", i); @@ -970,9 +970,9 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) } if (lpBand->fDraw & NTF_INVALIDATE) { TRACE("invalidating (%d,%d)-(%d,%d)\n", - lpBand->rcBand.left, + lpBand->rcBand.left, lpBand->rcBand.top, - lpBand->rcBand.right + ((lpBand->fDraw & DRAW_RIGHTSEP) ? SEP_WIDTH_SIZE : 0), + lpBand->rcBand.right + ((lpBand->fDraw & DRAW_RIGHTSEP) ? SEP_WIDTH_SIZE : 0), lpBand->rcBand.bottom + ((lpBand->fDraw & DRAW_BOTTOMSEP) ? SEP_WIDTH_SIZE : 0)); lpBand->fDraw &= ~NTF_INVALIDATE; work = lpBand->rcBand; @@ -1046,7 +1046,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) /* if no gripper but either image or text, then leave space */ xoff = REBAR_ALWAYS_SPACE; /* initialize Caption image rectangle */ - SetRect (&lpBand->rcCapImage, + SetRect (&lpBand->rcCapImage, lpBand->rcBand.left, lpBand->rcBand.top+xoff, lpBand->rcBand.right, lpBand->rcBand.top+xoff); } @@ -1059,7 +1059,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) lpBand->rcCapImage.bottom += infoPtr->imageSize.cy; /* set initial caption text rectangle */ - SetRect (&lpBand->rcCapText, + SetRect (&lpBand->rcCapText, lpBand->rcBand.left, lpBand->rcCapImage.bottom+REBAR_POST_IMAGE, lpBand->rcBand.right, lpBand->rcBand.top+lpBand->cxHeader); /* update band height * @@ -1070,7 +1070,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) } else { /* set initial caption text rectangle */ - SetRect (&lpBand->rcCapText, + SetRect (&lpBand->rcCapText, lpBand->rcBand.left, lpBand->rcCapImage.bottom, lpBand->rcBand.right, lpBand->rcBand.top+lpBand->cxHeader); } @@ -1097,7 +1097,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) } /* flag if notify required and invalidate rectangle */ - if (notify && + if (notify && ((oldChild.right-oldChild.left != lpBand->rcChild.right-lpBand->rcChild.left) || (oldChild.bottom-oldChild.top != lpBand->rcChild.bottom-lpBand->rcChild.top))) { TRACE("Child rectangle changed for band %u\n", i); @@ -1109,9 +1109,9 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, UINT rstart, UINT rend, BOOL notify) } if (lpBand->fDraw & NTF_INVALIDATE) { TRACE("invalidating (%d,%d)-(%d,%d)\n", - lpBand->rcBand.left, + lpBand->rcBand.left, lpBand->rcBand.top, - lpBand->rcBand.right + ((lpBand->fDraw & DRAW_BOTTOMSEP) ? SEP_WIDTH_SIZE : 0), + lpBand->rcBand.right + ((lpBand->fDraw & DRAW_BOTTOMSEP) ? SEP_WIDTH_SIZE : 0), lpBand->rcBand.bottom + ((lpBand->fDraw & DRAW_RIGHTSEP) ? SEP_WIDTH_SIZE : 0)); lpBand->fDraw &= ~NTF_INVALIDATE; work = lpBand->rcBand; @@ -1258,7 +1258,7 @@ REBAR_MoveChildWindows (REBAR_INFO *infoPtr, UINT start, UINT endplus) rbcz.wID = lpBand->wID; rbcz.rcChild = lpBand->rcChild; rbcz.rcBand = lpBand->rcBand; - if (infoPtr->dwStyle & CCS_VERT) + if (infoPtr->dwStyle & CCS_VERT) rbcz.rcBand.top += lpBand->cxHeader; else rbcz.rcBand.left += lpBand->cxHeader; @@ -1400,7 +1400,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) } /* save height of original control */ - if (infoPtr->dwStyle & CCS_VERT) + if (infoPtr->dwStyle & CCS_VERT) origheight = infoPtr->calcSize.cx; else origheight = infoPtr->calcSize.cy; @@ -1439,10 +1439,10 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) lpBand->offChild.cy = ((lpBand->fStyle & RBBS_CHILDEDGE) ? 2 : 0); /* separator from previous band */ - cxsep = (cntonrow == 0) ? 0 : SEP_WIDTH; + cxsep = (cntonrow == 0) ? 0 : SEP_WIDTH; /* Header: includes gripper, text, image */ - cx = lpBand->cxHeader; + cx = lpBand->cxHeader; if (lpBand->fStyle & RBBS_FIXEDSIZE) cx = lpBand->lcx; if (infoPtr->dwStyle & CCS_VERT) @@ -1484,7 +1484,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) cntonrow = 0; } - if (mcy < lpBand->lcy + REBARSPACE(lpBand)) + if (mcy < lpBand->lcy + REBARSPACE(lpBand)) mcy = lpBand->lcy + REBARSPACE(lpBand); /* if boundary rect specified then limit mcy */ @@ -1513,7 +1513,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) rightx = clientcx; bottomy = (lpRect) ? min(clientcy, y+cxsep+cx) : y+cxsep+cx; lpBand->rcBand.left = x; - lpBand->rcBand.right = x + min(mcy, + lpBand->rcBand.right = x + min(mcy, lpBand->lcy+REBARSPACE(lpBand)); lpBand->rcBand.top = min(bottomy, y + cxsep); lpBand->rcBand.bottom = bottomy; @@ -1527,7 +1527,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) lpBand->rcBand.left = min(rightx, x + cxsep); lpBand->rcBand.right = rightx; lpBand->rcBand.top = y; - lpBand->rcBand.bottom = y + min(mcy, + lpBand->rcBand.bottom = y + min(mcy, lpBand->lcy+REBARSPACE(lpBand)); lpBand->uMinHeight = lpBand->lcy; x = rightx; @@ -1615,7 +1615,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) REBAR_BAND *prev, *current, *walk; /* FIXME: problem # 2 */ - if (((infoPtr->dwStyle & CCS_VERT) ? + if (((infoPtr->dwStyle & CCS_VERT) ? #if PROBLEM2 (x < adjcx) : (y < adjcy) #else @@ -1697,7 +1697,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) walk->rcBand.bottom += adj_rh; } } - if ((infoPtr->dwStyle & CCS_VERT) ? (x >= adjcx) : (y >= adjcy)) + if ((infoPtr->dwStyle & CCS_VERT) ? (x >= adjcx) : (y >= adjcy)) break; /* all done */ } } @@ -1761,7 +1761,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) lpBand = &infoPtr->bands[iband]; if(HIDDENBAND(lpBand)) continue; if (lpBand->fMask & RBBS_VARIABLEHEIGHT) continue; - if (((INT)lpBand->cyMaxChild < 1) || + if (((INT)lpBand->cyMaxChild < 1) || ((INT)lpBand->cyIntegral < 1)) { if (lpBand->cyMaxChild + lpBand->cyIntegral == 0) continue; ERR("P2b band %u RBBS_VARIABLEHEIGHT set but cyMax=%d, cyInt=%d\n", @@ -1769,9 +1769,9 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) continue; } /* j is now the maximum height/width in the client area */ - j = ((diff / lpBand->cyIntegral) * lpBand->cyIntegral) + + j = ((diff / lpBand->cyIntegral) * lpBand->cyIntegral) + ircBw(lpBand); - if (j > lpBand->cyMaxChild + REBARSPACE(lpBand)) + if (j > lpBand->cyMaxChild + REBARSPACE(lpBand)) j = lpBand->cyMaxChild + REBARSPACE(lpBand); diff -= (j - ircBw(lpBand)); if (infoPtr->dwStyle & CCS_VERT) @@ -1827,7 +1827,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) p = &infoPtr->rows[i-1]; mcy = 0; - TRACE("P3 processing row %d, starting band %d, ending band %d\n", + TRACE("P3 processing row %d, starting band %d, ending band %d\n", i, p->istartband, p->iendband); /* Find the largest height of the bands in the row */ @@ -1839,7 +1839,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) } REBAR_AdjustBands (infoPtr, p->istartband, p->iendband, - (infoPtr->dwStyle & CCS_VERT) ? + (infoPtr->dwStyle & CCS_VERT) ? clientcy : clientcx, mcy); } @@ -1849,7 +1849,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) notify); } else { - REBAR_CalcHorzBand (infoPtr, 0, infoPtr->uNumBands, + REBAR_CalcHorzBand (infoPtr, 0, infoPtr->uNumBands, notify); } } @@ -1875,7 +1875,7 @@ REBAR_Layout (REBAR_INFO *infoPtr, LPRECT lpRect, BOOL notify, BOOL resetclient) infoPtr->calcSize.cy = y; TRACE("horz, notify=%d, y=%d, origheight=%d\n", notify, y, origheight); - if (notify && (y != origheight)) infoPtr->fStatus |= NTF_HGHTCHG; + if (notify && (y != origheight)) infoPtr->fStatus |= NTF_HGHTCHG; } REBAR_DumpBand (infoPtr); @@ -1942,7 +1942,7 @@ REBAR_ValidateBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand) /* calculate gripper rectangle */ if ( (!(lpBand->fStyle & RBBS_NOGRIPPER)) && - ( (lpBand->fStyle & RBBS_GRIPPERALWAYS) || + ( (lpBand->fStyle & RBBS_GRIPPERALWAYS) || ( !(lpBand->fStyle & RBBS_FIXEDSIZE) && (nonfixed > 1))) ) { lpBand->fStatus |= HAS_GRIPPER; @@ -2185,7 +2185,7 @@ REBAR_InternalEraseBkGnd (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, REC rect = lpBand->rcBand; TRACE("%s background color=0x%06lx, band (%d,%d)-(%d,%d), clip (%d,%d)-(%d,%d)\n", - (lpBand->clrBack == CLR_NONE) ? "none" : + (lpBand->clrBack == CLR_NONE) ? "none" : ((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""), GetBkColor(hdc), lpBand->rcBand.left,lpBand->rcBand.top, @@ -2392,7 +2392,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove) /* a one to separate each band. */ if (i < ihitBand) LHeaderSum += (band->lcx + SEP_WIDTH); - else + else RHeaderSum += (band->lcx + SEP_WIDTH); } @@ -2425,7 +2425,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove) imaxdBand, LHeaderSum, RHeaderSum); REBAR_DumpBand (infoPtr); - if (movement < 0) { + if (movement < 0) { /* *** Drag left/up *** */ compress = rcBlt(hitBand) - rcBlt(mindBand) - @@ -2442,7 +2442,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove) if (i == ihitBand) { LEADJ(band, movement) } - else + else movement = REBAR_Shrink (infoPtr, band, movement, i); band->ccx = rcBw(band); } @@ -2465,7 +2465,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove) first = FALSE; READJ(band, movement) } - else + else movement = REBAR_Shrink (infoPtr, band, movement, i); band->ccx = rcBw(band); } @@ -2477,7 +2477,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove) FALSE); } else { - REBAR_CalcHorzBand (infoPtr, imindBand, imaxdBand+1, + REBAR_CalcHorzBand (infoPtr, imindBand, imaxdBand+1, FALSE); } @@ -2485,7 +2485,7 @@ REBAR_HandleLRDrag (REBAR_INFO *infoPtr, POINTS *ptsmove) imindBand, imaxdBand); REBAR_DumpBand (infoPtr); - SetRect (&newrect, + SetRect (&newrect, mindBand->rcBand.left, mindBand->rcBand.top, maxdBand->rcBand.right, @@ -2652,7 +2652,7 @@ REBAR_GetBandInfoA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) lprbbi->lpText, lprbbi->cch, NULL, NULL )) lprbbi->lpText[lprbbi->cch-1] = 0; } - else + else *lprbbi->lpText = 0; } @@ -2734,7 +2734,7 @@ REBAR_GetBandInfoW (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) if ((lprbbi->fMask & RBBIM_TEXT) && (lprbbi->lpText)) { if (lpBand->lpText && (lpBand->fMask & RBBIM_TEXT)) lstrcpynW (lprbbi->lpText, lpBand->lpText, lprbbi->cch); - else + else *lprbbi->lpText = 0; } @@ -2922,7 +2922,7 @@ REBAR_GetToolTips (REBAR_INFO *infoPtr) inline static LRESULT REBAR_GetUnicodeFormat (REBAR_INFO *infoPtr) { - TRACE("%s hwnd=0x%x\n", + TRACE("%s hwnd=0x%x\n", infoPtr->bUnicode ? "TRUE" : "FALSE", infoPtr->hwndSelf); return infoPtr->bUnicode; @@ -2940,7 +2940,7 @@ REBAR_GetVersion (REBAR_INFO *infoPtr) static LRESULT REBAR_HitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { - LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam; + LPRBHITTESTINFO lprbht = (LPRBHITTESTINFO)lParam; if (!lprbht) return -1; @@ -3249,7 +3249,7 @@ REBAR_MinimizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) } startBand = uBand; endBand = iprevBand; - SetRect (&newrect, + SetRect (&newrect, lpBand->rcBand.left, lpBand->rcBand.top, band->rcBand.right, @@ -3275,7 +3275,7 @@ REBAR_MinimizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) } startBand = iprevBand; endBand = uBand; - SetRect (&newrect, + SetRect (&newrect, band->rcBand.left, band->rcBand.top, lpBand->rcBand.right, @@ -3290,7 +3290,7 @@ REBAR_MinimizeBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) FALSE); } else { - REBAR_CalcHorzBand (infoPtr, startBand, endBand+1, + REBAR_CalcHorzBand (infoPtr, startBand, endBand+1, FALSE); } @@ -3553,12 +3553,12 @@ REBAR_SetUnicodeFormat (REBAR_INFO *infoPtr, WPARAM wParam) { BOOL bTemp = infoPtr->bUnicode; - TRACE("to %s hwnd=0x%04x, was %s\n", + TRACE("to %s hwnd=0x%04x, was %s\n", ((BOOL)wParam) ? "TRUE" : "FALSE", infoPtr->hwndSelf, (bTemp) ? "TRUE" : "FALSE"); infoPtr->bUnicode = (BOOL)wParam; - + return bTemp; } @@ -3892,7 +3892,7 @@ REBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam) /* get font handle for Caption Font */ ncm.cbSize = sizeof(NONCLIENTMETRICSA); - SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, + SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); /* if the font is bold, set to normal */ if (ncm.lfCaptionFont.lfWeight > FW_NORMAL) { @@ -3952,14 +3952,14 @@ REBAR_NCHitTest (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) POINTSTOPOINT(pt, shortpt); clpt = pt; ScreenToClient (infoPtr->hwndSelf, &clpt); - REBAR_InternalHitTest (infoPtr, &clpt, &scrap, + REBAR_InternalHitTest (infoPtr, &clpt, &scrap, (INT *)&nmmouse.dwItemSpec); nmmouse.dwItemData = 0; nmmouse.pt = clpt; nmmouse.dwHitInfo = 0; if ((i = REBAR_Notify((NMHDR *) &nmmouse, infoPtr, NM_NCHITTEST))) { TRACE("notify changed return value from %ld to %d\n", - ret, i); + ret, i); ret = (LRESULT) i; } TRACE("returning %ld, client point (%ld,%ld)\n", ret, clpt.x, clpt.y); @@ -4101,7 +4101,7 @@ REBAR_SetRedraw (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) * Handles the WM_SETREDRAW message. * * Documentation: - * According to testing V4.71 of COMCTL32 returns the + * According to testing V4.71 of COMCTL32 returns the * *previous* status of the redraw flag (either 0 or -1) * instead of the MSDN documented value of 0 if handled * @@ -4109,7 +4109,7 @@ REBAR_SetRedraw (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { BOOL oldredraw = infoPtr->DoRedraw; - TRACE("set to %s, fStatus=%08x\n", + TRACE("set to %s, fStatus=%08x\n", (wParam) ? "TRUE" : "FALSE", infoPtr->fStatus); infoPtr->DoRedraw = (BOOL) wParam; if (wParam) { @@ -4152,11 +4152,11 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TRACE("win rect (%d,%d)-(%d,%d)\n", rcWin.left, rcWin.top, rcWin.right, rcWin.bottom); - if ((lParam == 0) && (rcWin.right-rcWin.left == 0) && + if ((lParam == 0) && (rcWin.right-rcWin.left == 0) && (rcWin.bottom-rcWin.top == 0)) { /* native control seems to do this */ GetClientRect (GetParent(infoPtr->hwndSelf), &rcClient); - TRACE("sizing rebar, message and client zero, parent client (%d,%d)\n", + TRACE("sizing rebar, message and client zero, parent client (%d,%d)\n", rcClient.right, rcClient.bottom); } else { @@ -4170,7 +4170,7 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) /* do the actual WM_SIZE request */ GetClientRect (infoPtr->hwndSelf, &rcClient); - TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%d,%d)\n", + TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%d,%d)\n", infoPtr->calcSize.cx, infoPtr->calcSize.cy, LOWORD(lParam), HIWORD(lParam), rcClient.right, rcClient.bottom); @@ -4190,11 +4190,11 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) /* on a WM_SIZE to zero and current client not zero and AUTOSIZE */ /* native seems to use the current client rect for the size */ infoPtr->fStatus |= BAND_NEEDS_LAYOUT; - TRACE("sizing rebar to client (%d,%d) size is zero but AUTOSIZE set\n", + TRACE("sizing rebar to client (%d,%d) size is zero but AUTOSIZE set\n", rcClient.right, rcClient.bottom); } else { - TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%d,%d)\n", + TRACE("sizing rebar from (%ld,%ld) to (%d,%d), client (%d,%d)\n", infoPtr->calcSize.cx, infoPtr->calcSize.cy, LOWORD(lParam), HIWORD(lParam), rcClient.right, rcClient.bottom); @@ -4208,7 +4208,7 @@ REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) autosize.fChanged = 0; /* ??? */ autosize.rcActual = autosize.rcTarget; /* ??? */ REBAR_Notify((NMHDR *) &autosize, infoPtr, RBN_AUTOSIZE); - TRACE("RBN_AUTOSIZE client=(%d,%d), lp=%08lx\n", + TRACE("RBN_AUTOSIZE client=(%d,%d), lp=%08lx\n", autosize.rcTarget.right, autosize.rcTarget.bottom, lParam); } @@ -4246,7 +4246,7 @@ REBAR_WindowPosChanged (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) /* Save the new origin of this window - used by _ForceResize */ infoPtr->origin.x = lpwp->x; infoPtr->origin.y = lpwp->y; - ret = DefWindowProcA(infoPtr->hwndSelf, WM_WINDOWPOSCHANGED, + ret = DefWindowProcA(infoPtr->hwndSelf, WM_WINDOWPOSCHANGED, wParam, lParam); GetWindowRect(infoPtr->hwndSelf, &rc); TRACE("hwnd %08x new pos (%d,%d)-(%d,%d)\n", @@ -4260,7 +4260,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); - TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", + TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", hwnd, uMsg, /* SPY_GetMsgName(uMsg), */ wParam, lParam); if (!infoPtr && (uMsg != WM_NCCREATE)) return DefWindowProcA (hwnd, uMsg, wParam, lParam); @@ -4462,7 +4462,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* case WM_SYSCOLORCHANGE: supported according to ControlSpy */ /* "Applications that have brushes using the existing system colors - should delete those brushes and recreate them using the new + should delete those brushes and recreate them using the new system colors." per MSDN */ /* case WM_VKEYTOITEM: supported according to ControlSpy */ @@ -4497,7 +4497,7 @@ REBAR_Register (void) wndClass.hbrBackground = CreateSolidBrush(RGB(0,128,0)); #endif wndClass.lpszClassName = REBARCLASSNAMEA; - + RegisterClassA (&wndClass); mindragx = GetSystemMetrics (SM_CXDRAG); diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index 2df03ad8fbc..29e6df4a522 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -124,7 +124,7 @@ STATUSBAR_DrawSizeGrip (HDC hdc, LPRECT lpRect) } -static void +static void STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINFO *infoPtr, int itemID) { RECT r = part->bound; @@ -137,7 +137,7 @@ STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINF border = 0; DrawEdge(hdc, &r, border, BF_RECT|BF_ADJUST); - + if (part->style & SBT_OWNERDRAW) { DRAWITEMSTRUCT dis; @@ -150,14 +150,14 @@ STATUSBAR_DrawPart (HDC hdc, const STATUSWINDOWPART *part, const STATUSWINDOWINF dis.itemData = (INT)part->text; SendMessageW (GetParent (infoPtr->Self), WM_DRAWITEM, (WPARAM)dis.CtlID, (LPARAM)&dis); - } + } else { if (part->hIcon) { INT cy = r.bottom - r.top; - r.left += 2; + r.left += 2; DrawIconEx (hdc, r.left, r.top, part->hIcon, cy, cy, 0, 0, DI_NORMAL); r.left += cy; } @@ -586,7 +586,7 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts) if (i==oldNumParts) /* Unchanged? no need to redraw! */ return TRUE; } - + for (i = 0; i < infoPtr->numParts; i++) infoPtr->parts[i].x = parts[i]; @@ -625,13 +625,13 @@ STATUSBAR_SetParts (STATUSWINDOWINFO *infoPtr, INT count, LPINT parts) static BOOL -STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style, +STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style, LPCWSTR text, BOOL isW) { STATUSWINDOWPART *part=NULL; BOOL changed = FALSE; - if (style & SBT_OWNERDRAW) { + if (style & SBT_OWNERDRAW) { TRACE("part %d, text %x\n",nPart,text); } else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW)); @@ -678,7 +678,7 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style, return TRUE; } } else { - if (!changed && !part->text) + if (!changed && !part->text) return TRUE; } @@ -898,7 +898,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate) SendMessageW (lpCreate->hwndParent, WM_NOTIFY, (WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc); - } + } } if (!(dwStyle & CCS_NORESIZE)) { /* don't resize wnd if it doesn't want it ! */ @@ -911,7 +911,7 @@ STATUSBAR_WMCreate (HWND hwnd, LPCREATESTRUCTA lpCreate) } return 0; - + create_fail: TRACE(" failed!\n"); if (infoPtr) STATUSBAR_WMDestroy(infoPtr); @@ -1049,13 +1049,13 @@ STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags) return FALSE; } if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & CCS_NORESIZE) return FALSE; - + /* width and height don't apply */ GetClientRect (GetParent(infoPtr->Self), &parent_rect); width = parent_rect.right - parent_rect.left; x = parent_rect.left; y = parent_rect.bottom - infoPtr->height; - MoveWindow (infoPtr->Self, parent_rect.left, + MoveWindow (infoPtr->Self, parent_rect.left, parent_rect.bottom - infoPtr->height, width, infoPtr->height, TRUE); STATUSBAR_SetPartBounds (infoPtr); @@ -1063,7 +1063,7 @@ STATUSBAR_WMSize (STATUSWINDOWINFO *infoPtr, WORD flags) } -static LRESULT +static LRESULT STATUSBAR_NotifyFormat (STATUSWINDOWINFO *infoPtr, HWND from, INT cmd) { if (cmd == NF_REQUERY) { @@ -1144,7 +1144,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case SB_SETMINHEIGHT: return STATUSBAR_SetMinHeight (infoPtr, (INT)wParam); - case SB_SETPARTS: + case SB_SETPARTS: return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam); case SB_SETTEXTA: @@ -1202,7 +1202,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_NOTIFYFORMAT: return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam); - + case WM_PAINT: return STATUSBAR_WMPaint (infoPtr, (HDC)wParam); @@ -1251,7 +1251,7 @@ STATUS_Register (void) wndClass.hCursor = LoadCursorW (0, IDC_ARROWW); wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); wndClass.lpszClassName = STATUSCLASSNAMEW; - + RegisterClassW (&wndClass); } diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index fffe48878aa..0114b6536b8 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -45,9 +45,9 @@ typedef struct INT iImage; LPARAM lParam; RECT rect; /* bounding rectangle of the item relative to the - * leftmost item (the leftmost item, 0, would have a - * "left" member of 0 in this rectangle) - * + * leftmost item (the leftmost item, 0, would have a + * "left" member of 0 in this rectangle) + * * additionally the top member hold the row number * and bottom is unused and should be 0 */ } TAB_ITEM; @@ -69,7 +69,7 @@ typedef struct INT uFocus; /* item which has the focus */ TAB_ITEM* items; /* pointer to an array of TAB_ITEM's */ BOOL DoRedraw; /* flag for redrawing when tab contents is changed*/ - BOOL needsScrolling; /* TRUE if the size of the tabs is greater than + BOOL needsScrolling; /* TRUE if the size of the tabs is greater than * the size of the control */ BOOL fSizeSet; /* was the size of the tabs explicitly set? */ BOOL bUnicode; /* Unicode control? */ @@ -87,7 +87,7 @@ typedef struct #define DISPLAY_AREA_PADDINGY 2 #define CONTROL_BORDER_SIZEX 2 #define CONTROL_BORDER_SIZEY 2 -#define BUTTON_SPACINGX 4 +#define BUTTON_SPACINGX 4 #define BUTTON_SPACINGY 4 #define FLAT_BTN_SPACINGX 8 #define DEFAULT_TAB_WIDTH 96 @@ -143,7 +143,7 @@ static LRESULT TAB_GetCurSel (HWND hwnd) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); - + return infoPtr->iSelected; } @@ -151,7 +151,7 @@ static LRESULT TAB_GetCurFocus (HWND hwnd) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); - + return infoPtr->uFocus; } @@ -170,7 +170,7 @@ TAB_SetCurSel (HWND hwnd,WPARAM wParam) TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); INT iItem = (INT)wParam; INT prevItem; - + prevItem = -1; if ((iItem >= 0) && (iItem < infoPtr->uNumItem)) { prevItem=infoPtr->iSelected; @@ -186,12 +186,12 @@ TAB_SetCurFocus (HWND hwnd,WPARAM wParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); INT iItem=(INT) wParam; - + if ((iItem < 0) || (iItem >= infoPtr->uNumItem)) return 0; if (GetWindowLongA(hwnd, GWL_STYLE) & TCS_BUTTONS) { FIXME("Should set input focus\n"); - } else { + } else { int oldFocus = infoPtr->uFocus; if (infoPtr->iSelected != iItem || infoPtr->uFocus == -1 ) { infoPtr->uFocus = iItem; @@ -238,7 +238,7 @@ static BOOL TAB_InternalGetItemRect( { RECT tmpItemRect,clientRect; LONG lStyle = GetWindowLongA(hwnd, GWL_STYLE); - + /* Perform a sanity check and a trivial visibility check. */ if ( (infoPtr->uNumItem <= 0) || (itemIndex >= infoPtr->uNumItem) || @@ -251,7 +251,7 @@ static BOOL TAB_InternalGetItemRect( */ if (itemRect == NULL) itemRect = &tmpItemRect; - + /* Retrieve the unmodified item rect. */ *itemRect = infoPtr->items[itemIndex].rect; @@ -286,18 +286,18 @@ static BOOL TAB_InternalGetItemRect( } else if(!(lStyle & TCS_VERTICAL) && !(lStyle & TCS_BOTTOM)) /* not TCS_BOTTOM and not TCS_VERTICAL */ { - itemRect->bottom = clientRect.top + + itemRect->bottom = clientRect.top + infoPtr->tabHeight + itemRect->top * (infoPtr->tabHeight - 2) + ((lStyle & TCS_BUTTONS) ? itemRect->top * BUTTON_SPACINGY : 0); - itemRect->top = clientRect.top + + itemRect->top = clientRect.top + SELECTED_TAB_OFFSET + itemRect->top * (infoPtr->tabHeight - 2) + ((lStyle & TCS_BUTTONS) ? itemRect->top * BUTTON_SPACINGY : 0); } /* - * "scroll" it to make sure the item at the very left of the + * "scroll" it to make sure the item at the very left of the * tab control is the leftmost visible tab. */ if(lStyle & TCS_VERTICAL) @@ -317,7 +317,7 @@ static BOOL TAB_InternalGetItemRect( } else { OffsetRect(itemRect, - -infoPtr->items[infoPtr->leftmostVisible].rect.left, + -infoPtr->items[infoPtr->leftmostVisible].rect.left, 0); /* @@ -345,7 +345,7 @@ static BOOL TAB_InternalGetItemRect( /* If it also a bit higher. */ if ((lStyle & TCS_BOTTOM) && !(lStyle & TCS_VERTICAL)) - { + { selectedRect->top -= 2; /* the border is thicker on the bottom */ selectedRect->bottom += SELECTED_TAB_OFFSET; } @@ -371,7 +371,7 @@ static BOOL TAB_InternalGetItemRect( static BOOL TAB_GetItemRect(HWND hwnd, WPARAM wParam, LPARAM lParam) { - return TAB_InternalGetItemRect(hwnd, TAB_GetInfoPtr(hwnd), (INT)wParam, + return TAB_InternalGetItemRect(hwnd, TAB_GetInfoPtr(hwnd), (INT)wParam, (LPRECT)lParam, (LPRECT)NULL); } @@ -381,7 +381,7 @@ static BOOL TAB_GetItemRect(HWND hwnd, WPARAM wParam, LPARAM lParam) * This method is called to handle keyboard input */ static LRESULT TAB_KeyUp( - HWND hwnd, + HWND hwnd, WPARAM keyCode) { TAB_INFO* infoPtr = TAB_GetInfoPtr(hwnd); @@ -396,7 +396,7 @@ static LRESULT TAB_KeyUp( newItem = infoPtr->uFocus + 1; break; } - + /* * If we changed to a valid item, change the selection */ @@ -425,9 +425,9 @@ static LRESULT TAB_KeyUp( * it is used to update the visual state of the control. */ static LRESULT TAB_FocusChanging( - HWND hwnd, - UINT uMsg, - WPARAM wParam, + HWND hwnd, + UINT uMsg, + WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -442,7 +442,7 @@ static LRESULT TAB_FocusChanging( infoPtr->uFocus, NULL, &selectedRect); - + /* * If the rectangle is not completely invisible, invalidate that * portion of the window. @@ -463,14 +463,14 @@ static LRESULT TAB_FocusChanging( static HWND TAB_InternalHitTest ( HWND hwnd, - TAB_INFO* infoPtr, - POINT pt, + TAB_INFO* infoPtr, + POINT pt, UINT* flags) { RECT rect; - int iCount; - + int iCount; + for (iCount = 0; iCount < infoPtr->uNumItem; iCount++) { TAB_InternalGetItemRect(hwnd, infoPtr, iCount, &rect, NULL); @@ -491,7 +491,7 @@ TAB_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); LPTCHITTESTINFO lptest = (LPTCHITTESTINFO) lParam; - + return TAB_InternalHitTest (hwnd, infoPtr, lptest->pt, &lptest->flags); } @@ -542,12 +542,12 @@ TAB_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->hwndToolTip) TAB_RelayEvent (infoPtr->hwndToolTip, hwnd, WM_LBUTTONDOWN, wParam, lParam); - + pt.x = (INT)LOWORD(lParam); pt.y = (INT)HIWORD(lParam); - + newItem = TAB_InternalHitTest (hwnd, infoPtr, pt, &dummy); - + TRACE("On Tab, item %d\n", newItem); if ((newItem != -1) && (infoPtr->iSelected != newItem)) @@ -631,7 +631,7 @@ TAB_HotTrackTimerProc ** "outside" even if it is within our bounding rect if another window ** overlaps. Note also that the case where the cursor stayed within our ** window but has moved off the hot-tracked tab will be handled by the - ** WM_MOUSEMOVE event. + ** WM_MOUSEMOVE event. */ if (!GetCursorPos(&pt) || WindowFromPoint(pt) != hwnd) { @@ -776,8 +776,8 @@ TAB_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) * the window rectangle given the requested display rectangle. */ static LRESULT TAB_AdjustRect( - HWND hwnd, - WPARAM fLarger, + HWND hwnd, + WPARAM fLarger, LPRECT prc) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -857,7 +857,7 @@ static LRESULT TAB_AdjustRect( * perform the scrolling operation on the tab control. */ static LRESULT TAB_OnHScroll( - HWND hwnd, + HWND hwnd, int nScrollCode, int nPos, HWND hwndScroll) @@ -883,7 +883,7 @@ static LRESULT TAB_OnHScroll( /****************************************************************************** * TAB_SetupScrolling * - * This method will check the current scrolling state and make sure the + * This method will check the current scrolling state and make sure the * scrolling control is displayed (or not). */ static void TAB_SetupScrolling( @@ -948,18 +948,18 @@ static void TAB_SetupScrolling( controlPos.right - controlPos.left, controlPos.bottom - controlPos.top, hwnd, - (HMENU)NULL, - (HINSTANCE)NULL, - NULL); + (HMENU)NULL, + (HINSTANCE)NULL, + NULL); } else { - SetWindowPos(infoPtr->hwndUpDown, + SetWindowPos(infoPtr->hwndUpDown, (HWND)NULL, controlPos.left, controlPos.top, controlPos.right - controlPos.left, controlPos.bottom - controlPos.top, - SWP_SHOWWINDOW | SWP_NOZORDER); + SWP_SHOWWINDOW | SWP_NOZORDER); } /* Now calculate upper limit of the updown control range. @@ -1022,8 +1022,8 @@ static void TAB_SetItemBounds (HWND hwnd) * We need to get text information so we need a DC and we need to select * a font. */ - hdc = GetDC(hwnd); - + hdc = GetDC(hwnd); + hFont = infoPtr->hFont ? infoPtr->hFont : GetStockObject (SYSTEM_FONT); hOldFont = SelectObject (hdc, hFont); @@ -1034,7 +1034,7 @@ static void TAB_SetItemBounds (HWND hwnd) GetClientRect(hwnd, &clientRect); /* if TCS_VERTICAL then swap the height and width so this code places the - tabs along the top of the rectangle and we can just rotate them after + tabs along the top of the rectangle and we can just rotate them after rather than duplicate all of the below code */ if(lStyle & TCS_VERTICAL) { @@ -1066,11 +1066,11 @@ static void TAB_SetItemBounds (HWND hwnd) item_height = icon_height; /* - * Make sure there is enough space for the letters + icon + growing the - * selected item + extra space for the selected item. + * Make sure there is enough space for the letters + icon + growing the + * selected item + extra space for the selected item. */ infoPtr->tabHeight = item_height + SELECTED_TAB_OFFSET + - ((lStyle & TCS_BUTTONS) ? 2 : 1) * + ((lStyle & TCS_BUTTONS) ? 2 : 1) * VERTICAL_ITEM_PADDING; TRACE("tabH=%d, tmH=%ld, iconh=%d\n", @@ -1110,7 +1110,7 @@ static void TAB_SetItemBounds (HWND hwnd) } infoPtr->items[curItem].rect.right = infoPtr->items[curItem].rect.left + - size.cx + icon_width + + size.cx + icon_width + num * HORIZONTAL_ITEM_PADDING; } @@ -1137,11 +1137,11 @@ static void TAB_SetItemBounds (HWND hwnd) infoPtr->items[curItem].rect.top = curItemRowCount - 1; TRACE("TextSize: %li\n", size.cx); - TRACE("Rect: T %i, L %i, B %i, R %i\n", + TRACE("Rect: T %i, L %i, B %i, R %i\n", infoPtr->items[curItem].rect.top, infoPtr->items[curItem].rect.left, infoPtr->items[curItem].rect.bottom, - infoPtr->items[curItem].rect.right); + infoPtr->items[curItem].rect.right); /* * The leftmost position of the next item is the rightmost position @@ -1167,7 +1167,7 @@ static void TAB_SetItemBounds (HWND hwnd) /* Don't need scrolling, then update infoPtr->leftmostVisible */ if(!infoPtr->needsScrolling) - infoPtr->leftmostVisible = 0; + infoPtr->leftmostVisible = 0; TAB_SetupScrolling(hwnd, infoPtr, &clientRect); } @@ -1207,7 +1207,7 @@ static void TAB_SetItemBounds (HWND hwnd) /* normalize the current rect */ /* shift the item to the left side of the clientRect */ - infoPtr->items[iItm].rect.right -= + infoPtr->items[iItm].rect.right -= infoPtr->items[iItm].rect.left; infoPtr->items[iItm].rect.left = 0; @@ -1224,25 +1224,25 @@ static void TAB_SetItemBounds (HWND hwnd) else curItemLeftPos = infoPtr->items[iItm].rect.right; } - + /* * Justify the rows */ { while(iIndexStart < infoPtr->uNumItem) { - /* + /* * find the indexs of the row */ /* find the first item on the next row */ for (iIndexEnd=iIndexStart; - (iIndexEnd < infoPtr->uNumItem) && + (iIndexEnd < infoPtr->uNumItem) && (infoPtr->items[iIndexEnd].rect.top == infoPtr->items[iIndexStart].rect.top) ; iIndexEnd++) /* intentionally blank */; - /* + /* * we need to justify these tabs so they fill the whole given * client area * @@ -1260,7 +1260,7 @@ static void TAB_SetItemBounds (HWND hwnd) remainder = widthDiff % iCount; widthDiff = widthDiff / iCount; /* add widthDiff/iCount, or extra space/items on row, to each item on this row */ - for (iIndex=iIndexStart,iCount=0; iIndex < iIndexEnd; + for (iIndex=iIndexStart,iCount=0; iIndex < iIndexEnd; iIndex++,iCount++) { infoPtr->items[iIndex].rect.left += iCount * widthDiff; @@ -1311,7 +1311,7 @@ static void TAB_SetItemBounds (HWND hwnd) * * This method is used to draw the interior (text and icon) of a single tab * into the tab control. - */ + */ static void TAB_DrawItemInterior ( @@ -1381,7 +1381,7 @@ TAB_DrawItemInterior holdPen = SelectObject(hdc, htextPen); oldBkMode = SetBkMode(hdc, TRANSPARENT); - SetTextColor(hdc, (iItem == infoPtr->iHotTracked) ? + SetTextColor(hdc, (iItem == infoPtr->iHotTracked) ? comctl32_color.clrHighlight : comctl32_color.clrBtnText); /* @@ -1406,19 +1406,19 @@ TAB_DrawItemInterior */ id = GetWindowLongA( hwnd, GWL_ID ); - /* + /* * put together the DRAWITEMSTRUCT */ - dis.CtlType = ODT_TAB; - dis.CtlID = id; - dis.itemID = iItem; - dis.itemAction = ODA_DRAWENTIRE; + dis.CtlType = ODT_TAB; + dis.CtlID = id; + dis.itemID = iItem; + dis.itemAction = ODA_DRAWENTIRE; if ( iItem == infoPtr->iSelected ) - dis.itemState = ODS_SELECTED; - else - dis.itemState = 0; + dis.itemState = ODS_SELECTED; + else + dis.itemState = 0; dis.hwndItem = hwnd; /* */ - dis.hDC = hdc; + dis.hDC = hdc; dis.rcItem = *drawRect; /* */ dis.itemData = infoPtr->items[iItem].lParam; @@ -1455,7 +1455,7 @@ TAB_DrawItemInterior * Setup for text output */ oldBkMode = SetBkMode(hdc, TRANSPARENT); - SetTextColor(hdc, (iItem == infoPtr->iHotTracked) ? + SetTextColor(hdc, (iItem == infoPtr->iHotTracked) ? comctl32_color.clrHighlight : comctl32_color.clrBtnText); /* get the rectangle that the text fits in */ @@ -1555,14 +1555,14 @@ TAB_DrawItemInterior /* call CreateFontIndirectA, which requires us to set the values of the logfont we pass in */ if(lStyle & TCS_VERTICAL) { - if (!GetObjectA((infoPtr->hFont) ? + if (!GetObjectA((infoPtr->hFont) ? infoPtr->hFont : GetStockObject(SYSTEM_FONT), sizeof(LOGFONTA),&logfont)) { iPointSize = 9; lstrcpyA(logfont.lfFaceName, "Arial"); - logfont.lfHeight = -MulDiv(iPointSize, GetDeviceCaps(hdc, LOGPIXELSY), + logfont.lfHeight = -MulDiv(iPointSize, GetDeviceCaps(hdc, LOGPIXELSY), 72); logfont.lfWeight = FW_NORMAL; logfont.lfItalic = 0; @@ -1622,10 +1622,10 @@ TAB_DrawItemInterior * TAB_DrawItem * * This method is used to draw a single tab into the tab control. - */ + */ static void TAB_DrawItem( - HWND hwnd, - HDC hdc, + HWND hwnd, + HDC hdc, INT iItem) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -1651,7 +1651,7 @@ static void TAB_DrawItem( { /* If you need to see what the control is doing, * then override these variables. They will change what - * fill colors are used for filling the tabs, and the + * fill colors are used for filling the tabs, and the * corners when drawing the edge. */ bkgnd = comctl32_color.clrBtnFace; @@ -1659,14 +1659,14 @@ static void TAB_DrawItem( if (lStyle & TCS_BUTTONS) { - HBRUSH hbr = CreateSolidBrush (bkgnd); + HBRUSH hbr = CreateSolidBrush (bkgnd); BOOL deleteBrush = TRUE; /* Get item rectangle */ r = itemRect; /* Separators between flat buttons */ - if (lStyle & TCS_FLATBUTTONS) + if (lStyle & TCS_FLATBUTTONS) { r1 = r; r1.right += (FLAT_BTN_SPACINGX -2); @@ -1729,12 +1729,12 @@ static void TAB_DrawItem( /* * Erase the background. (Delay it but setup rectangle.) - * This is necessary when drawing the selected item since it is larger - * than the others, it might overlap with stuff already drawn by the + * This is necessary when drawing the selected item since it is larger + * than the others, it might overlap with stuff already drawn by the * other tabs - */ + */ fillRect = r; - + if(lStyle & TCS_VERTICAL) { /* These are for adjusting the drawing of a Selected tab */ @@ -1768,7 +1768,7 @@ static void TAB_DrawItem( /* Draw rectangular edge around tab */ DrawEdge(hdc, &r, EDGE_RAISED, BF_SOFT|BF_RIGHT|BF_TOP|BF_BOTTOM); - /* Now erase the top corner and draw diagonal edge */ + /* Now erase the top corner and draw diagonal edge */ SetBkColor(hdc, corner); r1.left = r.right - ROUND_CORNER_SIZE - 1; r1.top = r.top; @@ -1778,7 +1778,7 @@ static void TAB_DrawItem( r1.right--; DrawEdge(hdc, &r1, EDGE_RAISED, BF_SOFT|BF_DIAGONAL_ENDTOPLEFT); - /* Now erase the bottom corner and draw diagonal edge */ + /* Now erase the bottom corner and draw diagonal edge */ r1.left = r.right - ROUND_CORNER_SIZE - 1; r1.bottom = r.bottom; r1.right = r.right; @@ -1812,7 +1812,7 @@ static void TAB_DrawItem( /* Draw rectangular edge around tab */ DrawEdge(hdc, &r, EDGE_RAISED, BF_SOFT|BF_LEFT|BF_TOP|BF_BOTTOM); - /* Now erase the top corner and draw diagonal edge */ + /* Now erase the top corner and draw diagonal edge */ SetBkColor(hdc, corner); r1.left = r.left; r1.top = r.top; @@ -1822,7 +1822,7 @@ static void TAB_DrawItem( r1.left++; DrawEdge(hdc, &r1, EDGE_RAISED, BF_SOFT|BF_DIAGONAL_ENDTOPRIGHT); - /* Now erase the bottom corner and draw diagonal edge */ + /* Now erase the bottom corner and draw diagonal edge */ r1.left = r.left; r1.bottom = r.bottom; r1.right = r1.left + ROUND_CORNER_SIZE + 1; @@ -1869,7 +1869,7 @@ static void TAB_DrawItem( /* Draw rectangular edge around tab */ DrawEdge(hdc, &r, EDGE_RAISED, BF_SOFT|BF_LEFT|BF_BOTTOM|BF_RIGHT); - /* Now erase the righthand corner and draw diagonal edge */ + /* Now erase the righthand corner and draw diagonal edge */ SetBkColor(hdc, corner); r1.left = r.right - ROUND_CORNER_SIZE; r1.bottom = r.bottom; @@ -1879,7 +1879,7 @@ static void TAB_DrawItem( r1.bottom--; DrawEdge(hdc, &r1, EDGE_RAISED, BF_SOFT|BF_DIAGONAL_ENDBOTTOMLEFT); - /* Now erase the lefthand corner and draw diagonal edge */ + /* Now erase the lefthand corner and draw diagonal edge */ r1.left = r.left; r1.bottom = r.bottom; r1.right = r1.left + ROUND_CORNER_SIZE; @@ -1914,7 +1914,7 @@ static void TAB_DrawItem( /* Draw rectangular edge around tab */ DrawEdge(hdc, &r, EDGE_RAISED, BF_SOFT|BF_LEFT|BF_TOP|BF_RIGHT); - /* Now erase the righthand corner and draw diagonal edge */ + /* Now erase the righthand corner and draw diagonal edge */ SetBkColor(hdc, corner); r1.left = r.right - ROUND_CORNER_SIZE; r1.top = r.top; @@ -1924,7 +1924,7 @@ static void TAB_DrawItem( r1.top++; DrawEdge(hdc, &r1, EDGE_RAISED, BF_SOFT|BF_DIAGONAL_ENDBOTTOMRIGHT); - /* Now erase the lefthand corner and draw diagonal edge */ + /* Now erase the lefthand corner and draw diagonal edge */ r1.left = r.left; r1.top = r.top; r1.right = r1.left + ROUND_CORNER_SIZE; @@ -1936,7 +1936,7 @@ static void TAB_DrawItem( } } } - + /* This modifies r to be the text rectangle. */ { HFONT hOldFont = SelectObject(hdc, infoPtr->hFont); @@ -1962,7 +1962,7 @@ static void TAB_DrawItem( * * This method is used to draw the raised border around the tab control * "content" area. - */ + */ static void TAB_DrawBorder (HWND hwnd, HDC hdc) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -2005,7 +2005,7 @@ static void TAB_DrawBorder (HWND hwnd, HDC hdc) * TAB_Refresh * * This method repaints the tab control.. - */ + */ static void TAB_Refresh (HWND hwnd, HDC hdc) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -2019,13 +2019,13 @@ static void TAB_Refresh (HWND hwnd, HDC hdc) if (GetWindowLongA(hwnd, GWL_STYLE) & TCS_BUTTONS) { - for (i = 0; i < infoPtr->uNumItem; i++) + for (i = 0; i < infoPtr->uNumItem; i++) TAB_DrawItem (hwnd, hdc, i); } else { /* Draw all the non selected item first */ - for (i = 0; i < infoPtr->uNumItem; i++) + for (i = 0; i < infoPtr->uNumItem; i++) { if (i != infoPtr->iSelected) TAB_DrawItem (hwnd, hdc, i); @@ -2059,13 +2059,13 @@ static LRESULT TAB_SetRedraw (HWND hwnd, WPARAM wParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); - + infoPtr->DoRedraw=(BOOL) wParam; return 0; } static LRESULT TAB_EraseBackground( - HWND hwnd, + HWND hwnd, HDC givenDC) { HDC hdc; @@ -2258,7 +2258,7 @@ TAB_Paint (HWND hwnd, WPARAM wParam) { HDC hdc; PAINTSTRUCT ps; - + hdc = wParam== 0 ? BeginPaint (hwnd, &ps) : (HDC)wParam; TRACE("erase %d, rect=(%d,%d)-(%d,%d)\n", @@ -2269,7 +2269,7 @@ TAB_Paint (HWND hwnd, WPARAM wParam) TAB_EraseBackground (hwnd, hdc); TAB_Refresh (hwnd, hdc); - + if(!wParam) EndPaint (hwnd, &ps); @@ -2278,23 +2278,23 @@ TAB_Paint (HWND hwnd, WPARAM wParam) static LRESULT TAB_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) -{ +{ TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); TCITEMA *pti; INT iItem; RECT rect; - + GetClientRect (hwnd, &rect); TRACE("Rect: %x T %i, L %i, B %i, R %i\n", hwnd, - rect.top, rect.left, rect.bottom, rect.right); - + rect.top, rect.left, rect.bottom, rect.right); + pti = (TCITEMA *)lParam; iItem = (INT)wParam; - + if (iItem < 0) return -1; if (iItem > infoPtr->uNumItem) iItem = infoPtr->uNumItem; - + if (infoPtr->uNumItem == 0) { infoPtr->items = COMCTL32_Alloc (sizeof (TAB_ITEM)); infoPtr->uNumItem++; @@ -2302,21 +2302,21 @@ TAB_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) } else { TAB_ITEM *oldItems = infoPtr->items; - + infoPtr->uNumItem++; infoPtr->items = COMCTL32_Alloc (sizeof (TAB_ITEM) * infoPtr->uNumItem); - + /* pre insert copy */ if (iItem > 0) { memcpy (&infoPtr->items[0], &oldItems[0], iItem * sizeof(TAB_ITEM)); } - + /* post insert copy */ if (iItem < infoPtr->uNumItem - 1) { memcpy (&infoPtr->items[iItem+1], &oldItems[iItem], (infoPtr->uNumItem - iItem - 1) * sizeof(TAB_ITEM)); - + } if (iItem <= infoPtr->iSelected) @@ -2324,23 +2324,23 @@ TAB_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) COMCTL32_Free (oldItems); } - + infoPtr->items[iItem].mask = pti->mask; if (pti->mask & TCIF_TEXT) Str_SetPtrAtoW (&infoPtr->items[iItem].pszText, pti->pszText); if (pti->mask & TCIF_IMAGE) infoPtr->items[iItem].iImage = pti->iImage; - + if (pti->mask & TCIF_PARAM) infoPtr->items[iItem].lParam = pti->lParam; - + TAB_SetItemBounds(hwnd); if (infoPtr->uNumItem > 1) TAB_InvalidateTabArea(hwnd, infoPtr); else InvalidateRect(hwnd, NULL, TRUE); - + TRACE("[%04x]: added item %d %s\n", hwnd, iItem, debugstr_w(infoPtr->items[iItem].pszText)); @@ -2390,7 +2390,7 @@ TAB_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam) (infoPtr->uNumItem - iItem - 1) * sizeof(TAB_ITEM)); } - + if (iItem <= infoPtr->iSelected) infoPtr->iSelected++; @@ -2403,16 +2403,16 @@ TAB_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam) if (pti->mask & TCIF_IMAGE) infoPtr->items[iItem].iImage = pti->iImage; - + if (pti->mask & TCIF_PARAM) infoPtr->items[iItem].lParam = pti->lParam; - + TAB_SetItemBounds(hwnd); if (infoPtr->uNumItem > 1) TAB_InvalidateTabArea(hwnd, infoPtr); else InvalidateRect(hwnd, NULL, TRUE); - + TRACE("[%04x]: added item %d %s\n", hwnd, iItem, debugstr_w(infoPtr->items[iItem].pszText)); @@ -2420,7 +2420,7 @@ TAB_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT TAB_SetItemSize (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -2434,7 +2434,7 @@ TAB_SetItemSize (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->tabWidth = (INT)LOWORD(lParam); infoPtr->tabHeight = (INT)HIWORD(lParam); TRACE("was h=%d,w=%d, now h=%d,w=%d\n", - HIWORD(lResult), LOWORD(lResult), + HIWORD(lResult), LOWORD(lResult), infoPtr->tabHeight, infoPtr->tabWidth); } infoPtr->fSizeSet = TRUE; @@ -2442,11 +2442,11 @@ TAB_SetItemSize (HWND hwnd, WPARAM wParam, LPARAM lParam) return lResult; } -static LRESULT +static LRESULT TAB_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); - TCITEMA *tabItem; + TCITEMA *tabItem; TAB_ITEM *wineItem; INT iItem; @@ -2464,10 +2464,10 @@ TAB_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) if (tabItem->mask & TCIF_PARAM) wineItem->lParam = tabItem->lParam; - if (tabItem->mask & TCIF_RTLREADING) + if (tabItem->mask & TCIF_RTLREADING) FIXME("TCIF_RTLREADING\n"); - if (tabItem->mask & TCIF_STATE) + if (tabItem->mask & TCIF_STATE) wineItem->dwState = tabItem->dwState; if (tabItem->mask & TCIF_TEXT) @@ -2520,7 +2520,7 @@ TAB_SetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT TAB_GetItemCount (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -2529,7 +2529,7 @@ TAB_GetItemCount (HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT TAB_GetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -2545,26 +2545,26 @@ TAB_GetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam) wineItem = &infoPtr->items[iItem]; - if (tabItem->mask & TCIF_IMAGE) + if (tabItem->mask & TCIF_IMAGE) tabItem->iImage = wineItem->iImage; - if (tabItem->mask & TCIF_PARAM) + if (tabItem->mask & TCIF_PARAM) tabItem->lParam = wineItem->lParam; - if (tabItem->mask & TCIF_RTLREADING) + if (tabItem->mask & TCIF_RTLREADING) FIXME("TCIF_RTLREADING\n"); - if (tabItem->mask & TCIF_STATE) + if (tabItem->mask & TCIF_STATE) tabItem->dwState = wineItem->dwState; - if (tabItem->mask & TCIF_TEXT) + if (tabItem->mask & TCIF_TEXT) Str_GetPtrWtoA (wineItem->pszText, tabItem->pszText, tabItem->cchTextMax); return TRUE; } -static LRESULT +static LRESULT TAB_GetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -2599,7 +2599,7 @@ TAB_GetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT TAB_DeleteItem (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -2609,23 +2609,23 @@ TAB_DeleteItem (HWND hwnd, WPARAM wParam, LPARAM lParam) if ((iItem >= 0) && (iItem < infoPtr->uNumItem)) { TAB_ITEM *oldItems = infoPtr->items; - + infoPtr->uNumItem--; infoPtr->items = COMCTL32_Alloc(sizeof (TAB_ITEM) * infoPtr->uNumItem); - - if (iItem > 0) + + if (iItem > 0) memcpy(&infoPtr->items[0], &oldItems[0], iItem * sizeof(TAB_ITEM)); - - if (iItem < infoPtr->uNumItem) + + if (iItem < infoPtr->uNumItem) memcpy(&infoPtr->items[iItem], &oldItems[iItem + 1], (infoPtr->uNumItem - iItem) * sizeof(TAB_ITEM)); - + COMCTL32_Free(oldItems); /* Readjust the selected index */ if ((iItem == infoPtr->iSelected) && (iItem > 0)) infoPtr->iSelected--; - + if (iItem < infoPtr->iSelected) infoPtr->iSelected--; @@ -2642,7 +2642,7 @@ TAB_DeleteItem (HWND hwnd, WPARAM wParam, LPARAM lParam) return bResult; } -static LRESULT +static LRESULT TAB_DeleteAllItems (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); @@ -2653,7 +2653,7 @@ TAB_DeleteAllItems (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->iHotTracked >= 0) KillTimer(hwnd, TAB_HOTTRACK_TIMER); infoPtr->iHotTracked = -1; - + TAB_SetItemBounds(hwnd); TAB_InvalidateTabArea(hwnd,infoPtr); return TRUE; @@ -2674,11 +2674,11 @@ TAB_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); - + TRACE("%x %lx\n",wParam, lParam); - + infoPtr->hFont = (HFONT)wParam; - + TAB_SetItemBounds(hwnd); TAB_InvalidateTabArea(hwnd, infoPtr); @@ -2745,7 +2745,7 @@ TAB_Size (HWND hwnd, WPARAM wParam, LPARAM lParam) GetClientRect(parent, &parent_rect); cx=LOWORD (lParam); cy=HIWORD (lParam); - if (GetWindowLongA(hwnd, GWL_STYLE) & CCS_NORESIZE) + if (GetWindowLongA(hwnd, GWL_STYLE) & CCS_NORESIZE) uPosFlags |= (SWP_NOSIZE | SWP_NOMOVE); SetWindowPos (hwnd, 0, parent_rect.left, parent_rect.top, @@ -2764,7 +2764,7 @@ TAB_Size (HWND hwnd, WPARAM wParam, LPARAM lParam) } -static LRESULT +static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) { TAB_INFO *infoPtr; @@ -2776,7 +2776,7 @@ TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr = (TAB_INFO *)COMCTL32_Alloc (sizeof(TAB_INFO)); SetWindowLongA(hwnd, 0, (DWORD)infoPtr); - + infoPtr->uNumItem = 0; infoPtr->uNumRows = 0; infoPtr->hFont = 0; @@ -2784,7 +2784,7 @@ TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->hcurArrow = LoadCursorA (0, IDC_ARROWA); infoPtr->iSelected = -1; infoPtr->iHotTracked = -1; - infoPtr->uFocus = -1; + infoPtr->uFocus = -1; infoPtr->hwndToolTip = 0; infoPtr->DoRedraw = TRUE; infoPtr->needsScrolling = FALSE; @@ -2792,11 +2792,11 @@ TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->leftmostVisible = 0; infoPtr->fSizeSet = FALSE; infoPtr->bUnicode = IsWindowUnicode (hwnd); - - TRACE("Created tab control, hwnd [%04x]\n", hwnd); - /* The tab control always has the WS_CLIPSIBLINGS style. Even - if you don't specify it in CreateWindow. This is necessary in + TRACE("Created tab control, hwnd [%04x]\n", hwnd); + + /* The tab control always has the WS_CLIPSIBLINGS style. Even + if you don't specify it in CreateWindow. This is necessary in order for paint to work correctly. This follows windows behaviour. */ dwStyle = GetWindowLongA(hwnd, GWL_STYLE); SetWindowLongA(hwnd, GWL_STYLE, dwStyle|WS_CLIPSIBLINGS); @@ -2808,37 +2808,37 @@ TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwnd, 0, 0, 0); - + /* Send NM_TOOLTIPSCREATED notification */ if (infoPtr->hwndToolTip) { NMTOOLTIPSCREATED nmttc; - + nmttc.hdr.hwndFrom = hwnd; nmttc.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID); nmttc.hdr.code = NM_TOOLTIPSCREATED; nmttc.hwndToolTips = infoPtr->hwndToolTip; - + SendMessageA (GetParent (hwnd), WM_NOTIFY, (WPARAM)GetWindowLongA(hwnd, GWL_ID), (LPARAM)&nmttc); } - } - + } + /* * We need to get text information so we need a DC and we need to select * a font. */ - hdc = GetDC(hwnd); + hdc = GetDC(hwnd); hOldFont = SelectObject (hdc, GetStockObject (SYSTEM_FONT)); /* Use the system font to determine the initial height of a tab. */ GetTextMetricsA(hdc, &fontMetrics); /* - * Make sure there is enough space for the letters + growing the - * selected item + extra space for the selected item. + * Make sure there is enough space for the letters + growing the + * selected item + extra space for the selected item. */ infoPtr->tabHeight = fontMetrics.tmHeight + SELECTED_TAB_OFFSET + - ((dwStyle & TCS_BUTTONS) ? 2 : 1) * + ((dwStyle & TCS_BUTTONS) ? 2 : 1) * VERTICAL_ITEM_PADDING; /* Initialize the width of a tab. */ @@ -2868,10 +2868,10 @@ TAB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) } COMCTL32_Free (infoPtr->items); } - - if (infoPtr->hwndToolTip) + + if (infoPtr->hwndToolTip) DestroyWindow (infoPtr->hwndToolTip); - + if (infoPtr->hwndUpDown) DestroyWindow(infoPtr->hwndUpDown); @@ -2895,67 +2895,67 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { case TCM_GETIMAGELIST: return TAB_GetImageList (hwnd, wParam, lParam); - + case TCM_SETIMAGELIST: return TAB_SetImageList (hwnd, wParam, lParam); - + case TCM_GETITEMCOUNT: return TAB_GetItemCount (hwnd, wParam, lParam); - + case TCM_GETITEMA: return TAB_GetItemA (hwnd, wParam, lParam); - + case TCM_GETITEMW: return TAB_GetItemW (hwnd, wParam, lParam); - + case TCM_SETITEMA: return TAB_SetItemA (hwnd, wParam, lParam); - + case TCM_SETITEMW: return TAB_SetItemW (hwnd, wParam, lParam); - + case TCM_DELETEITEM: return TAB_DeleteItem (hwnd, wParam, lParam); - + case TCM_DELETEALLITEMS: return TAB_DeleteAllItems (hwnd, wParam, lParam); - + case TCM_GETITEMRECT: return TAB_GetItemRect (hwnd, wParam, lParam); - + case TCM_GETCURSEL: return TAB_GetCurSel (hwnd); - + case TCM_HITTEST: return TAB_HitTest (hwnd, wParam, lParam); - + case TCM_SETCURSEL: return TAB_SetCurSel (hwnd, wParam); - + case TCM_INSERTITEMA: return TAB_InsertItemA (hwnd, wParam, lParam); - + case TCM_INSERTITEMW: return TAB_InsertItemW (hwnd, wParam, lParam); - + case TCM_SETITEMEXTRA: FIXME("Unimplemented msg TCM_SETITEMEXTRA\n"); return 0; - + case TCM_ADJUSTRECT: return TAB_AdjustRect (hwnd, (BOOL)wParam, (LPRECT)lParam); - + case TCM_SETITEMSIZE: return TAB_SetItemSize (hwnd, wParam, lParam); - + case TCM_REMOVEIMAGE: FIXME("Unimplemented msg TCM_REMOVEIMAGE\n"); return 0; - + case TCM_SETPADDING: FIXME("Unimplemented msg TCM_SETPADDING\n"); return 0; - + case TCM_GETROWCOUNT: return TAB_GetRowCount(hwnd); @@ -2968,27 +2968,27 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case TCM_HIGHLIGHTITEM: FIXME("Unimplemented msg TCM_HIGHLIGHTITEM\n"); return 0; - + case TCM_GETTOOLTIPS: return TAB_GetToolTips (hwnd, wParam, lParam); - + case TCM_SETTOOLTIPS: return TAB_SetToolTips (hwnd, wParam, lParam); - + case TCM_GETCURFOCUS: return TAB_GetCurFocus (hwnd); - + case TCM_SETCURFOCUS: return TAB_SetCurFocus (hwnd, wParam); - + case TCM_SETMINTABWIDTH: FIXME("Unimplemented msg TCM_SETMINTABWIDTH\n"); return 0; - + case TCM_DESELECTALL: FIXME("Unimplemented msg TCM_DESELECTALL\n"); return 0; - + case TCM_GETEXTENDEDSTYLE: FIXME("Unimplemented msg TCM_GETEXTENDEDSTYLE\n"); return 0; @@ -2999,34 +2999,34 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETFONT: return TAB_GetFont (hwnd, wParam, lParam); - + case WM_SETFONT: return TAB_SetFont (hwnd, wParam, lParam); - + case WM_CREATE: return TAB_Create (hwnd, wParam, lParam); - + case WM_NCDESTROY: return TAB_Destroy (hwnd, wParam, lParam); - + case WM_GETDLGCODE: return DLGC_WANTARROWS | DLGC_WANTCHARS; - + case WM_LBUTTONDOWN: return TAB_LButtonDown (hwnd, wParam, lParam); - + case WM_LBUTTONUP: return TAB_LButtonUp (hwnd, wParam, lParam); - + case WM_NOTIFY: return SendMessageA(GetParent(hwnd), WM_NOTIFY, wParam, lParam); - + case WM_RBUTTONDOWN: return TAB_RButtonDown (hwnd, wParam, lParam); - + case WM_MOUSEMOVE: return TAB_MouseMove (hwnd, wParam, lParam); - + case WM_ERASEBKGND: return TAB_EraseBackground (hwnd, (HDC)wParam); @@ -3035,7 +3035,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SIZE: return TAB_Size (hwnd, wParam, lParam); - + case WM_SETREDRAW: return TAB_SetRedraw (hwnd, wParam); @@ -3050,7 +3050,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); return 0; - + case WM_KILLFOCUS: case WM_SETFOCUS: return TAB_FocusChanging(hwnd, uMsg, wParam, lParam); @@ -3084,7 +3084,7 @@ TAB_Register (void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)NULL; wndClass.lpszClassName = WC_TABCONTROLA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 9a7b03133f5..9db550f50a6 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -85,7 +85,7 @@ typedef struct BOOL bHot; INT nRow; RECT rect; -} TBUTTON_INFO; +} TBUTTON_INFO; typedef struct { @@ -170,7 +170,7 @@ typedef struct #define SEPARATOR_WIDTH 8 #define TOP_BORDER 2 #define BOTTOM_BORDER 2 -#define DDARROW_WIDTH 11 +#define DDARROW_WIDTH 11 #define TOOLBAR_GetInfoPtr(hwnd) ((TOOLBAR_INFO *)GetWindowLongA(hwnd,0)) #define TOOLBAR_HasText(x, y) (TOOLBAR_GetText(x, y) ? TRUE : FALSE) @@ -196,7 +196,7 @@ TOOLBAR_GetText(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr) lpText = (LPWSTR)btnPtr->iString; else if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings)) lpText = infoPtr->strings[btnPtr->iString]; - + return lpText; } @@ -212,7 +212,7 @@ TOOLBAR_DumpButton(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *bP, INT btn_num, BOOL in TRACE("button %d id %d, hot=%s, row=%d, rect=(%d,%d)-(%d,%d)\n", btn_num, bP->idCommand, (bP->bHot) ? "TRUE":"FALSE", bP->nRow, - bP->rect.left, bP->rect.top, + bP->rect.left, bP->rect.top, bP->rect.right, bP->rect.bottom); } } @@ -263,7 +263,7 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code) { if(!IsWindow(infoPtr->hwndSelf)) return 0; /* we have just been destroyed */ - + nmhdr->idFrom = GetDlgCtrlID (infoPtr->hwndSelf); nmhdr->hwndFrom = infoPtr->hwndSelf; nmhdr->code = code; @@ -272,10 +272,10 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code) (infoPtr->bNtfUnicode) ? "via Unicode" : "via ANSI"); if (infoPtr->bNtfUnicode) - return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, + return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, (WPARAM) nmhdr->idFrom, (LPARAM)nmhdr); else - return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, + return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, (WPARAM) nmhdr->idFrom, (LPARAM)nmhdr); } @@ -286,7 +286,7 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, TOOLBAR_INFO *infoPtr, UINT code) * If the button specifies I_IMAGECALLBACK, then the TBN_GETDISPINFO * is issued to retrieve the index. */ -static INT +static INT TOOLBAR_GetBitmapIndex(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr) { INT ret = btnPtr->iBitmap; @@ -305,14 +305,14 @@ TOOLBAR_GetBitmapIndex(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr) btnPtr->iBitmap = nmgd.iImage; } ret = nmgd.iImage; - TRACE("TBN_GETDISPINFOA returned bitmap id %d, mask=%08lx, nNumBitmaps=%d\n", + TRACE("TBN_GETDISPINFOA returned bitmap id %d, mask=%08lx, nNumBitmaps=%d\n", ret, nmgd.dwMask, infoPtr->nNumBitmaps); } return ret; } -static BOOL +static BOOL TOOLBAR_IsValidBitmapIndex(TOOLBAR_INFO *infoPtr, INT index) { if (((index>=0) && (index <= infoPtr->nNumBitmaps)) || @@ -328,7 +328,7 @@ TOOLBAR_IsValidBitmapIndex(TOOLBAR_INFO *infoPtr, INT index) * * This function validates the bitmap index (including I_IMAGECALLBACK * functionality). It then draws the image via the ImageList_Draw -* function. It returns TRUE if the image was drawn, FALSE otherwise. +* function. It returns TRUE if the image was drawn, FALSE otherwise. */ static BOOL TOOLBAR_DrawImageList (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HIMAGELIST himl, @@ -340,7 +340,7 @@ TOOLBAR_DrawImageList (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HIMAGELIST h if (!TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap)) { if (btnPtr->iBitmap == I_IMAGENONE) return FALSE; - ERR("index %d is not valid, max %d\n", + ERR("index %d is not valid, max %d\n", btnPtr->iBitmap, infoPtr->nNumBitmaps); return FALSE; } @@ -375,7 +375,7 @@ TOOLBAR_TestImageExist (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HIMAGELIST if (!TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap)) { if (btnPtr->iBitmap == I_IMAGENONE) return FALSE; - ERR("index %d is not valid, max %d\n", + ERR("index %d is not valid, max %d\n", btnPtr->iBitmap, infoPtr->nNumBitmaps); return FALSE; } @@ -402,7 +402,7 @@ TOOLBAR_DrawFlatSeparator (LPRECT lpRect, HDC hdc, TOOLBAR_INFO *infoPtr) myrect.top = lpRect->top + 2; myrect.bottom = lpRect->bottom - 2; - newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ? + newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ? comctl32_color.clrBtnShadow : infoPtr->clrBtnShadow; oldcolor = SetBkColor (hdc, newcolor); ExtTextOutA (hdc, 0, 0, ETO_OPAQUE, &myrect, 0, 0, 0); @@ -410,7 +410,7 @@ TOOLBAR_DrawFlatSeparator (LPRECT lpRect, HDC hdc, TOOLBAR_INFO *infoPtr) myrect.left = myrect.right; myrect.right = myrect.left + 1; - newcolor = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ? + newcolor = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ? comctl32_color.clrBtnHighlight : infoPtr->clrBtnHighlight; SetBkColor (hdc, newcolor); ExtTextOutA (hdc, 0, 0, ETO_OPAQUE, &myrect, 0, 0, 0); @@ -446,7 +446,7 @@ TOOLBAR_DrawDDFlatSeparator (LPRECT lpRect, HDC hdc, TBUTTON_INFO *btnPtr, TOOLB TRACE("rect=(%d,%d)-(%d,%d)\n", myrect.left, myrect.top, myrect.right, myrect.bottom); - newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ? + newcolor = (infoPtr->clrBtnShadow == CLR_DEFAULT) ? comctl32_color.clrBtnShadow : infoPtr->clrBtnShadow; oldcolor = SetBkColor (hdc, newcolor); ExtTextOutA (hdc, 0, 0, ETO_OPAQUE, &myrect, 0, 0, 0); @@ -454,7 +454,7 @@ TOOLBAR_DrawDDFlatSeparator (LPRECT lpRect, HDC hdc, TBUTTON_INFO *btnPtr, TOOLB myrect.top = myrect.bottom; myrect.bottom = myrect.top + 1; - newcolor = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ? + newcolor = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ? comctl32_color.clrBtnHighlight : infoPtr->clrBtnHighlight; SetBkColor (hdc, newcolor); ExtTextOutA (hdc, 0, 0, ETO_OPAQUE, &myrect, 0, 0, 0); @@ -631,7 +631,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) rc.right = max(rc.left, rc.right - DDARROW_WIDTH); else rc.right = max(rc.left, rc.right - DDARROW_WIDTH - 2); - rcArrow.left = rc.right; + rcArrow.left = rc.right; } /* Center the bitmap horizontally and vertically */ @@ -645,7 +645,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) else rcBitmap.top+=(infoPtr->nButtonHeight - infoPtr->nBitmapHeight) / 2; - TRACE("iBitmap: %d, start=(%d,%d) w=%d, h=%d\n", + TRACE("iBitmap: %d, start=(%d,%d) w=%d, h=%d\n", btnPtr->iBitmap, rcBitmap.left, rcBitmap.top, infoPtr->nBitmapWidth, infoPtr->nBitmapHeight); TRACE ("iString: %x\n", btnPtr->iString); @@ -656,7 +656,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) InflateRect (&rcText, -3, -3); - if (infoPtr->himlDef && + if (infoPtr->himlDef && TOOLBAR_IsValidBitmapIndex(infoPtr,btnPtr->iBitmap)) { /* The following test looked like this before * I changed it. IE4 "Links" toolbar would not @@ -664,7 +664,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) * ((dwStyle & TBSTYLE_LIST) && * ((btnPtr->fsStyle & TBSTYLE_AUTOSIZE) == 0) && * (btnPtr->iBitmap != I_IMAGENONE)) - */ + */ if (dwStyle & TBSTYLE_LIST) { /* LIST style w/ ICON offset is by matching native. */ /* Matches IE4 "Links" bar. - GA 8/01 */ @@ -711,7 +711,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) tbcd.hbrLines = 0; tbcd.hpenLines = 0; - /* Issue Item Prepaint notify */ + /* Issue Item Prepaint notify */ infoPtr->dwItemCustDraw = 0; infoPtr->dwItemCDFlag = 0; if (infoPtr->dwBaseCustDraw & CDRF_NOTIFYITEMDRAW) @@ -725,7 +725,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) ntfret = TOOLBAR_SendNotify ((NMHDR *)&tbcd, infoPtr, NM_CUSTOMDRAW); infoPtr->dwItemCustDraw = ntfret & 0xffff; infoPtr->dwItemCDFlag = ntfret & 0xffff0000; - if (infoPtr->dwItemCustDraw & CDRF_SKIPDEFAULT) + if (infoPtr->dwItemCustDraw & CDRF_SKIPDEFAULT) return; /* save the only part of the rect that the user can change */ rcText.right = tbcd.rcText.right + rc.left; @@ -765,7 +765,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) DrawEdge (hdc, &rcArrow, EDGE_RAISED, BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST); } - + if (hasDropDownArrow) { TOOLBAR_DrawArrow(hdc, rcArrow.left+1, rcArrow.top+1, COLOR_3DHIGHLIGHT); @@ -773,7 +773,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) } if (!TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDis, - hdc, rcBitmap.left, rcBitmap.top, + hdc, rcBitmap.left, rcBitmap.top, ILD_NORMAL)) TOOLBAR_DrawMasked (infoPtr, btnPtr, hdc, rcBitmap.left, rcBitmap.top); @@ -804,7 +804,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) TOOLBAR_DrawArrow(hdc, rcArrow.left, rcArrow.top, COLOR_WINDOWFRAME); TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDef, - hdc, rcBitmap.left+offset, rcBitmap.top+offset, + hdc, rcBitmap.left+offset, rcBitmap.top+offset, ILD_NORMAL); TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState, dwStyle, &rcText, lpText, &tbcd); @@ -825,16 +825,16 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) } TOOLBAR_DrawPattern (hdc, &rc); - + TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDef, - hdc, rcBitmap.left+1, rcBitmap.top+1, + hdc, rcBitmap.left+1, rcBitmap.top+1, ILD_NORMAL); TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState, dwStyle, &rcText, lpText, &tbcd); goto FINALNOTIFY; } - /* indeterminate */ + /* indeterminate */ if (btnPtr->fsState & TBSTATE_INDETERMINATE) { if (!(infoPtr->dwItemCDFlag & TBCDRF_NOEDGES)) DrawEdge (hdc, &rc, EDGE_RAISED, @@ -888,9 +888,9 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) if (btnPtr->bHot) { /* if hot, attempt to draw with himlHot, if fails, use himlDef */ - if (!TOOLBAR_DrawImageList (infoPtr, btnPtr, + if (!TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlHot, - hdc, rcBitmap.left, + hdc, rcBitmap.left, rcBitmap.top, ILD_NORMAL)) TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDef, hdc, rcBitmap.left, rcBitmap.top, @@ -918,7 +918,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc) TOOLBAR_DrawImageList (infoPtr, btnPtr, infoPtr->himlDef, hdc, rcBitmap.left, rcBitmap.top, ILD_NORMAL);} - + TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState, dwStyle, &rcText, lpText, &tbcd); @@ -1002,7 +1002,7 @@ TOOLBAR_Refresh (HWND hwnd, HDC hdc, PAINTSTRUCT* ps) * only DrawText does. Note that the TBSTYLE_NOPREFIX is handled here. */ static void -TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, +TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc, LPSIZE lpSize) { RECT myrect; @@ -1010,7 +1010,7 @@ TOOLBAR_MeasureString(TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, lpSize->cx = 0; lpSize->cy = 0; - if (!(btnPtr->fsState & TBSTATE_HIDDEN) ) + if (!(btnPtr->fsState & TBSTATE_HIDDEN) ) { LPWSTR lpText = TOOLBAR_GetText(infoPtr, btnPtr); @@ -1080,17 +1080,17 @@ TOOLBAR_CalcStrings (HWND hwnd, LPSIZE lpSize) /*********************************************************************** * TOOLBAR_WrapToolbar * -* This function walks through the buttons and seperators in the -* toolbar, and sets the TBSTATE_WRAP flag only on those items where -* wrapping should occur based on the width of the toolbar window. -* It does *not* calculate button placement itself. That task -* takes place in TOOLBAR_CalcToolbar. If the program wants to manage -* the toolbar wrapping on its own, it can use the TBSTYLE_WRAPABLE +* This function walks through the buttons and seperators in the +* toolbar, and sets the TBSTATE_WRAP flag only on those items where +* wrapping should occur based on the width of the toolbar window. +* It does *not* calculate button placement itself. That task +* takes place in TOOLBAR_CalcToolbar. If the program wants to manage +* the toolbar wrapping on its own, it can use the TBSTYLE_WRAPABLE * flag, and set the TBSTATE_WRAP flags manually on the appropriate items. * -* Note: TBSTYLE_WRAPABLE or TBSTYLE_EX_UNDOC1 can be used also to allow -* vertical toolbar lists. -*/ +* Note: TBSTYLE_WRAPABLE or TBSTYLE_EX_UNDOC1 can be used also to allow +* vertical toolbar lists. +*/ static void TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) @@ -1101,10 +1101,10 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) RECT rc; BOOL bWrap, bButtonWrap; - /* When the toolbar window style is not TBSTYLE_WRAPABLE, */ + /* When the toolbar window style is not TBSTYLE_WRAPABLE, */ /* no layout is necessary. Applications may use this style */ /* to perform their own layout on the toolbar. */ - if( !(dwStyle & TBSTYLE_WRAPABLE) && + if( !(dwStyle & TBSTYLE_WRAPABLE) && !(infoPtr->dwExStyle & TBSTYLE_EX_UNDOC1) ) return; btnPtr = infoPtr->buttons; @@ -1126,7 +1126,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) { bWrap = FALSE; btnPtr[i].fsState &= ~TBSTATE_WRAP; - + if (btnPtr[i].fsState & TBSTATE_HIDDEN) continue; @@ -1138,18 +1138,18 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) /* width. - GA 8/01 */ if ((btnPtr[i].fsStyle & TBSTYLE_SEP) && !(btnPtr[i].fsStyle & TBSTYLE_DROPDOWN)) - cx = (btnPtr[i].iBitmap > 0) ? + cx = (btnPtr[i].iBitmap > 0) ? btnPtr[i].iBitmap : SEPARATOR_WIDTH; else cx = infoPtr->nButtonWidth; - /* Two or more adjacent separators form a separator group. */ + /* Two or more adjacent separators form a separator group. */ /* The first separator in a group should be wrapped to the */ /* next row if the previous wrapping is on a button. */ if( bButtonWrap && - (btnPtr[i].fsStyle & TBSTYLE_SEP) && + (btnPtr[i].fsStyle & TBSTYLE_SEP) && (i + 1 < infoPtr->nNumButtons ) && - (btnPtr[i + 1].fsStyle & TBSTYLE_SEP) ) + (btnPtr[i + 1].fsStyle & TBSTYLE_SEP) ) { TRACE("wrap point 1 btn %d style %02x\n", i, btnPtr[i].fsStyle); btnPtr[i].fsState |= TBSTATE_WRAP; @@ -1162,28 +1162,28 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) /* The layout makes sure the bitmap is visible, but not the button. */ /* Test added to also wrap after a button that starts a row but */ /* is bigger than the area. - GA 8/01 */ - if (( x + cx - (infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2 + if (( x + cx - (infoPtr->nButtonWidth - infoPtr->nBitmapWidth) / 2 > infoPtr->nWidth ) || ((x == infoPtr->nIndent) && (cx > infoPtr->nWidth))) { BOOL bFound = FALSE; - /* If the current button is a separator and not hidden, */ + /* If the current button is a separator and not hidden, */ /* go to the next until it reaches a non separator. */ /* Wrap the last separator if it is before a button. */ while( ( ((btnPtr[i].fsStyle & TBSTYLE_SEP) && - !(btnPtr[i].fsStyle & TBSTYLE_DROPDOWN)) || + !(btnPtr[i].fsStyle & TBSTYLE_DROPDOWN)) || (btnPtr[i].fsState & TBSTATE_HIDDEN) ) && i < infoPtr->nNumButtons ) { i++; bFound = TRUE; } - + if( bFound && i < infoPtr->nNumButtons ) { i--; - TRACE("wrap point 2 btn %d style %02x, x=%d, cx=%d\n", + TRACE("wrap point 2 btn %d style %02x, x=%d, cx=%d\n", i, btnPtr[i].fsStyle, x, cx); btnPtr[i].fsState |= TBSTATE_WRAP; x = infoPtr->nIndent; @@ -1193,20 +1193,20 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) else if ( i >= infoPtr->nNumButtons) break; - /* If the current button is not a separator, find the last */ + /* If the current button is not a separator, find the last */ /* separator and wrap it. */ for ( j = i - 1; j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--) { if ((btnPtr[j].fsStyle & TBSTYLE_SEP) && !(btnPtr[j].fsState & TBSTATE_HIDDEN)) { - bFound = TRUE; - i = j; - TRACE("wrap point 3 btn %d style %02x, x=%d, cx=%d\n", + bFound = TRUE; + i = j; + TRACE("wrap point 3 btn %d style %02x, x=%d, cx=%d\n", i, btnPtr[i].fsStyle, x, cx); x = infoPtr->nIndent; btnPtr[j].fsState |= TBSTATE_WRAP; - bButtonWrap = FALSE; + bButtonWrap = FALSE; break; } } @@ -1215,15 +1215,15 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) /* non-hidden previous button. */ if (!bFound) { - for ( j = i - 1; + for ( j = i - 1; j >= 0 && !(btnPtr[j].fsState & TBSTATE_WRAP); j--) { - if (btnPtr[j].fsState & TBSTATE_HIDDEN) + if (btnPtr[j].fsState & TBSTATE_HIDDEN) continue; - bFound = TRUE; - i = j; - TRACE("wrap point 4 btn %d style %02x, x=%d, cx=%d\n", + bFound = TRUE; + i = j; + TRACE("wrap point 4 btn %d style %02x, x=%d, cx=%d\n", i, btnPtr[i].fsStyle, x, cx); x = infoPtr->nIndent; btnPtr[j].fsState |= TBSTATE_WRAP; @@ -1233,7 +1233,7 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) } /* If all above failed, wrap the current button. */ - if (!bFound) + if (!bFound) { TRACE("wrap point 5 btn %d style %02x, x=%d, cx=%d\n", i, btnPtr[i].fsStyle, x, cx); @@ -1244,10 +1244,10 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) bButtonWrap = FALSE; else bButtonWrap = TRUE; - } + } } else { - TRACE("wrap point 6 btn %d style %02x, x=%d, cx=%d\n", + TRACE("wrap point 6 btn %d style %02x, x=%d, cx=%d\n", i, btnPtr[i].fsStyle, x, cx); x += cx; } @@ -1258,13 +1258,13 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) /*********************************************************************** * TOOLBAR_CalcToolbar * -* This function calculates button and separator placement. It first -* calculates the button sizes, gets the toolbar window width and then -* calls TOOLBAR_WrapToolbar to determine which buttons we need to wrap +* This function calculates button and separator placement. It first +* calculates the button sizes, gets the toolbar window width and then +* calls TOOLBAR_WrapToolbar to determine which buttons we need to wrap * on. It assigns a new location to each item and sends this location to -* the tooltip window if appropriate. Finally, it updates the rcBound -* rect and calculates the new required toolbar window height. -*/ +* the tooltip window if appropriate. Finally, it updates the rcBound +* rect and calculates the new required toolbar window height. +*/ static void TOOLBAR_CalcToolbar (HWND hwnd) @@ -1301,10 +1301,10 @@ TOOLBAR_CalcToolbar (HWND hwnd) if (sizeString.cy > 0) { if (usesBitmaps) - infoPtr->nButtonHeight = sizeString.cy + + infoPtr->nButtonHeight = sizeString.cy + 2 + /* this is the space to separate text from bitmap */ infoPtr->nBitmapHeight + 6; - else + else infoPtr->nButtonHeight = sizeString.cy + 6; } else if (infoPtr->nButtonHeight < infoPtr->nBitmapHeight + 6) @@ -1327,8 +1327,8 @@ TOOLBAR_CalcToolbar (HWND hwnd) y = 0; /* - * We will set the height below, and we set the width on entry - * so we do not reset them here.. + * We will set the height below, and we set the width on entry + * so we do not reset them here.. */ #if 0 GetClientRect( hwnd, &rc ); @@ -1389,7 +1389,7 @@ TOOLBAR_CalcToolbar (HWND hwnd) } else { - if (btnPtr->fsStyle & TBSTYLE_AUTOSIZE) + if (btnPtr->fsStyle & TBSTYLE_AUTOSIZE) { SIZE sz; HDC hdc; @@ -1406,7 +1406,7 @@ TOOLBAR_CalcToolbar (HWND hwnd) /* Fudge amount measured against IE4 "menu" and "Links" */ /* toolbars with native control (v4.71). - GA 8/01 */ cx = sz.cx + 6 + 5 + 5; - if ((dwStyle & TBSTYLE_LIST) && + if ((dwStyle & TBSTYLE_LIST) && (TOOLBAR_TestImageExist (infoPtr, btnPtr, infoPtr->himlDef))) cx += infoPtr->nBitmapWidth; } @@ -1414,7 +1414,7 @@ TOOLBAR_CalcToolbar (HWND hwnd) cx = infoPtr->nButtonWidth; if (hasDropDownArrows && (btnPtr->fsStyle & TBSTYLE_DROPDOWN)) - cx += DDARROW_WIDTH; + cx += DDARROW_WIDTH; } if (btnPtr->fsState & TBSTATE_WRAP ) bWrap = TRUE; @@ -1429,7 +1429,7 @@ TOOLBAR_CalcToolbar (HWND hwnd) infoPtr->rcBound.bottom = y + cy; /* Set the toolTip only for non-hidden, non-separator button */ - if (infoPtr->hwndToolTip && !(btnPtr->fsStyle & TBSTYLE_SEP )) + if (infoPtr->hwndToolTip && !(btnPtr->fsStyle & TBSTYLE_SEP )) { TTTOOLINFOA ti; @@ -1454,17 +1454,17 @@ TOOLBAR_CalcToolbar (HWND hwnd) { if ( !(btnPtr->fsStyle & TBSTYLE_SEP) ) y += cy; - else - { + else + { /* UNDOCUMENTED: If a separator has a non zero bitmap index, */ /* it is the actual width of the separator. This is used for */ /* custom controls in toolbars. */ if ( !(btnPtr->fsStyle & TBSTYLE_DROPDOWN)) y += cy + ( (btnPtr->iBitmap > 0 ) ? - btnPtr->iBitmap : SEPARATOR_WIDTH) * 2 /3; + btnPtr->iBitmap : SEPARATOR_WIDTH) * 2 /3; else y += cy; - + /* nSepRows is used to calculate the extra height follwoing */ /* the last row. */ nSepRows++; @@ -1495,10 +1495,10 @@ TOOLBAR_CalcToolbar (HWND hwnd) /* nSepRows * (infoPtr->nBitmapHeight + 1) is the space following */ /* the last row. */ - infoPtr->nHeight = TOP_BORDER + (nRows + 1) * infoPtr->nButtonHeight + + infoPtr->nHeight = TOP_BORDER + (nRows + 1) * infoPtr->nButtonHeight + nSepRows * (SEPARATOR_WIDTH * 2 / 3) + - nSepRows * (infoPtr->nBitmapHeight + 1) + - BOTTOM_BORDER; + nSepRows * (infoPtr->nBitmapHeight + 1) + + BOTTOM_BORDER; #endif infoPtr->nHeight = infoPtr->rcBound.bottom - infoPtr->rcBound.top; @@ -1513,7 +1513,7 @@ TOOLBAR_InternalHitTest (HWND hwnd, LPPOINT lpPt) TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); TBUTTON_INFO *btnPtr; INT i; - + btnPtr = infoPtr->buttons; for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++) { if (btnPtr->fsState & TBSTATE_HIDDEN) @@ -1593,7 +1593,7 @@ TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT nIndex) /* check next buttons */ nRunIndex = nIndex + 1; while (nRunIndex < infoPtr->nNumButtons) { - btnPtr = &infoPtr->buttons[nRunIndex]; + btnPtr = &infoPtr->buttons[nRunIndex]; if ((btnPtr->fsStyle & TBSTYLE_CHECKGROUP) == TBSTYLE_CHECKGROUP) { if (btnPtr->fsState & TBSTATE_CHECKED) return nRunIndex; @@ -1648,7 +1648,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) char Buffer[256]; int i = 0; int index; - + infoPtr = custInfo->tbInfo; /* send TBN_QUERYINSERT notification */ @@ -1668,8 +1668,8 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* send TBN_QUERYDELETE notification */ nmtb.iItem = i; - btnInfo->bRemovable = TOOLBAR_SendNotify ((NMHDR *) &nmtb, - infoPtr, + btnInfo->bRemovable = TOOLBAR_SendNotify ((NMHDR *) &nmtb, + infoPtr, TBN_QUERYDELETE); index = (int)SendDlgItemMessageA (hwnd, IDC_TOOLBARBTN_LBOX, LB_ADDSTRING, 0, 0); @@ -1697,7 +1697,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (!TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_GETBUTTONINFOA)) break; - TRACE("style: %x\n", nmtb.tbButton.fsStyle); + TRACE("style: %x\n", nmtb.tbButton.fsStyle); /* insert button into the apropriate list */ index = TOOLBAR_GetButtonIndex (custInfo->tbInfo, nmtb.tbButton.idCommand, FALSE); @@ -1773,7 +1773,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* send TBN_QUERYINSERT notification */ nmtb.iItem = index; - TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, + TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_QUERYINSERT); /* get list box item */ @@ -2100,18 +2100,18 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam) TRACE ("adding %d internal bitmaps!\n", nButtons); /* Windows resize all the buttons to the size of a newly added standard image */ - if (lpAddBmp->nID & 1) + if (lpAddBmp->nID & 1) { /* large icons */ - /* FIXME: on windows the size of the images is 25x24 but the size of the bitmap - * in rsrc is only 24x24. Fix the bitmap (how?) and then fix this + /* FIXME: on windows the size of the images is 25x24 but the size of the bitmap + * in rsrc is only 24x24. Fix the bitmap (how?) and then fix this */ SendMessageA (hwnd, TB_SETBITMAPSIZE, 0, MAKELPARAM((WORD)24, (WORD)24)); SendMessageA (hwnd, TB_SETBUTTONSIZE, 0, MAKELPARAM((WORD)31, (WORD)30)); - } - else + } + else { /* small icons */ SendMessageA (hwnd, TB_SETBITMAPSIZE, 0, @@ -2119,7 +2119,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam) SendMessageA (hwnd, TB_SETBUTTONSIZE, 0, MAKELPARAM((WORD)22, (WORD)22)); } - + TOOLBAR_CalcToolbar (hwnd); } else @@ -2127,10 +2127,10 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam) nButtons = (INT)wParam; if (nButtons <= 0) return -1; - + TRACE ("adding %d bitmaps!\n", nButtons); } - + if (!(infoPtr->himlDef)) { /* create new default image list */ TRACE ("creating default image list!\n"); @@ -2146,7 +2146,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam) /* Add bitmaps to the default image list */ if (lpAddBmp->hInst == (HINSTANCE)0) { - nIndex = + nIndex = ImageList_AddMasked (infoPtr->himlDef, (HBITMAP)lpAddBmp->nID, CLR_DEFAULT); } @@ -2476,7 +2476,7 @@ TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam) if (szString[0] == L'|') { PWSTR p = szString + 1; - + nIndex = infoPtr->nNumStrings; while (*p != L'|') { @@ -2698,7 +2698,7 @@ TOOLBAR_CheckButton (HWND hwnd, WPARAM wParam, LPARAM lParam) btnPtr->fsState &= ~TBSTATE_CHECKED; else { if (btnPtr->fsStyle & TBSTYLE_GROUP) { - nOldIndex = + nOldIndex = TOOLBAR_GetCheckedGroupButtonIndex (infoPtr, nIndex); if (nOldIndex == nIndex) return 0; @@ -2781,7 +2781,7 @@ TOOLBAR_DeleteButton (HWND hwnd, WPARAM wParam, LPARAM lParam) if ((nIndex < 0) || (nIndex >= infoPtr->nNumButtons)) return FALSE; - if ((infoPtr->hwndToolTip) && + if ((infoPtr->hwndToolTip) && !(infoPtr->buttons[nIndex].fsStyle & TBSTYLE_SEP)) { TTTOOLINFOA ti; @@ -2976,7 +2976,7 @@ TOOLBAR_GetButtonInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam) if (lpTbInfo->cbSize < sizeof(TBBUTTONINFOW)) return -1; - nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, + nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, lpTbInfo->dwMask & 0x80000000); if (nIndex == -1) return -1; @@ -3134,7 +3134,7 @@ TOOLBAR_GetItemRect (HWND hwnd, WPARAM wParam, LPARAM lParam) return FALSE; if (btnPtr->fsState & TBSTATE_HIDDEN) return FALSE; - + lpRect->left = btnPtr->rect.left; lpRect->right = btnPtr->rect.right; lpRect->bottom = btnPtr->rect.bottom; @@ -3195,7 +3195,7 @@ TOOLBAR_GetRect (HWND hwnd, WPARAM wParam, LPARAM lParam) lpRect = (LPRECT)lParam; if (lpRect == NULL) return FALSE; - + lpRect->left = btnPtr->rect.left; lpRect->right = btnPtr->rect.right; lpRect->bottom = btnPtr->rect.bottom; @@ -3273,7 +3273,7 @@ TOOLBAR_GetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam) { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); - TRACE("%s hwnd=0x%x stub!\n", + TRACE("%s hwnd=0x%x stub!\n", infoPtr->bUnicode ? "TRUE" : "FALSE", hwnd); return infoPtr->bUnicode; @@ -3471,7 +3471,7 @@ TOOLBAR_InsertButtonW (HWND hwnd, WPARAM wParam, LPARAM lParam) } else if (nIndex < 0) return FALSE; - /* If the string passed is not an index, assume address of string + /* If the string passed is not an index, assume address of string and do our own AddString */ if ((HIWORD(lpTbb->iString) != 0) && (lpTbb->iString != -1)) { LPWSTR ptr; @@ -3839,7 +3839,7 @@ TOOLBAR_SetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam) return FALSE; if (lptbbi->cbSize < sizeof(TBBUTTONINFOA)) return FALSE; - + nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, lptbbi->dwMask & 0x80000000); if (nIndex == -1) @@ -3863,7 +3863,7 @@ TOOLBAR_SetButtonInfoA (HWND hwnd, WPARAM wParam, LPARAM lParam) if ((HIWORD(btnPtr->iString) == 0) || (btnPtr->iString == -1)) /* iString is index, zero it to make Str_SetPtr succeed */ btnPtr->iString=0; - + Str_SetPtrAtoW ((LPWSTR *)&btnPtr->iString, lptbbi->pszText); } return TRUE; @@ -3925,15 +3925,15 @@ TOOLBAR_SetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam) } /* The documentation claims you can only change the button size before - * any button has been added. But this is wrong. - * WINZIP32.EXE (ver 8) calls this on one of its buttons after adding + * any button has been added. But this is wrong. + * WINZIP32.EXE (ver 8) calls this on one of its buttons after adding * it to the toolbar, and it checks that the return value is nonzero - mjm * Further testing shows that we must actually perform the change too. */ /* * The documentation also does not mention that if 0 is supplied for * either size, the system changes it to the default of 24 wide and - * 22 high. Demonstarted in ControlSpy Toolbar. GLA 3/02 + * 22 high. Demonstarted in ControlSpy Toolbar. GLA 3/02 */ infoPtr->nButtonWidth = (cx) ? cx : 24; infoPtr->nButtonHeight = (cy) ? cy : 22; @@ -3956,7 +3956,7 @@ TOOLBAR_SetButtonWidth (HWND hwnd, WPARAM wParam, LPARAM lParam) (infoPtr->cxMax == (INT)HIWORD(lParam))) { TRACE("matches current width, min=%d, max=%d, no recalc\n", infoPtr->cxMin, infoPtr->cxMax); - return TRUE; + return TRUE; } /* save new values */ @@ -3965,14 +3965,14 @@ TOOLBAR_SetButtonWidth (HWND hwnd, WPARAM wParam, LPARAM lParam) /* if both values are 0 then we are done */ if (lParam == 0) { - TRACE("setting both min and max to 0, norecalc\n"); + TRACE("setting both min and max to 0, norecalc\n"); return TRUE; } /* otherwise we need to recalc the toolbar and in some cases recalc the bounding rectangle (does DrawText w/ DT_CALCRECT which doesn't actually draw - GA). */ - TRACE("number of buttons %d, cx=%d, cy=%d, recalcing\n", + TRACE("number of buttons %d, cx=%d, cy=%d, recalcing\n", infoPtr->nNumButtons, infoPtr->cxMin, infoPtr->cxMax); TOOLBAR_CalcToolbar (hwnd); @@ -4021,7 +4021,7 @@ TOOLBAR_SetDisabledImageList (HWND hwnd, WPARAM wParam, LPARAM lParam) /* FIXME: redraw ? */ - return (LRESULT)himlTemp; + return (LRESULT)himlTemp; } @@ -4060,7 +4060,7 @@ TOOLBAR_SetExtendedStyle (HWND hwnd, WPARAM wParam, LPARAM lParam) FIXME("Unknown Toolbar Extended Style 0x%08lx. Please report.\n", (infoPtr->dwExStyle & ~TBSTYLE_EX_ALL)); - return (LRESULT)dwTemp; + return (LRESULT)dwTemp; } @@ -4080,7 +4080,7 @@ TOOLBAR_SetHotImageList (HWND hwnd, WPARAM wParam, LPARAM lParam) /* FIXME: redraw ? */ - return (LRESULT)himlTemp; + return (LRESULT)himlTemp; } @@ -4146,7 +4146,7 @@ TOOLBAR_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam) /* FIXME: redraw ? */ InvalidateRect(hwnd, NULL, TRUE); - return (LRESULT)himlTemp; + return (LRESULT)himlTemp; } @@ -4348,7 +4348,7 @@ TOOLBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); BOOL bTemp; - TRACE("%s hwnd=0x%04x stub!\n", + TRACE("%s hwnd=0x%04x stub!\n", ((BOOL)wParam) ? "TRUE" : "FALSE", hwnd); bTemp = infoPtr->bUnicode; @@ -4363,10 +4363,10 @@ TOOLBAR_GetColorScheme (HWND hwnd, LPCOLORSCHEME lParam) { TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); - lParam->clrBtnHighlight = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ? - comctl32_color.clrBtnHighlight : + lParam->clrBtnHighlight = (infoPtr->clrBtnHighlight == CLR_DEFAULT) ? + comctl32_color.clrBtnHighlight : infoPtr->clrBtnHighlight; - lParam->clrBtnShadow = (infoPtr->clrBtnShadow == CLR_DEFAULT) ? + lParam->clrBtnShadow = (infoPtr->clrBtnShadow == CLR_DEFAULT) ? comctl32_color.clrBtnShadow : infoPtr->clrBtnShadow; return 1; } @@ -4426,7 +4426,7 @@ TOOLBAR_Unkwn45E (HWND hwnd, WPARAM wParam, LPARAM lParam) nmhotitem.idOld = (nOldHotItem >= 0) ? infoPtr->buttons[nOldHotItem].idCommand : 0; if ( !(nmhotitem.dwFlags & HICF_LEAVING) ) - nmhotitem.idNew = (infoPtr->nHotItem >= 0) ? + nmhotitem.idNew = (infoPtr->nHotItem >= 0) ? infoPtr->buttons[infoPtr->nHotItem].idCommand : 0; no_hi = TOOLBAR_SendNotify((NMHDR*)&nmhotitem, infoPtr, TBN_HOTITEMCHANGE); } @@ -4635,7 +4635,7 @@ TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->dwBaseCustDraw = ntfret & 0xffff; /* FIXME: in general the return flags *can* be or'ed together */ - switch (infoPtr->dwBaseCustDraw) + switch (infoPtr->dwBaseCustDraw) { case CDRF_DODEFAULT: break; @@ -4647,7 +4647,7 @@ TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam) } } - /* If the toolbar is "transparent" then pass the WM_ERASEBKGND up + /* If the toolbar is "transparent" then pass the WM_ERASEBKGND up * to my parent for processing. */ if (infoPtr->bTransparent) { @@ -4666,14 +4666,14 @@ TOOLBAR_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam) if (!ret) ret = DefWindowProcA (hwnd, WM_ERASEBKGND, wParam, lParam); - if ((dwStyle & TBSTYLE_CUSTOMERASE) && - (infoPtr->dwBaseCustDraw & CDRF_NOTIFYPOSTERASE)) { + if ((dwStyle & TBSTYLE_CUSTOMERASE) && + (infoPtr->dwBaseCustDraw & CDRF_NOTIFYPOSTERASE)) { ZeroMemory (&tbcd, sizeof(NMTBCUSTOMDRAW)); tbcd.nmcd.dwDrawStage = CDDS_POSTERASE; tbcd.nmcd.hdc = (HDC)wParam; ntfret = TOOLBAR_SendNotify ((NMHDR *)&tbcd, infoPtr, NM_CUSTOMDRAW); infoPtr->dwBaseCustDraw = ntfret & 0xffff; - switch (infoPtr->dwBaseCustDraw) + switch (infoPtr->dwBaseCustDraw) { case CDRF_DODEFAULT: break; @@ -4846,7 +4846,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) nHit); if (nOldIndex == nHit) bSendMessage = FALSE; - if ((nOldIndex != nHit) && + if ((nOldIndex != nHit) && (nOldIndex != -1)) infoPtr->buttons[nOldIndex].fsState &= ~TBSTATE_CHECKED; btnPtr->fsState |= TBSTATE_CHECKED; @@ -4868,7 +4868,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) /* * now we can ReleaseCapture, which triggers CAPTURECHANGED msg, * that resets bCaptured and btn TBSTATE_PRESSED flags, - * and obliterates nButtonDown and nOldHit (see TOOLBAR_CaptureChanged) + * and obliterates nButtonDown and nOldHit (see TOOLBAR_CaptureChanged) */ if ((infoPtr->bCaptured) && (infoPtr->nButtonDown >= 0)) ReleaseCapture (); @@ -4877,7 +4877,7 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_SendNotify ((NMHDR *) &hdr, infoPtr, NM_RELEASEDCAPTURE); - /* native issues TBN_ENDDRAG here, if _LBUTTONDOWN issued the + /* native issues TBN_ENDDRAG here, if _LBUTTONDOWN issued the * TBN_BEGINDRAG */ nmtb.iItem = btnPtr->idCommand; @@ -4992,7 +4992,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) /* Make sure tracking is enabled so we receive a WM_MOUSELEAVE message */ if(!(trackinfo.dwFlags & TME_LEAVE)) { trackinfo.dwFlags = TME_LEAVE; /* notify upon leaving */ - + /* call TRACKMOUSEEVENT so we receive a WM_MOUSELEAVE message */ /* and can properly deactivate the hot toolbar button */ _TrackMouseEvent(&trackinfo); @@ -5011,7 +5011,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) { /* Remove the effect of an old hot button if the button was enabled and was drawn with the hot button effect */ - if(infoPtr->nOldHit >= 0 && infoPtr->nOldHit == infoPtr->nHotItem && + if(infoPtr->nOldHit >= 0 && infoPtr->nOldHit == infoPtr->nHotItem && (infoPtr->buttons[infoPtr->nOldHit].fsState & TBSTATE_ENABLED)) { oldBtnPtr = &infoPtr->buttons[infoPtr->nOldHit]; @@ -5025,7 +5025,7 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->nHotItem = nHit; - /* only enabled buttons show hot effect */ + /* only enabled buttons show hot effect */ if(infoPtr->buttons[nHit].fsState & TBSTATE_ENABLED) { btnPtr->bHot = TRUE; @@ -5116,7 +5116,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam) * CreateBitmap(0x27, 0x24, 1, 1, 0) * hdc = GetDC(toolbar) * GetSystemMetrics(0x48) - * fnt2=CreateFontA(0xe, 0, 0, 0, 0x190, 0, 0, 0, 0, 2, + * fnt2=CreateFontA(0xe, 0, 0, 0, 0x190, 0, 0, 0, 0, 2, * 0, 0, 0, 0, "MARLETT") * oldfnt = SelectObject(hdc, fnt2) * GetCharWidthA(hdc, 0x36, 0x36, adr2) @@ -5205,12 +5205,12 @@ TOOLBAR_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam) if (lppgc->dwFlag == PGF_CALCWIDTH) { lppgc->iWidth = infoPtr->rcBound.right - infoPtr->rcBound.left; - TRACE("processed PGN_CALCSIZE, returning horz size = %d\n", + TRACE("processed PGN_CALCSIZE, returning horz size = %d\n", lppgc->iWidth); } else { lppgc->iHeight = infoPtr->rcBound.bottom - infoPtr->rcBound.top; - TRACE("processed PGN_CALCSIZE, returning vert size = %d\n", + TRACE("processed PGN_CALCSIZE, returning vert size = %d\n", lppgc->iHeight); } return 0; @@ -5231,10 +5231,10 @@ TOOLBAR_Notify (HWND hwnd, WPARAM wParam, LPARAM lParam) if ((infoPtr->hwndToolTip) && (lpnmh->hwndFrom == infoPtr->hwndToolTip)) { if (infoPtr->bNtfUnicode) - return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, + return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, wParam, lParam); else - return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, + return SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, wParam, lParam); #if 0 @@ -5296,7 +5296,7 @@ TOOLBAR_Paint (HWND hwnd, WPARAM wParam) PAINTSTRUCT ps; /* fill ps.rcPaint with a default rect */ - memcpy(&(ps.rcPaint), &(infoPtr->rcBound), sizeof(infoPtr->rcBound)); + memcpy(&(ps.rcPaint), &(infoPtr->rcBound), sizeof(infoPtr->rcBound)); hdc = wParam==0 ? BeginPaint(hwnd, &ps) : (HDC)wParam; @@ -5319,7 +5319,7 @@ TOOLBAR_SetRedraw (HWND hwnd, WPARAM wParam, LPARAM lParam) * Handles the WM_SETREDRAW message. * * Documentation: - * According to testing V4.71 of COMCTL32 returns the + * According to testing V4.71 of COMCTL32 returns the * *previous* status of the redraw flag (either 0 or 1) * instead of the MSDN documented value of 0 if handled. * (For laughs see the "consistancy" with same function @@ -5330,7 +5330,7 @@ TOOLBAR_SetRedraw (HWND hwnd, WPARAM wParam, LPARAM lParam) TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd); BOOL oldredraw = infoPtr->bDoRedraw; - TRACE("set to %s\n", + TRACE("set to %s\n", (wParam) ? "TRUE" : "FALSE"); infoPtr->bDoRedraw = (BOOL) wParam; if (wParam) { @@ -5384,7 +5384,7 @@ TOOLBAR_Size (HWND hwnd, WPARAM wParam, LPARAM lParam) * this sets the working width of the toolbar, and * Calc Toolbar will not adjust it, only the height */ - infoPtr->nWidth = parent_rect.right - parent_rect.left; + infoPtr->nWidth = parent_rect.right - parent_rect.left; cy = infoPtr->nHeight; cx = infoPtr->nWidth; TOOLBAR_CalcToolbar (hwnd); @@ -5440,7 +5440,7 @@ TOOLBAR_StyleChanged (HWND hwnd, INT nType, LPSTYLESTRUCT lpStyle) infoPtr->dwDTFlags = DT_CENTER; } infoPtr->bTransparent = (lpStyle->styleNew & TBSTYLE_TRANSPARENT); - infoPtr->bBtnTranspnt = (lpStyle->styleNew & + infoPtr->bBtnTranspnt = (lpStyle->styleNew & (TBSTYLE_FLAT | TBSTYLE_LIST)); TOOLBAR_CheckStyle (hwnd, lpStyle->styleNew); } @@ -5466,7 +5466,7 @@ TOOLBAR_SysColorChange (HWND hwnd) static LRESULT WINAPI ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", + TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", hwnd, uMsg, /* SPY_GetMsgName(uMsg), */ wParam, lParam); if (!TOOLBAR_GetInfoPtr(hwnd) && (uMsg != WM_NCCREATE)) @@ -5774,10 +5774,10 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TOOLBAR_MouseMove (hwnd, wParam, lParam); case WM_MOUSELEAVE: - return TOOLBAR_MouseLeave (hwnd, wParam, lParam); + return TOOLBAR_MouseLeave (hwnd, wParam, lParam); case WM_CAPTURECHANGED: - return TOOLBAR_CaptureChanged(hwnd); + return TOOLBAR_CaptureChanged(hwnd); case WM_NCACTIVATE: return TOOLBAR_NCActivate (hwnd, wParam, lParam); @@ -5854,7 +5854,7 @@ TOOLBAR_Register (void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); wndClass.lpszClassName = TOOLBARCLASSNAMEA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index efe8fe105de..47428f3a724 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -61,7 +61,7 @@ * * infoPtr->nTool is the tool the mouse was on on the last relayed MM * or timer expiry or -1 if the mouse was not on a tool. - * + * * infoPtr->nCurrentTool is the tool for which the tip is currently * displaying text for or -1 if the tip is not shown. Actually this * will only ever be infoPtr-nTool or -1, so it could be changed to a @@ -97,7 +97,7 @@ typedef struct HINSTANCE hinst; LPWSTR lpszText; LPARAM lParam; -} TTTOOL_INFO; +} TTTOOL_INFO; typedef struct @@ -285,7 +285,7 @@ TOOLTIPS_CalcTipSize (HWND hwnd, TOOLTIPS_INFO *infoPtr, LPSIZE lpSize) SelectObject (hdc, hOldFont); ReleaseDC (hwnd, hdc); - lpSize->cx = rc.right - rc.left + 4 + + lpSize->cx = rc.right - rc.left + 4 + infoPtr->rcMargin.left + infoPtr->rcMargin.right; lpSize->cy = rc.bottom - rc.top + 4 + infoPtr->rcMargin.bottom + infoPtr->rcMargin.top; @@ -367,7 +367,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr) else { rc = toolPtr->rect; MapWindowPoints (toolPtr->hwnd, (HWND)0, (LPPOINT)&rc, 2); - } + } rect.bottom = rc.top - 2; rect.top = rect.bottom - size.cy; } @@ -535,7 +535,7 @@ TOOLTIPS_GetToolFromInfoA (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFOA lpToolInfo) for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) { toolPtr = &infoPtr->tools[nTool]; - if (!(toolPtr->uFlags & TTF_IDISHWND) && + if (!(toolPtr->uFlags & TTF_IDISHWND) && (lpToolInfo->hwnd == toolPtr->hwnd) && (lpToolInfo->uId == toolPtr->uId)) return nTool; @@ -562,7 +562,7 @@ TOOLTIPS_GetToolFromInfoW (TOOLTIPS_INFO *infoPtr, LPTTTOOLINFOW lpToolInfo) for (nTool = 0; nTool < infoPtr->uNumTools; nTool++) { toolPtr = &infoPtr->tools[nTool]; - if (!(toolPtr->uFlags & TTF_IDISHWND) && + if (!(toolPtr->uFlags & TTF_IDISHWND) && (lpToolInfo->hwnd == toolPtr->hwnd) && (lpToolInfo->uId == toolPtr->uId)) return nTool; @@ -738,7 +738,7 @@ TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam) if (lpttsi == NULL) { lpttsi = (LPTT_SUBCLASS_INFO)COMCTL32_Alloc (sizeof(TT_SUBCLASS_INFO)); - lpttsi->wpOrigProc = + lpttsi->wpOrigProc = (WNDPROC)SetWindowLongA ((HWND)toolPtr->uId, GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc); lpttsi->hwndToolTip = hwnd; @@ -755,7 +755,7 @@ TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam) if (lpttsi == NULL) { lpttsi = (LPTT_SUBCLASS_INFO)COMCTL32_Alloc (sizeof(TT_SUBCLASS_INFO)); - lpttsi->wpOrigProc = + lpttsi->wpOrigProc = (WNDPROC)SetWindowLongA (toolPtr->hwnd, GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc); lpttsi->hwndToolTip = hwnd; @@ -840,7 +840,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam) if (lpttsi == NULL) { lpttsi = (LPTT_SUBCLASS_INFO)COMCTL32_Alloc (sizeof(TT_SUBCLASS_INFO)); - lpttsi->wpOrigProc = + lpttsi->wpOrigProc = (WNDPROC)SetWindowLongA ((HWND)toolPtr->uId, GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc); lpttsi->hwndToolTip = hwnd; @@ -857,7 +857,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam) if (lpttsi == NULL) { lpttsi = (LPTT_SUBCLASS_INFO)COMCTL32_Alloc (sizeof(TT_SUBCLASS_INFO)); - lpttsi->wpOrigProc = + lpttsi->wpOrigProc = (WNDPROC)SetWindowLongA (toolPtr->hwnd, GWL_WNDPROC,(LONG)TOOLTIPS_SubclassProc); lpttsi->hwndToolTip = hwnd; @@ -896,9 +896,9 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam) /* make sure the tooltip has disappeared before deleting it */ TOOLTIPS_Hide(hwnd, infoPtr); - + /* delete text string */ - toolPtr = &infoPtr->tools[nTool]; + toolPtr = &infoPtr->tools[nTool]; if ((toolPtr->hinst) && (toolPtr->lpszText)) { if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) && (HIWORD((INT)toolPtr->lpszText) != 0) ) @@ -962,11 +962,11 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->nTool == nTool) { /* no current tool (0 means first tool) */ - infoPtr->nTool = -1; + infoPtr->nTool = -1; } - + infoPtr->uNumTools--; - + return 0; } @@ -992,10 +992,10 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam) TRACE("tool %d\n", nTool); /* make sure the tooltip has disappeared before deleting it */ - TOOLTIPS_Hide(hwnd, infoPtr); - + TOOLTIPS_Hide(hwnd, infoPtr); + /* delete text string */ - toolPtr = &infoPtr->tools[nTool]; + toolPtr = &infoPtr->tools[nTool]; if ((toolPtr->hinst) && (toolPtr->lpszText)) { if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) && (HIWORD((INT)toolPtr->lpszText) != 0) ) @@ -1059,11 +1059,11 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->nTool == nTool) { /* no current tool (0 means first tool) */ - infoPtr->nTool = -1; + infoPtr->nTool = -1; } - + infoPtr->uNumTools--; - + return 0; } @@ -2044,7 +2044,7 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) toolPtr = &infoPtr->tools[i]; if ((toolPtr->hinst) && (toolPtr->lpszText)) { if ( (toolPtr->lpszText != LPSTR_TEXTCALLBACKW) && - (HIWORD((INT)toolPtr->lpszText) != 0) ) + (HIWORD((INT)toolPtr->lpszText) != 0) ) { COMCTL32_Free (toolPtr->lpszText); toolPtr->lpszText = NULL; @@ -2054,7 +2054,7 @@ TOOLTIPS_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) /* remove subclassing */ if (toolPtr->uFlags & TTF_SUBCLASS) { LPTT_SUBCLASS_INFO lpttsi; - + if (toolPtr->uFlags & TTF_IDISHWND) { lpttsi = (LPTT_SUBCLASS_INFO)GetPropA ((HWND)toolPtr->uId, COMCTL32_aSubclass); if (lpttsi) { @@ -2470,10 +2470,10 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETTEXT: return TOOLTIPS_OnWMGetText (hwnd, wParam, lParam); - + case WM_GETTEXTLENGTH: return TOOLTIPS_OnWMGetTextLength (hwnd, wParam, lParam); - + case WM_LBUTTONDOWN: case WM_LBUTTONUP: @@ -2528,7 +2528,7 @@ TOOLTIPS_Register (void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = 0; wndClass.lpszClassName = TOOLTIPS_CLASSA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 4bc2e595432..6701053a8d5 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -23,7 +23,7 @@ * - handle dragging slider better * - better tic handling. * - more notifications. - * + * */ /* known bugs: @@ -76,10 +76,10 @@ typedef struct #define TRACKBAR_GetInfoPtr(wndPtr) ((TRACKBAR_INFO *)GetWindowLongA (hwnd,0)) -/* Used by TRACKBAR_Refresh to find out which parts of the control +/* Used by TRACKBAR_Refresh to find out which parts of the control need to be recalculated */ -#define TB_THUMBPOSCHANGED 1 +#define TB_THUMBPOSCHANGED 1 #define TB_THUMBSIZECHANGED 2 #define TB_THUMBCHANGED (TB_THUMBPOSCHANGED | TB_THUMBPOSCHANGED) #define TB_SELECTIONCHANGED 4 @@ -101,7 +101,7 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr) { int i,tic,nrTics; - if (infoPtr->uTicFreq && infoPtr->nRangeMax >= infoPtr->nRangeMin) + if (infoPtr->uTicFreq && infoPtr->nRangeMax >= infoPtr->nRangeMin) nrTics=(infoPtr->nRangeMax - infoPtr->nRangeMin)/infoPtr->uTicFreq; else { nrTics=0; @@ -112,7 +112,7 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr) } if (nrTics!=infoPtr->uNumTics) { - infoPtr->tics=COMCTL32_ReAlloc (infoPtr->tics, + infoPtr->tics=COMCTL32_ReAlloc (infoPtr->tics, (nrTics+1)*sizeof (DWORD)); infoPtr->uNumTics=nrTics; } @@ -123,12 +123,12 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr) } -/* converts from physical (mouse) position to logical position +/* converts from physical (mouse) position to logical position (in range of trackbar) */ static inline DOUBLE -TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place, - int vertical) +TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place, + int vertical) { double range,width,pos; @@ -165,7 +165,7 @@ TRACKBAR_CalcChannel (HWND hwnd, TRACKBAR_INFO *infoPtr) else cyChannel = 4; - offsettop = (int)(infoPtr->uThumbLen/4.5); + offsettop = (int)(infoPtr->uThumbLen/4.5); offsetedge = (int)(infoPtr->uThumbLen/4.5) + 3; if (dwStyle & TBS_VERT) { @@ -202,33 +202,33 @@ TRACKBAR_CalcThumb (HWND hwnd, TRACKBAR_INFO *infoPtr) RECT *thumb; int range, width, thumbdepth; DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); - + thumb=&infoPtr->rcThumb; range=infoPtr->nRangeMax - infoPtr->nRangeMin; thumbdepth = ((INT)((FLOAT)infoPtr->uThumbLen / 4.5) * 2) + 2; if (!range) return; /* FIXME: may this happen? */ - if (dwStyle & TBS_VERT) + if (dwStyle & TBS_VERT) { width=infoPtr->rcChannel.bottom - infoPtr->rcChannel.top; if (dwStyle & (TBS_BOTH | TBS_LEFT)) thumb->left = 10; else - thumb-> left =2; + thumb-> left =2; thumb->right = thumb -> left + infoPtr->uThumbLen; thumb->top = infoPtr->rcChannel.top + - (width*(infoPtr->nPos - infoPtr->nRangeMin))/range - + (width*(infoPtr->nPos - infoPtr->nRangeMin))/range - thumbdepth/2; thumb->bottom = thumb->top + thumbdepth; - } - else + } + else { width=infoPtr->rcChannel.right - infoPtr->rcChannel.left; thumb->left = infoPtr->rcChannel.left + - (width*(infoPtr->nPos - infoPtr->nRangeMin))/range - + (width*(infoPtr->nPos - infoPtr->nRangeMin))/range - thumbdepth/2; thumb->right = thumb->left + thumbdepth; if (dwStyle & (TBS_BOTH | TBS_TOP)) @@ -249,9 +249,9 @@ TRACKBAR_CalcSelection (HWND hwnd, TRACKBAR_INFO *infoPtr) range=infoPtr->nRangeMax - infoPtr->nRangeMin; width=infoPtr->rcChannel.right - infoPtr->rcChannel.left; - if (range <= 0) + if (range <= 0) SetRectEmpty (selection); - else + else if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT) { selection->left = infoPtr->rcChannel.left + (width*infoPtr->nSelMin)/range; @@ -274,7 +274,7 @@ TRACKBAR_CalcSelection (HWND hwnd, TRACKBAR_INFO *infoPtr) /* ticPos is in tic-units, not in pixels */ static VOID -TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, +TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags, COLORREF clrTic) { RECT rcChannel=infoPtr->rcChannel; @@ -292,9 +292,9 @@ TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, } if (flags & TIC_SELECTIONMARK) { - if (flags & TIC_SELECTIONMARKMIN) + if (flags & TIC_SELECTIONMARKMIN) x=rcChannel.left + (width*(ticPos - infoPtr->nRangeMin))/range - 1; - else + else x=rcChannel.left + (width*(ticPos - infoPtr->nRangeMin))/range + 1; SetPixel (hdc, x,y+6*side, clrTic); @@ -312,7 +312,7 @@ TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, if (flags & TIC_EDGE) { if (flags & TIC_LEFTEDGE) x=rcChannel.left; - else + else x=rcChannel.right; SetPixel (hdc, x,y+5*side, clrTic); @@ -324,7 +324,7 @@ TRACKBAR_DrawHorizTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, } static VOID -TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, +TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags, COLORREF clrTic) { RECT rcChannel=infoPtr->rcChannel; @@ -343,9 +343,9 @@ TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, if (flags & TIC_SELECTIONMARK) { - if (flags & TIC_SELECTIONMARKMIN) + if (flags & TIC_SELECTIONMARKMIN) y=rcChannel.top + (width*(ticPos - infoPtr->nRangeMin))/range - 1; - else + else y=rcChannel.top + (width*(ticPos - infoPtr->nRangeMin))/range + 1; SetPixel (hdc, x+6*side, y, clrTic); @@ -363,7 +363,7 @@ TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, if (flags & TIC_EDGE) { if (flags & TIC_LEFTEDGE) y=rcChannel.top; - else + else y=rcChannel.bottom; SetPixel (hdc, x+5*side, y, clrTic); @@ -376,23 +376,23 @@ TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, static VOID -TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, +TRACKBAR_DrawTics (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags, COLORREF clrTic) { if (flags & TBS_VERT) { - if ((flags & TBS_TOP) || (flags & TBS_BOTH)) - TRACKBAR_DrawVertTic (infoPtr, hdc, ticPos, + if ((flags & TBS_TOP) || (flags & TBS_BOTH)) + TRACKBAR_DrawVertTic (infoPtr, hdc, ticPos, flags | TBS_TOP , clrTic); - if (!(flags & TBS_TOP) || (flags & TBS_BOTH)) + if (!(flags & TBS_TOP) || (flags & TBS_BOTH)) TRACKBAR_DrawVertTic (infoPtr, hdc, ticPos, flags, clrTic); return; } - if ((flags & TBS_TOP) || (flags & TBS_BOTH)) + if ((flags & TBS_TOP) || (flags & TBS_BOTH)) TRACKBAR_DrawHorizTic (infoPtr, hdc, ticPos, flags | TBS_TOP , clrTic); - if (!(flags & TBS_TOP) || (flags & TBS_BOTH)) + if (!(flags & TBS_TOP) || (flags & TBS_BOTH)) TRACKBAR_DrawHorizTic (infoPtr, hdc, ticPos, flags, clrTic); } @@ -411,8 +411,8 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) oldbr = SelectObject (hdc, hbr); SetPolyFillMode (hdc,WINDING); - - if (dwStyle & TBS_BOTH) + + if (dwStyle & TBS_BOTH) { points[0].x=thumb.right; points[0].y=thumb.top; @@ -426,8 +426,8 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) points[4].y=points[0].y; PointCount = 5; BlackUntil = 3; - } - else + } + else { if (dwStyle & TBS_VERT) { @@ -472,7 +472,7 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) points[1].x=thumb.right; points[1].y=thumb.top + PointDepth; points[2].x=thumb.right; - points[2].y=thumb.bottom; + points[2].y=thumb.bottom; points[3].x=thumb.left; points[3].y=thumb.bottom; points[4].x=thumb.left; @@ -497,7 +497,7 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) points[5].y=points[0].y; } } - + } /* @@ -513,13 +513,13 @@ TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc, DWORD dwStyle) /* * Black part - */ + */ Polyline(hdc,points,BlackUntil); SelectObject(hdc,oldpen); hpn = GetStockObject(WHITE_PEN); SelectObject(hdc,hpn); - + /* * White Part */ @@ -551,15 +551,15 @@ TRACKBAR_Refresh (HWND hwnd, HDC hdc) infoPtr->nPos=infoPtr->dragPos; infoPtr->flags |= TB_THUMBPOSCHANGED; } - + if (infoPtr->flags & TB_THUMBCHANGED) { TRACKBAR_CalcThumb (hwnd, infoPtr); - if (infoPtr->flags & TB_THUMBSIZECHANGED) + if (infoPtr->flags & TB_THUMBSIZECHANGED) TRACKBAR_CalcChannel (hwnd, infoPtr); } if (infoPtr->flags & TB_SELECTIONCHANGED) TRACKBAR_CalcSelection (hwnd, infoPtr); - infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED | + infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED | TB_DRAGPOSVALID); /* draw channel */ @@ -571,11 +571,11 @@ TRACKBAR_Refresh (HWND hwnd, HDC hdc) if (dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */ HBRUSH hbr = CreateSolidBrush (RGB(255,255,255)); FillRect (hdc, &rcChannel, hbr); - if (((dwStyle & TBS_VERT) && - (rcSelection.left!=rcSelection.right)) || - ((!(dwStyle & TBS_VERT)) && + if (((dwStyle & TBS_VERT) && + (rcSelection.left!=rcSelection.right)) || + ((!(dwStyle & TBS_VERT)) && (rcSelection.left!=rcSelection.right))) { - hbr=CreateSolidBrush (COLOR_HIGHLIGHT); + hbr=CreateSolidBrush (COLOR_HIGHLIGHT); FillRect (hdc, &rcSelection, hbr); } DeleteObject (hbr); @@ -588,27 +588,27 @@ TRACKBAR_Refresh (HWND hwnd, HDC hdc) int ticFlags = dwStyle & 0x0f; COLORREF clrTic=GetSysColor (COLOR_3DDKSHADOW); - for (i=0; iuNumTics; i++) - TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->tics[i], + for (i=0; iuNumTics; i++) + TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->tics[i], ticFlags, clrTic); TRACKBAR_DrawTics (infoPtr, hdc, 0, ticFlags | TIC_LEFTEDGE, clrTic); TRACKBAR_DrawTics (infoPtr, hdc, 0, ticFlags | TIC_RIGHTEDGE, clrTic); - - if ((dwStyle & TBS_ENABLESELRANGE) && + + if ((dwStyle & TBS_ENABLESELRANGE) && (rcSelection.left!=rcSelection.right)) { - TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMin, + TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMin, ticFlags | TIC_SELECTIONMARKMIN, clrTic); - TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMax, + TRACKBAR_DrawTics (infoPtr, hdc, infoPtr->nSelMax, ticFlags | TIC_SELECTIONMARKMAX, clrTic); } } /* draw thumb */ - if (!(dwStyle & TBS_NOTHUMB)) + if (!(dwStyle & TBS_NOTHUMB)) { - TRACKBAR_DrawThumb(infoPtr,hdc,dwStyle); + TRACKBAR_DrawThumb(infoPtr,hdc,dwStyle); } if (infoPtr->bFocus) @@ -678,7 +678,7 @@ TRACKBAR_ClearSel (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->nSelMax = 0; infoPtr->flags |= TB_SELECTIONCHANGED; - if ((BOOL)wParam) + if ((BOOL)wParam) InvalidateRect (hwnd, NULL, FALSE); return 0; @@ -696,7 +696,7 @@ TRACKBAR_ClearTics (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->uNumTics = 0; } - if (wParam) + if (wParam) InvalidateRect (hwnd, NULL, FALSE); return 0; @@ -821,7 +821,7 @@ static LRESULT TRACKBAR_GetPTics (HWND hwnd) { TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd); - + return (LRESULT) infoPtr->tics; } @@ -830,17 +830,17 @@ TRACKBAR_GetThumbRect (HWND hwnd, WPARAM wParam, LPARAM lParam) { TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd); LPRECT lprc = (LPRECT)lParam; - + if (lprc == NULL) - return 0; - + return 0; + lprc->left = infoPtr->rcThumb.left; lprc->right = infoPtr->rcThumb.right; lprc->bottom = infoPtr->rcThumb.bottom; lprc->top = infoPtr->rcThumb.top; - + return 0; -} +} static LRESULT @@ -850,7 +850,7 @@ TRACKBAR_GetTic (HWND hwnd, WPARAM wParam, LPARAM lParam) INT iTic; iTic=(INT) wParam; - if ((iTic<0) || (iTic>infoPtr->uNumTics)) + if ((iTic<0) || (iTic>infoPtr->uNumTics)) return -1; return (LRESULT) infoPtr->tics[iTic]; @@ -863,10 +863,10 @@ TRACKBAR_GetTicPos (HWND hwnd, WPARAM wParam, LPARAM lParam) { TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd); INT iTic, range, width, pos; - + iTic=(INT ) wParam; - if ((iTic<0) || (iTic>infoPtr->uNumTics)) + if ((iTic<0) || (iTic>infoPtr->uNumTics)) return -1; range=infoPtr->nRangeMax - infoPtr->nRangeMin; @@ -957,7 +957,7 @@ TRACKBAR_SetPos (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->nPos = infoPtr->nRangeMax; infoPtr->flags |= TB_THUMBPOSCHANGED; - if (wParam) + if (wParam) InvalidateRect (hwnd, NULL, FALSE); return 0; @@ -1009,7 +1009,7 @@ TRACKBAR_SetRangeMax (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->nPageSize = 1; TRACKBAR_RecalculateTics (infoPtr); - if (wParam) + if (wParam) InvalidateRect (hwnd, NULL, FALSE); return 0; @@ -1043,16 +1043,16 @@ static LRESULT TRACKBAR_SetTicFreq (HWND hwnd, WPARAM wParam) { TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd); - + if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_AUTOTICKS) - infoPtr->uTicFreq=(UINT) wParam; - + infoPtr->uTicFreq=(UINT) wParam; + TRACKBAR_RecalculateTics (infoPtr); InvalidateRect (hwnd, NULL, FALSE); return 0; -} +} static LRESULT @@ -1072,7 +1072,7 @@ TRACKBAR_SetSel (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->nSelMax > infoPtr->nRangeMax) infoPtr->nSelMax = infoPtr->nRangeMax; - if (wParam) + if (wParam) InvalidateRect (hwnd, NULL, FALSE); @@ -1090,11 +1090,11 @@ TRACKBAR_SetSelEnd (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->nSelMax = (INT)lParam; infoPtr->flags |= TB_SELECTIONCHANGED; - + if (infoPtr->nSelMax > infoPtr->nRangeMax) infoPtr->nSelMax = infoPtr->nRangeMax; - if (wParam) + if (wParam) InvalidateRect (hwnd, NULL, FALSE); return 0; @@ -1115,7 +1115,7 @@ TRACKBAR_SetSelStart (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->nSelMin < infoPtr->nRangeMin) infoPtr->nSelMin = infoPtr->nRangeMin; - if (wParam) + if (wParam) InvalidateRect (hwnd, NULL, FALSE); return 0; @@ -1165,7 +1165,7 @@ TRACKBAR_SetTipSide (HWND hwnd, WPARAM wParam, LPARAM lParam) INT fTemp = infoPtr->fLocation; infoPtr->fLocation = (INT)wParam; - + return fTemp; } @@ -1322,7 +1322,7 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->flags |= TB_SHOW_TOOLTIP; SetCapture (hwnd); - SendMessageA (infoPtr->hwndToolTip, TTM_TRACKACTIVATE, + SendMessageA (infoPtr->hwndToolTip, TTM_TRACKACTIVATE, (WPARAM)TRUE, (LPARAM)&ti); } return 0; @@ -1338,7 +1338,7 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) else clickPlace=(INT)LOWORD(lParam); - clickPos = TRACKBAR_ConvertPlaceToPosition(infoPtr, clickPlace, + clickPos = TRACKBAR_ConvertPlaceToPosition(infoPtr, clickPlace, vertical); prevPos = infoPtr->nPos; if (clickPos > (int)prevPos) @@ -1346,22 +1346,22 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) infoPtr->nPos += infoPtr->nPageSize; if (infoPtr->nPos > infoPtr->nRangeMax) infoPtr->nPos = infoPtr->nRangeMax; - TRACKBAR_SendNotify (hwnd, TB_PAGEUP); - } - else + TRACKBAR_SendNotify (hwnd, TB_PAGEUP); + } + else { infoPtr->nPos -= infoPtr->nPageSize; /* similar to VK_PRIOR */ if (infoPtr->nPos < infoPtr->nRangeMin) infoPtr->nPos = infoPtr->nRangeMin; TRACKBAR_SendNotify (hwnd, TB_PAGEDOWN); } - + if (prevPos!=infoPtr->nPos) { infoPtr->flags |= TB_THUMBPOSCHANGED; InvalidateRect (hwnd, NULL, FALSE); } } - + return 0; } @@ -1390,7 +1390,7 @@ TRACKBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) SendMessageA (infoPtr->hwndToolTip, TTM_TRACKACTIVATE, (WPARAM)FALSE, (LPARAM)&ti); } - + InvalidateRect (hwnd, NULL, FALSE); return 0; @@ -1401,12 +1401,12 @@ static LRESULT TRACKBAR_CaptureChanged (HWND hwnd, WPARAM wParam, LPARAM lParam) { TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd); - + if (infoPtr->flags & TB_DRAGPOSVALID) { infoPtr->nPos=infoPtr->dragPos; InvalidateRect (hwnd, NULL, FALSE); } - + infoPtr->flags &= ~ TB_DRAGPOSVALID; TRACKBAR_SendNotify (hwnd, TB_ENDTRACK); @@ -1459,11 +1459,11 @@ TRACKBAR_SendNotify (HWND hwnd, UINT code) { TRACE("%x\n",code); - if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT) - return (BOOL) SendMessageA (GetParent (hwnd), + if (GetWindowLongA (hwnd, GWL_STYLE) & TBS_VERT) + return (BOOL) SendMessageA (GetParent (hwnd), WM_VSCROLL, (WPARAM)code, (LPARAM)hwnd); - return (BOOL) SendMessageA (GetParent (hwnd), + return (BOOL) SendMessageA (GetParent (hwnd), WM_HSCROLL, (WPARAM)code, (LPARAM)hwnd); } @@ -1476,7 +1476,7 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) SHORT clickPlace; DOUBLE dragPos; char buf[80]; - + TRACE("%x\n",wParam); if (dwStyle & TBS_VERT) @@ -1488,7 +1488,7 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) return TRUE; SetCapture (hwnd); - dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, + dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, dwStyle & TBS_VERT); if (dragPos > ((INT)dragPos) + 0.5) infoPtr->dragPos = dragPos + 1; @@ -1501,7 +1501,7 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) if (infoPtr->flags & TB_SHOW_TOOLTIP) { POINT pt; TTTOOLINFOA ti; - + ti.cbSize = sizeof(TTTOOLINFOA); ti.hwnd = hwnd; ti.uId = 0; @@ -1509,12 +1509,12 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) sprintf (buf,"%d",infoPtr->nPos); ti.lpszText = (LPSTR) buf; GetCursorPos (&pt); - + if (dwStyle & TBS_VERT) { - SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION, + SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION, 0, (LPARAM)MAKELPARAM(pt.x+5, pt.y+15)); } else { - SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION, + SendMessageA (infoPtr->hwndToolTip, TTM_TRACKPOSITION, 0, (LPARAM)MAKELPARAM(pt.x+15, pt.y+5)); } SendMessageA (infoPtr->hwndToolTip, TTM_UPDATETIPTEXTA, @@ -1539,48 +1539,48 @@ TRACKBAR_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam) pos=infoPtr->nPos; switch (wParam) { case VK_LEFT: - case VK_UP: + case VK_UP: if (infoPtr->nPos == infoPtr->nRangeMin) return FALSE; infoPtr->nPos -= infoPtr->nLineSize; - if (infoPtr->nPos < infoPtr->nRangeMin) + if (infoPtr->nPos < infoPtr->nRangeMin) infoPtr->nPos = infoPtr->nRangeMin; TRACKBAR_SendNotify (hwnd, TB_LINEUP); break; case VK_RIGHT: - case VK_DOWN: + case VK_DOWN: if (infoPtr->nPos == infoPtr->nRangeMax) return FALSE; infoPtr->nPos += infoPtr->nLineSize; - if (infoPtr->nPos > infoPtr->nRangeMax) + if (infoPtr->nPos > infoPtr->nRangeMax) infoPtr->nPos = infoPtr->nRangeMax; TRACKBAR_SendNotify (hwnd, TB_LINEDOWN); break; case VK_NEXT: if (infoPtr->nPos == infoPtr->nRangeMax) return FALSE; infoPtr->nPos += infoPtr->nPageSize; - if (infoPtr->nPos > infoPtr->nRangeMax) + if (infoPtr->nPos > infoPtr->nRangeMax) infoPtr->nPos = infoPtr->nRangeMax; TRACKBAR_SendNotify (hwnd, TB_PAGEUP); break; case VK_PRIOR: if (infoPtr->nPos == infoPtr->nRangeMin) return FALSE; infoPtr->nPos -= infoPtr->nPageSize; - if (infoPtr->nPos < infoPtr->nRangeMin) + if (infoPtr->nPos < infoPtr->nRangeMin) infoPtr->nPos = infoPtr->nRangeMin; TRACKBAR_SendNotify (hwnd, TB_PAGEDOWN); break; - case VK_HOME: + case VK_HOME: if (infoPtr->nPos == infoPtr->nRangeMin) return FALSE; infoPtr->nPos = infoPtr->nRangeMin; TRACKBAR_SendNotify (hwnd, TB_TOP); break; - case VK_END: + case VK_END: if (infoPtr->nPos == infoPtr->nRangeMax) return FALSE; infoPtr->nPos = infoPtr->nRangeMax; TRACKBAR_SendNotify (hwnd, TB_BOTTOM); break; } - if (pos!=infoPtr->nPos) { + if (pos!=infoPtr->nPos) { infoPtr->flags |=TB_THUMBPOSCHANGED; InvalidateRect (hwnd, NULL, FALSE); } @@ -1594,12 +1594,12 @@ TRACKBAR_KeyUp (HWND hwnd, WPARAM wParam) { switch (wParam) { case VK_LEFT: - case VK_UP: + case VK_UP: case VK_RIGHT: - case VK_DOWN: + case VK_DOWN: case VK_NEXT: case VK_PRIOR: - case VK_HOME: + case VK_HOME: case VK_END: TRACKBAR_SendNotify (hwnd, TB_ENDTRACK); } @@ -1662,10 +1662,10 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case TBM_GETTIC: return TRACKBAR_GetTic (hwnd, wParam, lParam); - + case TBM_GETTICPOS: return TRACKBAR_GetTicPos (hwnd, wParam, lParam); - + case TBM_GETTOOLTIPS: return TRACKBAR_GetToolTips (hwnd, wParam, lParam); @@ -1738,7 +1738,7 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_KEYDOWN: return TRACKBAR_KeyDown (hwnd, wParam, lParam); - + case WM_KEYUP: return TRACKBAR_KeyUp (hwnd, wParam); @@ -1789,7 +1789,7 @@ TRACKBAR_Register (void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); wndClass.lpszClassName = TRACKBAR_CLASSA; - + RegisterClassA (&wndClass); } diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 3374eb04640..d7533fa5945 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -154,7 +154,7 @@ typedef struct tagTREEVIEW_INFO #define TV_LDRAG 0x04 /* Lbutton pushed to start drag */ #define TV_LDRAGGING 0x08 /* Lbutton pushed, mouse moved. */ #define TV_RDRAG 0x10 /* dito Rbutton */ -#define TV_RDRAGGING 0x20 +#define TV_RDRAGGING 0x20 /* bitflags for infoPtr->timer */ @@ -309,7 +309,7 @@ TREEVIEW_GetLastListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem) } /*************************************************************************** - * This method returns the previous non-hidden item in the list not + * This method returns the previous non-hidden item in the list not * considering the tree hierarchy. */ static TREEVIEW_ITEM * @@ -334,7 +334,7 @@ TREEVIEW_GetPrevListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *tvItem) /*************************************************************************** - * This method returns the next physical item in the treeview not + * This method returns the next physical item in the treeview not * considering the tree hierarchy. */ static TREEVIEW_ITEM * @@ -342,7 +342,7 @@ TREEVIEW_GetNextListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *tvItem) { assert(tvItem != NULL); - /* + /* * If this item has children and is expanded, return the first child */ if ((tvItem->state & TVIS_EXPANDED) && tvItem->firstChild != NULL) @@ -372,7 +372,7 @@ TREEVIEW_GetNextListItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *tvItem) } /*************************************************************************** - * This method returns the nth item starting at the given item. It returns + * This method returns the nth item starting at the given item. It returns * the last item (or first) we we run out of items. * * Will scroll backward if count is <0. @@ -687,7 +687,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, TREEVIEW_SendRealNotify(infoPtr, (WPARAM)callback.hdr.idFrom, (LPARAM)&callback); - /* It may have changed due to a call to SetItem. */ + /* It may have changed due to a call to SetItem. */ mask &= wineItem->callbackMask; if ((mask & TVIF_TEXT) && callback.item.pszText != wineItem->pszText) @@ -696,7 +696,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, if (infoPtr->bNtfUnicode) { LPWSTR newText; int buflen; - int len = WideCharToMultiByte( CP_ACP, 0, + int len = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)callback.item.pszText, -1, NULL, 0, NULL, NULL ); buflen = max((len+1)*sizeof(WCHAR), TEXT_CALLBACK_SIZE); @@ -708,16 +708,16 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, if (newText) { wineItem->pszText = (LPSTR)newText; - WideCharToMultiByte( CP_ACP, 0, + WideCharToMultiByte( CP_ACP, 0, (LPWSTR)callback.item.pszText, -1, - wineItem->pszText, buflen, + wineItem->pszText, buflen, NULL, NULL ); wineItem->cchTextMax = buflen; } /* If ReAlloc fails we have nothing to do, but keep original text */ } else { - int len = max(lstrlenA(callback.item.pszText) + 1, + int len = max(lstrlenA(callback.item.pszText) + 1, TEXT_CALLBACK_SIZE); LPSTR newText = COMCTL32_ReAlloc(wineItem->pszText, len); @@ -739,7 +739,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, LPWSTR newText; LPSTR oldText = NULL; int buflen; - int len = WideCharToMultiByte( CP_ACP, 0, + int len = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)callback.item.pszText, -1, NULL, 0, NULL, NULL ); buflen = max((len+1)*sizeof(WCHAR), TEXT_CALLBACK_SIZE); @@ -752,7 +752,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, { oldText = wineItem->pszText; wineItem->pszText = (LPSTR)newText; - WideCharToMultiByte( CP_ACP, 0, + WideCharToMultiByte( CP_ACP, 0, (LPWSTR)callback.item.pszText, -1, wineItem->pszText, buflen, NULL, NULL ); wineItem->cchTextMax = buflen; @@ -761,7 +761,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, } } } - + if (mask & TVIF_IMAGE) wineItem->iImage = callback.item.iImage; @@ -1240,7 +1240,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam) /* This will help us to exit if there is no more sibling */ aChild = (aChild->nextSibling == 0) - ? NULL + ? NULL : aChild->nextSibling; /* Look at the next item */ @@ -1248,9 +1248,9 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam) } else if (comp == 0) { - /* - * An item with this name is already existing, therefore, - * we add after the one we found + /* + * An item with this name is already existing, therefore, + * we add after the one we found */ TREEVIEW_InsertAfter(newItem, aChild, parentItem); bItemInserted = TRUE; @@ -1258,7 +1258,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam) } } - /* + /* * we reach the end of the child list and the item has not * yet been inserted, therefore, insert it after the last child. */ @@ -1304,7 +1304,7 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam) TREEVIEW_ComputeTextWidth(infoPtr, newItem, 0); TREEVIEW_UpdateScrollBars(infoPtr); /* - * if the item was inserted in a visible part of the tree, + * if the item was inserted in a visible part of the tree, * invalidate it, as well as those after it */ for (item = newItem; @@ -1435,8 +1435,8 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem) { TRACE("%p, (%s)\n", wineItem, TREEVIEW_ItemName(wineItem)); - TREEVIEW_SendTreeviewNotify(infoPtr, - (infoPtr->bNtfUnicode) ? TVN_DELETEITEMW : + TREEVIEW_SendTreeviewNotify(infoPtr, + (infoPtr->bNtfUnicode) ? TVN_DELETEITEMW : TVN_DELETEITEMA, TVIF_HANDLE | TVIF_PARAM, 0, wineItem, 0); @@ -1933,9 +1933,9 @@ TREEVIEW_GetItemRect(TREEVIEW_INFO *infoPtr, BOOL fTextRect, LPRECT lpRect) if (!TREEVIEW_ValidItem(infoPtr, wineItem) || !ISVISIBLE(wineItem)) return FALSE; - /* - * If wParam is TRUE return the text size otherwise return - * the whole item size + /* + * If wParam is TRUE return the text size otherwise return + * the whole item size */ if (fTextRect) { @@ -2141,7 +2141,7 @@ TREEVIEW_SetItemW(TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem) len ++; tvItemA.pszText = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR)); len = WideCharToMultiByte(CP_ACP, 0, tvItem->pszText, -1, - tvItemA.pszText ,len*sizeof(WCHAR), + tvItemA.pszText ,len*sizeof(WCHAR), NULL,NULL); } else @@ -2300,7 +2300,7 @@ TREEVIEW_DrawItemLines(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item) HPEN hOldPen, hNewPen; HTREEITEM parent; - /* + /* * Get a dotted grey pen */ hNewPen = CreatePen(PS_ALTERNATE, 0, infoPtr->clrLine); @@ -2342,7 +2342,7 @@ TREEVIEW_DrawItemLines(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item) DeleteObject(hNewPen); } - /* + /* * Display the (+/-) signs */ @@ -2419,7 +2419,7 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem) centery = (wineItem->rect.top + wineItem->rect.bottom) / 2; - /* + /* * Display the images associated with this item */ { @@ -2439,7 +2439,7 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem) } /* Now, draw the normal image; can be either selected or - * non-selected image. + * non-selected image. */ if ((wineItem->state & TVIS_SELECTED) && (wineItem->iSelectedImage)) @@ -2465,7 +2465,7 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem) } - /* + /* * Display the text associated with this item */ @@ -2813,7 +2813,7 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam) GetObjectA(hbitmap, sizeof(BITMAP), &bitmap); rc.left = 0; rc.top = 0; rc.right = bitmap.bmWidth; - rc.bottom = bitmap.bmHeight; + rc.bottom = bitmap.bmHeight; TREEVIEW_EraseBackground(infoPtr, wParam); } } @@ -3050,7 +3050,7 @@ TREEVIEW_SendExpanding(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, UINT action) { return !TREEVIEW_SendTreeviewNotify(infoPtr, - (infoPtr->bNtfUnicode) ? TVN_ITEMEXPANDINGW : + (infoPtr->bNtfUnicode) ? TVN_ITEMEXPANDINGW : TVN_ITEMEXPANDINGA, action, TVIF_HANDLE | TVIF_STATE | TVIF_PARAM @@ -3062,8 +3062,8 @@ static VOID TREEVIEW_SendExpanded(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, UINT action) { - TREEVIEW_SendTreeviewNotify(infoPtr, - (infoPtr->bNtfUnicode) ? TVN_ITEMEXPANDEDW : + TREEVIEW_SendTreeviewNotify(infoPtr, + (infoPtr->bNtfUnicode) ? TVN_ITEMEXPANDEDW : TVN_ITEMEXPANDEDA, action, TVIF_HANDLE | TVIF_STATE | TVIF_PARAM @@ -3240,8 +3240,8 @@ TREEVIEW_ExpandAll(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) } /* Note:If the specified item is the child of a collapsed parent item, - the parent's list of child items is (recursively) expanded to reveal the - specified item. This is mentioned for TREEVIEW_SelectItem; don't + the parent's list of child items is (recursively) expanded to reveal the + specified item. This is mentioned for TREEVIEW_SelectItem; don't know if it also applies here. */ @@ -3461,8 +3461,8 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { case EN_UPDATE: { - /* - * Adjust the edit window size + /* + * Adjust the edit window size */ char buffer[1024]; TREEVIEW_ITEM *editItem = infoPtr->selectedItem; @@ -3897,8 +3897,8 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam) if (TREEVIEW_SendSimpleNotify(infoPtr, NM_CLICK)) goto setfocus; - /* - * If the style allows editing and the node is already selected + /* + * If the style allows editing and the node is already selected * and the click occurred on the item label... */ if ((infoPtr->dwStyle & TVS_EDITLABELS) && @@ -4188,20 +4188,20 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item) /************************************************************************* * TREEVIEW_ProcessLetterKeys * - * Processes keyboard messages generated by pressing the letter keys + * Processes keyboard messages generated by pressing the letter keys * on the keyboard. - * What this does is perform a case insensitive search from the + * What this does is perform a case insensitive search from the * current position with the following quirks: - * - If two chars or more are pressed in quick succession we search + * - If two chars or more are pressed in quick succession we search * for the corresponding string (e.g. 'abc'). - * - If there is a delay we wipe away the current search string and + * - If there is a delay we wipe away the current search string and * restart with just that char. - * - If the user keeps pressing the same character, whether slowly or - * fast, so that the search string is entirely composed of this - * character ('aaaaa' for instance), then we search for first item + * - If the user keeps pressing the same character, whether slowly or + * fast, so that the search string is entirely composed of this + * character ('aaaaa' for instance), then we search for first item * that starting with that character. - * - If the user types the above character in quick succession, then - * we must also search for the corresponding string ('aaaaa'), and + * - If the user types the above character in quick succession, then + * we must also search for the corresponding string ('aaaaa'), and * go to that string if there is a match. * * RETURNS @@ -4210,13 +4210,13 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item) * * BUGS * - * - The current implementation has a list of characters it will - * accept and it ignores averything else. In particular it will - * ignore accentuated characters which seems to match what - * Windows does. But I'm not sure it makes sense to follow + * - The current implementation has a list of characters it will + * accept and it ignores averything else. In particular it will + * ignore accentuated characters which seems to match what + * Windows does. But I'm not sure it makes sense to follow * Windows there. * - We don't sound a beep when the search fails. - * - The search should start from the focused item, not from the selected + * - The search should start from the focused item, not from the selected * item. One reason for this is to allow for multiple selections in trees. * But currently infoPtr->focusedItem does not seem very usable. * @@ -4624,7 +4624,7 @@ scroll: { TREEVIEW_ITEM *item; LONG scroll_pixels = infoPtr->scrollX - scrollX; - + for (item = infoPtr->root->firstChild; item != NULL; item = TREEVIEW_GetNextListItem(infoPtr, item)) { @@ -4679,14 +4679,14 @@ TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam) static LRESULT TREEVIEW_Create(HWND hwnd) -{ +{ RECT rcClient; TREEVIEW_INFO *infoPtr; TRACE("wnd %x, style %lx\n", hwnd, GetWindowLongA(hwnd, GWL_STYLE)); infoPtr = (TREEVIEW_INFO *)COMCTL32_Alloc(sizeof(TREEVIEW_INFO)); - + if (infoPtr == NULL) { ERR("could not allocate info memory!\n"); @@ -4768,7 +4768,7 @@ TREEVIEW_Create(HWND hwnd) /* Determine what type of notify should be issued */ /* sets infoPtr->bNtfUnicode */ - TREEVIEW_NotifyFormat(infoPtr, 0, NF_REQUERY); + TREEVIEW_NotifyFormat(infoPtr, 0, NF_REQUERY); if (!(infoPtr->dwStyle & TVS_NOTOOLTIPS)) infoPtr->hwndToolTip = COMCTL32_CreateToolTip(hwnd); @@ -5009,12 +5009,12 @@ TREEVIEW_Notify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) if (lppgc->dwFlag == PGF_CALCWIDTH) { lppgc->iWidth = infoPtr->treeWidth; - TRACE("got PGN_CALCSIZE, returning horz size = %ld, client=%ld\n", + TRACE("got PGN_CALCSIZE, returning horz size = %ld, client=%ld\n", infoPtr->treeWidth, infoPtr->clientWidth); } else { lppgc->iHeight = infoPtr->treeHeight; - TRACE("got PGN_CALCSIZE, returning vert size = %ld, client=%ld\n", + TRACE("got PGN_CALCSIZE, returning vert size = %ld, client=%ld\n", infoPtr->treeHeight, infoPtr->clientHeight); } return 0; diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index 77f37ba36de..5016ba6263c 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -1,4 +1,4 @@ -/* +/* * Updown control * * Copyright 1997, 2002 Dimitrie O. Paun @@ -151,7 +151,7 @@ static BOOL UPDOWN_OffsetVal(UPDOWN_INFO *infoPtr, int delta) * want to draw a sunken edge to make like we are part of that control. */ static BOOL UPDOWN_HasBuddyBorder(UPDOWN_INFO* infoPtr) -{ +{ DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE); return ( ((dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT)) != 0) && @@ -181,7 +181,7 @@ static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow) rect->left += DEFAULT_BUDDYBORDER; else rect->right -= DEFAULT_BUDDYBORDER; - + InflateRect(rect, 0, -DEFAULT_BUDDYBORDER); } @@ -190,7 +190,7 @@ static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow) if (dwStyle & UDS_ALIGNLEFT) rect->right -= DEFAULT_BUDDYSPACER; else rect->left += DEFAULT_BUDDYSPACER; } - + /* * We're calculating the midpoint to figure-out where the * separation between the buttons will lay. We make sure that we @@ -199,7 +199,7 @@ static void UPDOWN_GetArrowRect (UPDOWN_INFO* infoPtr, RECT *rect, int arrow) if (dwStyle & UDS_HORZ) { int len = rect->right - rect->left + 1; /* compute the width */ if (arrow & FLAG_INCR) - rect->left = rect->left + len/2; + rect->left = rect->left + len/2; if (arrow & FLAG_DECR) rect->right = rect->left + len/2 - 1; } else { @@ -267,7 +267,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr) /* we have a regular window, so will get the text */ if (!GetWindowTextW(infoPtr->Buddy, txt, COUNT_OF(txt))) return FALSE; - sep = UPDOWN_GetThousandSep(); + sep = UPDOWN_GetThousandSep(); /* now get rid of the separators */ for(src = dst = txt; *src; src++) @@ -278,7 +278,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr) newVal = strtolW(txt, &src, infoPtr->Base); if(*src || !UPDOWN_InBounds (infoPtr, newVal)) return FALSE; } - + TRACE("new value(%d) from buddy (old=%d)\n", newVal, infoPtr->CurVal); infoPtr->CurVal = newVal; return TRUE; @@ -306,7 +306,7 @@ static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr) if (UPDOWN_IsBuddyListbox(infoPtr)) { return SendMessageW(infoPtr->Buddy, LB_SETCURSEL, infoPtr->CurVal, 0) != LB_ERR; } - + /* Regular window, so set caption to the number */ if (infoPtr->Base == 16) fmt[1] = 'X'; len = wsprintfW(txt, fmt, infoPtr->CurVal); @@ -317,7 +317,7 @@ static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr) WCHAR tmp[COUNT_OF(txt)], *src = tmp, *dst = txt; WCHAR sep = UPDOWN_GetThousandSep(); int start = len % 3; - + memcpy(tmp, txt, sizeof(txt)); if (start == 0) start = 3; dst += start; @@ -328,9 +328,9 @@ static BOOL UPDOWN_SetBuddyInt (UPDOWN_INFO *infoPtr) } *dst = 0; } - + return SetWindowTextW(infoPtr->Buddy, txt); -} +} /*********************************************************************** * UPDOWN_Draw @@ -346,16 +346,16 @@ static LRESULT UPDOWN_Draw (UPDOWN_INFO *infoPtr, HDC hdc) /* Draw the common border between ourselves and our buddy */ if (UPDOWN_HasBuddyBorder(infoPtr)) { GetClientRect(infoPtr->Self, &rect); - DrawEdge(hdc, &rect, EDGE_SUNKEN, - BF_BOTTOM | BF_TOP | + DrawEdge(hdc, &rect, EDGE_SUNKEN, + BF_BOTTOM | BF_TOP | (dwStyle & UDS_ALIGNLEFT ? BF_LEFT : BF_RIGHT)); } - + /* Draw the incr button */ UPDOWN_GetArrowRect (infoPtr, &rect, FLAG_INCR); pressed = (infoPtr->Flags & FLAG_PRESSED) && (infoPtr->Flags & FLAG_INCR); hot = (infoPtr->Flags & FLAG_INCR) && (infoPtr->Flags & FLAG_MOUSEIN); - DrawFrameControl(hdc, &rect, DFC_SCROLL, + DrawFrameControl(hdc, &rect, DFC_SCROLL, (dwStyle & UDS_HORZ ? DFCS_SCROLLRIGHT : DFCS_SCROLLUP) | ((dwStyle & UDS_HOTTRACK) && hot ? DFCS_HOT : 0) | (pressed ? DFCS_PUSHED : 0) | @@ -365,7 +365,7 @@ static LRESULT UPDOWN_Draw (UPDOWN_INFO *infoPtr, HDC hdc) UPDOWN_GetArrowRect(infoPtr, &rect, FLAG_DECR); pressed = (infoPtr->Flags & FLAG_PRESSED) && (infoPtr->Flags & FLAG_DECR); hot = (infoPtr->Flags & FLAG_DECR) && (infoPtr->Flags & FLAG_MOUSEIN); - DrawFrameControl(hdc, &rect, DFC_SCROLL, + DrawFrameControl(hdc, &rect, DFC_SCROLL, (dwStyle & UDS_HORZ ? DFCS_SCROLLLEFT : DFCS_SCROLLDOWN) | ((dwStyle & UDS_HOTTRACK) && hot ? DFCS_HOT : 0) | (pressed ? DFCS_PUSHED : 0) | @@ -398,11 +398,11 @@ static LRESULT UPDOWN_Paint (UPDOWN_INFO *infoPtr, HDC hdc) static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key) { int arrow; - + if (key == VK_UP) arrow = FLAG_INCR; else if (key == VK_DOWN) arrow = FLAG_DECR; else return 1; - + UPDOWN_GetBuddyInt (infoPtr); infoPtr->Flags &= ~FLAG_ARROW; infoPtr->Flags |= FLAG_PRESSED | arrow; @@ -413,19 +413,19 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key) } /*********************************************************************** - * UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy + * UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy * control. */ -static LRESULT CALLBACK +static LRESULT CALLBACK UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { WNDPROC superClassWndProc = (WNDPROC)GetPropA(hwnd, BUDDY_SUPERCLASS_WNDPROC); - TRACE("hwnd=%04x, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d\n", + TRACE("hwnd=%04x, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d\n", hwnd, (INT)superClassWndProc, uMsg, wParam, (UINT)lParam); if (uMsg == WM_KEYDOWN) { HWND upDownHwnd = GetPropA(hwnd, BUDDY_UPDOWN_HWND); - + UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam); } @@ -436,7 +436,7 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) * UPDOWN_SetBuddy * Tests if 'bud' is a valid window handle. If not, returns FALSE. * Else, sets it as a new Buddy. - * Then, it should subclass the buddy + * Then, it should subclass the buddy * If window has the UDS_ARROWKEYS, it subcalsses the buddy window to * process the UP/DOWN arrow keys. * If window has the UDS_ALIGNLEFT or UDS_ALIGNRIGHT style @@ -449,20 +449,20 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud) int x, width; /* new x position and width for the up-down */ WNDPROC baseWndProc, currWndProc; CHAR buddyClass[40]; - + /* Is it a valid bud? */ if(!IsWindow(bud)) return FALSE; TRACE("(hwnd=%04x, bud=%04x)\n", infoPtr->Self, bud); - + /* there is already a body assigned */ if (infoPtr->Buddy) RemovePropA(infoPtr->Buddy, BUDDY_UPDOWN_HWND); /* Store buddy window handle */ - infoPtr->Buddy = bud; + infoPtr->Buddy = bud; - /* keep upDown ctrl hwnd in a buddy property */ - SetPropA( bud, BUDDY_UPDOWN_HWND, infoPtr->Self); + /* keep upDown ctrl hwnd in a buddy property */ + SetPropA( bud, BUDDY_UPDOWN_HWND, infoPtr->Self); /* Store buddy window class type */ infoPtr->BuddyType = BUDDY_TYPE_UNKNOWN; @@ -474,12 +474,12 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud) } if(dwStyle & UDS_ARROWKEYS){ - /* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property - when we reset the upDown ctrl buddy to another buddy because it is not + /* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property + when we reset the upDown ctrl buddy to another buddy because it is not good to break the window proc chain. */ currWndProc = (WNDPROC) GetWindowLongW(bud, GWL_WNDPROC); if (currWndProc != UPDOWN_Buddy_SubclassProc) { - baseWndProc = (WNDPROC)SetWindowLongW(bud, GWL_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc); + baseWndProc = (WNDPROC)SetWindowLongW(bud, GWL_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc); SetPropA(bud, BUDDY_SUPERCLASS_WNDPROC, (HANDLE)baseWndProc); } } @@ -501,7 +501,7 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud) /* first adjust the buddy to accomodate the up/down */ SetWindowPos(infoPtr->Buddy, 0, budRect.left, budRect.top, - budRect.right - budRect.left, budRect.bottom - budRect.top, + budRect.right - budRect.left, budRect.bottom - budRect.top, SWP_NOACTIVATE|SWP_NOZORDER); /* now position the up/down */ @@ -511,7 +511,7 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud) /* * If the updown has a buddy border, it has to overlap with the buddy - * to look as if it is integrated with the buddy control. + * to look as if it is integrated with the buddy control. * We nudge the control or change it size to overlap. */ if (UPDOWN_HasBuddyBorder(infoPtr)) { @@ -521,18 +521,18 @@ static BOOL UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud) x -= DEFAULT_BUDDYBORDER; } - SetWindowPos(infoPtr->Self, infoPtr->Buddy, x, - budRect.top - DEFAULT_ADDTOP, width, + SetWindowPos(infoPtr->Self, infoPtr->Buddy, x, + budRect.top - DEFAULT_ADDTOP, width, budRect.bottom - budRect.top + DEFAULT_ADDTOP + DEFAULT_ADDBOT, SWP_NOACTIVATE); return TRUE; -} +} /*********************************************************************** * UPDOWN_DoAction * - * This function increments/decrements the CurVal by the + * This function increments/decrements the CurVal by the * 'delta' amount according to the 'action' flag which can be a * combination of FLAG_INCR and FLAG_DECR * It notifies the parent as required. @@ -555,7 +555,7 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action) ni.iDelta = delta; ni.hdr.hwndFrom = infoPtr->Self; ni.hdr.idFrom = GetWindowLongW (infoPtr->Self, GWL_ID); - ni.hdr.code = UDN_DELTAPOS; + ni.hdr.code = UDN_DELTAPOS; if (!SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY, (WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) { /* Parent said: OK to adjust */ @@ -566,10 +566,10 @@ static void UPDOWN_DoAction (UPDOWN_INFO *infoPtr, int delta, int action) if (dwStyle & UDS_SETBUDDYINT) UPDOWN_SetBuddyInt (infoPtr); } } - + /* Also, notify it. This message is sent in any case. */ - SendMessageW( GetParent(infoPtr->Self), - dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL, + SendMessageW( GetParent(infoPtr->Self), + dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL, MAKELONG(SB_THUMBPOSITION, infoPtr->CurVal), infoPtr->Self); } @@ -593,17 +593,17 @@ static BOOL UPDOWN_IsEnabled (UPDOWN_INFO *infoPtr) * * Deletes any timers, releases the mouse and does redraw if necessary. * If the control is not in "capture" mode, it does nothing. - * If the control was not in cancel mode, it returns FALSE. + * If the control was not in cancel mode, it returns FALSE. * If the control was in cancel mode, it returns TRUE. */ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr) { if (!(infoPtr->Flags & FLAG_PRESSED)) return FALSE; - + KillTimer (infoPtr->Self, TIMER_AUTOREPEAT); KillTimer (infoPtr->Self, TIMER_ACCEL); KillTimer (infoPtr->Self, TIMER_AUTOPRESS); - + if (GetCapture() == infoPtr->Self) { NMHDR hdr; hdr.hwndFrom = infoPtr->Self; @@ -612,10 +612,10 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr) SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY, hdr.idFrom, (LPARAM)&hdr); ReleaseCapture(); } - + infoPtr->Flags &= ~FLAG_PRESSED; InvalidateRect (infoPtr->Self, NULL, FALSE); - + return TRUE; } @@ -624,7 +624,7 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr) * * Handle a mouse event for the updown. * 'pt' is the location of the mouse event in client or - * windows coordinates. + * windows coordinates. */ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINT pt) { @@ -646,10 +646,10 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINT pt) /* Update the CurVal if necessary */ if (dwStyle & UDS_SETBUDDYINT) UPDOWN_GetBuddyInt (infoPtr); - + /* Set up the correct flags */ - infoPtr->Flags |= FLAG_PRESSED; - + infoPtr->Flags |= FLAG_PRESSED; + /* repaint the control */ InvalidateRect (infoPtr->Self, NULL, FALSE); @@ -678,7 +678,7 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINT pt) } else { if(infoPtr->AccelIndex != -1) infoPtr->AccelIndex = 0; } - + /* If state changed, redraw the control */ if(temp != infoPtr->Flags) InvalidateRect (infoPtr->Self, &rect, FALSE); @@ -699,9 +699,9 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE); int temp; - + if (!infoPtr && (message != WM_CREATE)) - return DefWindowProcW (hwnd, message, wParam, lParam); + return DefWindowProcW (hwnd, message, wParam, lParam); switch(message) { @@ -715,8 +715,8 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, infoPtr->AccelCount = 0; infoPtr->AccelVect = 0; infoPtr->AccelIndex = -1; - infoPtr->CurVal = 0; - infoPtr->MinVal = 0; + infoPtr->CurVal = 0; + infoPtr->MinVal = 0; infoPtr->MaxVal = 9999; infoPtr->Base = 10; /* Default to base 10 */ infoPtr->Buddy = 0; /* No buddy window yet */ @@ -725,10 +725,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, /* Do we pick the buddy win ourselves? */ if (dwStyle & UDS_AUTOBUDDY) UPDOWN_SetBuddy (infoPtr, GetWindow (hwnd, GW_HWNDPREV)); - + TRACE("UpDown Ctrl creation, hwnd=%04x\n", hwnd); break; - + case WM_DESTROY: if(infoPtr->AccelVect) COMCTL32_Free (infoPtr->AccelVect); @@ -738,7 +738,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, SetWindowLongW (hwnd, 0, 0); TRACE("UpDown Ctrl destruction, hwnd=%04x\n", hwnd); break; - + case WM_ENABLE: if (dwStyle & WS_DISABLED) UPDOWN_CancelMode (infoPtr); InvalidateRect (infoPtr->Self, NULL, FALSE); @@ -770,13 +770,13 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, if(infoPtr->Flags & FLAG_MOUSEIN) { temp = infoPtr->AccelIndex == -1 ? 1 : infoPtr->AccelVect[infoPtr->AccelIndex].nInc; UPDOWN_DoAction(infoPtr, temp, infoPtr->Flags & FLAG_ARROW); - + if(infoPtr->AccelIndex != -1 && infoPtr->AccelIndex < infoPtr->AccelCount-1) { KillTimer(hwnd, TIMER_ACCEL); infoPtr->AccelIndex++; /* move to the next accel info */ temp = infoPtr->AccelVect[infoPtr->AccelIndex].nSec * 1000 + 1; /* make sure we have at least 1ms intervals */ - SetTimer(hwnd, TIMER_ACCEL, temp, 0); + SetTimer(hwnd, TIMER_ACCEL, temp, 0); } } break; @@ -786,11 +786,11 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, case WM_LBUTTONUP: if (GetCapture() != infoPtr->Self) break; - + if ( (infoPtr->Flags & FLAG_MOUSEIN) && (infoPtr->Flags & FLAG_ARROW) ) { - - SendMessageW( GetParent(hwnd), + + SendMessageW( GetParent(hwnd), dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL, MAKELONG(SB_ENDSCROLL, infoPtr->CurVal), hwnd); if (UPDOWN_IsBuddyEdit(infoPtr)) @@ -798,7 +798,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, } UPDOWN_CancelMode(infoPtr); break; - + case WM_LBUTTONDOWN: case WM_MOUSEMOVE: if(UPDOWN_IsEnabled(infoPtr)){ @@ -814,10 +814,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, return UPDOWN_KeyPressed(infoPtr, (int)wParam); } break; - + case WM_PAINT: return UPDOWN_Paint (infoPtr, (HDC)wParam); - + case UDM_GETACCEL: if (wParam==0 && lParam==0) return infoPtr->AccelCount; if (wParam && lParam) { @@ -883,20 +883,20 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, infoPtr->CurVal = temp; if(dwStyle & UDS_SETBUDDYINT) UPDOWN_SetBuddyInt (infoPtr); return wParam; /* return prev value */ - + case UDM_GETRANGE: if (wParam || lParam) UNKNOWN_PARAM(UDM_GETRANGE, wParam, lParam); return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal); case UDM_SETRANGE: - if (wParam) UNKNOWN_PARAM(UDM_SETRANGE, wParam, lParam); + if (wParam) UNKNOWN_PARAM(UDM_SETRANGE, wParam, lParam); /* we must have: */ infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */ infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */ /* |Max-Min| <= UD_MAXVAL */ - TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n", + TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n", infoPtr->MinVal, infoPtr->MaxVal, hwnd); - break; + break; case UDM_GETRANGE32: if (wParam) *(LPINT)wParam = infoPtr->MinVal; @@ -908,7 +908,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, infoPtr->MaxVal = (INT)lParam; if (infoPtr->MaxVal <= infoPtr->MinVal) infoPtr->MaxVal = infoPtr->MinVal + 1; - TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n", + TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n", infoPtr->MinVal, infoPtr->MaxVal, hwnd); break; @@ -937,12 +937,12 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, temp = infoPtr->UnicodeFormat; infoPtr->UnicodeFormat = (BOOL)wParam; return temp; - - default: - if (message >= WM_USER) + + default: + if (message >= WM_USER) ERR("unknown msg %04x wp=%04x lp=%08lx\n", message, wParam, lParam); - return DefWindowProcW (hwnd, message, wParam, lParam); - } + return DefWindowProcW (hwnd, message, wParam, lParam); + } return 0; } @@ -966,7 +966,7 @@ UPDOWN_Register(void) wndClass.hCursor = LoadCursorW( 0, IDC_ARROWW ); wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); wndClass.lpszClassName = UPDOWN_CLASSW; - + RegisterClassW( &wndClass ); } diff --git a/dlls/commdlg/cdlg.h b/dlls/commdlg/cdlg.h index 9fb24e94d70..df107f354bf 100644 --- a/dlls/commdlg/cdlg.h +++ b/dlls/commdlg/cdlg.h @@ -70,7 +70,7 @@ typedef struct { #define PD32_PRINTER_STATUS_READY 1536 #define PD32_PRINTER_STATUS_PAUSED 1537 -#define PD32_PRINTER_STATUS_ERROR 1538 +#define PD32_PRINTER_STATUS_ERROR 1538 #define PD32_PRINTER_STATUS_PENDING_DELETION 1539 #define PD32_PRINTER_STATUS_PAPER_JAM 1540 #define PD32_PRINTER_STATUS_PAPER_OUT 1541 @@ -183,7 +183,7 @@ typedef struct { } FINDREPLACE16, *LPFINDREPLACE16; typedef UINT16 (CALLBACK *LPCFHOOKPROC16)(HWND16,UINT16,WPARAM16,LPARAM); -typedef struct +typedef struct { DWORD lStructSize; HWND16 hwndOwner; /* caller's window handle */ diff --git a/dlls/commdlg/cdlg32.c b/dlls/commdlg/cdlg32.c index f3bcbfc90a1..c8e90fa3c6c 100644 --- a/dlls/commdlg/cdlg32.c +++ b/dlls/commdlg/cdlg32.c @@ -89,7 +89,7 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res COMDLG32_TlsIndex = 0xffffffff; SHELL32_hInstance = GetModuleHandleA("SHELL32.DLL"); - + if (!SHELL32_hInstance) { ERR("loading of shell32 failed\n"); @@ -102,9 +102,9 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res GPA(COMDLG32_PIDL_ILGetNext, SHELL32_hInstance, (LPCSTR)153L); GPA(COMDLG32_PIDL_ILClone, SHELL32_hInstance, (LPCSTR)18L); GPA(COMDLG32_PIDL_ILRemoveLastID, SHELL32_hInstance, (LPCSTR)17L); - + /* SHELL */ - + 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 */ @@ -177,7 +177,7 @@ void COMDLG32_SetCommDlgExtendedError(DWORD err) */ DWORD WINAPI CommDlgExtendedError(void) { - if (COMDLG32_TlsIndex != 0xffffffff) + if (COMDLG32_TlsIndex != 0xffffffff) return (DWORD)TlsGetValue(COMDLG32_TlsIndex); else return 0; /* we never set an error, so there isn't one */ diff --git a/dlls/commdlg/colordlg.c b/dlls/commdlg/colordlg.c index d08e6a8d4ef..4e079a02b7f 100644 --- a/dlls/commdlg/colordlg.c +++ b/dlls/commdlg/colordlg.c @@ -69,7 +69,7 @@ struct CCPRIVATE LPCHOOSECOLOR16 lpcc16; /* save the 16 bits pointer */ int nextuserdef; /* next free place in user defined color array */ HDC hdcMem; /* color graph used for BitBlt() */ - HBITMAP hbmMem; /* color graph bitmap */ + HBITMAP hbmMem; /* color graph bitmap */ RECT fullsize; /* original dialog window size */ UINT msetrgb; /* # of SETRGBSTRING message (today not used) */ RECT old3angle; /* last position of l-marker */ @@ -459,7 +459,7 @@ static void CC_PaintTriangle( HWND hDlg, int y) int oben; RECT rect; HWND hwnd = GetDlgItem(hDlg, 0x2be); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER); if (IsWindowVisible( GetDlgItem(hDlg, 0x2c6))) /* if full size */ { @@ -497,7 +497,7 @@ static void CC_PaintCross( HWND hDlg, int x, int y) HDC hDC; int w = GetDialogBaseUnits(); HWND hwnd = GetDlgItem(hDlg, 0x2c6); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER ); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER ); RECT rect; POINT point, p; HPEN hPen; @@ -519,11 +519,11 @@ static void CC_PaintCross( HWND hDlg, int x, int y) lpp->oldcross.left = point.x - w - 1; lpp->oldcross.right = point.x + w + 1; lpp->oldcross.top = point.y - w - 1; - lpp->oldcross.bottom = point.y + w + 1; + lpp->oldcross.bottom = point.y + w + 1; - MoveToEx(hDC, point.x - w, point.y, &p); + MoveToEx(hDC, point.x - w, point.y, &p); LineTo(hDC, point.x + w, point.y); - MoveToEx(hDC, point.x, point.y - w, &p); + MoveToEx(hDC, point.x, point.y - w, &p); LineTo(hDC, point.x, point.y + w); DeleteObject( SelectObject(hDC, hPen)) ; ReleaseDC(hwnd, hDC); @@ -538,11 +538,11 @@ static void CC_PaintCross( HWND hDlg, int x, int y) /*********************************************************************** * CC_PrepareColorGraph [internal] */ -static void CC_PrepareColorGraph( HWND hDlg ) +static void CC_PrepareColorGraph( HWND hDlg ) { int sdif, hdif, xdif, ydif, r, g, b, hue, sat; HWND hwnd = GetDlgItem(hDlg, 0x2c6); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); HBRUSH hbrush; HDC hdc ; RECT rect, client; @@ -585,7 +585,7 @@ static void CC_PrepareColorGraph( HWND hDlg ) static void CC_PaintColorGraph( HWND hDlg ) { HWND hwnd = GetDlgItem( hDlg, 0x2c6 ); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); HDC hDC; RECT rect; if (IsWindowVisible(hwnd)) /* if full size */ @@ -645,7 +645,7 @@ static void CC_PaintLumBar( HWND hDlg, int hue, int sat ) static void CC_EditSetRGB( HWND hDlg, COLORREF cr ) { char buffer[10]; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); int r = GetRValue(cr); int g = GetGValue(cr); int b = GetBValue(cr); @@ -690,8 +690,8 @@ static void CC_EditSetHSL( HWND hDlg, int h, int s, int l ) static void CC_SwitchToFullSize( HWND hDlg, COLORREF result, LPRECT lprect ) { int i; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); - + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + EnableWindow( GetDlgItem(hDlg, 0x2cf), FALSE); CC_PrepareColorGraph(hDlg); for (i = 0x2bf; i < 0x2c5; i++) @@ -738,7 +738,7 @@ static void CC_PaintPredefColorArray( HWND hDlg, int rows, int cols) FillRect(hdc, &rect, GetClassLongA(hwnd, GCL_HBRBACKGROUND)); for ( j = 0; j < rows; j++ ) { - for ( i = 0; i < cols; i++ ) + for ( i = 0; i < cols; i++ ) { hBrush = CreateSolidBrush(predefcolors[j][i]); if (hBrush) @@ -759,7 +759,7 @@ static void CC_PaintPredefColorArray( HWND hDlg, int rows, int cols) } /*********************************************************************** * CC_PaintUserColorArray [internal] - * Paint the 16 user-selected colors + * Paint the 16 user-selected colors */ static void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, COLORREF* lpcr ) { @@ -777,7 +777,7 @@ static void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, COLORREF* lpc k = rect.left; hdc = GetDC(hwnd); - if (hdc) + if (hdc) { FillRect(hdc, &rect, GetClassLongA(hwnd, GCL_HBRBACKGROUND) ); for (j = 0; j < rows; j++) @@ -786,7 +786,7 @@ static void CC_PaintUserColorArray( HWND hDlg, int rows, int cols, COLORREF* lpc { hBrush = CreateSolidBrush(lpcr[i+j*cols]); if (hBrush) - { + { hBrush = SelectObject(hdc, hBrush) ; Rectangle(hdc, rect.left, rect.top, rect.left + dx - DISTANCE, rect.top + dy - DISTANCE); @@ -821,15 +821,15 @@ static BOOL CC_HookCallChk( LPCHOOSECOLORW lpcc ) /*********************************************************************** * CC_WMInitDialog [internal] */ -static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 ) +static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 ) { int i, res; int r, g, b; HWND hwnd; RECT rect; POINT point; - LCCPRIV lpp; - + LCCPRIV lpp; + TRACE("WM_INITDIALOG lParam=%08lX\n", lParam); lpp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct CCPRIVATE) ); if (b16) @@ -845,7 +845,7 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 ) return FALSE; } ch32->lStructSize = sizeof(CHOOSECOLORW); - ch32->hwndOwner = ch16->hwndOwner; + ch32->hwndOwner = ch16->hwndOwner; ch32->hInstance = ch16->hInstance; ch32->lpCustColors = MapSL(ch16->lpCustColors); ch32->lpfnHook = (LPCCHOOKPROC) ch16->lpfnHook; /* only used as flag */ @@ -859,7 +859,7 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 ) EndDialog (hDlg, 0) ; return FALSE; } - SetWindowLongA(hDlg, DWL_USER, (LONG)lpp); + SetWindowLongA(hDlg, DWL_USER, (LONG)lpp); if (!(lpp->lpcc->Flags & CC_SHOWHELP)) ShowWindow( GetDlgItem(hDlg,0x40e), SW_HIDE); @@ -869,7 +869,7 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 ) cpos = MAKELONG(5,7); /* init */ if (lpp->lpcc->Flags & CC_RGBINIT) { - for (i = 0; i < 6; i++) + for (i = 0; i < 6; i++) for (j = 0; j < 8; j++) if (predefcolors[i][j] == lpp->lpcc->rgbResult) { @@ -921,7 +921,7 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 ) else res = CallWindowProcA( (WNDPROC)lpp->lpcc->lpfnHook, hDlg, WM_INITDIALOG, wParam, lParam); } - + /* Set the initial values of the color chooser dialog */ r = GetRValue(lpp->lpcc->rgbResult); g = GetGValue(lpp->lpcc->rgbResult); @@ -950,13 +950,13 @@ static LONG CC_WMInitDialog( HWND hDlg, WPARAM wParam, LPARAM lParam, BOOL b16 ) /*********************************************************************** * CC_WMCommand [internal] */ -static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode, HWND hwndCtl ) +static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notifyCode, HWND hwndCtl ) { int r, g, b, i, xx; UINT cokmsg; HDC hdc; COLORREF *cr; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); TRACE("CC_WMCommand wParam=%x lParam=%lx\n", wParam, lParam); switch (wParam) { @@ -989,7 +989,7 @@ static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notif } } break; - + case 0x2bf: /* edit notify HSL */ case 0x2c0: case 0x2c1: @@ -1016,7 +1016,7 @@ static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notif } } break; - + case 0x2cf: CC_SwitchToFullSize(hDlg, lpp->lpcc->rgbResult, &lpp->fullsize); SetFocus( GetDlgItem(hDlg, 0x2bf)); @@ -1089,7 +1089,7 @@ static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notif } EndDialog(hDlg, 1) ; return TRUE ; - + case IDCANCEL : EndDialog(hDlg, 0) ; return TRUE ; @@ -1101,11 +1101,11 @@ static LRESULT CC_WMCommand( HWND hDlg, WPARAM wParam, LPARAM lParam, WORD notif /*********************************************************************** * CC_WMPaint [internal] */ -static LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam ) +static LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam ) { HDC hdc; PAINTSTRUCT ps; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); hdc = BeginPaint(hDlg, &ps); /* we have to paint dialog children except text and buttons */ @@ -1134,7 +1134,7 @@ static LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam ) ReleaseCapture(); CC_PaintCross(hDlg, lpp->h, lpp->s); return 1; - } + } return 0; } @@ -1142,15 +1142,15 @@ static LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam ) /*********************************************************************** * CC_WMMouseMove [internal] */ -static LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam ) +static LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam ) { - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); int r, g, b; if (lpp->capturedGraph) { int *ptrh = NULL, *ptrs = &lpp->l; - if (lpp->capturedGraph == 0x2c6) + if (lpp->capturedGraph == 0x2c6) { ptrh = &lpp->h; ptrs = &lpp->s; @@ -1179,9 +1179,9 @@ static LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam ) /*********************************************************************** * CC_WMLButtonDown [internal] */ -static LRESULT CC_WMLButtonDown( HWND hDlg, WPARAM wParam, LPARAM lParam ) +static LRESULT CC_WMLButtonDown( HWND hDlg, WPARAM wParam, LPARAM lParam ) { - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); int r, g, b, i; i = 0; @@ -1263,15 +1263,15 @@ static LRESULT WINAPI ColorDlgProc( HWND hDlg, UINT message, case WM_INITDIALOG: return CC_WMInitDialog(hDlg, wParam, lParam, FALSE); case WM_NCDESTROY: - DeleteDC(lpp->hdcMem); - DeleteObject(lpp->hbmMem); + DeleteDC(lpp->hdcMem); + DeleteObject(lpp->hbmMem); HeapFree(GetProcessHeap(), 0, lpp); SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */ break; case WM_COMMAND: if (CC_WMCommand( hDlg, wParam, lParam, HIWORD(wParam), (HWND) lParam)) return TRUE; - break; + break; case WM_PAINT: if ( CC_WMPaint(hDlg, wParam, lParam)) return TRUE; @@ -1291,7 +1291,7 @@ static LRESULT WINAPI ColorDlgProc( HWND hDlg, UINT message, case WM_LBUTTONDOWN:/* FIXME: ClipCursor on (if in color graph)*/ if (CC_WMLButtonDown(hDlg, wParam, lParam)) return TRUE; - break; + break; } return FALSE ; } @@ -1303,7 +1303,7 @@ LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message, WPARAM16 wParam, LONG lParam ) { int res; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); if (message != WM_INITDIALOG) { if (!lpp) @@ -1325,8 +1325,8 @@ LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message, case WM_INITDIALOG: return CC_WMInitDialog(hDlg, wParam, lParam, TRUE); case WM_NCDESTROY: - DeleteDC(lpp->hdcMem); - DeleteObject(lpp->hbmMem); + DeleteDC(lpp->hdcMem); + DeleteObject(lpp->hbmMem); HeapFree(GetProcessHeap(), 0, lpp->lpcc); HeapFree(GetProcessHeap(), 0, lpp); SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */ @@ -1334,7 +1334,7 @@ LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message, case WM_COMMAND: if (CC_WMCommand(hDlg, wParam, lParam, HIWORD(lParam), (HWND)LOWORD(lParam))) return TRUE; - break; + break; case WM_PAINT: if (CC_WMPaint(hDlg, wParam, lParam)) return TRUE; @@ -1354,7 +1354,7 @@ LRESULT WINAPI ColorDlgProc16( HWND16 hDlg, UINT16 message, case WM_LBUTTONDOWN:/* FIXME: ClipCursor on (if in color graph)*/ if (CC_WMLButtonDown(hDlg, wParam, lParam)) return TRUE; - break; + break; } return FALSE ; } @@ -1372,9 +1372,9 @@ BOOL16 WINAPI ChooseColor16( LPCHOOSECOLOR16 lpChCol ) BOOL16 bRet = FALSE; LPCVOID template; FARPROC16 ptr; - + TRACE("ChooseColor\n"); - if (!lpChCol) return FALSE; + if (!lpChCol) return FALSE; if (lpChCol->Flags & CC_ENABLETEMPLATEHANDLE) hDlgTmpl16 = lpChCol->hInstance; @@ -1420,7 +1420,7 @@ BOOL16 WINAPI ChooseColor16( LPCHOOSECOLOR16 lpChCol ) return FALSE; } template = GlobalLock16(hGlobal16); - if (!template) + if (!template) { COMDLG32_SetCommDlgExtendedError(CDERR_MEMLOCKFAILURE); ERR("global lock failure for %x handle\n", hDlgTmpl16); @@ -1456,7 +1456,7 @@ BOOL WINAPI ChooseColorW( LPCHOOSECOLORW lpChCol ) LPCVOID template; TRACE("ChooseColor\n"); - if (!lpChCol) return FALSE; + if (!lpChCol) return FALSE; if (lpChCol->Flags & CC_ENABLETEMPLATEHANDLE) { diff --git a/dlls/commdlg/filedlg.c b/dlls/commdlg/filedlg.c index 9c39f696313..6aa733577ba 100644 --- a/dlls/commdlg/filedlg.c +++ b/dlls/commdlg/filedlg.c @@ -39,9 +39,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); #include "cdlg.h" #define BUFFILE 512 -#define BUFFILEALLOC 512 * sizeof(WCHAR) +#define BUFFILEALLOC 512 * sizeof(WCHAR) -struct FSPRIVATE +struct FSPRIVATE { HWND hwnd; /* file dialog window handle */ BOOL hook; /* TRUE if the dialog is hooked */ @@ -64,7 +64,7 @@ struct FSPRIVATE #define LFS16 1 #define LFS32A 2 #define LFS32W 3 - + static const WCHAR FILE_star[] = {'*','.','*', 0}; static const WCHAR FILE_bslash[] = {'\\', 0}; static const WCHAR FILE_specc[] = {'%','c',':', 0}; @@ -117,7 +117,7 @@ static BOOL FileDlg_Init(void) hHDisk = LoadImageA( inst, "HDISK", IMAGE_ICON, 16, 16, LR_SHARED ); hCDRom = LoadImageA( inst, "CDROM", IMAGE_ICON, 16, 16, LR_SHARED ); hNet = LoadImageA( inst, "NETWORK", IMAGE_ICON, 16, 16, LR_SHARED ); - if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 || + if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 || hHDisk == 0 || hCDRom == 0 || hNet == 0) { ERR("Error loading icons !\n"); @@ -174,7 +174,7 @@ BOOL Get32BitsTemplate(LFSPRIVATE lfs) } } else { /* get it from internal Wine resource */ HANDLE hResInfo; - if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, + if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, lfs->open? "OPEN_FILE":"SAVE_FILE", RT_DIALOGA))) { COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); @@ -229,7 +229,7 @@ BOOL Get16BitsTemplate(LFSPRIVATE lfs) LPCVOID template32; DWORD size; - if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, + if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, lfs->open ? "OPEN_FILE":"SAVE_FILE", RT_DIALOGA))) { COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); @@ -376,7 +376,7 @@ static LPWSTR FILEDLG_GetFileType(LPWSTR cfptr, LPWSTR fptr, WORD index) int n, i; i = 0; if (cfptr) - for ( ;(n = lstrlenW(cfptr)) != 0; i++) + for ( ;(n = lstrlenW(cfptr)) != 0; i++) { cfptr += n + 1; if (i == index) @@ -384,7 +384,7 @@ static LPWSTR FILEDLG_GetFileType(LPWSTR cfptr, LPWSTR fptr, WORD index) cfptr += lstrlenW(cfptr) + 1; } if (fptr) - for ( ;(n = lstrlenW(fptr)) != 0; i++) + for ( ;(n = lstrlenW(fptr)) != 0; i++) { fptr += n + 1; if (i == index) @@ -407,7 +407,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam, if (lpdis->CtlType == ODT_LISTBOX && lpdis->CtlID == lst1) { if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC))) return FALSE; - SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, + SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, (LPARAM)str); if ((lpdis->itemState & ODS_SELECTED) && !savedlg) @@ -438,7 +438,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam, { if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC))) return FALSE; - SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, + SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, (LPARAM)str); if (lpdis->itemState & ODS_SELECTED) @@ -467,7 +467,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam, char root[] = "a:"; if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC))) return FALSE; - SendMessageW(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID, + SendMessageW(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID, (LPARAM)str); root[0] += str[2] - 'a'; switch(GetDriveTypeA(root)) @@ -502,10 +502,10 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam, /*********************************************************************** * FILEDLG_WMMeasureItem [internal] */ -static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam) +static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam) { LPMEASUREITEMSTRUCT lpmeasure; - + lpmeasure = (LPMEASUREITEMSTRUCT)lParam; lpmeasure->itemHeight = fldrHeight; return TRUE; @@ -514,10 +514,10 @@ static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam) /*********************************************************************** * FILEDLG_WMMeasureItem16 [internal] */ -static LONG FILEDLG_WMMeasureItem16(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) +static LONG FILEDLG_WMMeasureItem16(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) { LPMEASUREITEMSTRUCT16 lpmeasure; - + lpmeasure = MapSL(lParam); lpmeasure->itemHeight = fldrHeight; return TRUE; @@ -583,10 +583,10 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam) /* set default filter */ if (ofn->nFilterIndex == 0 && ofn->lpstrCustomFilter == NULL) ofn->nFilterIndex = 1; - SendDlgItemMessageW(hWnd, cmb1, CB_SETCURSEL, ofn->nFilterIndex - 1, 0); + SendDlgItemMessageW(hWnd, cmb1, CB_SETCURSEL, ofn->nFilterIndex - 1, 0); lstrcpynW(tmpstr, FILEDLG_GetFileType(ofn->lpstrCustomFilter, (LPWSTR)ofn->lpstrFilter, ofn->nFilterIndex - 1),BUFFILE); - TRACE("nFilterIndex = %ld, SetText of edt1 to %s\n", + TRACE("nFilterIndex = %ld, SetText of edt1 to %s\n", ofn->nFilterIndex, debugstr_w(tmpstr)); SetDlgItemTextW( hWnd, edt1, tmpstr ); /* get drive list */ @@ -597,7 +597,7 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam) * the OPENFILENAME structure). For example under 2000/XP any path in the * lpstrFile overrides the lpstrInitialDir, but not under 95/98/ME */ - if (ofn->lpstrInitialDir != NULL) + if (ofn->lpstrInitialDir != NULL) { int len; lstrcpynW(tmpstr, ofn->lpstrInitialDir, 511); @@ -638,7 +638,7 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam) /*********************************************************************** * FILEDLG_UpdateResult [internal] - * update the displayed file name (with path) + * update the displayed file name (with path) */ void FILEDLG_UpdateResult(LFSPRIVATE lfs, WCHAR *tmpstr) { @@ -695,13 +695,13 @@ void FILEDLG_UpdateResult(LFSPRIVATE lfs, WCHAR *tmpstr) /*********************************************************************** * FILEDLG_UpdateFileTitle [internal] - * update the displayed file name (without path) + * update the displayed file name (without path) */ void FILEDLG_UpdateFileTitle(LFSPRIVATE lfs) { LONG lRet; LPOPENFILENAMEW ofnW = lfs->ofnW; - if (ofnW->lpstrFileTitle != NULL) + if (ofnW->lpstrFileTitle != NULL) { lRet = SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETCURSEL, 0, 0); SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETTEXT, lRet, @@ -907,7 +907,7 @@ static LRESULT FILEDLG_Validate( LFSPRIVATE lfs, LPWSTR path, UINT control, INT { lRet = (BOOL)FILEDLG_CallWindowProc(lfs, lfs->fileokstring, 0, lfs->lParam ); - if (lRet) + if (lRet) { *ofnW = ofnsav; /* restore old state */ return FALSE; @@ -945,7 +945,7 @@ static LRESULT FILEDLG_DiskChange( LFSPRIVATE lfs ) SendDlgItemMessageW(hWnd, cmb2, CB_GETLBTEXT, lRet, (LPARAM)pstr); wsprintfW(diskname, FILE_specc, pstr[2]); - HeapFree(GetProcessHeap(), 0, pstr); + HeapFree(GetProcessHeap(), 0, pstr); return FILEDLG_Validate( lfs, diskname, cmb2, lRet, TRUE ); } @@ -977,7 +977,7 @@ static LRESULT FILEDLG_FileTypeChange( LFSPRIVATE lfs ) * FILEDLG_WMCommand [internal] */ static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification, - UINT control, LFSPRIVATE lfs ) + UINT control, LFSPRIVATE lfs ) { switch (control) { @@ -1000,7 +1000,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification, break; case cmb1: /* file type drop list */ - if (notification == CBN_SELCHANGE) + if (notification == CBN_SELCHANGE) return FILEDLG_FileTypeChange( lfs ); break; @@ -1117,7 +1117,7 @@ void FILEDLG_MapOfnStructA(LPOPENFILENAMEA ofnA, LPOPENFILENAMEW ofnW, BOOL open ofnW->lpstrInitialDir = HEAP_strdupAtoW(GetProcessHeap(),0,ofnA->lpstrInitialDir); if (ofnA->lpstrTitle) str = ofnA->lpstrTitle; - else + else /* Allocates default title (FIXME : get it from resource) */ str = open ? defaultopen:defaultsave; ofnW->lpstrTitle = HEAP_strdupAtoW(GetProcessHeap(),0, str); @@ -1174,7 +1174,7 @@ void FILEDLG_MapOfnStruct16(LPOPENFILENAME16 ofn16, LPOPENFILENAMEW ofnW, BOOL o /************************************************************************ * FILEDLG_DestroyPrivate [internal] - * destroys the private object + * destroys the private object */ void FILEDLG_DestroyPrivate(LFSPRIVATE lfs) { @@ -1209,7 +1209,7 @@ void FILEDLG_DestroyPrivate(LFSPRIVATE lfs) /************************************************************************ * FILEDLG_AllocPrivate [internal] - * allocate a private object to hold 32 bits Unicode + * allocate a private object to hold 32 bits Unicode * structure that will be used throughtout the calls, while * keeping available the original structures and a few variables * On entry : type = dialog procedure type (16,32A,32W) @@ -1264,7 +1264,7 @@ LFSPRIVATE FILEDLG_AllocPrivate(LPARAM lParam, int type, UINT dlgType) if (lfs->ofnA) FILEDLG_MapOfnStructA(lfs->ofnA, lfs->ofnW, lfs->open); } - else + else ret = NULL; } if (lfs->ofn16) @@ -1283,7 +1283,7 @@ LFSPRIVATE FILEDLG_AllocPrivate(LPARAM lParam, int type, UINT dlgType) * * Creates a win31 style dialog box for the user to select a file to open/save. */ -BOOL WINAPI GetFileName31A( +BOOL WINAPI GetFileName31A( LPOPENFILENAMEA lpofn, /* addess of structure with data*/ UINT dlgType /* type dialogue : open/save */ ) @@ -1298,7 +1298,7 @@ BOOL WINAPI GetFileName31A( if (lfs) { hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); - bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner, + bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner, (DLGPROC) FileOpenDlgProc, (DWORD) lfs); FILEDLG_DestroyPrivate(lfs); } @@ -1313,7 +1313,7 @@ BOOL WINAPI GetFileName31A( * * Creates a win31 style dialog box for the user to select a file to open/save */ -BOOL WINAPI GetFileName31W( +BOOL WINAPI GetFileName31W( LPOPENFILENAMEW lpofn, /* addess of structure with data*/ UINT dlgType /* type dialogue : open/save */ ) @@ -1328,7 +1328,7 @@ BOOL WINAPI GetFileName31W( if (lfs) { hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); - bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner, + bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner, (DLGPROC) FileOpenDlgProc, (DWORD) lfs); FILEDLG_DestroyPrivate(lfs); } @@ -1345,15 +1345,15 @@ BOOL WINAPI GetFileName31W( */ LRESULT WINAPI FileOpenDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam) -{ +{ LFSPRIVATE lfs = (LFSPRIVATE)GetPropA(hWnd,OFN_PROP); DRAWITEMSTRUCT dis; - + TRACE("msg=%x wparam=%x lParam=%lx\n", wMsg, wParam, lParam); if ((wMsg != WM_INITDIALOG) && lfs && lfs->hook) { LRESULT lRet = (BOOL16)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam); - if (lRet) + if (lRet) return lRet; /* else continue message processing */ } switch (wMsg) @@ -1402,16 +1402,16 @@ LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, { LRESULT lRet; lRet = (BOOL16)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam); - if (lRet) + if (lRet) return lRet; /* else continue message processing */ - } + } switch (wMsg) { case WM_INITDIALOG: return FILEDLG_WMInitDialog(hWnd, wParam, lParam); - + case WM_MEASUREITEM: return FILEDLG_WMMeasureItem16(hWnd, wParam, lParam); - + case WM_DRAWITEM: FILEDLG_MapDrawItemStruct(MapSL(lParam), &dis); return FILEDLG_WMDrawItem(hWnd, wParam, lParam, TRUE, &dis); @@ -1419,7 +1419,7 @@ LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, case WM_COMMAND: return FILEDLG_WMCommand(hWnd, lParam, HIWORD(lParam), wParam, lfs); } - + /* case WM_CTLCOLOR: SetBkColor((HDC16)wParam, 0x00C0C0C0); @@ -1433,14 +1433,14 @@ LRESULT WINAPI FileSaveDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, return hGRAYBrush; } return FALSE; - + */ return FALSE; } /*********************************************************************** * FileOpenDlgProc [internal] - * Used for open and save, in fact. + * Used for open and save, in fact. */ static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) @@ -1452,7 +1452,7 @@ static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg, { LRESULT lRet; lRet = (BOOL)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam); - if (lRet) + if (lRet) return lRet; /* else continue message processing */ } switch (wMsg) @@ -1486,7 +1486,7 @@ static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg, return FALSE; } -/* ------------------ APIs ---------------------- */ +/* ------------------ APIs ---------------------- */ /*********************************************************************** * GetOpenFileName (COMMDLG.1) @@ -1500,7 +1500,7 @@ static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg, * BUGS * unknown, there are some FIXME's left. */ -BOOL16 WINAPI GetOpenFileName16( +BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn /* [in/out] address of structure with data*/ ) { @@ -1517,7 +1517,7 @@ BOOL16 WINAPI GetOpenFileName16( { hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 6); - bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, + bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, (DLGPROC16) ptr, (DWORD) lfs); FILEDLG_DestroyPrivate(lfs); } @@ -1538,7 +1538,7 @@ BOOL16 WINAPI GetOpenFileName16( * BUGS * unknown. There are some FIXME's left. */ -BOOL16 WINAPI GetSaveFileName16( +BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn /* [in/out] addess of structure with data*/ ) { @@ -1555,10 +1555,10 @@ BOOL16 WINAPI GetSaveFileName16( { hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE ); ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 7); - bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, + bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, (DLGPROC16) ptr, (DWORD) lfs); FILEDLG_DestroyPrivate(lfs); - } + } TRACE("return lpstrFile='%s' !\n", (char *)MapSL(lpofn->lpstrFile)); return bRet; @@ -1650,7 +1650,7 @@ BOOL WINAPI GetSaveFileNameA( if (newlook) { return GetFileDialog95A(ofn, SAVE_DIALOG); - } + } else { return GetFileName31A(ofn, SAVE_DIALOG); @@ -1681,7 +1681,7 @@ BOOL WINAPI GetSaveFileNameW( if (newlook) { return GetFileDialog95W(ofn, SAVE_DIALOG); - } + } else { return GetFileName31W(ofn, SAVE_DIALOG); diff --git a/dlls/commdlg/filedlg95.c b/dlls/commdlg/filedlg95.c index 560e0523625..e83a2db86cc 100644 --- a/dlls/commdlg/filedlg95.c +++ b/dlls/commdlg/filedlg95.c @@ -92,7 +92,7 @@ typedef struct SFolder int m_iImageIndex; /* Index of picture in image list */ HIMAGELIST hImgList; int m_iIndent; /* Indentation index */ - LPITEMIDLIST pidlItem; /* absolute pidl of the item */ + LPITEMIDLIST pidlItem; /* absolute pidl of the item */ } SFOLDER,*LPSFOLDER; @@ -222,7 +222,7 @@ static BOOL BrowseSelectedFolder(HWND hwnd); /*********************************************************************** * GetFileName95 * - * Creates an Open common dialog box that lets the user select + * Creates an Open common dialog box that lets the user select * the drive, directory, and the name of a file or set of files to open. * * IN : The FileOpenDlgInfos structure associated with the dialog @@ -257,7 +257,7 @@ BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos) COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); return FALSE; } - + /* old style hook messages */ if (IsHooked(fodInfos)) { @@ -266,7 +266,7 @@ BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos) fodInfos->HookMsg.helpmsgstring = RegisterWindowMessageA(HELPMSGSTRINGA); fodInfos->HookMsg.sharevistring = RegisterWindowMessageA(SHAREVISTRINGA); } - + lRes = DialogBoxIndirectParamA(COMMDLG_hInstance32, (LPDLGTEMPLATEA) template, fodInfos->ofnInfos->hwndOwner, @@ -276,7 +276,7 @@ BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos) /* Unable to create the dialog */ if( lRes == -1) return FALSE; - + return lRes; } @@ -297,14 +297,14 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType) LPCSTR lpstrInitialDir = (LPCSTR)-1; LPSTR lpstrSavDir = NULL; DWORD dwFlags = 0; - + /* Initialize FileOpenDlgInfos structure */ fodInfos = (FileOpenDlgInfos*)MemAlloc(sizeof(FileOpenDlgInfos)); ZeroMemory(fodInfos, sizeof(FileOpenDlgInfos)); - + /* Pass in the original ofn */ fodInfos->ofnInfos = ofn; - + /* Save original hInstance value */ hInstance = ofn->hInstance; fodInfos->ofnInfos->hInstance = MapHModuleLS(ofn->hInstance); @@ -322,7 +322,7 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType) /* Initialize the dialog property */ fodInfos->DlgInfos.dwDlgProp = 0; fodInfos->DlgInfos.hwndCustomDlg = (HWND)NULL; - + switch(iDlgType) { case OPEN_DIALOG : @@ -402,7 +402,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) BOOL ret; FileOpenDlgInfos *fodInfos; HINSTANCE hInstance; - + /* out arguments */ LPWSTR lpstrFile = NULL; LPWSTR lpstrFileTitle = NULL; @@ -436,7 +436,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) /* filter is a list... title\0ext\0......\0\0 */ s = ofn->lpstrFilter; - + while (*s) s = s+strlenW(s)+1; s++; n = s - ofn->lpstrFilter; /* already divides by 2. ptr magic */ @@ -490,7 +490,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) default : ret = 0; } - + /* restore saved IN arguments and convert OUT arguments back */ ofn->Flags = dwFlags; ofn->hInstance = hInstance; @@ -568,7 +568,7 @@ void ArrangeCtrlPositions( HWND hwndChildDlg, HWND hwndParentDlg) SetWindowPos(hwndChildDlg, 0, 0,0, ptParentClient.x,ptParentClient.y, SWP_NOZORDER ); SetWindowPos(hwndParentDlg, 0, rectParent.left,rectParent.top, (rectParent.right- rectParent.left), (rectParent.bottom-rectParent.top),SWP_NOMOVE | SWP_NOZORDER); - + hwndChild = GetWindow(hwndChildDlg,GW_CHILD); if(hwndStc32) { @@ -588,7 +588,7 @@ void ArrangeCtrlPositions( HWND hwndChildDlg, HWND hwndParentDlg) continue; GetWindowRect(hwndChild,&rectCtrl); MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2); - + /* Check the initial position of the controls relative to the initial position and size of stc32 (before it is expanded). @@ -606,15 +606,15 @@ void ArrangeCtrlPositions( HWND hwndChildDlg, HWND hwndParentDlg) { rectCtrl.top += ptMoveCtl.y; } - - SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top, + + SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top, rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top, SWP_NOSIZE | SWP_NOZORDER ); } } while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL); } hwndChild = GetWindow(hwndParentDlg,GW_CHILD); - + if(hwndStc32) { GetWindowRect(hwndStc32,&rectStc32); @@ -635,12 +635,12 @@ void ArrangeCtrlPositions( HWND hwndChildDlg, HWND hwndParentDlg) rectCtrl.left += ptMoveCtl.x; rectCtrl.top += ptMoveCtl.y; - SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top, + SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top, rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top, SWP_NOSIZE |SWP_NOZORDER ); } } while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL); - } + } } } @@ -656,7 +656,7 @@ HRESULT WINAPI FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam, switch(uMsg) { case WM_INITDIALOG: - { + { /* Hide caption since some program may leave it */ DWORD Style = GetWindowLongA(hwnd, GWL_STYLE); if (Style & WS_CAPTION) SetWindowLongA(hwnd, GWL_STYLE, Style & (~WS_CAPTION)); @@ -667,14 +667,14 @@ HRESULT WINAPI FileOpenDlgProcUserTemplate(HWND hwnd, UINT uMsg, WPARAM wParam, if(fodInfos && IsHooked(fodInfos)) return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam); - return 0; - } + return 0; + } } if(fodInfos && IsHooked(fodInfos)) - return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam); + return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam); - return DefWindowProcA(hwnd,uMsg,wParam,lParam); + return DefWindowProcA(hwnd,uMsg,wParam,lParam); } HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd) @@ -716,7 +716,7 @@ HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd) hChildDlg= CreateDialogIndirectParamA(fodInfos->ofnInfos->hInstance,template,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos); if(hChildDlg) { - ShowWindow(hChildDlg,SW_SHOW); + ShowWindow(hChildDlg,SW_SHOW); return hChildDlg; } } @@ -742,7 +742,7 @@ HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd) } return (HWND)NULL; } - + /*********************************************************************** * SendCustomDlgNotificationMessage * @@ -794,7 +794,7 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam case CDM_GETFILEPATH: GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath)); lpstrFileSpec = (LPSTR)PathFindFileNameA(lpstrPath); - if (lpstrFileSpec==lpstrPath) + if (lpstrFileSpec==lpstrPath) { char lpstrCurrentDir[MAX_PATH]; /* Prepend the current path */ @@ -802,8 +802,8 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam if ((LPSTR)lParam!=NULL) snprintf((LPSTR)lParam,(int)wParam,"%s\\%s",lpstrCurrentDir,lpstrPath); reqSize=strlen(lpstrCurrentDir)+1+strlen(lpstrPath)+1; - } - else + } + else { lstrcpynA((LPSTR)lParam,(LPSTR)lpstrPath,(int)wParam); reqSize=strlen(lpstrPath); @@ -836,7 +836,7 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam } return TRUE; } - + /*********************************************************************** * FileOpenDlgProc95 * @@ -847,18 +847,18 @@ HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa #if 0 TRACE("0x%04x 0x%04x\n", hwnd, uMsg); #endif - + switch(uMsg) { case WM_INITDIALOG: { FileOpenDlgInfos * fodInfos = (FileOpenDlgInfos *)lParam; - /* Adds the FileOpenDlgInfos in the property list of the dialog + /* Adds the FileOpenDlgInfos in the property list of the dialog so it will be easily accessible through a GetPropA(...) */ SetPropA(hwnd, FileOpenDlgInfosStr, (HANDLE) fodInfos); - fodInfos->DlgInfos.hwndCustomDlg = + fodInfos->DlgInfos.hwndCustomDlg = CreateTemplateDialog((FileOpenDlgInfos *)lParam, hwnd); FILEDLG95_InitControls(hwnd); @@ -881,7 +881,7 @@ HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } } return FALSE; - + case WM_GETISHELLBROWSER: return FILEDLG95_OnWMGetIShellBrowser(hwnd); @@ -897,7 +897,7 @@ HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa /* set up the button tooltips strings */ if(TTN_GETDISPINFOA == lpnmh->code ) { - LPNMTTDISPINFOA lpdi = (LPNMTTDISPINFOA)lParam; + LPNMTTDISPINFOA lpdi = (LPNMTTDISPINFOA)lParam; switch(lpnmh->idFrom ) { /* Up folder button */ @@ -923,7 +923,7 @@ HRESULT WINAPI FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa default: stringId = 0; } - lpdi->hinst = COMMDLG_hInstance32; + lpdi->hinst = COMMDLG_hInstance32; lpdi->lpszText = (LPSTR) stringId; } return FALSE; @@ -959,9 +959,9 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) { HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR }, { COMDLG32_hInstance, 800 } /* desktop icon */ }; - + RECT rectTB; - + FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); TRACE("%p\n", fodInfos); @@ -975,11 +975,11 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) GetWindowRect(GetDlgItem(hwnd,IDC_TOOLBARSTATIC),&rectTB); MapWindowPoints( 0, hwnd,(LPPOINT)&rectTB,2); - fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, (LPSTR) NULL, + fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, (LPSTR) NULL, WS_CHILD | WS_GROUP | TBSTYLE_TOOLTIPS | CCS_NODIVIDER | CCS_NORESIZE, - 0, 0, 150, 26, hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL); - - SetWindowPos(fodInfos->DlgInfos.hwndTB, 0, + 0, 0, 150, 26, hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL); + + SetWindowPos(fodInfos->DlgInfos.hwndTB, 0, rectTB.left,rectTB.top, rectTB.right-rectTB.left, rectTB.bottom-rectTB.top, SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER ); @@ -991,7 +991,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBITMAP, (WPARAM) 1, (LPARAM) &tba[1]); SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBUTTONSA, (WPARAM) 9,(LPARAM) &tbb); - SendMessageA(fodInfos->DlgInfos.hwndTB, TB_AUTOSIZE, 0, 0); + SendMessageA(fodInfos->DlgInfos.hwndTB, TB_AUTOSIZE, 0, 0); /* Set the window text with the text specified in the OPENFILENAME structure */ if(fodInfos->ofnInfos->lpstrTitle) @@ -1031,7 +1031,7 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) /* Resize the height, if open as read only checkbox ad help button are hidden and we are not using a custom template */ if ( (fodInfos->ofnInfos->Flags & OFN_HIDEREADONLY) && - (!(fodInfos->ofnInfos->Flags & + (!(fodInfos->ofnInfos->Flags & (OFN_SHOWHELP|OFN_ENABLETEMPLATE|OFN_ENABLETEMPLATEHANDLE)))) { RECT rectDlg, rectHelp, rectCancel; @@ -1040,8 +1040,8 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) GetWindowRect(GetDlgItem(hwnd, IDCANCEL), &rectCancel); /* subtract the height of the help button plus the space between the help button and the cancel button to the height of the dialog */ - SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left, - (rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom), + SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left, + (rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom), SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER); } @@ -1062,10 +1062,10 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) static LRESULT FILEDLG95_FillControls(HWND hwnd, WPARAM wParam, LPARAM lParam) { LPITEMIDLIST pidlItemId = NULL; - + FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) lParam; - TRACE("dir=%s file=%s\n", + TRACE("dir=%s file=%s\n", fodInfos->ofnInfos->lpstrInitialDir, fodInfos->ofnInfos->lpstrFile); /* Get the initial directory pidl */ @@ -1165,7 +1165,7 @@ static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) } /* Do not use the listview selection anymore */ fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW; - return 0; + return 0; } /*********************************************************************** @@ -1182,13 +1182,13 @@ static LRESULT FILEDLG95_OnWMGetIShellBrowser(HWND hwnd) SetWindowLongA(hwnd,DWL_MSGRESULT,(LONG)fodInfos->Shell.FOIShellBrowser); - return TRUE; + return TRUE; } /*********************************************************************** * FILEDLG95_OnOpenMultipleFiles - * + * * Handles the opening of multiple files. * * FIXME @@ -1205,13 +1205,13 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCou lpstrFile = fodInfos->ofnInfos->lpstrFile; lpstrFile[0] = '\0'; - + SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec ); if ( !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE) && ( fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST)) { - LPSTR lpstrTemp = lpstrFileList; + LPSTR lpstrTemp = lpstrFileList; for ( nCount = 0; nCount < nFileCount; nCount++ ) { @@ -1236,7 +1236,7 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCou MessageBoxA(hwnd, tmp, fodInfos->ofnInfos->lpstrTitle, MB_OK | MB_ICONEXCLAMATION); return FALSE; } - + /* move to the next file in the list of files */ lpstrTemp += strlen(lpstrTemp) + 1; COMDLG32_SHFree(pidl); @@ -1259,7 +1259,7 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCou * FILEDLG95_OnOpen * * Ok button WM_COMMAND message handler - * + * * If the function succeeds, the return value is nonzero. */ #define ONOPEN_BROWSE 1 @@ -1300,7 +1300,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) BrowseSelectedFolder(hwnd); return FALSE; } - + if(nFileCount > 1) { ret = FILEDLG95_OnOpenMultipleFiles(hwnd, lpstrFileList, nFileCount, sizeUsed); @@ -1359,7 +1359,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) We have to parse the path step by step to see if we have to browse to a folder if the path points to a directory or the last valid element is a directory. - + valid variables: lpstrPathAndFile: cleaned up path */ @@ -1381,7 +1381,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) } if (FAILED (SHGetDesktopFolder(&lpsf))) return FALSE; - + lpszTemp1 = lpszTemp = lpstrPathAndFile; while (lpszTemp1) { @@ -1537,12 +1537,12 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) { int PathLength; PathLength = strlen(lpstrPathAndFile); - + strcat(lpstrPathAndFile, "."); strcat(lpstrPathAndFile, fodInfos->ofnInfos->lpstrDefExt); - + /* if file does not exist try without extension */ - if (!PathFileExistsA(lpstrPathAndFile)) + if (!PathFileExistsA(lpstrPathAndFile)) lpstrPathAndFile[PathLength] = '\0'; } } @@ -1554,7 +1554,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) ((fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT) ? 1 : 0)) { LPSTR lpszTemp; - + /* fill destination buffer */ strcpy(fodInfos->ofnInfos->lpstrFile, lpstrPathAndFile); if (fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT) @@ -1564,11 +1564,11 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) /* set filename offset */ lpszTemp = PathFindFileNameA(lpstrPathAndFile); fodInfos->ofnInfos->nFileOffset = lpszTemp - lpstrPathAndFile; - + /* set extension offset */ lpszTemp = PathFindExtensionA(lpstrPathAndFile); fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? lpszTemp - lpstrPathAndFile + 1 : 0; - + /* set the lpstrFileTitle */ if(fodInfos->ofnInfos->lpstrFileTitle) { @@ -1627,7 +1627,7 @@ static HRESULT FILEDLG95_SHELL_Init(HWND hwnd) TRACE("\n"); /* - * Initialisation of the FileOpenDialogInfos structure + * Initialisation of the FileOpenDialogInfos structure */ /* Shell */ @@ -1638,7 +1638,7 @@ static HRESULT FILEDLG95_SHELL_Init(HWND hwnd) /* Disable multi-select if flag not set */ if (!(fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT)) { - fodInfos->ShellInfos.folderSettings.fFlags |= FWF_SINGLESEL; + fodInfos->ShellInfos.folderSettings.fFlags |= FWF_SINGLESEL; } fodInfos->ShellInfos.folderSettings.fFlags |= FWF_AUTOARRANGE | FWF_ALIGNLEFT; fodInfos->ShellInfos.folderSettings.ViewMode = FVM_LIST; @@ -1648,8 +1648,8 @@ static HRESULT FILEDLG95_SHELL_Init(HWND hwnd) ScreenToClient(hwnd,(LPPOINT)&fodInfos->ShellInfos.rectView.right); /* Construct the IShellBrowser interface */ - fodInfos->Shell.FOIShellBrowser = IShellBrowserImpl_Construct(hwnd); - + fodInfos->Shell.FOIShellBrowser = IShellBrowserImpl_Construct(hwnd); + return NOERROR; } @@ -1716,7 +1716,7 @@ static BOOL FILEDLG95_SHELL_BrowseToDesktop(HWND hwnd) FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); LPITEMIDLIST pidl; HRESULT hres; - + TRACE("\n"); SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl); @@ -1749,7 +1749,7 @@ static void FILEDLG95_SHELL_Clean(HWND hwnd) /*********************************************************************** * FILEDLG95_FILETYPE_Init * - * Initialisation of the file type combo box + * Initialisation of the file type combo box */ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) { @@ -1765,7 +1765,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) for(;;) { - /* filter is a list... title\0ext\0......\0\0 + /* filter is a list... title\0ext\0......\0\0 * Set the combo item text to the title and the item data * to the ext */ @@ -1782,7 +1782,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) if (!(lpstrExt = (LPSTR) MemAlloc(strlen(lpstrPos)+1))) return E_FAIL; strcpy(lpstrExt,lpstrPos); lpstrPos += strlen(lpstrPos) + 1; - + /* Add the item at the end of the combo */ CBAddString(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay); CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters, lpstrExt); @@ -1793,7 +1793,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) * in the initialisation structure * FIXME: lpstrCustomFilter not handled at all */ - + /* set default filter index */ if(fodInfos->ofnInfos->nFilterIndex == 0 && fodInfos->ofnInfos->lpstrCustomFilter == NULL) fodInfos->ofnInfos->nFilterIndex = 1; @@ -1801,16 +1801,16 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) /* First, check to make sure our index isn't out of bounds. */ if ( fodInfos->ofnInfos->nFilterIndex > nFilters ) fodInfos->ofnInfos->nFilterIndex = nFilters; - + /* Set the current index selection. */ CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, fodInfos->ofnInfos->nFilterIndex-1); - + /* Get the corresponding text string from the combo box. */ lpstrFilter = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, fodInfos->ofnInfos->nFilterIndex-1); if ((INT)lpstrFilter == CB_ERR) /* control is empty */ - lpstrFilter = NULL; + lpstrFilter = NULL; if(lpstrFilter) { @@ -1919,11 +1919,11 @@ static void FILEDLG95_FILETYPE_Clean(HWND hwnd) MemFree(fodInfos->ShellInfos.lpstrCurrentFilter); } - + /*********************************************************************** * FILEDLG95_LOOKIN_Init * - * Initialisation of the look in combo box + * Initialisation of the look in combo box */ static HRESULT FILEDLG95_LOOKIN_Init(HWND hwndCombo) { @@ -2026,21 +2026,21 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct) if(pDIStruct->itemID == liInfos->uSelectedItem) { ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem, - 0, - &sfi, - sizeof (SHFILEINFOA), - SHGFI_PIDL | SHGFI_SMALLICON | - SHGFI_OPENICON | SHGFI_SYSICONINDEX | - SHGFI_DISPLAYNAME ); + 0, + &sfi, + sizeof (SHFILEINFOA), + SHGFI_PIDL | SHGFI_SMALLICON | + SHGFI_OPENICON | SHGFI_SYSICONINDEX | + SHGFI_DISPLAYNAME ); } else { ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem, - 0, - &sfi, + 0, + &sfi, sizeof (SHFILEINFOA), - SHGFI_PIDL | SHGFI_SMALLICON | - SHGFI_SYSICONINDEX | + SHGFI_PIDL | SHGFI_SMALLICON | + SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME); } @@ -2063,10 +2063,10 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct) { iIndentation = 0; ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem, - 0, - &sfi, - sizeof (SHFILEINFOA), - SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_OPENICON + 0, + &sfi, + sizeof (SHFILEINFOA), + SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME ); } @@ -2090,14 +2090,14 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct) rectText.right = pDIStruct->rcItem.right + XTEXTOFFSET; rectText.bottom = (pDIStruct->rcItem.top + pDIStruct->rcItem.bottom + tm.tmHeight) / 2; - + /* Draw the icon from the image list */ ImageList_Draw(ilItemImage, sfi.iIcon, - pDIStruct->hDC, - rectIcon.left, - rectIcon.top, - ILD_TRANSPARENT ); + pDIStruct->hDC, + rectIcon.left, + rectIcon.top, + ILD_TRANSPARENT ); /* Draw the associated text */ if(sfi.szDisplayName) @@ -2124,7 +2124,7 @@ static BOOL FILEDLG95_LOOKIN_OnCommand(HWND hwnd, WORD wNotifyCode) case CBN_SELENDOK: { LPSFOLDER tmpFolder; - int iItem; + int iItem; iItem = CBGetCurSel(fodInfos->DlgInfos.hwndLookInCB); @@ -2141,7 +2141,7 @@ static BOOL FILEDLG95_LOOKIN_OnCommand(HWND hwnd, WORD wNotifyCode) } break; } - + } return FALSE; } @@ -2166,7 +2166,7 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId) if(!(liInfos = (LookInInfos *)GetPropA(hwnd,LookInInfosStr))) return -1; - + tmpFolder = MemAlloc(sizeof(SFOLDER)); tmpFolder->m_iIndent = 0; @@ -2181,13 +2181,13 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId) if(tmpFolder->m_iIndent > liInfos->iMaxIndentation) liInfos->iMaxIndentation = tmpFolder->m_iIndent; - + sfi.dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; SHGetFileInfoA((LPSTR)pidl, 0, &sfi, sizeof(sfi), - SHGFI_DISPLAYNAME | SHGFI_SYSICONINDEX + SHGFI_DISPLAYNAME | SHGFI_SYSICONINDEX | SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_ATTRIBUTES | SHGFI_ATTR_SPECIFIED); TRACE("-- Add %s attr=%08lx\n", sfi.szDisplayName, sfi.dwAttributes); @@ -2195,7 +2195,7 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId) if((sfi.dwAttributes & SFGAO_FILESYSANCESTOR) || (sfi.dwAttributes & SFGAO_FILESYSTEM)) { int iItemID; - + TRACE("-- Add %s at %u\n", sfi.szDisplayName, tmpFolder->m_iIndent); /* Add the item at the end of the list */ @@ -2221,11 +2221,11 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId) /*********************************************************************** * FILEDLG95_LOOKIN_InsertItemAfterParent * - * Insert an item below its parent + * Insert an item below its parent */ static int FILEDLG95_LOOKIN_InsertItemAfterParent(HWND hwnd,LPITEMIDLIST pidl) { - + LPITEMIDLIST pidlParent = GetParentPidl(pidl); int iParentPos; @@ -2280,7 +2280,7 @@ int FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl) iItemPos--; } } - + CBSetCurSel(hwnd,iItemPos); liInfos->uSelectedItem = iItemPos; @@ -2402,7 +2402,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd) for ( nFileToOpen = 0; nFileToOpen < nFileSelected; nFileToOpen++ ) { pidl = GetPidlFromDataObject( fodInfos->Shell.FOIDataObject, nFileToOpen+1 ); - + if (pidl) { /* get the total length of the selected file names*/ @@ -2514,7 +2514,7 @@ int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPSTR * lpstrFileList, UINT * si GetDlgItemTextA(hwnd, IDC_FILENAME, lpstrEdit, nStrLen+1); TRACE("nStrLen=%u str=%s\n", nStrLen, lpstrEdit); - + /* we might get single filename without any '"', * so we need nStrLen + terminating \0 + end-of-list \0 */ *lpstrFileList = MemAlloc(nStrLen+2); @@ -2535,7 +2535,7 @@ int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPSTR * lpstrFileList, UINT * si (*lpstrFileList)[nFileIndex++] = '\0'; (*sizeUsed)++; nFileCount++; - } + } nStrCharCount++; } @@ -2596,13 +2596,13 @@ static void COMCTL32_ReleaseStgMedium (STGMEDIUM medium) */ LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex) { - + STGMEDIUM medium; FORMATETC formatetc; LPITEMIDLIST pidl = NULL; - + TRACE("sv=%p index=%u\n", doSelected, nPidlIndex); - + /* Set the FORMATETC structure*/ SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); @@ -2656,9 +2656,9 @@ UINT GetNumSelected( IDataObject *doSelected ) /*********************************************************************** * GetName * - * Get the pidl's display name (relative to folder) and + * Get the pidl's display name (relative to folder) and * put it in lpstrFileName. - * + * * Return NOERROR on success, * E_FAIL otherwise */ @@ -2690,7 +2690,7 @@ HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrF /*********************************************************************** * GetShellFolderFromPidl * - * pidlRel is the item pidl relative + * pidlRel is the item pidl relative * Return the IShellFolder of the absolute pidl */ IShellFolder *GetShellFolderFromPidl(LPITEMIDLIST pidlAbs) @@ -2726,17 +2726,17 @@ LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl) LPITEMIDLIST pidlParent; TRACE("%p\n", pidl); - + pidlParent = COMDLG32_PIDL_ILClone(pidl); COMDLG32_PIDL_ILRemoveLastID(pidlParent); - + return pidlParent; } /*********************************************************************** * GetPidlFromName * - * returns the pidl of the file name relative to folder + * returns the pidl of the file name relative to folder * NULL if an error occurred */ LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName) @@ -2750,7 +2750,7 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName) if(!lpcstrFileName) return NULL; if(!*lpcstrFileName) return NULL; - MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpcstrFileName,-1,(LPWSTR)lpwstrDirName,MAX_PATH); + MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpcstrFileName,-1,(LPWSTR)lpwstrDirName,MAX_PATH); if(!lpsf) { @@ -2760,7 +2760,7 @@ LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName) } else { - IShellFolder_ParseDisplayName(lpsf, 0, NULL, (LPWSTR)lpwstrDirName, &ulEaten, &pidl, NULL); + IShellFolder_ParseDisplayName(lpsf, 0, NULL, (LPWSTR)lpwstrDirName, &ulEaten, &pidl, NULL); } return pidl; } @@ -2771,11 +2771,11 @@ BOOL IsPidlFolder (LPSHELLFOLDER psf, LPITEMIDLIST pidl) { ULONG uAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; HRESULT ret; - + TRACE("%p, %p\n", psf, pidl); - + ret = IShellFolder_GetAttributesOf( psf, 1, &pidl, &uAttr ); - + TRACE("-- 0x%08lx 0x%08lx\n", uAttr, ret); /* see documentation shell 4.1*/ return uAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER); @@ -2812,7 +2812,7 @@ static BOOL BrowseSelectedFolder(HWND hwnd) } return bBrowseSelFolder; -} +} /* * Memory allocation methods */ diff --git a/dlls/commdlg/filedlgbrowser.c b/dlls/commdlg/filedlgbrowser.c index 26532459cb6..7d0d649d836 100644 --- a/dlls/commdlg/filedlgbrowser.c +++ b/dlls/commdlg/filedlgbrowser.c @@ -1,6 +1,6 @@ /* * Implementation of IShellBrowser for the File Open common dialog - * + * * Copyright 1999 Francois Boisvert * Copyright 1999, 2000 Juergen Schmied * @@ -69,7 +69,7 @@ LPITEMIDLIST GetSelectedPidl(IShellView *ppshv); /************************************************************************** * External Prototypes */ -extern const char *FileOpenDlgInfosStr; +extern const char *FileOpenDlgInfosStr; extern HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrFileName); extern HRESULT GetFileName(HWND hwnd, LPITEMIDLIST pidl, LPSTR lpstrFileName); @@ -137,7 +137,7 @@ static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPI /* * IShellBrowser */ - + /************************************************************************** * IShellBrowserImpl_Construct */ @@ -168,7 +168,7 @@ IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner) * IShellBrowserImpl_QueryInterface */ HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface, - REFIID riid, + REFIID riid, LPVOID *ppvObj) { ICOM_THIS(IShellBrowserImpl, iface); @@ -178,7 +178,7 @@ HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface, *ppvObj = NULL; if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = This; + { *ppvObj = This; } else if(IsEqualIID(riid, &IID_IOleWindow)) /*IOleWindow*/ { *ppvObj = (IOleWindow*)This; @@ -225,8 +225,8 @@ ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface) TRACE("(%p)\n", This); - if (!--(This->ref)) - { + if (!--(This->ref)) + { HeapFree(GetProcessHeap(),0, This); return 0; } @@ -245,9 +245,9 @@ ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface) * See Windows documentation for more details * * Note : We will never be window less in the File Open dialog -* +* */ -HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, +HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, HWND * phwnd) { ICOM_THIS(IShellBrowserImpl, iface); @@ -259,7 +259,7 @@ HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, *phwnd = This->hwndOwner; - return (*phwnd) ? S_OK : E_UNEXPECTED; + return (*phwnd) ? S_OK : E_UNEXPECTED; } @@ -286,11 +286,11 @@ HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface, * * See Windows documentation on IShellBrowser::BrowseObject for more details * -* This function will override user specified flags and will always -* use SBSP_DEFBROWSER and SBSP_DEFMODE. +* This function will override user specified flags and will always +* use SBSP_DEFBROWSER and SBSP_DEFMODE. */ -HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, - LPCITEMIDLIST pidl, +HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, + LPCITEMIDLIST pidl, UINT wFlags) { HRESULT hRes; @@ -311,7 +311,7 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, /* Format the pidl according to its parameter's category */ if(wFlags & SBSP_RELATIVE) { - + /* SBSP_RELATIVE A relative pidl (relative from the current folder) */ if(FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder, pidl, NULL, &IID_IShellFolder, (LPVOID *)&psfTmp))) @@ -336,14 +336,14 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, pidlTmp = COMDLG32_PIDL_ILClone((LPITEMIDLIST)pidl); psfTmp = GetShellFolderFromPidl(pidlTmp); } - + if(!psfTmp) { ERR("could not browse to folder\n"); return E_FAIL; } - /* If the pidl to browse to is equal to the actual pidl ... + /* If the pidl to browse to is equal to the actual pidl ... do nothing and pretend you did it*/ if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent)) { @@ -405,14 +405,14 @@ HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent); /* changes the tab order of the ListView to reflect the window's File Dialog */ - hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN); + hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN); SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE); /* Since we destroyed the old view if it had focus set focus to the newly created view */ if (bViewHasFocus) SetFocus(fodInfos->ShellInfos.hwndView); - return hRes; + return hRes; error: ERR("Failed with error 0x%08lx\n", hRes); return hRes; @@ -421,9 +421,9 @@ error: /************************************************************************** * IShellBrowserImpl_EnableModelessSB */ -HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, +HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, BOOL fEnable) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -436,10 +436,10 @@ HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, /************************************************************************** * IShellBrowserImpl_GetControlWindow */ -HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, - UINT id, +HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, + UINT id, HWND *lphwnd) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -452,9 +452,9 @@ HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, * IShellBrowserImpl_GetViewStateStream */ HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface, - DWORD grfMode, + DWORD grfMode, LPSTREAM *ppStrm) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -462,14 +462,14 @@ HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface, /* Feature not implemented */ return E_NOTIMPL; -} +} /************************************************************************** * IShellBrowserImpl_InsertMenusSB */ HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -483,7 +483,7 @@ HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface, */ HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface, IShellView *ppshv) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -491,13 +491,13 @@ HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface, /* Feature not implemented */ return E_NOTIMPL; -} +} /************************************************************************** * IShellBrowserImpl_QueryActiveShellView */ HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface, IShellView **ppshv) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -513,13 +513,13 @@ HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface, } IShellView_AddRef(fodInfos->Shell.FOIShellView); return NOERROR; -} +} /************************************************************************** * IShellBrowserImpl_RemoveMenusSB */ HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface, HMENU hmenuShared) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -527,21 +527,21 @@ HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface, /* Feature not implemented */ return E_NOTIMPL; -} +} /************************************************************************** * IShellBrowserImpl_SendControlMsg */ -HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, - UINT id, - UINT uMsg, - WPARAM wParam, +HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, + UINT id, + UINT uMsg, + WPARAM wParam, LPARAM lParam, LRESULT *pret) - + { ICOM_THIS(IShellBrowserImpl, iface); LRESULT lres; - + TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret); switch (id) @@ -560,10 +560,10 @@ HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, * IShellBrowserImpl_SetMenuSB */ HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface, - HMENU hmenuShared, + HMENU hmenuShared, HOLEMENU holemenuReserved, HWND hwndActiveObject) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -571,13 +571,13 @@ HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface, /* Feature not implemented */ return E_NOTIMPL; -} +} /************************************************************************** * IShellBrowserImpl_SetStatusTextSB */ HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface, LPCOLESTR lpszStatusText) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -585,15 +585,15 @@ HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface, /* Feature not implemented */ return E_NOTIMPL; -} +} /************************************************************************** * IShellBrowserImpl_SetToolbarItems */ HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface, - LPTBBUTTON lpButtons, - UINT nButtons, + LPTBBUTTON lpButtons, + UINT nButtons, UINT uFlags) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -601,14 +601,14 @@ HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface, /* Feature not implemented */ return E_NOTIMPL; -} +} /************************************************************************** * IShellBrowserImpl_TranslateAcceleratorSB */ HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface, - LPMSG lpmsg, + LPMSG lpmsg, WORD wID) - + { ICOM_THIS(IShellBrowserImpl, iface); @@ -655,7 +655,7 @@ static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl = */ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface( ICommDlgBrowser *iface, - REFIID riid, + REFIID riid, LPVOID *ppvObj) { _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface); @@ -703,8 +703,8 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowse TRACE("(%p)\n", This); - fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); - + fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); + /* If the selected object is not a folder, send a IDOK command to parent window */ if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1))) { @@ -753,7 +753,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser * SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0); break; - case CDBOSC_KILLFOCUS: + case CDBOSC_KILLFOCUS: { FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) @@ -767,13 +767,13 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser * break; } - return NOERROR; + return NOERROR; } /************************************************************************** * IShellBrowserImpl_ICommDlgBrowser_IncludeObject */ -HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, +HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, IShellView * ppshv, LPCITEMIDLIST pidl) { @@ -790,13 +790,13 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser * ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK; IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); - + if( (ulAttr & SFGAO_HIDDEN) /* hidden */ | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */ return S_FALSE; /* always include directories and links */ - if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK)) + if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK)) return S_OK; /* Check if there is a mask to apply if not */ @@ -817,7 +817,7 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser * /************************************************************************** * IShellBrowserImpl_ICommDlgBrowser_OnSelChange -*/ +*/ HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv) { FileOpenDlgInfos *fodInfos; @@ -826,16 +826,16 @@ HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IS fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView); - + /* release old selections */ if (fodInfos->Shell.FOIDataObject) IDataObject_Release(fodInfos->Shell.FOIDataObject); - + /* get a new DataObject from the ShellView */ if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION, &IID_IDataObject, (LPVOID*)&fodInfos->Shell.FOIDataObject))) return E_FAIL; - + FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner); SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE); @@ -867,7 +867,7 @@ static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl = */ HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface( IServiceProvider *iface, - REFIID riid, + REFIID riid, LPVOID *ppvObj) { _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface); @@ -905,7 +905,7 @@ ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface * IShellBrowserImpl_IServiceProvider_Release * * NOTES -* the w2k shellview asks for +* the w2k shellview asks for * guidService = SID_STopLevelBrowser * riid = IShellBrowser * diff --git a/dlls/commdlg/filedlgbrowser.h b/dlls/commdlg/filedlgbrowser.h index 7bd22aee5a0..221db78a8c3 100644 --- a/dlls/commdlg/filedlgbrowser.h +++ b/dlls/commdlg/filedlgbrowser.h @@ -1,6 +1,6 @@ /* * Implementation of IShellBrowser for the File Open common dialog - * + * * Copyright 1999 Francois Boisvert * Copyright 1999, 2000 Juergen Schmied * @@ -39,7 +39,7 @@ /* dialog internal property */ #define FODPROP_SAVEDLG 0x0001 /* File dialog is a Save file dialog */ -#define FODPROP_USEVIEW 0x0002 /* Indicates the user selection must be taken +#define FODPROP_USEVIEW 0x0002 /* Indicates the user selection must be taken from the IShellView */ /*********************************************************************** @@ -49,10 +49,10 @@ typedef struct { - + LPOPENFILENAMEA ofnInfos; struct { - IShellBrowser *FOIShellBrowser; + IShellBrowser *FOIShellBrowser; IShellFolder *FOIShellFolder; IShellView *FOIShellView; IDataObject *FOIDataObject; diff --git a/dlls/commdlg/filetitle.c b/dlls/commdlg/filetitle.c index 8c610756b30..6c55e5eebc8 100644 --- a/dlls/commdlg/filetitle.c +++ b/dlls/commdlg/filetitle.c @@ -71,7 +71,7 @@ short WINAPI GetFileTitleA(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf) i++; TRACE("---> '%s' \n", &lpFile[i]); - + len = strlen(lpFile+i)+1; if(cbBuf < len) return len; diff --git a/dlls/commdlg/finddlg.c b/dlls/commdlg/finddlg.c index 269ccb43e38..5ef7f000b39 100644 --- a/dlls/commdlg/finddlg.c +++ b/dlls/commdlg/finddlg.c @@ -33,7 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); #include "cdlg.h" -struct FRPRIVATE +struct FRPRIVATE { HANDLE16 hDlgTmpl16; /* handle for resource 16 */ HANDLE16 hResource16; /* handle for allocated resource 16 */ @@ -101,7 +101,7 @@ BOOL FINDDLG_Get16BitsTemplate(LFRPRIVATE lfr) DWORD size; HGLOBAL16 hGlobal16; - if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, + if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, lfr->find ? MAKEINTRESOURCEA(FINDDLGORD):MAKEINTRESOURCEA(REPLACEDLGORD), RT_DIALOGA))) @@ -142,7 +142,7 @@ BOOL FINDDLG_Get16BitsTemplate(LFRPRIVATE lfr) /*********************************************************************** * FINDDLG_FreeResources [internal] * - * Free resources allocated + * Free resources allocated */ void FINDDLG_FreeResources(LFRPRIVATE lfr) { @@ -259,15 +259,15 @@ static LRESULT FINDDLG_WMInitDialog(HWND hWnd, LPARAM lParam, LPDWORD lpFlags, } ShowWindow(hWnd, SW_SHOWNORMAL); return TRUE; -} +} /*********************************************************************** * FINDDLG_WMCommand [internal] */ -static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam, +static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam, HWND hwndOwner, LPDWORD lpFlags, - LPSTR lpstrFindWhat, WORD wFindWhatLen, + LPSTR lpstrFindWhat, WORD wFindWhatLen, BOOL fUnicode) { int uFindReplaceMessage = RegisterWindowMessageA( FINDMSGSTRINGA ); @@ -275,17 +275,17 @@ static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam, switch (wParam) { case IDOK: - if (fUnicode) + if (fUnicode) GetDlgItemTextW(hWnd, edt1, (LPWSTR)lpstrFindWhat, wFindWhatLen/2); else GetDlgItemTextA(hWnd, edt1, lpstrFindWhat, wFindWhatLen); if (IsDlgButtonChecked(hWnd, rad2)) *lpFlags |= FR_DOWN; else *lpFlags &= ~FR_DOWN; if (IsDlgButtonChecked(hWnd, chx1)) - *lpFlags |= FR_WHOLEWORD; + *lpFlags |= FR_WHOLEWORD; else *lpFlags &= ~FR_WHOLEWORD; if (IsDlgButtonChecked(hWnd, chx2)) - *lpFlags |= FR_MATCHCASE; + *lpFlags |= FR_MATCHCASE; else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_FINDNEXT; @@ -305,7 +305,7 @@ static LRESULT FINDDLG_WMCommand(HWND hWnd, WPARAM wParam, return TRUE; } return FALSE; -} +} /*********************************************************************** @@ -334,7 +334,7 @@ LRESULT WINAPI FindTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, * REPLACEDLG_WMInitDialog [internal] */ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam, - LPDWORD lpFlags, LPSTR lpstrFindWhat, + LPDWORD lpFlags, LPSTR lpstrFindWhat, LPSTR lpstrReplaceWith, BOOL fUnicode) { SetWindowLongA(hWnd, DWL_USER, lParam); @@ -344,7 +344,7 @@ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam, * Replace / ReplaceAll buttons. Only after typing some text, the buttons should be * enabled. */ - if (fUnicode) + if (fUnicode) { SetDlgItemTextW(hWnd, edt1, (LPWSTR)lpstrFindWhat); SetDlgItemTextW(hWnd, edt2, (LPWSTR)lpstrReplaceWith); @@ -369,7 +369,7 @@ static LRESULT REPLACEDLG_WMInitDialog(HWND hWnd, LPARAM lParam, } ShowWindow(hWnd, SW_SHOWNORMAL); return TRUE; -} +} /*********************************************************************** @@ -396,10 +396,10 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam, GetDlgItemTextA(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen); } if (IsDlgButtonChecked(hWnd, chx1)) - *lpFlags |= FR_WHOLEWORD; + *lpFlags |= FR_WHOLEWORD; else *lpFlags &= ~FR_WHOLEWORD; if (IsDlgButtonChecked(hWnd, chx2)) - *lpFlags |= FR_MATCHCASE; + *lpFlags |= FR_MATCHCASE; else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_FINDNEXT; @@ -419,15 +419,15 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam, GetDlgItemTextW(hWnd, edt1, (LPWSTR)lpstrFindWhat, wFindWhatLen/2); GetDlgItemTextW(hWnd, edt2, (LPWSTR)lpstrReplaceWith, wReplaceWithLen/2); } else - { + { GetDlgItemTextA(hWnd, edt1, lpstrFindWhat, wFindWhatLen); GetDlgItemTextA(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen); } if (IsDlgButtonChecked(hWnd, chx1)) - *lpFlags |= FR_WHOLEWORD; + *lpFlags |= FR_WHOLEWORD; else *lpFlags &= ~FR_WHOLEWORD; if (IsDlgButtonChecked(hWnd, chx2)) - *lpFlags |= FR_MATCHCASE; + *lpFlags |= FR_MATCHCASE; else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_FINDNEXT | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_REPLACE; @@ -445,10 +445,10 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam, GetDlgItemTextA(hWnd, edt2, lpstrReplaceWith, wReplaceWithLen); } if (IsDlgButtonChecked(hWnd, chx1)) - *lpFlags |= FR_WHOLEWORD; + *lpFlags |= FR_WHOLEWORD; else *lpFlags &= ~FR_WHOLEWORD; if (IsDlgButtonChecked(hWnd, chx2)) - *lpFlags |= FR_MATCHCASE; + *lpFlags |= FR_MATCHCASE; else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_DIALOGTERM); *lpFlags |= FR_REPLACEALL; @@ -461,7 +461,7 @@ static LRESULT REPLACEDLG_WMCommand(HWND hWnd, WPARAM16 wParam, return TRUE; } return FALSE; -} +} /*********************************************************************** @@ -479,7 +479,7 @@ LRESULT WINAPI ReplaceTextDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, MapSL(lpfr->lpstrReplaceWith), FALSE); case WM_COMMAND: lpfr=MapSL(GetWindowLongA(hWnd, DWL_USER)); - return REPLACEDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner, + return REPLACEDLG_WMCommand(hWnd, wParam, lpfr->hwndOwner, &lpfr->Flags, MapSL(lpfr->lpstrFindWhat), lpfr->wFindWhatLen, MapSL(lpfr->lpstrReplaceWith), lpfr->wReplaceWithLen, FALSE); diff --git a/dlls/commdlg/finddlg32.c b/dlls/commdlg/finddlg32.c index 77880495772..caa270c6c04 100644 --- a/dlls/commdlg/finddlg32.c +++ b/dlls/commdlg/finddlg32.c @@ -175,7 +175,7 @@ Replace: static BOOL CALLBACK COMDLG32_FindReplaceDlgProc(HWND hDlgWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) { COMDLG32_FR_Data *pdata = (COMDLG32_FR_Data *)GetPropA(hDlgWnd, (LPSTR)COMDLG32_Atom); - BOOL retval = TRUE;; + BOOL retval = TRUE; if(iMsg == WM_INITDIALOG) { diff --git a/dlls/commdlg/fontdlg.c b/dlls/commdlg/fontdlg.c index fd4618bf0fe..194a736533e 100644 --- a/dlls/commdlg/fontdlg.c +++ b/dlls/commdlg/fontdlg.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); #include "cdlg.h" -static HBITMAP16 hBitmapTT = 0; +static HBITMAP16 hBitmapTT = 0; LRESULT WINAPI FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, @@ -132,7 +132,7 @@ _dump_cf_flags(DWORD cflags) { /*********************************************************************** - * ChooseFont (COMMDLG.15) + * ChooseFont (COMMDLG.15) */ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont) { @@ -146,12 +146,12 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont) LOGFONTA lf32a; LOGFONT16 *font16; SEGPTR lpTemplateName; - + cf32a.lpLogFont=&lf32a; CFn_CHOOSEFONT16to32A(lpChFont, &cf32a); TRACE("ChooseFont\n"); - if (!lpChFont) return FALSE; + if (!lpChFont) return FALSE; if (TRACE_ON(commdlg)) _dump_cf_flags(lpChFont->Flags); @@ -214,7 +214,7 @@ BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont) return FALSE; } ConvertDialog32To16((LPVOID)template32, size, (LPVOID)template); - hDlgTmpl16 = hGlobal16; + hDlgTmpl16 = hGlobal16; } @@ -278,7 +278,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont) if (lpChFont->Flags & (CF_SELECTSCRIPT | CF_NOVERTFONTS | CF_ENABLETEMPLATE | CF_ENABLETEMPLATEHANDLE)) FIXME(": unimplemented flag (ignored)\n"); - return DialogBoxIndirectParamA(COMMDLG_hInstance32, template, + return DialogBoxIndirectParamA(COMMDLG_hInstance32, template, lpChFont->hwndOwner, (DLGPROC)FormatCharDlgProcA, (LPARAM)lpChFont ); } @@ -320,9 +320,9 @@ static BOOL ChooseFontWtoA(const CHOOSEFONTW *cfw, CHOOSEFONTA *cfa) memcpy(cfa, cfw, sizeof(CHOOSEFONTA)); cfa->lpLogFont = lpLogFont; cfa->lpszStyle = lpszStyle; - + LogFontWtoA(cfw->lpLogFont, lpLogFont); - + if (cfw->lpTemplateName != NULL) { cfa->lpTemplateName = HEAP_strdupWtoA(GetProcessHeap(), 0, @@ -330,14 +330,14 @@ static BOOL ChooseFontWtoA(const CHOOSEFONTW *cfw, CHOOSEFONTA *cfa) if (cfa->lpTemplateName == NULL) return FALSE; } - + if ((cfw->Flags & CF_USESTYLE) != 0 && cfw->lpszStyle != NULL) { WideCharToMultiByte(CP_ACP, 0, cfw->lpszStyle, -1, cfa->lpszStyle, LF_FACESIZE, NULL, NULL); cfa->lpszStyle[LF_FACESIZE - 1] = '\0'; } - + return TRUE; } @@ -351,12 +351,12 @@ static VOID ChooseFontAtoW(const CHOOSEFONTA *cfa, CHOOSEFONTW *cfw) cfw->lpLogFont = lpLogFont; cfw->lpszStyle = lpszStyle; cfw->lpTemplateName = lpTemplateName; - + LogFontAtoW(cfa->lpLogFont, lpLogFont); - + if (cfa->lpTemplateName != NULL) HeapFree(GetProcessHeap(), 0, (LPSTR)(cfa->lpTemplateName)); - + if ((cfa->Flags & CF_USESTYLE) != 0 && cfa->lpszStyle != NULL) { MultiByteToWideChar(CP_ACP, 0, cfa->lpszStyle, -1, cfw->lpszStyle, @@ -370,25 +370,25 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont) CHOOSEFONTA cf_a; LOGFONTA lf_a; CHAR style_a[LF_FACESIZE]; - + cf_a.lpLogFont = &lf_a; cf_a.lpszStyle = style_a; - + if (ChooseFontWtoA(lpChFont, &cf_a) == FALSE) { COMDLG32_SetCommDlgExtendedError(CDERR_MEMALLOCFAILURE); return FALSE; } - + if (ChooseFontA(&cf_a) == FALSE) { if (cf_a.lpTemplateName != NULL) HeapFree(GetProcessHeap(), 0, (LPSTR)(cf_a.lpTemplateName)); return FALSE; } - + ChooseFontAtoW(&cf_a, lpChFont); - + return TRUE; } @@ -430,7 +430,7 @@ BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont) cf32a.lpLogFont=&lf32a; cf32a.lpszStyle=HEAP_strdupWtoA(GetProcessHeap(), 0, lpChFont->lpszStyle); lpChFont->lpTemplateName=(LPWSTR)&cf32a; - bRet = DialogBoxIndirectParamW(COMMDLG_hInstance32, template, + bRet = DialogBoxIndirectParamW(COMMDLG_hInstance32, template, lpChFont->hwndOwner, (DLGPROC)FormatCharDlgProcW, (LPARAM)lpChFont ); HeapFree(GetProcessHeap(), 0, cf32a.lpszStyle); lpChFont->lpTemplateName=(LPWSTR)cf32a.lpTemplateName; @@ -488,7 +488,7 @@ typedef struct /************************************************************************* * AddFontFamily [internal] */ -static INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType, +static INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType, LPCHOOSEFONTA lpcf, HWND hwnd, LPCFn_ENUMSTRUCT e) { int i; @@ -504,7 +504,7 @@ static INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType, return 1; if (lpcf->Flags & CF_TTONLY) if (!(nFontType & TRUETYPE_FONTTYPE)) - return 1; + return 1; if (e) e->added++; @@ -522,7 +522,7 @@ static INT AddFontFamily(const LOGFONTA *lplf, UINT nFontType, /************************************************************************* * FontFamilyEnumProc32 [internal] */ -static INT WINAPI FontFamilyEnumProc(const LOGFONTA *lpLogFont, +static INT WINAPI FontFamilyEnumProc(const LOGFONTA *lpLogFont, const TEXTMETRICA *metrics, DWORD dwFontType, LPARAM lParam) { LPCFn_ENUMSTRUCT e; @@ -538,7 +538,7 @@ INT16 WINAPI FontFamilyEnumProc16( SEGPTR logfont, SEGPTR metrics, { HWND16 hwnd=LOWORD(lParam); HWND hDlg=GetParent(hwnd); - LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); LOGFONT16 *lplf = MapSL( logfont ); LOGFONTA lf32a; FONT_LogFont16To32A(lplf, &lf32a); @@ -555,10 +555,10 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTA *lplf) { #define FSTYLES 4 struct FONTSTYLE - { int italic; + { int italic; int weight; char stname[20]; }; - static struct FONTSTYLE fontstyles[FSTYLES]={ + static struct FONTSTYLE fontstyles[FSTYLES]={ { 0,FW_NORMAL,"Regular"},{0,FW_BOLD,"Bold"}, { 1,FW_NORMAL,"Italic"}, {1,FW_BOLD,"Bold Italic"}}; HFONT hf; @@ -585,9 +585,9 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTA *lplf) if (j==CB_ERR) return 1; j=SendMessageA(hwnd, CB_SETITEMDATA, j, MAKELONG(fontstyles[i].weight,fontstyles[i].italic)); - if (j==CB_ERR) return 1; + if (j==CB_ERR) return 1; } - } + } return 0; } @@ -606,14 +606,14 @@ static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTA lpcf) j=SendMessageA(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer); if (j==CB_ERR) { - j=SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer); - if (j!=CB_ERR) j = SendMessageA(hwnd, CB_SETITEMDATA, j, h); + j=SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer); + if (j!=CB_ERR) j = SendMessageA(hwnd, CB_SETITEMDATA, j, h); if (j==CB_ERR) return 1; } } return 0; -} - +} + /************************************************************************* * SetFontSizesToCombo3 [internal] */ @@ -630,11 +630,11 @@ static int SetFontSizesToCombo3(HWND hwnd, LPCHOOSEFONTA lpcf) /*********************************************************************** * AddFontStyle [internal] */ -static INT AddFontStyle(const LOGFONTA *lplf, UINT nFontType, +static INT AddFontStyle(const LOGFONTA *lplf, UINT nFontType, LPCHOOSEFONTA lpcf, HWND hcmb2, HWND hcmb3, HWND hDlg) { int i; - + TRACE("(nFontType=%d)\n",nFontType); TRACE(" %s h=%ld w=%ld e=%ld o=%ld wg=%ld i=%d u=%d s=%d" " ch=%d op=%d cp=%d q=%d pf=%xh\n", @@ -659,7 +659,7 @@ static INT AddFontStyle(const LOGFONTA *lplf, UINT nFontType, } return 1 ; -} +} /*********************************************************************** * FontStyleEnumProc (COMMDLG.18) @@ -670,7 +670,7 @@ INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics, HWND16 hcmb2=LOWORD(lParam); HWND16 hcmb3=HIWORD(lParam); HWND hDlg=GetParent(hcmb3); - LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); LOGFONT16 *lplf = MapSL(logfont); LOGFONTA lf32a; FONT_LogFont16To32A(lplf, &lf32a); @@ -681,7 +681,7 @@ INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics, /*********************************************************************** * FontStyleEnumProc32 [internal] */ -static INT WINAPI FontStyleEnumProc( const LOGFONTA *lpFont, +static INT WINAPI FontStyleEnumProc( const LOGFONTA *lpFont, const TEXTMETRICA *metrics, DWORD dwFontType, LPARAM lParam ) { LPCFn_ENUMSTRUCT s=(LPCFn_ENUMSTRUCT)lParam; @@ -704,14 +704,14 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam, LPLOGFONTA lpxx; HCURSOR hcursor=SetCursor(LoadCursorA(0,IDC_WAITA)); - SetWindowLongA(hDlg, DWL_USER, lParam); + SetWindowLongA(hDlg, DWL_USER, lParam); lpxx=lpcf->lpLogFont; TRACE("WM_INITDIALOG lParam=%08lX\n", lParam); if (lpcf->lStructSize != sizeof(CHOOSEFONTA)) { ERR("structure size failure !!!\n"); - EndDialog (hDlg, 0); + EndDialog (hDlg, 0); return FALSE; } if (!hBitmapTT) @@ -720,7 +720,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam, /* This font will be deleted by WM_COMMAND */ SendDlgItemMessageA(hDlg,stc6,WM_SETFONT, CreateFontA(0, 0, 1, 1, 400, 0, 0, 0, 0, 0, 0, 0, 0, NULL),FALSE); - + if (!(lpcf->Flags & CF_SHOWHELP) || !IsWindow(lpcf->hwndOwner)) ShowWindow(GetDlgItem(hDlg,pshHelp),SW_HIDE); if (!(lpcf->Flags & CF_APPLY)) @@ -791,7 +791,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam, if (l==SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0)) SendDlgItemMessageA(hDlg, cmb2, CB_SETCURSEL, i, 0); } - + /* look for fitting font size in combobox3 */ j=SendDlgItemMessageA(hDlg, cmb3, CB_GETCOUNT, 0, 0); for (i=0;iFlags & CF_USESTYLE && lpcf->lpszStyle) { j=SendDlgItemMessageA(hDlg,cmb2,CB_FINDSTRING,-1,(LONG)lpcf->lpszStyle); @@ -821,13 +821,13 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam, else { WARN("HDC failure !!!\n"); - EndDialog (hDlg, 0); + EndDialog (hDlg, 0); return FALSE; } if (!((lpcf->Flags & CF_PRINTERFONTS) && lpcf->hDC)) ReleaseDC(hDlg,hdc); - SetCursor(hcursor); + SetCursor(hcursor); return TRUE; } @@ -858,11 +858,11 @@ static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam) BITMAP bm; COLORREF cr, oldText=0, oldBk=0; RECT rect; -#if 0 +#if 0 HDC hMemDC; int nFontType; HBITMAP hBitmap; /* for later TT usage */ -#endif +#endif LPDRAWITEMSTRUCT lpdi = (LPDRAWITEMSTRUCT)lParam; if (lpdi->itemID == (UINT)-1) /* got no items */ @@ -891,7 +891,7 @@ static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam) { case cmb1: /* TRACE(commdlg,"WM_Drawitem cmb1\n"); */ SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID, - (LPARAM)buffer); + (LPARAM)buffer); GetObjectA( hBitmapTT, sizeof(bm), &bm ); TextOutA(lpdi->hDC, lpdi->rcItem.left + bm.bmWidth + 10, lpdi->rcItem.top, buffer, strlen(buffer)); @@ -976,7 +976,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, long l; HDC hdc; LPLOGFONTA lpxx=lpcf->lpLogFont; - + TRACE("WM_COMMAND wParam=%08lX lParam=%08lX\n", (LONG)wParam, lParam); switch (LOWORD(wParam)) { @@ -985,7 +985,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, hdc=((lpcf->Flags & CF_PRINTERFONTS) && lpcf->hDC) ? lpcf->hDC : GetDC(hDlg); if (hdc) { - SendDlgItemMessageA(hDlg, cmb2, CB_RESETCONTENT16, 0, 0); + SendDlgItemMessageA(hDlg, cmb2, CB_RESETCONTENT16, 0, 0); SendDlgItemMessageA(hDlg, cmb3, CB_RESETCONTENT16, 0, 0); i=SendDlgItemMessageA(hDlg, cmb1, CB_GETCURSEL16, 0, 0); if (i!=CB_ERR) @@ -1010,7 +1010,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, else { WARN("HDC failure !!!\n"); - EndDialog (hDlg, 0); + EndDialog (hDlg, 0); return TRUE; } } @@ -1063,7 +1063,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, hFont=CreateFontIndirectA(lpxx); if (hFont) { - HFONT oldFont=SendDlgItemMessageA(hDlg, stc6, + HFONT oldFont=SendDlgItemMessageA(hDlg, stc6, WM_GETFONT, 0, 0); SendDlgItemMessageA(hDlg,stc6,WM_SETFONT,hFont,TRUE); DeleteObject(oldFont); @@ -1078,7 +1078,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, InvalidateRect( GetDlgItem(hDlg,stc6), NULL, 0 ); } break; - + case psh15:i=RegisterWindowMessageA( HELPMSGSTRINGA ); if (lpcf->hwndOwner) SendMessageA(lpcf->hwndOwner, i, 0, (LPARAM)GetWindowLongA(hDlg, DWL_USER)); @@ -1087,8 +1087,8 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, break; case IDOK:if ( (!(lpcf->Flags & CF_LIMITSIZE)) || - ( (lpcf->Flags & CF_LIMITSIZE) && - (-lpxx->lfHeight >= lpcf->nSizeMin) && + ( (lpcf->Flags & CF_LIMITSIZE) && + (-lpxx->lfHeight >= lpcf->nSizeMin) && (-lpxx->lfHeight <= lpcf->nSizeMax))) EndDialog(hDlg, TRUE); else @@ -1097,7 +1097,7 @@ static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, sprintf(buffer,"Select a font size between %d and %d points.", lpcf->nSizeMin,lpcf->nSizeMax); MessageBoxA(hDlg, buffer, NULL, MB_OK); - } + } return(TRUE); case IDCANCEL:EndDialog(hDlg, FALSE); return(TRUE); @@ -1123,10 +1123,10 @@ LRESULT WINAPI FormatCharDlgProc16(HWND16 hDlg, UINT16 message, WPARAM16 wParam, { LPCHOOSEFONT16 lpcf; LPCHOOSEFONTA lpcf32a; - LRESULT res=0; + LRESULT res=0; if (message!=WM_INITDIALOG) { - lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); if (!lpcf) return FALSE; if (CFn_HookCallChk(lpcf)) @@ -1138,11 +1138,11 @@ LRESULT WINAPI FormatCharDlgProc16(HWND16 hDlg, UINT16 message, WPARAM16 wParam, { lpcf=(LPCHOOSEFONT16)lParam; lpcf32a=(LPCHOOSEFONTA)lpcf->lpTemplateName; - if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a)) + if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a)) { TRACE("CFn_WMInitDialog returned FALSE\n"); return FALSE; - } + } if (CFn_HookCallChk(lpcf)) return CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam); } @@ -1208,7 +1208,7 @@ LRESULT WINAPI FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LRESULT res=FALSE; if (uMsg!=WM_INITDIALOG) { - lpcf=(LPCHOOSEFONTA)GetWindowLongA(hDlg, DWL_USER); + lpcf=(LPCHOOSEFONTA)GetWindowLongA(hDlg, DWL_USER); if (!lpcf) return FALSE; if (CFn_HookCallChk32(lpcf)) @@ -1219,11 +1219,11 @@ LRESULT WINAPI FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, else { lpcf=(LPCHOOSEFONTA)lParam; - if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf)) + if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf)) { TRACE("CFn_WMInitDialog returned FALSE\n"); return FALSE; - } + } if (CFn_HookCallChk32(lpcf)) return CallWindowProcA((WNDPROC)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam); } @@ -1259,7 +1259,7 @@ LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, LRESULT res=FALSE; if (uMsg!=WM_INITDIALOG) { - lpcf32w=(LPCHOOSEFONTW)GetWindowLongA(hDlg, DWL_USER); + lpcf32w=(LPCHOOSEFONTW)GetWindowLongA(hDlg, DWL_USER); if (!lpcf32w) return FALSE; if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w)) @@ -1271,11 +1271,11 @@ LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, { lpcf32w=(LPCHOOSEFONTW)lParam; lpcf32a=(LPCHOOSEFONTA)lpcf32w->lpTemplateName; - if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a)) + if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a)) { TRACE("CFn_WMInitDialog returned FALSE\n"); return FALSE; - } + } if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w)) return CallWindowProcW((WNDPROC)lpcf32w->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam); } @@ -1292,7 +1292,7 @@ LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, return CFn_WMCommand(hDlg, wParam, lParam, lpcf32a); case WM_DESTROY: return CFn_WMDestroy(hDlg, wParam, lParam); - case WM_CHOOSEFONT_GETLOGFONT: + case WM_CHOOSEFONT_GETLOGFONT: TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n", lParam); FIXME("current logfont back to caller\n"); diff --git a/dlls/commdlg/printdlg.c b/dlls/commdlg/printdlg.c index e5b79684eb2..3cc04726c99 100644 --- a/dlls/commdlg/printdlg.c +++ b/dlls/commdlg/printdlg.c @@ -43,9 +43,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); /* This PRINTDLGA internal structure stores * pointers to several throughout useful structures. - * + * */ -typedef struct +typedef struct { LPDEVMODEA lpDevMode; struct { @@ -62,7 +62,7 @@ typedef struct HWND hwndUpDown; } PRINT_PTRA; -typedef struct +typedef struct { LPDEVMODEW lpDevMode; struct { @@ -137,7 +137,7 @@ static struct pd_flags psd_flags[] = { * PRINTDLG_GetDefaultPrinterName * * Returns the default printer name in buf. - * Even under WinNT/2000 default printer is retrieved via GetProfileString - + * Even under WinNT/2000 default printer is retrieved via GetProfileString - * these entries are mapped somewhere in the registry rather than win.ini. * * Returns TRUE on success else FALSE @@ -219,7 +219,7 @@ static INT PRINTDLG_SetUpPrinterListComboA(HWND hDlg, UINT id, LPCSTR name) LPPRINTER_INFO_2A pi; EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &needed, &num); pi = HeapAlloc(GetProcessHeap(), 0, needed); - EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pi, needed, &needed, + EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pi, needed, &needed, &num); for(i = 0; i < num; i++) { @@ -251,7 +251,7 @@ static INT PRINTDLG_SetUpPrinterListComboW(HWND hDlg, UINT id, LPCWSTR name) LPPRINTER_INFO_2W pi; EnumPrintersW(PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &needed, &num); pi = HeapAlloc(GetProcessHeap(), 0, needed); - EnumPrintersW(PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pi, needed, &needed, + EnumPrintersW(PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pi, needed, &needed, &num); for(i = 0; i < num; i++) { @@ -285,7 +285,7 @@ static INT PRINTDLG_SetUpPrinterListComboW(HWND hDlg, UINT id, LPCWSTR name) * * (NB. when we handle unicode the offsets will be in wchars). */ -static BOOL PRINTDLG_CreateDevNames(HGLOBAL *hmem, char* DeviceDriverName, +static BOOL PRINTDLG_CreateDevNames(HGLOBAL *hmem, char* DeviceDriverName, char* DeviceName, char* OutputPort) { long size; @@ -298,7 +298,7 @@ static BOOL PRINTDLG_CreateDevNames(HGLOBAL *hmem, char* DeviceDriverName, + strlen(DeviceName) + 1 + strlen(OutputPort) + 1 + sizeof(DEVNAMES); - + if(*hmem) *hmem = GlobalReAlloc(*hmem, size, GMEM_MOVEABLE); else @@ -316,7 +316,7 @@ static BOOL PRINTDLG_CreateDevNames(HGLOBAL *hmem, char* DeviceDriverName, pTempPtr += strlen(DeviceDriverName) + 1; strcpy(pTempPtr, DeviceName); lpDevNames->wDeviceOffset = pTempPtr - pDevNamesSpace; - + pTempPtr += strlen(DeviceName) + 1; strcpy(pTempPtr, OutputPort); lpDevNames->wOutputOffset = pTempPtr - pDevNamesSpace; @@ -327,7 +327,7 @@ static BOOL PRINTDLG_CreateDevNames(HGLOBAL *hmem, char* DeviceDriverName, return TRUE; } -static BOOL PRINTDLG_CreateDevNamesW(HGLOBAL *hmem, LPCWSTR DeviceDriverName, +static BOOL PRINTDLG_CreateDevNamesW(HGLOBAL *hmem, LPCWSTR DeviceDriverName, LPCWSTR DeviceName, LPCWSTR OutputPort) { long size; @@ -341,7 +341,7 @@ static BOOL PRINTDLG_CreateDevNamesW(HGLOBAL *hmem, LPCWSTR DeviceDriverName, + sizeof(WCHAR)*lstrlenW(DeviceName) + 2 + sizeof(WCHAR)*lstrlenW(OutputPort) + 2 + sizeof(DEVNAMES); - + if(*hmem) *hmem = GlobalReAlloc(*hmem, size, GMEM_MOVEABLE); else @@ -359,7 +359,7 @@ static BOOL PRINTDLG_CreateDevNamesW(HGLOBAL *hmem, LPCWSTR DeviceDriverName, pTempPtr += lstrlenW(DeviceDriverName) + 1; lstrcpyW(pTempPtr, DeviceName); lpDevNames->wDeviceOffset = pTempPtr - pDevNamesSpace; - + pTempPtr += lstrlenW(DeviceName) + 1; lstrcpyW(pTempPtr, OutputPort); lpDevNames->wOutputOffset = pTempPtr - pDevNamesSpace; @@ -372,7 +372,7 @@ static BOOL PRINTDLG_CreateDevNamesW(HGLOBAL *hmem, LPCWSTR DeviceDriverName, } -static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, char* DeviceDriverName, +static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, char* DeviceDriverName, char* DeviceName, char* OutputPort) { long size; @@ -385,7 +385,7 @@ static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, char* DeviceDriverName, + strlen(DeviceName) + 1 + strlen(OutputPort) + 1 + sizeof(DEVNAMES); - + if(*hmem) *hmem = GlobalReAlloc16(*hmem, size, GMEM_MOVEABLE); else @@ -403,7 +403,7 @@ static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, char* DeviceDriverName, pTempPtr += strlen(DeviceDriverName) + 1; strcpy(pTempPtr, DeviceName); lpDevNames->wDeviceOffset = pTempPtr - pDevNamesSpace; - + pTempPtr += strlen(DeviceName) + 1; strcpy(pTempPtr, OutputPort); lpDevNames->wOutputOffset = pTempPtr - pDevNamesSpace; @@ -420,12 +420,12 @@ static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, char* DeviceDriverName, * * * updates the PrintDlg structure for returnvalues. - * + * * RETURNS * FALSE if user is not allowed to close (i.e. wrong nTo or nFrom values) * TRUE if succesful. */ -static BOOL PRINTDLG_UpdatePrintDlgA(HWND hDlg, +static BOOL PRINTDLG_UpdatePrintDlgA(HWND hDlg, PRINT_PTRA* PrintStructures) { LPPRINTDLGA lppd = PrintStructures->dlg.lpPrintDlg; @@ -452,10 +452,10 @@ static BOOL PRINTDLG_UpdatePrintDlgA(HWND hDlg, nToPage < lppd->nMinPage || nToPage > lppd->nMaxPage) { char resourcestr[256]; char resultstr[256]; - LoadStringA(COMDLG32_hInstance, PD32_INVALID_PAGE_RANGE, + LoadStringA(COMDLG32_hInstance, PD32_INVALID_PAGE_RANGE, resourcestr, 255); sprintf(resultstr,resourcestr, lppd->nMinPage, lppd->nMaxPage); - LoadStringA(COMDLG32_hInstance, PD32_PRINT_TITLE, + LoadStringA(COMDLG32_hInstance, PD32_PRINT_TITLE, resourcestr, 255); MessageBoxA(hDlg, resultstr, resourcestr, MB_OK | MB_ICONWARNING); @@ -484,7 +484,7 @@ static BOOL PRINTDLG_UpdatePrintDlgA(HWND hDlg, * otherwise no collate & multiple copies ! */ if (lpdm->dmFields & DM_COLLATE) - lpdm->dmCollate = + lpdm->dmCollate = (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED); if (lpdm->dmFields & DM_COPIES) lpdm->dmCopies = GetDlgItemInt(hDlg, edt3, NULL, FALSE); @@ -499,7 +499,7 @@ static BOOL PRINTDLG_UpdatePrintDlgA(HWND hDlg, return TRUE; } -static BOOL PRINTDLG_UpdatePrintDlgW(HWND hDlg, +static BOOL PRINTDLG_UpdatePrintDlgW(HWND hDlg, PRINT_PTRW* PrintStructures) { LPPRINTDLGW lppd = PrintStructures->dlg.lpPrintDlg; @@ -526,10 +526,10 @@ static BOOL PRINTDLG_UpdatePrintDlgW(HWND hDlg, nToPage < lppd->nMinPage || nToPage > lppd->nMaxPage) { char resourcestr[256]; char resultstr[256]; - LoadStringA(COMDLG32_hInstance, PD32_INVALID_PAGE_RANGE, + LoadStringA(COMDLG32_hInstance, PD32_INVALID_PAGE_RANGE, resourcestr, 255); sprintf(resultstr,resourcestr, lppd->nMinPage, lppd->nMaxPage); - LoadStringA(COMDLG32_hInstance, PD32_PRINT_TITLE, + LoadStringA(COMDLG32_hInstance, PD32_PRINT_TITLE, resourcestr, 255); MessageBoxA(hDlg, resultstr, resourcestr, MB_OK | MB_ICONWARNING); @@ -559,7 +559,7 @@ static BOOL PRINTDLG_UpdatePrintDlgW(HWND hDlg, * otherwise no collate & multiple copies ! */ if (lpdm->dmFields & DM_COLLATE) - lpdm->dmCollate = + lpdm->dmCollate = (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED); if (lpdm->dmFields & DM_COPIES) lpdm->dmCopies = GetDlgItemInt(hDlg, edt3, NULL, FALSE); @@ -585,7 +585,7 @@ static BOOL PRINTDLG_PaperSizeA( char *Names = NULL; POINT *points = NULL; BOOL retval = FALSE; - + dn = GlobalLock(pdlga->hDevNames); dm = GlobalLock(pdlga->hDevMode); devname = ((char*)dn)+dn->wDeviceOffset; @@ -601,7 +601,7 @@ static BOOL PRINTDLG_PaperSizeA( ERR("Hmm ? DeviceCapabilities() DC_PAPERNAMES failed, ret -1 !\n"); goto out; } - + Names = (char*)HeapAlloc(GetProcessHeap(),0,NrOfEntries*64); if (NrOfEntries != (ret=DeviceCapabilitiesA(devname,portname,DC_PAPERNAMES,Names,dm))) { FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret); @@ -643,7 +643,7 @@ static BOOL PRINTDLG_PaperSizeW( WCHAR *Names = NULL; POINT *points = NULL; BOOL retval = FALSE; - + dn = GlobalLock(pdlga->hDevNames); dm = GlobalLock(pdlga->hDevMode); devname = ((WCHAR*)dn)+dn->wDeviceOffset; @@ -659,7 +659,7 @@ static BOOL PRINTDLG_PaperSizeW( ERR("Hmm ? DeviceCapabilities() DC_PAPERNAMES failed, ret -1 !\n"); goto out; } - + Names = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*NrOfEntries*64); if (NrOfEntries != (ret=DeviceCapabilitiesW(devname,portname,DC_PAPERNAMES,Names,dm))) { FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret); @@ -700,7 +700,7 @@ out: */ static BOOL PRINTDLG_SetUpPaperComboBoxA(HWND hDlg, int nIDComboBox, - char* PrinterName, + char* PrinterName, char* PortName, LPDEVMODEA dm) { @@ -713,9 +713,9 @@ static BOOL PRINTDLG_SetUpPaperComboBoxA(HWND hDlg, int NamesSize; int fwCapability_Names; int fwCapability_Words; - + TRACE(" Printer: %s, Port: %s, ComboID: %d\n",PrinterName,PortName,nIDComboBox); - + /* query the dialog box for the current selected value */ Sel = SendDlgItemMessageA(hDlg, nIDComboBox, CB_GETCURSEL, 0, 0); if(Sel != CB_ERR) { @@ -755,8 +755,8 @@ static BOOL PRINTDLG_SetUpPaperComboBoxA(HWND hDlg, fwCapability_Names = DC_BINNAMES; fwCapability_Words = DC_BINS; } - - /* for some printer drivers, DeviceCapabilities calls a VXD to obtain the + + /* for some printer drivers, DeviceCapabilities calls a VXD to obtain the * paper settings. As Wine doesn't allow VXDs, this results in a crash. */ WARN(" if your printer driver uses VXDs, expect a crash now!\n"); @@ -782,12 +782,12 @@ static BOOL PRINTDLG_SetUpPaperComboBoxA(HWND hDlg, /* reset any current content in the combobox */ SendDlgItemMessageA(hDlg, nIDComboBox, CB_RESETCONTENT, 0, 0); - + /* store new content */ for (i = 0; i < NrOfEntries; i++) { DWORD pos = SendDlgItemMessageA(hDlg, nIDComboBox, CB_ADDSTRING, 0, (LPARAM)(&Names[i*NamesSize]) ); - SendDlgItemMessageA(hDlg, nIDComboBox, CB_SETITEMDATA, pos, + SendDlgItemMessageA(hDlg, nIDComboBox, CB_SETITEMDATA, pos, Words[i]); } @@ -810,7 +810,7 @@ static BOOL PRINTDLG_SetUpPaperComboBoxA(HWND hDlg, static BOOL PRINTDLG_SetUpPaperComboBoxW(HWND hDlg, int nIDComboBox, - WCHAR* PrinterName, + WCHAR* PrinterName, WCHAR* PortName, LPDEVMODEW dm) { @@ -823,9 +823,9 @@ static BOOL PRINTDLG_SetUpPaperComboBoxW(HWND hDlg, int NamesSize; int fwCapability_Names; int fwCapability_Words; - + TRACE(" Printer: %s, Port: %s, ComboID: %d\n",debugstr_w(PrinterName),debugstr_w(PortName),nIDComboBox); - + /* query the dialog box for the current selected value */ Sel = SendDlgItemMessageA(hDlg, nIDComboBox, CB_GETCURSEL, 0, 0); if(Sel != CB_ERR) { @@ -865,8 +865,8 @@ static BOOL PRINTDLG_SetUpPaperComboBoxW(HWND hDlg, fwCapability_Names = DC_BINNAMES; fwCapability_Words = DC_BINS; } - - /* for some printer drivers, DeviceCapabilities calls a VXD to obtain the + + /* for some printer drivers, DeviceCapabilities calls a VXD to obtain the * paper settings. As Wine doesn't allow VXDs, this results in a crash. */ WARN(" if your printer driver uses VXDs, expect a crash now!\n"); @@ -892,12 +892,12 @@ static BOOL PRINTDLG_SetUpPaperComboBoxW(HWND hDlg, /* reset any current content in the combobox */ SendDlgItemMessageA(hDlg, nIDComboBox, CB_RESETCONTENT, 0, 0); - + /* store new content */ for (i = 0; i < NrOfEntries; i++) { DWORD pos = SendDlgItemMessageW(hDlg, nIDComboBox, CB_ADDSTRING, 0, (LPARAM)(&Names[i*NamesSize]) ); - SendDlgItemMessageW(hDlg, nIDComboBox, CB_SETITEMDATA, pos, + SendDlgItemMessageW(hDlg, nIDComboBox, CB_SETITEMDATA, pos, Words[i]); } @@ -934,18 +934,18 @@ static void PRINTDLG_UpdatePrinterInfoTextsA(HWND hDlg, LPPRINTER_INFO_2A pi) /* add all status messages */ for (i = 0; i < 25; i++) { if (pi->Status & (1<Status & (1<nMaxPage - lppd->nMinPage + 1); SendDlgItemMessageA(hDlg, rad1, WM_SETTEXT, 0, (LPARAM) result); } - - /* Collate pages + + /* Collate pages * * FIXME: The ico3 is not displayed for some reason. I don't know why. */ if (lppd->Flags & PD_COLLATE) { - SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, + SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)PrintStructures->hCollateIcon); CheckDlgButton(hDlg, chx2, 1); } else { - SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, + SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)PrintStructures->hNoCollateIcon); CheckDlgButton(hDlg, chx2, 0); } @@ -1106,8 +1106,8 @@ static BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name, if (lppd->Flags & PD_USEDEVMODECOPIESANDCOLLATE) { /* if printer doesn't support it: no Collate */ if (!(lpdm->dmFields & DM_COLLATE)) { - EnableWindow(GetDlgItem(hDlg, chx2), FALSE); - EnableWindow(GetDlgItem(hDlg, ico3), FALSE); + EnableWindow(GetDlgItem(hDlg, chx2), FALSE); + EnableWindow(GetDlgItem(hDlg, ico3), FALSE); } } @@ -1126,15 +1126,15 @@ static BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name, if (lppd->Flags & PD_USEDEVMODECOPIESANDCOLLATE) { /* if printer doesn't support it: no nCopies */ if (!(lpdm->dmFields & DM_COPIES)) { - EnableWindow(GetDlgItem(hDlg, edt3), FALSE); - EnableWindow(GetDlgItem(hDlg, stc5), FALSE); + EnableWindow(GetDlgItem(hDlg, edt3), FALSE); + EnableWindow(GetDlgItem(hDlg, stc5), FALSE); } } /* print to file */ CheckDlgButton(hDlg, chx1, (lppd->Flags & PD_PRINTTOFILE) ? 1 : 0); if (lppd->Flags & PD_DISABLEPRINTTOFILE) - EnableWindow(GetDlgItem(hDlg, chx1), FALSE); + EnableWindow(GetDlgItem(hDlg, chx1), FALSE); if (lppd->Flags & PD_HIDEPRINTTOFILE) ShowWindow(GetDlgItem(hDlg, chx1), SW_HIDE); @@ -1153,13 +1153,13 @@ static BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name, SendDlgItemMessageA(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)(bPortrait ? PrintStructures->hPortraitIcon : PrintStructures->hLandscapeIcon)); - + } /* help button */ if ((lppd->Flags & PD_SHOWHELP)==0) { /* hide if PD_SHOWHELP not specified */ - ShowWindow(GetDlgItem(hDlg, pshHelp), SW_HIDE); + ShowWindow(GetDlgItem(hDlg, pshHelp), SW_HIDE); } return TRUE; } @@ -1246,22 +1246,22 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name, /* ansi is ok */ char resourcestr[64]; char result[64]; - LoadStringA(COMDLG32_hInstance, PD32_PRINT_ALL_X_PAGES, + LoadStringA(COMDLG32_hInstance, PD32_PRINT_ALL_X_PAGES, resourcestr, 49); sprintf(result,resourcestr,lppd->nMaxPage - lppd->nMinPage + 1); SendDlgItemMessageA(hDlg, rad1, WM_SETTEXT, 0, (LPARAM) result); } - - /* Collate pages + + /* Collate pages * * FIXME: The ico3 is not displayed for some reason. I don't know why. */ if (lppd->Flags & PD_COLLATE) { - SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, + SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)PrintStructures->hCollateIcon); CheckDlgButton(hDlg, chx2, 1); } else { - SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, + SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)PrintStructures->hNoCollateIcon); CheckDlgButton(hDlg, chx2, 0); } @@ -1269,8 +1269,8 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name, if (lppd->Flags & PD_USEDEVMODECOPIESANDCOLLATE) { /* if printer doesn't support it: no Collate */ if (!(lpdm->dmFields & DM_COLLATE)) { - EnableWindow(GetDlgItem(hDlg, chx2), FALSE); - EnableWindow(GetDlgItem(hDlg, ico3), FALSE); + EnableWindow(GetDlgItem(hDlg, chx2), FALSE); + EnableWindow(GetDlgItem(hDlg, ico3), FALSE); } } @@ -1289,15 +1289,15 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name, if (lppd->Flags & PD_USEDEVMODECOPIESANDCOLLATE) { /* if printer doesn't support it: no nCopies */ if (!(lpdm->dmFields & DM_COPIES)) { - EnableWindow(GetDlgItem(hDlg, edt3), FALSE); - EnableWindow(GetDlgItem(hDlg, stc5), FALSE); + EnableWindow(GetDlgItem(hDlg, edt3), FALSE); + EnableWindow(GetDlgItem(hDlg, stc5), FALSE); } } /* print to file */ CheckDlgButton(hDlg, chx1, (lppd->Flags & PD_PRINTTOFILE) ? 1 : 0); if (lppd->Flags & PD_DISABLEPRINTTOFILE) - EnableWindow(GetDlgItem(hDlg, chx1), FALSE); + EnableWindow(GetDlgItem(hDlg, chx1), FALSE); if (lppd->Flags & PD_HIDEPRINTTOFILE) ShowWindow(GetDlgItem(hDlg, chx1), SW_HIDE); @@ -1316,13 +1316,13 @@ static BOOL PRINTDLG_ChangePrinterW(HWND hDlg, WCHAR *name, SendDlgItemMessageA(hDlg, ico1, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)(bPortrait ? PrintStructures->hPortraitIcon : PrintStructures->hLandscapeIcon)); - + } /* help button */ if ((lppd->Flags & PD_SHOWHELP)==0) { /* hide if PD_SHOWHELP not specified */ - ShowWindow(GetDlgItem(hDlg, pshHelp), SW_HIDE); + ShowWindow(GetDlgItem(hDlg, pshHelp), SW_HIDE); } return TRUE; } @@ -1344,7 +1344,7 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg, WPARAM wParam, size and we don't want them rescaled */ PrintStructures->hCollateIcon = LoadImageA(COMDLG32_hInstance, "PD32_COLLATE", IMAGE_ICON, 0, 0, 0); - PrintStructures->hNoCollateIcon = + PrintStructures->hNoCollateIcon = LoadImageA(COMDLG32_hInstance, "PD32_NOCOLLATE", IMAGE_ICON, 0, 0, 0); /* These can be done with LoadIcon */ @@ -1367,7 +1367,7 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg, WPARAM wParam, * must be registered and the Help button must be shown. */ if (lppd->Flags & PD_SHOWHELP) { - if((PrintStructures->HelpMessageID = + if((PrintStructures->HelpMessageID = RegisterWindowMessageA(HELPMSGSTRINGA)) == 0) { COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL); return FALSE; @@ -1390,8 +1390,8 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg, WPARAM wParam, */ if (lppd->nMaxPage < lppd->nMinPage) lppd->nMaxPage = lppd->nMinPage; - if (lppd->nMinPage == lppd->nMaxPage) - lppd->Flags |= PD_NOPAGENUMS; + if (lppd->nMinPage == lppd->nMaxPage) + lppd->Flags |= PD_NOPAGENUMS; if (lppd->nToPage < lppd->nMinPage) lppd->nToPage = lppd->nMinPage; if (lppd->nToPage > lppd->nMaxPage) @@ -1403,7 +1403,7 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg, WPARAM wParam, /* if we have the combo box, fill it */ if (GetDlgItem(hDlg,comboID)) { - /* Fill Combobox + /* Fill Combobox */ pdn = GlobalLock(lppd->hDevNames); pdm = GlobalLock(lppd->hDevMode); @@ -1447,7 +1447,7 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, WPARAM wParam, size and we don't want them rescaled */ PrintStructures->hCollateIcon = LoadImageA(COMDLG32_hInstance, "PD32_COLLATE", IMAGE_ICON, 0, 0, 0); - PrintStructures->hNoCollateIcon = + PrintStructures->hNoCollateIcon = LoadImageA(COMDLG32_hInstance, "PD32_NOCOLLATE", IMAGE_ICON, 0, 0, 0); /* These can be done with LoadIcon */ @@ -1470,7 +1470,7 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, WPARAM wParam, * must be registered and the Help button must be shown. */ if (lppd->Flags & PD_SHOWHELP) { - if((PrintStructures->HelpMessageID = + if((PrintStructures->HelpMessageID = RegisterWindowMessageA(HELPMSGSTRINGA)) == 0) { COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL); return FALSE; @@ -1493,8 +1493,8 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, WPARAM wParam, */ if (lppd->nMaxPage < lppd->nMinPage) lppd->nMaxPage = lppd->nMinPage; - if (lppd->nMinPage == lppd->nMaxPage) - lppd->Flags |= PD_NOPAGENUMS; + if (lppd->nMinPage == lppd->nMaxPage) + lppd->Flags |= PD_NOPAGENUMS; if (lppd->nToPage < lppd->nMinPage) lppd->nToPage = lppd->nMinPage; if (lppd->nToPage > lppd->nMaxPage) @@ -1506,7 +1506,7 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, WPARAM wParam, /* if we have the combo box, fill it */ if (GetDlgItem(hDlg,comboID)) { - /* Fill Combobox + /* Fill Combobox */ pdn = GlobalLock(lppd->hDevNames); pdm = GlobalLock(lppd->hDevMode); @@ -1553,7 +1553,7 @@ static LRESULT PRINTDLG_WMInitDialog16(HWND hDlg, WPARAM wParam, /* load Collate ICONs */ PrintStructures->hCollateIcon = LoadIconA(COMDLG32_hInstance, "PD32_COLLATE"); - PrintStructures->hNoCollateIcon = + PrintStructures->hNoCollateIcon = LoadIconA(COMDLG32_hInstance, "PD32_NOCOLLATE"); if(PrintStructures->hCollateIcon == 0 || PrintStructures->hNoCollateIcon == 0) { @@ -1570,7 +1570,7 @@ static LRESULT PRINTDLG_WMInitDialog16(HWND hDlg, WPARAM wParam, * must be registered and the Help button must be shown. */ if (lppd->Flags & PD_SHOWHELP) { - if((PrintStructures->HelpMessageID = + if((PrintStructures->HelpMessageID = RegisterWindowMessageA(HELPMSGSTRINGA)) == 0) { COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL); return FALSE; @@ -1596,7 +1596,7 @@ static LRESULT PRINTDLG_WMInitDialog16(HWND hDlg, WPARAM wParam, default : sprintf(buf,"%ddpi",pdm->dmPrintQuality);break; } GlobalUnlock16(lppd->hDevMode); - } else + } else strcpy(buf,"Default"); SendDlgItemMessageA(hDlg,cmb1,CB_ADDSTRING,0,(LPARAM)buf); SendDlgItemMessageA(hDlg,cmb1,CB_SETCURSEL,0,0); @@ -1610,8 +1610,8 @@ static LRESULT PRINTDLG_WMInitDialog16(HWND hDlg, WPARAM wParam, */ if (lppd->nMaxPage < lppd->nMinPage) lppd->nMaxPage = lppd->nMinPage; - if (lppd->nMinPage == lppd->nMaxPage) - lppd->Flags |= PD_NOPAGENUMS; + if (lppd->nMinPage == lppd->nMaxPage) + lppd->Flags |= PD_NOPAGENUMS; if (lppd->nToPage < lppd->nMinPage) lppd->nToPage = lppd->nMinPage; if (lppd->nToPage > lppd->nMaxPage) @@ -1623,7 +1623,7 @@ static LRESULT PRINTDLG_WMInitDialog16(HWND hDlg, WPARAM wParam, /* If the printer combo box is in the dialog, fill it */ if (GetDlgItem(hDlg,comboID)) { - /* Fill Combobox + /* Fill Combobox */ pdn = GlobalLock16(lppd->hDevNames); pdm = GlobalLock16(lppd->hDevMode); @@ -1657,7 +1657,7 @@ static LRESULT PRINTDLG_WMInitDialog16(HWND hDlg, WPARAM wParam, /*********************************************************************** * PRINTDLG_WMCommand [internal] */ -static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, +static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, LPARAM lParam, PRINT_PTRA* PrintStructures) { LPPRINTDLGA lppd = PrintStructures->dlg.lpPrintDlg; @@ -1681,18 +1681,18 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, case pshHelp: TRACE(" HELP button was hit\n"); - SendMessageA(lppd->hwndOwner, PrintStructures->HelpMessageID, + SendMessageA(lppd->hwndOwner, PrintStructures->HelpMessageID, (WPARAM) hDlg, (LPARAM) lppd); break; case chx2: /* collate pages checkbox */ if (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED) - SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, + SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)PrintStructures->hCollateIcon); else - SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, + SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)PrintStructures->hNoCollateIcon); - break; + break; case edt1: /* from page nr editbox */ case edt2: /* to page nr editbox */ if (HIWORD(wParam)==EN_CHANGE) { @@ -1718,7 +1718,7 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, case psh1: /* Print Setup */ { PRINTDLG16 pdlg; - + if (!PrintStructures->dlg.lpPrintDlg16) { FIXME("The 32bit print dialog does not have this button!?\n"); break; @@ -1741,7 +1741,7 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, FIXME(" Call to OpenPrinter did not succeed!\n"); break; } - DocumentPropertiesA(hDlg, hPrinter, PrinterName, + DocumentPropertiesA(hDlg, hPrinter, PrinterName, PrintStructures->lpDevMode, PrintStructures->lpDevMode, DM_IN_BUFFER | DM_OUT_BUFFER | DM_IN_PROMPT); @@ -1757,7 +1757,7 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, (LPARAM)(PrintStructures->hPortraitIcon)); } break; - + case rad2: /* Paperorientation */ if (lppd->Flags & PD_PRINTSETUP) { @@ -1766,7 +1766,7 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, (LPARAM)(PrintStructures->hLandscapeIcon)); } break; - + case cmb1: /* Printer Combobox in PRINT SETUP, quality combobox in PRINT */ if (PrinterComboID != wParam) { FIXME("No handling for print quality combo box yet.\n"); @@ -1799,7 +1799,7 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, CB_GETITEMDATA, Sel, 0); } - break; + break; } if(lppd->Flags & PD_PRINTSETUP) { switch (LOWORD(wParam)) { @@ -1830,9 +1830,9 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, } } return FALSE; -} +} -static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, +static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, LPARAM lParam, PRINT_PTRW* PrintStructures) { LPPRINTDLGW lppd = PrintStructures->dlg.lpPrintDlg; @@ -1856,18 +1856,18 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, case pshHelp: TRACE(" HELP button was hit\n"); - SendMessageW(lppd->hwndOwner, PrintStructures->HelpMessageID, + SendMessageW(lppd->hwndOwner, PrintStructures->HelpMessageID, (WPARAM) hDlg, (LPARAM) lppd); break; case chx2: /* collate pages checkbox */ if (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED) - SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, + SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)PrintStructures->hCollateIcon); else - SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, + SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)PrintStructures->hNoCollateIcon); - break; + break; case edt1: /* from page nr editbox */ case edt2: /* to page nr editbox */ if (HIWORD(wParam)==EN_CHANGE) { @@ -1905,7 +1905,7 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, FIXME(" Call to OpenPrinter did not succeed!\n"); break; } - DocumentPropertiesW(hDlg, hPrinter, PrinterName, + DocumentPropertiesW(hDlg, hPrinter, PrinterName, PrintStructures->lpDevMode, PrintStructures->lpDevMode, DM_IN_BUFFER | DM_OUT_BUFFER | DM_IN_PROMPT); @@ -1921,7 +1921,7 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, (LPARAM)(PrintStructures->hPortraitIcon)); } break; - + case rad2: /* Paperorientation */ if (lppd->Flags & PD_PRINTSETUP) { @@ -1930,7 +1930,7 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, (LPARAM)(PrintStructures->hLandscapeIcon)); } break; - + case cmb1: /* Printer Combobox in PRINT SETUP, quality combobox in PRINT */ if (PrinterComboID != wParam) { FIXME("No handling for print quality combo box yet.\n"); @@ -1963,7 +1963,7 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, CB_GETITEMDATA, Sel, 0); } - break; + break; } if(lppd->Flags & PD_PRINTSETUP) { switch (LOWORD(wParam)) { @@ -1994,7 +1994,7 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, } } return FALSE; -} +} /*********************************************************************** * PrintDlgProcA [internal] @@ -2006,21 +2006,21 @@ BOOL WINAPI PrintDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LRESULT res=FALSE; if (uMsg!=WM_INITDIALOG) { - PrintStructures = (PRINT_PTRA*) GetWindowLongA(hDlg, DWL_USER); + PrintStructures = (PRINT_PTRA*) GetWindowLongA(hDlg, DWL_USER); if (!PrintStructures) return FALSE; } else { PrintStructures = (PRINT_PTRA*) lParam; - SetWindowLongA(hDlg, DWL_USER, lParam); + SetWindowLongA(hDlg, DWL_USER, lParam); res = PRINTDLG_WMInitDialog(hDlg, wParam, PrintStructures); if(PrintStructures->dlg.lpPrintDlg->Flags & PD_ENABLEPRINTHOOK) res = PrintStructures->dlg.lpPrintDlg->lpfnPrintHook( hDlg, uMsg, wParam, (LPARAM)PrintStructures->dlg.lpPrintDlg - ); + ); return res; } - + if(PrintStructures->dlg.lpPrintDlg->Flags & PD_ENABLEPRINTHOOK) { res = PrintStructures->dlg.lpPrintDlg->lpfnPrintHook(hDlg,uMsg,wParam, lParam); @@ -2039,7 +2039,7 @@ BOOL WINAPI PrintDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, if(PrintStructures->hwndUpDown) DestroyWindow(PrintStructures->hwndUpDown); return FALSE; - } + } return res; } @@ -2050,21 +2050,21 @@ BOOL WINAPI PrintDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, LRESULT res=FALSE; if (uMsg!=WM_INITDIALOG) { - PrintStructures = (PRINT_PTRW*) GetWindowLongA(hDlg, DWL_USER); + PrintStructures = (PRINT_PTRW*) GetWindowLongA(hDlg, DWL_USER); if (!PrintStructures) return FALSE; } else { PrintStructures = (PRINT_PTRW*) lParam; - SetWindowLongA(hDlg, DWL_USER, lParam); + SetWindowLongA(hDlg, DWL_USER, lParam); res = PRINTDLG_WMInitDialogW(hDlg, wParam, PrintStructures); if(PrintStructures->dlg.lpPrintDlg->Flags & PD_ENABLEPRINTHOOK) res = PrintStructures->dlg.lpPrintDlg->lpfnPrintHook( hDlg, uMsg, wParam, (LPARAM)PrintStructures->dlg.lpPrintDlg - ); + ); return res; } - + if(PrintStructures->dlg.lpPrintDlg->Flags & PD_ENABLEPRINTHOOK) { res = PrintStructures->dlg.lpPrintDlg->lpfnPrintHook(hDlg,uMsg,wParam, lParam); @@ -2083,7 +2083,7 @@ BOOL WINAPI PrintDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, if(PrintStructures->hwndUpDown) DestroyWindow(PrintStructures->hwndUpDown); return FALSE; - } + } return res; } @@ -2101,7 +2101,7 @@ static HGLOBAL16 PRINTDLG_Get16TemplateFrom32(char *PrintResourceName) DWORD size; HGLOBAL16 hGlobal16; LPVOID template; - + if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, PrintResourceName, RT_DIALOGA))) { @@ -2147,7 +2147,7 @@ static HGLOBAL PRINTDLG_GetDlgTemplateA(PRINTDLGA *lppd) if (lppd->Flags & PD_PRINTSETUP) { if(lppd->Flags & PD_ENABLESETUPTEMPLATEHANDLE) { hDlgTmpl = lppd->hSetupTemplate; - } else if(lppd->Flags & PD_ENABLESETUPTEMPLATE) { + } else if(lppd->Flags & PD_ENABLESETUPTEMPLATE) { hResInfo = FindResourceA(lppd->hInstance, lppd->lpSetupTemplateName, RT_DIALOGA); hDlgTmpl = LoadResource(lppd->hInstance, hResInfo); @@ -2182,7 +2182,7 @@ static HGLOBAL PRINTDLG_GetDlgTemplateW(PRINTDLGW *lppd) if (lppd->Flags & PD_PRINTSETUP) { if(lppd->Flags & PD_ENABLESETUPTEMPLATEHANDLE) { hDlgTmpl = lppd->hSetupTemplate; - } else if(lppd->Flags & PD_ENABLESETUPTEMPLATE) { + } else if(lppd->Flags & PD_ENABLESETUPTEMPLATE) { hResInfo = FindResourceW(lppd->hInstance, lppd->lpSetupTemplateName, RT_DIALOGW); hDlgTmpl = LoadResource(lppd->hInstance, hResInfo); @@ -2220,7 +2220,7 @@ static HGLOBAL16 PRINTDLG_GetDlgTemplate16(PRINTDLG16 *lppd) if (lppd->Flags & PD_PRINTSETUP) { if(lppd->Flags & PD_ENABLESETUPTEMPLATEHANDLE) { hDlgTmpl = lppd->hSetupTemplate; - } else if(lppd->Flags & PD_ENABLESETUPTEMPLATE) { + } else if(lppd->Flags & PD_ENABLESETUPTEMPLATE) { hResInfo = FindResource16(lppd->hInstance, MapSL(lppd->lpSetupTemplateName), RT_DIALOGA); hDlgTmpl = LoadResource16(lppd->hInstance, hResInfo); @@ -2327,7 +2327,7 @@ static BOOL PRINTDLG_CreateDC16(LPPRINTDLG16 lppd) * PrintSetupDlg: * * The Paper Orientation Icons are not implemented yet. * * The Properties Button(s) should call DocumentPropertiesA(). - * * Settings are not yet taken from a provided DevMode or + * * Settings are not yet taken from a provided DevMode or * default printer settings. */ @@ -2357,7 +2357,7 @@ BOOL WINAPI PrintDlgA( if(lppd->lStructSize != sizeof(PRINTDLGA)) { WARN("structure size failure !!!\n"); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); - return FALSE; + return FALSE; } if(lppd->Flags & PD_RETURNDEFAULT) { @@ -2368,12 +2368,12 @@ BOOL WINAPI PrintDlgA( if(lppd->hDevMode || lppd->hDevNames) { WARN("hDevMode or hDevNames non-zero for PD_RETURNDEFAULT\n"); - COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); + COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); return FALSE; } if(!PRINTDLG_OpenDefaultPrinter(&hprn)) { WARN("Can't find default printer\n"); - COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN); + COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN); return FALSE; } @@ -2385,7 +2385,7 @@ BOOL WINAPI PrintDlgA( dbuf = HeapAlloc(GetProcessHeap(),0,needed); if (!GetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, needed, &needed)) { ERR("GetPrinterDriverA failed, le %ld, fix your config for printer %s!\n",GetLastError(),pbuf->pPrinterName); - COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); + COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); return FALSE; } ClosePrinter(hprn); @@ -2407,8 +2407,8 @@ BOOL WINAPI PrintDlgA( HGLOBAL hDlgTmpl; PRINT_PTRA *PrintStructures; - /* load Dialog resources, - * depending on Flags indicates Print32 or Print32_setup dialog + /* load Dialog resources, + * depending on Flags indicates Print32 or Print32_setup dialog */ hDlgTmpl = PRINTDLG_GetDlgTemplateA(lppd); if (!hDlgTmpl) { @@ -2480,8 +2480,8 @@ BOOL WINAPI PrintDlgA( if(bRet && (lppd->Flags & PD_RETURNDC || lppd->Flags & PD_RETURNIC)) bRet = PRINTDLG_CreateDCA(lppd); - TRACE("exit! (%d)\n", bRet); - return bRet; + TRACE("exit! (%d)\n", bRet); + return bRet; } /*********************************************************************** @@ -2513,7 +2513,7 @@ BOOL WINAPI PrintDlgW( if(lppd->lStructSize != sizeof(PRINTDLGW)) { WARN("structure size failure !!!\n"); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); - return FALSE; + return FALSE; } if(lppd->Flags & PD_RETURNDEFAULT) { @@ -2524,12 +2524,12 @@ BOOL WINAPI PrintDlgW( if(lppd->hDevMode || lppd->hDevNames) { WARN("hDevMode or hDevNames non-zero for PD_RETURNDEFAULT\n"); - COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); + COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); return FALSE; } if(!PRINTDLG_OpenDefaultPrinter(&hprn)) { WARN("Can't find default printer\n"); - COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN); + COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN); return FALSE; } @@ -2541,7 +2541,7 @@ BOOL WINAPI PrintDlgW( dbuf = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*needed); if (!GetPrinterDriverW(hprn, NULL, 3, (LPBYTE)dbuf, needed, &needed)) { ERR("GetPrinterDriverA failed, le %ld, fix your config for printer %s!\n",GetLastError(),debugstr_w(pbuf->pPrinterName)); - COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); + COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); return FALSE; } ClosePrinter(hprn); @@ -2563,8 +2563,8 @@ BOOL WINAPI PrintDlgW( HGLOBAL hDlgTmpl; PRINT_PTRW *PrintStructures; - /* load Dialog resources, - * depending on Flags indicates Print32 or Print32_setup dialog + /* load Dialog resources, + * depending on Flags indicates Print32 or Print32_setup dialog */ hDlgTmpl = PRINTDLG_GetDlgTemplateW(lppd); if (!hDlgTmpl) { @@ -2636,13 +2636,13 @@ BOOL WINAPI PrintDlgW( if(bRet && (lppd->Flags & PD_RETURNDC || lppd->Flags & PD_RETURNIC)) bRet = PRINTDLG_CreateDCW(lppd); - TRACE("exit! (%d)\n", bRet); - return bRet; + TRACE("exit! (%d)\n", bRet); + return bRet; } /*********************************************************************** * PrintDlg (COMMDLG.20) - * + * * Displays the the PRINT dialog box, which enables the user to specify * specific properties of the print job. * @@ -2691,12 +2691,12 @@ BOOL16 WINAPI PrintDlg16( if(lppd->hDevMode || lppd->hDevNames) { WARN("hDevMode or hDevNames non-zero for PD_RETURNDEFAULT\n"); - COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); + COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); return FALSE; } if(!PRINTDLG_OpenDefaultPrinter(&hprn)) { WARN("Can't find default printer\n"); - COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN); + COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN); return FALSE; } @@ -2708,7 +2708,7 @@ BOOL16 WINAPI PrintDlg16( if (!GetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, needed, &needed)) { ERR("GetPrinterDriverA failed for %s, le %ld, fix your config!\n", pbuf->pPrinterName,GetLastError()); - COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); + COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE); return FALSE; } ClosePrinter(hprn); @@ -2729,8 +2729,8 @@ BOOL16 WINAPI PrintDlg16( HGLOBAL hDlgTmpl; PRINT_PTRA *PrintStructures; - /* load Dialog resources, - * depending on Flags indicates Print32 or Print32_setup dialog + /* load Dialog resources, + * depending on Flags indicates Print32 or Print32_setup dialog */ hDlgTmpl = PRINTDLG_GetDlgTemplate16(lppd); if (!hDlgTmpl) { @@ -2813,8 +2813,8 @@ BOOL16 WINAPI PrintDlg16( if(bRet && (lppd->Flags & PD_RETURNDC || lppd->Flags & PD_RETURNIC)) bRet = PRINTDLG_CreateDC16(lppd); - TRACE("exit! (%d)\n", bRet); - return bRet; + TRACE("exit! (%d)\n", bRet); + return bRet; } @@ -2848,7 +2848,7 @@ static HGLOBAL PRINTDLG_GetPGSTemplateA(PAGESETUPDLGA *lppd) if(lppd->Flags & PSD_ENABLEPAGESETUPTEMPLATEHANDLE) { hDlgTmpl = lppd->hPageSetupTemplate; - } else if(lppd->Flags & PSD_ENABLEPAGESETUPTEMPLATE) { + } else if(lppd->Flags & PSD_ENABLEPAGESETUPTEMPLATE) { hResInfo = FindResourceA(lppd->hInstance, lppd->lpPageSetupTemplateName, RT_DIALOGA); hDlgTmpl = LoadResource(lppd->hInstance, hResInfo); @@ -2865,7 +2865,7 @@ static HGLOBAL PRINTDLG_GetPGSTemplateW(PAGESETUPDLGW *lppd) if(lppd->Flags & PSD_ENABLEPAGESETUPTEMPLATEHANDLE) { hDlgTmpl = lppd->hPageSetupTemplate; - } else if(lppd->Flags & PSD_ENABLEPAGESETUPTEMPLATE) { + } else if(lppd->Flags & PSD_ENABLEPAGESETUPTEMPLATE) { hResInfo = FindResourceW(lppd->hInstance, lppd->lpPageSetupTemplateName, RT_DIALOGW); hDlgTmpl = LoadResource(lppd->hInstance, hResInfo); @@ -2983,7 +2983,7 @@ PRINTDLG_PS_UpdateDlgStructA(HWND hDlg, PageSetupDataA *pda) { LPSTR devname,portname; char papername[64]; char buf[200]; - + dn = GlobalLock(pda->pdlg.hDevNames); dm = GlobalLock(pda->pdlg.hDevMode); devname = ((char*)dn)+dn->wDeviceOffset; @@ -3024,7 +3024,7 @@ PRINTDLG_PS_UpdateDlgStructW(HWND hDlg, PageSetupDataW *pda) { WCHAR papername[64]; char buf[200]; - + dn = GlobalLock(pda->pdlg.hDevNames); dm = GlobalLock(pda->pdlg.hDevMode); devname = ((WCHAR*)dn)+dn->wDeviceOffset; @@ -3065,7 +3065,7 @@ PRINTDLG_PS_ChangePrinterA(HWND hDlg, PageSetupDataA *pda) { DEVNAMES *dn; DEVMODEA *dm; LPSTR devname,portname; - + dn = GlobalLock(pda->pdlg.hDevNames); dm = GlobalLock(pda->pdlg.hDevMode); devname = ((char*)dn)+dn->wDeviceOffset; @@ -3082,7 +3082,7 @@ PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pda) { DEVNAMES *dn; DEVMODEW *dm; LPWSTR devname,portname; - + dn = GlobalLock(pda->pdlg.hDevNames); dm = GlobalLock(pda->pdlg.hDevMode); devname = ((WCHAR*)dn)+dn->wDeviceOffset; @@ -3174,12 +3174,12 @@ PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) FIXME("PagePaintHook not yet implemented!\n"); } if (pda->dlga->Flags & PSD_DISABLEPRINTER) - EnableWindow(GetDlgItem(hDlg, psh3), FALSE); + EnableWindow(GetDlgItem(hDlg, psh3), FALSE); if (pda->dlga->Flags & PSD_DISABLEMARGINS) { - EnableWindow(GetDlgItem(hDlg, edt4), FALSE); - EnableWindow(GetDlgItem(hDlg, edt5), FALSE); - EnableWindow(GetDlgItem(hDlg, edt6), FALSE); - EnableWindow(GetDlgItem(hDlg, edt7), FALSE); + EnableWindow(GetDlgItem(hDlg, edt4), FALSE); + EnableWindow(GetDlgItem(hDlg, edt5), FALSE); + EnableWindow(GetDlgItem(hDlg, edt6), FALSE); + EnableWindow(GetDlgItem(hDlg, edt7), FALSE); } /* width larger as height -> landscape */ if (pda->dlga->ptPaperSize.x > pda->dlga->ptPaperSize.y) @@ -3256,12 +3256,12 @@ PageDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) FIXME("PagePaintHook not yet implemented!\n"); } if (pda->dlga->Flags & PSD_DISABLEPRINTER) - EnableWindow(GetDlgItem(hDlg, psh3), FALSE); + EnableWindow(GetDlgItem(hDlg, psh3), FALSE); if (pda->dlga->Flags & PSD_DISABLEMARGINS) { - EnableWindow(GetDlgItem(hDlg, edt4), FALSE); - EnableWindow(GetDlgItem(hDlg, edt5), FALSE); - EnableWindow(GetDlgItem(hDlg, edt6), FALSE); - EnableWindow(GetDlgItem(hDlg, edt7), FALSE); + EnableWindow(GetDlgItem(hDlg, edt4), FALSE); + EnableWindow(GetDlgItem(hDlg, edt5), FALSE); + EnableWindow(GetDlgItem(hDlg, edt6), FALSE); + EnableWindow(GetDlgItem(hDlg, edt7), FALSE); } /* width larger as height -> landscape */ if (pda->dlga->ptPaperSize.x > pda->dlga->ptPaperSize.y) @@ -3339,7 +3339,7 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) { TRACE("(%p): hwndOwner = %08x, hDevMode = %08x, hDevNames = %08x\n" "hinst %08x, flags %08lx (%s)\n", setupdlg, setupdlg->hwndOwner, setupdlg->hDevMode, - setupdlg->hDevNames, + setupdlg->hDevNames, setupdlg->hInstance, setupdlg->Flags, flagstr); } @@ -3405,7 +3405,7 @@ BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW setupdlg) { TRACE("(%p): hwndOwner = %08x, hDevMode = %08x, hDevNames = %08x\n" "hinst %08x, flags %08lx (%s)\n", setupdlg, setupdlg->hwndOwner, setupdlg->hDevMode, - setupdlg->hDevNames, + setupdlg->hDevNames, setupdlg->hInstance, setupdlg->Flags, flagstr); } @@ -3466,12 +3466,12 @@ LRESULT WINAPI PrintDlgProc16(HWND16 hDlg, UINT16 uMsg, WPARAM16 wParam, LRESULT res=FALSE; if (uMsg!=WM_INITDIALOG) { - PrintStructures = (PRINT_PTRA*) GetWindowLongA(hDlg, DWL_USER); + PrintStructures = (PRINT_PTRA*) GetWindowLongA(hDlg, DWL_USER); if (!PrintStructures) return FALSE; } else { PrintStructures = (PRINT_PTRA*) lParam; - SetWindowLongA(hDlg, DWL_USER, lParam); + SetWindowLongA(hDlg, DWL_USER, lParam); res = PRINTDLG_WMInitDialog16(hDlg, wParam, PrintStructures); if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) { @@ -3482,7 +3482,7 @@ LRESULT WINAPI PrintDlgProc16(HWND16 hDlg, UINT16 uMsg, WPARAM16 wParam, } return res; } - + if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) { res = CallWindowProc16( (WNDPROC16)PrintStructures->dlg.lpPrintDlg16->lpfnPrintHook, @@ -3509,7 +3509,7 @@ LRESULT WINAPI PrintDlgProc16(HWND16 hDlg, UINT16 uMsg, WPARAM16 wParam, /* FIXME: don't forget to delete the paper orientation icons here! */ return FALSE; - } + } return res; } diff --git a/dlls/dciman32/dciman_main.c b/dlls/dciman32/dciman_main.c index f4e2c60df7e..af8cfa1068f 100644 --- a/dlls/dciman32/dciman_main.c +++ b/dlls/dciman32/dciman_main.c @@ -1,7 +1,7 @@ -/* +/* * Implementation of DCIMAN32 - DCI Manager * "Device Context Interface" ? - * + * * Copyright 2000 Marcus Meissner * * This library is free software; you can redistribute it and/or diff --git a/dlls/ddraw/convert.c b/dlls/ddraw/convert.c index eeeb8492c95..3a1393cb9f8 100644 --- a/dlls/ddraw/convert.c +++ b/dlls/ddraw/convert.c @@ -38,7 +38,7 @@ static void pixel_convert_16_to_8(void *src, void *dst, DWORD width, DWORD heigh /* gcc generates slightly inefficient code for the the copy/lookup, * it generates one excess memory access (to pal) per pixel. Since * we know that pal is not modified by the memory write we can - * put it into a register and reduce the number of memory accesses + * put it into a register and reduce the number of memory accesses * from 4 to 3 pp. There are two xor eax,eax to avoid pipeline * stalls. (This is not guaranteed to be the fastest method.) */ diff --git a/dlls/ddraw/d3d_private.h b/dlls/ddraw/d3d_private.h index ec601da0961..fa63bf11e70 100644 --- a/dlls/ddraw/d3d_private.h +++ b/dlls/ddraw/d3d_private.h @@ -108,7 +108,7 @@ extern HRESULT WINAPI IDirect3DImpl_FindDevice( LPDIRECT3D iface, LPD3DFINDDEVICESEARCH lpfinddevsrc, LPD3DFINDDEVICERESULT lpfinddevrst) ; -extern HRESULT WINAPI IDirect3D2Impl_QueryInterface(LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj); +extern HRESULT WINAPI IDirect3D2Impl_QueryInterface(LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj); extern ULONG WINAPI IDirect3D2Impl_AddRef(LPDIRECT3D2 iface); extern ULONG WINAPI IDirect3D2Impl_Release(LPDIRECT3D2 iface); extern HRESULT WINAPI IDirect3D2Impl_EnumDevices( @@ -144,7 +144,7 @@ struct IDirect3DLightImpl IDirect3D2Impl* d3d2; } d3d; int type; - + D3DLIGHT2 light; /* Chained list used for adding / removing from viewports */ @@ -153,7 +153,7 @@ struct IDirect3DLightImpl /* Activation function */ void (*activate)(IDirect3DLightImpl*); int is_active; - + LPVOID private; }; @@ -250,13 +250,13 @@ struct IDirect3DViewport2Impl /* Activation function */ void (*activate)(IDirect3DViewport2Impl*); - + /* Field used to chain viewports together */ IDirect3DViewport2Impl* next; /* Lights list */ IDirect3DLightImpl* lights; - + LPVOID private; }; diff --git a/dlls/ddraw/d3ddevice/main.c b/dlls/ddraw/d3ddevice/main.c index 780212b137f..82d95a718b4 100644 --- a/dlls/ddraw/d3ddevice/main.c +++ b/dlls/ddraw/d3ddevice/main.c @@ -1,6 +1,6 @@ /* Direct3D Device * Copyright (c) 1998 Lionel ULMER - * + * * This file contains all the common stuff for D3D devices. * * This library is free software; you can redistribute it and/or @@ -379,12 +379,12 @@ HRESULT WINAPI IDirect3DDevice2Impl_DrawPrimitive( LPVOID lpvertex, DWORD vertcount, DWORD dwFlags ) { ICOM_THIS(IDirect3DDevice2Impl,iface); - + TRACE("(%p)->(%d,%d,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvertex, vertcount, dwFlags); return D3D_OK; } - + HRESULT WINAPI IDirect3DDevice2Impl_DrawIndexedPrimitive( LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv, LPVOID lpvertex, DWORD vertcount, LPWORD lpindexes, DWORD indexcount, @@ -670,7 +670,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface) { ICOM_THIS(IDirect3DDeviceImpl,iface); FIXME("(%p)->(): stub\n", This); - return DD_OK; + return DD_OK; } HRESULT WINAPI IDirect3DDeviceImpl_GetDirect3D( @@ -685,7 +685,7 @@ HRESULT WINAPI IDirect3DDeviceImpl_GetDirect3D( /******************************************************************************* * Direct3DDevice VTable */ -static ICOM_VTABLE(IDirect3DDevice) WINE_UNUSED d3d_d3ddevice_vtbl = +static ICOM_VTABLE(IDirect3DDevice) WINE_UNUSED d3d_d3ddevice_vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirect3DDeviceImpl_QueryInterface, diff --git a/dlls/ddraw/d3ddevice/mesa.c b/dlls/ddraw/d3ddevice/mesa.c index af8c3813720..bb09d9a5161 100644 --- a/dlls/ddraw/d3ddevice/mesa.c +++ b/dlls/ddraw/d3ddevice/mesa.c @@ -1,6 +1,6 @@ /* Direct3D Device * Copyright (c) 1998 Lionel ULMER - * + * * This file contains the MESA implementation of all the D3D devices that * Wine supports. * @@ -98,7 +98,7 @@ static void fill_opengl_primcaps(D3DPRIMCAPS *pc) static void fill_opengl_caps(D3DDEVICEDESC *d1, D3DDEVICEDESC *d2) { /* GLint maxlight; */ - + d1->dwSize = sizeof(*d1); d1->dwFlags = D3DDD_DEVCAPS | D3DDD_BCLIPPING | D3DDD_COLORMODEL | D3DDD_DEVICERENDERBITDEPTH | D3DDD_DEVICEZBUFFERBITDEPTH | D3DDD_LIGHTINGCAPS | D3DDD_LINECAPS | D3DDD_MAXBUFFERSIZE | D3DDD_MAXVERTEXCOUNT | D3DDD_TRANSFORMCAPS | D3DDD_TRICAPS; @@ -114,7 +114,7 @@ static void fill_opengl_caps(D3DDEVICEDESC *d1, D3DDEVICEDESC *d2) d1->dlcLightingCaps.dwLightingModel = D3DLIGHTINGMODEL_RGB; d1->dlcLightingCaps.dwNumLights = 16; /* glGetIntegerv(GL_MAX_LIGHTS, &maxlight); d1->dlcLightingCaps.dwNumLights = maxlight; */ fill_opengl_primcaps(&(d1->dpcLineCaps)); - fill_opengl_primcaps(&(d1->dpcTriCaps)); + fill_opengl_primcaps(&(d1->dpcTriCaps)); d1->dwDeviceRenderBitDepth = DDBD_16; d1->dwDeviceZBufferBitDepth = DDBD_16; d1->dwMaxBufferSize = 0; @@ -137,10 +137,10 @@ static void fill_device_capabilities(IDirectDrawImpl* ddraw) { x11_dd_private *private = (x11_dd_private *) ddraw->d->private; const char *ext_string; Mesa_DeviceCapabilities *devcap; - + private->device_capabilities = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Mesa_DeviceCapabilities)); devcap = (Mesa_DeviceCapabilities *) private->device_capabilities; - + ENTER_GL(); ext_string = glGetString(GL_EXTENSIONS); /* Query for the ColorTable Extension */ @@ -174,7 +174,7 @@ is_OpenGL( (!memcmp(&IID_IDirect3DHALDevice,rguid,sizeof(IID_IDirect3DHALDevice))) || /* OpenGL Device */ (!memcmp(&IID_D3DDEVICE2_OpenGL,rguid,sizeof(IID_D3DDEVICE2_OpenGL)))) { - + *device = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DDevice2Impl)); (*device)->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dd_private)); odev = (mesa_d3dd_private*)(*device)->private; @@ -185,7 +185,7 @@ is_OpenGL( (*device)->viewport_list = NULL; (*device)->current_viewport = NULL; (*device)->set_context = set_context; - + TRACE("Creating OpenGL device for surface %p\n", surface); /* Create the OpenGL context */ #if COMPILABLE @@ -203,12 +203,12 @@ is_OpenGL( odev->ctx = glXCreateContext(gdi_display, vis, NULL, GL_TRUE); } - + if (odev->ctx == NULL) ERR("Error in context creation !\n"); else TRACE("Context created (%p)\n", odev->ctx); - + /* Now override the surface's Flip method (if in double buffering) */ ((x11_ds_private *) surface->private)->opengl_flip = TRUE; { @@ -230,7 +230,7 @@ is_OpenGL( odev->world_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float)); odev->view_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float)); odev->proj_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float)); - + memcpy(odev->world_mat, id_mat, 16 * sizeof(float)); memcpy(odev->view_mat , id_mat, 16 * sizeof(float)); memcpy(odev->proj_mat , id_mat, 16 * sizeof(float)); @@ -244,7 +244,7 @@ is_OpenGL( LEAVE_GL(); fill_device_capabilities(d3d->ddraw); - + TRACE("OpenGL device created \n"); return 1; } @@ -260,7 +260,7 @@ static ULONG WINAPI MESA_IDirect3DDevice2Impl_Release(LPDIRECT3DDEVICE2 iface) { ICOM_THIS(IDirect3DDevice2Impl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); - + if (!--(This->ref)) { #if 0 /* broken for now */ D3DDPRIVATE(This); @@ -298,7 +298,7 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb, pformat = &(sdesc.ddpfPixelFormat); pformat->dwSize = sizeof(DDPIXELFORMAT); pformat->dwFourCC = 0; - + TRACE("Enumerating GL_RGBA unpacked (32)\n"); pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; pformat->u1.dwRGBBitCount = 32; @@ -371,8 +371,8 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb, pformat->u4.dwBBitMask = 0x0000001F; pformat->u5.dwRGBAlphaBitMask = 0x00008000; if (cb(&sdesc, context) == 0) - return DD_OK; - + return DD_OK; + TRACE("Enumerating Paletted (8)\n"); pformat->dwFlags = DDPF_PALETTEINDEXED8; pformat->u1.dwRGBBitCount = 8; @@ -382,9 +382,9 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb, pformat->u5.dwRGBAlphaBitMask = 0x00000000; if (cb(&sdesc, context) == 0) return DD_OK; - + TRACE("End of enumeration\n"); - + return DD_OK; } @@ -393,7 +393,7 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_EnumTextureFormats( ) { ICOM_THIS(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, cb, context); - + return enum_texture_format_OpenGL(cb, context); } @@ -401,12 +401,12 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_BeginScene( LPDIRECT3DDEVICE2 iface ) { ICOM_THIS(IDirect3DDevice2Impl,iface); - + FIXME("(%p)->(): stub\n", This); - + /* Here, we should get the DDraw surface and 'copy it' to the OpenGL surface.... */ - + return DD_OK; } @@ -416,7 +416,7 @@ HRESULT WINAPI MESA_IDirect3DDevice2Impl_EndScene(LPDIRECT3DDEVICE2 iface) { FIXME("(%p)->(): stub\n", This); /* No need to do anything here... */ - + return DD_OK; } @@ -428,10 +428,10 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetRenderState( D3DDPRIVATE(This); TRACE("(%p)->(%d,%ld)\n", This, dwRenderStateType, dwRenderState); - + /* Call the render state functions */ set_render_state(dwRenderStateType, dwRenderState, &(odev->rs)); - + return DD_OK; } @@ -441,11 +441,11 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetLightState( ) { ICOM_THIS(IDirect3DDevice2Impl,iface); FIXME("(%p)->(%d,%08lx): stub\n", This, dwLightStateType, dwLightState); - + switch (dwLightStateType) { case D3DLIGHTSTATE_MATERIAL: { /* 1 */ IDirect3DMaterial2Impl* mat = (IDirect3DMaterial2Impl*) dwLightState; - + if (mat != NULL) { ENTER_GL(); mat->activate(mat); @@ -454,10 +454,10 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetLightState( TRACE("Zoups !!!\n"); } } break; - + case D3DLIGHTSTATE_AMBIENT: { /* 2 */ float light[4]; - + light[0] = ((dwLightState >> 16) & 0xFF) / 255.0; light[1] = ((dwLightState >> 8) & 0xFF) / 255.0; light[2] = ((dwLightState >> 0) & 0xFF) / 255.0; @@ -478,7 +478,7 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetLightState( TRACE("Unexpected Light State Type\n"); return DDERR_INVALIDPARAMS; } - + return DD_OK; } @@ -488,12 +488,12 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetTransform( ) { ICOM_THIS(IDirect3DDevice2Impl,iface); D3DDPRIVATE(This); - + FIXME("(%p)->(%d,%p): stub\n", This, d3dts, lpmatrix); - + ENTER_GL(); - - /* Using a trial and failure approach, I found that the order of + + /* Using a trial and failure approach, I found that the order of Direct3D transformations that works best is : ScreenCoord = ProjectionMat * ViewMat * WorldMat * ObjectCoord @@ -504,7 +504,7 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetTransform( If anyone has a good explanation of the three different matrices in the SDK online documentation, feel free to point it to me. For example, which matrices transform lights ? In OpenGL only the PROJECTION matrix - transform the lights, not the MODELVIEW. Using the matrix names, I + transform the lights, not the MODELVIEW. Using the matrix names, I supposed that PROJECTION and VIEW (all 'camera' related names) do transform lights, but WORLD do not. It may be wrong though... */ @@ -530,21 +530,21 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetTransform( glMatrixMode(GL_MODELVIEW); glLoadMatrixf((float *) odev->world_mat); } break; - + case D3DTRANSFORMSTATE_VIEW: { conv_mat(lpmatrix, odev->view_mat); glMatrixMode(GL_PROJECTION); glLoadMatrixf((float *) odev->proj_mat); glMultMatrixf((float *) odev->view_mat); } break; - + case D3DTRANSFORMSTATE_PROJECTION: { conv_mat(lpmatrix, odev->proj_mat); glMatrixMode(GL_PROJECTION); glLoadMatrixf((float *) odev->proj_mat); glMultMatrixf((float *) odev->view_mat); } break; - + default: break; } @@ -720,16 +720,16 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_DrawPrimitive( ICOM_THIS(IDirect3DDevice2Impl,iface); D3DDPRIVATE(This); int vx_index; - + TRACE("(%p)->(%d,%d,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvertex, vertcount, dwFlags); ENTER_GL(); DRAW_PRIMITIVE(vertcount, vx_index); LEAVE_GL(); - + return D3D_OK; } - + static HRESULT WINAPI MESA_IDirect3DDevice2Impl_DrawIndexedPrimitive( LPDIRECT3DDEVICE2 iface, D3DPRIMITIVETYPE d3dp, D3DVERTEXTYPE d3dv, LPVOID lpvertex, DWORD vertcount, LPWORD lpindexes, DWORD indexcount, @@ -738,13 +738,13 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_DrawIndexedPrimitive( ICOM_THIS(IDirect3DDevice2Impl,iface); D3DDPRIVATE(This); int vx_index; - + TRACE("(%p)->(%d,%d,%p,%ld,%p,%ld,%08lx): stub\n", This, d3dp, d3dv, lpvertex, vertcount, lpindexes, indexcount, dwFlags); - + ENTER_GL(); DRAW_PRIMITIVE(indexcount, lpindexes[vx_index]); LEAVE_GL(); - + return D3D_OK; } @@ -767,7 +767,7 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_CreateExecuteBuffer( * OpenGL-specific VTable */ -ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable = +ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirect3DDevice2Impl_QueryInterface, @@ -784,20 +784,20 @@ ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable = MESA_IDirect3DDevice2Impl_BeginScene, MESA_IDirect3DDevice2Impl_EndScene, IDirect3DDevice2Impl_GetDirect3D, - + /*** DrawPrimitive API ***/ IDirect3DDevice2Impl_SetCurrentViewport, IDirect3DDevice2Impl_GetCurrentViewport, - + IDirect3DDevice2Impl_SetRenderTarget, IDirect3DDevice2Impl_GetRenderTarget, - + IDirect3DDevice2Impl_Begin, IDirect3DDevice2Impl_BeginIndexed, IDirect3DDevice2Impl_Vertex, IDirect3DDevice2Impl_Index, IDirect3DDevice2Impl_End, - + IDirect3DDevice2Impl_GetRenderState, MESA_IDirect3DDevice2Impl_SetRenderState, IDirect3DDevice2Impl_GetLightState, @@ -805,10 +805,10 @@ ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable = MESA_IDirect3DDevice2Impl_SetTransform, IDirect3DDevice2Impl_GetTransform, IDirect3DDevice2Impl_MultiplyTransform, - + MESA_IDirect3DDevice2Impl_DrawPrimitive, MESA_IDirect3DDevice2Impl_DrawIndexedPrimitive, - + IDirect3DDevice2Impl_SetClipStatus, IDirect3DDevice2Impl_GetClipStatus, }; @@ -818,11 +818,11 @@ ICOM_VTABLE(IDirect3DDevice2) OpenGL_vtable = */ int d3d_OpenGL_dx3(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) { D3DDEVICEDESC d1,d2; - + TRACE(" Enumerating OpenGL D3D device (IID %s).\n", debugstr_guid(&IID_D3DDEVICE_OpenGL)); - + fill_opengl_caps(&d1, &d2); - + return cb((void*)&IID_D3DDEVICE_OpenGL,"WINE Direct3D using OpenGL","direct3d",&d1,&d2,context); } @@ -834,7 +834,7 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi int attributeList[]={ GLX_RGBA, GLX_DEPTH_SIZE, 16, GLX_DOUBLEBUFFER, None }; XVisualInfo *xvis; #endif - + *device = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DDeviceImpl)); (*device)->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dd_private)); odev = (mesa_d3dd_private*)(*device)->private; @@ -842,14 +842,14 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi ICOM_VTBL(*device) = &OpenGL_vtable_dx3; (*device)->d3d = NULL; (*device)->surface = surface; - + (*device)->viewport_list = NULL; (*device)->current_viewport = NULL; - + (*device)->set_context = (void*)set_context; - + TRACE("OpenGL device created \n"); - + /* Create the OpenGL context */ /* First get the correct visual */ /* if (surface->s.backbuffer == NULL) @@ -869,7 +869,7 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi NULL, GL_TRUE); TRACE("Context created\n"); - + /* Now override the surface's Flip method (if in double buffering) */ surface->s.d3d_device = (void *) odev; { @@ -893,12 +893,12 @@ int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevi (*device)->set_context(*device); glClearColor(0.0, 0.0, 0.0, 0.0); glColor3f(1.0, 1.0, 1.0); - + fill_device_capabilities((IDirectDrawImpl *) surface->ddraw_owner); return 1; } - + /* This is not the OpenGL UID */ return DD_OK; } @@ -907,7 +907,7 @@ static ULONG WINAPI MESA_IDirect3DDeviceImpl_Release(LPDIRECT3DDEVICE iface) { ICOM_THIS(IDirect3DDeviceImpl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); - + if (!--(This->ref)) { #if 0 /* broken for now */ D3DDPRIVATE(This); @@ -928,7 +928,7 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_EnumTextureFormats( { ICOM_THIS(IDirect3DDeviceImpl,iface); TRACE("(%p)->(%p,%p): stub\n", This, lpd3dEnumTextureProc, lpArg); - + return enum_texture_format_OpenGL(lpd3dEnumTextureProc, lpArg); } @@ -937,12 +937,12 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_BeginScene(LPDIRECT3DDEVICE iface { ICOM_THIS(IDirect3DDeviceImpl,iface); /* OpenGL_IDirect3DDevice *odev = (OpenGL_IDirect3DDevice *) This; */ - + FIXME("(%p)->(): stub\n", This); - + /* We get the pointer to the surface (should be done on flip) */ /* odev->zb->pbuf = This->surface->s.surface_desc.u2.lpSurface; */ - + return DD_OK; } @@ -952,18 +952,18 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_BeginScene(LPDIRECT3DDEVICE iface static HRESULT WINAPI MESA_IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface) { ICOM_THIS(IDirect3DDeviceImpl,iface); - + FIXME("(%p)->(): stub\n", This); /* No need to do anything here... */ - - return DD_OK; + + return DD_OK; } /******************************************************************************* * Direct3DDevice VTable */ -ICOM_VTABLE(IDirect3DDevice) OpenGL_vtable_dx3 = +ICOM_VTABLE(IDirect3DDevice) OpenGL_vtable_dx3 = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirect3DDeviceImpl_QueryInterface, diff --git a/dlls/ddraw/d3dexecutebuffer.c b/dlls/ddraw/d3dexecutebuffer.c index fe78460db80..bec04092e91 100644 --- a/dlls/ddraw/d3dexecutebuffer.c +++ b/dlls/ddraw/d3dexecutebuffer.c @@ -69,7 +69,7 @@ static ICOM_VTABLE(IDirect3DExecuteBuffer) executebuffer_vtable; * ExecuteBuffer static functions */ void _dump_d3dstatus(LPD3DSTATUS lpStatus) { - + } void _dump_executedata(LPD3DEXECUTEDATA lpData) { @@ -193,16 +193,16 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, /* DWORD vc = ilpBuff->data.dwVertexCount; */ DWORD is = ilpBuff->data.dwInstructionOffset; /* DWORD il = ilpBuff->data.dwInstructionLength; */ - + void *instr = ilpBuff->desc.lpData + is; D3DDPRIVATE((IDirect3DDeviceImpl*)dev); - + TRACE("ExecuteData : \n"); if (TRACE_ON(ddraw)) _dump_executedata(&(ilpBuff->data)); - + ENTER_GL(); - + while (1) { LPD3DINSTRUCTION current = (LPD3DINSTRUCTION) instr; BYTE size; @@ -211,20 +211,20 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, count = current->wCount; size = current->bSize; instr += sizeof(D3DINSTRUCTION); - + switch (current->bOpcode) { case D3DOP_POINT: { TRACE("POINT-s (%d)\n", count); instr += count * size; } break; - + case D3DOP_LINE: { TRACE("LINE-s (%d)\n", count); instr += count * size; } break; - + case D3DOP_TRIANGLE: { int i; float z_inv_matrix[16] = { @@ -233,18 +233,18 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0, 1.0 }; - + OGL_Vertex *vx = (OGL_Vertex *) ilpBuff->vertex_data; OGL_LVertex *l_vx = (OGL_LVertex *) ilpBuff->vertex_data; D3DTLVERTEX *tl_vx = (D3DTLVERTEX *) ilpBuff->vertex_data; - + TRACE("TRIANGLE (%d)\n", count); switch (ilpBuff->vertex_type) { case D3DVT_VERTEX: /* This time, there is lighting */ glEnable(GL_LIGHTING); - + /* Use given matrixes */ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); /* The model transformation was done during the @@ -282,16 +282,16 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, case D3DVT_TLVERTEX: { GLdouble height, width, minZ, maxZ; - + /* First, disable lighting */ glDisable(GL_LIGHTING); - + /* Then do not put any transformation matrixes */ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - + if (ivp == NULL) { ERR("No current viewport !\n"); /* Using standard values */ @@ -314,7 +314,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, glOrtho(0.0, width, height, 0.0, -minZ, -maxZ); } break; - + default: ERR("Unhandled vertex type !\n"); break; @@ -324,27 +324,27 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, case D3DVT_VERTEX: TRIANGLE_LOOP(DO_VERTEX); break; - + case D3DVT_LVERTEX: TRIANGLE_LOOP(DO_LVERTEX); break; - + case D3DVT_TLVERTEX: TRIANGLE_LOOP(DO_TLVERTEX); break; - + default: ERR("Unhandled vertex type !\n"); } - + } break; - + case D3DOP_MATRIXLOAD: { TRACE("MATRIXLOAD-s (%d)\n", count); instr += count * size; } break; - + case D3DOP_MATRIXMULTIPLY: { int i; TRACE("MATRIXMULTIPLY (%d)\n", count); @@ -354,7 +354,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, LPD3DMATRIX a = (LPD3DMATRIX) ci->hDestMatrix; LPD3DMATRIX b = (LPD3DMATRIX) ci->hSrcMatrix1; LPD3DMATRIX c = (LPD3DMATRIX) ci->hSrcMatrix2; - + TRACE(" Dest : %08lx Src1 : %08lx Src2 : %08lx\n", ci->hDestMatrix, ci->hSrcMatrix1, ci->hSrcMatrix2); @@ -369,11 +369,11 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, glGetFloatv(GL_PROJECTION_MATRIX, (float *) a); /* Restore the current matrix */ glPopMatrix(); - + instr += size; } } break; - + case D3DOP_STATETRANSFORM: { int i; TRACE("STATETRANSFORM (%d)\n", count); @@ -401,38 +401,38 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, default: ERR(" Unhandled state transformation !! (%d)\n", (int) ci->u1.dtstTransformStateType); break; - + } - + instr += size; } } break; - + case D3DOP_STATELIGHT: { int i; TRACE("STATELIGHT (%d)\n", count); for (i = 0; i < count; i++) { LPD3DSTATE ci = (LPD3DSTATE) instr; - + /* Handle the state transform */ switch (ci->u1.dlstLightStateType) { case D3DLIGHTSTATE_MATERIAL: { IDirect3DMaterial2Impl* mat = (IDirect3DMaterial2Impl*) ci->u2.dwArg[0]; TRACE(" MATERIAL\n"); - + if (mat != NULL) { mat->activate(mat); } else { TRACE(" bad Material Handle\n"); } } break ; - + case D3DLIGHTSTATE_AMBIENT: { float light[4]; DWORD dwLightState = ci->u2.dwArg[0]; TRACE(" AMBIENT\n"); - + light[0] = ((dwLightState >> 16) & 0xFF) / 255.0; light[1] = ((dwLightState >> 8) & 0xFF) / 255.0; light[2] = ((dwLightState >> 0) & 0xFF) / 255.0; @@ -445,27 +445,27 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, ((dwLightState >> 0) & 0xFF), ((dwLightState >> 24) & 0xFF)); } break ; - + case D3DLIGHTSTATE_COLORMODEL: { TRACE(" COLORMODEL\n"); } break ; - + case D3DLIGHTSTATE_FOGMODE: { TRACE(" FOGMODE\n"); } break ; - + case D3DLIGHTSTATE_FOGSTART: { TRACE(" FOGSTART\n"); } break ; - + case D3DLIGHTSTATE_FOGEND: { TRACE(" FOGEND\n"); } break ; - + case D3DLIGHTSTATE_FOGDENSITY: { TRACE(" FOGDENSITY\n"); } break ; - + default: ERR(" Unhandled light state !! (%d)\n", (int) ci->u1.dlstLightStateType); break; @@ -473,28 +473,28 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, instr += size; } } break; - + case D3DOP_STATERENDER: { int i; TRACE("STATERENDER (%d)\n", count); - + for (i = 0; i < count; i++) { LPD3DSTATE ci = (LPD3DSTATE) instr; - + /* Handle the state transform */ set_render_state(ci->u1.drstRenderStateType, ci->u2.dwArg[0], &(odev->rs)); instr += size; } } break; - + case D3DOP_PROCESSVERTICES: { int i; TRACE("PROCESSVERTICES (%d)\n", count); - + for (i = 0; i < count; i++) { LPD3DPROCESSVERTICES ci = (LPD3DPROCESSVERTICES) instr; - + TRACE(" Start : %d Dest : %d Count : %ld\n", ci->wStart, ci->wDest, ci->dwCount); TRACE(" Flags : "); @@ -523,13 +523,13 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, In this implementation, I will emulate only ONE thing : each vertex can have its own "WORLD" transformation (this is used in the - TWIST.EXE demo of the 5.2 SDK). I suppose that all vertices of the + TWIST.EXE demo of the 5.2 SDK). I suppose that all vertices of the execute buffer use the same state. If I find applications that change other states, I will try to do a - more 'fine-tuned' state emulation (but I may become quite tricky if + more 'fine-tuned' state emulation (but I may become quite tricky if it changes a light position in the middle of a triangle). - + In this case, a 'direct' approach (i.e. without using OpenGL, but writing our own 3D rasterizer) would be easier. */ @@ -551,13 +551,13 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, dump_mat(mat); ilpBuff->vertex_type = D3DVT_VERTEX; - + for (nb = 0; nb < ci->dwCount; nb++) { /* For the moment, no normal transformation... */ dst->nx = src->u4.nx; dst->ny = src->u5.ny; dst->nz = src->u6.nz; - + dst->u = src->u7.tu; dst->v = src->u8.tv; @@ -566,7 +566,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, dst->y = (src->u1.x * mat->_12) + (src->u2.y * mat->_22) + (src->u3.z * mat->_32) + (1.0 * mat->_42); dst->z = (src->u1.x * mat->_13) + (src->u2.y * mat->_23) + (src->u3.z * mat->_33) + (1.0 * mat->_43); dst->w = (src->u1.x * mat->_14) + (src->u2.y * mat->_24) + (src->u3.z * mat->_34) + (1.0 * mat->_44); - + src++; dst++; } @@ -580,7 +580,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, dump_mat(mat); ilpBuff->vertex_type = D3DVT_LVERTEX; - + for (nb = 0; nb < ci->dwCount; nb++) { dst->c = src->u4.color; dst->sc = src->u5.specular; @@ -592,7 +592,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, dst->y = (src->u1.x * mat->_12) + (src->u2.y * mat->_22) + (src->u3.z * mat->_32) + (1.0 * mat->_42); dst->z = (src->u1.x * mat->_13) + (src->u2.y * mat->_23) + (src->u3.z * mat->_33) + (1.0 * mat->_43); dst->w = (src->u1.x * mat->_14) + (src->u2.y * mat->_24) + (src->u3.z * mat->_34) + (1.0 * mat->_44); - + src++; dst++; } @@ -601,22 +601,22 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, D3DTLVERTEX *dst = ((LPD3DTLVERTEX) (ilpBuff->vertex_data)) + ci->wDest; ilpBuff->vertex_type = D3DVT_TLVERTEX; - + memcpy(dst, src, ci->dwCount * sizeof(D3DTLVERTEX)); } else { ERR("Unhandled vertex processing !\n"); } - + instr += size; } } break; - + case D3DOP_TEXTURELOAD: { TRACE("TEXTURELOAD-s (%d)\n", count); instr += count * size; } break; - + case D3DOP_EXIT: { TRACE("EXIT (%d)\n", count); /* We did this instruction */ @@ -624,14 +624,14 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, /* Exit this loop */ goto end_of_buffer; } break; - + case D3DOP_BRANCHFORWARD: { int i; TRACE("BRANCHFORWARD (%d)\n", count); for (i = 0; i < count; i++) { LPD3DBRANCH ci = (LPD3DBRANCH) instr; - + if ((ilpBuff->data.dsStatus.dwStatus & ci->dwMask) == ci->dwValue) { if (!ci->bNegate) { TRACE(" Should branch to %ld\n", ci->dwOffset); @@ -645,22 +645,22 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, instr += size; } } break; - + case D3DOP_SPAN: { TRACE("SPAN-s (%d)\n", count); instr += count * size; } break; - + case D3DOP_SETSTATUS: { int i; TRACE("SETSTATUS (%d)\n", count); for (i = 0; i < count; i++) { LPD3DSTATUS ci = (LPD3DSTATUS) instr; - + ilpBuff->data.dsStatus = *ci; - + instr += size; } } break; @@ -683,7 +683,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff, LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc) { IDirect3DExecuteBufferImpl* eb; - + eb = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DExecuteBufferImpl)); eb->ref = 1; ICOM_VTBL(eb) = &executebuffer_vtable; @@ -707,14 +707,14 @@ LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD } else { eb->need_free = FALSE; } - + /* No vertices for the moment */ eb->vertex_data = NULL; eb->desc.dwFlags |= D3DDEB_LPDATA; eb->execute = execute; - + return (LPDIRECT3DEXECUTEBUFFER)eb; } @@ -727,9 +727,9 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_QueryInterface(LPDIRECT3DEXECUT LPVOID* ppvObj) { ICOM_THIS(IDirect3DExecuteBufferImpl,iface); - + FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); - + return S_OK; } @@ -739,7 +739,7 @@ static ULONG WINAPI IDirect3DExecuteBufferImpl_AddRef(LPDIRECT3DEXECUTEBUFFER if { ICOM_THIS(IDirect3DExecuteBufferImpl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); - + return ++(This->ref); } @@ -749,7 +749,7 @@ static ULONG WINAPI IDirect3DExecuteBufferImpl_Release(LPDIRECT3DEXECUTEBUFFER i { ICOM_THIS(IDirect3DExecuteBufferImpl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); - + if (!--(This->ref)) { if ((This->desc.lpData != NULL) && This->need_free) HeapFree(GetProcessHeap(),0,This->desc.lpData); @@ -760,7 +760,7 @@ static ULONG WINAPI IDirect3DExecuteBufferImpl_Release(LPDIRECT3DEXECUTEBUFFER i HeapFree(GetProcessHeap(),0,This); return 0; } - + return This->ref; } @@ -770,7 +770,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Initialize(LPDIRECT3DEXECUTEBUF { ICOM_THIS(IDirect3DExecuteBufferImpl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lpDirect3DDevice, lpDesc); - + return DD_OK; } @@ -782,7 +782,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Lock(LPDIRECT3DEXECUTEBUFFER if /* Copies the buffer description */ *lpDesc = This->desc; - + return DD_OK; } @@ -806,7 +806,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_SetExecuteData(LPDIRECT3DEXECUT /* Get the number of vertices in the execute buffer */ nbvert = This->data.dwVertexCount; - + /* Prepares the transformed vertex buffer */ if (This->vertex_data != NULL) HeapFree(GetProcessHeap(), 0, This->vertex_data); @@ -816,7 +816,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_SetExecuteData(LPDIRECT3DEXECUT if (TRACE_ON(ddraw)) { _dump_executedata(lpData); } - + return DD_OK; } @@ -827,7 +827,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_GetExecuteData(LPDIRECT3DEXECUT TRACE("(%p)->(%p): stub\n", This, lpData); *lpData = This->data; - + return DD_OK; } @@ -856,7 +856,7 @@ static HRESULT WINAPI IDirect3DExecuteBufferImpl_Optimize(LPDIRECT3DEXECUTEBUFFE /******************************************************************************* * IDirect3DLight VTable */ -static ICOM_VTABLE(IDirect3DExecuteBuffer) executebuffer_vtable = +static ICOM_VTABLE(IDirect3DExecuteBuffer) executebuffer_vtable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /*** IUnknown methods ***/ diff --git a/dlls/ddraw/d3dlight.c b/dlls/ddraw/d3dlight.c index a734f9ae12a..cbe8ebf6e54 100644 --- a/dlls/ddraw/d3dlight.c +++ b/dlls/ddraw/d3dlight.c @@ -29,7 +29,7 @@ #include "mesa_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ddraw); - + #define D3DLPRIVATE(x) mesa_d3dl_private*dlpriv=((mesa_d3dl_private*)x->private) static ICOM_VTABLE(IDirect3DLight) light_vtable; @@ -52,14 +52,14 @@ static void update(IDirect3DLightImpl* This) { case D3DLIGHT_POINT: /* 1 */ TRACE("Activating POINT\n"); break; - + case D3DLIGHT_SPOT: /* 2 */ TRACE("Activating SPOT\n"); break; - + case D3DLIGHT_DIRECTIONAL: { /* 3 */ float direction[4]; - + TRACE("Activating DIRECTIONAL\n"); TRACE(" direction : %f %f %f\n", This->light.dvDirection.u1.x, @@ -77,7 +77,7 @@ static void update(IDirect3DLightImpl* This) { glLightfv(dlpriv->light_num, GL_POSITION, (float *) direction); } break; - + case D3DLIGHT_PARALLELPOINT: /* 4 */ TRACE("Activating PARRALLEL-POINT\n"); break; @@ -109,7 +109,7 @@ static void activate(IDirect3DLightImpl* This) { LPDIRECT3DLIGHT d3dlight_create(IDirect3D2Impl* d3d2) { IDirect3DLightImpl* light; - + light = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DLightImpl)); light->ref = 1; ICOM_VTBL(light) = &light_vtable; @@ -120,26 +120,26 @@ LPDIRECT3DLIGHT d3dlight_create(IDirect3D2Impl* d3d2) light->prev = NULL; light->activate = activate; light->is_active = 0; - + return (LPDIRECT3DLIGHT)light; } LPDIRECT3DLIGHT d3dlight_create_dx3(IDirect3DImpl* d3d1) { IDirect3DLightImpl* light; - + light = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DLightImpl)); light->ref = 1; ICOM_VTBL(light) = &light_vtable; - + light->d3d.d3d1 = d3d1; light->type = D3D_1; - + light->next = NULL; light->prev = NULL; light->activate = activate; light->is_active = 0; - + return (LPDIRECT3DLIGHT)light; } @@ -152,9 +152,9 @@ static HRESULT WINAPI IDirect3DLightImpl_QueryInterface(LPDIRECT3DLIGHT iface, LPVOID* ppvObj) { ICOM_THIS(IDirect3DLightImpl,iface); - + FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); - + return S_OK; } @@ -164,7 +164,7 @@ static ULONG WINAPI IDirect3DLightImpl_AddRef(LPDIRECT3DLIGHT iface) { ICOM_THIS(IDirect3DLightImpl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); - + return ++(This->ref); } @@ -174,12 +174,12 @@ static ULONG WINAPI IDirect3DLightImpl_Release(LPDIRECT3DLIGHT iface) { ICOM_THIS(IDirect3DLightImpl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); - + if (!--(This->ref)) { HeapFree(GetProcessHeap(),0,This); return 0; } - + return This->ref; } @@ -196,7 +196,7 @@ static HRESULT WINAPI IDirect3DLightImpl_GetLight(LPDIRECT3DLIGHT iface, TRACE("(%p)->(%p)\n", This, lpLight); if (TRACE_ON(ddraw)) dump_light(lpLight); - + /* Copies the light structure */ switch (This->type) { case D3D_1: @@ -206,7 +206,7 @@ static HRESULT WINAPI IDirect3DLightImpl_GetLight(LPDIRECT3DLIGHT iface, *((LPD3DLIGHT2)lpLight) = *((LPD3DLIGHT2) &(This->light)); break; } - + return DD_OK; } @@ -217,7 +217,7 @@ static HRESULT WINAPI IDirect3DLightImpl_SetLight(LPDIRECT3DLIGHT iface, TRACE("(%p)->(%p)\n", This, lpLight); if (TRACE_ON(ddraw)) dump_light(lpLight); - + /* Stores the light */ switch (This->type) { case D3D_1: @@ -227,12 +227,12 @@ static HRESULT WINAPI IDirect3DLightImpl_SetLight(LPDIRECT3DLIGHT iface, *((LPD3DLIGHT2) &(This->light)) = *((LPD3DLIGHT2)lpLight); break; } - + ENTER_GL(); if (This->is_active) update(This); LEAVE_GL(); - + return DD_OK; } @@ -250,7 +250,7 @@ static HRESULT WINAPI IDirect3DLightImpl_Initialize(LPDIRECT3DLIGHT iface, /******************************************************************************* * IDirect3DLight VTable */ -static ICOM_VTABLE(IDirect3DLight) light_vtable = +static ICOM_VTABLE(IDirect3DLight) light_vtable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /*** IUnknown methods ***/ diff --git a/dlls/ddraw/d3dmaterial.c b/dlls/ddraw/d3dmaterial.c index 64e61a009cf..ff8dbdd4b58 100644 --- a/dlls/ddraw/d3dmaterial.c +++ b/dlls/ddraw/d3dmaterial.c @@ -38,7 +38,7 @@ static ICOM_VTABLE(IDirect3DMaterial) material_vtable; */ static void activate(IDirect3DMaterial2Impl* This) { TRACE("Activating material %p\n", This); - + ENTER_GL(); /* First, set the rendering context */ if (This->use_d3d2) @@ -63,13 +63,13 @@ static void activate(IDirect3DMaterial2Impl* This) { glMaterialfv(GL_FRONT, GL_EMISSION, (float *) &(This->mat.u3.emissive)); - + TRACE("Size : %ld\n", This->mat.dwSize); TRACE("Power : %f\n", This->mat.u4.power); TRACE("Texture handle : %08lx\n", (DWORD)This->mat.hTexture); LEAVE_GL(); - + return ; } @@ -79,7 +79,7 @@ static void activate(IDirect3DMaterial2Impl* This) { LPDIRECT3DMATERIAL2 d3dmaterial2_create(IDirect3D2Impl* d3d2) { IDirect3DMaterial2Impl* mat; - + mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DMaterial2Impl)); mat->ref = 1; ICOM_VTBL(mat) = &material2_vtable; @@ -88,14 +88,14 @@ LPDIRECT3DMATERIAL2 d3dmaterial2_create(IDirect3D2Impl* d3d2) mat->d3d.d3d2 = d3d2; mat->activate = activate; - + return (LPDIRECT3DMATERIAL2)mat; } LPDIRECT3DMATERIAL d3dmaterial_create(IDirect3DImpl* d3d1) { IDirect3DMaterial2Impl* mat; - + mat = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DMaterial2Impl)); mat->ref = 1; ICOM_VTBL(mat) = (ICOM_VTABLE(IDirect3DMaterial2)*)&material_vtable; @@ -104,7 +104,7 @@ LPDIRECT3DMATERIAL d3dmaterial_create(IDirect3DImpl* d3d1) mat->d3d.d3d1 = d3d1; mat->activate = activate; - + return (LPDIRECT3DMATERIAL) mat; } @@ -117,9 +117,9 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_QueryInterface(LPDIRECT3DMATERIAL2 LPVOID* ppvObj) { ICOM_THIS(IDirect3DMaterial2Impl,iface); - + FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); - + return S_OK; } @@ -129,7 +129,7 @@ static ULONG WINAPI IDirect3DMaterial2Impl_AddRef(LPDIRECT3DMATERIAL2 iface) { ICOM_THIS(IDirect3DMaterial2Impl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); - + return ++(This->ref); } @@ -139,12 +139,12 @@ static ULONG WINAPI IDirect3DMaterial2Impl_Release(LPDIRECT3DMATERIAL2 iface) { ICOM_THIS(IDirect3DMaterial2Impl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); - + if (!--(This->ref)) { HeapFree(GetProcessHeap(),0,This); return 0; } - + return This->ref; } @@ -161,10 +161,10 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_GetMaterial(LPDIRECT3DMATERIAL2 ifa TRACE("(%p)->(%p)\n", This, lpMat); if (TRACE_ON(ddraw)) dump_material(lpMat); - + /* Copies the material structure */ *lpMat = This->mat; - + return DD_OK; } @@ -175,10 +175,10 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_SetMaterial(LPDIRECT3DMATERIAL2 ifa TRACE("(%p)->(%p)\n", This, lpMat); if (TRACE_ON(ddraw)) dump_material(lpMat); - + /* Stores the material */ This->mat = *lpMat; - + return DD_OK; } @@ -194,9 +194,9 @@ static HRESULT WINAPI IDirect3DMaterial2Impl_GetHandle(LPDIRECT3DMATERIAL2 iface This->device.active_device2 = (IDirect3DDevice2Impl*)lpD3DDevice2; else This->device.active_device1 = (IDirect3DDeviceImpl*)lpD3DDevice2; - + *lpMatHandle = (DWORD) This; /* lpD3DDevice2->store_material(This); */ - + return DD_OK; } @@ -207,7 +207,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_Reserve(LPDIRECT3DMATERIAL iface) return DDERR_INVALIDPARAMS; } - + static HRESULT WINAPI IDirect3DMaterialImpl_Unreserve(LPDIRECT3DMATERIAL iface) { ICOM_THIS(IDirect3DMaterial2Impl,iface); @@ -222,7 +222,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_Initialize(LPDIRECT3DMATERIAL iface, { ICOM_THIS(IDirect3DMaterial2Impl,iface); TRACE("(%p)->(%p)\n", This, lpDirect3D); - + return DDERR_ALREADYINITIALIZED; } @@ -236,7 +236,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_Initialize(LPDIRECT3DMATERIAL iface, # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirect3DMaterial) material_vtable = +static ICOM_VTABLE(IDirect3DMaterial) material_vtable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /*** IUnknown methods ***/ @@ -259,7 +259,7 @@ static ICOM_VTABLE(IDirect3DMaterial) material_vtable = /******************************************************************************* * IDirect3DMaterial2 VTable */ -static ICOM_VTABLE(IDirect3DMaterial2) material2_vtable = +static ICOM_VTABLE(IDirect3DMaterial2) material2_vtable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /*** IUnknown methods ***/ diff --git a/dlls/ddraw/d3dtexture.c b/dlls/ddraw/d3dtexture.c index 199a1dac19b..9728f97851c 100644 --- a/dlls/ddraw/d3dtexture.c +++ b/dlls/ddraw/d3dtexture.c @@ -43,7 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw); #ifdef TEXTURE_SNOOP #include - + #define SNOOP_PALETTED() \ { \ FILE *f; \ @@ -118,14 +118,14 @@ extern ICOM_VTABLE(IDirect3DTexture) mesa_texture_vtable; LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurfaceImpl* surf) { IDirect3DTexture2Impl* tex; - + tex = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2Impl)); tex->ref = 1; ICOM_VTBL(tex) = &mesa_texture2_vtable; tex->surface = surf; tex->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dt_private)); - + return (LPDIRECT3DTEXTURE2)tex; } @@ -135,14 +135,14 @@ LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurfaceImpl* surf) LPDIRECT3DTEXTURE d3dtexture_create(IDirectDrawSurfaceImpl* surf) { IDirect3DTexture2Impl* tex; - + tex = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2Impl)); tex->ref = 1; ICOM_VTBL(tex) = (ICOM_VTABLE(IDirect3DTexture2)*)&mesa_texture_vtable; tex->surface = surf; tex->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dt_private)); - + return (LPDIRECT3DTEXTURE)tex; } @@ -155,7 +155,7 @@ HRESULT WINAPI SetColorKey_cb(IDirect3DTexture2Impl *texture, DWORD dwFlags, LP D3DTPRIVATE(texture); int bpp; GLuint current_texture; - + TRACE("(%p) : colorkey callback\n", texture); /* Get the texture description */ @@ -163,7 +163,7 @@ HRESULT WINAPI SetColorKey_cb(IDirect3DTexture2Impl *texture, DWORD dwFlags, LP bpp = (tex_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8 ? 1 /* 8 bit of palette index */: tex_d->ddpfPixelFormat.u1.dwRGBBitCount / 8 /* RGB bits for each colors */ ); - + /* Now, save the current texture */ ENTER_GL(); glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_texture); @@ -193,13 +193,13 @@ HRESULT WINAPI SetColorKey_cb(IDirect3DTexture2Impl *texture, DWORD dwFlags, LP for (y = 0; y < tex_d->dwHeight; y++) { for (x = 0; x < tex_d->dwWidth; x++) { unsigned short cpixel = src[x + y * tex_d->dwWidth]; - + if ((dwFlags & DDCKEY_SRCBLT) && (cpixel >= ckey->dwColorSpaceLowValue) && (cpixel <= ckey->dwColorSpaceHighValue)) /* No alpha bit => this pixel is transparent */ dest[x + y * tex_d->dwWidth] = (cpixel & ~0x003F) | ((cpixel & 0x001F) << 1) | 0x0000; else /* Alpha bit is set => this pixel will be seen */ - dest[x + y * tex_d->dwWidth] = (cpixel & ~0x003F) | ((cpixel & 0x001F) << 1) | 0x0001; + dest[x + y * tex_d->dwWidth] = (cpixel & ~0x003F) | ((cpixel & 0x001F) << 1) | 0x0001; } } @@ -245,9 +245,9 @@ HRESULT WINAPI IDirect3DTexture2Impl_QueryInterface(LPDIRECT3DTEXTURE2 iface, LPVOID* ppvObj) { ICOM_THIS(IDirect3DTexture2Impl,iface); - + FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); - + return S_OK; } @@ -257,7 +257,7 @@ ULONG WINAPI IDirect3DTexture2Impl_AddRef(LPDIRECT3DTEXTURE2 iface) { ICOM_THIS(IDirect3DTexture2Impl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); - + return ++(This->ref); } @@ -268,20 +268,20 @@ ULONG WINAPI IDirect3DTexture2Impl_Release(LPDIRECT3DTEXTURE2 iface) ICOM_THIS(IDirect3DTexture2Impl,iface); D3DTPRIVATE(This); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); - + if (!--(This->ref)) { /* Delete texture from OpenGL */ ENTER_GL(); glDeleteTextures(1, &(dtpriv->tex_name)); LEAVE_GL(); - + /* Release surface */ IDirectDrawSurface4_Release((IDirectDrawSurface4*)This->surface); - + HeapFree(GetProcessHeap(),0,This); return 0; } - + return This->ref; } @@ -392,7 +392,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( /* Install the callbacks to the destination surface */ This->surface->texture = This; This->surface->SetColorKey_cb = SetColorKey_cb; - + if ((src_d->dwWidth != dst_d->dwWidth) || (src_d->dwHeight != dst_d->dwHeight)) { /* Should also check for same pixel format, lPitch, ... */ ERR("Error in surface sizes\n"); @@ -410,7 +410,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( memcpy(dst_d->lpSurface, src_d->lpSurface, src_d->dwWidth * src_d->dwHeight * bpp); ENTER_GL(); - + /* Now, load the texture */ /* d3dd->set_context(d3dd); We need to set the context somehow.... */ glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_texture); @@ -434,7 +434,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( ((Mesa_DeviceCapabilities *) ((x11_dd_private *) This->surface->s.ddraw->d->private)->device_capabilities)->ptr_ColorTableEXT; } #endif - + if (pal == NULL) { ERR("Palettized texture Loading with a NULL palette !\n"); LEAVE_GL(); @@ -453,7 +453,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( else table[i][3] = 0xFF; } - + /* Texture snooping */ SNOOP_PALETTED(); @@ -465,7 +465,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( GL_RGBA, /* table format */ GL_UNSIGNED_BYTE, /* table type */ table); /* the color table */ - + glTexImage2D(GL_TEXTURE_2D, /* target */ 0, /* level */ GL_COLOR_INDEX8_EXT, /* internal format */ @@ -478,7 +478,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( DWORD *surface = (DWORD *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, src_d->dwWidth * src_d->dwHeight * sizeof(DWORD)); DWORD i; BYTE *src = (BYTE *) src_d->lpSurface, *dst = (BYTE *) surface; - + for (i = 0; i < src_d->dwHeight * src_d->dwWidth; i++) { BYTE color = *src++; *dst++ = table[color][0]; @@ -486,7 +486,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( *dst++ = table[color][2]; *dst++ = table[color][3]; } - + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, @@ -495,7 +495,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( GL_RGBA, GL_UNSIGNED_BYTE, surface); - + HeapFree(GetProcessHeap(), 0, surface); } } else if (src_d->ddpfPixelFormat.dwFlags & DDPF_RGB) { @@ -504,7 +504,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( ************ */ if (src_d->ddpfPixelFormat.u1.dwRGBBitCount == 8) { /* ********************** - GL_UNSIGNED_BYTE_3_3_2 + GL_UNSIGNED_BYTE_3_3_2 ********************** */ glTexImage2D(GL_TEXTURE_2D, 0, @@ -516,10 +516,10 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( src_d->lpSurface); } else if (src_d->ddpfPixelFormat.u1.dwRGBBitCount == 16) { if (src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00000000) { - + /* Texture snooping */ SNOOP_5650(); - + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, @@ -531,7 +531,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( } else if (src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00000001) { /* Texture snooping */ SNOOP_5551(); - + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, @@ -560,7 +560,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( ((*src & 0x7FFF) << 1)); src++; } - + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, @@ -569,8 +569,8 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, surface); - - HeapFree(GetProcessHeap(), 0, surface); + + HeapFree(GetProcessHeap(), 0, surface); } else { ERR("Unhandled texture format (bad Aplha channel for a 16 bit texture)\n"); } @@ -603,7 +603,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( LEAVE_GL(); } - + return D3D_OK; } @@ -611,7 +611,7 @@ HRESULT WINAPI IDirect3DTexture2Impl_Load( /******************************************************************************* * IDirect3DTexture2 VTable */ -ICOM_VTABLE(IDirect3DTexture2) mesa_texture2_vtable = +ICOM_VTABLE(IDirect3DTexture2) mesa_texture2_vtable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /*** IUnknown methods ***/ @@ -633,7 +633,7 @@ ICOM_VTABLE(IDirect3DTexture2) mesa_texture2_vtable = # define XCAST(fun) (void*) #endif -ICOM_VTABLE(IDirect3DTexture) mesa_texture_vtable = +ICOM_VTABLE(IDirect3DTexture) mesa_texture_vtable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /*** IUnknown methods ***/ diff --git a/dlls/ddraw/d3dviewport.c b/dlls/ddraw/d3dviewport.c index 4cf4608a6dd..0309ba33831 100644 --- a/dlls/ddraw/d3dviewport.c +++ b/dlls/ddraw/d3dviewport.c @@ -43,7 +43,7 @@ static ICOM_VTABLE(IDirect3DViewport2) viewport2_vtable; */ static void activate(IDirect3DViewport2Impl* This) { IDirect3DLightImpl* l; - + /* Activate all the lights associated with this context */ l = This->lights; @@ -59,7 +59,7 @@ static void activate(IDirect3DViewport2Impl* This) { LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2) { IDirect3DViewport2Impl* vp; - + vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2Impl)); vp->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dv_private)); vp->ref = 1; @@ -73,14 +73,14 @@ LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2) vp->lights = NULL; ((mesa_d3dv_private *) vp->private)->nextlight = GL_LIGHT0; - + return (LPDIRECT3DVIEWPORT2)vp; } LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1) { IDirect3DViewport2Impl* vp; - + vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2Impl)); vp->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dv_private)); vp->ref = 1; @@ -94,7 +94,7 @@ LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1) vp->lights = NULL; ((mesa_d3dv_private *) vp->private)->nextlight = GL_LIGHT0; - + return (LPDIRECT3DVIEWPORT) vp; } @@ -107,9 +107,9 @@ HRESULT WINAPI IDirect3DViewport2Impl_QueryInterface(LPDIRECT3DVIEWPORT2 iface, LPVOID* ppvObj) { ICOM_THIS(IDirect3DViewport2Impl,iface); - + FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj); - + return S_OK; } @@ -119,7 +119,7 @@ ULONG WINAPI IDirect3DViewport2Impl_AddRef(LPDIRECT3DVIEWPORT2 iface) { ICOM_THIS(IDirect3DViewport2Impl,iface); TRACE("(%p)->()incrementing from %lu.\n", This, This->ref ); - + return ++(This->ref); } @@ -129,12 +129,12 @@ ULONG WINAPI IDirect3DViewport2Impl_Release(LPDIRECT3DVIEWPORT2 iface) { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->() decrementing from %lu.\n", This, This->ref ); - + if (!--(This->ref)) { HeapFree(GetProcessHeap(),0,This); return 0; } - + return This->ref; } @@ -144,7 +144,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_Initialize(LPDIRECT3DVIEWPORT2 iface, { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p): stub\n", This, d3d); - + return DD_OK; } @@ -153,12 +153,12 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetViewport(LPDIRECT3DVIEWPORT2 iface, { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpvp); - + if (This->use_vp2 != 0) return DDERR_INVALIDPARAMS; *lpvp = This->viewport.vp1; - + return DD_OK; } @@ -170,7 +170,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport(LPDIRECT3DVIEWPORT2 iface, This->use_vp2 = 0; This->viewport.vp1 = *lpvp; - + TRACE("dwSize = %ld dwX = %ld dwY = %ld\n", lpvp->dwSize, lpvp->dwX, lpvp->dwY); TRACE("dwWidth = %ld dwHeight = %ld\n", @@ -182,7 +182,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport(LPDIRECT3DVIEWPORT2 iface, TRACE("dvMinZ = %f dvMaxZ = %f\n", lpvp->dvMinZ, lpvp->dvMaxZ); - + return DD_OK; } @@ -195,7 +195,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_TransformVertices(LPDIRECT3DVIEWPORT2 ifac ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%8ld,%p,%08lx,%p): stub\n", This, dwVertexCount, lpData, dwFlags, lpOffScreen); - + return DD_OK; } @@ -205,7 +205,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_LightElements(LPDIRECT3DVIEWPORT2 iface, { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%8ld,%p): stub\n", This, dwElementCount, lpData); - + return DD_OK; } @@ -214,7 +214,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetBackground(LPDIRECT3DVIEWPORT2 iface, { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%08lx): stub\n", This, (DWORD) hMat); - + return DD_OK; } @@ -224,7 +224,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetBackground(LPDIRECT3DVIEWPORT2 iface, { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lphMat, lpValid); - + return DD_OK; } @@ -233,7 +233,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetBackgroundDepth(LPDIRECT3DVIEWPORT2 ifa { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpDDSurface); - + return DD_OK; } @@ -243,7 +243,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetBackgroundDepth(LPDIRECT3DVIEWPORT2 ifa { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p,%p): stub\n", This, lplpDDSurface, lpValid); - + return DD_OK; } @@ -272,7 +272,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_Clear(LPDIRECT3DVIEWPORT2 iface, glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDepthMask(ztest); LEAVE_GL(); - + return DD_OK; } @@ -291,18 +291,18 @@ HRESULT WINAPI IDirect3DViewport2Impl_AddLight(LPDIRECT3DVIEWPORT2 iface, if (This->device.active_device1 != NULL) { D3DVPRIVATE(This); D3DLPRIVATE(ilpLight); - + /* Get the rendering context */ if (This->use_d3d2) This->device.active_device2->set_context(This->device.active_device2); else This->device.active_device1->set_context(This->device.active_device1); - + /* Activate the light */ dlpriv->light_num = dvpriv->nextlight++; ilpLight->activate(ilpLight); } - + return DD_OK; } @@ -311,7 +311,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_DeleteLight(LPDIRECT3DVIEWPORT2 iface, { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p): stub\n", This, lpLight); - + return DD_OK; } @@ -322,7 +322,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_NextLight(LPDIRECT3DVIEWPORT2 iface, { ICOM_THIS(IDirect3DViewport2Impl,iface); FIXME("(%p)->(%p,%p,%08lx): stub\n", This, lpLight, lplpLight, dwFlags); - + return DD_OK; } @@ -337,7 +337,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_GetViewport2(LPDIRECT3DVIEWPORT2 iface, return DDERR_INVALIDPARAMS; *lpViewport2 = This->viewport.vp2; - + return DD_OK; } @@ -360,7 +360,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport2(LPDIRECT3DVIEWPORT2 iface, This->viewport.vp2 = *lpViewport2; This->use_vp2 = 1; - + return DD_OK; } @@ -368,7 +368,7 @@ HRESULT WINAPI IDirect3DViewport2Impl_SetViewport2(LPDIRECT3DVIEWPORT2 iface, /******************************************************************************* * IDirect3DViewport1/2 VTable */ -static ICOM_VTABLE(IDirect3DViewport2) viewport2_vtable = +static ICOM_VTABLE(IDirect3DViewport2) viewport2_vtable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /*** IUnknown methods ***/ diff --git a/dlls/ddraw/dclipper/main.c b/dlls/ddraw/dclipper/main.c index 9f642913f54..ae9c83eec88 100644 --- a/dlls/ddraw/dclipper/main.c +++ b/dlls/ddraw/dclipper/main.c @@ -54,7 +54,7 @@ HRESULT WINAPI DirectDrawCreateClipper( ICOM_INIT_INTERFACE(This, IDirectDrawClipper, DDRAW_Clipper_VTable); This->ref = 1; - This->hWnd = 0; + This->hWnd = 0; This->ddraw_owner = NULL; *lplpDDClipper = ICOM_INTERFACE(This, IDirectDrawClipper); @@ -87,7 +87,7 @@ HRESULT WINAPI Main_DirectDrawClipper_SetHwnd( TRACE("(%p)->SetHwnd(0x%08lx,0x%08lx)\n",This,dwFlags,(DWORD)hWnd); if( dwFlags ) { FIXME("dwFlags = 0x%08lx, not supported.\n",dwFlags); - return DDERR_INVALIDPARAMS; + return DDERR_INVALIDPARAMS; } This->hWnd = hWnd; @@ -170,7 +170,7 @@ HRESULT WINAPI Main_DirectDrawClipper_GetHWnd( ICOM_THIS(IDirectDrawClipperImpl,iface); FIXME("(%p)->(%p),stub!\n",This,hWndPtr); - *hWndPtr = This->hWnd; + *hWndPtr = This->hWnd; return DD_OK; } diff --git a/dlls/ddraw/ddraw/hal.c b/dlls/ddraw/ddraw/hal.c index 9710e52d8e8..d2b8ddc0da1 100644 --- a/dlls/ddraw/ddraw/hal.c +++ b/dlls/ddraw/ddraw/hal.c @@ -47,7 +47,7 @@ static DDVERSIONDATA hal_version; static DD32BITDRIVERDATA hal_driverdata; static HINSTANCE hal_instance; -static const DDDEVICEIDENTIFIER2 hal_device = +static const DDDEVICEIDENTIFIER2 hal_device = { "display", "DirectDraw HAL", @@ -501,7 +501,7 @@ HAL_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth, TRACE("(%p)->(%ldx%ldx%ld,%ld Hz,%08lx)\n",This,dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags); hr = User_DirectDraw_SetDisplayMode(iface, dwWidth, dwHeight, dwBPP, - dwRefreshRate, dwFlags); + dwRefreshRate, dwFlags); if (SUCCEEDED(hr)) { if (!(dd_gbl.dwFlags & DDRAWI_MODECHANGED)) dd_gbl.dwModeIndexOrig = dd_gbl.dwModeIndex; diff --git a/dlls/ddraw/ddraw/hal.h b/dlls/ddraw/ddraw/hal.h index 89cc8d881aa..32ca71d4b01 100644 --- a/dlls/ddraw/ddraw/hal.h +++ b/dlls/ddraw/ddraw/hal.h @@ -50,11 +50,11 @@ HRESULT HAL_DirectDraw_create_texture(IDirectDrawImpl* This, LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter, DWORD dwMipMapLevel); - + HRESULT HAL_DirectDraw_Construct(IDirectDrawImpl *This, BOOL ex); HRESULT HAL_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface, IUnknown* pUnkOuter, BOOL ex); - + HRESULT WINAPI HAL_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW7 iface, diff --git a/dlls/ddraw/ddraw/main.c b/dlls/ddraw/ddraw/main.c index 3d6126867ac..b4bd0d505d1 100644 --- a/dlls/ddraw/ddraw/main.c +++ b/dlls/ddraw/ddraw/main.c @@ -915,11 +915,11 @@ Main_DirectDraw_SetCooperativeLevel(LPDIRECTDRAW7 iface, HWND hwnd, return DD_OK; /* XXX "It cannot be reset while the process has surfaces or palettes - * created." Otherwise the window can be changed??? - * + * created." Otherwise the window can be changed??? + * * This appears to be wrong - comment it out for now. if (This->window) - return DDERR_HWNDALREADYSET; + return DDERR_HWNDALREADYSET; */ if (!(cooplevel & (DDSCL_EXCLUSIVE|DDSCL_NORMAL))) @@ -965,7 +965,7 @@ Main_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth, { short screenX; short screenY; - + ICOM_THIS(IDirectDrawImpl,iface); TRACE("(%p)->SetDisplayMode(%ld,%ld)\n",This,dwWidth,dwHeight); @@ -980,14 +980,14 @@ Main_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth, screenX = GetSystemMetrics(SM_CXSCREEN); screenY = GetSystemMetrics(SM_CYSCREEN); - + This->width = dwWidth; This->height = dwHeight; This->pitch = lPitch; This->pixelformat = *pixelformat; /* Position the window in the center of the screen - don't center for now */ - /* MoveWindow(This->window, (screenX-dwWidth)/2, (screenY-dwHeight)/2, + /* MoveWindow(This->window, (screenX-dwWidth)/2, (screenY-dwHeight)/2, dwWidth, dwHeight, TRUE);*/ MoveWindow(This->window, 0, 0, dwWidth, dwHeight, TRUE); @@ -1208,7 +1208,7 @@ LosePrimarySurface(IDirectDrawImpl *This) /****************************************************************************** * Uninitialised DirectDraw functions - * + * * This vtable is used when a DirectDraw object is created with * CoCreateInstance. The only usable method is Initialize. */ diff --git a/dlls/ddraw/ddraw/thunks.c b/dlls/ddraw/ddraw/thunks.c index 69a928adde9..396824d044c 100644 --- a/dlls/ddraw/ddraw/thunks.c +++ b/dlls/ddraw/ddraw/thunks.c @@ -202,7 +202,7 @@ IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc, LPDIRECTDRAWSURFACE7 pSurface7; HRESULT hr; - /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok, + /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok, * since the data layout is the same */ hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw, @@ -387,7 +387,7 @@ EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD, /* This coercion is safe, since the IDirectDrawSurface3 vtable has the * IDirectDrawSurface vtable layout at the beginning */ - return cbcontext->func((LPDIRECTDRAWSURFACE) + return cbcontext->func((LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7, IDirectDrawSurface3, pSurf), diff --git a/dlls/ddraw/ddraw/user.c b/dlls/ddraw/ddraw/user.c index b7810279abd..6b339e37028 100644 --- a/dlls/ddraw/ddraw/user.c +++ b/dlls/ddraw/ddraw/user.c @@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw); static ICOM_VTABLE(IDirectDraw7) User_DirectDraw_VTable; -static const DDDEVICEIDENTIFIER2 user_device = +static const DDDEVICEIDENTIFIER2 user_device = { "display", "User (and GDI)", @@ -48,7 +48,7 @@ static const DDDEVICEIDENTIFIER2 user_device = 0 }; -static const DDPIXELFORMAT pixelformats[] = +static const DDPIXELFORMAT pixelformats[] = { /* 8bpp paletted */ { sizeof(DDPIXELFORMAT), DDPF_RGB|DDPF_PALETTEINDEXED8, 0, { 8 } }, @@ -409,7 +409,7 @@ User_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, #define ROPS { 0, } #endif - static const DDCAPS caps = + static const DDCAPS caps = { sizeof(DDCAPS), DDCAPS_3D | DDCAPS_GDI | DDCAPS_PALETTE | BLIT_CAPS, DDCAPS2_CANMANAGETEXTURE | DDCAPS2_CANRENDERWINDOWED | DDCAPS2_CERTIFIED @@ -484,7 +484,7 @@ User_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, #undef ROPS ICOM_THIS(IDirectDrawImpl, iface); - + TRACE("(%p)->(%p,%p)\n",This,pDriverCaps,pHELCaps); if (pDriverCaps != NULL) diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index a7ad8dd0952..1bd5552ce50 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -139,7 +139,7 @@ struct IDirectDrawImpl HRESULT (*create_zbuffer)(IDirectDrawImpl* This, const DDSURFACEDESC2* pDDSD, LPDIRECTDRAWSURFACE7* ppSurf, LPUNKNOWN pOuter); - + LPVOID private; /* Everything below here is still questionable. */ @@ -281,7 +281,7 @@ struct IDirectDrawSurfaceImpl BOOL (*aux_flip)(LPVOID ctx, LPVOID data); void (*aux_unlock)(LPVOID ctx, LPVOID data, LPRECT lpRect); struct IDirect3DTexture2Impl* texture; - HRESULT (WINAPI *SetColorKey_cb)(struct IDirect3DTexture2Impl *texture, DWORD dwFlags, LPDDCOLORKEY ckey ) ; + HRESULT (WINAPI *SetColorKey_cb)(struct IDirect3DTexture2Impl *texture, DWORD dwFlags, LPDDCOLORKEY ckey ) ; }; /***************************************************************************** diff --git a/dlls/ddraw/direct3d/main.c b/dlls/ddraw/direct3d/main.c index b212f8f7039..61f5fb62676 100644 --- a/dlls/ddraw/direct3d/main.c +++ b/dlls/ddraw/direct3d/main.c @@ -167,7 +167,7 @@ static ICOM_VTABLE(IDirect3D) WINE_UNUSED d3dvt = { * IDirect3D2 */ HRESULT WINAPI IDirect3D2Impl_QueryInterface( - LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) { + LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) { ICOM_THIS(IDirect3D2Impl,iface); /* FIXME: Not sure if this is correct */ @@ -180,7 +180,7 @@ HRESULT WINAPI IDirect3D2Impl_QueryInterface( IDirect3D2_AddRef(iface); TRACE(" Creating IDirectDrawX interface (%p)\n", *obj); - + return S_OK; } if ( ( IsEqualGUID( &IID_IDirect3D2, refiid ) ) || @@ -280,7 +280,7 @@ HRESULT WINAPI IDirect3D2Impl_CreateDevice( /* This is for checking the correctness of the prototypes/functions. * Do not remove. */ -static ICOM_VTABLE(IDirect3D2) WINE_UNUSED d3d2vt = +static ICOM_VTABLE(IDirect3D2) WINE_UNUSED d3d2vt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirect3D2Impl_QueryInterface, diff --git a/dlls/ddraw/direct3d/mesa.c b/dlls/ddraw/direct3d/mesa.c index fa5a5366aba..ddbee96858d 100644 --- a/dlls/ddraw/direct3d/mesa.c +++ b/dlls/ddraw/direct3d/mesa.c @@ -148,7 +148,7 @@ static HRESULT WINAPI MESA_IDirect3DImpl_FindDevice( return D3D_OK; } -ICOM_VTABLE(IDirect3D) mesa_d3dvt = +ICOM_VTABLE(IDirect3D) mesa_d3dvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE MESA_IDirect3DImpl_QueryInterface, @@ -166,7 +166,7 @@ ICOM_VTABLE(IDirect3D) mesa_d3dvt = * IDirect3D2 */ static HRESULT WINAPI MESA_IDirect3D2Impl_QueryInterface( - LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) { + LPDIRECT3D2 iface,REFIID refiid,LPVOID *obj) { ICOM_THIS(IDirect3D2Impl,iface); /* FIXME: Not sure if this is correct */ @@ -179,7 +179,7 @@ static HRESULT WINAPI MESA_IDirect3D2Impl_QueryInterface( IDirect3D2_AddRef(iface); TRACE(" Creating IDirectDrawX interface (%p)\n", *obj); - + return S_OK; } if ( ( IsEqualGUID( &IID_IDirect3D2, refiid ) ) || @@ -292,7 +292,7 @@ static HRESULT WINAPI MESA_IDirect3D2Impl_CreateDevice( return DDERR_INVALIDPARAMS; } -ICOM_VTABLE(IDirect3D2) mesa_d3d2vt = +ICOM_VTABLE(IDirect3D2) mesa_d3d2vt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE MESA_IDirect3D2Impl_QueryInterface, @@ -405,7 +405,7 @@ HRESULT create_direct3d3(LPVOID *obj,IDirectDrawImpl* ddraw) { *obj = (LPUNKNOWN)d3d; TRACE(" Creating IDirect3D3 interface (%p)\n", *obj); - + return S_OK; } diff --git a/dlls/ddraw/dpalette/main.c b/dlls/ddraw/dpalette/main.c index 31259432147..a2c972f87fc 100644 --- a/dlls/ddraw/dpalette/main.c +++ b/dlls/ddraw/dpalette/main.c @@ -194,7 +194,7 @@ static void Main_DirectDrawPalette_Destroy(IDirectDrawPaletteImpl* This) if (This->private != This+1) HeapFree(GetProcessHeap(), 0, This->private); - + HeapFree(GetProcessHeap(),0,This); } @@ -244,7 +244,7 @@ Main_DirectDrawPalette_GetCaps(LPDIRECTDRAWPALETTE iface, LPDWORD lpdwCaps) *lpdwCaps = This->flags; return DD_OK; -} +} HRESULT WINAPI Main_DirectDrawPalette_QueryInterface(LPDIRECTDRAWPALETTE iface, diff --git a/dlls/ddraw/dsurface/dib.c b/dlls/ddraw/dsurface/dib.c index b013d016b01..ed6970124f2 100644 --- a/dlls/ddraw/dsurface/dib.c +++ b/dlls/ddraw/dsurface/dib.c @@ -455,7 +455,7 @@ DIB_DirectDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rdst, break; case SRCCOPY: /* well, we do that below ? */ break; - default: + default: FIXME("Unsupported raster op: %08lx Pattern: %p\n", lpbltfx->dwROP, lpbltfx->u5.lpDDSPattern); goto error; } @@ -623,7 +623,7 @@ DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dstx, else FIXME(" srcrect: NULL\n"); } - + /* We need to lock the surfaces, or we won't get refreshes when done. */ sdesc.dwSize = sizeof(sdesc); IDirectDrawSurface7_Lock(src, NULL,&sdesc,DDLOCK_READONLY, 0); @@ -824,7 +824,7 @@ DIB_DirectDrawSurface_Restore(LPDIRECTDRAWSURFACE7 iface) /* SetOverlayPosition: generic */ void DIB_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This, - IDirectDrawPaletteImpl* pal) + IDirectDrawPaletteImpl* pal) { if (!pal) return; if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) diff --git a/dlls/ddraw/dsurface/gamma.c b/dlls/ddraw/dsurface/gamma.c index eb874dd717c..d67141ac52b 100644 --- a/dlls/ddraw/dsurface/gamma.c +++ b/dlls/ddraw/dsurface/gamma.c @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw); static HRESULT WINAPI DirectDrawGammaControl_QueryInterface(LPDIRECTDRAWGAMMACONTROL iface, REFIID riid, - LPVOID *ppObj) + LPVOID *ppObj) { TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ppObj); return E_NOINTERFACE; @@ -47,13 +47,13 @@ DirectDrawGammaControl_AddRef(LPDIRECTDRAWGAMMACONTROL iface) { return IDirectDrawSurface7_AddRef(CONVERT(iface)); } - + static ULONG WINAPI DirectDrawGammaControl_Release(LPDIRECTDRAWGAMMACONTROL iface) { return IDirectDrawSurface7_Release(CONVERT(iface)); } - + static HRESULT WINAPI DirectDrawGammaControl_GetGammaRamp(LPDIRECTDRAWGAMMACONTROL iface, DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) { diff --git a/dlls/ddraw/dsurface/hal.c b/dlls/ddraw/dsurface/hal.c index 5cf70e5df13..d016cd496f4 100644 --- a/dlls/ddraw/dsurface/hal.c +++ b/dlls/ddraw/dsurface/hal.c @@ -107,7 +107,7 @@ HAL_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This, /* the driver may want to dereference these pointers */ This->local.lpSurfMore = &This->more; - This->local.lpGbl = &This->global; + This->local.lpGbl = &This->global; This->gmore = &This->global_more; if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE) { @@ -229,7 +229,7 @@ HRESULT HAL_DirectDrawSurface_late_allocate(IDirectDrawSurfaceImpl* This) } void HAL_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This, - IDirectDrawPaletteImpl* pal) + IDirectDrawPaletteImpl* pal) { LPDDRAWI_DIRECTDRAW_GBL dd_gbl = This->more.lpDD_lcl->lpGbl; DDHAL_SETPALETTEDATA data; diff --git a/dlls/ddraw/dsurface/main.c b/dlls/ddraw/dsurface/main.c index a62d105262a..c0b0794bdf7 100644 --- a/dlls/ddraw/dsurface/main.c +++ b/dlls/ddraw/dsurface/main.c @@ -480,7 +480,7 @@ Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface, /* MSDN: "The method fails if the specified [override] surface is not * a member of the flipping chain." */ - + /* Verify that override is on this flip chain. We assume that * surf is the head of the flipping chain, because it's the front * buffer. */ @@ -575,8 +575,8 @@ Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface, if (found != NULL) { FIXME("More than one attached surface matches requested caps. What should we do here?\n"); - /* Previous code returned 'DDERR_NOTFOUND'. That appears not - to be correct, given what 3DMark expects from MipMapped surfaces. + /* Previous code returned 'DDERR_NOTFOUND'. That appears not + to be correct, given what 3DMark expects from MipMapped surfaces. We shall just continue instead. */ } @@ -846,12 +846,12 @@ Main_DirectDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface, ICOM_THIS(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pDDSD); - if ((pDDSD->dwSize < sizeof(DDSURFACEDESC)) || + if ((pDDSD->dwSize < sizeof(DDSURFACEDESC)) || (pDDSD->dwSize > sizeof(DDSURFACEDESC2))) { ERR("Impossible/Strange struct size %ld.\n",pDDSD->dwSize); return DDERR_GENERIC; } - + DD_STRUCT_COPY_BYSIZE(pDDSD,&This->surface_desc); return DD_OK; } @@ -920,7 +920,7 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, } This->lock_update(This, prect, flags); - + pDDSD->lpSurface = (char *)This->surface_desc.lpSurface + prect->top * This->surface_desc.u1.lPitch + prect->left * GET_BPP(This->surface_desc); diff --git a/dlls/ddraw/dsurface/user.c b/dlls/ddraw/dsurface/user.c index 3c01f3eda95..f949e09e6e1 100644 --- a/dlls/ddraw/dsurface/user.c +++ b/dlls/ddraw/dsurface/user.c @@ -210,7 +210,7 @@ void User_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This, } void User_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This, - IDirectDrawPaletteImpl* pal) + IDirectDrawPaletteImpl* pal) { USER_PRIV_VAR(priv, This); diff --git a/dlls/ddraw/helper.c b/dlls/ddraw/helper.c index 0d3ee64d325..a775bb582c6 100644 --- a/dlls/ddraw/helper.c +++ b/dlls/ddraw/helper.c @@ -153,7 +153,7 @@ void DDRAW_dump_DDBLT(DWORD flagmask) void DDRAW_dump_DDSCAPS(const DDSCAPS2 *in) { - static const flag_info flags[] = + static const flag_info flags[] = { FE(DDSCAPS_RESERVED1), FE(DDSCAPS_ALPHA), diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c index 766af8a1665..d3f1a5ab867 100644 --- a/dlls/ddraw/main.c +++ b/dlls/ddraw/main.c @@ -49,7 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw); typedef struct { LPVOID lpCallback; - LPVOID lpContext; + LPVOID lpContext; } DirectDrawEnumerateProcData; /*********************************************************************** @@ -104,7 +104,7 @@ HRESULT WINAPI DirectDrawEnumerateExA( */ static BOOL CALLBACK DirectDrawEnumerateExProcW( - GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, + GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext, HMONITOR hm) { INT len; @@ -143,7 +143,7 @@ HRESULT WINAPI DirectDrawEnumerateExW( */ static BOOL CALLBACK DirectDrawEnumerateProcA( - GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, + GUID *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext, HMONITOR hm) { DirectDrawEnumerateProcData *pEPD = (DirectDrawEnumerateProcData*)lpContext; @@ -153,9 +153,9 @@ static BOOL CALLBACK DirectDrawEnumerateProcA( } HRESULT WINAPI DirectDrawEnumerateA( - LPDDENUMCALLBACKA lpCallback, LPVOID lpContext) + LPDDENUMCALLBACKA lpCallback, LPVOID lpContext) { - DirectDrawEnumerateProcData epd; + DirectDrawEnumerateProcData epd; epd.lpCallback = (LPVOID) lpCallback; epd.lpContext = lpContext; @@ -167,17 +167,17 @@ HRESULT WINAPI DirectDrawEnumerateA( */ static BOOL WINAPI DirectDrawEnumerateProcW( - GUID *lpGUID, LPWSTR lpDriverDescription, LPWSTR lpDriverName, + GUID *lpGUID, LPWSTR lpDriverDescription, LPWSTR lpDriverName, LPVOID lpContext, HMONITOR hm) { DirectDrawEnumerateProcData *pEPD = (DirectDrawEnumerateProcData*)lpContext; - + return ((LPDDENUMCALLBACKW) pEPD->lpCallback)( lpGUID, lpDriverDescription, lpDriverName, pEPD->lpContext); } HRESULT WINAPI DirectDrawEnumerateW( - LPDDENUMCALLBACKW lpCallback, LPVOID lpContext) + LPDDENUMCALLBACKW lpCallback, LPVOID lpContext) { DirectDrawEnumerateProcData epd; epd.lpCallback = (LPVOID) lpCallback; @@ -341,7 +341,7 @@ static const struct object_creation_info object_creation[] = { &CLSID_DirectDrawClipper, DDRAW_CreateDirectDrawClipper } }; -static HRESULT WINAPI +static HRESULT WINAPI DDCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { ICOM_THIS(IClassFactoryImpl,iface); @@ -391,7 +391,7 @@ static HRESULT WINAPI DDCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { return S_OK; } -static ICOM_VTABLE(IClassFactory) DDCF_Vtbl = +static ICOM_VTABLE(IClassFactory) DDCF_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE DDCF_QueryInterface, diff --git a/dlls/ddraw/mesa.c b/dlls/ddraw/mesa.c index 62bf5600807..7c38354fb8c 100644 --- a/dlls/ddraw/mesa.c +++ b/dlls/ddraw/mesa.c @@ -29,7 +29,7 @@ #include "mesa_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ddraw); - + #define D3DTPRIVATE(x) mesa_d3dt_private *dtpriv = (mesa_d3dt_private*)(x)->private void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, @@ -40,25 +40,25 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, _dump_renderstate(dwRenderStateType, dwRenderState); /* First, all the stipple patterns */ - if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) && + if ((dwRenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00) && (dwRenderStateType <= D3DRENDERSTATE_STIPPLEPATTERN31)) { ERR("Unhandled dwRenderStateType stipple %d!\n",dwRenderStateType); } else { ENTER_GL(); - + /* All others state variables */ switch (dwRenderStateType) { case D3DRENDERSTATE_TEXTUREHANDLE: { /* 1 */ IDirect3DTexture2Impl* tex = (IDirect3DTexture2Impl*) dwRenderState; - + if (tex == NULL) { glBindTexture(GL_TEXTURE_2D, 0); glDisable(GL_TEXTURE_2D); TRACE("disabling texturing\n"); } else { D3DTPRIVATE(tex); - + glEnable(GL_TEXTURE_2D); /* Default parameters */ glBindTexture(GL_TEXTURE_2D, dtpriv->tex_name); @@ -76,14 +76,14 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, else glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); break; - + case D3DRENDERSTATE_ZENABLE: /* 7 */ if (dwRenderState) glEnable(GL_DEPTH_TEST); else glDisable(GL_DEPTH_TEST); break; - + case D3DRENDERSTATE_FILLMODE: /* 8 */ switch ((D3DFILLMODE) dwRenderState) { case D3DFILL_SOLID: @@ -108,24 +108,24 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, ERR("Unhandled shade mode !\n"); } break; - + case D3DRENDERSTATE_ZWRITEENABLE: /* 14 */ if (dwRenderState) glDepthMask(GL_TRUE); else glDepthMask(GL_FALSE); break; - + case D3DRENDERSTATE_TEXTUREMAG: /* 17 */ switch ((D3DTEXTUREFILTER) dwRenderState) { case D3DFILTER_NEAREST: rs->mag = GL_NEAREST; break; - + case D3DFILTER_LINEAR: rs->mag = GL_LINEAR; break; - + default: ERR("Unhandled texture mag !\n"); } @@ -136,16 +136,16 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, case D3DFILTER_NEAREST: rs->min = GL_NEAREST; break; - + case D3DFILTER_LINEAR: rs->mag = GL_LINEAR; break; - + default: ERR("Unhandled texture min !\n"); } break; - + case D3DRENDERSTATE_SRCBLEND: /* 19 */ switch ((D3DBLEND) dwRenderState) { case D3DBLEND_SRCALPHA: @@ -155,20 +155,20 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, default: ERR("Unhandled blend mode !\n"); } - + glBlendFunc(rs->src, rs->dst); break; - + case D3DRENDERSTATE_DESTBLEND: /* 20 */ switch ((D3DBLEND) dwRenderState) { case D3DBLEND_INVSRCALPHA: rs->dst = GL_ONE_MINUS_SRC_ALPHA; break; - + default: ERR("Unhandled blend mode !\n"); } - + glBlendFunc(rs->src, rs->dst); break; @@ -183,28 +183,28 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, ERR("Unhandled texture environment !\n"); } break; - + case D3DRENDERSTATE_CULLMODE: /* 22 */ switch ((D3DCULL) dwRenderState) { case D3DCULL_NONE: glDisable(GL_CULL_FACE); break; - + case D3DCULL_CW: glEnable(GL_CULL_FACE); glFrontFace(GL_CW); break; - + case D3DCULL_CCW: glEnable(GL_CULL_FACE); glFrontFace(GL_CCW); break; - + default: ERR("Unhandled cull mode !\n"); } break; - + case D3DRENDERSTATE_ZFUNC: /* 23 */ switch ((D3DCMPFUNC) dwRenderState) { case D3DCMP_NEVER: @@ -236,14 +236,14 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, ERR("Unexpected value\n"); } break; - + case D3DRENDERSTATE_DITHERENABLE: /* 26 */ if (dwRenderState) glEnable(GL_DITHER); else glDisable(GL_DITHER); break; - + case D3DRENDERSTATE_ALPHABLENDENABLE: /* 27 */ if (dwRenderState) glEnable(GL_BLEND); @@ -260,7 +260,7 @@ void set_render_state(D3DRENDERSTATETYPE dwRenderStateType, case D3DRENDERSTATE_FLUSHBATCH: /* 50 */ break; - + default: ERR("Unhandled dwRenderStateType %d!\n",dwRenderStateType); break; diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 9817a207b3f..9354d84ee32 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -125,19 +125,19 @@ void fill_DataFormat(void *out, void *in, DataFormat *df) { df->dt[i].offset_out, df->dt[i].offset_in, *((char *) (in_c + df->dt[i].offset_in))); *((char *) (out_c + df->dt[i].offset_out)) = *((char *) (in_c + df->dt[i].offset_in)); break; - + case 2: TRACE("Copying (s) to %d from %d (value %d)\n", df->dt[i].offset_out, df->dt[i].offset_in, *((short *) (in_c + df->dt[i].offset_in))); *((short *) (out_c + df->dt[i].offset_out)) = *((short *) (in_c + df->dt[i].offset_in)); break; - + case 4: TRACE("Copying (i) to %d from %d (value %d)\n", df->dt[i].offset_out, df->dt[i].offset_in, *((int *) (in_c + df->dt[i].offset_in))); *((int *) (out_c + df->dt[i].offset_out)) = *((int *) (in_c + df->dt[i].offset_in)); break; - + default: memcpy((out_c + df->dt[i].offset_out), (in_c + df->dt[i].offset_in), df->dt[i].size); } @@ -148,19 +148,19 @@ void fill_DataFormat(void *out, void *in, DataFormat *df) { df->dt[i].offset_out, df->dt[i].value); *((char *) (out_c + df->dt[i].offset_out)) = (char) df->dt[i].value; break; - + case 2: TRACE("Copying (s) to %d default value %d\n", df->dt[i].offset_out, df->dt[i].value); *((short *) (out_c + df->dt[i].offset_out)) = (short) df->dt[i].value; break; - + case 4: TRACE("Copying (i) to %d default value %d\n", df->dt[i].offset_out, df->dt[i].value); *((int *) (out_c + df->dt[i].offset_out)) = (int) df->dt[i].value; break; - + default: memset((out_c + df->dt[i].offset_out), df->dt[i].size, 0); } @@ -176,40 +176,40 @@ DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_f int same = 1; int *done; int index = 0; - + ret = (DataFormat *) HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat)); - + done = (int *) HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs); memset(done, 0, sizeof(int) * asked_format->dwNumObjs); dt = (DataTransform *) HeapAlloc(GetProcessHeap(), 0, asked_format->dwNumObjs * sizeof(DataTransform)); TRACE("Creating DataTransform : \n"); - + for (i = 0; i < wine_format->dwNumObjs; i++) { offset[i] = -1; - + for (j = 0; j < asked_format->dwNumObjs; j++) { if (done[j] == 1) continue; - + if (((asked_format->rgodf[j].pguid == NULL) || (IsEqualGUID(wine_format->rgodf[i].pguid, asked_format->rgodf[j].pguid))) && (wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType)) { done[j] = 1; - TRACE("Matching : \n"); + TRACE("Matching : \n"); TRACE(" - Asked (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n", - j, debugstr_guid(asked_format->rgodf[j].pguid), + j, debugstr_guid(asked_format->rgodf[j].pguid), asked_format->rgodf[j].dwOfs, DIDFT_GETTYPE(asked_format->rgodf[j].dwType), DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType)); - + TRACE(" - Wine (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n", - j, debugstr_guid(wine_format->rgodf[i].pguid), + j, debugstr_guid(wine_format->rgodf[i].pguid), wine_format->rgodf[i].dwOfs, DIDFT_GETTYPE(wine_format->rgodf[i].dwType), DIDFT_GETINSTANCE(wine_format->rgodf[i].dwType)); - + if (wine_format->rgodf[i].dwType & DIDFT_BUTTON) dt[index].size = sizeof(BYTE); else @@ -218,7 +218,7 @@ DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_f dt[index].offset_out = asked_format->rgodf[j].dwOfs; dt[index].value = 0; index++; - + if (wine_format->rgodf[i].dwOfs != asked_format->rgodf[j].dwOfs) same = 0; @@ -235,11 +235,11 @@ DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_f for (j = 0; j < asked_format->dwNumObjs; j++) { if (done[j] == 0) { TRACE(" - Asked (%d) : %s - Ofs = %3ld - (Type = 0x%02x | Instance = %04x)\n", - j, debugstr_guid(asked_format->rgodf[j].pguid), + j, debugstr_guid(asked_format->rgodf[j].pguid), asked_format->rgodf[j].dwOfs, DIDFT_GETTYPE(asked_format->rgodf[j].dwType), DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType)); - + if (asked_format->rgodf[j].dwType & DIDFT_BUTTON) dt[index].size = sizeof(BYTE); else @@ -261,7 +261,7 @@ DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_f } else { ret->dt = dt; } - + HeapFree(GetProcessHeap(), 0, done); return ret; @@ -278,13 +278,13 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat( ICOM_THIS(IDirectInputDevice2AImpl,iface); TRACE("(this=%p,%p)\n",This,df); - + TRACE("df.dwSize=%ld\n",df->dwSize); TRACE("(df.dwObjsize=%ld)\n",df->dwObjSize); TRACE("(df.dwFlags=0x%08lx)\n",df->dwFlags); TRACE("(df.dwDataSize=%ld)\n",df->dwDataSize); TRACE("(df.dwNumObjs=%ld)\n",df->dwNumObjs); - + for (i=0;idwNumObjs;i++) { TRACE("df.rgodf[%d].guid %s\n",i,debugstr_guid(df->rgodf[i].pguid)); TRACE("df.rgodf[%d].dwOfs %ld\n",i,df->rgodf[i].dwOfs); @@ -367,10 +367,10 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects( _dump_EnumObjects_flags(dwFlags); DPRINTF("\n"); } - + return DI_OK; } - + HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty( LPDIRECTINPUTDEVICE2A iface, REFGUID rguid, @@ -378,10 +378,10 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty( { FIXME("(this=%p,%s,%p): stub!\n", iface, debugstr_guid(rguid), pdiph); - + if (TRACE_ON(dinput)) _dump_DIPROPHEADER(pdiph); - + return DI_OK; } @@ -393,20 +393,20 @@ HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo( { FIXME("(this=%p,%p,%ld,0x%08lx): stub!\n", iface, pdidoi, dwObj, dwHow); - + return DI_OK; } - + HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE2A iface, LPDIDEVICEINSTANCEA pdidi) { FIXME("(this=%p,%p): stub!\n", iface, pdidi); - + return DI_OK; } - + HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel( LPDIRECTINPUTDEVICE2A iface, HWND hwndOwner, @@ -414,10 +414,10 @@ HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel( { FIXME("(this=%p,0x%08x,0x%08lx): stub!\n", iface, hwndOwner, dwFlags); - + return DI_OK; } - + HRESULT WINAPI IDirectInputDevice2AImpl_Initialize( LPDIRECTINPUTDEVICE2A iface, HINSTANCE hinst, @@ -428,7 +428,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_Initialize( iface, hinst, dwVersion, debugstr_guid(rguid)); return DI_OK; } - + /****************************************************************************** * IDirectInputDevice2A */ @@ -453,7 +453,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects( { FIXME("(this=%p,%p,%p,0x%08lx): stub!\n", iface, lpCallback, lpvRef, dwFlags); - + if (lpCallback) lpCallback(NULL, lpvRef); return DI_OK; @@ -525,7 +525,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData( { FIXME("(this=%p,0x%08lx,%p,%p,0x%08lx): stub!\n", iface, cbObjectData, rgdod, pdwInOut, dwFlags); - + return DI_OK; } @@ -547,6 +547,6 @@ HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE7A DWORD dwFlags) { FIXME("(%p)->(%s,%08lx,%p,%08lx): stub !\n", iface, lpszFileName, dwEntries, rgDiFileEft, dwFlags); - + return DI_OK; } diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index cb77d4be8c1..ef5bad01a03 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -24,7 +24,7 @@ * Playable using keyboard only. * - WingCommander Prophecy Demo: * Doesn't get Input Focus. - * + * * - Fallout : works great in X and DGA mode * * FIXME: The keyboard handling needs to (and will) be merged into keyboard.c @@ -68,7 +68,7 @@ BOOL WINAPI Init( HINSTANCE inst, DWORD reason, LPVOID reserv) } -/* register a direct draw driver. We better not use malloc for we are in +/* register a direct draw driver. We better not use malloc for we are in * the ELF startup initialisation at this point. */ void dinput_register_device(dinput_device *device) { @@ -108,16 +108,16 @@ HRESULT WINAPI DirectInputCreateEx( This->ref = 1; ICOM_VTBL(This) = &ddiavt; *ppDI = This; - + return DI_OK; } - + if (IsEqualGUID(&IID_IDirectInput7A,riid)) { This = (IDirectInputAImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputAImpl)); This->ref = 1; ICOM_VTBL(This) = (ICOM_VTABLE(IDirectInputA) *) &ddi7avt; *ppDI = This; - + return DI_OK; } @@ -159,7 +159,7 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices( return 0; } } - + return 0; } @@ -186,7 +186,7 @@ static HRESULT WINAPI IDirectInputAImpl_CreateDevice( ICOM_THIS(IDirectInputAImpl,iface); HRESULT ret_value = DIERR_DEVICENOTREG; int i; - + TRACE("(this=%p,%s,%p,%p)\n",This,debugstr_guid(rguid),pdev,punk); /* Loop on all the devices to see if anyone matches the given GUID */ @@ -231,9 +231,9 @@ static HRESULT WINAPI IDirectInputAImpl_Initialize( static HRESULT WINAPI IDirectInputAImpl_GetDeviceStatus(LPDIRECTINPUT7A iface, REFGUID rguid) { ICOM_THIS(IDirectInputAImpl,iface); - + FIXME("(%p)->(%s): stub\n",This,debugstr_guid(rguid)); - + return DI_OK; } @@ -242,7 +242,7 @@ static HRESULT WINAPI IDirectInputAImpl_RunControlPanel(LPDIRECTINPUT7A iface, DWORD dwFlags) { ICOM_THIS(IDirectInputAImpl,iface); FIXME("(%p)->(%08lx,%08lx): stub\n",This, (DWORD) hwndOwner, dwFlags); - + return DI_OK; } @@ -250,7 +250,7 @@ static HRESULT WINAPI IDirectInput2AImpl_FindDevice(LPDIRECTINPUT2A iface, REFGU LPCSTR pszName, LPGUID pguidInstance) { ICOM_THIS(IDirectInputAImpl,iface); FIXME("(%p)->(%s, %s, %p): stub\n", This, debugstr_guid(rguid), pszName, pguidInstance); - + return DI_OK; } @@ -260,7 +260,7 @@ static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, R ICOM_THIS(IDirectInputAImpl,iface); HRESULT ret_value = DIERR_DEVICENOTREG; int i; - + TRACE("(%p)->(%s, %s, %p, %p)\n", This, debugstr_guid(rguid), debugstr_guid(riid), pvOut, lpUnknownOuter); /* Loop on all the devices to see if anyone matches the given GUID */ @@ -268,11 +268,11 @@ static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, R HRESULT ret; if ((ret = dinput_devices[i]->create_device(This, rguid, riid, (LPDIRECTINPUTDEVICEA*) pvOut)) == DI_OK) return DI_OK; - + if (ret == DIERR_NOINTERFACE) ret_value = DIERR_NOINTERFACE; } - + return ret_value; } @@ -282,7 +282,7 @@ static HRESULT WINAPI IDirectInput7AImpl_CreateDeviceEx(LPDIRECTINPUT7A iface, R # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectInputA) ddiavt = +static ICOM_VTABLE(IDirectInputA) ddiavt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)IDirectInputAImpl_QueryInterface, @@ -333,7 +333,7 @@ HRESULT WINAPI DINPUT_DllCanUnloadNow(void) HRESULT WINAPI DINPUT_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { - FIXME("(%p, %p, %p): stub\n", debugstr_guid(rclsid), + FIXME("(%p, %p, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); return CLASS_E_CLASSNOTAVAILABLE; diff --git a/dlls/dinput/joystick/linux.c b/dlls/dinput/joystick/linux.c index 6fad4dcace3..11a3b9db850 100644 --- a/dlls/dinput/joystick/linux.c +++ b/dlls/dinput/joystick/linux.c @@ -67,7 +67,7 @@ struct JoystickAImpl /* The 'parent' DInput */ IDirectInputAImpl *dinput; - + /* joystick private */ int joyfd; LPDIDATAFORMAT df; @@ -91,7 +91,7 @@ static BOOL joydev_enum_device(DWORD dwDevType, DWORD dwFlags, LPCDIDEVICEINSTAN /* check whether we have a joystick */ if ((access(JOYDEV,O_RDONLY) != -1) || (errno!=ENODEV && errno!=ENOENT)) { TRACE("Enumerating the Joystick device\n"); - + /* Return joystick */ lpddi->guidInstance = GUID_Joystick; lpddi->guidProduct = DInput_Wine_Joystick_GUID; @@ -112,7 +112,7 @@ static BOOL joydev_enum_device(DWORD dwDevType, DWORD dwFlags, LPCDIDEVICEINSTAN static JoystickAImpl *alloc_device(REFGUID rguid, ICOM_VTABLE(IDirectInputDevice2A) *jvt, IDirectInputAImpl *dinput) { JoystickAImpl* newDevice; - + newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(JoystickAImpl)); newDevice->ref = 1; ICOM_VTBL(newDevice) = jvt; @@ -131,12 +131,12 @@ static HRESULT joydev_create_device(IDirectInputAImpl *dinput, REFGUID rguid, RE (IsEqualGUID(&DInput_Wine_Joystick_GUID,rguid))) { if ((riid == NULL) || (IsEqualGUID(&IID_IDirectInputDevice2A,riid)) || (IsEqualGUID(&IID_IDirectInputDevice2A,riid))) { *pdev=(IDirectInputDeviceA*) alloc_device(rguid, &JoystickAvt, dinput); - + TRACE("Creating a Joystick device (%p)\n", *pdev); return DI_OK; } else if (IsEqualGUID(&IID_IDirectInputDevice7A,riid)) { *pdev=(IDirectInputDeviceA*) alloc_device(rguid, (ICOM_VTABLE(IDirectInputDevice2A) *) &Joystick7Avt, dinput); - + TRACE("Creating a Joystick DInput7A device (%p)\n", *pdev); return DI_OK; } else @@ -168,10 +168,10 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE2A iface) /* Free the data queue */ if (This->data_queue != NULL) HeapFree(GetProcessHeap(),0,This->data_queue); - + /* Free the DataFormat */ HeapFree(GetProcessHeap(), 0, This->df); - + HeapFree(GetProcessHeap(),0,This); return 0; } @@ -186,7 +186,7 @@ static HRESULT WINAPI JoystickAImpl_SetDataFormat( { ICOM_THIS(JoystickAImpl,iface); int i; - + TRACE("(this=%p,%p)\n",This,df); TRACE("(df.dwSize=%ld)\n",df->dwSize); @@ -201,13 +201,13 @@ static HRESULT WINAPI JoystickAImpl_SetDataFormat( TRACE("dwType 0x%02x,dwInstance %d\n",DIDFT_GETTYPE(df->rgodf[i].dwType),DIDFT_GETINSTANCE(df->rgodf[i].dwType)); TRACE("df.rgodf[%d].dwFlags 0x%08lx\n",i,df->rgodf[i].dwFlags); } - + /* Store the new data format */ This->df = HeapAlloc(GetProcessHeap(),0,df->dwSize); memcpy(This->df, df, df->dwSize); This->df->rgodf = HeapAlloc(GetProcessHeap(),0,df->dwNumObjs*df->dwObjSize); memcpy(This->df->rgodf,df->rgodf,df->dwNumObjs*df->dwObjSize); - + return 0; } @@ -217,7 +217,7 @@ static HRESULT WINAPI JoystickAImpl_SetDataFormat( static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface) { ICOM_THIS(JoystickAImpl,iface); - + TRACE("(this=%p)\n",This); if (This->joyfd!=-1) return 0; @@ -295,7 +295,7 @@ static HRESULT WINAPI JoystickAImpl_GetDeviceState( LPDIRECTINPUTDEVICE2A iface,DWORD len,LPVOID ptr ) { ICOM_THIS(JoystickAImpl,iface); - + joy_polldev(This); TRACE("(this=%p,0x%08lx,%p)\n",This,len,ptr); if (len != sizeof(DIJOYSTATE)) { @@ -317,7 +317,7 @@ static HRESULT WINAPI JoystickAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface, DWORD flags ) { ICOM_THIS(JoystickAImpl,iface); - + FIXME("(%p)->(dods=%ld,entries=%ld,fl=0x%08lx),STUB!\n",This,dodsize,*entries,flags); joy_polldev(This); @@ -341,7 +341,7 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(LPDIRECTINPUTDEVICE2A iface, FIXME("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); FIXME("ph.dwSize = %ld, ph.dwHeaderSize =%ld, ph.dwObj = %ld, ph.dwHow= %ld\n",ph->dwSize, ph->dwHeaderSize,ph->dwObj,ph->dwHow); - + if (!HIWORD(rguid)) { switch ((DWORD)rguid) { case (DWORD) DIPROP_BUFFERSIZE: { @@ -443,12 +443,12 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects( /* Only the fields till dwFFMaxForce are relevant */ ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce); - + /* For the joystick, do as is done in the GetCapabilities function */ if ((dwFlags == DIDFT_ALL) || (dwFlags & DIDFT_AXIS)) { BYTE axes, i; - + #ifdef JSIOCGAXES if (-1==ioctl(xfd,JSIOCGAXES,&axes)) axes = 2; @@ -482,15 +482,15 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects( if ((dwFlags == DIDFT_ALL) || (dwFlags & DIDFT_BUTTON)) { BYTE buttons, i; - + #ifdef JSIOCGBUTTONS if (-1==ioctl(xfd,JSIOCGAXES,&buttons)) buttons = 2; #endif - + /* The DInput SDK says that GUID_Button is only for mouse buttons but well... */ ddoi.guidType = GUID_Button; - + for (i = 0; i < buttons; i++) { ddoi.dwOfs = DIJOFS_BUTTON(i); ddoi.dwType = DIDFT_MAKEINSTANCE((0x0001 << i) << WINE_JOYSTICK_BUTTON_BASE) | DIDFT_PSHBUTTON; @@ -520,12 +520,12 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE2A iface, if (TRACE_ON(dinput)) _dump_DIPROPHEADER(pdiph); - + if (!HIWORD(rguid)) { switch ((DWORD)rguid) { case (DWORD) DIPROP_BUFFERSIZE: { LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; - + TRACE(" return buffersize = %d\n",This->queue_len); pd->dwData = This->queue_len; break; @@ -540,21 +540,21 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE2A iface, pr->lMin = This->lMin; pr->lMax = This->lMax; } - + break; } - + default: FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); break; } } - - + + return DI_OK; } -static ICOM_VTABLE(IDirectInputDevice2A) JoystickAvt = +static ICOM_VTABLE(IDirectInputDevice2A) JoystickAvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirectInputDevice2AImpl_QueryInterface, @@ -592,7 +592,7 @@ static ICOM_VTABLE(IDirectInputDevice2A) JoystickAvt = # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectInputDevice7A) Joystick7Avt = +static ICOM_VTABLE(IDirectInputDevice7A) Joystick7Avt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)IDirectInputDevice2AImpl_QueryInterface, diff --git a/dlls/dinput/joystick/linuxinput.c b/dlls/dinput/joystick/linuxinput.c index 729dce3fd5d..822962596a3 100644 --- a/dlls/dinput/joystick/linuxinput.c +++ b/dlls/dinput/joystick/linuxinput.c @@ -70,11 +70,11 @@ struct JoystickAImpl ICOM_VFIELD(IDirectInputDevice2A); DWORD ref; GUID guid; - + /* The 'parent' DInput */ IDirectInputAImpl *dinput; - + /* joystick private */ /* what range and deadzone the game wants */ LONG wantmin[ABS_MAX]; @@ -102,7 +102,7 @@ struct JoystickAImpl #define AXE_ABSFUZZ 3 #define AXE_ABSFLAT 4 - + /* data returned by EVIOCGBIT for EV_ABS and EV_KEY */ BYTE absbits[(ABS_MAX+7)/8]; BYTE keybits[(KEY_MAX+7)/8]; @@ -162,7 +162,7 @@ static BOOL joydev_enum_device(DWORD dwDevType, DWORD dwFlags, LPCDIDEVICEINSTAN return FALSE; TRACE("Enumerating the Joystick device\n"); - + /* Return joystick */ lpddi->guidInstance = GUID_Joystick; lpddi->guidProduct = DInput_Wine_Joystick_GUID; @@ -180,7 +180,7 @@ static JoystickAImpl *alloc_device(REFGUID rguid, ICOM_VTABLE(IDirectInputDevice { JoystickAImpl* newDevice; int i; - + newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(JoystickAImpl)); newDevice->ref = 1; ICOM_VTBL(newDevice) = jvt; @@ -240,12 +240,12 @@ static HRESULT joydev_create_device(IDirectInputAImpl *dinput, REFGUID rguid, RE (IsEqualGUID(&DInput_Wine_Joystick_GUID,rguid))) { if ((riid == NULL) || (IsEqualGUID(&IID_IDirectInputDevice2A,riid)) || (IsEqualGUID(&IID_IDirectInputDevice2A,riid))) { *pdev=(IDirectInputDeviceA*) alloc_device(rguid, &JoystickAvt, dinput); - + TRACE("Creating a Joystick device (%p)\n", *pdev); return DI_OK; } else if (IsEqualGUID(&IID_IDirectInputDevice7A,riid)) { *pdev=(IDirectInputDeviceA*) alloc_device(rguid, (ICOM_VTABLE(IDirectInputDevice2A) *) &Joystick7Avt, dinput); - + TRACE("Creating a Joystick DInput7A device (%p)\n", *pdev); return DI_OK; } else @@ -277,10 +277,10 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE2A iface) /* Free the data queue */ if (This->data_queue != NULL) HeapFree(GetProcessHeap(),0,This->data_queue); - + /* Free the DataFormat */ HeapFree(GetProcessHeap(), 0, This->df); - + HeapFree(GetProcessHeap(),0,This); return 0; } @@ -295,7 +295,7 @@ static HRESULT WINAPI JoystickAImpl_SetDataFormat( { ICOM_THIS(JoystickAImpl,iface); int i; - + TRACE("(this=%p,%p)\n",This,df); TRACE("(df.dwSize=%ld)\n",df->dwSize); @@ -310,13 +310,13 @@ static HRESULT WINAPI JoystickAImpl_SetDataFormat( TRACE("dwType 0x%02x,dwInstance %d\n",DIDFT_GETTYPE(df->rgodf[i].dwType),DIDFT_GETINSTANCE(df->rgodf[i].dwType)); TRACE("df.rgodf[%d].dwFlags 0x%08lx\n",i,df->rgodf[i].dwFlags); } - + /* Store the new data format */ This->df = HeapAlloc(GetProcessHeap(),0,df->dwSize); memcpy(This->df, df, df->dwSize); This->df->rgodf = HeapAlloc(GetProcessHeap(),0,df->dwNumObjs*df->dwObjSize); memcpy(This->df->rgodf,df->rgodf,df->dwNumObjs*df->dwObjSize); - + return 0; } @@ -328,7 +328,7 @@ static HRESULT WINAPI JoystickAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface) int i; ICOM_THIS(JoystickAImpl,iface); char buf[200]; - + TRACE("(this=%p)\n",This); if (This->joyfd!=-1) return 0; @@ -392,7 +392,7 @@ static HRESULT WINAPI JoystickAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface) return DI_OK; } -/* +/* * This maps the read value (from the input event) to a value in the * 'wanted' range. It also autodetects the possible range of the axe and * adapts values accordingly. @@ -511,7 +511,7 @@ static HRESULT WINAPI JoystickAImpl_GetDeviceState( LPDIRECTINPUTDEVICE2A iface,DWORD len,LPVOID ptr ) { ICOM_THIS(JoystickAImpl,iface); - + joy_polldev(This); TRACE("(this=%p,0x%08lx,%p)\n",This,len,ptr); @@ -534,7 +534,7 @@ static HRESULT WINAPI JoystickAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface, DWORD flags ) { ICOM_THIS(JoystickAImpl,iface); - + FIXME("(%p)->(dods=%ld,entries=%ld,fl=0x%08lx),STUB!\n",This,dodsize,*entries,flags); joy_polldev(This); @@ -558,7 +558,7 @@ static HRESULT WINAPI JoystickAImpl_SetProperty(LPDIRECTINPUTDEVICE2A iface, FIXME("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); FIXME("ph.dwSize = %ld, ph.dwHeaderSize =%ld, ph.dwObj = %ld, ph.dwHow= %ld\n",ph->dwSize, ph->dwHeaderSize,ph->dwObj,ph->dwHow); - + if (!HIWORD(rguid)) { switch ((DWORD)rguid) { case (DWORD) DIPROP_BUFFERSIZE: { @@ -680,13 +680,13 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects( /* Only the fields till dwFFMaxForce are relevant */ ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce); - + /* For the joystick, do as is done in the GetCapabilities function */ /* FIXME: needs more items */ if ((dwFlags == DIDFT_ALL) || (dwFlags & DIDFT_AXIS)) { BYTE i; - + for (i = 0; i < ABS_MAX; i++) { if (!test_bit(This->absbits,i)) continue; @@ -733,11 +733,11 @@ static HRESULT WINAPI JoystickAImpl_EnumObjects( if ((dwFlags == DIDFT_ALL) || (dwFlags & DIDFT_BUTTON)) { BYTE i; - + /*The DInput SDK says that GUID_Button is only for mouse buttons but well*/ ddoi.guidType = GUID_Button; - + for (i = 0; i < KEY_MAX; i++) { if (!test_bit(This->keybits,i)) continue; @@ -834,12 +834,12 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE2A iface, if (TRACE_ON(dinput)) _dump_DIPROPHEADER(pdiph); - + if (!HIWORD(rguid)) { switch ((DWORD)rguid) { case (DWORD) DIPROP_BUFFERSIZE: { LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; - + TRACE(" return buffersize = %d\n",This->queue_len); pd->dwData = This->queue_len; break; @@ -852,21 +852,21 @@ static HRESULT WINAPI JoystickAImpl_GetProperty(LPDIRECTINPUTDEVICE2A iface, /* The app is querying the current range of the axis : return the lMin and lMax values */ FIXME("unimplemented axis range query.\n"); } - + break; } - + default: FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); break; } } - - + + return DI_OK; } -static ICOM_VTABLE(IDirectInputDevice2A) JoystickAvt = +static ICOM_VTABLE(IDirectInputDevice2A) JoystickAvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirectInputDevice2AImpl_QueryInterface, @@ -904,7 +904,7 @@ static ICOM_VTABLE(IDirectInputDevice2A) JoystickAvt = # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectInputDevice7A) Joystick7Avt = +static ICOM_VTABLE(IDirectInputDevice7A) Joystick7Avt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)IDirectInputDevice2AImpl_QueryInterface, diff --git a/dlls/dinput/keyboard/main.c b/dlls/dinput/keyboard/main.c index 5298f788e1f..e50b2960332 100644 --- a/dlls/dinput/keyboard/main.c +++ b/dlls/dinput/keyboard/main.c @@ -47,8 +47,8 @@ struct SysKeyboardAImpl GUID guid; IDirectInputAImpl *dinput; - - HANDLE hEvent; + + HANDLE hEvent; /* SysKeyboardAImpl */ int acquired; int buffersize; /* set in 'SetProperty' */ @@ -64,10 +64,10 @@ struct SysKeyboardAImpl CRITICAL_SECTION crit; }; -SysKeyboardAImpl *current; /* Today's acquired device +SysKeyboardAImpl *current; /* Today's acquired device FIXME: currently this can be only one. Maybe this should be a linked list or st. -I don't know what the rules are for multiple acquired keyboards, +I don't know what the rules are for multiple acquired keyboards, but 'DI_LOSTFOCUS' and 'DI_UNACQUIRED' exist for a reason. */ @@ -116,7 +116,7 @@ LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam ) current->start++; current->overflow = TRUE; } - else + else current->count++; LeaveCriticalSection(&(current->crit)); @@ -138,13 +138,13 @@ static BOOL keyboarddev_enum_device(DWORD dwDevType, DWORD dwFlags, LPCDIDEVICEI { if ((dwDevType == 0) || (dwDevType == DIDEVTYPE_KEYBOARD)) { TRACE("Enumerating the Keyboard device\n"); - + lpddi->guidInstance = GUID_SysKeyboard;/* DInput's GUID */ lpddi->guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ lpddi->dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8); strcpy(lpddi->tszInstanceName, "Keyboard"); strcpy(lpddi->tszProductName, "Wine Keyboard"); - + return TRUE; } @@ -170,12 +170,12 @@ static HRESULT keyboarddev_create_device(IDirectInputAImpl *dinput, REFGUID rgui (IsEqualGUID(&DInput_Wine_Keyboard_GUID,rguid))) { /* Wine Keyboard */ if ((riid == NULL) || (IsEqualGUID(&IID_IDirectInputDevice2A,riid)) || (IsEqualGUID(&IID_IDirectInputDevice2A,riid))) { *pdev=(IDirectInputDeviceA*) alloc_device(rguid, &SysKeyboardAvt, dinput); - + TRACE("Creating a Keyboard device (%p)\n", *pdev); return DI_OK; } else if (IsEqualGUID(&IID_IDirectInputDevice7A,riid)) { *pdev=(IDirectInputDeviceA*) alloc_device(rguid, (ICOM_VTABLE(IDirectInputDevice2A) *) &SysKeyboard7Avt, dinput); - + TRACE("Creating a Keyboard DInput7A device (%p)\n", *pdev); return DI_OK; } else @@ -294,15 +294,15 @@ static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface); static HRESULT WINAPI SysKeyboardAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface) { ICOM_THIS(SysKeyboardAImpl,iface); - + TRACE("(this=%p)\n",This); - + if (This->acquired) return S_FALSE; This->acquired = 1; - if (current != NULL) + if (current != NULL) { FIXME("Not more than one keyboard can be acquired at the same time.\n"); SysKeyboardAImpl_Unacquire(iface); @@ -386,11 +386,11 @@ static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities( /* DirectX 3.0 */ FIXME("DirectX 3.0 not supported....\n"); } - + return DI_OK; } -static ICOM_VTABLE(IDirectInputDevice2A) SysKeyboardAvt = +static ICOM_VTABLE(IDirectInputDevice2A) SysKeyboardAvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirectInputDevice2AImpl_QueryInterface, @@ -428,7 +428,7 @@ static ICOM_VTABLE(IDirectInputDevice2A) SysKeyboardAvt = # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectInputDevice7A) SysKeyboard7Avt = +static ICOM_VTABLE(IDirectInputDevice7A) SysKeyboard7Avt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)IDirectInputDevice2AImpl_QueryInterface, diff --git a/dlls/dinput/mouse/main.c b/dlls/dinput/mouse/main.c index 4a081032f02..10f001cf373 100644 --- a/dlls/dinput/mouse/main.c +++ b/dlls/dinput/mouse/main.c @@ -104,13 +104,13 @@ struct SysMouseAImpl GUID guid; IDirectInputAImpl *dinput; - + /* The current data format and the conversion between internal and external data formats */ LPDIDATAFORMAT df; DataFormat *wine_df; int offset_array[5]; - + /* SysMouseAImpl */ BYTE absolute; /* Previous position for relative moves */ @@ -177,7 +177,7 @@ static SysMouseAImpl *alloc_device(REFGUID rguid, ICOM_VTABLE(IDirectInputDevice ICOM_VTBL(newDevice) = mvt; InitializeCriticalSection(&(newDevice->crit)); memcpy(&(newDevice->guid),rguid,sizeof(*rguid)); - + /* Per default, Wine uses its internal data format */ newDevice->df = &Wine_InternalMouseFormat; memcpy(newDevice->offset_array, offset_array, 5 * sizeof(int)); @@ -196,12 +196,12 @@ static HRESULT mousedev_create_device(IDirectInputAImpl *dinput, REFGUID rguid, (IsEqualGUID(&DInput_Wine_Mouse_GUID,rguid))) { /* Wine Mouse */ if ((riid == NULL) || (IsEqualGUID(&IID_IDirectInputDevice2A,riid)) || (IsEqualGUID(&IID_IDirectInputDevice2A,riid))) { *pdev=(IDirectInputDeviceA*) alloc_device(rguid, &SysMouseAvt, dinput); - + TRACE("Creating a Mouse device (%p)\n", *pdev); return DI_OK; }else if (IsEqualGUID(&IID_IDirectInputDevice7A,riid)) { *pdev=(IDirectInputDeviceA*) alloc_device(rguid, (ICOM_VTABLE(IDirectInputDevice2A) *) &SysMouse7Avt, dinput); - + TRACE("Creating a Mouse DInput7A device (%p)\n", *pdev); return DI_OK; } else @@ -246,7 +246,7 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE2A iface) HeapFree(GetProcessHeap(), 0, This->df->rgodf); HeapFree(GetProcessHeap(), 0, This->df); } - + HeapFree(GetProcessHeap(),0,This); return 0; } @@ -272,7 +272,7 @@ static HRESULT WINAPI SysMouseAImpl_SetCooperativeLevel( hwnd = GetDesktopWindow(); This->win = hwnd; This->dwCoopLevel = dwflags; - + return 0; } @@ -290,7 +290,7 @@ static HRESULT WINAPI SysMouseAImpl_SetDataFormat( { ICOM_THIS(SysMouseAImpl,iface); int i; - + TRACE("(this=%p,%p)\n",This,df); TRACE("(df.dwSize=%ld)\n",df->dwSize); @@ -323,10 +323,10 @@ static HRESULT WINAPI SysMouseAImpl_SetDataFormat( /* Prepare all the data-conversion filters */ This->wine_df = create_DataFormat(&(Wine_InternalMouseFormat), df, This->offset_array); - + return 0; } - + /* low-level mouse hook */ static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lparam ) { @@ -355,7 +355,7 @@ static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lpara This->need_warp = WARP_DONE; goto end; } - + /* Relative mouse input with absolute mouse event : the real fun starts here... */ if ((This->need_warp == WARP_NEEDED) || (This->need_warp == WARP_STARTED)) { @@ -370,7 +370,7 @@ static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lpara GEN_EVENT(This->offset_array[WINE_MOUSE_X_POSITION], hook->pt.x - This->mapped_center.x, hook->time, (This->dinput->evsequence)++); This->need_warp = WARP_NEEDED; } - + if (hook->pt.y != This->mapped_center.y) { GEN_EVENT(This->offset_array[WINE_MOUSE_Y_POSITION], hook->pt.y - This->mapped_center.y, hook->time, (This->dinput->evsequence)++); This->need_warp = WARP_NEEDED; @@ -380,7 +380,7 @@ static LRESULT CALLBACK dinput_mouse_hook( int code, WPARAM wparam, LPARAM lpara This->prevX = hook->pt.x; This->prevY = hook->pt.y; - + if (This->absolute) { This->m_state.lX = hook->pt.x; This->m_state.lY = hook->pt.y; @@ -449,7 +449,7 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface) { ICOM_THIS(SysMouseAImpl,iface); RECT rect; - + TRACE("(this=%p)\n",This); if (This->acquired == 0) { @@ -486,7 +486,7 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface) This->mapped_center.x = This->win_centerX; This->mapped_center.y = This->win_centerY; MapWindowPoints(This->win, HWND_DESKTOP, &This->mapped_center, 1); - TRACE("Warping mouse to %ld - %ld\n", This->mapped_center.x, This->mapped_center.y); + TRACE("Warping mouse to %ld - %ld\n", This->mapped_center.x, This->mapped_center.y); SetCursorPos( This->mapped_center.x, This->mapped_center.y ); #ifdef MOUSE_HACK This->need_warp = WARP_DONE; @@ -523,7 +523,7 @@ static HRESULT WINAPI SysMouseAImpl_Unacquire(LPDIRECTINPUTDEVICE2A iface) } else ERR("Unacquiring a not-acquired device !!!\n"); - + return DI_OK; } @@ -537,13 +537,13 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState( LPDIRECTINPUTDEVICE2A iface,DWORD len,LPVOID ptr ) { ICOM_THIS(SysMouseAImpl,iface); - + EnterCriticalSection(&(This->crit)); TRACE("(this=%p,0x%08lx,%p): \n",This,len,ptr); - + /* Copy the current mouse state */ fill_DataFormat(ptr, &(This->m_state), This->wine_df); - + /* Initialize the buffer when in relative mode */ if (This->absolute == 0) { This->m_state.lX = 0; @@ -555,7 +555,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState( This->mapped_center.x = This->win_centerX; This->mapped_center.y = This->win_centerY; MapWindowPoints(This->win, HWND_DESKTOP, &This->mapped_center, 1); - TRACE("Warping mouse to %ld - %ld\n", This->mapped_center.x, This->mapped_center.y); + TRACE("Warping mouse to %ld - %ld\n", This->mapped_center.x, This->mapped_center.y); SetCursorPos( This->mapped_center.x, This->mapped_center.y ); #ifdef MOUSE_HACK @@ -566,11 +566,11 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState( } LeaveCriticalSection(&(This->crit)); - + TRACE("(X: %ld - Y: %ld L: %02x M: %02x R: %02x)\n", This->m_state.lX, This->m_state.lY, This->m_state.rgbButtons[0], This->m_state.rgbButtons[2], This->m_state.rgbButtons[1]); - + return 0; } @@ -585,7 +585,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface, ) { ICOM_THIS(SysMouseAImpl,iface); DWORD len, nqtail; - + EnterCriticalSection(&(This->crit)); TRACE("(%p)->(dods=%ld,entries=%ld,fl=0x%08lx)\n",This,dodsize,*entries,flags); @@ -605,7 +605,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface, } if (len) - TRACE("Application retrieving %ld event(s).\n", len); + TRACE("Application retrieving %ld event(s).\n", len); *entries = 0; nqtail = This->queue_tail; @@ -632,7 +632,7 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE2A iface, This->mapped_center.x = This->win_centerX; This->mapped_center.y = This->win_centerY; MapWindowPoints(This->win, HWND_DESKTOP, &This->mapped_center, 1); - TRACE("Warping mouse to %ld - %ld\n", This->mapped_center.x, This->mapped_center.y); + TRACE("Warping mouse to %ld - %ld\n", This->mapped_center.x, This->mapped_center.y); SetCursorPos( This->mapped_center.x, This->mapped_center.y ); #ifdef MOUSE_HACK @@ -654,12 +654,12 @@ static HRESULT WINAPI SysMouseAImpl_SetProperty(LPDIRECTINPUTDEVICE2A iface, ICOM_THIS(SysMouseAImpl,iface); TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); - + if (!HIWORD(rguid)) { switch ((DWORD)rguid) { case (DWORD) DIPROP_BUFFERSIZE: { LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph; - + TRACE("buffersize = %ld\n",pd->dwData); This->data_queue = (LPDIDEVICEOBJECTDATA)HeapAlloc(GetProcessHeap(),0, @@ -680,7 +680,7 @@ static HRESULT WINAPI SysMouseAImpl_SetProperty(LPDIRECTINPUTDEVICE2A iface, break; } } - + return 0; } @@ -698,12 +698,12 @@ static HRESULT WINAPI SysMouseAImpl_GetProperty(LPDIRECTINPUTDEVICE2A iface, if (TRACE_ON(dinput)) _dump_DIPROPHEADER(pdiph); - + if (!HIWORD(rguid)) { switch ((DWORD)rguid) { case (DWORD) DIPROP_BUFFERSIZE: { LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; - + TRACE(" return buffersize = %d\n",This->queue_len); pd->dwData = This->queue_len; break; @@ -721,17 +721,17 @@ static HRESULT WINAPI SysMouseAImpl_GetProperty(LPDIRECTINPUTDEVICE2A iface, pr->lMin = DIPROPRANGE_NOMIN; pr->lMax = DIPROPRANGE_NOMAX; } - + break; } - + default: FIXME("Unknown type %ld (%s)\n",(DWORD)rguid,debugstr_guid(rguid)); break; } } - - + + return DI_OK; } @@ -777,7 +777,7 @@ static HRESULT WINAPI SysMouseAImpl_GetCapabilities( /* DirectX 3.0 */ FIXME("DirectX 3.0 not supported....\n"); } - + return DI_OK; } @@ -793,7 +793,7 @@ static HRESULT WINAPI SysMouseAImpl_EnumObjects( { ICOM_THIS(SysMouseAImpl,iface); DIDEVICEOBJECTINSTANCEA ddoi; - + TRACE("(this=%p,%p,%p,%08lx)\n", This, lpCallback, lpvRef, dwFlags); if (TRACE_ON(dinput)) { DPRINTF(" - flags = "); @@ -803,7 +803,7 @@ static HRESULT WINAPI SysMouseAImpl_EnumObjects( /* Only the fields till dwFFMaxForce are relevant */ ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce); - + /* In a mouse, we have : two relative axis and three buttons */ if ((dwFlags == DIDFT_ALL) || (dwFlags & DIDFT_AXIS)) { @@ -814,7 +814,7 @@ static HRESULT WINAPI SysMouseAImpl_EnumObjects( strcpy(ddoi.tszName, "X-Axis"); _dump_OBJECTINSTANCEA(&ddoi); if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) return DI_OK; - + /* Y axis */ ddoi.guidType = GUID_YAxis; ddoi.dwOfs = This->offset_array[WINE_MOUSE_Y_POSITION]; @@ -854,7 +854,7 @@ static HRESULT WINAPI SysMouseAImpl_EnumObjects( } -static ICOM_VTABLE(IDirectInputDevice2A) SysMouseAvt = +static ICOM_VTABLE(IDirectInputDevice2A) SysMouseAvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirectInputDevice2AImpl_QueryInterface, @@ -892,7 +892,7 @@ static ICOM_VTABLE(IDirectInputDevice2A) SysMouseAvt = # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectInputDevice7A) SysMouse7Avt = +static ICOM_VTABLE(IDirectInputDevice7A) SysMouse7Avt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)IDirectInputDevice2AImpl_QueryInterface, diff --git a/dlls/dplayx/dpinit.h b/dlls/dplayx/dpinit.h index 3516b7af6af..c84a4cc283c 100644 --- a/dlls/dplayx/dpinit.h +++ b/dlls/dplayx/dpinit.h @@ -24,7 +24,7 @@ extern HRESULT DP_CreateInterface( REFIID riid, LPVOID* ppvObj ); extern HRESULT DPL_CreateInterface( REFIID riid, LPVOID* ppvObj ); -extern HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj, +extern HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp ); extern HRESULT DPLSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp ); diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 035a6f9ce40..edefc775792 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -44,14 +44,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay); /* FIXME: Should this be externed? */ -extern HRESULT DPL_CreateCompoundAddress +extern HRESULT DPL_CreateCompoundAddress ( LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount, LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface ); /* Local function prototypes */ static lpPlayerList DP_FindPlayer( IDirectPlay2AImpl* This, DPID dpid ); -static lpPlayerData DP_CreatePlayer( IDirectPlay2Impl* iface, LPDPID lpid, +static lpPlayerData DP_CreatePlayer( IDirectPlay2Impl* iface, LPDPID lpid, LPDPNAME lpName, DWORD dwFlags, HANDLE hEvent, BOOL bAnsi ); static BOOL DP_CopyDPNAMEStruct( LPDPNAME lpDst, LPDPNAME lpSrc, BOOL bAnsi ); @@ -59,52 +59,52 @@ static void DP_SetPlayerData( lpPlayerData lpPData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize ); static lpGroupData DP_CreateGroup( IDirectPlay2AImpl* iface, LPDPID lpid, - LPDPNAME lpName, DWORD dwFlags, + LPDPNAME lpName, DWORD dwFlags, DPID idParent, BOOL bAnsi ); static void DP_SetGroupData( lpGroupData lpGData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize ); static void DP_DeleteDPNameStruct( LPDPNAME lpDPName ); static void DP_DeletePlayer( IDirectPlay2Impl* This, DPID dpid ); -static BOOL CALLBACK cbDeletePlayerFromAllGroups( DPID dpId, - DWORD dwPlayerType, - LPCDPNAME lpName, - DWORD dwFlags, +static BOOL CALLBACK cbDeletePlayerFromAllGroups( DPID dpId, + DWORD dwPlayerType, + LPCDPNAME lpName, + DWORD dwFlags, LPVOID lpContext ); static lpGroupData DP_FindAnyGroup( IDirectPlay2AImpl* This, DPID dpid ); -static BOOL CALLBACK cbRemoveGroupOrPlayer( DPID dpId, DWORD dwPlayerType, - LPCDPNAME lpName, DWORD dwFlags, +static BOOL CALLBACK cbRemoveGroupOrPlayer( DPID dpId, DWORD dwPlayerType, + LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext ); static void DP_DeleteGroup( IDirectPlay2Impl* This, DPID dpid ); /* Helper methods for player/group interfaces */ static HRESULT WINAPI DP_IF_DeletePlayerFromGroup - ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, + ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, DPID idPlayer, BOOL bAnsi ); static HRESULT WINAPI DP_IF_CreatePlayer - ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, LPDPID lpidPlayer, - LPDPNAME lpPlayerName, HANDLE hEvent, LPVOID lpData, + ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, LPDPID lpidPlayer, + LPDPNAME lpPlayerName, HANDLE hEvent, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_DestroyGroup ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, BOOL bAnsi ); static HRESULT WINAPI DP_IF_DestroyPlayer ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idPlayer, BOOL bAnsi ); static HRESULT WINAPI DP_IF_EnumGroupPlayers - ( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance, + ( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_EnumGroups - ( IDirectPlay2Impl* This, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + ( IDirectPlay2Impl* This, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_EnumPlayers - ( IDirectPlay2Impl* This, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + ( IDirectPlay2Impl* This, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_GetGroupData - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_GetGroupName - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ); static HRESULT WINAPI DP_IF_GetPlayerData ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, @@ -113,31 +113,31 @@ static HRESULT WINAPI DP_IF_GetPlayerName ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ); static HRESULT WINAPI DP_IF_SetGroupName - ( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName, + ( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_SetPlayerData - ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_SetPlayerName - ( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName, + ( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_AddGroupToGroup ( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup ); static HRESULT WINAPI DP_IF_CreateGroup - ( IDirectPlay2AImpl* This, LPVOID lpMsgHdr, LPDPID lpidGroup, - LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, + ( IDirectPlay2AImpl* This, LPVOID lpMsgHdr, LPDPID lpidGroup, + LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_CreateGroupInGroup - ( IDirectPlay3Impl* This, LPVOID lpMsgHdr, DPID idParentGroup, - LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, + ( IDirectPlay3Impl* This, LPVOID lpMsgHdr, DPID idParentGroup, + LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_AddPlayerToGroup - ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, + ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, DPID idPlayer, BOOL bAnsi ); static HRESULT WINAPI DP_IF_DeleteGroupFromGroup ( IDirectPlay3Impl* This, DPID idParentGroup, DPID idGroup ); static HRESULT WINAPI DP_SetSessionDesc - ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpSessDesc, + ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpSessDesc, DWORD dwFlags, BOOL bInitial, BOOL bAnsi ); static HRESULT WINAPI DP_SecureOpen ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags, @@ -169,7 +169,7 @@ static HRESULT WINAPI DP_IF_CancelMessage DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi ); static HRESULT WINAPI DP_IF_EnumGroupsInGroup ( IDirectPlay3AImpl* This, DPID idGroup, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ); static HRESULT WINAPI DP_IF_GetGroupParent ( IDirectPlay3AImpl* This, DPID idGroup, LPDPID lpidGroup, @@ -194,7 +194,7 @@ static inline DPID DP_NextObjectId(void); static DPID DP_GetRemoteNextObjectId(void); -static void DP_CopySessionDesc( LPDPSESSIONDESC2 destSessionDesc, +static void DP_CopySessionDesc( LPDPSESSIONDESC2 destSessionDesc, LPCDPSESSIONDESC2 srcSessDesc, BOOL bAnsi ); @@ -208,7 +208,7 @@ static HRESULT DP_InitializeDPLSP( IDirectPlay3Impl* This, HMODULE hServiceProvi #define DPID_NOPARENT_GROUP 0 /* Magic number to indicate no parent of group */ -#define DPID_SYSTEM_GROUP DPID_NOPARENT_GROUP /* If system group is supported +#define DPID_SYSTEM_GROUP DPID_NOPARENT_GROUP /* If system group is supported we don't have to change much */ #define DPID_NAME_SERVER 0x19a9d65b /* Don't ask me why */ @@ -277,8 +277,8 @@ static BOOL DP_CreateDirectPlay2( LPVOID lpDP ) } /* Provide an initial session desc with nothing in it */ - This->dp2->lpSessionDesc = (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(), - HEAP_ZERO_MEMORY, + This->dp2->lpSessionDesc = (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(), + HEAP_ZERO_MEMORY, sizeof( *This->dp2->lpSessionDesc ) ); if( This->dp2->lpSessionDesc == NULL ) { @@ -294,9 +294,9 @@ static BOOL DP_CreateDirectPlay2( LPVOID lpDP ) sizeof( *This->dp2->spData.lpCB ) ); This->dp2->spData.lpCB->dwSize = sizeof( *This->dp2->spData.lpCB ); This->dp2->spData.lpCB->dwVersion = DPSP_MAJORVERSION; - + /* This is the pointer to the service provider */ - if( FAILED( DPSP_CreateInterface( &IID_IDirectPlaySP, + if( FAILED( DPSP_CreateInterface( &IID_IDirectPlaySP, (LPVOID*)&This->dp2->spData.lpISP, This ) ) ) { @@ -337,8 +337,8 @@ DPQ_DECL_DELETECB( cbDeleteElemFromHeap, LPVOID ) DPQ_DECL_DELETECB( cbDeleteGroupsElem, lpGroupList ); DPQ_DECL_DELETECB( cbDeleteGroupsElem, lpGroupList ) { - DPQ_DELETEQ( elem->lpGData->groups, groups, - lpGroupList, cbDeleteElemFromHeap ); + DPQ_DELETEQ( elem->lpGData->groups, groups, + lpGroupList, cbDeleteElemFromHeap ); DPQ_DELETEQ( elem->lpGData->players, players, lpPlayerList, cbDeleteElemFromHeap ); HeapFree( GetProcessHeap(), 0, elem->lpGData ); @@ -462,9 +462,9 @@ static BOOL DP_DestroyDirectPlay4( LPVOID lpDP ) } -/* Create a new interface */ -extern -HRESULT DP_CreateInterface +/* Create a new interface */ +extern +HRESULT DP_CreateInterface ( REFIID riid, LPVOID* ppvObj ) { TRACE( " for %s\n", debugstr_guid( riid ) ); @@ -481,7 +481,7 @@ HRESULT DP_CreateInterface { ICOM_THIS(IDirectPlay2Impl,*ppvObj); ICOM_VTBL(This) = &directPlay2WVT; - } + } else if( IsEqualGUID( &IID_IDirectPlay2A, riid ) ) { ICOM_THIS(IDirectPlay2AImpl,*ppvObj); @@ -615,7 +615,7 @@ static ULONG WINAPI DP_AddRef ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef ); ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef ); - TRACE( "ref count incremented to %lu:%lu for %p\n", + TRACE( "ref count incremented to %lu:%lu for %p\n", ulInterfaceRefCount, ulObjRefCount, This ); return ulObjRefCount; @@ -644,7 +644,7 @@ static ULONG WINAPI DP_Release DP_DestroyDirectPlay2( This ); DP_DestroyIUnknown( This ); } - + /* Deallocate the interface */ if( ulInterfaceRefCount == 0 ) { @@ -662,11 +662,11 @@ static inline DPID DP_NextObjectId(void) /* *lplpReply will be non NULL iff there is something to reply */ HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpcMessageBody, DWORD dwMessageBodySize, LPCVOID lpcMessageHeader, - WORD wCommandId, WORD wVersion, + WORD wCommandId, WORD wVersion, LPVOID* lplpReply, LPDWORD lpdwMsgSize ) { TRACE( "(%p)->(%p,0x%08lx,%p,%u,%u)\n", - This, lpcMessageBody, dwMessageBodySize, lpcMessageHeader, wCommandId, + This, lpcMessageBody, dwMessageBodySize, lpcMessageHeader, wCommandId, wVersion ); switch( wCommandId ) @@ -693,14 +693,14 @@ HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpcMessageBody, case DPMSGCMD_REQUESTNEWPLAYERID: { - LPCDPMSG_REQUESTNEWPLAYERID lpcMsg = + LPCDPMSG_REQUESTNEWPLAYERID lpcMsg = (LPCDPMSG_REQUESTNEWPLAYERID)lpcMessageBody; LPDPMSG_NEWPLAYERIDREPLY lpReply; *lpdwMsgSize = This->dp2->spData.dwSPHeaderSize + sizeof( *lpReply ); - *lplpReply = (LPDPMSG_NEWPLAYERIDREPLY)HeapAlloc( GetProcessHeap(), + *lplpReply = (LPDPMSG_NEWPLAYERIDREPLY)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, *lpdwMsgSize ); @@ -708,16 +708,16 @@ HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpcMessageBody, lpcMsg->dwFlags ); /* Setup the reply */ - lpReply = (LPDPMSG_NEWPLAYERIDREPLY)( (BYTE*)(*lplpReply) + + lpReply = (LPDPMSG_NEWPLAYERIDREPLY)( (BYTE*)(*lplpReply) + This->dp2->spData.dwSPHeaderSize ); lpReply->envelope.dwMagic = DPMSGMAGIC_DPLAYMSG; - lpReply->envelope.wCommandId = DPMSGCMD_NEWPLAYERIDREPLY; - lpReply->envelope.wVersion = DPMSGVER_DP6; + lpReply->envelope.wCommandId = DPMSGCMD_NEWPLAYERIDREPLY; + lpReply->envelope.wVersion = DPMSGVER_DP6; lpReply->dpidNewPlayerId = DP_NextObjectId(); - TRACE( "Allocating new playerid 0x%08lx from remote request\n", + TRACE( "Allocating new playerid 0x%08lx from remote request\n", lpReply->dpidNewPlayerId ); break; @@ -732,10 +732,10 @@ HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpcMessageBody, DebugBreak(); #endif DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize ); - + break; } - + #if 1 case DPMSGCMD_JUSTENVELOPE: { @@ -778,14 +778,14 @@ HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpcMessageBody, static HRESULT WINAPI DP_IF_AddPlayerToGroup - ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, + ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, DPID idPlayer, BOOL bAnsi ) { lpGroupData lpGData; lpPlayerList lpPList; lpPlayerList lpNewPList; - TRACE( "(%p)->(%p,0x%08lx,0x%08lx,%u)\n", + TRACE( "(%p)->(%p,0x%08lx,0x%08lx,%u)\n", This, lpMsgHdr, idGroup, idPlayer, bAnsi ); /* Find the group */ @@ -803,10 +803,10 @@ static HRESULT WINAPI DP_IF_AddPlayerToGroup /* Create a player list (ie "shortcut" ) */ lpNewPList = (lpPlayerList)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpNewPList ) ); - if( lpNewPList == NULL ) + if( lpNewPList == NULL ) { return DPERR_CANTADDPLAYER; - } + } /* Add the shortcut */ lpPList->lpPData->uRef++; @@ -819,7 +819,7 @@ static HRESULT WINAPI DP_IF_AddPlayerToGroup if( This->dp2->spData.lpCB->AddPlayerToGroup ) { DPSP_ADDPLAYERTOGROUPDATA data; - + TRACE( "Calling SP AddPlayerToGroup\n" ); data.idPlayer = idPlayer; @@ -839,7 +839,7 @@ static HRESULT WINAPI DP_IF_AddPlayerToGroup ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) ) { DPMSG_ADDPLAYERTOGROUP msg; - msg.dwType = DPSYS_ADDPLAYERTOGROUP; + msg.dwType = DPSYS_ADDPLAYERTOGROUP; msg.dpIdGroup = idGroup; msg.dpIdPlayer = idPlayer; @@ -885,9 +885,9 @@ static HRESULT WINAPI DP_IF_Close( IDirectPlay2Impl* This, BOOL bAnsi ) TRACE( "Calling SP CloseEx\n" ); data.lpISP = This->dp2->spData.lpISP; - + hr = (*This->dp2->spData.lpCB->CloseEx)( &data ); - + } else if ( This->dp2->spData.lpCB->Close ) /* Try obsolete version */ { @@ -915,7 +915,7 @@ static HRESULT WINAPI DirectPlay2WImpl_Close static lpGroupData DP_CreateGroup( IDirectPlay2AImpl* This, LPDPID lpid, - LPDPNAME lpName, DWORD dwFlags, + LPDPNAME lpName, DWORD dwFlags, DPID idParent, BOOL bAnsi ) { lpGroupData lpGData; @@ -936,7 +936,7 @@ lpGroupData DP_CreateGroup( IDirectPlay2AImpl* This, LPDPID lpid, lpGData->dpid = *lpid; DP_CopyDPNAMEStruct( &lpGData->name, lpName, bAnsi ); - + /* FIXME: Should we check that the parent exists? */ lpGData->parent = idParent; @@ -949,7 +949,7 @@ lpGroupData DP_CreateGroup( IDirectPlay2AImpl* This, LPDPID lpid, } /* This method assumes that all links to it are already deleted */ -static void +static void DP_DeleteGroup( IDirectPlay2Impl* This, DPID dpid ) { lpGroupList lpGList; @@ -976,7 +976,7 @@ DP_DeleteGroup( IDirectPlay2Impl* This, DPID dpid ) /* Remove and Delete Player List object */ HeapFree( GetProcessHeap(), 0, lpGList ); - + } static lpGroupData DP_FindAnyGroup( IDirectPlay2AImpl* This, DPID dpid ) @@ -993,7 +993,7 @@ static lpGroupData DP_FindAnyGroup( IDirectPlay2AImpl* This, DPID dpid ) { DPQ_FIND_ENTRY( This->dp2->lpSysGroup->groups, groups, lpGData->dpid, ==, dpid, lpGroups ); } - + if( lpGroups == NULL ) { return NULL; @@ -1003,14 +1003,14 @@ static lpGroupData DP_FindAnyGroup( IDirectPlay2AImpl* This, DPID dpid ) } static HRESULT WINAPI DP_IF_CreateGroup - ( IDirectPlay2AImpl* This, LPVOID lpMsgHdr, LPDPID lpidGroup, - LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, + ( IDirectPlay2AImpl* This, LPVOID lpMsgHdr, LPDPID lpidGroup, + LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) { lpGroupData lpGData; - TRACE( "(%p)->(%p,%p,%p,%p,0x%08lx,0x%08lx,%u)\n", - This, lpMsgHdr, lpidGroup, lpGroupName, lpData, dwDataSize, + TRACE( "(%p)->(%p,%p,%p,%p,0x%08lx,0x%08lx,%u)\n", + This, lpMsgHdr, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags, bAnsi ); /* If the name is not specified, we must provide one */ @@ -1028,7 +1028,7 @@ static HRESULT WINAPI DP_IF_CreateGroup *lpidGroup = DP_GetRemoteNextObjectId(); } } - + lpGData = DP_CreateGroup( This, lpidGroup, lpGroupName, dwFlags, DPID_NOPARENT_GROUP, bAnsi ); @@ -1039,13 +1039,13 @@ static HRESULT WINAPI DP_IF_CreateGroup if( DPID_SYSTEM_GROUP == *lpidGroup ) { - This->dp2->lpSysGroup = lpGData; + This->dp2->lpSysGroup = lpGData; TRACE( "Inserting system group\n" ); } else { /* Insert into the system group */ - lpGroupList lpGroup = (lpGroupList) HeapAlloc( GetProcessHeap(), + lpGroupList lpGroup = (lpGroupList) HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGroup ) ); lpGroup->lpGData = lpGData; @@ -1088,12 +1088,12 @@ static HRESULT WINAPI DP_IF_CreateGroup (*This->dp2->spData.lpCB->CreateGroup)( &data ); } - /* Inform all other peers of the creation of a new group. If there are - * no peers keep this event quiet. + /* Inform all other peers of the creation of a new group. If there are + * no peers keep this event quiet. * Also if this message was sent to us, don't rebroadcast. */ if( ( lpMsgHdr == NULL ) && - This->dp2->lpSessionDesc && + This->dp2->lpSessionDesc && ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) ) { DPMSG_CREATEPLAYERORGROUP msg; @@ -1124,23 +1124,23 @@ static HRESULT WINAPI DirectPlay2AImpl_CreateGroup { *lpidGroup = DPID_UNKNOWN; - return DP_IF_CreateGroup( (IDirectPlay2AImpl*)iface, NULL, lpidGroup, + return DP_IF_CreateGroup( (IDirectPlay2AImpl*)iface, NULL, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags, TRUE ); } static HRESULT WINAPI DirectPlay2WImpl_CreateGroup - ( LPDIRECTPLAY2 iface, LPDPID lpidGroup, LPDPNAME lpGroupName, + ( LPDIRECTPLAY2 iface, LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) { *lpidGroup = DPID_UNKNOWN; - return DP_IF_CreateGroup( (IDirectPlay2AImpl*)iface, NULL, lpidGroup, + return DP_IF_CreateGroup( (IDirectPlay2AImpl*)iface, NULL, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags, FALSE ); } static void -DP_SetGroupData( lpGroupData lpGData, DWORD dwFlags, +DP_SetGroupData( lpGroupData lpGData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize ) { /* Clear out the data with this player */ @@ -1184,9 +1184,9 @@ DP_SetGroupData( lpGroupData lpGData, DWORD dwFlags, } /* This function will just create the storage for the new player. */ -static -lpPlayerData DP_CreatePlayer( IDirectPlay2Impl* This, LPDPID lpid, - LPDPNAME lpName, DWORD dwFlags, +static +lpPlayerData DP_CreatePlayer( IDirectPlay2Impl* This, LPDPID lpid, + LPDPNAME lpName, DWORD dwFlags, HANDLE hEvent, BOOL bAnsi ) { lpPlayerData lpPData; @@ -1194,7 +1194,7 @@ lpPlayerData DP_CreatePlayer( IDirectPlay2Impl* This, LPDPID lpid, TRACE( "(%p)->(%p,%p,%u)\n", This, lpid, lpName, bAnsi ); /* Allocate the storage for the player and associate it with list element */ - lpPData = (lpPlayerData) HeapAlloc( GetProcessHeap(), + lpPData = (lpPlayerData) HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPData ) ); if( lpPData == NULL ) @@ -1234,8 +1234,8 @@ lpPlayerData DP_CreatePlayer( IDirectPlay2Impl* This, LPDPID lpid, static void DP_DeleteDPNameStruct( LPDPNAME lpDPName ) { - HeapFree( GetProcessHeap(), HEAP_ZERO_MEMORY, lpDPName->u1.lpszShortNameA ); - HeapFree( GetProcessHeap(), HEAP_ZERO_MEMORY, lpDPName->u2.lpszLongNameA ); + HeapFree( GetProcessHeap(), HEAP_ZERO_MEMORY, lpDPName->u1.lpszShortNameA ); + HeapFree( GetProcessHeap(), HEAP_ZERO_MEMORY, lpDPName->u2.lpszLongNameA ); } /* This method assumes that all links to it are already deleted */ @@ -1258,9 +1258,9 @@ DP_DeletePlayer( IDirectPlay2Impl* This, DPID dpid ) if( --(lpPList->lpPData->uRef) ) { FIXME( "Why is this not the last reference to player?\n" ); - DebugBreak(); + DebugBreak(); } - + /* Delete player */ DP_DeleteDPNameStruct( &lpPList->lpPData->name ); @@ -1292,7 +1292,7 @@ static BOOL DP_CopyDPNAMEStruct( LPDPNAME lpDst, LPDPNAME lpSrc, BOOL bAnsi ) return TRUE; } - if( lpSrc->dwSize != sizeof( *lpSrc) ) + if( lpSrc->dwSize != sizeof( *lpSrc) ) { return FALSE; } @@ -1309,7 +1309,7 @@ static BOOL DP_CopyDPNAMEStruct( LPDPNAME lpDst, LPDPNAME lpSrc, BOOL bAnsi ) } /* Copy as required */ - CopyMemory( lpDst, lpSrc, lpSrc->dwSize ); + CopyMemory( lpDst, lpSrc, lpSrc->dwSize ); if( bAnsi ) { @@ -1345,8 +1345,8 @@ static BOOL DP_CopyDPNAMEStruct( LPDPNAME lpDst, LPDPNAME lpSrc, BOOL bAnsi ) return TRUE; } -static void -DP_SetPlayerData( lpPlayerData lpPData, DWORD dwFlags, +static void +DP_SetPlayerData( lpPlayerData lpPData, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize ) { /* Clear out the data with this player */ @@ -1389,14 +1389,14 @@ DP_SetPlayerData( lpPlayerData lpPData, DWORD dwFlags, } -static HRESULT WINAPI DP_IF_CreatePlayer -( IDirectPlay2Impl* This, +static HRESULT WINAPI DP_IF_CreatePlayer +( IDirectPlay2Impl* This, LPVOID lpMsgHdr, /* NULL for local creation, non NULL for remote creation */ - LPDPID lpidPlayer, - LPDPNAME lpPlayerName, - HANDLE hEvent, - LPVOID lpData, - DWORD dwDataSize, + LPDPID lpidPlayer, + LPDPNAME lpPlayerName, + HANDLE hEvent, + LPVOID lpData, + DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) { @@ -1405,11 +1405,11 @@ static HRESULT WINAPI DP_IF_CreatePlayer lpPlayerList lpPList; DWORD dwCreateFlags = 0; - TRACE( "(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx,%u)\n", - This, lpidPlayer, lpPlayerName, hEvent, lpData, + TRACE( "(%p)->(%p,%p,%d,%p,0x%08lx,0x%08lx,%u)\n", + This, lpidPlayer, lpPlayerName, hEvent, lpData, dwDataSize, dwFlags, bAnsi ); - if( dwFlags == 0 ) + if( dwFlags == 0 ) { dwFlags = DPPLAYER_SPECTATOR; } @@ -1509,7 +1509,7 @@ static HRESULT WINAPI DP_IF_CreatePlayer DPQ_INSERT( This->dp2->lpSysGroup->players, lpPList, players ); /* Update the information and send it to all players in the session */ - DP_SetPlayerData( lpPData, DPSET_REMOTE, lpData, dwDataSize ); + DP_SetPlayerData( lpPData, DPSET_REMOTE, lpData, dwDataSize ); /* Let the SP know that we've created this player */ if( This->dp2->spData.lpCB->CreatePlayer ) @@ -1539,7 +1539,7 @@ static HRESULT WINAPI DP_IF_CreatePlayer DPSP_ADDPLAYERTOGROUPDATA data; data.idPlayer = *lpidPlayer; - data.idGroup = DPID_SYSTEM_GROUP; + data.idGroup = DPID_SYSTEM_GROUP; data.lpISP = This->dp2->spData.lpISP; TRACE( "Calling SP AddPlayerToGroup (sys group)\n" ); @@ -1549,7 +1549,7 @@ static HRESULT WINAPI DP_IF_CreatePlayer if( FAILED(hr) ) { - ERR( "Failed to add player to sys group with sp: %s\n", + ERR( "Failed to add player to sys group with sp: %s\n", DPLAYX_HresultToString(hr) ); return hr; } @@ -1571,7 +1571,7 @@ static HRESULT WINAPI DP_IF_CreatePlayer } #else /* Inform all other peers of the creation of a new player. If there are - * no peers keep this quiet. + * no peers keep this quiet. * Also, if this was a remote event, no need to rebroadcast it. */ if( ( lpMsgHdr == NULL ) && @@ -1593,7 +1593,7 @@ static HRESULT WINAPI DP_IF_CreatePlayer /* FIXME: Correct to just use send effectively? */ /* FIXME: Should size include data w/ message or just message "header" */ /* FIXME: Check return code */ - hr = DP_SendEx( This, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg, + hr = DP_SendEx( This, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg, sizeof( msg ), 0, 0, NULL, NULL, bAnsi ); } #endif @@ -1602,7 +1602,7 @@ static HRESULT WINAPI DP_IF_CreatePlayer } static HRESULT WINAPI DirectPlay2AImpl_CreatePlayer - ( LPDIRECTPLAY2A iface, LPDPID lpidPlayer, LPDPNAME lpPlayerName, + ( LPDIRECTPLAY2A iface, LPDPID lpidPlayer, LPDPNAME lpPlayerName, HANDLE hEvent, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -1616,12 +1616,12 @@ static HRESULT WINAPI DirectPlay2AImpl_CreatePlayer *lpidPlayer = DPID_UNKNOWN; } - return DP_IF_CreatePlayer( This, NULL, lpidPlayer, lpPlayerName, hEvent, + return DP_IF_CreatePlayer( This, NULL, lpidPlayer, lpPlayerName, hEvent, lpData, dwDataSize, dwFlags, TRUE ); } static HRESULT WINAPI DirectPlay2WImpl_CreatePlayer - ( LPDIRECTPLAY2 iface, LPDPID lpidPlayer, LPDPNAME lpPlayerName, + ( LPDIRECTPLAY2 iface, LPDPID lpidPlayer, LPDPNAME lpPlayerName, HANDLE hEvent, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -1635,7 +1635,7 @@ static HRESULT WINAPI DirectPlay2WImpl_CreatePlayer *lpidPlayer = DPID_UNKNOWN; } - return DP_IF_CreatePlayer( This, NULL, lpidPlayer, lpPlayerName, hEvent, + return DP_IF_CreatePlayer( This, NULL, lpidPlayer, lpPlayerName, hEvent, lpData, dwDataSize, dwFlags, FALSE ); } @@ -1648,15 +1648,15 @@ static DPID DP_GetRemoteNextObjectId(void) } static HRESULT WINAPI DP_IF_DeletePlayerFromGroup - ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, + ( IDirectPlay2Impl* This, LPVOID lpMsgHdr, DPID idGroup, DPID idPlayer, BOOL bAnsi ) { HRESULT hr = DP_OK; lpGroupData lpGData; lpPlayerList lpPList; - - TRACE( "(%p)->(%p,0x%08lx,0x%08lx,%u)\n", + + TRACE( "(%p)->(%p,0x%08lx,0x%08lx,%u)\n", This, lpMsgHdr, idGroup, idPlayer, bAnsi ); /* Find the group */ @@ -1736,24 +1736,24 @@ cbRemoveGroupOrPlayer( { lpDPRGOPContext lpCtxt = (lpDPRGOPContext)lpContext; - TRACE( "Removing element:0x%08lx (type:0x%08lx) from element:0x%08lx\n", + TRACE( "Removing element:0x%08lx (type:0x%08lx) from element:0x%08lx\n", dpId, dwPlayerType, lpCtxt->idGroup ); if( dwPlayerType == DPPLAYERTYPE_GROUP ) { - if( FAILED( DP_IF_DeleteGroupFromGroup( lpCtxt->This, lpCtxt->idGroup, - dpId ) - ) + if( FAILED( DP_IF_DeleteGroupFromGroup( lpCtxt->This, lpCtxt->idGroup, + dpId ) + ) ) { - ERR( "Unable to delete group 0x%08lx from group 0x%08lx\n", + ERR( "Unable to delete group 0x%08lx from group 0x%08lx\n", dpId, lpCtxt->idGroup ); } } else { - if( FAILED( DP_IF_DeletePlayerFromGroup( (IDirectPlay2Impl*)lpCtxt->This, - NULL, lpCtxt->idGroup, + if( FAILED( DP_IF_DeletePlayerFromGroup( (IDirectPlay2Impl*)lpCtxt->This, + NULL, lpCtxt->idGroup, dpId, lpCtxt->bAnsi ) ) ) @@ -1762,7 +1762,7 @@ cbRemoveGroupOrPlayer( dpId, lpCtxt->idGroup ); } } - + return TRUE; /* Continue enumeration */ } @@ -1772,7 +1772,7 @@ static HRESULT WINAPI DP_IF_DestroyGroup lpGroupData lpGData; DPRGOPContext context; - FIXME( "(%p)->(%p,0x%08lx,%u): semi stub\n", + FIXME( "(%p)->(%p,0x%08lx,%u): semi stub\n", This, lpMsgHdr, idGroup, bAnsi ); /* Find the group */ @@ -1786,11 +1786,11 @@ static HRESULT WINAPI DP_IF_DestroyGroup context.idGroup = idGroup; /* Remove all players that this group has */ - DP_IF_EnumGroupPlayers( This, idGroup, NULL, + DP_IF_EnumGroupPlayers( This, idGroup, NULL, cbRemoveGroupOrPlayer, (LPVOID)&context, 0, bAnsi ); /* Remove all links to groups that this group has since this is dp3 */ - DP_IF_EnumGroupsInGroup( (IDirectPlay3Impl*)This, idGroup, NULL, + DP_IF_EnumGroupsInGroup( (IDirectPlay3Impl*)This, idGroup, NULL, cbRemoveGroupOrPlayer, (LPVOID)&context, 0, bAnsi ); /* Remove this group from the parent group - if it has one */ @@ -1798,12 +1798,12 @@ static HRESULT WINAPI DP_IF_DestroyGroup ( lpGData->parent != DPID_SYSTEM_GROUP ) ) { - DP_IF_DeleteGroupFromGroup( (IDirectPlay3Impl*)This, lpGData->parent, - idGroup ); + DP_IF_DeleteGroupFromGroup( (IDirectPlay3Impl*)This, lpGData->parent, + idGroup ); } - + /* Now delete this group data and list from the system group */ - DP_DeleteGroup( This, idGroup ); + DP_DeleteGroup( This, idGroup ); /* Let the SP know that we've destroyed this group */ if( This->dp2->spData.lpCB->DeleteGroup ) @@ -1813,7 +1813,7 @@ static HRESULT WINAPI DP_IF_DestroyGroup FIXME( "data.dwFlags is incorrect\n" ); data.idGroup = idGroup; - data.dwFlags = 0; + data.dwFlags = 0; data.lpISP = This->dp2->spData.lpISP; (*This->dp2->spData.lpCB->DeleteGroup)( &data ); @@ -1850,7 +1850,7 @@ static HRESULT WINAPI DP_IF_DestroyPlayer { DPFAGContext cbContext; - FIXME( "(%p)->(%p,0x%08lx,%u): semi stub\n", + FIXME( "(%p)->(%p,0x%08lx,%u): semi stub\n", This, lpMsgHdr, idPlayer, bAnsi ); if( DP_FindPlayer( This, idPlayer ) == NULL ) @@ -1880,7 +1880,7 @@ static HRESULT WINAPI DP_IF_DestroyPlayer FIXME( "data.dwFlags is incorrect\n" ); data.idPlayer = idPlayer; - data.dwFlags = 0; + data.dwFlags = 0; data.lpISP = This->dp2->spData.lpISP; (*This->dp2->spData.lpCB->DeletePlayer)( &data ); @@ -1912,7 +1912,7 @@ cbDeletePlayerFromAllGroups( DP_IF_EnumGroupsInGroup( (IDirectPlay3Impl*)lpCtxt->This, dpId, NULL, cbDeletePlayerFromAllGroups, - (LPVOID)lpContext, DPENUMGROUPS_ALL, + (LPVOID)lpContext, DPENUMGROUPS_ALL, lpCtxt->bAnsi ); } @@ -1939,15 +1939,15 @@ static HRESULT WINAPI DirectPlay2WImpl_DestroyPlayer } static HRESULT WINAPI DP_IF_EnumGroupPlayers - ( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance, + ( IDirectPlay2Impl* This, DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) { lpGroupData lpGData; lpPlayerList lpPList; - FIXME("(%p)->(0x%08lx,%p,%p,%p,0x%08lx,%u): semi stub\n", - This, idGroup, lpguidInstance, lpEnumPlayersCallback2, + FIXME("(%p)->(0x%08lx,%p,%p,%p,0x%08lx,%u): semi stub\n", + This, idGroup, lpguidInstance, lpEnumPlayersCallback2, lpContext, dwFlags, bAnsi ); /* Find the group */ @@ -1960,7 +1960,7 @@ static HRESULT WINAPI DP_IF_EnumGroupPlayers { return DP_OK; } - + lpPList = DPQ_FIRST( lpGData->players ); /* Walk the players in this group */ @@ -1970,7 +1970,7 @@ static HRESULT WINAPI DP_IF_EnumGroupPlayers * concequence to the end user. */ if( ( lpPList->lpPData->dpid != DPID_NAME_SERVER ) && - ( lpPList->lpPData->dpid != DPID_SERVERPLAYER ) + ( lpPList->lpPData->dpid != DPID_SERVERPLAYER ) ) { @@ -1989,7 +1989,7 @@ static HRESULT WINAPI DP_IF_EnumGroupPlayers if( DPQ_IS_ENDOFLIST( lpPList->players ) ) { - break; + break; } lpPList = DPQ_NEXT( lpPList->players ); @@ -1999,7 +1999,7 @@ static HRESULT WINAPI DP_IF_EnumGroupPlayers } static HRESULT WINAPI DirectPlay2AImpl_EnumGroupPlayers - ( LPDIRECTPLAY2A iface, DPID idGroup, LPGUID lpguidInstance, + ( LPDIRECTPLAY2A iface, DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags ) { @@ -2010,7 +2010,7 @@ static HRESULT WINAPI DirectPlay2AImpl_EnumGroupPlayers } static HRESULT WINAPI DirectPlay2WImpl_EnumGroupPlayers - ( LPDIRECTPLAY2 iface, DPID idGroup, LPGUID lpguidInstance, + ( LPDIRECTPLAY2 iface, DPID idGroup, LPGUID lpguidInstance, LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags ) { @@ -2022,19 +2022,19 @@ static HRESULT WINAPI DirectPlay2WImpl_EnumGroupPlayers /* NOTE: This only enumerates top level groups (created with CreateGroup) */ static HRESULT WINAPI DP_IF_EnumGroups - ( IDirectPlay2Impl* This, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + ( IDirectPlay2Impl* This, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) { - return DP_IF_EnumGroupsInGroup( (IDirectPlay3Impl*)This, + return DP_IF_EnumGroupsInGroup( (IDirectPlay3Impl*)This, DPID_SYSTEM_GROUP, lpguidInstance, lpEnumPlayersCallback2, lpContext, dwFlags, bAnsi ); } static HRESULT WINAPI DirectPlay2AImpl_EnumGroups - ( LPDIRECTPLAY2A iface, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + ( LPDIRECTPLAY2A iface, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2043,8 +2043,8 @@ static HRESULT WINAPI DirectPlay2AImpl_EnumGroups } static HRESULT WINAPI DirectPlay2WImpl_EnumGroups - ( LPDIRECTPLAY2 iface, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + ( LPDIRECTPLAY2 iface, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2053,8 +2053,8 @@ static HRESULT WINAPI DirectPlay2WImpl_EnumGroups } static HRESULT WINAPI DP_IF_EnumPlayers - ( IDirectPlay2Impl* This, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + ( IDirectPlay2Impl* This, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) { return DP_IF_EnumGroupPlayers( This, DPID_SYSTEM_GROUP, lpguidInstance, @@ -2063,8 +2063,8 @@ static HRESULT WINAPI DP_IF_EnumPlayers } static HRESULT WINAPI DirectPlay2AImpl_EnumPlayers - ( LPDIRECTPLAY2A iface, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + ( LPDIRECTPLAY2A iface, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2073,8 +2073,8 @@ static HRESULT WINAPI DirectPlay2AImpl_EnumPlayers } static HRESULT WINAPI DirectPlay2WImpl_EnumPlayers - ( LPDIRECTPLAY2 iface, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + ( LPDIRECTPLAY2 iface, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2168,7 +2168,7 @@ static void DP_KillEnumSessionThread( IDirectPlay2Impl* This ) /* Does a thread exist? If so we were doing an async enum session */ if( This->dp2->hEnumSessionThread != INVALID_HANDLE_VALUE ) { - TRACE( "Killing EnumSession thread %u\n", + TRACE( "Killing EnumSession thread %u\n", This->dp2->hEnumSessionThread ); /* Request that the thread kill itself nicely */ @@ -2183,13 +2183,13 @@ static void DP_KillEnumSessionThread( IDirectPlay2Impl* This ) } static HRESULT WINAPI DP_IF_EnumSessions - ( IDirectPlay2Impl* This, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, + ( IDirectPlay2Impl* This, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) { HRESULT hr = DP_OK; - TRACE( "(%p)->(%p,0x%08lx,%p,%p,0x%08lx,%u)\n", + TRACE( "(%p)->(%p,0x%08lx,%p,%p,0x%08lx,%u)\n", This, lpsd, dwTimeout, lpEnumSessionsCallback2, lpContext, dwFlags, bAnsi ); @@ -2267,8 +2267,8 @@ static HRESULT WINAPI DP_IF_EnumSessions if( ( dwFlags & DPENUMSESSIONS_ASYNC ) ) { /* Enumerate everything presently in the local session cache */ - DP_InvokeEnumSessionCallbacks( lpEnumSessionsCallback2, - This->dp2->lpNameServerData, dwTimeout, + DP_InvokeEnumSessionCallbacks( lpEnumSessionsCallback2, + This->dp2->lpNameServerData, dwTimeout, lpContext ); @@ -2285,7 +2285,7 @@ static HRESULT WINAPI DP_IF_EnumSessions if( !FAILED(hr) ) { - EnumSessionAsyncCallbackData* lpData + EnumSessionAsyncCallbackData* lpData = (EnumSessionAsyncCallbackData*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpData ) ); @@ -2295,11 +2295,11 @@ static HRESULT WINAPI DP_IF_EnumSessions CopyMemory( &lpData->requestGuid, &lpsd->guidApplication, sizeof(GUID) ); lpData->dwEnumSessionFlags = dwFlags; lpData->dwTimeout = dwTimeout; - - This->dp2->hKillEnumSessionThreadEvent = + + This->dp2->hKillEnumSessionThreadEvent = CreateEventA( NULL, TRUE, FALSE, NULL ); - - if( !DuplicateHandle( GetCurrentProcess(), + + if( !DuplicateHandle( GetCurrentProcess(), This->dp2->hKillEnumSessionThreadEvent, GetCurrentProcess(), &lpData->hSuicideRequest, @@ -2308,9 +2308,9 @@ static HRESULT WINAPI DP_IF_EnumSessions { ERR( "Can't duplicate thread killing handle\n" ); } - + TRACE( ": creating EnumSessionsRequest thread\n" ); - + This->dp2->hEnumSessionThread = CreateThread( NULL, 0, DP_EnumSessionsSendAsyncRequestThread, @@ -2318,7 +2318,7 @@ static HRESULT WINAPI DP_IF_EnumSessions 0, &dwThreadId ); } - } + } } else { @@ -2333,8 +2333,8 @@ static HRESULT WINAPI DP_IF_EnumSessions SleepEx( dwTimeout, FALSE ); - DP_InvokeEnumSessionCallbacks( lpEnumSessionsCallback2, - This->dp2->lpNameServerData, dwTimeout, + DP_InvokeEnumSessionCallbacks( lpEnumSessionsCallback2, + This->dp2->lpNameServerData, dwTimeout, lpContext ); } @@ -2342,7 +2342,7 @@ static HRESULT WINAPI DP_IF_EnumSessions } static HRESULT WINAPI DirectPlay2AImpl_EnumSessions - ( LPDIRECTPLAY2A iface, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, + ( LPDIRECTPLAY2A iface, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2, LPVOID lpContext, DWORD dwFlags ) { @@ -2352,7 +2352,7 @@ static HRESULT WINAPI DirectPlay2AImpl_EnumSessions } static HRESULT WINAPI DirectPlay2WImpl_EnumSessions - ( LPDIRECTPLAY2 iface, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, + ( LPDIRECTPLAY2 iface, LPDPSESSIONDESC2 lpsd, DWORD dwTimeout, LPDPENUMSESSIONSCALLBACK2 lpEnumSessionsCallback2, LPVOID lpContext, DWORD dwFlags ) { @@ -2362,7 +2362,7 @@ static HRESULT WINAPI DirectPlay2WImpl_EnumSessions } static HRESULT WINAPI DP_IF_GetPlayerCaps - ( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps, + ( IDirectPlay2Impl* This, DPID idPlayer, LPDPCAPS lpDPCaps, DWORD dwFlags ) { DPSP_GETCAPSDATA data; @@ -2399,14 +2399,14 @@ static HRESULT WINAPI DirectPlay2WImpl_GetCaps } static HRESULT WINAPI DP_IF_GetGroupData - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ) { lpGroupData lpGData; DWORD dwRequiredBufferSize; LPVOID lpCopyDataFrom; - TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx,%u)\n", + TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx,%u)\n", This, idGroup, lpData, lpdwDataSize, dwFlags, bAnsi ); if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL ) @@ -2434,11 +2434,11 @@ static HRESULT WINAPI DP_IF_GetGroupData /* Is the user requesting to know how big a buffer is required? */ if( ( lpData == NULL ) || - ( *lpdwDataSize < dwRequiredBufferSize ) + ( *lpdwDataSize < dwRequiredBufferSize ) ) { *lpdwDataSize = dwRequiredBufferSize; - return DPERR_BUFFERTOOSMALL; + return DPERR_BUFFERTOOSMALL; } CopyMemory( lpData, lpCopyDataFrom, dwRequiredBufferSize ); @@ -2447,32 +2447,32 @@ static HRESULT WINAPI DP_IF_GetGroupData } static HRESULT WINAPI DirectPlay2AImpl_GetGroupData - ( LPDIRECTPLAY2A iface, DPID idGroup, LPVOID lpData, + ( LPDIRECTPLAY2A iface, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_IF_GetGroupData( This, idGroup, lpData, lpdwDataSize, + return DP_IF_GetGroupData( This, idGroup, lpData, lpdwDataSize, dwFlags, TRUE ); } static HRESULT WINAPI DirectPlay2WImpl_GetGroupData - ( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, + ( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_IF_GetGroupData( This, idGroup, lpData, lpdwDataSize, + return DP_IF_GetGroupData( This, idGroup, lpData, lpdwDataSize, dwFlags, FALSE ); } static HRESULT WINAPI DP_IF_GetGroupName - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ) { lpGroupData lpGData; LPDPNAME lpName = (LPDPNAME)lpData; DWORD dwRequiredDataSize; - FIXME("(%p)->(0x%08lx,%p,%p,%u) ANSI ignored\n", + FIXME("(%p)->(0x%08lx,%p,%p,%u) ANSI ignored\n", This, idGroup, lpData, lpdwDataSize, bAnsi ); if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL ) @@ -2491,7 +2491,7 @@ static HRESULT WINAPI DP_IF_GetGroupName { dwRequiredDataSize += strlen( lpGData->name.u2.lpszLongNameA ) + 1; } - + if( ( lpData == NULL ) || ( *lpdwDataSize < dwRequiredDataSize ) ) @@ -2505,7 +2505,7 @@ static HRESULT WINAPI DP_IF_GetGroupName if( lpGData->name.u1.lpszShortNameA ) { - strcpy( ((BYTE*)lpName)+lpGData->name.dwSize, + strcpy( ((BYTE*)lpName)+lpGData->name.dwSize, lpGData->name.u1.lpszShortNameA ); } else @@ -2515,7 +2515,7 @@ static HRESULT WINAPI DP_IF_GetGroupName if( lpGData->name.u1.lpszShortNameA ) { - strcpy( ((BYTE*)lpName)+lpGData->name.dwSize, + strcpy( ((BYTE*)lpName)+lpGData->name.dwSize, lpGData->name.u2.lpszLongNameA ); } else @@ -2527,7 +2527,7 @@ static HRESULT WINAPI DP_IF_GetGroupName } static HRESULT WINAPI DirectPlay2AImpl_GetGroupName - ( LPDIRECTPLAY2A iface, DPID idGroup, LPVOID lpData, + ( LPDIRECTPLAY2A iface, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2535,7 +2535,7 @@ static HRESULT WINAPI DirectPlay2AImpl_GetGroupName } static HRESULT WINAPI DirectPlay2WImpl_GetGroupName - ( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, + ( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, LPDWORD lpdwDataSize ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2543,12 +2543,12 @@ static HRESULT WINAPI DirectPlay2WImpl_GetGroupName } static HRESULT WINAPI DP_IF_GetMessageCount - ( IDirectPlay2Impl* This, DPID idPlayer, + ( IDirectPlay2Impl* This, DPID idPlayer, LPDWORD lpdwCount, BOOL bAnsi ) { FIXME("(%p)->(0x%08lx,%p,%u): stub\n", This, idPlayer, lpdwCount, bAnsi ); - return DP_IF_GetMessageQueue( (IDirectPlay4Impl*)This, 0, idPlayer, - DPMESSAGEQUEUE_RECEIVE, lpdwCount, NULL, + return DP_IF_GetMessageQueue( (IDirectPlay4Impl*)This, 0, idPlayer, + DPMESSAGEQUEUE_RECEIVE, lpdwCount, NULL, bAnsi ); } @@ -2583,7 +2583,7 @@ static HRESULT WINAPI DirectPlay2WImpl_GetPlayerAddress } static HRESULT WINAPI DirectPlay2AImpl_GetPlayerCaps - ( LPDIRECTPLAY2A iface, DPID idPlayer, LPDPCAPS lpPlayerCaps, + ( LPDIRECTPLAY2A iface, DPID idPlayer, LPDPCAPS lpPlayerCaps, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2591,7 +2591,7 @@ static HRESULT WINAPI DirectPlay2AImpl_GetPlayerCaps } static HRESULT WINAPI DirectPlay2WImpl_GetPlayerCaps - ( LPDIRECTPLAY2 iface, DPID idPlayer, LPDPCAPS lpPlayerCaps, + ( LPDIRECTPLAY2 iface, DPID idPlayer, LPDPCAPS lpPlayerCaps, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2599,14 +2599,14 @@ static HRESULT WINAPI DirectPlay2WImpl_GetPlayerCaps } static HRESULT WINAPI DP_IF_GetPlayerData - ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags, BOOL bAnsi ) { lpPlayerList lpPList; DWORD dwRequiredBufferSize; LPVOID lpCopyDataFrom; - TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx,%u)\n", + TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx,%u)\n", This, idPlayer, lpData, lpdwDataSize, dwFlags, bAnsi ); if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL ) @@ -2647,32 +2647,32 @@ static HRESULT WINAPI DP_IF_GetPlayerData } static HRESULT WINAPI DirectPlay2AImpl_GetPlayerData - ( LPDIRECTPLAY2A iface, DPID idPlayer, LPVOID lpData, + ( LPDIRECTPLAY2A iface, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_IF_GetPlayerData( This, idPlayer, lpData, lpdwDataSize, + return DP_IF_GetPlayerData( This, idPlayer, lpData, lpdwDataSize, dwFlags, TRUE ); } static HRESULT WINAPI DirectPlay2WImpl_GetPlayerData - ( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, + ( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_IF_GetPlayerData( This, idPlayer, lpData, lpdwDataSize, + return DP_IF_GetPlayerData( This, idPlayer, lpData, lpdwDataSize, dwFlags, FALSE ); } static HRESULT WINAPI DP_IF_GetPlayerName - ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ) { lpPlayerList lpPList; LPDPNAME lpName = (LPDPNAME)lpData; DWORD dwRequiredDataSize; - FIXME( "(%p)->(0x%08lx,%p,%p,%u): ANSI \n", + FIXME( "(%p)->(0x%08lx,%p,%p,%u): ANSI \n", This, idPlayer, lpData, lpdwDataSize, bAnsi ); if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL ) @@ -2727,7 +2727,7 @@ static HRESULT WINAPI DP_IF_GetPlayerName } static HRESULT WINAPI DirectPlay2AImpl_GetPlayerName - ( LPDIRECTPLAY2A iface, DPID idPlayer, LPVOID lpData, + ( LPDIRECTPLAY2A iface, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2735,7 +2735,7 @@ static HRESULT WINAPI DirectPlay2AImpl_GetPlayerName } static HRESULT WINAPI DirectPlay2WImpl_GetPlayerName - ( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, + ( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, LPDWORD lpdwDataSize ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -2743,14 +2743,14 @@ static HRESULT WINAPI DirectPlay2WImpl_GetPlayerName } static HRESULT WINAPI DP_GetSessionDesc - ( IDirectPlay2Impl* This, LPVOID lpData, LPDWORD lpdwDataSize, + ( IDirectPlay2Impl* This, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ) { DWORD dwRequiredSize; TRACE( "(%p)->(%p,%p,%u)\n", This, lpData, lpdwDataSize, bAnsi ); - if( ( lpData == NULL ) && ( lpdwDataSize == NULL ) ) + if( ( lpData == NULL ) && ( lpdwDataSize == NULL ) ) { return DPERR_INVALIDPARAMS; } @@ -2765,10 +2765,10 @@ static HRESULT WINAPI DP_GetSessionDesc *lpdwDataSize = dwRequiredSize; return DPERR_BUFFERTOOSMALL; } - + DP_CopySessionDesc( lpData, This->dp2->lpSessionDesc, bAnsi ); - return DP_OK; + return DP_OK; } static HRESULT WINAPI DirectPlay2AImpl_GetSessionDesc @@ -2811,7 +2811,7 @@ static HRESULT WINAPI DP_SecureOpen { HRESULT hr = DP_OK; - FIXME( "(%p)->(%p,0x%08lx,%p,%p): partial stub\n", + FIXME( "(%p)->(%p,0x%08lx,%p,%p): partial stub\n", This, lpsd, dwFlags, lpSecurity, lpCredentials ); if( This->dp2->bConnectionOpen ) @@ -2834,7 +2834,7 @@ static HRESULT WINAPI DP_SecureOpen hr = DP_SetSessionDesc( This, lpsd, 0, TRUE, bAnsi ); if( FAILED( hr ) ) { - ERR( "Unable to set session desc: %s\n", DPLAYX_HresultToString( hr ) ); + ERR( "Unable to set session desc: %s\n", DPLAYX_HresultToString( hr ) ); return hr; } } @@ -2847,7 +2847,7 @@ static HRESULT WINAPI DP_SecureOpen FIXME( "Not all data fields are correct. Need new parameter\n" ); data.bCreate = (dwFlags & DPOPEN_CREATE ) ? TRUE : FALSE; - data.lpSPMessageHeader = (dwFlags & DPOPEN_CREATE ) ? NULL + data.lpSPMessageHeader = (dwFlags & DPOPEN_CREATE ) ? NULL : NS_GetNSAddr( This->dp2->lpNameServerData ); data.lpISP = This->dp2->spData.lpISP; data.bReturnStatus = (dwFlags & DPOPEN_RETURNSTATUS) ? TRUE : FALSE; @@ -2857,7 +2857,7 @@ static HRESULT WINAPI DP_SecureOpen hr = (*This->dp2->spData.lpCB->Open)(&data); if( FAILED( hr ) ) { - ERR( "Unable to open session: %s\n", DPLAYX_HresultToString( hr ) ); + ERR( "Unable to open session: %s\n", DPLAYX_HresultToString( hr ) ); return hr; } } @@ -2868,23 +2868,23 @@ static HRESULT WINAPI DP_SecureOpen hr = DP_IF_CreateGroup( This, NULL, &systemGroup, NULL, NULL, 0, 0, TRUE ); - + } if( dwFlags & DPOPEN_JOIN ) { DPID dpidServerId = DPID_UNKNOWN; - + /* Create the server player for this interface. This way we can receive * messages for this session. */ - /* FIXME: I suppose that we should be setting an event for a receive + /* FIXME: I suppose that we should be setting an event for a receive * type of thing. That way the messaging thread could know to wake * up. DPlay would then trigger the hEvent for the player the * message is directed to. */ - hr = DP_IF_CreatePlayer( This, NULL, &dpidServerId, NULL, 0, NULL, - 0, + hr = DP_IF_CreatePlayer( This, NULL, &dpidServerId, NULL, 0, NULL, + 0, DPPLAYER_SERVERPLAYER | DPPLAYER_LOCAL , bAnsi ); } @@ -2922,12 +2922,12 @@ static HRESULT WINAPI DirectPlay2WImpl_Open } static HRESULT WINAPI DP_IF_Receive - ( IDirectPlay2Impl* This, LPDPID lpidFrom, LPDPID lpidTo, + ( IDirectPlay2Impl* This, LPDPID lpidFrom, LPDPID lpidTo, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize, BOOL bAnsi ) { LPDPMSG lpMsg = NULL; - FIXME( "(%p)->(%p,%p,0x%08lx,%p,%p,%u): stub\n", + FIXME( "(%p)->(%p,%p,0x%08lx,%p,%p,%u): stub\n", This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, bAnsi ); if( dwFlags == 0 ) @@ -2950,7 +2950,7 @@ static HRESULT WINAPI DP_IF_Receive if( !( dwFlags & DPRECEIVE_PEEK ) ) { FIXME( "Remove from queue\n" ); - } + } } else if( ( dwFlags & DPRECEIVE_TOPLAYER ) || ( dwFlags & DPRECEIVE_FROMPLAYER ) @@ -2975,20 +2975,20 @@ static HRESULT WINAPI DP_IF_Receive } static HRESULT WINAPI DirectPlay2AImpl_Receive - ( LPDIRECTPLAY2A iface, LPDPID lpidFrom, LPDPID lpidTo, + ( LPDIRECTPLAY2A iface, LPDPID lpidFrom, LPDPID lpidTo, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_IF_Receive( This, lpidFrom, lpidTo, dwFlags, + return DP_IF_Receive( This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, TRUE ); } static HRESULT WINAPI DirectPlay2WImpl_Receive - ( LPDIRECTPLAY2 iface, LPDPID lpidFrom, LPDPID lpidTo, + ( LPDIRECTPLAY2 iface, LPDPID lpidFrom, LPDPID lpidTo, DWORD dwFlags, LPVOID lpData, LPDWORD lpdwDataSize ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_IF_Receive( This, lpidFrom, lpidTo, dwFlags, + return DP_IF_Receive( This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, FALSE ); } @@ -2996,7 +2996,7 @@ static HRESULT WINAPI DirectPlay2AImpl_Send ( LPDIRECTPLAY2A iface, DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_SendEx( This, idFrom, idTo, dwFlags, lpData, dwDataSize, + return DP_SendEx( This, idFrom, idTo, dwFlags, lpData, dwDataSize, 0, 0, NULL, NULL, TRUE ); } @@ -3004,17 +3004,17 @@ static HRESULT WINAPI DirectPlay2WImpl_Send ( LPDIRECTPLAY2 iface, DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_SendEx( This, idFrom, idTo, dwFlags, lpData, dwDataSize, + return DP_SendEx( This, idFrom, idTo, dwFlags, lpData, dwDataSize, 0, 0, NULL, NULL, FALSE ); } static HRESULT WINAPI DP_IF_SetGroupData - ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idGroup, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) { lpGroupData lpGData; - TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx,%u)\n", + TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx,%u)\n", This, idGroup, lpData, dwDataSize, dwFlags, bAnsi ); /* Parameter check */ @@ -3034,7 +3034,7 @@ static HRESULT WINAPI DP_IF_SetGroupData if( dwFlags & DPSET_REMOTE ) { FIXME( "Was this group created by this interface?\n" ); - /* FIXME: If this is a remote update need to allow it but not + /* FIXME: If this is a remote update need to allow it but not * send a message. */ } @@ -3053,28 +3053,28 @@ static HRESULT WINAPI DP_IF_SetGroupData } static HRESULT WINAPI DirectPlay2AImpl_SetGroupData - ( LPDIRECTPLAY2A iface, DPID idGroup, LPVOID lpData, + ( LPDIRECTPLAY2A iface, DPID idGroup, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) -{ +{ ICOM_THIS(IDirectPlay2Impl,iface); return DP_IF_SetGroupData( This, idGroup, lpData, dwDataSize, dwFlags, TRUE ); } static HRESULT WINAPI DirectPlay2WImpl_SetGroupData - ( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, + ( LPDIRECTPLAY2 iface, DPID idGroup, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) -{ +{ ICOM_THIS(IDirectPlay2Impl,iface); return DP_IF_SetGroupData( This, idGroup, lpData, dwDataSize, dwFlags, FALSE ); } static HRESULT WINAPI DP_IF_SetGroupName - ( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName, + ( IDirectPlay2Impl* This, DPID idGroup, LPDPNAME lpGroupName, DWORD dwFlags, BOOL bAnsi ) { lpGroupData lpGData; - TRACE( "(%p)->(0x%08lx,%p,0x%08lx,%u)\n", This, idGroup, + TRACE( "(%p)->(0x%08lx,%p,0x%08lx,%u)\n", This, idGroup, lpGroupName, dwFlags, bAnsi ); if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL ) @@ -3091,7 +3091,7 @@ static HRESULT WINAPI DP_IF_SetGroupName } static HRESULT WINAPI DirectPlay2AImpl_SetGroupName - ( LPDIRECTPLAY2A iface, DPID idGroup, LPDPNAME lpGroupName, + ( LPDIRECTPLAY2A iface, DPID idGroup, LPDPNAME lpGroupName, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -3099,7 +3099,7 @@ static HRESULT WINAPI DirectPlay2AImpl_SetGroupName } static HRESULT WINAPI DirectPlay2WImpl_SetGroupName - ( LPDIRECTPLAY2 iface, DPID idGroup, LPDPNAME lpGroupName, + ( LPDIRECTPLAY2 iface, DPID idGroup, LPDPNAME lpGroupName, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -3107,12 +3107,12 @@ static HRESULT WINAPI DirectPlay2WImpl_SetGroupName } static HRESULT WINAPI DP_IF_SetPlayerData - ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, + ( IDirectPlay2Impl* This, DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) { lpPlayerList lpPList; - TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx,%u)\n", + TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx,%u)\n", This, idPlayer, lpData, dwDataSize, dwFlags, bAnsi ); /* Parameter check */ @@ -3132,7 +3132,7 @@ static HRESULT WINAPI DP_IF_SetPlayerData if( dwFlags & DPSET_REMOTE ) { FIXME( "Was this group created by this interface?\n" ); - /* FIXME: If this is a remote update need to allow it but not + /* FIXME: If this is a remote update need to allow it but not * send a message. */ } @@ -3148,30 +3148,30 @@ static HRESULT WINAPI DP_IF_SetPlayerData } static HRESULT WINAPI DirectPlay2AImpl_SetPlayerData - ( LPDIRECTPLAY2A iface, DPID idPlayer, LPVOID lpData, + ( LPDIRECTPLAY2A iface, DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_IF_SetPlayerData( This, idPlayer, lpData, dwDataSize, + return DP_IF_SetPlayerData( This, idPlayer, lpData, dwDataSize, dwFlags, TRUE ); } static HRESULT WINAPI DirectPlay2WImpl_SetPlayerData - ( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, + ( LPDIRECTPLAY2 iface, DPID idPlayer, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); - return DP_IF_SetPlayerData( This, idPlayer, lpData, dwDataSize, + return DP_IF_SetPlayerData( This, idPlayer, lpData, dwDataSize, dwFlags, FALSE ); } static HRESULT WINAPI DP_IF_SetPlayerName - ( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName, + ( IDirectPlay2Impl* This, DPID idPlayer, LPDPNAME lpPlayerName, DWORD dwFlags, BOOL bAnsi ) { lpPlayerList lpPList; - TRACE( "(%p)->(0x%08lx,%p,0x%08lx,%u)\n", + TRACE( "(%p)->(0x%08lx,%p,0x%08lx,%u)\n", This, idPlayer, lpPlayerName, dwFlags, bAnsi ); if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL ) @@ -3188,7 +3188,7 @@ static HRESULT WINAPI DP_IF_SetPlayerName } static HRESULT WINAPI DirectPlay2AImpl_SetPlayerName - ( LPDIRECTPLAY2A iface, DPID idPlayer, LPDPNAME lpPlayerName, + ( LPDIRECTPLAY2A iface, DPID idPlayer, LPDPNAME lpPlayerName, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -3196,7 +3196,7 @@ static HRESULT WINAPI DirectPlay2AImpl_SetPlayerName } static HRESULT WINAPI DirectPlay2WImpl_SetPlayerName - ( LPDIRECTPLAY2 iface, DPID idPlayer, LPDPNAME lpPlayerName, + ( LPDIRECTPLAY2 iface, DPID idPlayer, LPDPNAME lpPlayerName, DWORD dwFlags ) { ICOM_THIS(IDirectPlay2Impl,iface); @@ -3204,13 +3204,13 @@ static HRESULT WINAPI DirectPlay2WImpl_SetPlayerName } static HRESULT WINAPI DP_SetSessionDesc - ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpSessDesc, + ( IDirectPlay2Impl* This, LPCDPSESSIONDESC2 lpSessDesc, DWORD dwFlags, BOOL bInitial, BOOL bAnsi ) { DWORD dwRequiredSize; LPDPSESSIONDESC2 lpTempSessDesc; - TRACE( "(%p)->(%p,0x%08lx,%u,%u)\n", + TRACE( "(%p)->(%p,0x%08lx,%u,%u)\n", This, lpSessDesc, dwFlags, bInitial, bAnsi ); if( dwFlags ) @@ -3226,8 +3226,8 @@ static HRESULT WINAPI DP_SetSessionDesc /* FIXME: Copy into This->dp2->lpSessionDesc */ dwRequiredSize = DP_CalcSessionDescSize( lpSessDesc, bAnsi ); - lpTempSessDesc = (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(), - HEAP_ZERO_MEMORY, + lpTempSessDesc = (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(), + HEAP_ZERO_MEMORY, dwRequiredSize ); if( lpTempSessDesc == NULL ) @@ -3243,13 +3243,13 @@ static HRESULT WINAPI DP_SetSessionDesc /* Set the new */ DP_CopySessionDesc( This->dp2->lpSessionDesc, lpSessDesc, bAnsi ); - /* If this is an external invocation of the interface, we should be + /* If this is an external invocation of the interface, we should be * letting everyone know that things have changed. Otherwise this is * just an initialization and it doesn't need to be propagated. */ if( !bInitial ) { - FIXME( "Need to send a DPMSG_SETSESSIONDESC msg to everyone\n" ); + FIXME( "Need to send a DPMSG_SETSESSIONDESC msg to everyone\n" ); } return DP_OK; @@ -3314,7 +3314,7 @@ DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi ) } /* Assumes that contugous buffers are already allocated. */ -static void DP_CopySessionDesc( LPDPSESSIONDESC2 lpSessionDest, +static void DP_CopySessionDesc( LPDPSESSIONDESC2 lpSessionDest, LPCDPSESSIONDESC2 lpSessionSrc, BOOL bAnsi ) { BYTE* lpStartOfFreeSpace; @@ -3333,21 +3333,21 @@ static void DP_CopySessionDesc( LPDPSESSIONDESC2 lpSessionDest, { if( lpSessionSrc->u1.lpszSessionNameA ) { - lstrcpyA( (LPSTR)lpStartOfFreeSpace, + lstrcpyA( (LPSTR)lpStartOfFreeSpace, lpSessionDest->u1.lpszSessionNameA ); lpSessionDest->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace; - lpStartOfFreeSpace += + lpStartOfFreeSpace += lstrlenA( (LPSTR)lpSessionDest->u1.lpszSessionNameA ) + 1; - } + } if( lpSessionSrc->u2.lpszPasswordA ) { - lstrcpyA( (LPSTR)lpStartOfFreeSpace, + lstrcpyA( (LPSTR)lpStartOfFreeSpace, lpSessionDest->u2.lpszPasswordA ); lpSessionDest->u2.lpszPasswordA = (LPSTR)lpStartOfFreeSpace; - lpStartOfFreeSpace += + lpStartOfFreeSpace += lstrlenA( (LPSTR)lpSessionDest->u2.lpszPasswordA ) + 1; - } + } } else /* UNICODE */ { @@ -3361,14 +3361,14 @@ static void DP_CopySessionDesc( LPDPSESSIONDESC2 lpSessionDest, } if( lpSessionSrc->u2.lpszPassword ) - { - lstrcpyW( (LPWSTR)lpStartOfFreeSpace, + { + lstrcpyW( (LPWSTR)lpStartOfFreeSpace, lpSessionDest->u2.lpszPassword ); lpSessionDest->u2.lpszPassword = (LPWSTR)lpStartOfFreeSpace; lpStartOfFreeSpace += sizeof(WCHAR) * ( lstrlenW( (LPWSTR)lpSessionDest->u2.lpszPassword ) + 1 ); } - } + } } @@ -3390,14 +3390,14 @@ static HRESULT WINAPI DP_IF_AddGroupToGroup { return DPERR_INVALIDGROUP; } - + /* Create a player list (ie "shortcut" ) */ lpNewGList = (lpGroupList)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpNewGList ) ); if( lpNewGList == NULL ) { return DPERR_CANTADDPLAYER; - } + } /* Add the shortcut */ lpGData->uRef++; @@ -3408,7 +3408,7 @@ static HRESULT WINAPI DP_IF_AddGroupToGroup /* Send a ADDGROUPTOGROUP message */ FIXME( "Not sending message\n" ); - + return DP_OK; } @@ -3427,27 +3427,27 @@ static HRESULT WINAPI DirectPlay3WImpl_AddGroupToGroup } static HRESULT WINAPI DP_IF_CreateGroupInGroup - ( IDirectPlay3Impl* This, LPVOID lpMsgHdr, DPID idParentGroup, - LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, + ( IDirectPlay3Impl* This, LPVOID lpMsgHdr, DPID idParentGroup, + LPDPID lpidGroup, LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags, BOOL bAnsi ) { lpGroupData lpGParentData; lpGroupList lpGList; lpGroupData lpGData; - TRACE( "(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx,%u)\n", - This, idParentGroup, lpidGroup, lpGroupName, lpData, + TRACE( "(%p)->(0x%08lx,%p,%p,%p,0x%08lx,0x%08lx,%u)\n", + This, idParentGroup, lpidGroup, lpGroupName, lpData, dwDataSize, dwFlags, bAnsi ); /* Verify that the specified parent is valid */ - if( ( lpGParentData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, - idParentGroup ) ) == NULL + if( ( lpGParentData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, + idParentGroup ) ) == NULL ) { return DPERR_INVALIDGROUP; - } + } - lpGData = DP_CreateGroup( (IDirectPlay2AImpl*)This, lpidGroup, lpGroupName, + lpGData = DP_CreateGroup( (IDirectPlay2AImpl*)This, lpidGroup, lpGroupName, dwFlags, idParentGroup, bAnsi ); if( lpGData == NULL ) @@ -3457,12 +3457,12 @@ static HRESULT WINAPI DP_IF_CreateGroupInGroup /* Something else is referencing this data */ lpGData->uRef++; - + DP_SetGroupData( lpGData, DPSET_REMOTE, lpData, dwDataSize ); /* The list has now been inserted into the interface group list. We now need to put a "shortcut" to this group in the parent group */ - lpGList = (lpGroupList)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + lpGList = (lpGroupList)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGList ) ); if( lpGList == NULL ) { @@ -3470,7 +3470,7 @@ static HRESULT WINAPI DP_IF_CreateGroupInGroup return DPERR_CANTADDPLAYER; /* yes player not group */ } - lpGList->lpGData = lpGData; + lpGList->lpGData = lpGData; DPQ_INSERT( lpGParentData->groups, lpGList, groups ); @@ -3489,10 +3489,10 @@ static HRESULT WINAPI DP_IF_CreateGroupInGroup (*This->dp2->spData.lpCB->CreateGroup)( &data ); } - /* Inform all other peers of the creation of a new group. If there are - * no peers keep this quiet. + /* Inform all other peers of the creation of a new group. If there are + * no peers keep this quiet. */ - if( This->dp2->lpSessionDesc && + if( This->dp2->lpSessionDesc && ( This->dp2->lpSessionDesc->dwFlags & DPSESSION_MULTICASTSERVER ) ) { DPMSG_CREATEPLAYERORGROUP msg; @@ -3508,7 +3508,7 @@ static HRESULT WINAPI DP_IF_CreateGroupInGroup /* FIXME: Correct to just use send effectively? */ /* FIXME: Should size include data w/ message or just message "header" */ /* FIXME: Check return code */ - DP_SendEx( (IDirectPlay2Impl*)This, + DP_SendEx( (IDirectPlay2Impl*)This, DPID_SERVERPLAYER, DPID_ALLPLAYERS, 0, &msg, sizeof( msg ), 0, 0, NULL, NULL, bAnsi ); } @@ -3517,30 +3517,30 @@ static HRESULT WINAPI DP_IF_CreateGroupInGroup } static HRESULT WINAPI DirectPlay3AImpl_CreateGroupInGroup - ( LPDIRECTPLAY3A iface, DPID idParentGroup, LPDPID lpidGroup, - LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, + ( LPDIRECTPLAY3A iface, DPID idParentGroup, LPDPID lpidGroup, + LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay3Impl,iface); *lpidGroup = DPID_UNKNOWN; - return DP_IF_CreateGroupInGroup( This, NULL, idParentGroup, lpidGroup, - lpGroupName, lpData, dwDataSize, dwFlags, + return DP_IF_CreateGroupInGroup( This, NULL, idParentGroup, lpidGroup, + lpGroupName, lpData, dwDataSize, dwFlags, TRUE ); } static HRESULT WINAPI DirectPlay3WImpl_CreateGroupInGroup - ( LPDIRECTPLAY3 iface, DPID idParentGroup, LPDPID lpidGroup, - LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, + ( LPDIRECTPLAY3 iface, DPID idParentGroup, LPDPID lpidGroup, + LPDPNAME lpGroupName, LPVOID lpData, DWORD dwDataSize, DWORD dwFlags ) { ICOM_THIS(IDirectPlay3Impl,iface); *lpidGroup = DPID_UNKNOWN; - return DP_IF_CreateGroupInGroup( This, NULL, idParentGroup, lpidGroup, - lpGroupName, lpData, dwDataSize, + return DP_IF_CreateGroupInGroup( This, NULL, idParentGroup, lpidGroup, + lpGroupName, lpData, dwDataSize, dwFlags, FALSE ); } @@ -3556,7 +3556,7 @@ static HRESULT WINAPI DP_IF_DeleteGroupFromGroup if( ( lpGParentData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, idParentGroup ) ) == NULL ) { return DPERR_INVALIDGROUP; - } + } /* Remove the group from the parent group queue */ DPQ_REMOVE_ENTRY( lpGParentData->groups, groups, lpGData->dpid, ==, idGroup, lpGList ); @@ -3570,7 +3570,7 @@ static HRESULT WINAPI DP_IF_DeleteGroupFromGroup lpGList->lpGData->uRef--; /* Free up the list item */ - HeapFree( GetProcessHeap(), 0, lpGList ); + HeapFree( GetProcessHeap(), 0, lpGList ); /* Should send a DELETEGROUPFROMGROUP message */ FIXME( "message not sent\n" ); @@ -3645,7 +3645,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections if( ! ( ( dwFlags & DPCONNECTION_DIRECTPLAY ) || ( dwFlags & DPCONNECTION_DIRECTPLAYLOBBY ) ) - ) + ) { return DPERR_INVALIDFLAGS; } @@ -3661,7 +3661,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections HKEY hkResult; LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers"; LPSTR guidDataSubKey = "Guid"; - char subKeyName[51]; + char subKeyName[51]; DWORD dwIndex, sizeOfSubKeyName=50; FILETIME filetime; @@ -3677,7 +3677,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections /* Traverse all the service providers we have available */ for( dwIndex=0; - RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, + RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS; ++dwIndex, sizeOfSubKeyName=51 ) { @@ -3722,7 +3722,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections dpName.u1.lpszShortNameA = subKeyName; dpName.u2.lpszLongNameA = NULL; - /* Create the compound address for the service provider. + /* Create the compound address for the service provider. * NOTE: This is a gruesome architectural scar right now. DP * uses DPL and DPL uses DP. Nasty stuff. This may be why the * native dll just gets around this little bit by allocating an @@ -3741,7 +3741,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections } /* The enumeration will return FALSE if we are not to continue */ - if( !lpEnumCallback( &serviceProviderGUID, lpAddressBuffer, dwAddressBufferSize, + if( !lpEnumCallback( &serviceProviderGUID, lpAddressBuffer, dwAddressBufferSize, &dpName, DPCONNECTION_DIRECTPLAY, lpContext ) ) { return DP_OK; @@ -3755,7 +3755,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections HKEY hkResult; LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Lobby Providers"; LPSTR guidDataSubKey = "Guid"; - char subKeyName[51]; + char subKeyName[51]; DWORD dwIndex, sizeOfSubKeyName=50; FILETIME filetime; @@ -3771,7 +3771,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections /* Traverse all the lobby providers we have available */ for( dwIndex=0; - RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, + RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS; ++dwIndex, sizeOfSubKeyName=51 ) { @@ -3817,7 +3817,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections dpName.u1.lpszShortNameA = subKeyName; dpName.u2.lpszLongNameA = NULL; - /* Create the compound address for the service provider. + /* Create the compound address for the service provider. NOTE: This is a gruesome architectural scar right now. DP uses DPL and DPL uses DP nast stuff. This may be why the native dll just gets around this little bit by allocating an 80 byte buffer which isn't even a filled with a valid compound @@ -3826,9 +3826,9 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections dpCompoundAddress.guidDataType = DPAID_LobbyProvider; dpCompoundAddress.dwDataSize = sizeof( GUID ); - dpCompoundAddress.lpData = &serviceProviderGUID; + dpCompoundAddress.lpData = &serviceProviderGUID; - if( ( hr = DPL_CreateCompoundAddress( &dpCompoundAddress, 1, lpAddressBuffer, + if( ( hr = DPL_CreateCompoundAddress( &dpCompoundAddress, 1, lpAddressBuffer, &dwAddressBufferSize, TRUE ) ) != DPERR_BUFFERTOOSMALL ) { ERR( "can't get buffer size: %s\n", DPLAYX_HresultToString( hr ) ); @@ -3859,7 +3859,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections static HRESULT WINAPI DirectPlay3WImpl_EnumConnections ( LPDIRECTPLAY3 iface, LPCGUID lpguidApplication, LPDPENUMCONNECTIONSCALLBACK lpEnumCallback, LPVOID lpContext, DWORD dwFlags ) -{ +{ ICOM_THIS(IDirectPlay3Impl,iface); FIXME("(%p)->(%p,%p,%p,0x%08lx): stub\n", This, lpguidApplication, lpEnumCallback, lpContext, dwFlags ); return DP_OK; @@ -3867,17 +3867,17 @@ static HRESULT WINAPI DirectPlay3WImpl_EnumConnections static HRESULT WINAPI DP_IF_EnumGroupsInGroup ( IDirectPlay3AImpl* This, DPID idGroup, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags, BOOL bAnsi ) { lpGroupList lpGList; lpGroupData lpGData; - FIXME( "(%p)->(0x%08lx,%p,%p,%p,0x%08lx,%u): semi stub\n", - This, idGroup, lpguidInstance, lpEnumPlayersCallback2, + FIXME( "(%p)->(0x%08lx,%p,%p,%p,0x%08lx,%u): semi stub\n", + This, idGroup, lpguidInstance, lpEnumPlayersCallback2, lpContext, dwFlags, bAnsi ); - if( ( lpGData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, idGroup ) ) == NULL ) + if( ( lpGData = DP_FindAnyGroup( (IDirectPlay2AImpl*)This, idGroup ) ) == NULL ) { return DPERR_INVALIDGROUP; } @@ -3913,12 +3913,12 @@ static HRESULT WINAPI DP_IF_EnumGroupsInGroup } static HRESULT WINAPI DirectPlay3AImpl_EnumGroupsInGroup - ( LPDIRECTPLAY3A iface, DPID idGroup, LPGUID lpguidInstance, - LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, + ( LPDIRECTPLAY3A iface, DPID idGroup, LPGUID lpguidInstance, + LPDPENUMPLAYERSCALLBACK2 lpEnumPlayersCallback2, LPVOID lpContext, DWORD dwFlags ) { ICOM_THIS(IDirectPlay3Impl,iface); - return DP_IF_EnumGroupsInGroup( This, idGroup, lpguidInstance, + return DP_IF_EnumGroupsInGroup( This, idGroup, lpguidInstance, lpEnumPlayersCallback2, lpContext, dwFlags, TRUE ); } @@ -3961,7 +3961,7 @@ BOOL CALLBACK DP_GetSpLpGuidFromCompoundAddress( ( IsEqualGUID( guidDataType, &DPAID_LobbyProvider ) ) ) { - TRACE( "Found SP/LP (%s) %s (data size = 0x%08lx)\n", + TRACE( "Found SP/LP (%s) %s (data size = 0x%08lx)\n", debugstr_guid( guidDataType ), debugstr_guid( lpData ), dwDataSize ); if( dwDataSize != sizeof( GUID ) ) @@ -3974,7 +3974,7 @@ BOOL CALLBACK DP_GetSpLpGuidFromCompoundAddress( /* There shouldn't be more than 1 GUID/compound address */ return FALSE; } - + /* Still waiting for what we want */ return TRUE; } @@ -3983,9 +3983,9 @@ BOOL CALLBACK DP_GetSpLpGuidFromCompoundAddress( /* Find and perform a LoadLibrary on the requested SP or LP GUID */ static HMODULE DP_LoadSP( LPCGUID lpcGuid, LPSPINITDATA lpSpData, LPBOOL lpbIsDpSp ) { - UINT i; + UINT i; LPCSTR spSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers"; - LPCSTR lpSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Lobby Providers"; + LPCSTR lpSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Lobby Providers"; LPCSTR guidDataSubKey = "Guid"; LPCSTR majVerDataSubKey = "dwReserved1"; LPCSTR minVerDataSubKey = "dwReserved2"; @@ -4004,7 +4004,7 @@ static HMODULE DP_LoadSP( LPCGUID lpcGuid, LPSPINITDATA lpSpData, LPBOOL lpbIsDp (i == 0) ? (searchSubKey = spSubKey ) : (searchSubKey = lpSubKey ); *lpbIsDpSp = (i == 0) ? TRUE : FALSE; - + /* Need to loop over the service providers in the registry */ if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey, @@ -4094,7 +4094,7 @@ static HMODULE DP_LoadSP( LPCGUID lpcGuid, LPSPINITDATA lpSpData, LPBOOL lpbIsDp memcpy( &lpSpData->dwReserved2, returnBuffer, sizeof(lpSpData->dwReserved2) ); sizeOfReturnBuffer = 255; - + /* Get the path for this service provider */ if( ( dwTemp = RegQueryValueExA( hkServiceProvider, pathSubKey, NULL, NULL, returnBuffer, @@ -4104,7 +4104,7 @@ static HMODULE DP_LoadSP( LPCGUID lpcGuid, LPSPINITDATA lpSpData, LPBOOL lpbIsDp continue; } - TRACE( "Loading %s\n", returnBuffer ); + TRACE( "Loading %s\n", returnBuffer ); return LoadLibraryA( returnBuffer ); } } @@ -4120,16 +4120,16 @@ HRESULT DP_InitializeDPSP( IDirectPlay3Impl* This, HMODULE hServiceProvider ) /* Initialize the service provider by calling SPInit */ SPInit = (LPDPSP_SPINIT)GetProcAddress( hServiceProvider, "SPInit" ); - + if( SPInit == NULL ) { ERR( "Service provider doesn't provide SPInit interface?\n" ); FreeLibrary( hServiceProvider ); return DPERR_UNAVAILABLE; - } + } TRACE( "Calling SPInit (DP SP entry point)\n" ); - + hr = (*SPInit)( &This->dp2->spData ); if( FAILED(hr) ) @@ -4148,7 +4148,7 @@ HRESULT DP_InitializeDPSP( IDirectPlay3Impl* This, HMODULE hServiceProvider ) /* Store the handle of the module so that we can unload it later */ This->dp2->hServiceProvider = hServiceProvider; - + return hr; } @@ -4157,19 +4157,19 @@ HRESULT DP_InitializeDPLSP( IDirectPlay3Impl* This, HMODULE hLobbyProvider ) { HRESULT hr; LPSP_INIT DPLSPInit; - + /* Initialize the service provider by calling SPInit */ DPLSPInit = (LPSP_INIT)GetProcAddress( hLobbyProvider, "DPLSPInit" ); - + if( DPLSPInit == NULL ) { ERR( "Service provider doesn't provide DPLSPInit interface?\n" ); FreeLibrary( hLobbyProvider ); return DPERR_UNAVAILABLE; - } + } TRACE( "Calling DPLSPInit (DPL SP entry point)\n" ); - + hr = (*DPLSPInit)( &This->dp2->dplspData ); if( FAILED(hr) ) @@ -4183,13 +4183,13 @@ HRESULT DP_InitializeDPLSP( IDirectPlay3Impl* This, HMODULE hLobbyProvider ) * using IsBadCodePtr */ This->dp2->bDPLSPInitialized = TRUE; - + /* This interface is now initialized as a lobby object */ This->dp2->connectionInitialized = DP_LOBBY_PROVIDER; /* Store the handle of the module so that we can unload it later */ This->dp2->hDPLobbyProvider = hLobbyProvider; - + return hr; } @@ -4210,7 +4210,7 @@ static HRESULT WINAPI DP_IF_InitializeConnection } /* Find out what the requested SP is and how large this buffer is */ - hr = DPL_EnumAddress( DP_GetSpLpGuidFromCompoundAddress, lpConnection, + hr = DPL_EnumAddress( DP_GetSpLpGuidFromCompoundAddress, lpConnection, dwAddrSize, &guidSP ); if( FAILED(hr) ) @@ -4225,9 +4225,9 @@ static HRESULT WINAPI DP_IF_InitializeConnection if( hServiceProvider == 0 ) { ERR( "Unable to load service provider\n" ); - return DPERR_UNAVAILABLE; + return DPERR_UNAVAILABLE; } - + if( bIsDpSp ) { /* Fill in what we can of the Service Provider required information. @@ -4245,7 +4245,7 @@ static HRESULT WINAPI DP_IF_InitializeConnection hr = DP_InitializeDPLSP( This, hServiceProvider ); } - + if( FAILED(hr) ) { return hr; @@ -4263,9 +4263,9 @@ static HRESULT WINAPI DirectPlay3AImpl_InitializeConnection if( This->dp2->connectionInitialized != NO_PROVIDER ) { return DPERR_ALREADYINITIALIZED; - } + } - return DP_IF_InitializeConnection( This, lpConnection, dwFlags, TRUE ); + return DP_IF_InitializeConnection( This, lpConnection, dwFlags, TRUE ); } static HRESULT WINAPI DirectPlay3WImpl_InitializeConnection @@ -4283,7 +4283,7 @@ static HRESULT WINAPI DirectPlay3WImpl_InitializeConnection } static HRESULT WINAPI DirectPlay3AImpl_SecureOpen - ( LPDIRECTPLAY3A iface, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags, + ( LPDIRECTPLAY3A iface, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags, LPCDPSECURITYDESC lpSecurity, LPCDPCREDENTIALS lpCredentials ) { ICOM_THIS(IDirectPlay2Impl,iface); /* Yes a dp 2 interface */ @@ -4291,9 +4291,9 @@ static HRESULT WINAPI DirectPlay3AImpl_SecureOpen } static HRESULT WINAPI DirectPlay3WImpl_SecureOpen - ( LPDIRECTPLAY3 iface, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags, + ( LPDIRECTPLAY3 iface, LPCDPSESSIONDESC2 lpsd, DWORD dwFlags, LPCDPSECURITYDESC lpSecurity, LPCDPCREDENTIALS lpCredentials ) -{ +{ ICOM_THIS(IDirectPlay2Impl,iface); /* Yes a dp 2 interface */ return DP_SecureOpen( This, lpsd, dwFlags, lpSecurity, lpCredentials, FALSE ); } @@ -4345,7 +4345,7 @@ static HRESULT WINAPI DirectPlay3WImpl_StartSession FIXME("(%p)->(0x%08lx,0x%08lx): stub\n", This, dwFlags, idGroup ); return DP_OK; } - + static HRESULT WINAPI DirectPlay3AImpl_GetGroupFlags ( LPDIRECTPLAY3A iface, DPID idGroup, LPDWORD lpdwFlags ) { @@ -4363,7 +4363,7 @@ static HRESULT WINAPI DirectPlay3WImpl_GetGroupFlags } static HRESULT WINAPI DP_IF_GetGroupParent - ( IDirectPlay3AImpl* This, DPID idGroup, LPDPID lpidGroup, + ( IDirectPlay3AImpl* This, DPID idGroup, LPDPID lpidGroup, BOOL bAnsi ) { lpGroupData lpGData; @@ -4384,13 +4384,13 @@ static HRESULT WINAPI DirectPlay3AImpl_GetGroupParent ( LPDIRECTPLAY3A iface, DPID idGroup, LPDPID lpidGroup ) { ICOM_THIS(IDirectPlay3Impl,iface); - return DP_IF_GetGroupParent( This, idGroup, lpidGroup, TRUE ); + return DP_IF_GetGroupParent( This, idGroup, lpidGroup, TRUE ); } static HRESULT WINAPI DirectPlay3WImpl_GetGroupParent ( LPDIRECTPLAY3 iface, DPID idGroup, LPDPID lpidGroup ) { ICOM_THIS(IDirectPlay3Impl,iface); - return DP_IF_GetGroupParent( This, idGroup, lpidGroup, FALSE ); + return DP_IF_GetGroupParent( This, idGroup, lpidGroup, FALSE ); } static HRESULT WINAPI DirectPlay3AImpl_GetPlayerAccount @@ -4458,7 +4458,7 @@ static HRESULT WINAPI DirectPlay4WImpl_SetGroupOwner } static HRESULT WINAPI DP_SendEx - ( IDirectPlay2Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags, + ( IDirectPlay2Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpContext, LPDWORD lpdwMsgID, BOOL bAnsi ) { @@ -4495,7 +4495,7 @@ static HRESULT WINAPI DP_SendEx */ if( idTo == DPID_ALLPLAYERS ) { - bValidDestination = TRUE; + bValidDestination = TRUE; /* See if SP has the ability to multicast. If so, use it */ if( This->dp2->spData.lpCB->SendToGroupEx ) @@ -4513,7 +4513,7 @@ static HRESULT WINAPI DP_SendEx } } - if( ( !bValidDestination ) && + if( ( !bValidDestination ) && ( DP_FindPlayer( This, idTo ) != NULL ) ) { @@ -4574,22 +4574,22 @@ static HRESULT WINAPI DP_SendEx static HRESULT WINAPI DirectPlay4AImpl_SendEx - ( LPDIRECTPLAY4A iface, DPID idFrom, DPID idTo, DWORD dwFlags, + ( LPDIRECTPLAY4A iface, DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpContext, LPDWORD lpdwMsgID ) { ICOM_THIS(IDirectPlay2Impl,iface); /* yes downcast to 2 */ - return DP_SendEx( This, idFrom, idTo, dwFlags, lpData, dwDataSize, + return DP_SendEx( This, idFrom, idTo, dwFlags, lpData, dwDataSize, dwPriority, dwTimeout, lpContext, lpdwMsgID, TRUE ); } static HRESULT WINAPI DirectPlay4WImpl_SendEx - ( LPDIRECTPLAY4 iface, DPID idFrom, DPID idTo, DWORD dwFlags, + ( LPDIRECTPLAY4 iface, DPID idFrom, DPID idTo, DWORD dwFlags, LPVOID lpData, DWORD dwDataSize, DWORD dwPriority, DWORD dwTimeout, LPVOID lpContext, LPDWORD lpdwMsgID ) { ICOM_THIS(IDirectPlay2Impl,iface); /* yes downcast to 2 */ - return DP_SendEx( This, idFrom, idTo, dwFlags, lpData, dwDataSize, + return DP_SendEx( This, idFrom, idTo, dwFlags, lpData, dwDataSize, dwPriority, dwTimeout, lpContext, lpdwMsgID, FALSE ); } @@ -4606,24 +4606,24 @@ static HRESULT WINAPI DP_SP_SendEx lpMElem = (LPDPMSG)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpMElem ) ); - lpMElem->msg = (DPMSG_GENERIC*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + lpMElem->msg = (DPMSG_GENERIC*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwDataSize ); CopyMemory( lpMElem->msg, lpData, dwDataSize ); /* FIXME: Need to queue based on priority */ - DPQ_INSERT( This->dp2->sendMsgs, lpMElem, msgs ); - + DPQ_INSERT( This->dp2->sendMsgs, lpMElem, msgs ); + return DP_OK; } static HRESULT WINAPI DP_IF_GetMessageQueue - ( IDirectPlay4Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags, + ( IDirectPlay4Impl* This, DPID idFrom, DPID idTo, DWORD dwFlags, LPDWORD lpdwNumMsgs, LPDWORD lpdwNumBytes, BOOL bAnsi ) { HRESULT hr = DP_OK; - FIXME( "(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,%p,%u): semi stub\n", + FIXME( "(%p)->(0x%08lx,0x%08lx,0x%08lx,%p,%p,%u): semi stub\n", This, idFrom, idTo, dwFlags, lpdwNumMsgs, lpdwNumBytes, bAnsi ); /* FIXME: Do we need to do idFrom and idTo sanity checking here? */ @@ -4638,12 +4638,12 @@ static HRESULT WINAPI DP_IF_GetMessageQueue /* FIXME: None of this is documented :( */ data.lpISP = This->dp2->spData.lpISP; - data.dwFlags = dwFlags; + data.dwFlags = dwFlags; data.idFrom = idFrom; data.idTo = idTo; data.lpdwNumMsgs = lpdwNumMsgs; data.lpdwNumBytes = lpdwNumBytes; - + hr = (*This->dp2->spData.lpCB->GetMessageQueue)( &data ); } else @@ -4655,7 +4655,7 @@ static HRESULT WINAPI DP_IF_GetMessageQueue } static HRESULT WINAPI DirectPlay4AImpl_GetMessageQueue - ( LPDIRECTPLAY4A iface, DPID idFrom, DPID idTo, DWORD dwFlags, + ( LPDIRECTPLAY4A iface, DPID idFrom, DPID idTo, DWORD dwFlags, LPDWORD lpdwNumMsgs, LPDWORD lpdwNumBytes ) { ICOM_THIS(IDirectPlay4Impl,iface); @@ -4664,7 +4664,7 @@ static HRESULT WINAPI DirectPlay4AImpl_GetMessageQueue } static HRESULT WINAPI DirectPlay4WImpl_GetMessageQueue - ( LPDIRECTPLAY4 iface, DPID idFrom, DPID idTo, DWORD dwFlags, + ( LPDIRECTPLAY4 iface, DPID idFrom, DPID idTo, DWORD dwFlags, LPDWORD lpdwNumMsgs, LPDWORD lpdwNumBytes ) { ICOM_THIS(IDirectPlay4Impl,iface); @@ -4673,12 +4673,12 @@ static HRESULT WINAPI DirectPlay4WImpl_GetMessageQueue } static HRESULT WINAPI DP_IF_CancelMessage - ( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, + ( IDirectPlay4Impl* This, DWORD dwMsgID, DWORD dwFlags, DWORD dwMinPriority, DWORD dwMaxPriority, BOOL bAnsi ) { HRESULT hr = DP_OK; - FIXME( "(%p)->(0x%08lx,0x%08lx,%u): semi stub\n", + FIXME( "(%p)->(0x%08lx,0x%08lx,%u): semi stub\n", This, dwMsgID, dwFlags, bAnsi ); if( This->dp2->spData.lpCB->Cancel ) @@ -4720,7 +4720,7 @@ static HRESULT WINAPI DirectPlay4AImpl_CancelMessage { dwFlags |= DPCANCELSEND_ALL; } - + return DP_IF_CancelMessage( This, dwMsgID, dwFlags, 0, 0, TRUE ); } @@ -4743,7 +4743,7 @@ static HRESULT WINAPI DirectPlay4WImpl_CancelMessage } static HRESULT WINAPI DirectPlay4AImpl_CancelPriority - ( LPDIRECTPLAY4A iface, DWORD dwMinPriority, DWORD dwMaxPriority, + ( LPDIRECTPLAY4A iface, DWORD dwMinPriority, DWORD dwMaxPriority, DWORD dwFlags ) { ICOM_THIS(IDirectPlay4Impl,iface); @@ -4753,12 +4753,12 @@ static HRESULT WINAPI DirectPlay4AImpl_CancelPriority return DPERR_INVALIDFLAGS; } - return DP_IF_CancelMessage( This, 0, DPCANCELSEND_PRIORITY, dwMinPriority, + return DP_IF_CancelMessage( This, 0, DPCANCELSEND_PRIORITY, dwMinPriority, dwMaxPriority, TRUE ); } static HRESULT WINAPI DirectPlay4WImpl_CancelPriority - ( LPDIRECTPLAY4 iface, DWORD dwMinPriority, DWORD dwMaxPriority, + ( LPDIRECTPLAY4 iface, DWORD dwMinPriority, DWORD dwMaxPriority, DWORD dwFlags ) { ICOM_THIS(IDirectPlay4Impl,iface); @@ -4768,7 +4768,7 @@ static HRESULT WINAPI DirectPlay4WImpl_CancelPriority return DPERR_INVALIDFLAGS; } - return DP_IF_CancelMessage( This, 0, DPCANCELSEND_PRIORITY, dwMinPriority, + return DP_IF_CancelMessage( This, 0, DPCANCELSEND_PRIORITY, dwMinPriority, dwMaxPriority, FALSE ); } @@ -4779,7 +4779,7 @@ static HRESULT WINAPI DirectPlay4WImpl_CancelPriority # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectPlay2) directPlay2WVT = +static ICOM_VTABLE(IDirectPlay2) directPlay2WVT = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)DP_QueryInterface, @@ -4825,7 +4825,7 @@ static ICOM_VTABLE(IDirectPlay2) directPlay2WVT = # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectPlay2) directPlay2AVT = +static ICOM_VTABLE(IDirectPlay2) directPlay2AVT = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)DP_QueryInterface, @@ -4872,7 +4872,7 @@ static ICOM_VTABLE(IDirectPlay2) directPlay2AVT = # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectPlay3) directPlay3AVT = +static ICOM_VTABLE(IDirectPlay3) directPlay3AVT = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)DP_QueryInterface, @@ -4933,7 +4933,7 @@ static ICOM_VTABLE(IDirectPlay3) directPlay3AVT = #else # define XCAST(fun) (void*) #endif -static ICOM_VTABLE(IDirectPlay3) directPlay3WVT = +static ICOM_VTABLE(IDirectPlay3) directPlay3WVT = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)DP_QueryInterface, @@ -5125,9 +5125,9 @@ static ICOM_VTABLE(IDirectPlay4) directPlay4AVT = }; #undef XCAST -extern -HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, - DPID idPlayer, +extern +HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, + DPID idPlayer, LPVOID* lplpData ) { lpPlayerList lpPlayer = DP_FindPlayer( lpDP, idPlayer ); @@ -5142,9 +5142,9 @@ HRESULT DP_GetSPPlayerData( IDirectPlay2Impl* lpDP, return DP_OK; } -extern -HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, - DPID idPlayer, +extern +HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, + DPID idPlayer, LPVOID lpData ) { lpPlayerList lpPlayer = DP_FindPlayer( lpDP, idPlayer ); @@ -5163,23 +5163,23 @@ HRESULT DP_SetSPPlayerData( IDirectPlay2Impl* lpDP, * DirectPlayEnumerate [DPLAYX.9] * DirectPlayEnumerateA [DPLAYX.2] * - * The pointer to the structure lpContext will be filled with the + * The pointer to the structure lpContext will be filled with the * appropriate data for each service offered by the OS. These services are * not necessarily available on this particular machine but are defined * as simple service providers under the "Service Providers" registry key. - * This structure is then passed to lpEnumCallback for each of the different - * services. + * This structure is then passed to lpEnumCallback for each of the different + * services. * * This API is useful only for applications written using DirectX3 or * worse. It is superceeded by IDirectPlay3::EnumConnections which also * gives information on the actual connections. * * defn of a service provider: - * A dynamic-link library used by DirectPlay to communicate over a network. + * A dynamic-link library used by DirectPlay to communicate over a network. * The service provider contains all the network-specific code required * to send and receive messages. Online services and network operators can * supply service providers to use specialized hardware, protocols, communications - * media, and network resources. + * media, and network resources. * * TODO: Allocate string buffer space from the heap (length from reg) * Pass real device driver numbers... @@ -5189,11 +5189,11 @@ HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback, LPVOID lpContext ) { - HKEY hkResult; + HKEY hkResult; LPCSTR searchSubKey = "SOFTWARE\\Microsoft\\DirectPlay\\Service Providers"; DWORD dwIndex; DWORD sizeOfSubKeyName=50; - char subKeyName[51]; + char subKeyName[51]; FILETIME filetime; TRACE(": lpEnumCallback=%p lpContext=%p\n", lpEnumCallback, lpContext ); @@ -5207,19 +5207,19 @@ HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback, if( RegOpenKeyExA( HKEY_LOCAL_MACHINE, searchSubKey, 0, KEY_READ, &hkResult ) != ERROR_SUCCESS ) { - /* Hmmm. Does this mean that there are no service providers? */ + /* Hmmm. Does this mean that there are no service providers? */ ERR(": no service providers?\n"); - return DP_OK; + return DP_OK; } /* Traverse all the service providers we have available */ for( dwIndex=0; - RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, + RegEnumKeyExA( hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, &filetime ) != ERROR_NO_MORE_ITEMS; ++dwIndex, sizeOfSubKeyName=50 ) { - LPSTR majVerDataSubKey = "dwReserved1"; - LPSTR minVerDataSubKey = "dwReserved2"; + LPSTR majVerDataSubKey = "dwReserved1"; + LPSTR minVerDataSubKey = "dwReserved2"; LPSTR guidDataSubKey = "Guid"; HKEY hkServiceProvider; GUID serviceProviderGUID; @@ -5238,15 +5238,15 @@ HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback, continue; } - /* Get the GUID, Device major number and device minor number - * from the registry. + /* Get the GUID, Device major number and device minor number + * from the registry. */ if( RegQueryValueExA( hkServiceProvider, guidDataSubKey, NULL, &returnTypeGUID, returnBuffer, &sizeOfReturnBuffer ) != ERROR_SUCCESS ) { ERR(": missing GUID registry data members\n" ); - continue; + continue; } /* FIXME: Check return types to ensure we're interpreting data right */ @@ -5261,7 +5261,7 @@ HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA lpEnumCallback, &sizeOfReturnBuffer ) != ERROR_SUCCESS ) { ERR(": missing dwReserved1 registry data members\n") ; - continue; + continue; } memcpy( &majVersionNum, returnBuffer, sizeof(majVersionNum) ); @@ -5298,18 +5298,18 @@ HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACKW lpEnumCallback, LPVOID FIXME(":stub\n"); - return DPERR_OUTOFMEMORY; + return DPERR_OUTOFMEMORY; } typedef struct tagCreateEnum { LPVOID lpConn; - LPCGUID lpGuid; + LPCGUID lpGuid; } CreateEnumData, *lpCreateEnumData; /* Find and copy the matching connection for the SP guid */ -static BOOL CALLBACK cbDPCreateEnumConnections( +static BOOL CALLBACK cbDPCreateEnumConnections( LPCGUID lpguidSP, LPVOID lpConnection, DWORD dwConnectionSize, @@ -5317,7 +5317,7 @@ static BOOL CALLBACK cbDPCreateEnumConnections( DWORD dwFlags, LPVOID lpContext) { - lpCreateEnumData lpData = (lpCreateEnumData)lpContext; + lpCreateEnumData lpData = (lpCreateEnumData)lpContext; if( IsEqualGUID( lpguidSP, lpData->lpGuid ) ) { @@ -5346,7 +5346,7 @@ HRESULT WINAPI DirectPlayCreate HRESULT hr; LPDIRECTPLAY3A lpDP3A; CreateEnumData cbData; - + TRACE( "lpGUID=%s lplpDP=%p pUnk=%p\n", debugstr_guid(lpGUID), lplpDP, pUnk ); if( pUnk != NULL ) @@ -5359,12 +5359,12 @@ HRESULT WINAPI DirectPlayCreate if( DP_CreateInterface( &IID_IDirectPlay2A, (LPVOID*)lplpDP ) != DP_OK ) { return DPERR_UNAVAILABLE; - } + } if( IsEqualGUID( &GUID_NULL, lpGUID ) ) { /* The GUID_NULL means don't bind a service provider. Just return the - interface as is */ + interface as is */ return DP_OK; } @@ -5372,11 +5372,11 @@ HRESULT WINAPI DirectPlayCreate TRACE( "Service Provider binding for %s\n", debugstr_guid(lpGUID) ); /* We're going to use a DP3 interface */ - hr = IDirectPlayX_QueryInterface( *lplpDP, &IID_IDirectPlay3A, + hr = IDirectPlayX_QueryInterface( *lplpDP, &IID_IDirectPlay3A, (LPVOID*)&lpDP3A ); if( FAILED(hr) ) { - ERR( "Failed to get DP3 interface: %s\n", DPLAYX_HresultToString(hr) ); + ERR( "Failed to get DP3 interface: %s\n", DPLAYX_HresultToString(hr) ); return hr; } @@ -5384,20 +5384,20 @@ HRESULT WINAPI DirectPlayCreate cbData.lpGuid = lpGUID; /* We were given a service provider, find info about it... */ - hr = IDirectPlayX_EnumConnections( lpDP3A, NULL, cbDPCreateEnumConnections, + hr = IDirectPlayX_EnumConnections( lpDP3A, NULL, cbDPCreateEnumConnections, &cbData, DPCONNECTION_DIRECTPLAY ); if( ( FAILED(hr) ) || - ( cbData.lpConn == NULL ) + ( cbData.lpConn == NULL ) ) { - ERR( "Failed to get Enum for SP: %s\n", DPLAYX_HresultToString(hr) ); + ERR( "Failed to get Enum for SP: %s\n", DPLAYX_HresultToString(hr) ); IDirectPlayX_Release( lpDP3A ); return DPERR_UNAVAILABLE; } /* Initialize the service provider */ hr = IDirectPlayX_InitializeConnection( lpDP3A, cbData.lpConn, 0 ); - if( FAILED(hr) ) + if( FAILED(hr) ) { ERR( "Failed to Initialize SP: %s\n", DPLAYX_HresultToString(hr) ); HeapFree( GetProcessHeap(), 0, cbData.lpConn ); diff --git a/dlls/dplayx/dplay_global.h b/dlls/dplayx/dplay_global.h index 8d939bc92f1..0917e588594 100644 --- a/dlls/dplayx/dplay_global.h +++ b/dlls/dplayx/dplay_global.h @@ -23,8 +23,8 @@ #include "lobbysp.h" #include "dplayx_queue.h" -extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, - LPCVOID lpAddress, DWORD dwAddressSize, +extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, + LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext ); extern DWORD DP_CalcSessionDescSize( LPCDPSESSIONDESC2 lpSessDesc, BOOL bAnsi ); @@ -65,7 +65,7 @@ typedef struct tagDP_MSG_REPLY_STRUCT typedef struct tagDP_MSG_REPLY_STRUCT_LIST { - DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST) replysExpected; + DPQ_ENTRY(tagDP_MSG_REPLY_STRUCT_LIST) replysExpected; DP_MSG_REPLY_STRUCT replyExpected; } DP_MSG_REPLY_STRUCT_LIST, *LPDP_MSG_REPLY_STRUCT_LIST; @@ -239,7 +239,7 @@ extern ICOM_VTABLE(IDirectPlay4) directPlay4WVT; HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpMessageBody, DWORD dwMessageBodySize, LPCVOID lpMessageHeader, - WORD wCommandId, WORD wVersion, + WORD wCommandId, WORD wVersion, LPVOID* lplpReply, LPDWORD lpdwMsgSize ); /* DP SP external interfaces into DirectPlay */ diff --git a/dlls/dplayx/dplaysp.c b/dlls/dplayx/dplaysp.c index 8c205359151..dec2861694b 100644 --- a/dlls/dplayx/dplaysp.c +++ b/dlls/dplayx/dplaysp.c @@ -1,5 +1,5 @@ /* This contains the implementation of the interface Service - * Providers require to communicate with Direct Play + * Providers require to communicate with Direct Play * * Copyright 2000 Peter Hunnisett * @@ -98,7 +98,7 @@ HRESULT DPSP_CreateInterface( REFIID riid, LPVOID* ppvObj, IDirectPlay2Impl* dp { return DPERR_OUTOFMEMORY; } - + if( IsEqualGUID( &IID_IDirectPlaySP, riid ) ) { ICOM_THIS(IDirectPlaySPImpl,*ppvObj); @@ -136,7 +136,7 @@ static BOOL DPSP_CreateIUnknown( LPVOID lpSP ) { ICOM_THIS(IDirectPlaySPImpl,lpSP); - This->unk = (DirectPlaySPIUnknownData*)HeapAlloc( GetProcessHeap(), + This->unk = (DirectPlaySPIUnknownData*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) ); @@ -153,7 +153,7 @@ static BOOL DPSP_CreateIUnknown( LPVOID lpSP ) static BOOL DPSP_DestroyIUnknown( LPVOID lpSP ) { ICOM_THIS(IDirectPlaySPImpl,lpSP); - + DeleteCriticalSection( &This->unk->DPSP_lock ); HeapFree( GetProcessHeap(), 0, This->unk ); @@ -185,7 +185,7 @@ static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp ) * FIXME: This is a kludge to get around a problem where a queryinterface * is used to get a new interface and then is closed. We will then * reference garbage. However, with this we will never deallocate - * the interface we store. The correct fix is to require all + * the interface we store. The correct fix is to require all * DP internal interfaces to use the This->dp2 interface which * should be changed to This->dp */ @@ -249,11 +249,11 @@ static HRESULT WINAPI DPSP_QueryInterface return E_NOINTERFACE; } - + IDirectPlaySP_AddRef( (LPDIRECTPLAYSP)*ppvObj ); return S_OK; -} +} static ULONG WINAPI DPSP_AddRef ( LPDIRECTPLAYSP iface ) @@ -301,8 +301,8 @@ static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry ( LPDIRECTPLAYSP iface, LPCWSTR lpSection, LPCWSTR lpKey, - LPCVOID lpData, - DWORD dwDataSize, + LPCVOID lpData, + DWORD dwDataSize, DWORD dwMaxEntries ) { @@ -310,7 +310,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry /* Should be able to call the comctl32 undocumented MRU routines. I suspect that the interface works appropriately */ - FIXME( "(%p)->(%p,%p%p,0x%08lx,0x%08lx): stub\n", + FIXME( "(%p)->(%p,%p%p,0x%08lx,0x%08lx): stub\n", This, lpSection, lpKey, lpData, dwDataSize, dwMaxEntries ); return DP_OK; @@ -318,17 +318,17 @@ static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress ( LPDIRECTPLAYSP iface, - REFGUID guidSP, - REFGUID guidDataType, - LPCVOID lpData, - DWORD dwDataSize, + REFGUID guidSP, + REFGUID guidDataType, + LPCVOID lpData, + DWORD dwDataSize, LPVOID lpAddress, LPDWORD lpdwAddressSize ) { ICOM_THIS(IDirectPlaySPImpl,iface); - FIXME( "(%p)->(%s,%s,%p,0x%08lx,%p,%p): stub\n", + FIXME( "(%p)->(%s,%s,%p,0x%08lx,%p,%p): stub\n", This, debugstr_guid(guidSP), debugstr_guid(guidDataType), lpData, dwDataSize, lpAddress, lpdwAddressSize ); @@ -337,15 +337,15 @@ static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress ( LPDIRECTPLAYSP iface, - LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, - LPCVOID lpAddress, - DWORD dwAddressSize, + LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, + LPCVOID lpAddress, + DWORD dwAddressSize, LPVOID lpContext ) { ICOM_THIS(IDirectPlaySPImpl,iface); - TRACE( "(%p)->(%p,%p,0x%08lx,%p)\n", + TRACE( "(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext ); DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext ); @@ -355,9 +355,9 @@ static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries ( LPDIRECTPLAYSP iface, - LPCWSTR lpSection, - LPCWSTR lpKey, - LPENUMMRUCALLBACK lpEnumMRUCallback, + LPCWSTR lpSection, + LPCWSTR lpKey, + LPENUMMRUCALLBACK lpEnumMRUCallback, LPVOID lpContext ) { @@ -365,7 +365,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries /* Should be able to call the comctl32 undocumented MRU routines. I suspect that the interface works appropriately */ - FIXME( "(%p)->(%p,%p,%p,%p,): stub\n", + FIXME( "(%p)->(%p,%p,%p,%p,): stub\n", This, lpSection, lpKey, lpEnumMRUCallback, lpContext ); return DP_OK; @@ -373,13 +373,13 @@ static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags ( LPDIRECTPLAYSP iface, - DPID idPlayer, + DPID idPlayer, LPDWORD lpdwPlayerFlags ) { ICOM_THIS(IDirectPlaySPImpl,iface); - FIXME( "(%p)->(0x%08lx,%p): stub\n", + FIXME( "(%p)->(0x%08lx,%p): stub\n", This, idPlayer, lpdwPlayerFlags ); return DP_OK; @@ -387,9 +387,9 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData ( LPDIRECTPLAYSP iface, - DPID idPlayer, - LPVOID* lplpData, - LPDWORD lpdwDataSize, + DPID idPlayer, + LPVOID* lplpData, + LPDWORD lpdwDataSize, DWORD dwFlags ) { @@ -397,7 +397,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData LPDP_SPPLAYERDATA lpPlayerData; ICOM_THIS(IDirectPlaySPImpl,iface); - TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx)\n", + TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx)\n", This, idPlayer, lplpData, lpdwDataSize, dwFlags ); hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerData ); @@ -433,15 +433,15 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData if( *lplpData == NULL ) { hr = DPERR_GENERIC; - } + } return hr; } static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage ( LPDIRECTPLAYSP iface, - LPVOID lpMessageBody, - DWORD dwMessageBodySize, + LPVOID lpMessageBody, + DWORD dwMessageBodySize, LPVOID lpMessageHeader ) { @@ -450,16 +450,16 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage WORD wCommandId; WORD wVersion; DPSP_REPLYDATA data; - + ICOM_THIS(IDirectPlaySPImpl,iface); - FIXME( "(%p)->(%p,0x%08lx,%p): mostly stub\n", + FIXME( "(%p)->(%p,0x%08lx,%p): mostly stub\n", This, lpMessageBody, dwMessageBodySize, lpMessageHeader ); wCommandId = lpMsg->wCommandId; wVersion = lpMsg->wVersion; - TRACE( "Incomming message has envelope of 0x%08lx, %u, %u\n", + TRACE( "Incomming message has envelope of 0x%08lx, %u, %u\n", lpMsg->dwMagic, wCommandId, wVersion ); if( lpMsg->dwMagic != DPMSGMAGIC_DPLAYMSG ) @@ -483,7 +483,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage /* Pass this message to the dplay interface to handle */ hr = DP_HandleMessage( This->sp->dplay, lpMessageBody, dwMessageBodySize, - lpMessageHeader, wCommandId, wVersion, + lpMessageHeader, wCommandId, wVersion, &data.lpMessage, &data.dwMessageSize ); if( FAILED(hr) ) @@ -524,8 +524,8 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage if( msg->dwPlayerType == DPPLAYERTYPE_PLAYER ) { - hr = DP_IF_CreatePlayer( This, lpMessageHeader, msg->dpId, - &msg->dpnName, 0, msg->lpData, + hr = DP_IF_CreatePlayer( This, lpMessageHeader, msg->dpId, + &msg->dpnName, 0, msg->lpData, msg->dwDataSize, msg->dwFlags, ... ); } else if( msg->dwPlayerType == DPPLAYERTYPE_GROUP ) @@ -533,14 +533,14 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage /* Group in group situation? */ if( msg->dpIdParent == DPID_NOPARENT_GROUP ) { - hr = DP_IF_CreateGroup( This, lpMessageHeader, msg->dpId, - &msg->dpnName, 0, msg->lpData, + hr = DP_IF_CreateGroup( This, lpMessageHeader, msg->dpId, + &msg->dpnName, 0, msg->lpData, msg->dwDataSize, msg->dwFlags, ... ); } else /* Group in Group */ { hr = DP_IF_CreateGroupInGroup( This, lpMessageHeader, msg->dpIdParent, - &msg->dpnName, 0, msg->lpData, + &msg->dpnName, 0, msg->lpData, msg->dwDataSize, msg->dwFlags, ... ); } } @@ -707,7 +707,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage FIXME( "DPSYS_CHAT not implemeneted\n" ); break; - } + } case DPSYS_SETGROUPOWNER: { @@ -754,20 +754,20 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData ( LPDIRECTPLAYSP iface, - DPID idPlayer, - LPVOID lpData, - DWORD dwDataSize, + DPID idPlayer, + LPVOID lpData, + DWORD dwDataSize, DWORD dwFlags ) { HRESULT hr; LPDP_SPPLAYERDATA lpPlayerEntry; - LPVOID lpPlayerData; + LPVOID lpPlayerData; ICOM_THIS(IDirectPlaySPImpl,iface); /* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */ - TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx)\n", + TRACE( "(%p)->(0x%08lx,%p,0x%08lx,0x%08lx)\n", This, idPlayer, lpData, dwDataSize, dwFlags ); hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerEntry ); @@ -798,15 +798,15 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress ( LPDIRECTPLAYSP iface, - LPCDPCOMPOUNDADDRESSELEMENT lpElements, - DWORD dwElementCount, - LPVOID lpAddress, + LPCDPCOMPOUNDADDRESSELEMENT lpElements, + DWORD dwElementCount, + LPVOID lpAddress, LPDWORD lpdwAddressSize ) { ICOM_THIS(IDirectPlaySPImpl,iface); - FIXME( "(%p)->(%p,0x%08lx,%p,%p): stub\n", + FIXME( "(%p)->(%p,0x%08lx,%p,%p): stub\n", This, lpElements, dwElementCount, lpAddress, lpdwAddressSize ); return DP_OK; @@ -814,8 +814,8 @@ static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress static HRESULT WINAPI IDirectPlaySPImpl_GetSPData ( LPDIRECTPLAYSP iface, - LPVOID* lplpData, - LPDWORD lpdwDataSize, + LPVOID* lplpData, + LPDWORD lpdwDataSize, DWORD dwFlags ) { @@ -823,7 +823,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPData ICOM_THIS(IDirectPlaySPImpl,iface); /* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */ - TRACE( "(%p)->(%p,%p,0x%08lx)\n", + TRACE( "(%p)->(%p,%p,0x%08lx)\n", This, lplpData, lpdwDataSize, dwFlags ); #if 0 @@ -872,8 +872,8 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPData static HRESULT WINAPI IDirectPlaySPImpl_SetSPData ( LPDIRECTPLAYSP iface, - LPVOID lpData, - DWORD dwDataSize, + LPVOID lpData, + DWORD dwDataSize, DWORD dwFlags ) { @@ -882,7 +882,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPData ICOM_THIS(IDirectPlaySPImpl,iface); /* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */ - TRACE( "(%p)->(%p,0x%08lx,0x%08lx)\n", + TRACE( "(%p)->(%p,0x%08lx,0x%08lx)\n", This, lpData, dwDataSize, dwFlags ); #if 0 @@ -932,13 +932,13 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPData static VOID WINAPI IDirectPlaySPImpl_SendComplete ( LPDIRECTPLAYSP iface, - LPVOID unknownA, + LPVOID unknownA, DWORD unknownB ) { ICOM_THIS(IDirectPlaySPImpl,iface); - FIXME( "(%p)->(%p,0x%08lx): stub\n", + FIXME( "(%p)->(%p,0x%08lx): stub\n", This, unknownA, unknownB ); } @@ -972,7 +972,7 @@ static struct ICOM_VTABLE(IDirectPlaySP) directPlaySPVT = extern LPVOID DPSP_CreateSPPlayerData(void) { TRACE( "Creating SPPlayer data struct\n" ); - return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( DP_SPPLAYERDATA ) ); } diff --git a/dlls/dplayx/dplaysp.h b/dlls/dplayx/dplaysp.h index ae14d4a1b43..1b961af4096 100644 --- a/dlls/dplayx/dplaysp.h +++ b/dlls/dplayx/dplaysp.h @@ -74,7 +74,7 @@ ICOM_DEFINE(IDirectPlaySP,IUnknown) #undef ICOM_INTERFACE -/* NOTE: The microsoft provided header file doesn't have these access +/* NOTE: The microsoft provided header file doesn't have these access * functions */ /*** IUnknown methods ***/ @@ -189,7 +189,7 @@ typedef struct tagDPSP_REMOVEPLAYERFROMGROUPDATA } DPSP_REMOVEPLAYERFROMGROUPDATA, *LPDPSP_REMOVEPLAYERFROMGROUPDATA; typedef struct tagDPSP_REPLYDATA -{ +{ LPVOID lpSPMessageHeader; LPVOID lpMessage; DWORD dwMessageSize; @@ -331,27 +331,27 @@ typedef struct tagDPSP_SPCALLBACKS LPDPSP_SENDEX SendEx; /* Optional */ LPDPSP_SENDTOGROUPEX SendToGroupEx; /* Optional */ LPDPSP_CANCEL Cancel; /* Optional */ - LPDPSP_GETMESSAGEQUEUE GetMessageQueue; /* Optional */ + LPDPSP_GETMESSAGEQUEUE GetMessageQueue; /* Optional */ } DPSP_SPCALLBACKS, *LPDPSP_SPCALLBACKS; typedef struct tagSPINITDATA { - LPDPSP_SPCALLBACKS lpCB; + LPDPSP_SPCALLBACKS lpCB; IDirectPlaySP* lpISP; LPWSTR lpszName; LPGUID lpGuid; - DWORD dwReserved1; + DWORD dwReserved1; DWORD dwReserved2; - DWORD dwSPHeaderSize; + DWORD dwSPHeaderSize; LPDPADDRESS lpAddress; - DWORD dwAddressSize; - DWORD dwSPVersion; + DWORD dwAddressSize; + DWORD dwSPVersion; } SPINITDATA, *LPSPINITDATA; typedef HRESULT (WINAPI *LPDPSP_SPINIT)(LPSPINITDATA); -/* This variable is exported from the DLL at ordinal 6 to be accessed by the - * SP directly +/* This variable is exported from the DLL at ordinal 6 to be accessed by the + * SP directly */ extern DWORD gdwDPlaySPRefCount; diff --git a/dlls/dplayx/dplayx_global.c b/dlls/dplayx/dplayx_global.c index fbc5fba267f..be481112434 100644 --- a/dlls/dplayx/dplayx_global.c +++ b/dlls/dplayx/dplayx_global.c @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* NOTE: Methods that begin with DPLAYX_ are used for dealing with +/* NOTE: Methods that begin with DPLAYX_ are used for dealing with * dplayx.dll data which is accessible from all processes. - */ + */ #include #include "wine/debug.h" @@ -57,7 +57,7 @@ static LPVOID lpSharedStaticData = NULL; TRACE( "DPLAYX Semaphore released\n" ) /* FIXME: Is this correct? */ -/* HACK for simple global data right now */ +/* HACK for simple global data right now */ #define dwStaticSharedSize (128 * 1024) /* 128 KBytes */ #define dwDynamicSharedSize (512 * 1024) /* 512 KBytes */ #define dwTotalSharedSize ( dwStaticSharedSize + dwDynamicSharedSize ) @@ -70,7 +70,7 @@ static LPVOID lpSharedStaticData = NULL; #define dwBlockSize 512 #define dwMaxBlock (dwDynamicSharedSize/dwBlockSize) -typedef struct +typedef struct { DWORD used; DWORD data[dwBlockSize-sizeof(DWORD)]; @@ -88,11 +88,11 @@ void DPLAYX_PrivHeapFree( LPVOID addr ) if( addr == NULL ) { return; - } + } lpAddrStart = addr - sizeof(DWORD); /* Find block header */ dwBlockUsed = ((BYTE*)lpAddrStart - (BYTE*)lpMemArea)/dwBlockSize; - + lpMemArea[ dwBlockUsed ].used = 0; } @@ -107,11 +107,11 @@ LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ) { FIXME( "Size exceeded. Request of 0x%08lx\n", size ); size = dwBlockSize - sizeof(DWORD); - } + } /* Find blank area */ - uBlockUsed = 0; - while( ( lpMemArea[ uBlockUsed ].used != 0 ) && ( uBlockUsed <= dwMaxBlock ) ) { uBlockUsed++; } + uBlockUsed = 0; + while( ( lpMemArea[ uBlockUsed ].used != 0 ) && ( uBlockUsed <= dwMaxBlock ) ) { uBlockUsed++; } if( uBlockUsed <= dwMaxBlock ) { @@ -124,7 +124,7 @@ LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ) ERR( "No free block found\n" ); return NULL; } - + if( flags & HEAP_ZERO_MEMORY ) { ZeroMemory( lpvArea, size ); @@ -145,7 +145,7 @@ LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str ) 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) { @@ -159,7 +159,7 @@ enum { numSupportedLobbies = 32, numSupportedSessions = 32 }; typedef struct tagDPLAYX_LOBBYDATA { /* Points to lpConn + block of contiguous extra memory for dynamic parts - * of the struct directly following + * of the struct directly following */ LPDPLCONNECTION lpConn; @@ -177,14 +177,14 @@ typedef struct tagDPLAYX_LOBBYDATA /* Sundries */ BOOL bWaitForConnectionSettings; DWORD dwLobbyMsgThreadId; - + } DPLAYX_LOBBYDATA, *LPDPLAYX_LOBBYDATA; static DPLAYX_LOBBYDATA* lobbyData = NULL; /* static DPLAYX_LOBBYDATA lobbyData[ numSupportedLobbies ]; */ -static DPSESSIONDESC2* sessionData = NULL; +static DPSESSIONDESC2* sessionData = NULL; /* static DPSESSIONDESC2* sessionData[ numSupportedSessions ]; */ /* Function prototypes */ @@ -199,10 +199,10 @@ BOOL DPLAYX_CopyIntoSessionDesc2A( LPDPSESSIONDESC2 lpSessionDest, -/*************************************************************************** - * Called to initialize the global data. This will only be used on the - * loading of the dll - ***************************************************************************/ +/*************************************************************************** + * Called to initialize the global data. This will only be used on the + * loading of the dll + ***************************************************************************/ BOOL DPLAYX_ConstructData(void) { SECURITY_ATTRIBUTES s_attrib; @@ -218,7 +218,7 @@ BOOL DPLAYX_ConstructData(void) s_attrib.lpSecurityDescriptor = NULL; s_attrib.nLength = sizeof(s_attrib); - hDplayxSema = CreateSemaphoreA( &s_attrib, 1, 1, lpszDplayxSemaName ); + hDplayxSema = CreateSemaphoreA( &s_attrib, 1, 1, lpszDplayxSemaName ); /* First instance creates the semaphore. Others just use it */ if( GetLastError() == ERROR_SUCCESS ) @@ -241,13 +241,13 @@ BOOL DPLAYX_ConstructData(void) SetLastError( ERROR_SUCCESS ); DPLAYX_AquireSemaphore(); - + hDplayxSharedMem = CreateFileMappingA( INVALID_HANDLE_VALUE, &s_attrib, PAGE_READWRITE | SEC_COMMIT, - 0, + 0, dwTotalSharedSize, - lpszDplayxFileMapping ); + lpszDplayxFileMapping ); if( GetLastError() == ERROR_SUCCESS ) { @@ -263,13 +263,13 @@ BOOL DPLAYX_ConstructData(void) return FALSE; } - lpSharedStaticData = MapViewOfFileEx( hDplayxSharedMem, - FILE_MAP_WRITE, + lpSharedStaticData = MapViewOfFileEx( hDplayxSharedMem, + FILE_MAP_WRITE, 0, 0, 0, lpDesiredMemoryMapStart ); if( lpSharedStaticData == NULL ) { - ERR( ": unable to map static data into process memory space (%ld)\n", + ERR( ": unable to map static data into process memory space (%ld)\n", GetLastError() ); return FALSE; } @@ -307,7 +307,7 @@ BOOL DPLAYX_ConstructData(void) TRACE( "Initializing shared memory\n" ); - /* Set all lobbies to be "empty" */ + /* Set all lobbies to be "empty" */ for( i=0; i < numSupportedLobbies; i++ ) { DPLAYX_InitializeLobbyDataEntry( &lobbyData[ i ] ); @@ -325,19 +325,19 @@ BOOL DPLAYX_ConstructData(void) /* Just for fun sync the whole data area */ FlushViewOfFile( lpSharedStaticData, dwTotalSharedSize ); } - + DPLAYX_ReleaseSemaphore(); /* Everything was created correctly. Signal the lobby client that * we started up correctly */ if( DPLAYX_GetThisLobbyHandles( &hInformOnStart, NULL, NULL, FALSE ) && - hInformOnStart + hInformOnStart ) { BOOL bSuccess; bSuccess = SetEvent( hInformOnStart ); - TRACE( "Signalling lobby app start event %u %s\n", + TRACE( "Signalling lobby app start event %u %s\n", hInformOnStart, bSuccess ? "succeed" : "failed" ); /* Close out handle */ @@ -347,10 +347,10 @@ BOOL DPLAYX_ConstructData(void) return TRUE; } -/*************************************************************************** - * Called to destroy all global data. This will only be used on the - * unloading of the dll - ***************************************************************************/ +/*************************************************************************** + * Called to destroy all global data. This will only be used on the + * unloading of the dll + ***************************************************************************/ BOOL DPLAYX_DestructData(void) { HANDLE hInformOnDeath; @@ -359,12 +359,12 @@ BOOL DPLAYX_DestructData(void) /* If required, inform that this app is dying */ if( DPLAYX_GetThisLobbyHandles( NULL, &hInformOnDeath, NULL, FALSE ) && - hInformOnDeath + hInformOnDeath ) { BOOL bSuccess; bSuccess = SetEvent( hInformOnDeath ); - TRACE( "Signalling lobby app death event %u %s\n", + TRACE( "Signalling lobby app death event %u %s\n", hInformOnDeath, bSuccess ? "succeed" : "failed" ); /* Close out handle */ @@ -375,7 +375,7 @@ BOOL DPLAYX_DestructData(void) /* Delete the semaphore */ CloseHandle( hDplayxSema ); - + /* Delete shared memory file mapping */ UnmapViewOfFile( lpSharedStaticData ); CloseHandle( hDplayxSharedMem ); @@ -389,7 +389,7 @@ void DPLAYX_InitializeLobbyDataEntry( LPDPLAYX_LOBBYDATA lpData ) ZeroMemory( lpData, sizeof( *lpData ) ); } -/* NOTE: This must be called with the semaphore aquired. +/* NOTE: This must be called with the semaphore aquired. * TRUE/FALSE with a pointer to it's data returned. Pointer data is * is only valid if TRUE is returned. */ @@ -409,7 +409,7 @@ BOOL DPLAYX_IsAppIdLobbied( DWORD dwAppID, LPDPLAYX_LOBBYDATA* lplpDplData ) { if( lobbyData[ i ].dwAppID == dwAppID ) { - /* This process is lobbied */ + /* This process is lobbied */ TRACE( "Found 0x%08lx @ %u\n", dwAppID, i ); *lplpDplData = &lobbyData[ i ]; return TRUE; @@ -428,7 +428,7 @@ BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID ) if( dwAppID == 0 ) { return FALSE; - } + } DPLAYX_AquireSemaphore(); @@ -445,7 +445,7 @@ BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID ) lobbyData[ i ].dwAppLaunchedFromID = GetCurrentProcessId(); /* FIXME: Where is the best place for this? In interface or here? */ - lobbyData[ i ].hInformOnAppStart = 0; + lobbyData[ i ].hInformOnAppStart = 0; lobbyData[ i ].hInformOnAppDeath = 0; lobbyData[ i ].hInformOnSettingRead = 0; @@ -461,7 +461,7 @@ BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID ) } /* I'm not sure when I'm going to need this, but here it is */ -BOOL DPLAYX_DestroyLobbyApplication( DWORD dwAppID ) +BOOL DPLAYX_DestroyLobbyApplication( DWORD dwAppID ) { UINT i; @@ -515,7 +515,7 @@ BOOL DPLAYX_SetLobbyHandles( DWORD dwAppID, return TRUE; } -BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart, +BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart, LPHANDLE lphDeath, LPHANDLE lphConnRead, BOOL bClearSetHandles ) @@ -535,7 +535,7 @@ BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart, if( lpLData->hInformOnAppStart == 0 ) { DPLAYX_ReleaseSemaphore(); - return FALSE; + return FALSE; } *lphStart = lpLData->hInformOnAppStart; @@ -580,7 +580,7 @@ BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart, lpLData->hInformOnSettingRead = 0; } } - + DPLAYX_ReleaseSemaphore(); return TRUE; @@ -609,7 +609,7 @@ HRESULT DPLAYX_GetConnectionSettingsA dwRequiredDataSize = DPLAYX_SizeOfLobbyDataA( lpDplData->lpConn ); /* Do they want to know the required buffer size or is the provided buffer - * big enough? + * big enough? */ if ( ( lpData == NULL ) || ( *lpdwDataSize < dwRequiredDataSize ) @@ -628,12 +628,12 @@ HRESULT DPLAYX_GetConnectionSettingsA /* They have gotten the information - signal the event if required */ if( DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, FALSE ) && - hInformOnSettingRead + hInformOnSettingRead ) { BOOL bSuccess; bSuccess = SetEvent( hInformOnSettingRead ); - TRACE( "Signalling setting read event %u %s\n", + TRACE( "Signalling setting read event %u %s\n", hInformOnSettingRead, bSuccess ? "succeed" : "failed" ); /* Close out handle */ @@ -664,7 +664,7 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src ) { strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u1.lpszSessionNameA ); dest->lpSessionDesc->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace; - lpStartOfFreeSpace += + lpStartOfFreeSpace += strlen( (LPSTR)dest->lpSessionDesc->u1.lpszSessionNameA ) + 1; } @@ -672,7 +672,7 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src ) { strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u2.lpszPasswordA ); dest->lpSessionDesc->u2.lpszPasswordA = (LPSTR)lpStartOfFreeSpace; - lpStartOfFreeSpace += + lpStartOfFreeSpace += strlen( (LPSTR)dest->lpSessionDesc->u2.lpszPasswordA ) + 1; } } @@ -688,7 +688,7 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src ) { strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortNameA ); dest->lpPlayerName->u1.lpszShortNameA = (LPSTR)lpStartOfFreeSpace; - lpStartOfFreeSpace += + lpStartOfFreeSpace += strlen( (LPSTR)dest->lpPlayerName->u1.lpszShortNameA ) + 1; } @@ -696,7 +696,7 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src ) { strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u2.lpszLongNameA ); dest->lpPlayerName->u2.lpszLongNameA = (LPSTR)lpStartOfFreeSpace; - lpStartOfFreeSpace += + lpStartOfFreeSpace += strlen( (LPSTR)dest->lpPlayerName->u2.lpszLongName ) + 1 ; } @@ -731,7 +731,7 @@ HRESULT DPLAYX_GetConnectionSettingsW dwRequiredDataSize = DPLAYX_SizeOfLobbyDataW( lpDplData->lpConn ); /* Do they want to know the required buffer size or is the provided buffer - * big enough? + * big enough? */ if ( ( lpData == NULL ) || ( *lpdwDataSize < dwRequiredDataSize ) @@ -750,12 +750,12 @@ HRESULT DPLAYX_GetConnectionSettingsW /* They have gotten the information - signal the event if required */ if( DPLAYX_GetThisLobbyHandles( NULL, NULL, &hInformOnSettingRead, FALSE ) && - hInformOnSettingRead + hInformOnSettingRead ) { BOOL bSuccess; bSuccess = SetEvent( hInformOnSettingRead ); - TRACE( "Signalling setting read event %u %s\n", + TRACE( "Signalling setting read event %u %s\n", hInformOnSettingRead, bSuccess ? "succeed" : "failed" ); /* Close out handle */ @@ -779,7 +779,7 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src ) { dest->lpSessionDesc = (LPDPSESSIONDESC2)lpStartOfFreeSpace; lpStartOfFreeSpace += sizeof( DPSESSIONDESC2 ); - CopyMemory( dest->lpSessionDesc, src->lpSessionDesc, sizeof( DPSESSIONDESC2 ) ); + CopyMemory( dest->lpSessionDesc, src->lpSessionDesc, sizeof( DPSESSIONDESC2 ) ); /* Session names may or may not exist */ if( src->lpSessionDesc->u1.lpszSessionName ) @@ -805,7 +805,7 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src ) dest->lpPlayerName = (LPDPNAME)lpStartOfFreeSpace; lpStartOfFreeSpace += sizeof( DPNAME ); CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) ); - + if( src->lpPlayerName->u1.lpszShortName ) { strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortName ); @@ -828,7 +828,7 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src ) if( src->lpAddress ) { dest->lpAddress = (LPVOID)lpStartOfFreeSpace; - CopyMemory( lpStartOfFreeSpace, src->lpAddress, src->dwAddressSize ); + CopyMemory( lpStartOfFreeSpace, src->lpAddress, src->dwAddressSize ); /* No need to advance lpStartOfFreeSpace as there is no more "dynamic" data */ } @@ -836,7 +836,7 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src ) /* Store the structure into the shared data structre. Ensure that allocs for * variable length strings come from the shared data structure. - * FIXME: We need to free information as well + * FIXME: We need to free information as well */ HRESULT DPLAYX_SetConnectionSettingsA ( DWORD dwFlags, @@ -885,7 +885,7 @@ HRESULT DPLAYX_SetConnectionSettingsA /* Free the existing memory */ DPLAYX_PrivHeapFree( lpDplData->lpConn ); - lpDplData->lpConn = DPLAYX_PrivHeapAlloc( HEAP_ZERO_MEMORY, + lpDplData->lpConn = DPLAYX_PrivHeapAlloc( HEAP_ZERO_MEMORY, DPLAYX_SizeOfLobbyDataA( lpConn ) ); DPLAYX_CopyConnStructA( lpDplData->lpConn, lpConn ); @@ -900,7 +900,7 @@ HRESULT DPLAYX_SetConnectionSettingsA /* Store the structure into the shared data structre. Ensure that allocs for * variable length strings come from the shared data structure. - * FIXME: We need to free information as well + * FIXME: We need to free information as well */ HRESULT DPLAYX_SetConnectionSettingsW ( DWORD dwFlags, @@ -969,7 +969,7 @@ DWORD DPLAYX_SizeOfLobbyDataA( LPDPLCONNECTION lpConn ) { dwTotalSize += strlen( lpConn->lpSessionDesc->u1.lpszSessionNameA ) + 1; } - + if( lpConn->lpSessionDesc->u2.lpszPasswordA ) { dwTotalSize += strlen( lpConn->lpSessionDesc->u2.lpszPasswordA ) + 1; @@ -1052,8 +1052,8 @@ DWORD DPLAYX_SizeOfLobbyDataW( LPDPLCONNECTION lpConn ) LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateSessionDesc2A( LPCDPSESSIONDESC2 lpSessionSrc ) { - LPDPSESSIONDESC2 lpSessionDest = - (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(), + LPDPSESSIONDESC2 lpSessionDest = + (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpSessionSrc ) ); DPLAYX_CopyIntoSessionDesc2A( lpSessionDest, lpSessionSrc ); @@ -1090,10 +1090,10 @@ LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateLocalSession( UINT* index ) { if( sessionData[(*index)].dwSize != 0 ) { - return DPLAYX_CopyAndAllocateSessionDesc2A( &sessionData[(*index)++] ); + return DPLAYX_CopyAndAllocateSessionDesc2A( &sessionData[(*index)++] ); } } - + /* No more sessions */ return NULL; } @@ -1119,14 +1119,14 @@ void DPLAYX_SetLocalSession( LPCDPSESSIONDESC2 lpsd ) UINT i; /* FIXME: Is this an error if it exists already? */ - + /* Crude/wrong implementation for now. Just always add to first empty spot */ for( i=0; i < numSupportedSessions; i++ ) { /* Is this one empty? */ if( sessionData[i].dwSize == 0 ) { - DPLAYX_CopyIntoSessionDesc2A( &sessionData[i], lpsd ); + DPLAYX_CopyIntoSessionDesc2A( &sessionData[i], lpsd ); break; } } @@ -1138,7 +1138,7 @@ BOOL DPLAYX_WaitForConnectionSettings( BOOL bWait ) LPDPLAYX_LOBBYDATA lpLobbyData; DPLAYX_AquireSemaphore(); - + if( !DPLAYX_IsAppIdLobbied( 0, &lpLobbyData ) ) { DPLAYX_ReleaseSemaphore(); @@ -1164,9 +1164,9 @@ BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void) if( ( lobbyData[ i ].dwAppID != 0 ) && /* lobby initialized */ ( lobbyData[ i ].bWaitForConnectionSettings ) /* Waiting */ ) - { + { bFound = TRUE; - break; + break; } } @@ -1194,7 +1194,7 @@ BOOL DPLAYX_SetLobbyMsgThreadId( DWORD dwAppId, DWORD dwThreadId ) return TRUE; } -/* NOTE: This is potentially not thread safe. You are not guaranteed to end up +/* NOTE: This is potentially not thread safe. You are not guaranteed to end up with the correct string printed in the case where the HRESULT is not known. You'll just get the last hr passed in printed. This can change over time if this method is used alot :) */ @@ -1204,135 +1204,135 @@ LPCSTR DPLAYX_HresultToString(HRESULT hr) switch (hr) { - case DP_OK: + case DP_OK: return "DP_OK"; - case DPERR_ALREADYINITIALIZED: + case DPERR_ALREADYINITIALIZED: return "DPERR_ALREADYINITIALIZED"; - case DPERR_ACCESSDENIED: + case DPERR_ACCESSDENIED: return "DPERR_ACCESSDENIED"; - case DPERR_ACTIVEPLAYERS: + case DPERR_ACTIVEPLAYERS: return "DPERR_ACTIVEPLAYERS"; - case DPERR_BUFFERTOOSMALL: + case DPERR_BUFFERTOOSMALL: return "DPERR_BUFFERTOOSMALL"; - case DPERR_CANTADDPLAYER: + case DPERR_CANTADDPLAYER: return "DPERR_CANTADDPLAYER"; - case DPERR_CANTCREATEGROUP: + case DPERR_CANTCREATEGROUP: return "DPERR_CANTCREATEGROUP"; - case DPERR_CANTCREATEPLAYER: + case DPERR_CANTCREATEPLAYER: return "DPERR_CANTCREATEPLAYER"; - case DPERR_CANTCREATESESSION: + case DPERR_CANTCREATESESSION: return "DPERR_CANTCREATESESSION"; - case DPERR_CAPSNOTAVAILABLEYET: + case DPERR_CAPSNOTAVAILABLEYET: return "DPERR_CAPSNOTAVAILABLEYET"; - case DPERR_EXCEPTION: + case DPERR_EXCEPTION: return "DPERR_EXCEPTION"; - case DPERR_GENERIC: + case DPERR_GENERIC: return "DPERR_GENERIC"; - case DPERR_INVALIDFLAGS: + case DPERR_INVALIDFLAGS: return "DPERR_INVALIDFLAGS"; - case DPERR_INVALIDOBJECT: + case DPERR_INVALIDOBJECT: return "DPERR_INVALIDOBJECT"; - case DPERR_INVALIDPARAMS: + case DPERR_INVALIDPARAMS: return "DPERR_INVALIDPARAMS"; - case DPERR_INVALIDPLAYER: + case DPERR_INVALIDPLAYER: return "DPERR_INVALIDPLAYER"; - case DPERR_INVALIDGROUP: + case DPERR_INVALIDGROUP: return "DPERR_INVALIDGROUP"; - case DPERR_NOCAPS: + case DPERR_NOCAPS: return "DPERR_NOCAPS"; - case DPERR_NOCONNECTION: + case DPERR_NOCONNECTION: return "DPERR_NOCONNECTION"; - case DPERR_OUTOFMEMORY: + case DPERR_OUTOFMEMORY: return "DPERR_OUTOFMEMORY"; - case DPERR_NOMESSAGES: + case DPERR_NOMESSAGES: return "DPERR_NOMESSAGES"; - case DPERR_NONAMESERVERFOUND: + case DPERR_NONAMESERVERFOUND: return "DPERR_NONAMESERVERFOUND"; - case DPERR_NOPLAYERS: + case DPERR_NOPLAYERS: return "DPERR_NOPLAYERS"; - case DPERR_NOSESSIONS: + case DPERR_NOSESSIONS: return "DPERR_NOSESSIONS"; - case DPERR_PENDING: + case DPERR_PENDING: return "DPERR_PENDING"; - case DPERR_SENDTOOBIG: + case DPERR_SENDTOOBIG: return "DPERR_SENDTOOBIG"; - case DPERR_TIMEOUT: + case DPERR_TIMEOUT: return "DPERR_TIMEOUT"; - case DPERR_UNAVAILABLE: + case DPERR_UNAVAILABLE: return "DPERR_UNAVAILABLE"; - case DPERR_UNSUPPORTED: + case DPERR_UNSUPPORTED: return "DPERR_UNSUPPORTED"; - case DPERR_BUSY: + case DPERR_BUSY: return "DPERR_BUSY"; - case DPERR_USERCANCEL: + case DPERR_USERCANCEL: return "DPERR_USERCANCEL"; - case DPERR_NOINTERFACE: + case DPERR_NOINTERFACE: return "DPERR_NOINTERFACE"; - case DPERR_CANNOTCREATESERVER: + case DPERR_CANNOTCREATESERVER: return "DPERR_CANNOTCREATESERVER"; - case DPERR_PLAYERLOST: + case DPERR_PLAYERLOST: return "DPERR_PLAYERLOST"; - case DPERR_SESSIONLOST: + case DPERR_SESSIONLOST: return "DPERR_SESSIONLOST"; - case DPERR_UNINITIALIZED: + case DPERR_UNINITIALIZED: return "DPERR_UNINITIALIZED"; - case DPERR_NONEWPLAYERS: + case DPERR_NONEWPLAYERS: return "DPERR_NONEWPLAYERS"; - case DPERR_INVALIDPASSWORD: + case DPERR_INVALIDPASSWORD: return "DPERR_INVALIDPASSWORD"; - case DPERR_CONNECTING: + case DPERR_CONNECTING: return "DPERR_CONNECTING"; - case DPERR_CONNECTIONLOST: + case DPERR_CONNECTIONLOST: return "DPERR_CONNECTIONLOST"; case DPERR_UNKNOWNMESSAGE: return "DPERR_UNKNOWNMESSAGE"; - case DPERR_CANCELFAILED: + case DPERR_CANCELFAILED: return "DPERR_CANCELFAILED"; - case DPERR_INVALIDPRIORITY: + case DPERR_INVALIDPRIORITY: return "DPERR_INVALIDPRIORITY"; - case DPERR_NOTHANDLED: + case DPERR_NOTHANDLED: return "DPERR_NOTHANDLED"; - case DPERR_CANCELLED: + case DPERR_CANCELLED: return "DPERR_CANCELLED"; - case DPERR_ABORTED: + case DPERR_ABORTED: return "DPERR_ABORTED"; - case DPERR_BUFFERTOOLARGE: + case DPERR_BUFFERTOOLARGE: return "DPERR_BUFFERTOOLARGE"; - case DPERR_CANTCREATEPROCESS: + case DPERR_CANTCREATEPROCESS: return "DPERR_CANTCREATEPROCESS"; - case DPERR_APPNOTSTARTED: + case DPERR_APPNOTSTARTED: return "DPERR_APPNOTSTARTED"; - case DPERR_INVALIDINTERFACE: + case DPERR_INVALIDINTERFACE: return "DPERR_INVALIDINTERFACE"; - case DPERR_NOSERVICEPROVIDER: + case DPERR_NOSERVICEPROVIDER: return "DPERR_NOSERVICEPROVIDER"; - case DPERR_UNKNOWNAPPLICATION: + case DPERR_UNKNOWNAPPLICATION: return "DPERR_UNKNOWNAPPLICATION"; - case DPERR_NOTLOBBIED: + case DPERR_NOTLOBBIED: return "DPERR_NOTLOBBIED"; - case DPERR_SERVICEPROVIDERLOADED: + case DPERR_SERVICEPROVIDERLOADED: return "DPERR_SERVICEPROVIDERLOADED"; - case DPERR_ALREADYREGISTERED: + case DPERR_ALREADYREGISTERED: return "DPERR_ALREADYREGISTERED"; - case DPERR_NOTREGISTERED: + case DPERR_NOTREGISTERED: return "DPERR_NOTREGISTERED"; - case DPERR_AUTHENTICATIONFAILED: + case DPERR_AUTHENTICATIONFAILED: return "DPERR_AUTHENTICATIONFAILED"; - case DPERR_CANTLOADSSPI: + case DPERR_CANTLOADSSPI: return "DPERR_CANTLOADSSPI"; - case DPERR_ENCRYPTIONFAILED: + case DPERR_ENCRYPTIONFAILED: return "DPERR_ENCRYPTIONFAILED"; - case DPERR_SIGNFAILED: + case DPERR_SIGNFAILED: return "DPERR_SIGNFAILED"; - case DPERR_CANTLOADSECURITYPACKAGE: + case DPERR_CANTLOADSECURITYPACKAGE: return "DPERR_CANTLOADSECURITYPACKAGE"; - case DPERR_ENCRYPTIONNOTSUPPORTED: + case DPERR_ENCRYPTIONNOTSUPPORTED: return "DPERR_ENCRYPTIONNOTSUPPORTED"; - case DPERR_CANTLOADCAPI: + case DPERR_CANTLOADCAPI: return "DPERR_CANTLOADCAPI"; - case DPERR_NOTLOGGEDIN: + case DPERR_NOTLOGGEDIN: return "DPERR_NOTLOGGEDIN"; - case DPERR_LOGONDENIED: + case DPERR_LOGONDENIED: return "DPERR_LOGONDENIED"; default: /* For errors not in the list, return HRESULT as a string diff --git a/dlls/dplayx/dplayx_global.h b/dlls/dplayx/dplayx_global.h index ffb1e4e78ba..b40669b119e 100644 --- a/dlls/dplayx/dplayx_global.h +++ b/dlls/dplayx/dplayx_global.h @@ -24,18 +24,18 @@ BOOL DPLAYX_ConstructData(void); BOOL DPLAYX_DestructData(void); -HRESULT DPLAYX_GetConnectionSettingsA ( DWORD dwAppID, - LPVOID lpData, +HRESULT DPLAYX_GetConnectionSettingsA ( DWORD dwAppID, + LPVOID lpData, LPDWORD lpdwDataSize ); -HRESULT DPLAYX_GetConnectionSettingsW ( DWORD dwAppID, +HRESULT DPLAYX_GetConnectionSettingsW ( DWORD dwAppID, LPVOID lpData, LPDWORD lpdwDataSize ); -HRESULT DPLAYX_SetConnectionSettingsA ( DWORD dwFlags, - DWORD dwAppID, +HRESULT DPLAYX_SetConnectionSettingsA ( DWORD dwFlags, + DWORD dwAppID, LPDPLCONNECTION lpConn ); -HRESULT DPLAYX_SetConnectionSettingsW ( DWORD dwFlags, - DWORD dwAppID, +HRESULT DPLAYX_SetConnectionSettingsW ( DWORD dwFlags, + DWORD dwAppID, LPDPLCONNECTION lpConn ); BOOL DPLAYX_CreateLobbyApplication( DWORD dwAppID ); @@ -44,9 +44,9 @@ BOOL DPLAYX_DestroyLobbyApplication( DWORD dwAppID ); BOOL DPLAYX_WaitForConnectionSettings( BOOL bWait ); BOOL DPLAYX_AnyLobbiesWaitingForConnSettings(void); -BOOL DPLAYX_SetLobbyHandles( DWORD dwAppID, +BOOL DPLAYX_SetLobbyHandles( DWORD dwAppID, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead ); -BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart, +BOOL DPLAYX_GetThisLobbyHandles( LPHANDLE lphStart, LPHANDLE lphDeath, LPHANDLE lphConnRead, BOOL bClearSetHandles ); diff --git a/dlls/dplayx/dplayx_main.c b/dlls/dplayx/dplayx_main.c index 8eb8e7daa23..ac8a34e6eb0 100644 --- a/dlls/dplayx/dplayx_main.c +++ b/dlls/dplayx/dplayx_main.c @@ -1,7 +1,7 @@ -/* +/* * DPLAYX.DLL LibMain * - * Copyright 1999,2000 - Peter Hunnisett + * Copyright 1999,2000 - Peter Hunnisett * * contact * @@ -35,20 +35,20 @@ BOOL WINAPI DPLAYX_LibMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReser TRACE( "(%u,0x%08lx,%p)\n", hinstDLL, fdwReason, lpvReserved ); - switch ( fdwReason ) + switch ( fdwReason ) { case DLL_PROCESS_ATTACH: - /* First instance perform construction of global processor data */ + /* First instance perform construction of global processor data */ return DPLAYX_ConstructData(); case DLL_PROCESS_DETACH: /* Last instance performs destruction of global processor data */ - return DPLAYX_DestructData(); + return DPLAYX_DestructData(); case DLL_THREAD_ATTACH: /* Do nothing */ case DLL_THREAD_DETACH: /* Do nothing */ break; - default: + default: break; } @@ -63,12 +63,12 @@ HRESULT WINAPI DPLAYX_DllCanUnloadNow(void) { HRESULT hr = ( gdwDPlaySPRefCount > 0 ) ? S_FALSE : S_OK; - /* FIXME: Should I be putting a check in for class factory objects + /* FIXME: Should I be putting a check in for class factory objects * as well */ TRACE( ": returning 0x%08lx\n", hr ); - + return hr; } diff --git a/dlls/dplayx/dplayx_messages.c b/dlls/dplayx/dplayx_messages.c index 43fd09e4308..f1684c77ff8 100644 --- a/dlls/dplayx/dplayx_messages.c +++ b/dlls/dplayx/dplayx_messages.c @@ -37,13 +37,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(dplay); typedef struct tagMSGTHREADINFO { HANDLE hStart; - HANDLE hDeath; + HANDLE hDeath; HANDLE hSettingRead; - HANDLE hNotifyEvent; + HANDLE hNotifyEvent; } MSGTHREADINFO, *LPMSGTHREADINFO; static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext ); -static LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA data, +static LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA data, DWORD dwWaitTime, WORD wReplyCommandId, LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize ); @@ -51,7 +51,7 @@ static LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA data, /* Create the message reception thread to allow the application to receive * asynchronous message reception */ -DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart, +DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead ) { DWORD dwMsgThreadId; @@ -65,8 +65,8 @@ DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart, /* The notify event may or may not exist. Depends if async comm or not */ if( hNotifyEvent && - !DuplicateHandle( GetCurrentProcess(), hNotifyEvent, - GetCurrentProcess(), &lpThreadInfo->hNotifyEvent, + !DuplicateHandle( GetCurrentProcess(), hNotifyEvent, + GetCurrentProcess(), &lpThreadInfo->hNotifyEvent, 0, FALSE, DUPLICATE_SAME_ACCESS ) ) { ERR( "Unable to duplicate event handle\n" ); @@ -75,14 +75,14 @@ DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart, /* These 3 handles don't need to be duplicated because we don't keep a * reference to them where they're created. They're created specifically - * for the message thread + * for the message thread */ lpThreadInfo->hStart = hStart; lpThreadInfo->hDeath = hDeath; lpThreadInfo->hSettingRead = hConnRead; if( !CreateThread( NULL, /* Security attribs */ - 0, /* Stack */ + 0, /* Stack */ DPL_MSG_ThreadMain, /* Msg reception function */ lpThreadInfo, /* Msg reception func parameter */ 0, /* Flags */ @@ -96,7 +96,7 @@ DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart, /* FIXME: Should I be closing the handle to the thread or does that terminate the thread? */ - + return dwMsgThreadId; error: @@ -110,7 +110,7 @@ static DWORD CALLBACK DPL_MSG_ThreadMain( LPVOID lpContext ) { LPMSGTHREADINFO lpThreadInfo = (LPMSGTHREADINFO)lpContext; DWORD dwWaitResult; - + TRACE( "Msg thread created. Waiting on app startup\n" ); /* Wait to ensure that the lobby application is started w/ 1 min timeout */ @@ -153,7 +153,7 @@ end_of_thread: /* DP messageing stuff */ static HANDLE DP_MSG_BuildAndLinkReplyStruct( IDirectPlay2Impl* This, - LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, + LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, WORD wReplyCommandId ); static LPVOID DP_MSG_CleanReplyStruct( LPDP_MSG_REPLY_STRUCT_LIST lpReplyStructList, LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize ); @@ -200,7 +200,7 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags, lpMsg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwMsgSize ); - lpMsgBody = (LPDPMSG_REQUESTNEWPLAYERID)( (BYTE*)lpMsg + + lpMsgBody = (LPDPMSG_REQUESTNEWPLAYERID)( (BYTE*)lpMsg + This->dp2->spData.dwSPHeaderSize ); /* Compose dplay message envelope */ @@ -223,33 +223,33 @@ HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags, data.bSystemMessage = TRUE; /* Allow reply to be sent */ data.lpISP = This->dp2->spData.lpISP; - TRACE( "Asking for player id w/ dwFlags 0x%08lx\n", + TRACE( "Asking for player id w/ dwFlags 0x%08lx\n", lpMsgBody->dwFlags ); - DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, DPMSGCMD_NEWPLAYERIDREPLY, + DP_MSG_ExpectReply( This, &data, DPMSG_DEFAULT_WAIT_TIME, DPMSGCMD_NEWPLAYERIDREPLY, &lpMsg, &dwMsgSize ); } /* Need to examine the data and extract the new player id */ if( !FAILED(hr) ) { - LPCDPMSG_NEWPLAYERIDREPLY lpcReply; + LPCDPMSG_NEWPLAYERIDREPLY lpcReply; lpcReply = (LPCDPMSG_NEWPLAYERIDREPLY)lpMsg; - *lpdpidAllocatedId = lpcReply->dpidNewPlayerId; + *lpdpidAllocatedId = lpcReply->dpidNewPlayerId; TRACE( "Received reply for id = 0x%08lx\n", lpcReply->dpidNewPlayerId ); /* FIXME: I think that the rest of the message has something to do * with remote data for the player that perhaps I need to setup. * However, with the information that is passed, all that it could - * be used for is a standardized intialization value, which I'm + * be used for is a standardized intialization value, which I'm * guessing we can do without. Unless the message content is the same * for several different messages? */ - HeapFree( GetProcessHeap(), 0, lpMsg ); + HeapFree( GetProcessHeap(), 0, lpMsg ); } return hr; @@ -278,14 +278,14 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ) { LPBYTE lpPData; DWORD dwDataSize; - + /* SP Player remote data needs to be propagated at some point - is this the point? */ IDirectPlaySP_GetSPPlayerData( This->dp2->spData.lpISP, 0, (LPVOID*)&lpPData, &dwDataSize, DPSET_REMOTE ); - + ERR( "Player Data size is 0x%08lx\n" "[%02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x]\n" - "[%02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x]\n", - + "[%02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x %02x%02x]\n", + dwDataSize, lpPData[0], lpPData[1], lpPData[2], lpPData[3], lpPData[4], lpPData[5], lpPData[6], lpPData[7], lpPData[8], lpPData[9], @@ -293,7 +293,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ) lpPData[15], lpPData[16], lpPData[17], lpPData[18], lpPData[19], lpPData[20], lpPData[21], lpPData[22], lpPData[23], lpPData[24], lpPData[25], lpPData[26], lpPData[27], lpPData[28], lpPData[29], - lpPData[30], lpPData[31] + lpPData[30], lpPData[31] ); DebugBreak(); } @@ -313,9 +313,9 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ) lpMsgBody->unknown3[0] = 0x20; lpMsgBody->unknown3[0] = 0x0; lpMsgBody->unknown3[0] = 0x0; - + lpMsgBody->dpidAppServer3 = dpidServer; - lpMsgBody->unknown4[0] = 0x30; + lpMsgBody->unknown4[0] = 0x30; lpMsgBody->unknown4[1] = 0xb; lpMsgBody->unknown4[2] = 0x0; @@ -357,8 +357,8 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ) TRACE( "Sending forward player request with 0x%08lx\n", dpidServer ); - lpMsg = DP_MSG_ExpectReply( This, &data, - DPMSG_WAIT_60_SECS, + lpMsg = DP_MSG_ExpectReply( This, &data, + DPMSG_WAIT_60_SECS, DPMSGCMD_GETNAMETABLEREPLY, &lpMsg, &dwMsgSize ); } @@ -379,7 +379,7 @@ HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ) * a networking company. */ static -LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData, +LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData, DWORD dwWaitTime, WORD wReplyCommandId, LPVOID* lplpReplyMsg, LPDWORD lpdwMsgBodySize ) { @@ -387,12 +387,12 @@ LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData, HANDLE hMsgReceipt; DP_MSG_REPLY_STRUCT_LIST replyStructList; DWORD dwWaitReturn; - + /* Setup for receipt */ - hMsgReceipt = DP_MSG_BuildAndLinkReplyStruct( This, &replyStructList, + hMsgReceipt = DP_MSG_BuildAndLinkReplyStruct( This, &replyStructList, wReplyCommandId ); - TRACE( "Sending msg and expecting cmd %u in reply within %lu ticks\n", + TRACE( "Sending msg and expecting cmd %u in reply within %lu ticks\n", wReplyCommandId, dwWaitTime ); hr = (*This->dp2->spData.lpCB->Send)( lpData ); @@ -420,7 +420,7 @@ LPVOID DP_MSG_ExpectReply( IDirectPlay2AImpl* This, LPDPSP_SENDDATA lpData, * all important data. It is quite silly to have to copy the message, but the documents * indicate that a copy is taken. Silly really. */ -void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId, +void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId, LPCVOID lpcMsgBody, DWORD dwMsgBodySize ) { LPDP_MSG_REPLY_STRUCT_LIST lpReplyList; @@ -432,21 +432,21 @@ void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId, } #endif - /* Find, and immediately remove (to avoid double triggering), the appropriate entry. Call locked to + /* Find, and immediately remove (to avoid double triggering), the appropriate entry. Call locked to * avoid problems. */ EnterCriticalSection( &This->unk->DP_lock ); DPQ_REMOVE_ENTRY( This->dp2->replysExpected, replysExpected, replyExpected.wExpectedReply,\ ==, wCommandId, lpReplyList ); - LeaveCriticalSection( &This->unk->DP_lock ); + LeaveCriticalSection( &This->unk->DP_lock ); if( lpReplyList != NULL ) { - lpReplyList->replyExpected.dwMsgBodySize = dwMsgBodySize; + lpReplyList->replyExpected.dwMsgBodySize = dwMsgBodySize; lpReplyList->replyExpected.lpReplyMsg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwMsgBodySize ); - CopyMemory( lpReplyList->replyExpected.lpReplyMsg, + CopyMemory( lpReplyList->replyExpected.lpReplyMsg, lpcMsgBody, dwMsgBodySize ); /* Signal the thread which sent the message that it has a reply */ @@ -503,7 +503,7 @@ void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId, lpcErrorMsg = (LPCDPMSG_FORWARDADDPLAYERNACK)lpMsgBody; - ERR( "Received error message %u. Error is %s\n", + ERR( "Received error message %u. Error is %s\n", wCommandId, DPLAYX_HresultToString( lpcErrorMsg->errorCode) ); DebugBreak(); } diff --git a/dlls/dplayx/dplayx_messages.h b/dlls/dplayx/dplayx_messages.h index 635118836f0..015f1c00281 100644 --- a/dlls/dplayx/dplayx_messages.h +++ b/dlls/dplayx/dplayx_messages.h @@ -25,14 +25,14 @@ #include "dplay_global.h" -DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart, +DWORD CreateLobbyMessageReceptionThread( HANDLE hNotifyEvent, HANDLE hStart, HANDLE hDeath, HANDLE hConnRead ); HRESULT DP_MSG_SendRequestPlayerId( IDirectPlay2AImpl* This, DWORD dwFlags, LPDPID lpdipidAllocatedId ); HRESULT DP_MSG_ForwardPlayerCreation( IDirectPlay2AImpl* This, DPID dpidServer ); -void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId, +void DP_MSG_ReplyReceived( IDirectPlay2AImpl* This, WORD wCommandId, LPCVOID lpMsgBody, DWORD dwMsgBodySize ); void DP_MSG_ErrorReceived( IDirectPlay2AImpl* This, WORD wCommandId, LPCVOID lpMsgBody, DWORD dwMsgBodySize ); @@ -55,9 +55,9 @@ void DP_MSG_ToSelf( IDirectPlay2AImpl* This, DPID dpidSelf ); #define DPMSGCMD_REQUESTNEWPLAYERID 5 #define DPMSGCMD_NEWPLAYERIDREPLY 7 -#define DPMSGCMD_CREATESESSION 8 /* Might be a create nameserver or new player msg */ +#define DPMSGCMD_CREATESESSION 8 /* Might be a create nameserver or new player msg */ #define DPMSGCMD_CREATENEWPLAYER 9 -#define DPMSGCMD_SYSTEMMESSAGE 10 +#define DPMSGCMD_SYSTEMMESSAGE 10 #define DPMSGCMD_DELETEPLAYER 11 #define DPMSGCMD_DELETEGROUP 12 @@ -93,7 +93,7 @@ typedef struct tagDPMSG_SENDENVELOPE typedef const DPMSG_SENDENVELOPE* LPCDPMSG_SENDENVELOPE; /* System messages exchanged between players seems to have this - * payload envelope on top of the basic envelope + * payload envelope on top of the basic envelope */ typedef struct tagDPMSG_SYSMSGENVELOPE { @@ -205,7 +205,7 @@ typedef struct tagDPMSG_FORWARDADDPLAYER } DPMSG_FORWARDADDPLAYER, *LPDPMSG_FORWARDADDPLAYER; typedef const DPMSG_FORWARDADDPLAYER* LPCDPMSG_FORWARDADDPLAYER; -/* This is an error message that can be received. Not sure if this is +/* This is an error message that can be received. Not sure if this is * specifically for a forward add player or for all errors */ typedef struct tagDPMSG_FORWARDADDPLAYERNACK diff --git a/dlls/dplayx/dplayx_queue.h b/dlls/dplayx/dplayx_queue.h index 12c1f687849..7e5cbf3bbea 100644 --- a/dlls/dplayx/dplayx_queue.h +++ b/dlls/dplayx/dplayx_queue.h @@ -1,5 +1,5 @@ /* A queue definition based on sys/queue.h TAILQ definitions - * + * * Copyright 2000 Peter Hunnisett * * This library is free software; you can redistribute it and/or @@ -52,7 +52,7 @@ do{ \ #define DPQ_FIRST( head ) ( (head).lpQHFirst ) /* Check if the queue has any elements */ -#define DPQ_IS_EMPTY( head ) ( DPQ_FIRST(head) == NULL ) +#define DPQ_IS_EMPTY( head ) ( DPQ_FIRST(head) == NULL ) /* Next entry -- FIXME: Convert everything over to this macro ... */ #define DPQ_NEXT( elem ) (elem).lpQNext @@ -85,7 +85,7 @@ do { \ * field - to be concatenated to rc to compare with fieldToCompare * fieldToCompare - The value that we're comparing against * fieldCompareOperator - The logical operator to compare field and - * fieldToCompare. + * fieldToCompare. * rc - Variable to put the return code. Same type as (head).lpQHFirst */ #define DPQ_FIND_ENTRY( head, elm, field, fieldCompareOperator, fieldToCompare, rc )\ @@ -114,7 +114,7 @@ do { \ * field - to be concatenated to rc to compare with fieldToCompare * fieldToCompare - The value that we're comparing against * compare_cb - Callback to invoke to determine if comparision should continue. - * Callback must be defined with DPQ_DECL_COMPARECB. + * Callback must be defined with DPQ_DECL_COMPARECB. * rc - Variable to put the return code. Same type as (head).lpQHFirst */ #define DPQ_FIND_ENTRY_CB( head, elm, field, compare_cb, fieldToCompare, rc )\ @@ -181,7 +181,7 @@ do { \ } while(0) -/* Delete the entire queue +/* Delete the entire queue * head - pointer to the head of the queue * field - field to access the next elements of the queue * type - type of the pointer to the element element diff --git a/dlls/dplayx/dplobby.c b/dlls/dplayx/dplobby.c index ebb208192ef..04760bc5edd 100644 --- a/dlls/dplayx/dplobby.c +++ b/dlls/dplayx/dplobby.c @@ -47,7 +47,7 @@ typedef struct IDirectPlayLobby3Impl IDirectPlayLobby3WImpl; HRESULT DPL_CreateCompoundAddress ( LPCDPCOMPOUNDADDRESSELEMENT lpElements, DWORD dwElementCount, LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface ); -HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize, +HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, DWORD dwDataSize, LPVOID lpAddress, LPDWORD lpdwAddressSize, BOOL bAnsiInterface ); @@ -55,8 +55,8 @@ HRESULT DPL_CreateAddress( REFGUID guidSP, REFGUID guidDataType, LPCVOID lpData, extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext ); -static HRESULT WINAPI DPL_ConnectEx( IDirectPlayLobbyAImpl* This, - DWORD dwFlags, REFIID riid, +static HRESULT WINAPI DPL_ConnectEx( IDirectPlayLobbyAImpl* This, + DWORD dwFlags, REFIID riid, LPVOID* lplpDP, IUnknown* pUnk ); BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess, @@ -66,10 +66,10 @@ BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess, /***************************************************************************** * IDirectPlayLobby {1,2,3} implementation structure - * - * The philosophy behind this extra pointer derefernce is that I wanted to + * + * The philosophy behind this extra pointer derefernce is that I wanted to * have the same structure for all types of objects without having to do - * alot of casting. I also only wanted to implement an interface in the + * alot of casting. I also only wanted to implement an interface in the * object it was "released" with IUnknown interface being implemented in the 1 version. * Of course, with these new interfaces comes the data required to keep the state required * by these interfaces. So, basically, the pointers contain the data associated with @@ -144,15 +144,15 @@ static ICOM_VTABLE(IDirectPlayLobby3) directPlayLobby3AVT; -static BOOL DPL_CreateIUnknown( LPVOID lpDPL ) +static BOOL DPL_CreateIUnknown( LPVOID lpDPL ) { ICOM_THIS(IDirectPlayLobbyAImpl,lpDPL); - This->unk = (DirectPlayLobbyIUnknownData*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof( *(This->unk) ) ); + This->unk = (DirectPlayLobbyIUnknownData*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof( *(This->unk) ) ); if ( This->unk == NULL ) { - return FALSE; + return FALSE; } InitializeCriticalSection( &This->unk->DPL_lock ); @@ -181,9 +181,9 @@ static BOOL DPL_CreateLobby1( LPVOID lpDPL ) return FALSE; } - DPQ_INIT( This->dpl->msgs ); + DPQ_INIT( This->dpl->msgs ); - return TRUE; + return TRUE; } static BOOL DPL_DestroyLobby1( LPVOID lpDPL ) @@ -273,7 +273,7 @@ static BOOL DPL_DestroyLobby3( LPVOID lpDPL ) * successfully for a third interface, a query for the first interface * through the pointer for the third interface must succeed. */ -extern +extern HRESULT DPL_CreateInterface ( REFIID riid, LPVOID* ppvObj ) { @@ -325,14 +325,14 @@ HRESULT DPL_CreateInterface return E_NOINTERFACE; } - + /* Initialize it */ if ( DPL_CreateIUnknown( *ppvObj ) && DPL_CreateLobby1( *ppvObj ) && DPL_CreateLobby2( *ppvObj ) && DPL_CreateLobby3( *ppvObj ) ) - { + { IDirectPlayLobby_AddRef( (LPDIRECTPLAYLOBBY)*ppvObj ); return S_OK; } @@ -411,7 +411,7 @@ static HRESULT WINAPI DPL_QueryInterface return S_OK; } -/* +/* * Simple procedure. Just increment the reference count to this * structure and return the new reference count. */ @@ -466,7 +466,7 @@ static ULONG WINAPI DPL_Release /******************************************************************** - * + * * Connects an application to the session specified by the DPLCONNECTION * structure currently stored with the DirectPlayLobby object. * @@ -474,9 +474,9 @@ static ULONG WINAPI DPL_Release * */ static HRESULT WINAPI DPL_ConnectEx -( IDirectPlayLobbyAImpl* This, +( IDirectPlayLobbyAImpl* This, DWORD dwFlags, - REFIID riid, + REFIID riid, LPVOID* lplpDP, IUnknown* pUnk) { @@ -501,19 +501,19 @@ static HRESULT WINAPI DPL_ConnectEx /* Create the DirectPlay interface */ if( ( hr = DP_CreateInterface( riid, lplpDP ) ) != DP_OK ) { - ERR( "error creating interface for %s:%s.\n", + ERR( "error creating interface for %s:%s.\n", debugstr_guid( riid ), DPLAYX_HresultToString( hr ) ); return hr; } /* FIXME: Is it safe/correct to use appID of 0? */ - hr = IDirectPlayLobby_GetConnectionSettings( (LPDIRECTPLAYLOBBY)This, - 0, NULL, &dwConnSize ); + hr = IDirectPlayLobby_GetConnectionSettings( (LPDIRECTPLAYLOBBY)This, + 0, NULL, &dwConnSize ); if( hr != DPERR_BUFFERTOOSMALL ) { return hr; } - + lpConn = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwConnSize ); if( lpConn == NULL ) @@ -522,7 +522,7 @@ static HRESULT WINAPI DPL_ConnectEx } /* FIXME: Is it safe/correct to use appID of 0? */ - hr = IDirectPlayLobby_GetConnectionSettings( (LPDIRECTPLAYLOBBY)This, + hr = IDirectPlayLobby_GetConnectionSettings( (LPDIRECTPLAYLOBBY)This, 0, lpConn, &dwConnSize ); if( FAILED( hr ) ) { @@ -538,7 +538,7 @@ static HRESULT WINAPI DPL_ConnectEx /* Now initialize the Service Provider */ hr = IDirectPlayX_InitializeConnection( (*(LPDIRECTPLAY2*)lplpDP), #endif - + /* Setup flags to pass into DirectPlay::Open */ if( dwFlags & DPCONNECT_RETURNSTATUS ) @@ -547,7 +547,7 @@ static HRESULT WINAPI DPL_ConnectEx } dwOpenFlags |= lpConn->dwFlags; - hr = IDirectPlayX_Open( (*(LPDIRECTPLAY2*)lplpDP), lpConn->lpSessionDesc, + hr = IDirectPlayX_Open( (*(LPDIRECTPLAY2*)lplpDP), lpConn->lpSessionDesc, dwOpenFlags ); HeapFree( GetProcessHeap(), 0, lpConn ); @@ -562,7 +562,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_Connect IUnknown* pUnk) { ICOM_THIS(IDirectPlayLobbyAImpl,iface); - return DPL_ConnectEx( This, dwFlags, &IID_IDirectPlay2A, + return DPL_ConnectEx( This, dwFlags, &IID_IDirectPlay2A, (LPVOID)lplpDP, pUnk ); } @@ -573,14 +573,14 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_Connect IUnknown* pUnk) { ICOM_THIS(IDirectPlayLobbyAImpl,iface); /* Yes cast to A */ - return DPL_ConnectEx( This, dwFlags, &IID_IDirectPlay2, + return DPL_ConnectEx( This, dwFlags, &IID_IDirectPlay2, (LPVOID)lplpDP, pUnk ); } /******************************************************************** * * Creates a DirectPlay Address, given a service provider-specific network - * address. + * address. * Returns an address contains the globally unique identifier * (GUID) of the service provider and data that the service provider can * interpret as a network address. @@ -592,13 +592,13 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_CreateAddress ( LPDIRECTPLAYLOBBYA iface, REFGUID guidSP, REFGUID guidDataType, - LPCVOID lpData, + LPCVOID lpData, DWORD dwDataSize, - LPVOID lpAddress, + LPVOID lpAddress, LPDWORD lpdwAddressSize ) { - return DPL_CreateAddress( guidSP, guidDataType, lpData, dwDataSize, - lpAddress, lpdwAddressSize, TRUE ); + return DPL_CreateAddress( guidSP, guidDataType, lpData, dwDataSize, + lpAddress, lpdwAddressSize, TRUE ); } static HRESULT WINAPI IDirectPlayLobbyWImpl_CreateAddress @@ -626,7 +626,7 @@ HRESULT DPL_CreateAddress( const DWORD dwNumAddElements = 2; /* Service Provide & address data type */ DPCOMPOUNDADDRESSELEMENT addressElements[ 2 /* dwNumAddElements */ ]; - TRACE( "(%p)->(%p,%p,0x%08lx,%p,%p,%d)\n", guidSP, guidDataType, lpData, dwDataSize, + TRACE( "(%p)->(%p,%p,0x%08lx,%p,%p,%d)\n", guidSP, guidDataType, lpData, dwDataSize, lpAddress, lpdwAddressSize, bAnsiInterface ); addressElements[ 0 ].guidDataType = DPAID_ServiceProvider; @@ -660,12 +660,12 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddress { ICOM_THIS(IDirectPlayLobbyAImpl,iface); - TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress, + TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext ); return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext ); } - + static HRESULT WINAPI IDirectPlayLobbyWImpl_EnumAddress ( LPDIRECTPLAYLOBBY iface, LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, @@ -675,7 +675,7 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_EnumAddress { ICOM_THIS(IDirectPlayLobbyWImpl,iface); - TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress, + TRACE("(%p)->(%p,%p,0x%08lx,%p)\n", This, lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext ); return DPL_EnumAddress( lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext ); @@ -683,20 +683,20 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_EnumAddress extern HRESULT DPL_EnumAddress( LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, LPCVOID lpAddress, DWORD dwAddressSize, LPVOID lpContext ) -{ +{ DWORD dwTotalSizeEnumerated = 0; - /* FIXME: First chunk is always the total size chunk - Should we report it? */ + /* FIXME: First chunk is always the total size chunk - Should we report it? */ while ( dwTotalSizeEnumerated < dwAddressSize ) { LPDPADDRESS lpElements = (LPDPADDRESS)lpAddress; - DWORD dwSizeThisEnumeration; + DWORD dwSizeThisEnumeration; /* Invoke the enum method. If false is returned, stop enumeration */ - if ( !lpEnumAddressCallback( &lpElements->guidDataType, - lpElements->dwDataSize, - (BYTE*)lpElements + sizeof( DPADDRESS ), + if ( !lpEnumAddressCallback( &lpElements->guidDataType, + lpElements->dwDataSize, + (BYTE*)lpElements + sizeof( DPADDRESS ), lpContext ) ) { break; @@ -825,7 +825,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes MultiByteToWideChar( CP_ACP, 0, atSubKey, -1, buff, sizeof(buff)/sizeof(WCHAR) ); CLSIDFromString( (LPCOLESTR)buff, &serviceProviderGUID ); /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ - + /* The enumeration will return FALSE if we are not to continue */ if( !lpEnumAddressTypeCallback( &serviceProviderGUID, lpContext, 0 ) ) { @@ -837,7 +837,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumAddressTypes /* We only enumerate address types for 1 GUID. We've found it, so quit looking */ break; - } + } return DP_OK; } @@ -946,10 +946,10 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications dplAppInfo.dwSize = sizeof( dplAppInfo ); dplAppInfo.guidApplication = serviceProviderGUID; - dplAppInfo.u.lpszAppNameA = subKeyName; + dplAppInfo.u.lpszAppNameA = subKeyName; EnterCriticalSection( &This->unk->DPL_lock ); - + memcpy( &This->dpl->hkCallbackKeyHack, &hkServiceProvider, sizeof( hkServiceProvider ) ); if( !lpEnumLocalAppCallback( &dplAppInfo, lpContext, dwFlags ) ) @@ -981,14 +981,14 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_GetConnectionSettings LPDWORD lpdwDataSize ) { ICOM_THIS(IDirectPlayLobbyAImpl,iface); - HRESULT hr; + HRESULT hr; TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize ); EnterCriticalSection( &This->unk->DPL_lock ); - hr = DPLAYX_GetConnectionSettingsA( dwAppID, - lpData, + hr = DPLAYX_GetConnectionSettingsA( dwAppID, + lpData, lpdwDataSize ); @@ -1007,11 +1007,11 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_GetConnectionSettings HRESULT hr; TRACE("(%p)->(0x%08lx,%p,%p)\n", This, dwAppID, lpData, lpdwDataSize ); - + EnterCriticalSection( &This->unk->DPL_lock ); - hr = DPLAYX_GetConnectionSettingsW( dwAppID, - lpData, + hr = DPLAYX_GetConnectionSettingsW( dwAppID, + lpData, lpdwDataSize ); @@ -1022,7 +1022,7 @@ static HRESULT WINAPI IDirectPlayLobbyWImpl_GetConnectionSettings /******************************************************************** * - * Retrieves the message sent between a lobby client and a DirectPlay + * Retrieves the message sent between a lobby client and a DirectPlay * application. All messages are queued until received. * */ @@ -1078,14 +1078,14 @@ static BOOL CALLBACK RunApplicationA_EnumLocalApplications char returnBuffer[200]; DWORD returnType, sizeOfReturnBuffer; LPSTR clSubKey = "CommandLine"; - LPSTR cdSubKey = "CurrentDirectory"; + LPSTR cdSubKey = "CurrentDirectory"; LPSTR fileSubKey = "File"; LPSTR pathSubKey = "Path"; - /* FIXME: Lazy man hack - dplay struct has the present reg key saved */ + /* FIXME: Lazy man hack - dplay struct has the present reg key saved */ sizeOfReturnBuffer = 200; - + /* Get all the appropriate data from the registry */ if( RegQueryValueExA( lpData->This->dpl->hkCallbackKeyHack, clSubKey, NULL, &returnType, returnBuffer, @@ -1144,11 +1144,11 @@ static BOOL CALLBACK RunApplicationA_EnumLocalApplications return FALSE; /* No need to keep going as we found what we wanted */ } - return TRUE; /* Keep enumerating, haven't found the application yet */ + return TRUE; /* Keep enumerating, haven't found the application yet */ } BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess, - LPHANDLE lphStart, LPHANDLE lphDeath, + LPHANDLE lphStart, LPHANDLE lphDeath, LPHANDLE lphRead ) { /* These are the handles for the created process */ @@ -1169,14 +1169,14 @@ BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess, hTemp = CreateEventA( &s_attrib, TRUE, FALSE, NULL ); *lphRead = ConvertToGlobalHandle( hTemp ); - if( ( !DuplicateHandle( GetCurrentProcess(), *lphStart, - hDestProcess, &hAppStart, + if( ( !DuplicateHandle( GetCurrentProcess(), *lphStart, + hDestProcess, &hAppStart, 0, FALSE, DUPLICATE_SAME_ACCESS ) ) || - ( !DuplicateHandle( GetCurrentProcess(), *lphDeath, - hDestProcess, &hAppDeath, + ( !DuplicateHandle( GetCurrentProcess(), *lphDeath, + hDestProcess, &hAppDeath, 0, FALSE, DUPLICATE_SAME_ACCESS ) ) || - ( !DuplicateHandle( GetCurrentProcess(), *lphRead, - hDestProcess, &hAppRead, + ( !DuplicateHandle( GetCurrentProcess(), *lphRead, + hDestProcess, &hAppRead, 0, FALSE, DUPLICATE_SAME_ACCESS ) ) ) { @@ -1185,10 +1185,10 @@ BOOL DPL_CreateAndSetLobbyHandles( DWORD dwDestProcessId, HANDLE hDestProcess, return FALSE; } - if( !DPLAYX_SetLobbyHandles( dwDestProcessId, + if( !DPLAYX_SetLobbyHandles( dwDestProcessId, hAppStart, hAppDeath, hAppRead ) ) { - return FALSE; + return FALSE; } return TRUE; @@ -1218,7 +1218,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication DWORD dwSuspendCount; HANDLE hStart, hDeath, hSettingRead; - TRACE( "(%p)->(0x%08lx,%p,%p,%x)\n", + TRACE( "(%p)->(0x%08lx,%p,%p,%x)\n", This, dwFlags, lpdwAppID, lpConn, hReceiveEvent ); if( dwFlags != 0 ) @@ -1237,7 +1237,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication enumData.This = This; enumData.appGUID = lpConn->lpSessionDesc->guidApplication; - /* Our callback function will fill up the enumData structure with all the information + /* Our callback function will fill up the enumData structure with all the information required to start a new process */ IDirectPlayLobby_EnumLocalApplications( iface, RunApplicationA_EnumLocalApplications, (LPVOID)(&enumData), 0 ); @@ -1245,13 +1245,13 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication /* First the application name */ strcpy( temp, enumData.lpszPath ); strcat( temp, "\\" ); - strcat( temp, enumData.lpszFileName ); - HeapFree( GetProcessHeap(), 0, enumData.lpszPath ); + strcat( temp, enumData.lpszFileName ); + HeapFree( GetProcessHeap(), 0, enumData.lpszPath ); HeapFree( GetProcessHeap(), 0, enumData.lpszFileName ); if ((appName = HeapAlloc( GetProcessHeap(), 0, strlen(temp)+1 ))) strcpy( appName, temp ); /* Now the command line */ - strcat( temp, " " ); + strcat( temp, " " ); strcat( temp, enumData.lpszCommandLine ); HeapFree( GetProcessHeap(), 0, enumData.lpszCommandLine ); if ((enumData.lpszCommandLine = HeapAlloc( GetProcessHeap(), 0, strlen(temp)+1 ))) @@ -1282,8 +1282,8 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication HeapFree( GetProcessHeap(), 0, enumData.lpszCommandLine ); HeapFree( GetProcessHeap(), 0, enumData.lpszCurrentDirectory ); - return DPERR_CANTCREATEPROCESS; - } + return DPERR_CANTCREATEPROCESS; + } HeapFree( GetProcessHeap(), 0, appName ); HeapFree( GetProcessHeap(), 0, enumData.lpszCommandLine ); @@ -1297,7 +1297,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication } hr = IDirectPlayLobby_SetConnectionSettings( iface, 0, newProcessInfo.dwProcessId, lpConn ); - + if( hr != DP_OK ) { ERR( "SetConnectionSettings failure %s\n", DPLAYX_HresultToString( hr ) ); @@ -1310,7 +1310,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication &hStart, &hDeath, &hSettingRead ); /* Setup the message thread ID */ - This->dpl->dwMsgThread = + This->dpl->dwMsgThread = CreateLobbyMessageReceptionThread( hReceiveEvent, hStart, hDeath, hSettingRead ); DPLAYX_SetLobbyMsgThreadId( newProcessInfo.dwProcessId, This->dpl->dwMsgThread ); @@ -1320,7 +1320,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_RunApplication /* Everything seems to have been set correctly, update the dwAppID */ *lpdwAppID = newProcessInfo.dwProcessId; - /* Unsuspend the process - should return the prev suspension count */ + /* Unsuspend the process - should return the prev suspension count */ if( ( dwSuspendCount = ResumeThread( newProcessInfo.hThread ) ) != 1 ) { ERR( "ResumeThread failed with 0x%08lx\n", dwSuspendCount ); @@ -1512,13 +1512,13 @@ HRESULT DPL_CreateCompoundAddress dwSizeRequired += sizeof( DPADDRESS ) + sizeof( DWORD ); /* Calculate the size of the buffer required */ - for ( dwElements = dwElementCount; dwElements > 0; --dwElements, ++lpElements ) + for ( dwElements = dwElementCount; dwElements > 0; --dwElements, ++lpElements ) { if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ServiceProvider ) ) || ( IsEqualGUID( &lpElements->guidDataType, &DPAID_LobbyProvider ) ) ) { - dwSizeRequired += sizeof( DPADDRESS ) + sizeof( GUID ); + dwSizeRequired += sizeof( DPADDRESS ) + sizeof( GUID ); } else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Phone ) ) || ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Modem ) ) || @@ -1526,7 +1526,7 @@ HRESULT DPL_CreateCompoundAddress ) { if( !bAnsiInterface ) - { + { ERR( "Ansi GUIDs used for unicode interface\n" ); return DPERR_INVALIDFLAGS; } @@ -1559,18 +1559,18 @@ HRESULT DPL_CreateCompoundAddress else { ERR( "Unknown GUID %s\n", debugstr_guid(&lpElements->guidDataType) ); - return DPERR_INVALIDFLAGS; + return DPERR_INVALIDFLAGS; } } /* The user wants to know how big a buffer to allocate for us */ if( ( lpAddress == NULL ) || - ( *lpdwAddressSize < dwSizeRequired ) + ( *lpdwAddressSize < dwSizeRequired ) ) { - *lpdwAddressSize = dwSizeRequired; + *lpdwAddressSize = dwSizeRequired; return DPERR_BUFFERTOOSMALL; - } + } /* Add the total size chunk */ { @@ -1585,9 +1585,9 @@ HRESULT DPL_CreateCompoundAddress } /* Calculate the size of the buffer required */ - for( dwElements = dwElementCount, lpElements = lpOrigElements; - dwElements > 0; - --dwElements, ++lpElements ) + for( dwElements = dwElementCount, lpElements = lpOrigElements; + dwElements > 0; + --dwElements, ++lpElements ) { if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_ServiceProvider ) ) || ( IsEqualGUID( &lpElements->guidDataType, &DPAID_LobbyProvider ) ) @@ -1595,7 +1595,7 @@ HRESULT DPL_CreateCompoundAddress { LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress; - CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, + CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, sizeof( GUID ) ); lpdpAddress->dwDataSize = sizeof( GUID ); lpAddress = (char *) lpAddress + sizeof( DPADDRESS ); @@ -1604,19 +1604,19 @@ HRESULT DPL_CreateCompoundAddress lpAddress = (char *) lpAddress + sizeof( GUID ); } else if ( ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Phone ) ) || - ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Modem ) ) || + ( IsEqualGUID( &lpElements->guidDataType, &DPAID_Modem ) ) || ( IsEqualGUID( &lpElements->guidDataType, &DPAID_INet ) ) ) { LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress; - CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, + CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, sizeof( GUID ) ); lpdpAddress->dwDataSize = lpElements->dwDataSize; lpAddress = (char *) lpAddress + sizeof( DPADDRESS ); - lstrcpynA( (LPSTR)lpAddress, - (LPCSTR)lpElements->lpData, + lstrcpynA( (LPSTR)lpAddress, + (LPCSTR)lpElements->lpData, lpElements->dwDataSize ); lpAddress = (char *) lpAddress + lpElements->dwDataSize; } @@ -1627,7 +1627,7 @@ HRESULT DPL_CreateCompoundAddress { LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress; - CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, + CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, sizeof( GUID ) ); lpdpAddress->dwDataSize = lpElements->dwDataSize; lpAddress = (char *) lpAddress + sizeof( DPADDRESS ); @@ -1641,7 +1641,7 @@ HRESULT DPL_CreateCompoundAddress { LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress; - CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, + CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, sizeof( GUID ) ); lpdpAddress->dwDataSize = lpElements->dwDataSize; lpAddress = (char *) lpAddress + sizeof( DPADDRESS ); @@ -1653,12 +1653,12 @@ HRESULT DPL_CreateCompoundAddress { LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress; - CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, + CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType, sizeof( GUID ) ); lpdpAddress->dwDataSize = lpElements->dwDataSize; lpAddress = (char *) lpAddress + sizeof( DPADDRESS ); - CopyMemory( lpAddress, lpElements->lpData, sizeof( DPADDRESS ) ); + CopyMemory( lpAddress, lpElements->lpData, sizeof( DPADDRESS ) ); lpAddress = (char *) lpAddress + sizeof( DPADDRESS ); } } @@ -1669,7 +1669,7 @@ HRESULT DPL_CreateCompoundAddress /* DPL 3 methods */ static HRESULT WINAPI IDirectPlayLobby3WImpl_ConnectEx -( LPDIRECTPLAYLOBBY3 iface, DWORD dwFlags, REFIID riid, +( LPDIRECTPLAYLOBBY3 iface, DWORD dwFlags, REFIID riid, LPVOID* lplpDP, IUnknown* pUnk ) { ICOM_THIS( IDirectPlayLobbyAImpl, iface ); @@ -1677,7 +1677,7 @@ static HRESULT WINAPI IDirectPlayLobby3WImpl_ConnectEx } static HRESULT WINAPI IDirectPlayLobby3AImpl_ConnectEx -( LPDIRECTPLAYLOBBY3A iface, DWORD dwFlags, REFIID riid, +( LPDIRECTPLAYLOBBY3A iface, DWORD dwFlags, REFIID riid, LPVOID* lplpDP, IUnknown* pUnk ) { ICOM_THIS( IDirectPlayLobbyAImpl, iface ); @@ -1723,7 +1723,7 @@ static HRESULT WINAPI IDirectPlayLobby3WImpl_WaitForConnectionSettings if( DPLAYX_WaitForConnectionSettings( bStartWait ) ) { /* FIXME: What is the correct error return code? */ - hr = DPERR_NOTLOBBIED; + hr = DPERR_NOTLOBBIED; } return hr; @@ -1758,7 +1758,7 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_WaitForConnectionSettings /* Direct Play Lobby 1 (ascii) Virtual Table for methods */ /* All lobby 1 methods are exactly the same except QueryInterface */ -static struct ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyAVT = +static struct ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyAVT = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE @@ -1789,7 +1789,7 @@ static struct ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyAVT = #endif /* Direct Play Lobby 1 (unicode) Virtual Table for methods */ -static ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyWVT = +static ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyWVT = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE @@ -1798,7 +1798,7 @@ static ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyWVT = XCAST(Release)DPL_Release, IDirectPlayLobbyWImpl_Connect, - IDirectPlayLobbyWImpl_CreateAddress, + IDirectPlayLobbyWImpl_CreateAddress, IDirectPlayLobbyWImpl_EnumAddress, IDirectPlayLobbyWImpl_EnumAddressTypes, IDirectPlayLobbyWImpl_EnumLocalApplications, @@ -1819,7 +1819,7 @@ static ICOM_VTABLE(IDirectPlayLobby) directPlayLobbyWVT = #endif /* Direct Play Lobby 2 (ascii) Virtual Table for methods */ -static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2AVT = +static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2AVT = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE @@ -1839,7 +1839,7 @@ static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2AVT = XCAST(SetConnectionSettings)IDirectPlayLobbyAImpl_SetConnectionSettings, XCAST(SetLobbyMessageEvent)IDirectPlayLobbyAImpl_SetLobbyMessageEvent, - IDirectPlayLobby2AImpl_CreateCompoundAddress + IDirectPlayLobby2AImpl_CreateCompoundAddress }; #undef XCAST @@ -1851,12 +1851,12 @@ static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2AVT = #endif /* Direct Play Lobby 2 (unicode) Virtual Table for methods */ -static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2WVT = +static ICOM_VTABLE(IDirectPlayLobby2) directPlayLobby2WVT = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE XCAST(QueryInterface)DPL_QueryInterface, - XCAST(AddRef)DPL_AddRef, + XCAST(AddRef)DPL_AddRef, XCAST(Release)DPL_Release, XCAST(Connect)IDirectPlayLobbyWImpl_Connect, @@ -1952,9 +1952,9 @@ static ICOM_VTABLE(IDirectPlayLobby3) directPlayLobby3WVT = /********************************************************* * - * Direct Play Lobby Interface Implementation - * - *********************************************************/ + * Direct Play Lobby Interface Implementation + * + *********************************************************/ /*************************************************************************** * DirectPlayLobbyCreateA (DPLAYX.4) @@ -1962,7 +1962,7 @@ static ICOM_VTABLE(IDirectPlayLobby3) directPlayLobby3WVT = */ HRESULT WINAPI DirectPlayLobbyCreateA( LPGUID lpGUIDDSP, LPDIRECTPLAYLOBBYA *lplpDPL, - IUnknown *lpUnk, + IUnknown *lpUnk, LPVOID lpData, DWORD dwDataSize ) { @@ -1985,23 +1985,23 @@ HRESULT WINAPI DirectPlayLobbyCreateA( LPGUID lpGUIDDSP, return CLASS_E_NOAGGREGATION; } - return DPL_CreateInterface( &IID_IDirectPlayLobbyA, (void**)lplpDPL ); + return DPL_CreateInterface( &IID_IDirectPlayLobbyA, (void**)lplpDPL ); } /*************************************************************************** * DirectPlayLobbyCreateW (DPLAYX.5) * */ -HRESULT WINAPI DirectPlayLobbyCreateW( LPGUID lpGUIDDSP, +HRESULT WINAPI DirectPlayLobbyCreateW( LPGUID lpGUIDDSP, LPDIRECTPLAYLOBBY *lplpDPL, IUnknown *lpUnk, - LPVOID lpData, + LPVOID lpData, DWORD dwDataSize ) { TRACE("lpGUIDDSP=%p lplpDPL=%p lpUnk=%p lpData=%p dwDataSize=%08lx\n", lpGUIDDSP,lplpDPL,lpUnk,lpData,dwDataSize); - /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must + /* Parameter Check: lpGUIDSP, lpUnk & lpData must be NULL. dwDataSize must * equal 0. These fields are mostly for future expansion. */ if ( lpGUIDDSP || lpData || dwDataSize ) @@ -2018,5 +2018,5 @@ HRESULT WINAPI DirectPlayLobbyCreateW( LPGUID lpGUIDDSP, return CLASS_E_NOAGGREGATION; } - return DPL_CreateInterface( &IID_IDirectPlayLobby, (void**)lplpDPL ); + return DPL_CreateInterface( &IID_IDirectPlayLobby, (void**)lplpDPL ); } diff --git a/dlls/dplayx/lobbysp.c b/dlls/dplayx/lobbysp.c index 364b77dfaaf..0575c356a81 100644 --- a/dlls/dplayx/lobbysp.c +++ b/dlls/dplayx/lobbysp.c @@ -181,9 +181,9 @@ static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP ) static HRESULT WINAPI DPLSP_QueryInterface -( LPDPLOBBYSP iface, +( LPDPLOBBYSP iface, REFIID riid, - LPVOID* ppvObj + LPVOID* ppvObj ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -219,7 +219,7 @@ HRESULT WINAPI DPLSP_QueryInterface return S_OK; } -static +static ULONG WINAPI DPLSP_AddRef ( LPDPLOBBYSP iface ) { @@ -263,10 +263,10 @@ ULONG WINAPI DPLSP_Release return ulInterfaceRefCount; } -static +static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup -( LPDPLOBBYSP iface, - LPSPDATA_ADDREMOTEGROUPTOGROUP argtg +( LPDPLOBBYSP iface, + LPSPDATA_ADDREMOTEGROUPTOGROUP argtg ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -274,10 +274,10 @@ HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup return DP_OK; } -static +static HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup -( LPDPLOBBYSP iface, - LPSPDATA_ADDREMOTEPLAYERTOGROUP arptg +( LPDPLOBBYSP iface, + LPSPDATA_ADDREMOTEPLAYERTOGROUP arptg ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -285,10 +285,10 @@ HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup return DP_OK; } -static +static HRESULT WINAPI IDPLobbySPImpl_CreateGroup -( LPDPLOBBYSP iface, - LPSPDATA_CREATEREMOTEGROUP crg +( LPDPLOBBYSP iface, + LPSPDATA_CREATEREMOTEGROUP crg ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -296,10 +296,10 @@ HRESULT WINAPI IDPLobbySPImpl_CreateGroup return DP_OK; } -static +static HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup -( LPDPLOBBYSP iface, - LPSPDATA_CREATEREMOTEGROUPINGROUP crgig +( LPDPLOBBYSP iface, + LPSPDATA_CREATEREMOTEGROUPINGROUP crgig ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -309,8 +309,8 @@ HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup static HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup -( LPDPLOBBYSP iface, - LPSPDATA_DELETEREMOTEGROUPFROMGROUP drgfg +( LPDPLOBBYSP iface, + LPSPDATA_DELETEREMOTEGROUPFROMGROUP drgfg ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -320,8 +320,8 @@ HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup static HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup -( LPDPLOBBYSP iface, - LPSPDATA_DELETEREMOTEPLAYERFROMGROUP drpfg +( LPDPLOBBYSP iface, + LPSPDATA_DELETEREMOTEPLAYERFROMGROUP drpfg ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -331,8 +331,8 @@ HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup -( LPDPLOBBYSP iface, - LPSPDATA_DESTROYREMOTEGROUP drg +( LPDPLOBBYSP iface, + LPSPDATA_DESTROYREMOTEGROUP drg ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -342,8 +342,8 @@ HRESULT WINAPI IDPLobbySPImpl_DestroyGroup static HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse -( LPDPLOBBYSP iface, - LPSPDATA_ENUMSESSIONSRESPONSE er +( LPDPLOBBYSP iface, + LPSPDATA_ENUMSESSIONSRESPONSE er ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -353,8 +353,8 @@ HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer -( LPDPLOBBYSP iface, - LPVOID* lplpData +( LPDPLOBBYSP iface, + LPVOID* lplpData ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -364,8 +364,8 @@ HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer static HRESULT WINAPI IDPLobbySPImpl_HandleMessage -( LPDPLOBBYSP iface, - LPSPDATA_HANDLEMESSAGE hm +( LPDPLOBBYSP iface, + LPSPDATA_HANDLEMESSAGE hm ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -375,8 +375,8 @@ HRESULT WINAPI IDPLobbySPImpl_HandleMessage static HRESULT WINAPI IDPLobbySPImpl_SendChatMessage -( LPDPLOBBYSP iface, - LPSPDATA_CHATMESSAGE cm +( LPDPLOBBYSP iface, + LPSPDATA_CHATMESSAGE cm ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -386,8 +386,8 @@ HRESULT WINAPI IDPLobbySPImpl_SendChatMessage static HRESULT WINAPI IDPLobbySPImpl_SetGroupName -( LPDPLOBBYSP iface, - LPSPDATA_SETREMOTEGROUPNAME srgn +( LPDPLOBBYSP iface, + LPSPDATA_SETREMOTEGROUPNAME srgn ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -397,8 +397,8 @@ HRESULT WINAPI IDPLobbySPImpl_SetGroupName static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName -( LPDPLOBBYSP iface, - LPSPDATA_SETREMOTEPLAYERNAME srpn +( LPDPLOBBYSP iface, + LPSPDATA_SETREMOTEPLAYERNAME srpn ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -408,8 +408,8 @@ HRESULT WINAPI IDPLobbySPImpl_SetPlayerName static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc -( LPDPLOBBYSP iface, - LPSPDATA_SETSESSIONDESC ssd +( LPDPLOBBYSP iface, + LPSPDATA_SETSESSIONDESC ssd ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -419,8 +419,8 @@ HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer -( LPDPLOBBYSP iface, - LPVOID lpData +( LPDPLOBBYSP iface, + LPVOID lpData ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -430,8 +430,8 @@ HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer static HRESULT WINAPI IDPLobbySPImpl_StartSession -( LPDPLOBBYSP iface, - LPSPDATA_STARTSESSIONCOMMAND ssc +( LPDPLOBBYSP iface, + LPSPDATA_STARTSESSIONCOMMAND ssc ) { ICOM_THIS(IDPLobbySPImpl,iface); @@ -459,8 +459,8 @@ static struct ICOM_VTABLE(IDPLobbySP) dpLobbySPVT = IDPLobbySPImpl_GetSPDataPointer, IDPLobbySPImpl_HandleMessage, IDPLobbySPImpl_SendChatMessage, - IDPLobbySPImpl_SetGroupName, - IDPLobbySPImpl_SetPlayerName, + IDPLobbySPImpl_SetGroupName, + IDPLobbySPImpl_SetPlayerName, IDPLobbySPImpl_SetSessionDesc, IDPLobbySPImpl_SetSPDataPointer, IDPLobbySPImpl_StartSession diff --git a/dlls/dplayx/lobbysp.h b/dlls/dplayx/lobbysp.h index a9efe35b258..4e905f10a52 100644 --- a/dlls/dplayx/lobbysp.h +++ b/dlls/dplayx/lobbysp.h @@ -442,9 +442,9 @@ typedef struct SP_CALLBACKS LPSP_SETPLAYERNAME SetPlayerName; LPSP_SHUTDOWN Shutdown; LPSP_STARTSESSION StartSession; -} SP_CALLBACKS, *LPSP_CALLBACKS; +} SP_CALLBACKS, *LPSP_CALLBACKS; -typedef struct SPDATA_INIT +typedef struct SPDATA_INIT { LPSP_CALLBACKS lpCB; DWORD dwSPVersion; diff --git a/dlls/dplayx/name_server.c b/dlls/dplayx/name_server.c index 8f97b09b691..d02cbaa8247 100644 --- a/dlls/dplayx/name_server.c +++ b/dlls/dplayx/name_server.c @@ -18,7 +18,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + /* NOTE: Methods with the NS_ prefix are name server methods */ #include @@ -60,14 +60,14 @@ struct NSCache BOOL bNsIsLocal; LPVOID lpLocalAddrHdr; /* FIXME: Not yet used */ LPVOID lpRemoteAddrHdr; /* FIXME: Not yet used */ -}; +}; typedef struct NSCache NSCache, *lpNSCache; /* Function prototypes */ DPQ_DECL_DELETECB( cbDeleteNSNodeFromHeap, lpNSCacheData ); -/* Name Server functions - * --------------------- +/* Name Server functions + * --------------------- */ void NS_SetLocalComputerAsNameServer( LPCDPSESSIONDESC2 lpsd, LPVOID lpNSInfo ) { @@ -117,7 +117,7 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr, } /* Add this to the list */ - lpCacheNode = (lpNSCacheData)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + lpCacheNode = (lpNSCacheData)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpCacheNode ) ); if( lpCacheNode == NULL ) @@ -129,10 +129,10 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr, lpCacheNode->lpNSAddrHdr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwHdrSize ); CopyMemory( lpCacheNode->lpNSAddrHdr, lpcNSAddrHdr, dwHdrSize ); - + lpCacheNode->data = (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(), - HEAP_ZERO_MEMORY, + HEAP_ZERO_MEMORY, sizeof( *(lpCacheNode->data) ) ); if( lpCacheNode->data == NULL ) @@ -155,8 +155,8 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr, lpCache->present = lpCacheNode; - /* Use this message as an oportunity to weed out any old sessions so - * that we don't enum them again + /* Use this message as an oportunity to weed out any old sessions so + * that we don't enum them again */ NS_PruneSessionCache( lpNSInfo ); } @@ -214,7 +214,7 @@ void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize ) HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid, DWORD dwFlags, LPSPINITDATA lpSpData ) - + { DPSP_ENUMSESSIONSDATA data; LPDPMSG_ENUMSESSIONSREQUEST lpMsg; @@ -225,13 +225,13 @@ HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid, FIXME( ": not all data fields are correct\n" ); data.dwMessageSize = lpSpData->dwSPHeaderSize + sizeof( *lpMsg ); /*FIXME!*/ - data.lpMessage = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + data.lpMessage = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, data.dwMessageSize ); data.lpISP = lpSpData->lpISP; data.bReturnStatus = (dwFlags & DPENUMSESSIONS_RETURNSTATUS) ? TRUE : FALSE; - lpMsg = (LPDPMSG_ENUMSESSIONSREQUEST)(((BYTE*)data.lpMessage)+lpSpData->dwSPHeaderSize); + lpMsg = (LPDPMSG_ENUMSESSIONSREQUEST)(((BYTE*)data.lpMessage)+lpSpData->dwSPHeaderSize); /* Setup EnumSession reqest message */ lpMsg->envelope.dwMagic = DPMSGMAGIC_DPLAYMSG; @@ -243,7 +243,7 @@ HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid, CopyMemory( &lpMsg->guidApplication, lpcGuid, sizeof( *lpcGuid ) ); - return (lpSpData->lpCB->EnumSessions)( &data ); + return (lpSpData->lpCB->EnumSessions)( &data ); } /* Delete a name server node which has been allocated on the heap */ @@ -318,7 +318,7 @@ LPDPSESSIONDESC2 NS_WalkSessions( LPVOID lpNSInfo ) /* FIXME: The pointers could disappear when walking if a prune happens */ - /* Test for end of the list */ + /* Test for end of the list */ if( lpCache->present == NULL ) { return NULL; @@ -343,10 +343,10 @@ void NS_PruneSessionCache( LPVOID lpNSInfo ) const DWORD dwPresentTime = timeGetTime(); const DWORD dwPrunePeriod = DPMSG_WAIT_60_SECS; /* is 60 secs enough? */ - /* This silly little algorithm is based on the fact we keep entries in + /* This silly little algorithm is based on the fact we keep entries in * the queue in a time based order. It also assumes that it is not possible * to wrap around over yourself (which is not unreasonable). - * The if statements verify if the first entry in the queue is less + * The if statements verify if the first entry in the queue is less * than dwPrunePeriod old depending on the "clock" roll over. */ for( ;; ) @@ -375,7 +375,7 @@ void NS_PruneSessionCache( LPVOID lpNSInfo ) } /* NAME SERVER Message stuff */ -void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg, +void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg, LPVOID* lplpReplyData, LPDWORD lpdwReplySize, IDirectPlay2Impl* lpDP ) @@ -406,15 +406,15 @@ void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg, *lplpReplyData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, *lpdwReplySize ); - rmsg = (LPDPMSG_ENUMSESSIONSREPLY)( (BYTE*)*lplpReplyData + + rmsg = (LPDPMSG_ENUMSESSIONSREPLY)( (BYTE*)*lplpReplyData + lpDP->dp2->spData.dwSPHeaderSize); - rmsg->envelope.dwMagic = DPMSGMAGIC_DPLAYMSG; + rmsg->envelope.dwMagic = DPMSGMAGIC_DPLAYMSG; rmsg->envelope.wCommandId = DPMSGCMD_ENUMSESSIONSREPLY; rmsg->envelope.wVersion = DPMSGVER_DP6; - CopyMemory( &rmsg->sd, lpDP->dp2->lpSessionDesc, - sizeof( lpDP->dp2->lpSessionDesc->dwSize ) ); + CopyMemory( &rmsg->sd, lpDP->dp2->lpSessionDesc, + sizeof( lpDP->dp2->lpSessionDesc->dwSize ) ); rmsg->dwUnknown = 0x0000005c; if( bAnsi ) { diff --git a/dlls/dplayx/name_server.h b/dlls/dplayx/name_server.h index 51caa877646..ed0c1e715bd 100644 --- a/dlls/dplayx/name_server.h +++ b/dlls/dplayx/name_server.h @@ -35,7 +35,7 @@ DWORD NS_GetNsMagic( LPVOID lpNSInfo ); DWORD NS_GetOtherMagic( LPVOID lpNSInfo ); void NS_SetLocalAddr( LPVOID lpNSInfo, LPCVOID lpHdr, DWORD dwHdrSize ); -void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg, +void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg, LPVOID* lplpReplyData, LPDWORD lpdwReplySize, IDirectPlay2Impl* lpDP ); @@ -43,7 +43,7 @@ void NS_ReplyToEnumSessionsRequest( LPCVOID lpcMsg, HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid, DWORD dwFlags, LPSPINITDATA lpSpData ); - + BOOL NS_InitializeSessionCache( LPVOID* lplpNSInfo ); void NS_DeleteSessionCache( LPVOID lpNSInfo ); diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index d58605b2fbc..b6295bf31ca 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -1,5 +1,5 @@ /* DirectSound - * + * * Copyright 1998 Marcus Meissner * Copyright 1998 Rob Riggs * Copyright 2000-2001 TransGaming Technologies, Inc. @@ -69,7 +69,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); /* these are eligible for tuning... they must be high on slow machines... */ /* some stuff may get more responsive with lower values though... */ #define DS_EMULDRIVER 1 /* some games (Quake 2, UT) refuse to accept - emulated dsound devices. set to 0 ! */ + emulated dsound devices. set to 0 ! */ #define DS_HEL_FRAGS 48 /* HEL only: number of waveOut fragments in primary buffer * (changing this won't help you) */ #define DS_HEL_MARGIN 5 /* HEL only: number of waveOut fragments ahead to mix in new buffers @@ -183,10 +183,10 @@ struct IDirectSound3DListenerImpl /* IDirectSound3DListenerImpl fields */ IDirectSoundBufferImpl* dsb; DS3DLISTENER ds3dl; - CRITICAL_SECTION lock; + CRITICAL_SECTION lock; }; -struct IKsPropertySetImpl +struct IKsPropertySetImpl { /* IUnknown fields */ ICOM_VFIELD(IKsPropertySet); @@ -288,7 +288,7 @@ static int ds_hel_queue = DS_HEL_QUEUE; static int ds_snd_queue_max = DS_SND_QUEUE_MAX; static int ds_snd_queue_min = DS_SND_QUEUE_MIN; -/* +/* * Call the callback provided to DirectSoundEnumerateA. */ @@ -324,9 +324,9 @@ inline static void setup_dsound_options(void) { char buffer[MAX_PATH+1]; HKEY hkey, appkey = 0; - + buffer[MAX_PATH]='\0'; - + if (RegCreateKeyExA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\dsound", 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL )) { @@ -356,10 +356,10 @@ inline static void setup_dsound_options(void) /* get options */ - if (!get_config_key( hkey, appkey, "EmulDriver", buffer, MAX_PATH )) + if (!get_config_key( hkey, appkey, "EmulDriver", buffer, MAX_PATH )) ds_emuldriver = strcmp(buffer, "N"); - if (!get_config_key( hkey, appkey, "HELmargin", buffer, MAX_PATH )) + if (!get_config_key( hkey, appkey, "HELmargin", buffer, MAX_PATH )) ds_hel_margin = atoi(buffer); if (!get_config_key( hkey, appkey, "HELqueue", buffer, MAX_PATH )) @@ -376,10 +376,10 @@ inline static void setup_dsound_options(void) if (ds_emuldriver != DS_EMULDRIVER ) WARN("ds_emuldriver = %d (default=%d)\n",ds_emuldriver, DS_EMULDRIVER); - if (ds_hel_margin != DS_HEL_MARGIN ) + if (ds_hel_margin != DS_HEL_MARGIN ) WARN("ds_hel_margin = %d (default=%d)\n",ds_hel_margin, DS_HEL_MARGIN ); if (ds_hel_queue != DS_HEL_QUEUE ) - WARN("ds_hel_queue = %d (default=%d)\n",ds_hel_queue, DS_HEL_QUEUE ); + WARN("ds_hel_queue = %d (default=%d)\n",ds_hel_queue, DS_HEL_QUEUE ); if (ds_snd_queue_max != DS_SND_QUEUE_MAX) WARN("ds_snd_queue_max = %d (default=%d)\n",ds_snd_queue_max ,DS_SND_QUEUE_MAX); if (ds_snd_queue_min != DS_SND_QUEUE_MIN) @@ -391,7 +391,7 @@ inline static void setup_dsound_options(void) /*************************************************************************** - * DirectSoundEnumerateA [DSOUND.2] + * DirectSoundEnumerateA [DSOUND.2] * * Enumerate all DirectSound drivers installed in the system * @@ -406,7 +406,7 @@ HRESULT WINAPI DirectSoundEnumerateA( WAVEOUTCAPSA wcaps; unsigned devs, wod; - TRACE("lpDSEnumCallback = %p, lpContext = %p\n", + TRACE("lpDSEnumCallback = %p, lpContext = %p\n", lpDSEnumCallback, lpContext); devs = waveOutGetNumDevs(); @@ -422,7 +422,7 @@ HRESULT WINAPI DirectSoundEnumerateA( } /*************************************************************************** - * DirectSoundEnumerateW [DSOUND.3] + * DirectSoundEnumerateW [DSOUND.3] * * Enumerate all DirectSound drivers installed in the system * @@ -431,10 +431,10 @@ HRESULT WINAPI DirectSoundEnumerateA( * Failure: DSERR_INVALIDPARAM */ HRESULT WINAPI DirectSoundEnumerateW( - LPDSENUMCALLBACKW lpDSEnumCallback, + LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext ) { - FIXME("lpDSEnumCallback = %p, lpContext = %p: stub\n", + FIXME("lpDSEnumCallback = %p, lpContext = %p: stub\n", lpDSEnumCallback, lpContext); return DS_OK; @@ -803,7 +803,7 @@ static HRESULT WINAPI IDirectSound3DBufferImpl_SetVelocity( #endif #ifdef USE_DSOUND3D -static ICOM_VTABLE(IDirectSound3DBuffer) ds3dbvt = +static ICOM_VTABLE(IDirectSound3DBuffer) ds3dbvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /* IUnknown methods */ @@ -898,7 +898,7 @@ static int DSOUND_Create3DBuffer(IDirectSoundBufferImpl* dsb) bObuf[i * 2] = temp; bObuf[(i * 2) + 1] = temp; } - + if (wTbuf) free(wTbuf); if (bTbuf) @@ -920,7 +920,7 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_QueryInterface( TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); return E_FAIL; } - + static ULONG WINAPI IDirectSound3DListenerImpl_AddRef(LPDIRECTSOUND3DLISTENER iface) { ICOM_THIS(IDirectSound3DListenerImpl,iface); @@ -1078,7 +1078,7 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_CommitDeferredSettings( return DS_OK; } -static ICOM_VTABLE(IDirectSound3DListener) ds3dlvt = +static ICOM_VTABLE(IDirectSound3DListener) ds3dlvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE /* IUnknown methods */ @@ -1156,7 +1156,7 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions( return S_OK; } -static ICOM_VTABLE(IDirectSoundNotify) dsnvt = +static ICOM_VTABLE(IDirectSoundNotify) dsnvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirectSoundNotifyImpl_QueryInterface, @@ -1363,7 +1363,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFormat( TRACE("(formattag=0x%04x,chans=%d,samplerate=%ld," "bytespersec=%ld,blockalign=%d,bitspersamp=%d,cbSize=%d)\n", wfex->wFormatTag, wfex->nChannels, wfex->nSamplesPerSec, - wfex->nAvgBytesPerSec, wfex->nBlockAlign, + wfex->nAvgBytesPerSec, wfex->nBlockAlign, wfex->wBitsPerSample, wfex->cbSize); primarybuf->wfx.nAvgBytesPerSec = @@ -1590,7 +1590,7 @@ static DWORD WINAPI IDirectSoundBufferImpl_Release(LPDIRECTSOUNDBUFFER iface) { HeapFree(GetProcessHeap(),0,This->buffer); HeapFree(GetProcessHeap(),0,This); - + if (This == primarybuf) primarybuf = NULL; @@ -1651,7 +1651,7 @@ static DWORD DSOUND_CalcPlayPosition(IDirectSoundBufferImpl *This, static HRESULT WINAPI IDirectSoundBufferImpl_GetCurrentPosition( LPDIRECTSOUNDBUFFER iface,LPDWORD playpos,LPDWORD writepos ) { - HRESULT hres; + HRESULT hres; ICOM_THIS(IDirectSoundBufferImpl,iface); TRACE("(%p,%p,%p)\n",This,playpos,writepos); if (This->hwbuf) { @@ -2004,7 +2004,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetCaps( ) { ICOM_THIS(IDirectSoundBufferImpl,iface); TRACE("(%p)->(%p)\n",This,caps); - + if (caps == NULL) return DSERR_INVALIDPARAM; @@ -2162,7 +2162,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_QueryInterface( return E_FAIL; } -static ICOM_VTABLE(IDirectSoundBuffer) dsbvt = +static ICOM_VTABLE(IDirectSoundBuffer) dsbvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirectSoundBufferImpl_QueryInterface, @@ -2213,10 +2213,10 @@ static HRESULT WINAPI IDirectSoundImpl_CreateSoundBuffer( HRESULT err = DS_OK; TRACE("(%p,%p,%p,%p)\n",This,dsbd,ippdsb,lpunk); - + if ((This == NULL) || (dsbd == NULL) || (ippdsb == NULL)) return DSERR_INVALIDPARAM; - + if (TRACE_ON(dsound)) { TRACE("(structsize=%ld)\n",dsbd->dwSize); TRACE("(flags=0x%08lx:\n",dsbd->dwFlags); @@ -2232,7 +2232,7 @@ static HRESULT WINAPI IDirectSoundImpl_CreateSoundBuffer( TRACE("(formattag=0x%04x,chans=%d,samplerate=%ld," "bytespersec=%ld,blockalign=%d,bitspersamp=%d,cbSize=%d)\n", wfex->wFormatTag, wfex->nChannels, wfex->nSamplesPerSec, - wfex->nAvgBytesPerSec, wfex->nBlockAlign, + wfex->nAvgBytesPerSec, wfex->nBlockAlign, wfex->wBitsPerSample, wfex->cbSize); if (dsbd->dwFlags & DSBCAPS_PRIMARYBUFFER) { @@ -2361,7 +2361,7 @@ static HRESULT WINAPI IDirectSoundImpl_CreateSoundBuffer( *ippdsb = NULL; return err; } - + #ifdef USE_DSOUND3D if (dsbd->dwFlags & DSBCAPS_CTRL3D) { IDirectSound3DBufferImpl *ds3db; @@ -2520,7 +2520,7 @@ static ULONG WINAPI IDirectSoundImpl_Release(LPDIRECTSOUND iface) { IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER)primarybuf); if (This->buffers) { - for( i=0;inrofbuffers;i++) + for( i=0;inrofbuffers;i++) IDirectSoundBuffer_Release((LPDIRECTSOUNDBUFFER)This->buffers[i]); } @@ -2574,9 +2574,9 @@ static HRESULT WINAPI IDirectSoundImpl_QueryInterface( This->listener->ref = 1; ICOM_VTBL(This->listener) = &ds3dlvt; *ppobj = (LPVOID)This->listener; - IDirectSound3DListener_AddRef((LPDIRECTSOUND3DLISTENER)*ppobj); + IDirectSound3DListener_AddRef((LPDIRECTSOUND3DLISTENER)*ppobj); - This->listener->dsb = NULL; + This->listener->dsb = NULL; This->listener->ds3dl.dwSize = sizeof(DS3DLISTENER); This->listener->ds3dl.vPosition.u1.x = 0.0; @@ -2631,7 +2631,7 @@ static HRESULT WINAPI IDirectSoundImpl_Initialize( return DS_OK; } -static ICOM_VTABLE(IDirectSound) dsvt = +static ICOM_VTABLE(IDirectSound) dsvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDirectSoundImpl_QueryInterface, @@ -2712,7 +2712,7 @@ static inline INT16 cvtU8toS16(BYTE byte) static inline BYTE cvtS16toU8(INT16 word) { BYTE b = (word + 32768) >> 8; - + return b; } @@ -2759,7 +2759,7 @@ static inline void cp_fields(const IDirectSoundBufferImpl *dsb, BYTE *ibuf, BYTE *(((INT16 *)obuf) + 1) = fr; return; } - } + } if (primarybuf->wfx.nChannels == 1) { fl = (fl + fr) >> 1; if (primarybuf->wfx.wBitsPerSample == 8) { @@ -2799,7 +2799,7 @@ static INT DSOUND_MixerNorm(IDirectSoundBufferImpl *dsb, BYTE *buf, INT len) } return len; } - + /* Check for same sample rate */ if (dsb->freq == primarybuf->wfx.nSamplesPerSec) { TRACE("(%p) Same sample rate %ld = primary %ld\n", dsb, @@ -2813,7 +2813,7 @@ static INT DSOUND_MixerNorm(IDirectSoundBufferImpl *dsb, BYTE *buf, INT len) if (ibp >= (BYTE *)(dsb->buffer + dsb->buflen)) ibp = dsb->buffer; /* wrap */ } - return (ilen); + return (ilen); } /* Mix in different sample rates */ @@ -2850,7 +2850,7 @@ static void DSOUND_MixerVol(IDirectSoundBufferImpl *dsb, BYTE *buf, INT len) INT i, inc = primarybuf->wfx.wBitsPerSample >> 3; BYTE *bpc = buf; INT16 *bps = (INT16 *) buf; - + TRACE("(%p) left = %lx, right = %lx\n", dsb, dsb->volpan.dwTotalLeftAmpFactor, dsb->volpan.dwTotalRightAmpFactor); if ((!(dsb->dsbd.dwFlags & DSBCAPS_CTRLPAN) || (dsb->volpan.lPan == 0)) && @@ -2886,7 +2886,7 @@ static void DSOUND_MixerVol(IDirectSoundBufferImpl *dsb, BYTE *buf, INT len) /* Very ugly! */ FIXME("MixerVol had a nasty error\n"); } - } + } } #ifdef USE_DSOUND3D @@ -3015,7 +3015,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO } dsb->buf_mixpos += ilen; - + if (dsb->buf_mixpos >= dsb->buflen) { if (!(dsb->playflags & DSBPLAY_LOOPING)) { dsb->state = STATE_STOPPED; @@ -3309,7 +3309,7 @@ static DWORD DSOUND_MixToPrimary(DWORD playpos, DWORD writepos, DWORD mixlen, BO LeaveCriticalSection(&(dsb->lock)); } } - + return maxlen; } @@ -3545,7 +3545,7 @@ static void DSOUND_PerformMix(void) if (primarybuf->state == STATE_STARTING) { DSOUND_PrimaryPlay(primarybuf); primarybuf->state = STATE_PLAYING; - } + } else if (primarybuf->state == STATE_STOPPING) { DSOUND_PrimaryStop(primarybuf); primarybuf->state = STATE_STOPPED; @@ -3618,7 +3618,7 @@ HRESULT WINAPI DirectSoundCreate(REFGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pU PIDSDRIVER drv = NULL; WAVEOUTCAPSA wcaps; unsigned wod, wodn; - HRESULT err = DS_OK; + HRESULT err = DS_OK; if (lpGUID) TRACE("(%p,%p,%p)\n",lpGUID,ippDS,pUnkOuter); @@ -3659,11 +3659,11 @@ HRESULT WINAPI DirectSoundCreate(REFGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pU (*ippDS)->driver = drv; (*ippDS)->fraglen = 0; - (*ippDS)->priolevel = DSSCL_NORMAL; + (*ippDS)->priolevel = DSSCL_NORMAL; (*ippDS)->nrofbuffers = 0; (*ippDS)->buffers = NULL; - (*ippDS)->primary = NULL; - (*ippDS)->listener = NULL; + (*ippDS)->primary = NULL; + (*ippDS)->listener = NULL; (*ippDS)->prebuf = ds_snd_queue_max; @@ -3695,10 +3695,10 @@ HRESULT WINAPI DirectSoundCreate(REFGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pU err = DSERR_ALLOCATED; /* if this device is busy try the next one */ - while((err == DSERR_ALLOCATED) && + while((err == DSERR_ALLOCATED) && ((*ippDS)->drvdesc.dnDevNode < wodn)) { - err = mmErr(waveOutOpen(&((*ippDS)->hwo), + err = mmErr(waveOutOpen(&((*ippDS)->hwo), (*ippDS)->drvdesc.dnDevNode, &((*ippDS)->wfx), (DWORD)DSOUND_callback, (DWORD)(*ippDS), CALLBACK_FUNCTION | WAVE_DIRECTSOUND)); @@ -3706,7 +3706,7 @@ HRESULT WINAPI DirectSoundCreate(REFGUID lpGUID,LPDIRECTSOUND *ppDS,IUnknown *pU } (*ippDS)->drvdesc.dnDevNode--; /* take away last increment */ - + } if (drv && (err == DS_OK)) @@ -3845,7 +3845,7 @@ HRESULT WINAPI DirectSoundCaptureEnumerateW( { FIXME("(%p,%p):stub\n", lpDSEnumCallback, lpContext ); return DS_OK; -} +} static HRESULT DSOUND_CreateDirectSoundCapture( LPVOID* ppobj ) @@ -3922,7 +3922,7 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer( LPDIRECTSOUNDCAPTURE iface, LPCDSCBUFFERDESC lpcDSCBufferDesc, - LPDIRECTSOUNDCAPTUREBUFFER* lplpDSCaptureBuffer, + LPDIRECTSOUNDCAPTUREBUFFER* lplpDSCaptureBuffer, LPUNKNOWN pUnk ) { HRESULT hr; @@ -3975,7 +3975,7 @@ static ICOM_VTABLE(IDirectSoundCapture) dscvt = /* IDirectSoundCapture methods */ IDirectSoundCaptureImpl_CreateCaptureBuffer, IDirectSoundCaptureImpl_GetCaps, - IDirectSoundCaptureImpl_Initialize + IDirectSoundCaptureImpl_Initialize }; static HRESULT @@ -4081,8 +4081,8 @@ IDirectSoundCaptureBufferImpl_GetCurrentPosition( static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFormat( LPDIRECTSOUNDCAPTUREBUFFER iface, - LPWAVEFORMATEX lpwfxFormat, - DWORD dwSizeAllocated, + LPWAVEFORMATEX lpwfxFormat, + DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten ) { ICOM_THIS(IDirectSoundCaptureBufferImpl,iface); @@ -4107,7 +4107,7 @@ IDirectSoundCaptureBufferImpl_GetStatus( static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Initialize( LPDIRECTSOUNDCAPTUREBUFFER iface, - LPDIRECTSOUNDCAPTURE lpDSC, + LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc ) { ICOM_THIS(IDirectSoundCaptureBufferImpl,iface); @@ -4120,12 +4120,12 @@ IDirectSoundCaptureBufferImpl_Initialize( static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Lock( LPDIRECTSOUNDCAPTUREBUFFER iface, - DWORD dwReadCusor, - DWORD dwReadBytes, - LPVOID* lplpvAudioPtr1, - LPDWORD lpdwAudioBytes1, - LPVOID* lplpvAudioPtr2, - LPDWORD lpdwAudioBytes2, + DWORD dwReadCusor, + DWORD dwReadBytes, + LPVOID* lplpvAudioPtr1, + LPDWORD lpdwAudioBytes1, + LPVOID* lplpvAudioPtr2, + LPDWORD lpdwAudioBytes2, DWORD dwFlags ) { ICOM_THIS(IDirectSoundCaptureBufferImpl,iface); @@ -4160,9 +4160,9 @@ IDirectSoundCaptureBufferImpl_Stop( LPDIRECTSOUNDCAPTUREBUFFER iface ) static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Unlock( LPDIRECTSOUNDCAPTUREBUFFER iface, - LPVOID lpvAudioPtr1, - DWORD dwAudioBytes1, - LPVOID lpvAudioPtr2, + LPVOID lpvAudioPtr1, + DWORD dwAudioBytes1, + LPVOID lpvAudioPtr2, DWORD dwAudioBytes2 ) { ICOM_THIS(IDirectSoundCaptureBufferImpl,iface); @@ -4203,7 +4203,7 @@ typedef struct DWORD ref; } IClassFactoryImpl; -static HRESULT WINAPI +static HRESULT WINAPI DSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { ICOM_THIS(IClassFactoryImpl,iface); diff --git a/dlls/gdi/bidi16.c b/dlls/gdi/bidi16.c index cebd7d264fe..06abc133d7d 100644 --- a/dlls/gdi/bidi16.c +++ b/dlls/gdi/bidi16.c @@ -38,9 +38,9 @@ LONG WINAPI RawExtTextOut16(void) { FIXME("stub (no prototype)\n"); return 0; } /*********************************************************************** * RawGetTextExtent (GDI.532) */ -LONG WINAPI RawGetTextExtent16(HDC16 hdc, LPCSTR lpszString, INT16 cbString ) { - FIXME("(%04hx, %p, %hd): stub\n", hdc, lpszString, cbString); - return 0; +LONG WINAPI RawGetTextExtent16(HDC16 hdc, LPCSTR lpszString, INT16 cbString ) { + FIXME("(%04hx, %p, %hd): stub\n", hdc, lpszString, cbString); + return 0; } /*********************************************************************** diff --git a/dlls/gdi/driver.c b/dlls/gdi/driver.c index 12f72fa218e..3dff1c76c0e 100644 --- a/dlls/gdi/driver.c +++ b/dlls/gdi/driver.c @@ -366,12 +366,12 @@ INT WINAPI GDI_CallDevInstall16( FARPROC16 lpfnDevInstallProc, HWND hWnd, * @ [GDI32.101] * * This should load the correct driver for lpszDevice and calls this driver's - * ExtDeviceModePropSheet proc. + * ExtDeviceModePropSheet proc. * - * Note: The driver calls a callback routine for each property sheet page; these + * Note: The driver calls a callback routine for each property sheet page; these * pages are supposed to be filled into the structure pointed to by lpPropSheet. * The layout of this structure is: - * + * * struct * { * DWORD nPages; diff --git a/dlls/gdi/enhmfdrv/enhmetafiledrv.h b/dlls/gdi/enhmfdrv/enhmetafiledrv.h index 30f6df3e310..ab2ef5446fc 100644 --- a/dlls/gdi/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi/enhmfdrv/enhmetafiledrv.h @@ -33,7 +33,7 @@ typedef struct DC *dc; ENHMETAHEADER *emh; /* Pointer to enhanced metafile header */ UINT nextHandle; /* Next handle number */ - HFILE hFile; /* HFILE for disk based MetaFile */ + HFILE hFile; /* HFILE for disk based MetaFile */ } EMFDRV_PDEVICE; diff --git a/dlls/gdi/enhmfdrv/graphics.c b/dlls/gdi/enhmfdrv/graphics.c index 997f3abf518..32cc2d3a159 100644 --- a/dlls/gdi/enhmfdrv/graphics.c +++ b/dlls/gdi/enhmfdrv/graphics.c @@ -138,7 +138,7 @@ EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, bounds.top = min(yinterStart, yinterEnd); bounds.right = max(xinterStart, xinterEnd); bounds.bottom = max(yinterStart, yinterEnd); - + for(i = 0; i <= 8; i++) { if(i * M_PI / 2 < angleStart) /* loop until we're past start */ continue; @@ -148,7 +148,7 @@ EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, /* the arc touches the rectangle at the start of quadrant i, so adjust BBox to reflect this. */ - switch(i % 4) { + switch(i % 4) { case 0: bounds.right = right; break; @@ -283,7 +283,7 @@ EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) /*********************************************************************** * EMFDRV_RoundRect */ -BOOL +BOOL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ) { @@ -343,7 +343,7 @@ EMFDRV_Polylinegon( PHYSDEV dev, const POINT* pt, INT count, DWORD iType ) emr = HeapAlloc( GetProcessHeap(), 0, size ); emr->emr.iType = iType; emr->emr.nSize = size; - + emr->rclBounds.left = emr->rclBounds.right = pt[0].x; emr->rclBounds.top = emr->rclBounds.bottom = pt[0].y; @@ -394,7 +394,7 @@ EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) * * Helper for EMFDRV_PolyPoly{line|gon} */ -static BOOL +static BOOL EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys, DWORD iType) { @@ -418,8 +418,8 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po pts++; } } - - size = sizeof(EMRPOLYPOLYLINE) + (polys - 1) * sizeof(DWORD) + + + size = sizeof(EMRPOLYPOLYLINE) + (polys - 1) * sizeof(DWORD) + (cptl - 1) * sizeof(POINTL); emr = HeapAlloc( GetProcessHeap(), 0, size ); @@ -441,7 +441,7 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po /********************************************************************** * EMFDRV_PolyPolyline */ -BOOL +BOOL EMFDRV_PolyPolyline(PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polys) { return EMFDRV_PolyPolylinegon( dev, pt, (INT *)counts, polys, @@ -451,7 +451,7 @@ EMFDRV_PolyPolyline(PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD pol /********************************************************************** * EMFDRV_PolyPolygon */ -BOOL +BOOL EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys ) { return EMFDRV_PolyPolylinegon( dev, pt, counts, polys, EMR_POLYPOLYGON ); @@ -461,7 +461,7 @@ EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys /********************************************************************** * EMFDRV_ExtFloodFill */ -BOOL +BOOL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) { EMREXTFLOODFILL emr; @@ -503,7 +503,7 @@ BOOL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) emr->rclBounds.bottom = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.bottom - 1; emr->cbRgnData = rgnsize; emr->ihBrush = index; - + ret = EMFDRV_WriteRecord( dev, &emr->emr ); if(ret) EMFDRV_UpdateBBox( dev, &emr->rclBounds ); @@ -571,7 +571,7 @@ static BOOL EMFDRV_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType ) emr->rclBounds.right = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.right - 1; emr->rclBounds.bottom = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.bottom - 1; emr->cbRgnData = rgnsize; - + ret = EMFDRV_WriteRecord( dev, &emr->emr ); if(ret) EMFDRV_UpdateBBox( dev, &emr->rclBounds ); diff --git a/dlls/gdi/enhmfdrv/init.c b/dlls/gdi/enhmfdrv/init.c index a50243429ad..12a10052d58 100644 --- a/dlls/gdi/enhmfdrv/init.c +++ b/dlls/gdi/enhmfdrv/init.c @@ -223,11 +223,11 @@ int EMFDRV_AddHandleDC( PHYSDEV dev ) /********************************************************************** * CreateEnhMetaFileA (GDI32.@) */ -HDC WINAPI CreateEnhMetaFileA( +HDC WINAPI CreateEnhMetaFileA( HDC hdc, /* [in] optional reference DC */ LPCSTR filename, /* [in] optional filename for disk metafiles */ const RECT *rect, /* [in] optional bounding rectangle */ - LPCSTR description /* [in] optional description */ + LPCSTR description /* [in] optional description */ ) { LPWSTR filenameW = NULL; @@ -266,7 +266,7 @@ HDC WINAPI CreateEnhMetaFileW( HDC hdc, /* [in] optional reference DC */ LPCWSTR filename, /* [in] optional filename for disk metafiles */ const RECT* rect, /* [in] optional bounding rectangle */ - LPCWSTR description /* [in] optional description */ + LPCWSTR description /* [in] optional description */ ) { HDC ret; @@ -335,7 +335,7 @@ HDC WINAPI CreateEnhMetaFileW( physDev->emh->offDescription = length ? sizeof(ENHMETAHEADER) : 0; physDev->emh->nPalEntries = 0; /* I guess this should start at 0 */ - + /* Size in pixels */ physDev->emh->szlDevice.cx = GetDeviceCaps( hRefDC, HORZRES ); physDev->emh->szlDevice.cy = GetDeviceCaps( hRefDC, VERTRES ); @@ -366,7 +366,7 @@ HDC WINAPI CreateEnhMetaFileW( if( !hdc ) DeleteDC( hRefDC ); - + return ret; } diff --git a/dlls/gdi/enhmfdrv/objects.c b/dlls/gdi/enhmfdrv/objects.c index b516cc552d6..938e57ad326 100644 --- a/dlls/gdi/enhmfdrv/objects.c +++ b/dlls/gdi/enhmfdrv/objects.c @@ -86,7 +86,7 @@ DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) emr->cbBmi = biSize; emr->offBits = sizeof(EMRCREATEDIBPATTERNBRUSHPT) + biSize; memcpy((char *)emr + sizeof(EMRCREATEDIBPATTERNBRUSHPT), info, - biSize + bmSize ); + biSize + bmSize ); if(!EMFDRV_WriteRecord( dev, &emr->emr )) index = 0; diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c index 418ba3f8434..016384a3432 100644 --- a/dlls/gdi/freetype.c +++ b/dlls/gdi/freetype.c @@ -244,7 +244,7 @@ static BOOL AddFontFileToList(char *file) StyleW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, ft_face->style_name, -1, StyleW, len); - + for(insertface = &family->FirstFace; *insertface; insertface = &(*insertface)->next) { if(!strcmpW((*insertface)->StyleName, StyleW)) { @@ -337,7 +337,7 @@ static void split_subst_info(NameCs *nc, LPSTR str) nc->name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, str, -1, nc->name, len); } - + static void LoadSubstList(void) { FontSubst *psub, **ppsub; @@ -491,7 +491,7 @@ BOOL WineEngInit(void) <= 2.0.3 has FT_Sqrt64 */ goto sym_not_found; } - + if(pFT_Init_FreeType(&library) != 0) { ERR("Can't init FreeType library\n"); wine_dlclose(ft_handle, NULL, 0); @@ -685,7 +685,7 @@ static LONG load_VDMX(GdiFont font, LONG height) TRACE("numRecs = %d numRatios = %d\n", numRecs, numRatios); for(i = 0; i < numRatios; i++) { Ratios ratio; - + offset = (3 * 2) + (i * sizeof(Ratios)); WineEngGetFontData(font, MS_VDMX_TAG, offset, &ratio, sizeof(Ratios)); offset = -1; @@ -695,12 +695,12 @@ static LONG load_VDMX(GdiFont font, LONG height) if(ratio.bCharSet != 1) continue; - if((ratio.xRatio == 0 && + if((ratio.xRatio == 0 && ratio.yStartRatio == 0 && ratio.yEndRatio == 0) || - (devXRatio == ratio.xRatio && + (devXRatio == ratio.xRatio && devYRatio >= ratio.yStartRatio && - devYRatio <= ratio.yEndRatio)) + devYRatio <= ratio.yEndRatio)) { offset = (3 * 2) + (numRatios * 4) + (i * 2); WineEngGetFontData(font, MS_VDMX_TAG, offset, tmp, 2); @@ -767,10 +767,10 @@ static LONG load_VDMX(GdiFont font, LONG height) for(i = 0; i < recs; i++) { USHORT yPelHeight; yPelHeight = GET_BE_WORD(&vTable[i * 6]); - + if(yPelHeight > ppem) break; /* failed */ - + if(yPelHeight == ppem) { font->yMax = GET_BE_WORD(&vTable[(i * 6) + 2]); font->yMin = GET_BE_WORD(&vTable[(i * 6) + 4]); @@ -930,7 +930,7 @@ static void DumpGdiFontList(void) for(gdiFont = GdiFontList; gdiFont; gdiFont = gdiFont->next) { FONTOBJ *font = GDI_GetObjPtr(gdiFont->hfont, FONT_MAGIC); LOGFONTW *plf = &font->logfont; - TRACE("gdiFont=%p hfont=%x (%s)\n", + TRACE("gdiFont=%p hfont=%x (%s)\n", gdiFont, gdiFont->hfont, debugstr_w(plf->lfFaceName)); GDI_ReleaseObj(gdiFont->hfont); } @@ -950,14 +950,14 @@ BOOL WineEngDestroyFontInstance(HFONT handle) TRACE("destroying hfont=%x\n", handle); if(TRACE_ON(font)) DumpGdiFontList(); - + for(gdiFont = GdiFontList; gdiFont; gdiFont = gdiFont->next) { if(gdiFont->hfont == handle) { if(gdiPrev) gdiPrev->next = gdiFont->next; else GdiFontList = gdiFont->next; - + free_font(gdiFont); return TRUE; } @@ -1106,7 +1106,7 @@ DWORD WineEngEnumFonts(LPLOGFONTW plf, DEVICEFONTENUMPROC proc, csi.ciCharset = DEFAULT_CHARSET; if(i == 31) csi.ciCharset = SYMBOL_CHARSET; if(csi.ciCharset != DEFAULT_CHARSET) { - elf.elfLogFont.lfCharSet = ntm.ntmTm.tmCharSet = + elf.elfLogFont.lfCharSet = ntm.ntmTm.tmCharSet = csi.ciCharset; if(ElfScriptsW[i]) strcpyW(elf.elfScript, ElfScriptsW[i]); @@ -1219,7 +1219,7 @@ DWORD WineEngGetGlyphOutline(GdiFont font, UINT glyph, UINT format, font->gm[glyph_index].bbx = (right - left) >> 6; if(font->orientation == 0) { - top = (ft_face->glyph->metrics.horiBearingY + 63) & -64;; + top = (ft_face->glyph->metrics.horiBearingY + 63) & -64; bottom = (ft_face->glyph->metrics.horiBearingY - ft_face->glyph->metrics.height) & -64; lpgm->gmCellIncX = font->gm[glyph_index].adv; @@ -1271,7 +1271,7 @@ DWORD WineEngGetGlyphOutline(GdiFont font, UINT glyph, UINT format, if(format == GGO_METRICS) return 1; /* FIXME */ - + if(ft_face->glyph->format != ft_glyph_format_outline) { FIXME("loaded a bitmap\n"); return GDI_ERROR; @@ -1437,7 +1437,7 @@ BOOL WineEngGetTextMetrics(GdiFont font, LPTEXTMETRICW ptm) FT_Fixed x_scale, y_scale; TRACE("font=%p, ptm=%p\n", font, ptm); - + x_scale = ft_face->size->metrics.x_scale; y_scale = ft_face->size->metrics.y_scale; @@ -1554,7 +1554,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont font, UINT cbSize, TRACE("font=%p\n", font); needed = sizeof(*potm); - + lenfam = MultiByteToWideChar(CP_ACP, 0, ft_face->family_name, -1, NULL, 0) * sizeof(WCHAR); family_nameW = HeapAlloc(GetProcessHeap(), 0, lenfam); @@ -1610,7 +1610,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont font, UINT cbSize, potm->otmSize = needed; WineEngGetTextMetrics(font, &potm->otmTextMetrics); - + potm->otmFiller = 0; memcpy(&potm->otmPanoseNumber, pOS2->panose, PANOSE_COUNT); potm->otmfsSelection = pOS2->fsSelection; @@ -1659,7 +1659,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont font, UINT cbSize, strcatW((WCHAR*)cp, spaceW); strcatW((WCHAR*)cp, style_nameW); cp += lenfam + lensty; - } else + } else cp += lenfam; potm->otmpFullName = (LPSTR)(cp - (char*)potm); strcpyW((WCHAR*)cp, family_nameW); @@ -1714,7 +1714,7 @@ BOOL WineEngGetTextExtentPoint(GdiFont font, LPCWSTR wstr, INT count, size->cx = 0; WineEngGetTextMetrics(font, &tm); size->cy = tm.tmHeight; - + for(idx = 0; idx < count; idx++) { WineEngGetGlyphOutline(font, wstr[idx], GGO_METRICS, &gm, 0, NULL, NULL); @@ -1741,7 +1741,7 @@ BOOL WineEngGetTextExtentPointI(GdiFont font, const WORD *indices, INT count, size->cx = 0; WineEngGetTextMetrics(font, &tm); size->cy = tm.tmHeight; - + for(idx = 0; idx < count; idx++) { WineEngGetGlyphOutline(font, indices[idx], GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, diff --git a/dlls/gdi/mfdrv/bitblt.c b/dlls/gdi/mfdrv/bitblt.c index 9c31a3356e0..d5730ca7cc0 100644 --- a/dlls/gdi/mfdrv/bitblt.c +++ b/dlls/gdi/mfdrv/bitblt.c @@ -73,7 +73,7 @@ BOOL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height, *(mr->rdParm + 5) = yDst; *(mr->rdParm + 6) = xDst; ret = MFDRV_WriteRecord( devDst, mr, mr->rdSize * 2); - } + } else ret = FALSE; HeapFree( GetProcessHeap(), 0, mr); @@ -101,15 +101,15 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, BITMAP16 BM; METAFILEDRV_PDEVICE *physDevSrc = (METAFILEDRV_PDEVICE *)devSrc; DC *dcSrc = physDevSrc->dc; -#ifdef STRETCH_VIA_DIB +#ifdef STRETCH_VIA_DIB LPBITMAPINFOHEADER lpBMI; WORD nBPP; -#endif +#endif GetObject16(dcSrc->hBitmap, sizeof(BITMAP16), &BM); #ifdef STRETCH_VIA_DIB nBPP = BM.bmPlanes * BM.bmBitsPixel; - len = sizeof(METARECORD) + 10 * sizeof(INT16) - + sizeof(BITMAPINFOHEADER) + (nBPP != 24 ? 1 << nBPP: 0) * sizeof(RGBQUAD) + len = sizeof(METARECORD) + 10 * sizeof(INT16) + + sizeof(BITMAPINFOHEADER) + (nBPP != 24 ? 1 << nBPP: 0) * sizeof(RGBQUAD) + ((BM.bmWidth * nBPP + 31) / 32) * 4 * BM.bmHeight; if (!(mr = HeapAlloc( GetProcessHeap(), 0, len))) return FALSE; @@ -146,7 +146,7 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, TRACE("len = %ld rop=%lx \n",len,rop); if (GetBitmapBits( dcSrc->hBitmap, BM.bmWidthBytes * BM.bmHeight, mr->rdParm +15)) -#endif +#endif { mr->rdSize = len / sizeof(INT16); *(mr->rdParm) = LOWORD(rop); @@ -160,7 +160,7 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, *(mr->rdParm + 8) = yDst; *(mr->rdParm + 9) = xDst; ret = MFDRV_WriteRecord( devDst, mr, mr->rdSize * 2); - } + } else ret = FALSE; HeapFree( GetProcessHeap(), 0, mr); @@ -208,7 +208,7 @@ INT MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, return heightSrc; } - + /*********************************************************************** * MFDRV_SetDIBitsToDeivce */ @@ -248,4 +248,4 @@ INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD cx, return lines; } - + diff --git a/dlls/gdi/mfdrv/graphics.c b/dlls/gdi/mfdrv/graphics.c index 54c4ad39e50..591d05ca0b5 100644 --- a/dlls/gdi/mfdrv/graphics.c +++ b/dlls/gdi/mfdrv/graphics.c @@ -49,7 +49,7 @@ MFDRV_LineTo( PHYSDEV dev, INT x, INT y ) /*********************************************************************** * MFDRV_Arc */ -BOOL +BOOL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -102,7 +102,7 @@ MFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) /*********************************************************************** * MFDRV_RoundRect */ -BOOL +BOOL MFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ) { @@ -117,7 +117,7 @@ COLORREF MFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) { return MFDRV_MetaParam4(dev, META_SETPIXEL, x, y,HIWORD(color), - LOWORD(color)); + LOWORD(color)); } @@ -130,7 +130,7 @@ static BOOL MFDRV_MetaPoly(PHYSDEV dev, short func, LPPOINT16 pt, short count) DWORD len; METARECORD *mr; - len = sizeof(METARECORD) + (count * 4); + len = sizeof(METARECORD) + (count * 4); if (!(mr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len ))) return FALSE; @@ -157,7 +157,7 @@ MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count ) pt16 = (LPPOINT16)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count ); if(!pt16) return FALSE; for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i])); - ret = MFDRV_MetaPoly(dev, META_POLYLINE, pt16, count); + ret = MFDRV_MetaPoly(dev, META_POLYLINE, pt16, count); HeapFree( GetProcessHeap(), 0, pt16 ); return ret; @@ -177,7 +177,7 @@ MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) pt16 = (LPPOINT16) HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count ); if(!pt16) return FALSE; for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i])); - ret = MFDRV_MetaPoly(dev, META_POLYGON, pt16, count); + ret = MFDRV_MetaPoly(dev, META_POLYGON, pt16, count); HeapFree( GetProcessHeap(), 0, pt16 ); return ret; @@ -187,7 +187,7 @@ MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) /********************************************************************** * MFDRV_PolyPolygon */ -BOOL +BOOL MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygons) { int i,j; @@ -196,7 +196,7 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon BOOL ret; for (i=0;irdParm[0] = 0; mr->rdParm[1] = 6; mr->rdParm[2] = 0x1234; @@ -297,10 +297,10 @@ static INT16 MFDRV_CreateRegion(PHYSDEV dev, HRGN hrgn) mr->rdParm[10] = rgndata->rdh.rcBound.bottom; mr->rdFunction = META_CREATEREGION; mr->rdSize = len / 2; - ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2 ); + ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2 ); HeapFree( GetProcessHeap(), 0, mr ); HeapFree( GetProcessHeap(), 0, rgndata ); - if(!ret) + if(!ret) { WARN("MFDRV_WriteRecord failed\n"); return -1; diff --git a/dlls/gdi/mfdrv/init.c b/dlls/gdi/mfdrv/init.c index cb6fd19d242..ad952db2d2a 100644 --- a/dlls/gdi/mfdrv/init.c +++ b/dlls/gdi/mfdrv/init.c @@ -149,7 +149,7 @@ static DC *MFDRV_AllocMetaFile(void) { DC *dc; METAFILEDRV_PDEVICE *physDev; - + if (!(dc = DC_AllocDC( &MFDRV_Funcs ))) return NULL; dc->header.wMagic = METAFILE_DC_MAGIC; @@ -209,7 +209,7 @@ static BOOL MFDRV_DeleteDC( PHYSDEV dev ) * RETURNS * A handle to the metafile DC if successful, NULL on failure. */ -HDC16 WINAPI CreateMetaFile16( +HDC16 WINAPI CreateMetaFile16( LPCSTR filename /* [in] Filename of disk metafile */ ) { @@ -222,7 +222,7 @@ HDC16 WINAPI CreateMetaFile16( if (!(dc = MFDRV_AllocMetaFile())) return 0; physDev = (METAFILEDRV_PDEVICE *)dc->physDev; - + if (filename) /* disk based metafile */ { physDev->mh->mtType = METAFILE_DISK; @@ -243,7 +243,7 @@ HDC16 WINAPI CreateMetaFile16( } else /* memory based metafile */ physDev->mh->mtType = METAFILE_MEMORY; - + TRACE("returning %04x\n", dc->hSelf); ret = dc->hSelf; GDI_ReleaseObj( dc->hSelf ); @@ -253,7 +253,7 @@ HDC16 WINAPI CreateMetaFile16( /********************************************************************** * CreateMetaFileA (GDI32.@) */ -HDC WINAPI CreateMetaFileA( +HDC WINAPI CreateMetaFileA( LPCSTR filename /* [in] Filename of disk metafile */ ) { @@ -284,11 +284,11 @@ HDC WINAPI CreateMetaFileW(LPCWSTR filename) /********************************************************************** * MFDRV_CloseMetaFile */ -static DC *MFDRV_CloseMetaFile( HDC hdc ) +static DC *MFDRV_CloseMetaFile( HDC hdc ) { DC *dc; METAFILEDRV_PDEVICE *physDev; - + TRACE("(%04x)\n", hdc ); if (!(dc = (DC *) GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) return 0; @@ -302,7 +302,7 @@ static DC *MFDRV_CloseMetaFile( HDC hdc ) { MFDRV_DeleteDC( dc->physDev ); return 0; - } + } if (physDev->mh->mtType == METAFILE_DISK) /* disk based metafile */ { @@ -328,7 +328,7 @@ static DC *MFDRV_CloseMetaFile( HDC hdc ) * CloseMetaFile (GDI.126) * CloseMetaFile16 (GDI32.@) */ -HMETAFILE16 WINAPI CloseMetaFile16( +HMETAFILE16 WINAPI CloseMetaFile16( HDC16 hdc /* [in] Metafile DC to close */ ) { @@ -356,7 +356,7 @@ HMETAFILE16 WINAPI CloseMetaFile16( * RETURNS * Handle of newly created metafile on success, NULL on failure. */ -HMETAFILE WINAPI CloseMetaFile( +HMETAFILE WINAPI CloseMetaFile( HDC hdc /* [in] Metafile DC to close */ ) { @@ -420,7 +420,7 @@ BOOL MFDRV_MetaParam0(PHYSDEV dev, short func) { char buffer[8]; METARECORD *mr = (METARECORD *)&buffer; - + mr->rdSize = 3; mr->rdFunction = func; return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2); @@ -434,7 +434,7 @@ BOOL MFDRV_MetaParam1(PHYSDEV dev, short func, short param1) { char buffer[8]; METARECORD *mr = (METARECORD *)&buffer; - + mr->rdSize = 4; mr->rdFunction = func; *(mr->rdParm) = param1; @@ -449,7 +449,7 @@ BOOL MFDRV_MetaParam2(PHYSDEV dev, short func, short param1, short param2) { char buffer[10]; METARECORD *mr = (METARECORD *)&buffer; - + mr->rdSize = 5; mr->rdFunction = func; *(mr->rdParm) = param2; @@ -462,12 +462,12 @@ BOOL MFDRV_MetaParam2(PHYSDEV dev, short func, short param1, short param2) * MFDRV_MetaParam4 */ -BOOL MFDRV_MetaParam4(PHYSDEV dev, short func, short param1, short param2, +BOOL MFDRV_MetaParam4(PHYSDEV dev, short func, short param1, short param2, short param3, short param4) { char buffer[14]; METARECORD *mr = (METARECORD *)&buffer; - + mr->rdSize = 7; mr->rdFunction = func; *(mr->rdParm) = param4; @@ -482,12 +482,12 @@ BOOL MFDRV_MetaParam4(PHYSDEV dev, short func, short param1, short param2, * MFDRV_MetaParam6 */ -BOOL MFDRV_MetaParam6(PHYSDEV dev, short func, short param1, short param2, +BOOL MFDRV_MetaParam6(PHYSDEV dev, short func, short param1, short param2, short param3, short param4, short param5, short param6) { char buffer[18]; METARECORD *mr = (METARECORD *)&buffer; - + mr->rdSize = 9; mr->rdFunction = func; *(mr->rdParm) = param6; @@ -503,13 +503,13 @@ BOOL MFDRV_MetaParam6(PHYSDEV dev, short func, short param1, short param2, /****************************************************************** * MFDRV_MetaParam8 */ -BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2, +BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2, short param3, short param4, short param5, short param6, short param7, short param8) { char buffer[22]; METARECORD *mr = (METARECORD *)&buffer; - + mr->rdSize = 11; mr->rdFunction = func; *(mr->rdParm) = param8; diff --git a/dlls/gdi/mfdrv/metafiledrv.h b/dlls/gdi/mfdrv/metafiledrv.h index f1af970b341..caca363cc36 100644 --- a/dlls/gdi/mfdrv/metafiledrv.h +++ b/dlls/gdi/mfdrv/metafiledrv.h @@ -33,7 +33,7 @@ typedef struct DC *dc; METAHEADER *mh; /* Pointer to metafile header */ UINT nextHandle; /* Next handle number */ - HFILE hFile; /* HFILE for disk based MetaFile */ + HFILE hFile; /* HFILE for disk based MetaFile */ } METAFILEDRV_PDEVICE; diff --git a/dlls/gdi/mfdrv/objects.c b/dlls/gdi/mfdrv/objects.c index 9e5f54a7c85..4c5b7c6deb0 100644 --- a/dlls/gdi/mfdrv/objects.c +++ b/dlls/gdi/mfdrv/objects.c @@ -86,7 +86,7 @@ INT16 MFDRV_CreateBrushIndirect(PHYSDEV dev, HBRUSH hBrush ) bmSize = DIB_GetDIBImageBytes(bm.bmWidth, bm.bmHeight, 1); - size = sizeof(METARECORD) + sizeof(WORD) + sizeof(BITMAPINFO) + + size = sizeof(METARECORD) + sizeof(WORD) + sizeof(BITMAPINFO) + sizeof(RGBQUAD) + bmSize; mr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); diff --git a/dlls/gdi/mfdrv/text.c b/dlls/gdi/mfdrv/text.c index 33d8792492f..b185d9cdf71 100644 --- a/dlls/gdi/mfdrv/text.c +++ b/dlls/gdi/mfdrv/text.c @@ -37,7 +37,7 @@ static BOOL MFDRV_MetaExtTextOut( PHYSDEV dev, short x, short y, UINT16 flags, BOOL ret; DWORD len; METARECORD *mr; - + if (flags && !rect) WARN("Inconsistent flags and rect\n"); len = sizeof(METARECORD) + (((count + 1) >> 1) * 2) + 2 * sizeof(short) diff --git a/dlls/gdi/printdrv.c b/dlls/gdi/printdrv.c index 273f6148240..cd17a57c0ad 100644 --- a/dlls/gdi/printdrv.c +++ b/dlls/gdi/printdrv.c @@ -1,6 +1,6 @@ -/* +/* * Implementation of some printer driver bits - * + * * Copyright 1996 John Harvey * Copyright 1998 Huw Davies * Copyright 1998 Andreas Mohr @@ -80,7 +80,7 @@ INT16 WINAPI StartDoc16( HDC16 hdc, const DOCINFO16 *lpdoc ) * StartDoc calls the STARTDOC Escape with the input data pointing to DocName * and the output data (which is used as a second input parameter).pointing at * the whole docinfo structure. This seems to be an undocumented feature of - * the STARTDOC Escape. + * the STARTDOC Escape. * * Note: we now do it the other way, with the STARTDOC Escape calling StartDoc. */ @@ -101,7 +101,7 @@ INT WINAPI StartDocA(HDC hdc, const DOCINFOA* doc) /************************************************************************* * StartDocW [GDI32.@] - * + * */ INT WINAPI StartDocW(HDC hdc, const DOCINFOW* doc) { @@ -109,7 +109,7 @@ INT WINAPI StartDocW(HDC hdc, const DOCINFOW* doc) INT ret; docA.cbSize = doc->cbSize; - docA.lpszDocName = doc->lpszDocName ? + docA.lpszDocName = doc->lpszDocName ? HEAP_strdupWtoA( GetProcessHeap(), 0, doc->lpszDocName ) : NULL; docA.lpszOutput = doc->lpszOutput ? HEAP_strdupWtoA( GetProcessHeap(), 0, doc->lpszOutput ) : NULL; @@ -312,7 +312,7 @@ INT WINAPI SetAbortProc(HDC hdc, ABORTPROC abrtprc) /* * The following function should implement a queing system */ -struct hpq +struct hpq { struct hpq *next; int tag; @@ -325,7 +325,7 @@ static struct hpq *hpqueue; * CreatePQ (GDI.230) * */ -HPQ16 WINAPI CreatePQ16(INT16 size) +HPQ16 WINAPI CreatePQ16(INT16 size) { #if 0 HGLOBAL16 hpq = 0; @@ -353,7 +353,7 @@ HPQ16 WINAPI CreatePQ16(INT16 size) * DeletePQ (GDI.235) * */ -INT16 WINAPI DeletePQ16(HPQ16 hPQ) +INT16 WINAPI DeletePQ16(HPQ16 hPQ) { return GlobalFree16((HGLOBAL16)hPQ); } @@ -362,15 +362,15 @@ INT16 WINAPI DeletePQ16(HPQ16 hPQ) * ExtractPQ (GDI.232) * */ -INT16 WINAPI ExtractPQ16(HPQ16 hPQ) -{ +INT16 WINAPI ExtractPQ16(HPQ16 hPQ) +{ struct hpq *queue, *prev, *current, *currentPrev; int key = 0, tag = -1; currentPrev = prev = NULL; queue = current = hpqueue; if (current) key = current->key; - + while (current) { currentPrev = current; @@ -387,15 +387,15 @@ INT16 WINAPI ExtractPQ16(HPQ16 hPQ) if (queue) { tag = queue->tag; - + if (prev) prev->next = queue->next; else hpqueue = queue->next; HeapFree(GetProcessHeap(), 0, queue); } - - TRACE("%x got tag %d key %d\n", hPQ, tag, key); + + TRACE("%x got tag %d key %d\n", hPQ, tag, key); return tag; } @@ -404,7 +404,7 @@ INT16 WINAPI ExtractPQ16(HPQ16 hPQ) * InsertPQ (GDI.233) * */ -INT16 WINAPI InsertPQ16(HPQ16 hPQ, INT16 tag, INT16 key) +INT16 WINAPI InsertPQ16(HPQ16 hPQ, INT16 tag, INT16 key) { struct hpq *queueItem = HeapAlloc(GetProcessHeap(), 0, sizeof(struct hpq)); if(queueItem == NULL) { @@ -415,7 +415,7 @@ INT16 WINAPI InsertPQ16(HPQ16 hPQ, INT16 tag, INT16 key) hpqueue = queueItem; queueItem->key = key; queueItem->tag = tag; - + FIXME("(%x %d %d): stub???\n", hPQ, tag, key); return TRUE; } @@ -424,9 +424,9 @@ INT16 WINAPI InsertPQ16(HPQ16 hPQ, INT16 tag, INT16 key) * MinPQ (GDI.231) * */ -INT16 WINAPI MinPQ16(HPQ16 hPQ) +INT16 WINAPI MinPQ16(HPQ16 hPQ) { - FIXME("(%x): stub\n", hPQ); + FIXME("(%x): stub\n", hPQ); return 0; } @@ -434,16 +434,16 @@ INT16 WINAPI MinPQ16(HPQ16 hPQ) * SizePQ (GDI.234) * */ -INT16 WINAPI SizePQ16(HPQ16 hPQ, INT16 sizechange) -{ - FIXME("(%x %d): stub\n", hPQ, sizechange); - return -1; +INT16 WINAPI SizePQ16(HPQ16 hPQ, INT16 sizechange) +{ + FIXME("(%x %d): stub\n", hPQ, sizechange); + return -1; } -/* - * The following functions implement part of the spooling process to +/* + * The following functions implement part of the spooling process to * print manager. I would like to see wine have a version of print managers * that used LPR/LPD. For simplicity print jobs will be sent to a file for * now. @@ -522,7 +522,7 @@ static int CreateSpoolFile(LPCSTR pszOutput) close (fds[1]); system(psCmdP); exit(0); - + } close (fds[0]); fd = fds[1]; @@ -542,7 +542,7 @@ static int CreateSpoolFile(LPCSTR pszOutput) if ((fd = open(buffer, O_CREAT | O_TRUNC | O_WRONLY , 0600)) < 0) { - ERR("Failed to create spool file '%s' ('%s'). (error %s)\n", + ERR("Failed to create spool file '%s' ('%s'). (error %s)\n", buffer, psCmdP, strerror(errno)); } } @@ -593,7 +593,7 @@ HPJOB16 WINAPI OpenJob16(LPCSTR lpOutput, LPCSTR lpTitle, HDC16 hDC) WARN("Memory exausted!\n"); return hHandle; } - + hHandle = 1; pPrintJob->pszOutput = HeapAlloc(GetProcessHeap(), 0, strlen(lpOutput)+1); @@ -606,8 +606,8 @@ HPJOB16 WINAPI OpenJob16(LPCSTR lpOutput, LPCSTR lpTitle, HDC16 hDC) pPrintJob->hDC = hDC; pPrintJob->fd = fd; pPrintJob->nIndex = 0; - pPrintJob->hHandle = hHandle; - gPrintJobsTable[pPrintJob->nIndex] = pPrintJob; + pPrintJob->hHandle = hHandle; + gPrintJobsTable[pPrintJob->nIndex] = pPrintJob; } } TRACE("return %04x\n", hHandle); @@ -710,7 +710,7 @@ INT16 WINAPI DeleteJob16(HPJOB16 hJob, INT16 nNotUsed) return nRet; } -/* +/* * The following two function would allow a page to be sent to the printer * when it has been processed. For simplicity they havn't been implemented. * This means a whole job has to be processed before it is sent to the printer. @@ -872,7 +872,7 @@ DWORD WINAPI DrvGetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile, RegSetValueExA(hkey2, lpProfile, 0, REG_DWORD, (LPBYTE)&SetData, 4); /* no result returned */ } } - + failed: if (hkey2) RegCloseKey(hkey2); if (hkey) RegCloseKey(hkey); @@ -916,9 +916,9 @@ DWORD WINAPI DrvSetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile, if (((DWORD)lpProfile == INT_PD_DEFAULT_DEVMODE) || (HIWORD(lpProfile) && (!strcmp(lpProfile, DefaultDevMode)))) { - if ( RegOpenKeyA(HKEY_LOCAL_MACHINE, RegStr_Printer, &hkey) + if ( RegOpenKeyA(HKEY_LOCAL_MACHINE, RegStr_Printer, &hkey) != ERROR_SUCCESS || - RegSetValueExA(hkey, DefaultDevMode, 0, REG_BINARY, + RegSetValueExA(hkey, DefaultDevMode, 0, REG_BINARY, lpPrinterData, dwSize) != ERROR_SUCCESS ) res = ERROR_INVALID_PRINTER_NAME; } @@ -929,7 +929,7 @@ DWORD WINAPI DrvSetPrinterData16(LPSTR lpPrinter, LPSTR lpProfile, if( (res = RegOpenKeyA(HKEY_LOCAL_MACHINE, RegStr_Printer, &hkey)) == ERROR_SUCCESS ) { - if (!lpPrinterData) + if (!lpPrinterData) res = RegDeleteValueA(hkey, lpProfile); else res = RegSetValueExA(hkey, lpProfile, 0, lpType, diff --git a/dlls/gdi/win16drv/font.c b/dlls/gdi/win16drv/font.c index 6af457a17eb..d959853d40c 100644 --- a/dlls/gdi/win16drv/font.c +++ b/dlls/gdi/win16drv/font.c @@ -48,9 +48,9 @@ BOOL WIN16DRV_GetTextExtentPoint( PHYSDEV dev, LPCWSTR wstr, INT count, str = HeapAlloc( GetProcessHeap(), 0, len ); WideCharToMultiByte( CP_ACP, 0, wstr, count, str, len, NULL, NULL ); - dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0, + dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0, NULL, str, -len, physDev->FontInfo, - win16drv_SegPtr_DrawMode, + win16drv_SegPtr_DrawMode, win16drv_SegPtr_TextXForm, NULL, NULL, 0); size->cx = XDSTOLS(dc,LOWORD(dwRet)); size->cy = YDSTOLS(dc,HIWORD(dwRet)); @@ -109,29 +109,29 @@ HFONT WIN16DRV_SelectFont( PHYSDEV dev, HFONT hfont) } nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_FONT, - &physDev->lf, 0, 0); + &physDev->lf, 0, 0); - if( physDev->FontInfo && + if( physDev->FontInfo && HeapSize( GetProcessHeap(), 0, physDev->FontInfo ) < nSize ) { HeapFree( GetProcessHeap(), 0, physDev->FontInfo ); physDev->FontInfo = NULL; } - + if( !physDev->FontInfo ) physDev->FontInfo = HeapAlloc( GetProcessHeap(), 0, nSize ); nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_FONT, - &physDev->lf, - physDev->FontInfo, - win16drv_SegPtr_TextXForm ); + &physDev->lf, + physDev->FontInfo, + win16drv_SegPtr_TextXForm ); -#define fi physDev->FontInfo +#define fi physDev->FontInfo physDev->tm.tmHeight = YDSTOLS(dc, fi->dfPixHeight); physDev->tm.tmAscent = YDSTOLS(dc, fi->dfAscent); physDev->tm.tmDescent = physDev->tm.tmHeight - - physDev->tm.tmAscent; + physDev->tm.tmAscent; physDev->tm.tmInternalLeading = YDSTOLS(dc, fi->dfInternalLeading); physDev->tm.tmExternalLeading = YDSTOLS(dc, fi->dfExternalLeading); physDev->tm.tmAveCharWidth = XDSTOLS(dc, fi->dfAvgWidth); @@ -176,9 +176,9 @@ BOOL WIN16DRV_GetCharWidth( PHYSDEV dev, UINT firstChar, UINT lastChar, TRACE("%d - %d into %p\n", firstChar, lastChar, buffer ); - wRet = PRTDRV_GetCharWidth( physDev->segptrPDEVICE, buffer, firstChar, - lastChar, physDev->FontInfo, - win16drv_SegPtr_DrawMode, + wRet = PRTDRV_GetCharWidth( physDev->segptrPDEVICE, buffer, firstChar, + lastChar, physDev->FontInfo, + win16drv_SegPtr_DrawMode, win16drv_SegPtr_TextXForm ); if( TRACE_ON(win16drv) ){ for(i = 0; i <= lastChar - firstChar; i++) @@ -223,8 +223,8 @@ BOOL WIN16DRV_EnumDeviceFonts( PHYSDEV dev, LPLOGFONTW plf, /*********************************************************************** * EnumCallback (GDI.158) - * - * This is the callback function used when EnumDFonts is called. + * + * This is the callback function used when EnumDFonts is called. * (The printer drivers uses it to pass info on available fonts). * * lpvClientData is the pointer passed to EnumDFonts, which points to a WEPFC @@ -233,7 +233,7 @@ BOOL WIN16DRV_EnumDeviceFonts( PHYSDEV dev, LPLOGFONTW plf, */ WORD WINAPI EnumCallback16(LPENUMLOGFONT16 lpLogFont, LPNEWTEXTMETRIC16 lpTextMetrics, - WORD wFontType, LONG lpClientData) + WORD wFontType, LONG lpClientData) { ENUMLOGFONTEXW lfW; ENUMLOGFONTEX16 lf16; diff --git a/dlls/gdi/win16drv/graphics.c b/dlls/gdi/win16drv/graphics.c index 7d9af8698f7..f3dd7d92029 100644 --- a/dlls/gdi/win16drv/graphics.c +++ b/dlls/gdi/win16drv/graphics.c @@ -41,7 +41,7 @@ WIN16DRV_LineTo( PHYSDEV dev, INT x, INT y ) points[1].x = dc->DCOrgX + XLPTODP( dc, x ); points[1].y = dc->DCOrgY + YLPTODP( dc, y ); bRet = PRTDRV_Output(physDev->segptrPDEVICE, - OS_POLYLINE, 2, points, + OS_POLYLINE, 2, points, physDev->PenInfo, NULL, win16drv_SegPtr_DrawMode, dc->hClipRgn); @@ -73,7 +73,7 @@ WIN16DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) points[1].x = XLPTODP(dc, right); points[1].y = YLPTODP(dc, bottom); bRet = PRTDRV_Output(physDev->segptrPDEVICE, - OS_RECTANGLE, 2, points, + OS_RECTANGLE, 2, points, physDev->PenInfo, physDev->BrushInfo, win16drv_SegPtr_DrawMode, dc->hClipRgn); @@ -100,8 +100,8 @@ WIN16DRV_Polygon(PHYSDEV dev, const POINT* pt, INT count ) count++; /* Ensure polygon is closed */ points = HeapAlloc( GetProcessHeap(), 0, count * sizeof(POINT16) ); - if(points == NULL) return FALSE; - + if(points == NULL) return FALSE; + for (i = 0; i < count - 1; i++) { points[i].x = XLPTODP( dc, pt[i].x ); @@ -110,7 +110,7 @@ WIN16DRV_Polygon(PHYSDEV dev, const POINT* pt, INT count ) points[count-1].x = points[0].x; points[count-1].y = points[0].y; bRet = PRTDRV_Output(physDev->segptrPDEVICE, - OS_WINDPOLYGON, count, points, + OS_WINDPOLYGON, count, points, physDev->PenInfo, physDev->BrushInfo, win16drv_SegPtr_DrawMode, dc->hClipRgn); @@ -135,14 +135,14 @@ WIN16DRV_Polyline(PHYSDEV dev, const POINT* pt, INT count ) points = HeapAlloc( GetProcessHeap(), 0, count * sizeof(POINT16) ); if(points == NULL) return FALSE; - + for (i = 0; i < count; i++) { points[i].x = XLPTODP( dc, pt[i].x ); points[i].y = YLPTODP( dc, pt[i].y ); } bRet = PRTDRV_Output(physDev->segptrPDEVICE, - OS_POLYLINE, count, points, + OS_POLYLINE, count, points, physDev->PenInfo, NULL, win16drv_SegPtr_DrawMode, dc->hClipRgn); @@ -172,7 +172,7 @@ WIN16DRV_Ellipse(PHYSDEV dev, INT left, INT top, INT right, INT bottom) points[1].y = YLPTODP(dc, bottom); bRet = PRTDRV_Output(physDev->segptrPDEVICE, - OS_ELLIPSE, 2, points, + OS_ELLIPSE, 2, points, physDev->PenInfo, physDev->BrushInfo, win16drv_SegPtr_DrawMode, dc->hClipRgn); diff --git a/dlls/gdi/win16drv/init.c b/dlls/gdi/win16drv/init.c index 0550337ae92..56a64290030 100644 --- a/dlls/gdi/win16drv/init.c +++ b/dlls/gdi/win16drv/init.c @@ -210,7 +210,7 @@ void InitTextXForm(LPTEXTXFORM16 lpTextXForm) lpTextXForm->txfWeight = 0x0190; lpTextXForm->txfItalic = 0x00; lpTextXForm->txfUnderline = 0x00; - lpTextXForm->txfStrikeOut = 0x00; + lpTextXForm->txfStrikeOut = 0x00; lpTextXForm->txfOutPrecision = 0x02; lpTextXForm->txfClipPrecision = 0x01; lpTextXForm->txfAccelerator = 0x0001; @@ -220,18 +220,18 @@ void InitTextXForm(LPTEXTXFORM16 lpTextXForm) void InitDrawMode(LPDRAWMODE lpDrawMode) { - lpDrawMode->Rop2 = 0x000d; - lpDrawMode->bkMode = 0x0001; - lpDrawMode->bkColor = 0x3fffffff; - lpDrawMode->TextColor = 0x20000000; + lpDrawMode->Rop2 = 0x000d; + lpDrawMode->bkMode = 0x0001; + lpDrawMode->bkColor = 0x3fffffff; + lpDrawMode->TextColor = 0x20000000; lpDrawMode->TBreakExtra = 0x0000; - lpDrawMode->BreakExtra = 0x0000; - lpDrawMode->BreakErr = 0x0000; - lpDrawMode->BreakRem = 0x0000; - lpDrawMode->BreakCount = 0x0000; - lpDrawMode->CharExtra = 0x0000; - lpDrawMode->LbkColor = 0x00ffffff; - lpDrawMode->LTextColor = 0x00000000; + lpDrawMode->BreakExtra = 0x0000; + lpDrawMode->BreakErr = 0x0000; + lpDrawMode->BreakRem = 0x0000; + lpDrawMode->BreakCount = 0x0000; + lpDrawMode->CharExtra = 0x0000; + lpDrawMode->LbkColor = 0x00ffffff; + lpDrawMode->LTextColor = 0x00000000; lpDrawMode->ICMCXform = 0; /* ? */ lpDrawMode->StretchBltMode = STRETCH_ANDSCANS; lpDrawMode->eMiterLimit = 1; @@ -269,13 +269,13 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, if(!output) output = "LPT1:"; /* Get GDIINFO which is the same as a DeviceCaps structure */ - wRet = PRTDRV_Enable(&physDev->DevCaps, GETGDIINFO, device, driver, output,NULL); + wRet = PRTDRV_Enable(&physDev->DevCaps, GETGDIINFO, device, driver, output,NULL); /* Add this to the DC */ dc->bitsPerPixel = physDev->DevCaps.bitsPixel; - + TRACE("Got devcaps width %d height %d bits %d planes %d\n", - physDev->DevCaps.horzRes, physDev->DevCaps.vertRes, + physDev->DevCaps.horzRes, physDev->DevCaps.vertRes, physDev->DevCaps.bitsPixel, physDev->DevCaps.planes); /* Now we allocate enough memory for the PDEVICE structure */ @@ -286,30 +286,30 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, /* TTD Shouldn't really do pointer arithmetic on segment points */ physDev->segptrPDEVICE = K32WOWGlobalLock16(GlobalAlloc16(GHND, nPDEVICEsize))+sizeof(PDEVICE_HEADER); - *((BYTE *)MapSL(physDev->segptrPDEVICE)+0) = 'N'; - *((BYTE *)MapSL(physDev->segptrPDEVICE)+1) = 'B'; + *((BYTE *)MapSL(physDev->segptrPDEVICE)+0) = 'N'; + *((BYTE *)MapSL(physDev->segptrPDEVICE)+1) = 'B'; /* Set up the header */ - pPDH = (PDEVICE_HEADER *)((BYTE*)MapSL(physDev->segptrPDEVICE) - sizeof(PDEVICE_HEADER)); + pPDH = (PDEVICE_HEADER *)((BYTE*)MapSL(physDev->segptrPDEVICE) - sizeof(PDEVICE_HEADER)); pPDH->pLPD = pLPD; - + TRACE("PDEVICE allocated %08lx\n",(DWORD)(physDev->segptrPDEVICE)); - + /* Now get the printer driver to initialise this data */ - wRet = PRTDRV_Enable((LPVOID)physDev->segptrPDEVICE, INITPDEVICE, device, driver, output, NULL); + wRet = PRTDRV_Enable((LPVOID)physDev->segptrPDEVICE, INITPDEVICE, device, driver, output, NULL); physDev->FontInfo = NULL; physDev->BrushInfo = NULL; physDev->PenInfo = NULL; win16drv_SegPtr_TextXForm = K32WOWGlobalLock16(GlobalAlloc16(GHND, sizeof(TEXTXFORM16))); win16drv_TextXFormP = MapSL(win16drv_SegPtr_TextXForm); - + InitTextXForm(win16drv_TextXFormP); /* TTD Lots more to do here */ win16drv_SegPtr_DrawMode = K32WOWGlobalLock16(GlobalAlloc16(GHND, sizeof(DRAWMODE))); win16drv_DrawModeP = MapSL(win16drv_SegPtr_DrawMode); - + InitDrawMode(win16drv_DrawModeP); return TRUE; @@ -317,7 +317,7 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, BOOL WIN16DRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, DWORD rop ) { - + WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev; BOOL bRet = 0; @@ -372,7 +372,7 @@ static INT WIN16DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in - After every write to printer port or spool file - Several times when no more disk space - Before every metafile record when GDI does banding - */ + */ /* Call Control with hdc as lpInData */ HDC16 *seghdc = SEGPTR_NEW(HDC16); @@ -413,7 +413,7 @@ static INT WIN16DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in char *cp = SEGPTR_ALLOC(cbInput + 1); memcpy(cp, MapSL(lpInData), cbInput); cp[cbInput] = '\0'; - + nRet = PRTDRV_Control(physDev->segptrPDEVICE, nEscape, SEGPTR_GET(cp), lpOutData); SEGPTR_FREE(cp); @@ -437,7 +437,7 @@ static INT WIN16DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in } } else - WARN("Escape(nEscape = %04x) - ???\n", nEscape); + WARN("Escape(nEscape = %04x) - ???\n", nEscape); return nRet; #endif /* FIXME: should convert args to SEGPTR and redo all the above */ diff --git a/dlls/gdi/win16drv/prtdrv.c b/dlls/gdi/win16drv/prtdrv.c index 527b28a14ba..d401f85ad1e 100644 --- a/dlls/gdi/win16drv/prtdrv.c +++ b/dlls/gdi/win16drv/prtdrv.c @@ -140,13 +140,13 @@ static LOADED_PRINTER_DRIVER *FindPrinterDriverFromPDEVICE(SEGPTR segptrPDEVICE) return pLPD; } -/* +/* * Load a printer driver, adding it self to the list of loaded drivers. */ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver) -{ - HINSTANCE16 hInst; +{ + HINSTANCE16 hInst; LOADED_PRINTER_DRIVER *pLPD = NULL; int nDriverSlot = 0; BOOL bSlotFound = FALSE; @@ -186,7 +186,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver) HeapFree(GetProcessHeap(), 0, drvName); } - + if (hInst <= 32) { /* Failed to load driver */ @@ -196,7 +196,7 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver) /* Allocate some memory for printer driver info */ pLPD = malloc(sizeof(LOADED_PRINTER_DRIVER)); memset(pLPD, 0 , sizeof(LOADED_PRINTER_DRIVER)); - + pLPD->hInst = hInst; pLPD->szDriver = HeapAlloc(GetProcessHeap(),0,strlen(pszDriver)+1); strcpy( pLPD->szDriver, pszDriver ); @@ -240,7 +240,7 @@ INT16 PRTDRV_Control(LPPDEVICE lpDestDev, WORD wfunction, SEGPTR lpInData, SEGPT WARN("Not supported by driver\n"); return 0; } - wRet = PRTDRV_CallTo16_word_lwll( pLPD->fn[FUNC_CONTROL], + wRet = PRTDRV_CallTo16_word_lwll( pLPD->fn[FUNC_CONTROL], (SEGPTR)lpDestDev, wfunction, lpInData, lpOutData ); } @@ -251,7 +251,7 @@ INT16 PRTDRV_Control(LPPDEVICE lpDestDev, WORD wfunction, SEGPTR lpInData, SEGPT /* * Enable (ordinal 5) */ -WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, +WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, LPCSTR lpDeviceName, LPCSTR lpOutputFile, LPVOID lpData) { WORD wRet = 0; @@ -279,14 +279,14 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, lP1 = (SEGPTR)lpDevInfo;/* 16 bit segmented ptr already */ else lP1 = MapLS(&devcaps); - + wP2 = wStyle; - + /* MapLS handles NULL like a charm ... */ lP3 = MapLS(lpDestDevType); lP4 = MapLS(lpOutputFile); lP5 = (LONG)lpData; - + wRet = PRTDRV_CallTo16_word_lwlll(pLPD->fn[FUNC_ENABLE], lP1, wP2, lP3, lP4, lP5); UnMapLS(lP3); UnMapLS(lP4); @@ -305,7 +305,7 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, /* * EnumDFonts (ordinal 6) */ -WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName, +WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName, FARPROC16 lpCallbackFunc, LPVOID lpClientData) { WORD wRet = 0; @@ -329,16 +329,16 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName, wRet = PRTDRV_CallTo16_word_llll( pLPD->fn[FUNC_ENUMDFONTS], lP1, lP2, (LONG)lpCallbackFunc,lP4); UnMapLS(lP2); - } else + } else WARN("Failed to find device\n"); - + TRACE("return %x\n", wRet); return wRet; } /* * EnumObj (ordinal 7) */ -BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, +BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, FARPROC16 lpCallbackFunc, LPVOID lpClientData) { WORD wRet = 0; @@ -358,22 +358,22 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, } lP1 = (SEGPTR)lpDestDev; - + wP2 = iStyle; - /* + /* * Need to pass addres of function conversion function that will switch back to 32 bit code if necessary */ - lP3 = (LONG)lpCallbackFunc; + lP3 = (LONG)lpCallbackFunc; lP4 = (LONG)lpClientData; - - wRet = PRTDRV_CallTo16_word_lwll( pLPD->fn[FUNC_ENUMOBJ], + + wRet = PRTDRV_CallTo16_word_lwll( pLPD->fn[FUNC_ENUMOBJ], lP1, wP2, lP3, lP4 ); } - else + else WARN("Failed to find device\n"); - + TRACE("return %x\n", wRet); return wRet; } @@ -382,9 +382,9 @@ BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, * Output (ordinal 8) */ WORD PRTDRV_Output(LPPDEVICE lpDestDev, - WORD wStyle, + WORD wStyle, WORD wCount, - POINT16 *points, + POINT16 *points, LPLOGPEN16 lpPen, LPLOGBRUSH16 lpBrush, SEGPTR lpDrawMode, @@ -392,9 +392,9 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, { WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - + TRACE("PRTDRV_OUTPUT %d\n", wStyle ); - + if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { LONG lP1, lP4, lP5, lP6, lP7, lP8; @@ -412,7 +412,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, lP5 = MapLS( lpPen ); lP6 = MapLS( lpBrush ); lP7 = lpDrawMode; - + if (hClipRgn) { DWORD size; @@ -420,7 +420,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, size = GetRegionData( hClipRgn, 0, NULL ); clip = HeapAlloc( GetProcessHeap(), 0, size ); - if(!clip) + if(!clip) { WARN("Can't alloc clip array in PRTDRV_Output\n"); return FALSE; @@ -428,7 +428,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, GetRegionData( hClipRgn, size, clip ); if( clip->rdh.nCount == 0 ) { - wRet = PRTDRV_CallTo16_word_lwwlllll(pLPD->fn[FUNC_OUTPUT], + wRet = PRTDRV_CallTo16_word_lwwlllll(pLPD->fn[FUNC_OUTPUT], lP1, wP2, wP3, lP4, lP5, lP6, lP7, (SEGPTR) NULL); @@ -438,8 +438,8 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, RECT *pRect; RECT16 r16; lP8 = MapLS(&r16); - - for(pRect = (RECT *)clip->Buffer; + + for(pRect = (RECT *)clip->Buffer; pRect < (RECT *)clip->Buffer + clip->rdh.nCount; pRect++) { CONV_RECT32TO16( pRect, &r16 ); @@ -455,7 +455,7 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, } else { - wRet = PRTDRV_CallTo16_word_lwwlllll(pLPD->fn[FUNC_OUTPUT], + wRet = PRTDRV_CallTo16_word_lwwlllll(pLPD->fn[FUNC_OUTPUT], lP1, wP2, wP3, lP4, lP5, lP6, lP7, (SEGPTR) NULL); } @@ -467,22 +467,22 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev, return wRet; } -/* +/* * RealizeObject (ordinal 10) */ -DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, +DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, LPVOID lpInObj, LPVOID lpOutObj, SEGPTR lpTextXForm) { WORD dwRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - + TRACE("%08lx %04x %p %p %08lx\n", lpDestDev, wStyle, lpInObj, lpOutObj, lpTextXForm); - + if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { - LONG lP1, lP3, lP4, lP5; + LONG lP1, lP3, lP4, lP5; WORD wP2; if (pLPD->fn[FUNC_REALIZEOBJECT] == NULL) @@ -498,7 +498,7 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, lP5 = lpTextXForm; TRACE("Calling Realize %08lx %04x %08lx %08lx %08lx\n", lP1, wP2, lP3, lP4, lP5); - dwRet = PRTDRV_CallTo16_long_lwlll(pLPD->fn[FUNC_REALIZEOBJECT], + dwRet = PRTDRV_CallTo16_long_lwlll(pLPD->fn[FUNC_REALIZEOBJECT], lP1, wP2, lP3, lP4, lP5); UnMapLS( lP3 ); UnMapLS( lP4 ); @@ -507,15 +507,15 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, return dwRet; } -/* +/* * StretchBlt (ordinal 27) */ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev, WORD wDestX, WORD wDestY, - WORD wDestXext, WORD wDestYext, + WORD wDestXext, WORD wDestYext, LPPDEVICE lpSrcDev, WORD wSrcX, WORD wSrcY, - WORD wSrcXext, WORD wSrcYext, + WORD wSrcXext, WORD wSrcYext, DWORD Rop3, LPLOGBRUSH16 lpBrush, SEGPTR lpDrawMode, @@ -523,9 +523,9 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev, { WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - + TRACE("(lots of params - FIXME)\n"); - + if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { LONG lP1,lP6, lP11, lP12, lP13; @@ -551,9 +551,9 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev, lP12 = MapLS( lpBrush ); lP13 = lpDrawMode; lP14 = MapLS(lpClipRect); - wRet = PRTDRV_CallTo16_word_lwwwwlwwwwllll(pLPD->fn[FUNC_STRETCHBLT], + wRet = PRTDRV_CallTo16_word_lwwwwlwwwwllll(pLPD->fn[FUNC_STRETCHBLT], lP1, wP2, wP3, wP4, wP5, - lP6, wP7, wP8, wP9, wP10, + lP6, wP7, wP8, wP9, wP10, lP11, lP12, lP13, lP14); UnMapLS(lP12); UnMapLS(lP14); @@ -563,16 +563,16 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev, } DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, - RECT16 *lpClipRect, LPCSTR lpString, WORD wCount, - LPFONTINFO16 lpFontInfo, SEGPTR lpDrawMode, + RECT16 *lpClipRect, LPCSTR lpString, WORD wCount, + LPFONTINFO16 lpFontInfo, SEGPTR lpDrawMode, SEGPTR lpTextXForm, SHORT *lpCharWidths, RECT16 * lpOpaqueRect, WORD wOptions) { DWORD dwRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - + TRACE("(lots of params - FIXME)\n"); - + if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { LONG lP1, lP4, lP5, lP7, lP8, lP9, lP10, lP11; @@ -591,13 +591,13 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, lP4 = MapLS( lpClipRect ); lP5 = MapLS( lpString ); iP6 = wCount; - + /* This should be realized by the driver, so in 16bit data area */ lP7 = MapLS( lpFontInfo ); lP8 = lpDrawMode; lP9 = lpTextXForm; - - if (lpCharWidths != NULL) + + if (lpCharWidths != NULL) FIXME("Char widths not supported\n"); lP10 = 0; lP11 = MapLS( lpOpaqueRect ); @@ -690,7 +690,7 @@ int WINAPI dmRealizeObject16(LPPDEVICE lpDestDev, INT16 wStyle, LPSTR lpInObj, L OutBrush->lbStyle = InBrush->lbStyle; OutBrush->lbColor = InBrush->lbColor; OutBrush->lbHatch = InBrush->lbHatch; - if (InBrush->lbStyle == BS_SOLID) + if (InBrush->lbStyle == BS_SOLID) return 0x8002; /* FIXME: diff mono-color */ else return 0x8000; } @@ -709,21 +709,21 @@ int WINAPI dmRealizeObject16(LPPDEVICE lpDestDev, INT16 wStyle, LPSTR lpInObj, L } -WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer, +WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer, WORD wFirstChar, WORD wLastChar, LPFONTINFO16 lpFontInfo, SEGPTR lpDrawMode, SEGPTR lpTextXForm ) { WORD wRet = 0; LOADED_PRINTER_DRIVER *pLPD = NULL; - + TRACE("(lots of params - FIXME)\n"); - + if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL) { LONG lP1, lP2, lP5, lP6, lP7; WORD wP3, wP4; - + if (pLPD->fn[FUNC_GETCHARWIDTH] == NULL) { WARN("Not supported by driver\n"); @@ -737,8 +737,8 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer, lP5 = MapLS( lpFontInfo ); lP6 = lpDrawMode; lP7 = lpTextXForm; - - wRet = PRTDRV_CallTo16_word_llwwlll(pLPD->fn[FUNC_GETCHARWIDTH], + + wRet = PRTDRV_CallTo16_word_llwwlll(pLPD->fn[FUNC_GETCHARWIDTH], lP1, lP2, wP3, wP4, lP5, lP6, lP7 ); UnMapLS( lP2 ); diff --git a/dlls/gdi/win16drv/text.c b/dlls/gdi/win16drv/text.c index ab6f80f9280..93614bcd271 100644 --- a/dlls/gdi/win16drv/text.c +++ b/dlls/gdi/win16drv/text.c @@ -40,7 +40,7 @@ BOOL WIN16DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, BOOL bRet = 1; RECT16 clipRect; RECT16 opaqueRect; - RECT16 *lpOpaqueRect = NULL; + RECT16 *lpOpaqueRect = NULL; WORD wOptions = 0; DWORD len; INT16 width; @@ -59,7 +59,7 @@ BOOL WIN16DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, clipRect.left = 0; clipRect.top = 0; - + clipRect.right = physDev->DevCaps.horzRes; clipRect.bottom = physDev->DevCaps.vertRes; if (lprect) { @@ -69,7 +69,7 @@ BOOL WIN16DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, opaqueRect.bottom = lprect->bottom; lpOpaqueRect = &opaqueRect; } - + TRACE("textalign = %d\n", dc->textAlign); if (dc->textAlign & TA_UPDATECP) { @@ -80,8 +80,8 @@ BOOL WIN16DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, x = XLPTODP( dc, x ); y = YLPTODP( dc, y ); - dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0, - NULL, str, -len, physDev->FontInfo, + dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0, + NULL, str, -len, physDev->FontInfo, win16drv_SegPtr_DrawMode, win16drv_SegPtr_TextXForm, NULL, NULL, 0); @@ -111,12 +111,12 @@ BOOL WIN16DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, break; case TA_BASELINE: y -= physDev->FontInfo->dfAscent; - break; + break; } - dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, + dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, x, y, &clipRect, str, (WORD)len, - physDev->FontInfo, win16drv_SegPtr_DrawMode, + physDev->FontInfo, win16drv_SegPtr_DrawMode, win16drv_SegPtr_TextXForm, NULL, lpOpaqueRect, wOptions); diff --git a/dlls/gdi/win16drv/win16drv.h b/dlls/gdi/win16drv/win16drv.h index 0b56d5f5c77..6880a767444 100644 --- a/dlls/gdi/win16drv/win16drv.h +++ b/dlls/gdi/win16drv/win16drv.h @@ -25,7 +25,7 @@ #include "wingdi.h" #include "gdi.h" -#define SETHIGHBIT +#define SETHIGHBIT #undef SETHIGHBIT #ifdef SETHIGHBIT #define GETGDIINFO 0x8001 @@ -51,14 +51,14 @@ /* Internal Data */ #define ORD_BITBLT 1 -#define ORD_COLORINFO 2 +#define ORD_COLORINFO 2 #define ORD_CONTROL 3 #define ORD_DISABLE 4 #define ORD_ENABLE 5 #define ORD_ENUMDFONTS 6 #define ORD_ENUMOBJ 7 #define ORD_OUTPUT 8 -#define ORD_PIXEL 9 +#define ORD_PIXEL 9 #define ORD_REALIZEOBJECT 10 #define ORD_STRBLT 11 #define ORD_SCANLR 12 @@ -80,34 +80,34 @@ #define ORD_DIALOGFN 100 #define ORD_PSEUDOEDIT 101 - + enum { - FUNC_BITBLT = 0, - FUNC_COLORINFO, - FUNC_CONTROL, - FUNC_DISABLE, - FUNC_ENABLE, - FUNC_ENUMDFONTS, - FUNC_ENUMOBJ, - FUNC_OUTPUT, - FUNC_PIXEL, - FUNC_REALIZEOBJECT, - FUNC_STRBLT, - FUNC_SCANLR, - FUNC_DEVICEMODE, - FUNC_EXTTEXTOUT, - FUNC_GETCHARWIDTH, - FUNC_DEVICEBITMAP, - FUNC_FASTBORDER, - FUNC_SETATTRIBUTE, - FUNC_STRETCHBLT, - FUNC_STRETCHDIBITS, - FUNC_SELECTBITMAP, - FUNC_BITMAPBITS, - FUNC_EXTDEVICEMODE, - FUNC_DEVICECAPABILITIES, - FUNC_ADVANCEDSETUPDIALOG, - FUNC_DIALOGFN, + FUNC_BITBLT = 0, + FUNC_COLORINFO, + FUNC_CONTROL, + FUNC_DISABLE, + FUNC_ENABLE, + FUNC_ENUMDFONTS, + FUNC_ENUMOBJ, + FUNC_OUTPUT, + FUNC_PIXEL, + FUNC_REALIZEOBJECT, + FUNC_STRBLT, + FUNC_SCANLR, + FUNC_DEVICEMODE, + FUNC_EXTTEXTOUT, + FUNC_GETCHARWIDTH, + FUNC_DEVICEBITMAP, + FUNC_FASTBORDER, + FUNC_SETATTRIBUTE, + FUNC_STRETCHBLT, + FUNC_STRETCHDIBITS, + FUNC_SELECTBITMAP, + FUNC_BITMAPBITS, + FUNC_EXTDEVICEMODE, + FUNC_DEVICECAPABILITIES, + FUNC_ADVANCEDSETUPDIALOG, + FUNC_DIALOGFN, FUNC_PSEUDOEDIT, TOTAL_PRINTER_DRIVER_FUNCTIONS /* insert functions before here */ }; @@ -129,19 +129,19 @@ typedef struct PDEVICE_HEADER #include "pshpack1.h" #define PCOLOR DWORD -typedef struct DRAWMODE +typedef struct DRAWMODE { - SHORT Rop2; - SHORT bkMode; - PCOLOR bkColor; - PCOLOR TextColor; + SHORT Rop2; + SHORT bkMode; + PCOLOR bkColor; + PCOLOR TextColor; SHORT TBreakExtra; - SHORT BreakExtra; - SHORT BreakErr; - SHORT BreakRem; - SHORT BreakCount; - SHORT CharExtra; - COLORREF LbkColor; + SHORT BreakExtra; + SHORT BreakErr; + SHORT BreakRem; + SHORT BreakCount; + SHORT CharExtra; + COLORREF LbkColor; COLORREF LTextColor; DWORD ICMCXform; SHORT StretchBltMode; @@ -157,9 +157,9 @@ typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK LPARAM lp; } WEPFC; -#define DRVOBJ_PEN 1 -#define DRVOBJ_BRUSH 2 -#define DRVOBJ_FONT 3 +#define DRVOBJ_PEN 1 +#define DRVOBJ_BRUSH 2 +#define DRVOBJ_FONT 3 #define DRVOBJ_PBITMAP 5 typedef struct tagDeviceCaps @@ -217,25 +217,25 @@ typedef SEGPTR LPPDEVICE; LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver); extern INT16 PRTDRV_Control(LPPDEVICE lpDestDev, WORD wfunction, SEGPTR lpInData, SEGPTR lpOutData); -extern WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, +extern WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType, LPCSTR lpDeviceName, LPCSTR lpOutputFile, LPVOID lpData); -extern WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName, +extern WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName, FARPROC16 lpCallbackFunc, LPVOID lpClientData); -extern DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, +extern DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle, LPVOID lpInObj, LPVOID lpOutObj, SEGPTR lpTextXForm); extern BOOL16 PRTDRV_EnumObj(LPPDEVICE lpDestDev, WORD iStyle, FARPROC16 lpfn, LPVOID lpb); extern DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg, - RECT16 *lpClipRect, LPCSTR lpString, WORD wCount, - LPFONTINFO16 lpFontInfo, SEGPTR lpDrawMode, + RECT16 *lpClipRect, LPCSTR lpString, WORD wCount, + LPFONTINFO16 lpFontInfo, SEGPTR lpDrawMode, SEGPTR lpTextXForm, SHORT *lpCharWidths, RECT16 * lpOpaqueRect, WORD wOptions); extern WORD PRTDRV_Output(LPPDEVICE lpDestDev, - WORD wStyle, + WORD wStyle, WORD wCount, - POINT16 *points, + POINT16 *points, LPLOGPEN16 lpPen, LPLOGBRUSH16 lpBrush, SEGPTR lpDrawMode, @@ -243,16 +243,16 @@ extern WORD PRTDRV_Output(LPPDEVICE lpDestDev, DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev, WORD wDestX, WORD wDestY, - WORD wDestXext, WORD wDestYext, + WORD wDestXext, WORD wDestYext, LPPDEVICE lpSrcDev, WORD wSrcX, WORD wSrcY, - WORD wSrcXext, WORD wSrcYext, + WORD wSrcXext, WORD wSrcYext, DWORD Rop3, LPLOGBRUSH16 lpBrush, SEGPTR lpDrawMode, RECT16 *lpClipRect); -extern WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer, +extern WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer, WORD wFirstChar, WORD wLastChar, LPFONTINFO16 lpFontInfo, SEGPTR lpDrawMode, SEGPTR lpTextXForm ); diff --git a/dlls/gdi/wing.c b/dlls/gdi/wing.c index e692dc4841d..a581c488d48 100644 --- a/dlls/gdi/wing.c +++ b/dlls/gdi/wing.c @@ -34,10 +34,10 @@ typedef enum WING_DITHER_TYPE WING_DISPERSED_4x4, WING_DISPERSED_8x8, WING_CLUSTERED_4x4 } WING_DITHER_TYPE; -/* +/* * WinG DIB bitmaps can be selected into DC and then scribbled upon - * by GDI functions. They can also be changed directly. This gives us - * three choices + * by GDI functions. They can also be changed directly. This gives us + * three choices * - use original WinG 16-bit DLL * requires working 16-bit driver interface * - implement DIB graphics driver from scratch diff --git a/dlls/icmp/icmp_main.c b/dlls/icmp/icmp_main.c index e35fcc74b88..8fd1882217f 100644 --- a/dlls/icmp/icmp_main.c +++ b/dlls/icmp/icmp_main.c @@ -2,8 +2,8 @@ * ICMP * * Francois Gouget, 1999, based on the work of - * RW Hall, 1999, based on public domain code PING.C by Mike Muus (1983) - * and later works (c) 1989 Regents of Univ. of California - see copyright + * RW Hall, 1999, based on public domain code PING.C by Mike Muus (1983) + * and later works (c) 1989 Regents of Univ. of California - see copyright * notice at end of source-code. * * This library is free software; you can redistribute it and/or @@ -25,9 +25,9 @@ * - Systems like FreeBSD don't seem to support the IP_TTL option and maybe others. * But using IP_HDRINCL and building the IP header by hand might work. * - Not all IP options are supported. - * - Are ICMP handles real handles, i.e. inheritable and all? There might be some + * - 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 + * - 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. @@ -86,9 +86,9 @@ #define u_int16_t WORD #define u_int32_t DWORD -/* These are BSD headers. We use these here because they are needed on - * libc5 Linux systems. On other platforms they are usually simply more - * complete than the native stuff, and cause less portability problems +/* These are BSD headers. We use these here because they are needed on + * libc5 Linux systems. On other platforms they are usually simply more + * complete than the native stuff, and cause less portability problems * so we use them anyway. */ #include "ip.h" @@ -140,7 +140,7 @@ typedef struct { #define IP_OPTS_DEFAULT 1 #define IP_OPTS_CUSTOM 2 -/* The sequence number is unique process wide, so that all threads +/* The sequence number is unique process wide, so that all threads * have a distinct sequence number. */ static LONG icmp_sequence=0; @@ -456,7 +456,7 @@ DWORD WINAPI IcmpSendEcho( ier->Status=IP_REQ_TIMED_OUT; } } - } + } } if (ier->Status==IP_REQ_TIMED_OUT) { diff --git a/dlls/imagehlp/access.c b/dlls/imagehlp/access.c index 43c2909bcfd..bdd60b4c04f 100644 --- a/dlls/imagehlp/access.c +++ b/dlls/imagehlp/access.c @@ -121,7 +121,7 @@ PVOID WINAPI ImageDirectoryEntryToData( */ PLOADED_IMAGE WINAPI ImageLoad(LPSTR DllName, LPSTR DllPath) { - PLOADED_IMAGE pLoadedImage = + PLOADED_IMAGE pLoadedImage = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE)); return pLoadedImage; } @@ -175,8 +175,8 @@ BOOL WINAPI ImageUnload(PLOADED_IMAGE pLoadedImage) pFind=&pLoadedImage->Links; pCurrent=&IMAGEHLP_pFirstLoadedImage->Links; - while((pCurrent != pFind) && - (pCurrent != NULL)) + while((pCurrent != pFind) && + (pCurrent != NULL)) pCurrent = pCurrent->Flink; if(!pCurrent) { diff --git a/dlls/imagehlp/imagehlp_main.c b/dlls/imagehlp/imagehlp_main.c index d638c09863e..2fb86577cb4 100644 --- a/dlls/imagehlp/imagehlp_main.c +++ b/dlls/imagehlp/imagehlp_main.c @@ -104,7 +104,7 @@ BOOL WINAPI SearchTreeForFile( LPSTR RootPath, LPSTR InputPathName, LPSTR OutputPathBuffer) { FIXME("(%s, %s, %s): stub\n", - debugstr_a(RootPath), debugstr_a(InputPathName), + debugstr_a(RootPath), debugstr_a(InputPathName), debugstr_a(OutputPathBuffer) ); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); diff --git a/dlls/imagehlp/internal.c b/dlls/imagehlp/internal.c index dc8096f1db1..488a246f6c2 100644 --- a/dlls/imagehlp/internal.c +++ b/dlls/imagehlp/internal.c @@ -96,10 +96,10 @@ VOID RemoveEntryList(PLIST_ENTRY pEntry) PLIST_ENTRY RemoveHeadList(PLIST_ENTRY pListHead) { PLIST_ENTRY p = pListHead->Flink; - + if(p != pListHead) { - RemoveEntryList(pListHead); + RemoveEntryList(pListHead); return p; } else diff --git a/dlls/imagehlp/modify.c b/dlls/imagehlp/modify.c index 25fef449984..54dd3a028db 100644 --- a/dlls/imagehlp/modify.c +++ b/dlls/imagehlp/modify.c @@ -45,7 +45,7 @@ BOOL WINAPI BindImageEx( DWORD Flags, LPSTR ImageName, LPSTR DllPath, LPSTR SymbolPath, PIMAGEHLP_STATUS_ROUTINE StatusRoutine) { - FIXME("(%ld, %s, %s, %s, %p): stub\n", + FIXME("(%ld, %s, %s, %s, %p): stub\n", Flags, debugstr_a(ImageName), debugstr_a(DllPath), debugstr_a(SymbolPath), StatusRoutine ); @@ -84,7 +84,7 @@ static WORD CalcCheckSum( * CheckSumMappedFile (IMAGEHLP.@) */ PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile( - LPVOID BaseAddress, DWORD FileLength, + LPVOID BaseAddress, DWORD FileLength, LPDWORD HeaderSum, LPDWORD CheckSum) { PIMAGE_NT_HEADERS Header; @@ -275,8 +275,8 @@ BOOL WINAPI ReBaseImage( { FIXME( "(%s, %s, %d, %d, %d, %ld, %p, %p, %p, %p, %ld): stub\n", - debugstr_a(CurrentImageName),debugstr_a(SymbolPath), fReBase, - fRebaseSysfileOk, fGoingDown, CheckImageSize, OldImageSize, + debugstr_a(CurrentImageName),debugstr_a(SymbolPath), fReBase, + fRebaseSysfileOk, fGoingDown, CheckImageSize, OldImageSize, OldImageBase, NewImageSize, NewImageBase, TimeStamp ); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -309,7 +309,7 @@ VOID WINAPI RemoveRelocations(PCHAR ImageName) * SplitSymbols (IMAGEHLP.@) */ BOOL WINAPI SplitSymbols( - LPSTR ImageName, LPSTR SymbolsPath, + LPSTR ImageName, LPSTR SymbolsPath, LPSTR SymbolFilePath, DWORD Flags) { FIXME("(%s, %s, %s, %ld): stub\n", diff --git a/dlls/imagehlp/symbol.c b/dlls/imagehlp/symbol.c index 214082d633b..4e5d31f6dc3 100644 --- a/dlls/imagehlp/symbol.c +++ b/dlls/imagehlp/symbol.c @@ -126,7 +126,7 @@ BOOL WINAPI SymGetSearchPath( * SymGetSymFromAddr (IMAGEHLP.@) */ BOOL WINAPI SymGetSymFromAddr( - HANDLE hProcess, DWORD dwAddr, + HANDLE hProcess, DWORD dwAddr, PDWORD pdwDisplacement, PIMAGEHLP_SYMBOL Symbol) { FIXME("(0x%08x, 0x%08lx, %p, %p): stub\n", diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 44f4ce01989..79f982f412e 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -93,7 +93,7 @@ UINT WINAPI ImmEnumRegisterWordA( LPCSTR lpszRegister, LPVOID lpData) { FIXME("(0x%08x, %p, %s, %ld, %s, %p): stub\n", - hKL, lpfnEnumProc, + hKL, lpfnEnumProc, debugstr_a(lpszReading), dwStyle, debugstr_a(lpszRegister), lpData ); @@ -110,7 +110,7 @@ UINT WINAPI ImmEnumRegisterWordW( LPCWSTR lpszRegister, LPVOID lpData) { FIXME("(0x%08x, %p, %s, %ld, %s, %p): stub\n", - hKL, lpfnEnumProc, + hKL, lpfnEnumProc, debugstr_w(lpszReading), dwStyle, debugstr_w(lpszRegister), lpData ); @@ -122,7 +122,7 @@ UINT WINAPI ImmEnumRegisterWordW( * ImmEscapeA (IMM32.@) */ LRESULT WINAPI ImmEscapeA( - HKL hKL, HIMC hIMC, + HKL hKL, HIMC hIMC, UINT uEscape, LPVOID lpData) { FIXME("(0x%08x, 0x%08x, %d, %p): stub\n", @@ -150,7 +150,7 @@ LRESULT WINAPI ImmEscapeW( * ImmGetCandidateListA (IMM32.@) */ DWORD WINAPI ImmGetCandidateListA( - HIMC hIMC, DWORD deIndex, + HIMC hIMC, DWORD deIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen) { FIXME("(0x%08x, %ld, %p, %ld): stub\n", @@ -187,7 +187,7 @@ DWORD WINAPI ImmGetCandidateListCountW( * ImmGetCandidateListW (IMM32.@) */ DWORD WINAPI ImmGetCandidateListW( - HIMC hIMC, DWORD deIndex, + HIMC hIMC, DWORD deIndex, LPCANDIDATELIST lpCandList, DWORD dwBufLen) { FIXME("(0x%08x, %ld, %p, %ld): stub\n", @@ -255,7 +255,7 @@ LONG WINAPI ImmGetCompositionStringA( * ImmGetCompositionStringW (IMM32.@) */ LONG WINAPI ImmGetCompositionStringW( - HIMC hIMC, DWORD dwIndex, + HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen) { OSVERSIONINFOA version; @@ -642,8 +642,8 @@ BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf) * ImmSetCompositionStringA (IMM32.@) */ BOOL WINAPI ImmSetCompositionStringA( - HIMC hIMC, DWORD dwIndex, - LPCVOID lpComp, DWORD dwCompLen, + HIMC hIMC, DWORD dwIndex, + LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen) { FIXME("(0x%08x, %ld, %p, %ld, %p, %ld): stub\n", diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index fc98f98635d..fd1547c16ff 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -34,7 +34,7 @@ * A program that wants to monitor the modem status line (RLSD/DCD) may * poll the modem status register in the commMask structure. I update the bit * in GetCommError, waiting for an implementation of communication events. - * + * * July 6, 1998. Fixes and comments by Valentijn Sessink * [V] * @@ -187,7 +187,7 @@ BOOL WINAPI COMM_BuildOldCommDCB(LPCSTR device, LPDCB lpdcb) else strcpy(temp,device); last=temp[strlen(temp)-1]; - ptr = strtok(temp, ", "); + ptr = strtok(temp, ", "); /* DOS/Windows only compares the first two numbers * and assigns an appropriate baud rate. @@ -219,7 +219,7 @@ BOOL WINAPI COMM_BuildOldCommDCB(LPCSTR device, LPDCB lpdcb) WARN("Unknown baudrate indicator %d !\n", rate); return FALSE; } - + lpdcb->BaudRate = rate; TRACE("baudrate (%ld)\n", lpdcb->BaudRate); @@ -233,25 +233,25 @@ BOOL WINAPI COMM_BuildOldCommDCB(LPCSTR device, LPDCB lpdcb) case 'N': lpdcb->Parity = NOPARITY; lpdcb->fParity = FALSE; - break; + break; case 'E': lpdcb->Parity = EVENPARITY; - break; + break; case 'M': lpdcb->Parity = MARKPARITY; - break; + break; case 'O': lpdcb->Parity = ODDPARITY; - break; + break; case 'S': lpdcb->Parity = SPACEPARITY; - break; + break; default: WARN("Unknown parity `%c'!\n", *ptr); return FALSE; } - ptr = strtok(NULL, ", "); + ptr = strtok(NULL, ", "); TRACE("charsize (%c)\n", *ptr); lpdcb->ByteSize = *ptr - '0'; @@ -260,14 +260,14 @@ BOOL WINAPI COMM_BuildOldCommDCB(LPCSTR device, LPDCB lpdcb) switch (*ptr) { case '1': lpdcb->StopBits = ONESTOPBIT; - break; + break; case '2': lpdcb->StopBits = TWOSTOPBITS; - break; + break; default: WARN("Unknown # of stopbits `%c'!\n", *ptr); return FALSE; - } + } if (last == 'x') { lpdcb->fInX = TRUE; @@ -352,7 +352,7 @@ BOOL WINAPI BuildCommDCBAndTimeoutsA( return COMM_BuildOldCommDCB(device,lpdcb); } - ptr=strtok(temp," "); + ptr=strtok(temp," "); while (ptr) { DWORD flag,x; @@ -498,14 +498,14 @@ static BOOL COMM_GetCommError(HANDLE handle, LPDWORD lperror) * * BUGS * - * Only TIOCSBRK and TIOCCBRK are supported. + * Only TIOCSBRK and TIOCCBRK are supported. */ BOOL WINAPI SetCommBreak( HANDLE handle) /* [in] The communictions device to suspend. */ { #if defined(TIOCSBRK) && defined(TIOCCBRK) /* check if available for compilation */ int fd,result; - + fd = FILE_GetUnixHandle( handle, GENERIC_READ ); if(fd<0) { TRACE("FILE_GetUnixHandle failed\n"); @@ -538,14 +538,14 @@ BOOL WINAPI SetCommBreak( * * BUGS * - * Only TIOCSBRK and TIOCCBRK are supported. + * Only TIOCSBRK and TIOCCBRK are supported. */ BOOL WINAPI ClearCommBreak( HANDLE handle) /* [in] The halted communication device whose character transmission is to be resumed. */ { #if defined(TIOCSBRK) && defined(TIOCCBRK) /* check if available for compilation */ int fd,result; - + fd = FILE_GetUnixHandle( handle, GENERIC_READ ); if(fd<0) { TRACE("FILE_GetUnixHandle failed\n"); @@ -601,7 +601,7 @@ BOOL WINAPI EscapeCommFunction( switch (nFunction) { case RESETDEV: TRACE("\n"); - break; + break; case CLRDTR: TRACE("CLRDTR\n"); @@ -618,7 +618,7 @@ BOOL WINAPI EscapeCommFunction( result= COMM_WhackModem(fd, ~TIOCM_RTS, 0); break; #endif - + case SETDTR: TRACE("SETDTR\n"); #ifdef TIOCM_DTR @@ -659,17 +659,17 @@ BOOL WINAPI EscapeCommFunction( break; #endif default: - WARN("(handle=%d,nFunction=%d): Unknown function\n", + WARN("(handle=%d,nFunction=%d): Unknown function\n", handle, nFunction); - break; + break; } - + if (!direct) if (tcsetattr(fd, TCSADRAIN, &port) == -1) { close(fd); COMM_SetCommError(handle,CE_IOE); - return FALSE; - } else + return FALSE; + } else result= TRUE; else { @@ -745,13 +745,13 @@ BOOL WINAPI ClearCommError( int fd; fd=FILE_GetUnixHandle( handle, GENERIC_READ ); - if(0>fd) + if(0>fd) { FIXME("no handle %d found\n",handle); return FALSE; } - if (lpStat) + if (lpStat) { lpStat->status = 0; @@ -808,7 +808,7 @@ BOOL WINAPI SetupComm( } close(fd); return TRUE; -} +} /***************************************************************************** * GetCommMask (KERNEL32.@) @@ -934,58 +934,58 @@ BOOL WINAPI SetCommState( case 110: case CBR_110: port.c_cflag |= B110; - break; + break; case 300: case CBR_300: port.c_cflag |= B300; - break; + break; case 600: case CBR_600: port.c_cflag |= B600; - break; + break; case 1200: case CBR_1200: port.c_cflag |= B1200; - break; + break; case 2400: case CBR_2400: port.c_cflag |= B2400; - break; + break; case 4800: case CBR_4800: port.c_cflag |= B4800; - break; + break; case 9600: case CBR_9600: port.c_cflag |= B9600; - break; + break; case 19200: case CBR_19200: port.c_cflag |= B19200; - break; + break; case 38400: case CBR_38400: port.c_cflag |= B38400; - break; + break; #ifdef B57600 case 57600: port.c_cflag |= B57600; - break; + break; #endif #ifdef B115200 case 115200: port.c_cflag |= B115200; - break; + break; #endif #ifdef B230400 case 230400: port.c_cflag |= B230400; - break; + break; #endif #ifdef B460800 case 460800: port.c_cflag |= B460800; - break; + break; #endif default: #if defined (HAVE_LINUX_SERIAL_H) && defined (TIOCSSERIAL) @@ -1009,8 +1009,8 @@ BOOL WINAPI SetCommState( } break; #endif /* Don't have linux/serial.h or lack TIOCSSERIAL */ - - + + COMM_SetCommError(handle,IE_BAUDRATE); close( fd ); ERR("baudrate %ld\n",lpdcb->BaudRate); @@ -1144,7 +1144,7 @@ BOOL WINAPI SetCommState( ERR("Parity\n"); return FALSE; } - + port.c_cflag &= ~CSIZE; switch (bytesize) { @@ -1166,7 +1166,7 @@ BOOL WINAPI SetCommState( ERR("ByteSize\n"); return FALSE; } - + switch (stopbits) { case ONESTOPBIT: port.c_cflag &= ~CSTOPB; @@ -1184,13 +1184,13 @@ BOOL WINAPI SetCommState( #ifdef CRTSCTS if ( lpdcb->fOutxCtsFlow || lpdcb->fRtsControl == RTS_CONTROL_HANDSHAKE - ) + ) { port.c_cflag |= CRTSCTS; TRACE("CRTSCTS\n"); } -#endif - +#endif + if (lpdcb->fDtrControl == DTR_CONTROL_HANDSHAKE) { WARN("DSR/DTR flow control not supported\n"); @@ -1227,7 +1227,7 @@ BOOL WINAPI SetCommState( * RETURNS * * True on success, false if the communication device handle is bad etc - * + * * BUGS * * XonChar and XoffChar are not set. @@ -1242,7 +1242,7 @@ BOOL WINAPI GetCommState( TRACE("handle %d, ptr %p\n", handle, lpdcb); fd = FILE_GetUnixHandle( handle, GENERIC_READ ); - if (fd < 0) + if (fd < 0) { ERR("FILE_GetUnixHandle failed\n"); return FALSE; @@ -1292,22 +1292,22 @@ BOOL WINAPI GetCommState( #ifdef B57600 case B57600: lpdcb->BaudRate = 57600; - break; + break; #endif #ifdef B115200 case B115200: lpdcb->BaudRate = 115200; - break; + break; #endif #ifdef B230400 case B230400: lpdcb->BaudRate = 230400; - break; + break; #endif #ifdef B460800 case B460800: lpdcb->BaudRate = 460800; - break; + break; #endif default: ERR("unknown speed %x \n",speed); @@ -1328,8 +1328,8 @@ BOOL WINAPI GetCommState( break; default: ERR("unknown size %x \n",port.c_cflag & CSIZE); - } - + } + if(port.c_iflag & INPCK) lpdcb->fParity = TRUE; else @@ -1347,14 +1347,14 @@ BOOL WINAPI GetCommState( lpdcb->Parity = EVENPARITY; break; case (PARENB | PARODD): - lpdcb->Parity = ODDPARITY; + lpdcb->Parity = ODDPARITY; break; #ifdef CMSPAR case (PARENB | CMSPAR): - lpdcb->Parity = MARKPARITY; + lpdcb->Parity = MARKPARITY; break; case (PARENB | PARODD | CMSPAR): - lpdcb->Parity = SPACEPARITY; + lpdcb->Parity = SPACEPARITY; break; #endif } @@ -1379,7 +1379,7 @@ BOOL WINAPI GetCommState( if (port.c_cflag & CRTSCTS) { lpdcb->fRtsControl = RTS_CONTROL_HANDSHAKE; lpdcb->fOutxCtsFlow = 1; - } else + } else #endif { lpdcb->fRtsControl = RTS_CONTROL_ENABLE; @@ -1395,8 +1395,8 @@ BOOL WINAPI GetCommState( else lpdcb->fOutX = 0; /* - lpdcb->XonChar = - lpdcb->XoffChar = + lpdcb->XonChar = + lpdcb->XoffChar = */ lpdcb->XonLim = 10; lpdcb->XoffLim = 10; @@ -1404,7 +1404,7 @@ BOOL WINAPI GetCommState( COMM_SetCommError(handle,0); TRACE("OK\n"); - + TRACE("bytesize %d baudrate %ld fParity %d Parity %d stopbits %d\n", lpdcb->ByteSize,lpdcb->BaudRate,lpdcb->fParity, lpdcb->Parity, (lpdcb->StopBits == ONESTOPBIT)?1: @@ -1414,13 +1414,13 @@ BOOL WINAPI GetCommState( #ifdef CRTSCTS if ( lpdcb->fOutxCtsFlow || lpdcb->fRtsControl == RTS_CONTROL_HANDSHAKE - ) + ) TRACE("CRTSCTS\n"); else - + TRACE("~CRTSCTS\n"); - -#endif + +#endif return TRUE; } @@ -1506,7 +1506,7 @@ BOOL WINAPI GetCommTimeouts( * * Sets the timeouts used when reading and writing data to/from COMM ports. * - * ReadIntervalTimeout + * ReadIntervalTimeout * - converted and passes to linux kernel as c_cc[VTIME] * ReadTotalTimeoutMultiplier, ReadTotalTimeoutConstant * - used in ReadFile to calculate GetOverlappedResult's timeout @@ -1601,7 +1601,7 @@ BOOL WINAPI GetCommModemStatus( LPDWORD lpModemStat) /* [out] The control register bits. */ { int fd,mstat, result=FALSE; - + *lpModemStat=0; #ifdef TIOCMGET fd = FILE_GetUnixHandle( hFile, GENERIC_READ ); @@ -1657,7 +1657,7 @@ static void COMM_WaitCommEventService(async_private *ovp) /* FIXME: detect other events */ *commio->buffer = EV_RXCHAR; - + lpOverlapped->Internal = STATUS_SUCCESS; } @@ -1761,11 +1761,11 @@ BOOL WINAPI WaitCommEvent( return ret; } - + /*********************************************************************** * GetCommProperties (KERNEL32.@) * - * This function fills in a structure with the capabilities of the + * This function fills in a structure with the capabilities of the * communications port driver. * * RETURNS @@ -1796,13 +1796,13 @@ BOOL WINAPI GetCommProperties( lpCommProp->dwMaxBaud = BAUD_115200; lpCommProp->dwProvSubType = PST_RS232; lpCommProp->dwProvCapabilities = PCF_DTRDSR | PCF_PARITY_CHECK | PCF_RTSCTS ; - lpCommProp->dwSettableParams = SP_BAUD | SP_DATABITS | SP_HANDSHAKING | + lpCommProp->dwSettableParams = SP_BAUD | SP_DATABITS | SP_HANDSHAKING | SP_PARITY | SP_PARITY_CHECK | SP_STOPBITS ; lpCommProp->dwSettableBaud = BAUD_075 | BAUD_110 | BAUD_134_5 | BAUD_150 | BAUD_300 | BAUD_600 | BAUD_1200 | BAUD_1800 | BAUD_2400 | BAUD_4800 | BAUD_9600 | BAUD_19200 | BAUD_38400 | BAUD_57600 | BAUD_115200 ; lpCommProp->wSettableData = DATABITS_5 | DATABITS_6 | DATABITS_7 | DATABITS_8 ; - lpCommProp->wSettableStopParity = STOPBITS_10 | STOPBITS_15 | STOPBITS_20 | + lpCommProp->wSettableStopParity = STOPBITS_10 | STOPBITS_15 | STOPBITS_20 | PARITY_NONE | PARITY_ODD |PARITY_EVEN | PARITY_MARK | PARITY_SPACE; lpCommProp->dwCurrentTxQueue = lpCommProp->dwMaxTxQueue; lpCommProp->dwCurrentRxQueue = lpCommProp->dwMaxRxQueue; @@ -1816,12 +1816,12 @@ BOOL WINAPI GetCommProperties( * SetDefaultCommConfig is implemented in a DLL (usually SERIALUI.DLL). * This is dependent on the type of COMM port, but since it is doubtful * anybody will get around to implementing support for fancy serial - * ports in WINE, this is hardcoded for the time being. The name of - * this DLL should be stored in and read from the system registry in + * ports in WINE, this is hardcoded for the time being. The name of + * this DLL should be stored in and read from the system registry in * the hive HKEY_LOCAL_MACHINE, key * System\\CurrentControlSet\\Services\\Class\\Ports\\???? * where ???? is the port number... that is determined by PNP - * The DLL should be loaded when the COMM port is opened, and closed + * The DLL should be loaded when the COMM port is opened, and closed * when the COMM port is closed. - MJM 20 June 2000 ***********************************************************************/ static CHAR lpszSerialUI[] = "serialui.dll"; @@ -1909,7 +1909,7 @@ BOOL WINAPI GetCommConfig( HANDLE hFile, /* [in] The communications device. */ LPCOMMCONFIG lpCommConfig, /* [out] The communications configuration of the device (if it fits). */ LPDWORD lpdwSize) /* [in/out] Initially the size of the configuration buffer/structure, - afterwards the number of bytes copied to the buffer or + afterwards the number of bytes copied to the buffer or the needed size of the buffer. */ { BOOL r; @@ -1921,7 +1921,7 @@ BOOL WINAPI GetCommConfig( r = *lpdwSize < sizeof(COMMCONFIG); *lpdwSize = sizeof(COMMCONFIG); - if(!r) + if(!r) return FALSE; lpCommConfig->dwSize = sizeof(COMMCONFIG); diff --git a/dlls/kernel/console.c b/dlls/kernel/console.c index 085cd35ccb3..6b69d9206ee 100644 --- a/dlls/kernel/console.c +++ b/dlls/kernel/console.c @@ -333,7 +333,7 @@ BOOL WINAPI WriteConsoleOutputCharacterA( HANDLE hConsoleOutput, LPCSTR str, DWO * RETURNS * Success: TRUE * Failure: FALSE - * + * */ BOOL WINAPI WriteConsoleOutputAttribute( HANDLE hConsoleOutput, CONST WORD *attr, DWORD length, COORD coord, LPDWORD lpNumAttrsWritten ) @@ -468,7 +468,7 @@ BOOL WINAPI FillConsoleOutputAttribute( HANDLE hConsoleOutput, WORD attr, DWORD /****************************************************************************** * ReadConsoleOutputCharacterA [KERNEL32.@] - * + * */ BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE hConsoleOutput, LPSTR lpstr, DWORD count, COORD coord, LPDWORD read_count) @@ -492,7 +492,7 @@ BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE hConsoleOutput, LPSTR lpstr, DWOR /****************************************************************************** * ReadConsoleOutputCharacterW [KERNEL32.@] - * + * */ BOOL WINAPI ReadConsoleOutputCharacterW( HANDLE hConsoleOutput, LPWSTR buffer, DWORD count, COORD coord, LPDWORD read_count ) @@ -550,7 +550,7 @@ BOOL WINAPI ReadConsoleOutputAttribute(HANDLE hConsoleOutput, LPWORD lpAttribute /****************************************************************************** * ReadConsoleOutputA [KERNEL32.@] - * + * */ BOOL WINAPI ReadConsoleOutputA( HANDLE hConsoleOutput, LPCHAR_INFO lpBuffer, COORD size, COORD coord, LPSMALL_RECT region ) @@ -573,7 +573,7 @@ BOOL WINAPI ReadConsoleOutputA( HANDLE hConsoleOutput, LPCHAR_INFO lpBuffer, COO /****************************************************************************** * ReadConsoleOutputW [KERNEL32.@] - * + * * NOTE: The NT4 (sp5) kernel crashes on me if size is (0,0). I don't * think we need to be *that* compatible. -- AJ */ diff --git a/dlls/kernel/format_msg.c b/dlls/kernel/format_msg.c index be7b58c60f7..435c7d1dd58 100644 --- a/dlls/kernel/format_msg.c +++ b/dlls/kernel/format_msg.c @@ -37,10 +37,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(resource); /* Messages...used by FormatMessage32* (KERNEL32.something) - * + * * They can be specified either directly or using a message ID and * loading them from the resource. - * + * * The resourcedata has following format: * start: * 0: DWORD nrofentries @@ -78,7 +78,7 @@ static INT load_messageA( HMODULE instance, UINT id, WORD lang, if (!hrsrc) return 0; hmem = LoadResource( instance, hrsrc ); if (!hmem) return 0; - + mrd = (PMESSAGE_RESOURCE_DATA)LockResource(hmem); mre = NULL; mrb = &(mrd->Blocks[0]); @@ -177,7 +177,7 @@ DWORD WINAPI FormatMessageA( &&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) || (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0; - if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK) + if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK) FIXME("line wrapping (%lu) not supported.\n", width); from = NULL; if (dwFlags & FORMAT_MESSAGE_FROM_STRING) @@ -306,7 +306,7 @@ DWORD WINAPI FormatMessageA( HeapFree(GetProcessHeap(),0,b); } else { - /* NULL args - copy formatstr + /* NULL args - copy formatstr * (probably wrong) */ while ((lastf0,"GetSystemInfo should return a valid page size"); - + /* Chhose a reasonable allocation size */ memchunk=10*sysInfo.dwPageSize; diff --git a/dlls/kernel/tests/locale.c b/dlls/kernel/tests/locale.c index 2aee6e5af1c..2e1c93bb291 100644 --- a/dlls/kernel/tests/locale.c +++ b/dlls/kernel/tests/locale.c @@ -34,7 +34,7 @@ char GlobalBuffer[BUFFER_SIZE]; // TODO : -// Unicode versions +// Unicode versions // EnumTimeFormatsA // EnumDateFormatsA // LCMapStringA @@ -58,7 +58,7 @@ char buffer[BUFFER_SIZE], Expected[BUFFER_SIZE]; ret = GetLocaleInfoA(lcid, LOCALE_SDAYNAME1, buffer, 0); cmp = strncmp (buffer, Expected, strlen(Expected)); ok (cmp == 0, "GetLocaleInfoA got %s instead of %s", buffer, Expected); - eq (ret, strlen("Monday") + 1, "GetLocaleInfoA with len=0", "%d"); + eq (ret, strlen("Monday") + 1, "GetLocaleInfoA with len=0", "%d"); strcpy(Expected, "Monxx"); memset( buffer, 'x', sizeof (buffer)/sizeof(buffer[0]) ); @@ -66,7 +66,7 @@ char buffer[BUFFER_SIZE], Expected[BUFFER_SIZE]; cmp = strncmp (buffer, Expected, strlen(Expected)); ok (cmp == 0, "GetLocaleInfoA got %s instead of %s", buffer, Expected); eq (ret, 0, "GetLocaleInfoA with len = 3", "%d"); - + strcpy(Expected, "Monday"); memset( buffer, 'x', sizeof (buffer)/sizeof(buffer[0]) ); ret = GetLocaleInfoA(lcid, LOCALE_SDAYNAME1, buffer, 10); @@ -107,7 +107,7 @@ LCID lcid; } strcpy(Expected, "AM 08:56@13"); - curtime.wHour = 8; curtime.wMinute = 56; + curtime.wHour = 8; curtime.wMinute = 56; curtime.wSecond = 13; curtime.wMilliseconds = 22; ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, format, buffer, sizeof(buffer)); cmp = strncmp (Expected, buffer, strlen(Expected)+1); @@ -293,7 +293,7 @@ char Expected[BUFFER_SIZE]; ret = EnumTimeFormatsA(EnumTimeFormatsProc, lcid, 0); eq (ret, 1, "EnumTimeFormats should return 1", "%d"); - ok (strncmp (GlobalBuffer, Expected, strlen(Expected)) == 0, + ok (strncmp (GlobalBuffer, Expected, strlen(Expected)) == 0, "EnumTimeFormats failed"); ok (ret == 1, "EnumTimeFormats should return 1"); } @@ -324,7 +324,7 @@ char buffer1[BUFFER_SIZE], buffer2[BUFFER_SIZE]; ok (ret== 1, "CompareStringA (st1=%s str2=%s) expected result=1", buffer1, buffer2); lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT ); - + strcpy(buffer1, "héhé"); strcpy(buffer2, "hèhè"); ret = CompareStringA(lcid, NORM_IGNORECASE, buffer1, -1, buffer2, -1); ok (ret== 1, "CompareStringA (st1=%s str2=%s) expected result=1", buffer1, buffer2); diff --git a/dlls/kernel/tests/path.c b/dlls/kernel/tests/path.c index 8056ebfdf42..c4b0278169c 100644 --- a/dlls/kernel/tests/path.c +++ b/dlls/kernel/tests/path.c @@ -66,7 +66,7 @@ typedef struct { for wine. It is not very pretty, but it sure beats duplicating this function lots of times */ -static void test_ValidPathA(CHAR *curdir, CHAR *subdir, CHAR *filename, +static void test_ValidPathA(CHAR *curdir, CHAR *subdir, CHAR *filename, CHAR *shortstr, SLpassfail *passfail, CHAR *errstr) { CHAR tmpstr[MAX_PATH], fullpath[MAX_PATH], /*full path to the file (not short/long) */ @@ -119,7 +119,7 @@ static void test_ValidPathA(CHAR *curdir, CHAR *subdir, CHAR *filename, "%s: GetFullPathNameA returned '%s' instead of '%s'", errstr,tmpstr,fullpath); } - } else { + } else { ok(lstrcmpiA(strptr,filename)==0, "%s: GetFullPathNameA returned '%s' instead of '%s'", errstr,strptr,filename); @@ -136,7 +136,7 @@ static void test_ValidPathA(CHAR *curdir, CHAR *subdir, CHAR *filename, passfail->shortlen=len; passfail->shorterror=GetLastError(); } -/* Test GetLongPathNameA functionality +/* Test GetLongPathNameA functionality We test both conversion from GetFullPathNameA and from GetShortPathNameA */ if(pGetLongPathNameA) { @@ -144,7 +144,7 @@ static void test_ValidPathA(CHAR *curdir, CHAR *subdir, CHAR *filename, SetLastError(0); len=pGetLongPathNameA(shortstr,tmpstr,MAX_PATH); if(passfail==NULL) { - ok(len, + ok(len, "%s: GetLongPathNameA failed during Short->Long conversion", errstr); ok(lstrcmpiA(fullpathlong,tmpstr)==0, "%s: GetLongPathNameA returned '%s' instead of '%s'", @@ -186,7 +186,7 @@ static void test_SplitShortPathA(CHAR *path,CHAR *dir,CHAR *eight,CHAR *three) { ext=len; fil=len; done=0; error=0; /* walk backwards over path looking for '.' or '\\' seperators */ for(i=len-1;(i>=0) && (!done);i--) { - if(path[i]=='.') + if(path[i]=='.') if(ext!=len) error=1; else ext=i; else if(path[i]=='\\') { if(i==len-1) { @@ -229,7 +229,7 @@ static void test_LongtoShortA(CHAR *teststr,CHAR *goodstr, characters in the filename. 'valid' indicates whether this would be an allowed filename 'todo' indictaes that wine doesn't get this right yet. - NOTE: We always call this routine with a non-existant filename, so + NOTE: We always call this routine with a non-existant filename, so Get(Short|Long)PathNameA should never pass, but GetFullPathNameA should. */ @@ -317,7 +317,7 @@ static void test_setdir(CHAR *olddir,CHAR *newdir, /* else thest that it fails correctly */ chklen=lstrlenA(olddir); ok(val==0, - "%s: SetCurrentDirectoryA passed when it should have failed",errstr); + "%s: SetCurrentDirectoryA passed when it should have failed",errstr); ok(len==chklen, "%s: SetCurrentDirectory changed the directrory, though it failed", errstr); @@ -351,7 +351,7 @@ static void test_InitPathA(CHAR *newdir) "GetTempPathA should not have modified the buffer"); } } -/* Test GetTmpFileNameA +/* Test GetTmpFileNameA The only test we do here is whether GetTempFileNameA passes or not. We do not thoroughly test this function yet (specifically, whether it behaves correctly when 'unique' is non zero) @@ -363,7 +363,7 @@ static void test_InitPathA(CHAR *newdir) lstrcmpiA(newdir+(lstrlenA(newdir)-lstrlenA(tmpstr1)),tmpstr1)==0, "GetTempPath returned '%s' which doesn't match '%s' or '%s'", newdir,tmpstr,tmpstr1); - + /* Do some CreateDirectoryA tests */ /* It would be nice to do test the SECURITY_ATTRIBUTES, but I don't really understand how they work. @@ -422,13 +422,13 @@ static void test_CurrentDirectoryA(CHAR *origdir, CHAR *newdir) ok(len1==len+1, "GetCurrentDirectoryA returned %d instead of %d",len1,len+1); ok(lstrcmpiA(tmpstr,"aaaaaaa")==0, "GetCurrentDirectoryA should not have modified the buffer"); -/* SetCurrentDirectoryA shouldn't care whether the string has a +/* SetCurrentDirectoryA shouldn't care whether the string has a trailing '\\' or not */ sprintf(tmpstr,"%s\\",newdir); test_setdir(origdir,tmpstr,newdir,1,"check 1"); test_setdir(origdir,newdir,NULL,1,"check 2"); -/* Set the directory to the working area. We just tested that this works, +/* Set the directory to the working area. We just tested that this works, so why check it again. */ SetCurrentDirectoryA(newdir); @@ -569,7 +569,7 @@ static void test_PathNameA(CHAR *curdir) test_ValidPathA(curdir,NONDIR_SHORT,SHORTFILE,tmpstr,&passfail,"test9"); todo_wine { ok(passfail.shortlen==0,"GetShortPathNameA passed when it shouldn't have"); - ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || + ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND, "GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'", passfail.shorterror); @@ -584,7 +584,7 @@ static void test_PathNameA(CHAR *curdir) /* Now try a 8.3 directory, long file name */ test_ValidPathA(curdir,NONDIR_SHORT,LONGFILE,tmpstr,&passfail,"test10"); ok(passfail.shortlen==0,"GetShortPathNameA passed when it shouldn't have"); - ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || + ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND, "GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'", passfail.shorterror); @@ -598,7 +598,7 @@ static void test_PathNameA(CHAR *curdir) /* Next is a long directory, 8.3 file */ test_ValidPathA(curdir,NONDIR_LONG,SHORTFILE,tmpstr,&passfail,"test11"); ok(passfail.shortlen==0,"GetShortPathNameA passed when it shouldn't have"); - ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || + ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND, "GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'", passfail.shorterror); @@ -612,7 +612,7 @@ static void test_PathNameA(CHAR *curdir) /*Lastly a long directory, long file */ test_ValidPathA(curdir,NONDIR_LONG,LONGFILE,tmpstr,&passfail,"test12"); ok(passfail.shortlen==0,"GetShortPathNameA passed when it shouldn't have"); - ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || + ok(passfail.shorterror==ERROR_PATH_NOT_FOUND || passfail.shorterror==ERROR_FILE_NOT_FOUND, "GetShortPathA returned %d and not 'ERROR_PATH_NOT_FOUND'", passfail.shorterror); diff --git a/dlls/kernel/tests/process.c b/dlls/kernel/tests/process.c index f43f95e4b2b..df58baf8837 100644 --- a/dlls/kernel/tests/process.c +++ b/dlls/kernel/tests/process.c @@ -119,7 +119,7 @@ static WCHAR* decodeW(const char* str) if (!len--) return NULL; ptr = (WCHAR*)grab_memory(len * 2 + 1); for (i = 0; i < len; i++) - ptr[i] = (decode_char(str[4 * i]) << 12) | + ptr[i] = (decode_char(str[4 * i]) << 12) | (decode_char(str[4 * i + 1]) << 8) | (decode_char(str[4 * i + 2]) << 4) | (decode_char(str[4 * i + 3]) << 0); @@ -194,33 +194,33 @@ static void doChild(const char* file) /* output of startup info (Ansi) */ GetStartupInfoA(&siA); - childPrintf(hFile, + childPrintf(hFile, "[StartupInfoA]\ncb=%08ld\nlpDesktop=%s\nlpTitle=%s\n" "dwX=%lu\ndwY=%lu\ndwXSize=%lu\ndwYSize=%lu\n" "dwXCountChars=%lu\ndwYCountChars=%lu\ndwFillAttribute=%lu\n" "dwFlags=%lu\nwShowWindow=%u\n" "hStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n", siA.cb, encodeA(siA.lpDesktop), encodeA(siA.lpTitle), - siA.dwX, siA.dwY, siA.dwXSize, siA.dwYSize, - siA.dwXCountChars, siA.dwYCountChars, siA.dwFillAttribute, - siA.dwFlags, siA.wShowWindow, + siA.dwX, siA.dwY, siA.dwXSize, siA.dwYSize, + siA.dwXCountChars, siA.dwYCountChars, siA.dwFillAttribute, + siA.dwFlags, siA.wShowWindow, (DWORD)siA.hStdInput, (DWORD)siA.hStdOutput, (DWORD)siA.hStdError); - /* since GetStartupInfoW is only implemented in win2k, + /* since GetStartupInfoW is only implemented in win2k, * zero out before calling so we can notice the difference */ memset(&siW, 0, sizeof(siW)); GetStartupInfoW(&siW); - childPrintf(hFile, + childPrintf(hFile, "[StartupInfoW]\ncb=%08ld\nlpDesktop=%s\nlpTitle=%s\n" "dwX=%lu\ndwY=%lu\ndwXSize=%lu\ndwYSize=%lu\n" "dwXCountChars=%lu\ndwYCountChars=%lu\ndwFillAttribute=%lu\n" "dwFlags=%lu\nwShowWindow=%u\n" "hStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n", siW.cb, encodeW(siW.lpDesktop), encodeW(siW.lpTitle), - siW.dwX, siW.dwY, siW.dwXSize, siW.dwYSize, - siW.dwXCountChars, siW.dwYCountChars, siW.dwFillAttribute, - siW.dwFlags, siW.wShowWindow, + siW.dwX, siW.dwY, siW.dwXSize, siW.dwYSize, + siW.dwXCountChars, siW.dwYCountChars, siW.dwFillAttribute, + siW.dwFlags, siW.wShowWindow, (DWORD)siW.hStdInput, (DWORD)siW.hStdOutput, (DWORD)siW.hStdError); /* Arguments */ @@ -286,7 +286,7 @@ static void doChild(const char* file) if (GetCurrentDirectoryW(sizeof(bufW) / sizeof(bufW[0]), bufW)) childPrintf(hFile, "CurrDirW=%s\n", encodeW(bufW)); childPrintf(hFile, "\n"); - + CloseHandle(hFile); } @@ -342,7 +342,7 @@ static int strCmp(const char* s1, const char* s2, BOOL sensitive) } while (0) /* using !expect insures that the test will fail if the sect/key isn't present - * in result file + * in result file */ #define okChildInt(sect, key, expect) \ do { \ diff --git a/dlls/kernel/thunk.c b/dlls/kernel/thunk.c index 683ab7692d8..ba46ac8bf57 100644 --- a/dlls/kernel/thunk.c +++ b/dlls/kernel/thunk.c @@ -62,7 +62,7 @@ void WINAPI LogApiThk( LPSTR func ) /*********************************************************************** * LogApiThkLSF (KERNEL32.42) - * + * * NOTE: needs to preserve all registers! */ void WINAPI LogApiThkLSF( LPSTR func, CONTEXT86 *context ) @@ -72,7 +72,7 @@ void WINAPI LogApiThkLSF( LPSTR func, CONTEXT86 *context ) /*********************************************************************** * LogApiThkSL (KERNEL32.44) - * + * * NOTE: needs to preserve all registers! */ void WINAPI LogApiThkSL( LPSTR func, CONTEXT86 *context ) @@ -82,7 +82,7 @@ void WINAPI LogApiThkSL( LPSTR func, CONTEXT86 *context ) /*********************************************************************** * LogCBThkSL (KERNEL32.47) - * + * * NOTE: needs to preserve all registers! */ void WINAPI LogCBThkSL( LPSTR func, CONTEXT86 *context ) @@ -92,7 +92,7 @@ void WINAPI LogCBThkSL( LPSTR func, CONTEXT86 *context ) /*********************************************************************** * Generates a FT_Prolog call. - * + * * 0FB6D1 movzbl edx,cl * 8B1495xxxxxxxx mov edx,[4*edx + targetTable] * 68xxxxxxxx push FT_Prolog @@ -141,14 +141,14 @@ static void _write_qtthunk( /*********************************************************************** * _loadthunk */ -static LPVOID _loadthunk(LPCSTR module, LPCSTR func, LPCSTR module32, +static LPVOID _loadthunk(LPCSTR module, LPCSTR func, LPCSTR module32, struct ThunkDataCommon *TD32, DWORD checksum) { struct ThunkDataCommon *TD16; HMODULE hmod; int ordinal; - if ((hmod = LoadLibrary16(module)) <= 32) + if ((hmod = LoadLibrary16(module)) <= 32) { ERR("(%s, %s, %s): Unable to load '%s', error %d\n", module, func, module32, module, hmod); @@ -166,7 +166,7 @@ static LPVOID _loadthunk(LPCSTR module, LPCSTR func, LPCSTR module32, if (TD32 && memcmp(TD16->magic, TD32->magic, 4)) { ERR("(%s, %s, %s): Bad magic %c%c%c%c (should be %c%c%c%c)\n", - module, func, module32, + module, func, module32, TD16->magic[0], TD16->magic[1], TD16->magic[2], TD16->magic[3], TD32->magic[0], TD32->magic[1], TD32->magic[2], TD32->magic[3]); return 0; @@ -210,7 +210,7 @@ LPVOID WINAPI GetThunkBuff(void) * ThunkConnect32 (KERNEL32.@) * Connects a 32bit and a 16bit thunkbuffer. */ -UINT WINAPI ThunkConnect32( +UINT WINAPI ThunkConnect32( struct ThunkDataCommon *TD, /* [in/out] thunkbuffer */ LPSTR thunkfun16, /* [in] win16 thunkfunction */ LPSTR module16, /* [in] name of win16 dll */ @@ -236,11 +236,11 @@ UINT WINAPI ThunkConnect32( } else { - ERR("Invalid magic %c%c%c%c\n", + ERR("Invalid magic %c%c%c%c\n", TD->magic[0], TD->magic[1], TD->magic[2], TD->magic[3]); return 0; } - + switch (dwReason) { case DLL_PROCESS_ATTACH: @@ -270,7 +270,7 @@ UINT WINAPI ThunkConnect32( tdb->next = SL32->data->targetDB; /* FIXME: not thread-safe! */ SL32->data->targetDB = tdb; - TRACE("Process %08lx allocated TargetDB entry for ThunkDataSL %08lx\n", + TRACE("Process %08lx allocated TargetDB entry for ThunkDataSL %08lx\n", GetCurrentProcessId(), (DWORD)SL32->data); } else @@ -332,7 +332,7 @@ void WINAPI QT_Thunk( CONTEXT86 *context ) /********************************************************************** * FT_Prolog (KERNEL32.@) - * + * * The set of FT_... thunk routines is used instead of QT_Thunk, * if structures have to be converted from 32-bit to 16-bit * (change of member alignment, conversion of members). @@ -349,7 +349,7 @@ void WINAPI QT_Thunk( CONTEXT86 *context ) * bits 10..15 number of DWORD arguments * * Output: A new stackframe is created, and a 64 byte buffer - * allocated on the stack. The layout of the stack + * allocated on the stack. The layout of the stack * on return is as follows: * * (ebp+4) return address to caller of thunk function @@ -371,7 +371,7 @@ void WINAPI QT_Thunk( CONTEXT86 *context ) * (ebp-64) * * ESP is EBP-64 after return. - * + * */ void WINAPI FT_Prolog( CONTEXT86 *context ) @@ -398,7 +398,7 @@ void WINAPI FT_Prolog( CONTEXT86 *context ) /********************************************************************** * FT_Thunk (KERNEL32.@) * - * This routine performs the actual call to 16-bit code, + * This routine performs the actual call to 16-bit code, * similar to QT_Thunk. The differences are: * - The call target is taken from the buffer created by FT_Prolog * - Those arguments requested by the thunk code (by setting the @@ -407,11 +407,11 @@ void WINAPI FT_Prolog( CONTEXT86 *context ) * are guaranteed to point to structures copied to the stack * by the thunk code, so we always use the 16-bit stack selector * for those addresses). - * + * * The bit #i of EBP-20 corresponds here to the DWORD starting at * ESP+4 + 2*i. - * - * FIXME: It is unclear what happens if there are more than 32 WORDs + * + * FIXME: It is unclear what happens if there are more than 32 WORDs * of arguments, so that the single DWORD bitmap is no longer * sufficient ... */ @@ -464,8 +464,8 @@ void WINAPI FT_Thunk( CONTEXT86 *context ) * * One of the FT_ExitNN functions is called at the end of the thunk code. * It removes the stack frame created by FT_Prolog, moves the function - * return from EBX to EAX (yes, FT_Thunk did use EAX for the return - * value, but the thunk code has moved it from EAX to EBX in the + * return from EBX to EAX (yes, FT_Thunk did use EAX for the return + * value, but the thunk code has moved it from EAX to EBX in the * meantime ... :-), restores the caller's EBX, ESI, and EDI registers, * and perform a return to the CALLER of the thunk code (while removing * the given number of arguments from the caller's stack). @@ -568,7 +568,7 @@ void WINAPI FT_Exit56(CONTEXT86 *context) { FT_Exit(context, 56); } /*********************************************************************** * ThunkInitLS (KERNEL32.43) - * A thunkbuffer link routine + * A thunkbuffer link routine * The thunkbuf looks like: * * 00: DWORD length ? don't know exactly @@ -600,14 +600,14 @@ DWORD WINAPI ThunkInitLS( /*********************************************************************** * Common32ThkLS (KERNEL32.45) - * + * * This is another 32->16 thunk, independent of the QT_Thunk/FT_Thunk - * style thunks. The basic difference is that the parameter conversion + * style thunks. The basic difference is that the parameter conversion * is done completely on the *16-bit* side here. Thus we do not call * the 16-bit target directly, but call a common entry point instead. * This entry function then calls the target according to the target * number passed in the DI register. - * + * * Input: EAX SEGPTR to the common 16-bit entry point * CX offset in thunk table (target number * 4) * DX error return value if execution fails (unclear???) @@ -620,14 +620,14 @@ DWORD WINAPI ThunkInitLS( * (esp+40) 32-bit arguments * ... * (esp+8) 32 byte of stack space available as buffer - * (esp) 8 byte return address for use with 0x66 lret - * + * (esp) 8 byte return address for use with 0x66 lret + * * The called 16-bit stub uses a 0x66 lret to return to 32-bit code, * and uses the EAX register to return a DWORD return value. - * Thus we need to use a special assembly glue routine + * Thus we need to use a special assembly glue routine * (CallRegisterLongProc instead of CallRegisterShortProc). * - * Finally, we return to the caller, popping the arguments off + * Finally, we return to the caller, popping the arguments off * the stack. The number of arguments to be popped is returned * in the BL register by the called 16-bit routine. * @@ -667,12 +667,12 @@ void WINAPI Common32ThkLS( CONTEXT86 *context ) * YET Another 32->16 thunk. The difference to Common32ThkLS is that * argument processing is done on both the 32-bit and the 16-bit side: * The 32-bit side prepares arguments, copying them onto the stack. - * - * When this routine is called, the first word on the stack is the + * + * When this routine is called, the first word on the stack is the * number of argument bytes prepared by the 32-bit code, and EDX * contains the 16-bit target address. * - * The called 16-bit routine is another relaycode, doing further + * The called 16-bit routine is another relaycode, doing further * argument processing and then calling the real 16-bit target * whose address is stored at [bp-04]. * @@ -680,7 +680,7 @@ void WINAPI Common32ThkLS( CONTEXT86 *context ) * After return from the 16-bit relaycode, the arguments need * to be copied *back* to the 32-bit stack, since the 32-bit * relaycode processes output parameters. - * + * * Note that we copy twice the number of arguments, since some of the * 16-bit relaycodes in SYSTHUNK.DLL directly access the original * arguments of the caller! @@ -710,7 +710,7 @@ void WINAPI OT_32ThkLSF( CONTEXT86 *context ) context->Edx = context16.Edx; /* Copy modified buffers back to 32-bit stack */ - memcpy( (LPBYTE)context->Esp, + memcpy( (LPBYTE)context->Esp, (LPBYTE)CURRENT_STACK16 - argsize, argsize ); context->Esp += LOWORD(context16.Esp) - @@ -770,7 +770,7 @@ LPVOID WINAPI ThunkInitLSF( *(DWORD*)(thunk+0x35) = (DWORD)GetProcAddress(hkrnl32,(LPSTR)90); *(DWORD*)(thunk+0x6D) = (DWORD)GetProcAddress(hkrnl32,(LPSTR)89); - + if (!(addr = _loadthunk( dll16, thkbuf, dll32, NULL, len ))) return 0; @@ -783,21 +783,21 @@ LPVOID WINAPI ThunkInitLSF( /*********************************************************************** * FT_PrologPrime (KERNEL32.89) - * + * * This function is called from the relay code installed by - * ThunkInitLSF. It replaces the location from where it was + * ThunkInitLSF. It replaces the location from where it was * called by a standard FT_Prolog call stub (which is 'primed' * by inserting the correct target table pointer). * Finally, it calls that stub. - * + * * Input: ECX target number + flags (passed through to FT_Prolog) - * (ESP) offset of location where target table pointer + * (ESP) offset of location where target table pointer * is stored, relative to the start of the relay code * (ESP+4) pointer to start of relay code * (this is where the FT_Prolog call stub gets written to) - * + * * Note: The two DWORD arguments get popped off the stack. - * + * */ void WINAPI FT_PrologPrime( CONTEXT86 *context ) { @@ -820,13 +820,13 @@ void WINAPI FT_PrologPrime( CONTEXT86 *context ) /*********************************************************************** * QT_ThunkPrime (KERNEL32.90) * - * This function corresponds to FT_PrologPrime, but installs a + * This function corresponds to FT_PrologPrime, but installs a * call stub for QT_Thunk instead. * * Input: (EBP-4) target number (passed through to QT_Thunk) * EDX target table pointer location offset * EAX start of relay code - * + * */ void WINAPI QT_ThunkPrime( CONTEXT86 *context ) { @@ -925,7 +925,7 @@ DWORD WINAPIV SSCall( if(TRACE_ON(thunk)) { DPRINTF("(%ld,0x%08lx,%p,[",nr,flags,fun); - for (i=0;ilong registers. * - * 665A pop edx + * 665A pop edx * 6668x arg2 x pushl * 6652 push edx * EAx arg1 x jmpf @@ -1048,7 +1048,7 @@ FreeSLCallback( * GetTEBSelectorFS (KERNEL.475) * Set the 16-bit %fs to the 32-bit %fs (current TEB selector) */ -void WINAPI GetTEBSelectorFS16(void) +void WINAPI GetTEBSelectorFS16(void) { CURRENT_STACK16->fs = wine_get_fs(); } @@ -1095,7 +1095,7 @@ void WINAPI K32Thk1632Prolog( CONTEXT86 *context ) This means that SYSTHUNK.DLL itself switches to a 32-bit stack, and does a far call to the 32-bit code segment of OLECLI32/OLESVR32. Unfortunately, our CallTo/CallFrom mechanism is therefore completely - bypassed, which means it will crash the next time the 32-bit OLE + bypassed, which means it will crash the next time the 32-bit OLE code thunks down again to 16-bit (this *will* happen!). The following hack tries to recognize this situation. @@ -1108,8 +1108,8 @@ void WINAPI K32Thk1632Prolog( CONTEXT86 *context ) If we recognize this situation, we try to simulate the actions of our CallTo/CallFrom mechanism by copying the 16-bit stack - to our 32-bit stack, creating a proper STACK16FRAME and - updating cur_stack. */ + to our 32-bit stack, creating a proper STACK16FRAME and + updating cur_stack. */ if ( code[5] == 0xFF && code[6] == 0x55 && code[7] == 0xFC && code[13] == 0x66 && code[14] == 0xCB) @@ -1519,15 +1519,15 @@ void WINAPI SetThunkletCallbackGlue16( FARPROC glueLS, SEGPTR glueSL ) /*********************************************************************** * THUNK_FindThunklet */ -THUNKLET *THUNK_FindThunklet( DWORD target, DWORD relay, - DWORD glue, BYTE type ) +THUNKLET *THUNK_FindThunklet( DWORD target, DWORD relay, + DWORD glue, BYTE type ) { - THUNKLET *thunk; + THUNKLET *thunk; for (thunk = ThunkletAnchor; thunk; thunk = thunk->next) if ( thunk->type == type && thunk->target == target - && thunk->relay == relay + && thunk->relay == relay && ( type == THUNKLET_TYPE_LS ? ( thunk->glue == glue - (DWORD)&thunk->type ) : ( thunk->glue == glue ) ) ) @@ -1539,8 +1539,8 @@ THUNKLET *THUNK_FindThunklet( DWORD target, DWORD relay, /*********************************************************************** * THUNK_AllocLSThunklet */ -FARPROC THUNK_AllocLSThunklet( SEGPTR target, DWORD relay, - FARPROC glue, HTASK16 owner ) +FARPROC THUNK_AllocLSThunklet( SEGPTR target, DWORD relay, + FARPROC glue, HTASK16 owner ) { THUNKLET *thunk = THUNK_FindThunklet( (DWORD)target, relay, (DWORD)glue, THUNKLET_TYPE_LS ); @@ -1629,22 +1629,22 @@ BOOL16 WINAPI IsSLThunklet16( THUNKLET *thunk ) /*********************************************************************** * AllocLSThunkletSysthunk (KERNEL.607) */ -FARPROC WINAPI AllocLSThunkletSysthunk16( SEGPTR target, +FARPROC WINAPI AllocLSThunkletSysthunk16( SEGPTR target, FARPROC relay, DWORD dummy ) { if (!ThunkletSysthunkGlueLS) THUNK_Init(); - return THUNK_AllocLSThunklet( (SEGPTR)relay, (DWORD)target, + return THUNK_AllocLSThunklet( (SEGPTR)relay, (DWORD)target, ThunkletSysthunkGlueLS, GetCurrentTask() ); } /*********************************************************************** * AllocSLThunkletSysthunk (KERNEL.608) */ -SEGPTR WINAPI AllocSLThunkletSysthunk16( FARPROC target, +SEGPTR WINAPI AllocSLThunkletSysthunk16( FARPROC target, SEGPTR relay, DWORD dummy ) { if (!ThunkletSysthunkGlueSL) THUNK_Init(); - return THUNK_AllocSLThunklet( (FARPROC)relay, (DWORD)target, + return THUNK_AllocSLThunklet( (FARPROC)relay, (DWORD)target, ThunkletSysthunkGlueSL, GetCurrentTask() ); } @@ -1652,34 +1652,34 @@ SEGPTR WINAPI AllocSLThunkletSysthunk16( FARPROC target, /*********************************************************************** * AllocLSThunkletCallbackEx (KERNEL.567) */ -FARPROC WINAPI AllocLSThunkletCallbackEx16( SEGPTR target, +FARPROC WINAPI AllocLSThunkletCallbackEx16( SEGPTR target, DWORD relay, HTASK16 task ) { THUNKLET *thunk = MapSL( target ); if ( !thunk ) return NULL; - if ( IsSLThunklet16( thunk ) && thunk->relay == relay + if ( IsSLThunklet16( thunk ) && thunk->relay == relay && thunk->glue == (DWORD)ThunkletCallbackGlueSL ) return (FARPROC)thunk->target; - return THUNK_AllocLSThunklet( target, relay, + return THUNK_AllocLSThunklet( target, relay, ThunkletCallbackGlueLS, task ); } /*********************************************************************** * AllocSLThunkletCallbackEx (KERNEL.568) */ -SEGPTR WINAPI AllocSLThunkletCallbackEx16( FARPROC target, +SEGPTR WINAPI AllocSLThunkletCallbackEx16( FARPROC target, DWORD relay, HTASK16 task ) { THUNKLET *thunk = (THUNKLET *)target; if ( !thunk ) return 0; - if ( IsLSThunklet( thunk ) && thunk->relay == relay + if ( IsLSThunklet( thunk ) && thunk->relay == relay && thunk->glue == (DWORD)ThunkletCallbackGlueLS - (DWORD)&thunk->type ) return (SEGPTR)thunk->target; - return THUNK_AllocSLThunklet( target, relay, + return THUNK_AllocSLThunklet( target, relay, ThunkletCallbackGlueSL, task ); } @@ -1708,12 +1708,12 @@ SEGPTR WINAPI AllocSLThunkletCallback16( FARPROC target, DWORD relay ) FARPROC WINAPI FindLSThunkletCallback( SEGPTR target, DWORD relay ) { THUNKLET *thunk = MapSL( target ); - if ( thunk && IsSLThunklet16( thunk ) && thunk->relay == relay + if ( thunk && IsSLThunklet16( thunk ) && thunk->relay == relay && thunk->glue == (DWORD)ThunkletCallbackGlueSL ) return (FARPROC)thunk->target; - thunk = THUNK_FindThunklet( (DWORD)target, relay, - (DWORD)ThunkletCallbackGlueLS, + thunk = THUNK_FindThunklet( (DWORD)target, relay, + (DWORD)ThunkletCallbackGlueLS, THUNKLET_TYPE_LS ); return (FARPROC)thunk; } @@ -1725,12 +1725,12 @@ FARPROC WINAPI FindLSThunkletCallback( SEGPTR target, DWORD relay ) SEGPTR WINAPI FindSLThunkletCallback( FARPROC target, DWORD relay ) { THUNKLET *thunk = (THUNKLET *)target; - if ( thunk && IsLSThunklet( thunk ) && thunk->relay == relay + if ( thunk && IsLSThunklet( thunk ) && thunk->relay == relay && thunk->glue == (DWORD)ThunkletCallbackGlueLS - (DWORD)&thunk->type ) return (SEGPTR)thunk->target; - thunk = THUNK_FindThunklet( (DWORD)target, relay, - (DWORD)ThunkletCallbackGlueSL, + thunk = THUNK_FindThunklet( (DWORD)target, relay, + (DWORD)ThunkletCallbackGlueSL, THUNKLET_TYPE_SL ); return get_segptr( thunk ); } @@ -1759,7 +1759,7 @@ static FARPROC *CBClientRelay32[ N_CBC_TOTAL ]; /*********************************************************************** * RegisterCBClient (KERNEL.619) */ -INT16 WINAPI RegisterCBClient16( INT16 wCBCId, +INT16 WINAPI RegisterCBClient16( INT16 wCBCId, SEGPTR relay16, FARPROC *relay32 ) { /* Search for free Callback ID */ @@ -1783,11 +1783,11 @@ INT16 WINAPI RegisterCBClient16( INT16 wCBCId, /*********************************************************************** * UnRegisterCBClient (KERNEL.622) */ -INT16 WINAPI UnRegisterCBClient16( INT16 wCBCId, +INT16 WINAPI UnRegisterCBClient16( INT16 wCBCId, SEGPTR relay16, FARPROC *relay32 ) { - if ( wCBCId >= N_CBC_FIXED && wCBCId < N_CBC_TOTAL - && CBClientRelay16[ wCBCId ] == relay16 + if ( wCBCId >= N_CBC_FIXED && wCBCId < N_CBC_TOTAL + && CBClientRelay16[ wCBCId ] == relay16 && CBClientRelay32[ wCBCId ] == relay32 ) { CBClientRelay16[ wCBCId ] = 0; @@ -1820,7 +1820,7 @@ void WINAPI CBClientGlueSL( CONTEXT86 *context ) SEGPTR stackSeg = stack16_push( 12 ); LPWORD stackLin = MapSL( stackSeg ); SEGPTR glue, *glueTab; - + stackLin[3] = BP_reg( context ); stackLin[2] = SI_reg( context ); stackLin[1] = DI_reg( context ); diff --git a/dlls/kernel/time.c b/dlls/kernel/time.c index 85a7a3a2fcb..bdb69917827 100644 --- a/dlls/kernel/time.c +++ b/dlls/kernel/time.c @@ -51,19 +51,19 @@ struct tagTZ_INFO static const struct tagTZ_INFO TZ_INFO[] = { - {"MHT", + {"MHT", {'D','a','t','e','l','i','n','e',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'}, -720, 0}, - {"SST", + {"SST", {'S','a','m','o','a',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'}, 660, 0}, {"HST", {'H','a','w','a','i','i','a','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'}, 600, 0}, - {"AKDT", + {"AKDT", {'A','l','a','s','k','a','n',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'}, 480, 1}, - {"PDT", + {"PDT", {'P','a','c','i','f','i','c',' ','S','t','a','n','d','a','r','d',' ','T','i','m','e','\0'}, 420, 1}, {"MST", @@ -258,7 +258,7 @@ static const WCHAR* TIME_GetTZAsStr (time_t utc, int bias, int dst) if (!strftime (psTZName, 7, "%Z", ptm)) return (NULL); - for (i=0; i<(sizeof(TZ_INFO) / sizeof(struct tagTZ_INFO)); i++) + for (i=0; i<(sizeof(TZ_INFO) / sizeof(struct tagTZ_INFO)); i++) { if ( strcmp(TZ_INFO[i].psTZFromUnix, psTZName) == 0 && TZ_INFO[i].bias == bias && @@ -334,7 +334,7 @@ BOOL WINAPI SetLocalTime( ERR("Cannot set time to %d/%d/%d %d:%d:%d Time adjustment %ld %s\n", systime->wYear, systime->wMonth, systime->wDay, systime->wHour, systime->wMinute, systime->wSecond, - sec-oldsec, err == -1 ? "No Permission" : + sec-oldsec, err == -1 ? "No Permission" : sec==(time_t)-1 ? "" : "is too large." ); return FALSE; } @@ -535,7 +535,7 @@ VOID WINAPI GetSystemTimeAsFileTime( * * Differences to UnixTimeToFileTime: * 1) Divided by CLK_TCK - * 2) Time is relative. There is no 'starting date', so there is + * 2) Time is relative. There is no 'starting date', so there is * no need in offset correction, like in UnixTimeToFileTime */ static void TIME_ClockTimeToFileTime(clock_t unix_time, LPFILETIME filetime) @@ -589,7 +589,7 @@ int WINAPI GetCalendarInfoA(LCID Locale, CALID Calendar, CALTYPE CalType, int ret; LPWSTR lpCalDataW = NULL; - FIXME("(%08lx,%08lx,%08lx,%p,%d,%p): quarter-stub\n", + FIXME("(%08lx,%08lx,%08lx,%p,%d,%p): quarter-stub\n", Locale, Calendar, CalType, lpCalData, cchData, lpValue); /* FIXME: Should verify if Locale is allowable in ANSI, as per MSDN */ @@ -611,8 +611,8 @@ int WINAPI GetCalendarInfoA(LCID Locale, CALID Calendar, CALTYPE CalType, */ int WINAPI GetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType, LPWSTR lpCalData, int cchData, LPDWORD lpValue) -{ - FIXME("(%08lx,%08lx,%08lx,%p,%d,%p): quarter-stub\n", +{ + FIXME("(%08lx,%08lx,%08lx,%p,%d,%p): quarter-stub\n", Locale, Calendar, CalType, lpCalData, cchData, lpValue); if (CalType & CAL_NOUSEROVERRIDE) @@ -746,7 +746,7 @@ int WINAPI GetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType, */ int WINAPI SetCalendarInfoA(LCID Locale, CALID Calendar, CALTYPE CalType, LPCSTR lpCalData) { - FIXME("(%08lx,%08lx,%08lx,%s): stub\n", + FIXME("(%08lx,%08lx,%08lx,%s): stub\n", Locale, Calendar, CalType, debugstr_a(lpCalData)); return 0; } @@ -757,7 +757,7 @@ int WINAPI SetCalendarInfoA(LCID Locale, CALID Calendar, CALTYPE CalType, LPCSTR */ int WINAPI SetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType, LPCWSTR lpCalData) { - FIXME("(%08lx,%08lx,%08lx,%s): stub\n", + FIXME("(%08lx,%08lx,%08lx,%s): stub\n", Locale, Calendar, CalType, debugstr_w(lpCalData)); return 0; } diff --git a/dlls/kernel/toolhelp.c b/dlls/kernel/toolhelp.c index 62638fb3b75..f128d650979 100644 --- a/dlls/kernel/toolhelp.c +++ b/dlls/kernel/toolhelp.c @@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(toolhelp); -/* FIXME: to make this work, we have to call back all these registered +/* FIXME: to make this work, we have to call back all these registered * functions from all over the WINE code. Someone with more knowledge than * me please do that. -Marcus */ @@ -86,7 +86,7 @@ BOOL16 WINAPI NotifyRegister16( HTASK16 htask, FARPROC16 lpfnCallback, BOOL16 WINAPI NotifyUnregister16( HTASK16 htask ) { int i; - + FIXME("(%x), semi-stub.\n", htask ); if (!htask) htask = GetCurrentTask(); for (i=nrofnotifys;i--;) @@ -152,14 +152,14 @@ BOOL16 WINAPI InterruptUnRegister16( HTASK16 task ) BOOL16 WINAPI TimerCount16( TIMERINFO *pTimerInfo ) { /* FIXME - * In standard mode, dwmsSinceStart = dwmsThisVM + * In standard mode, dwmsSinceStart = dwmsThisVM * * I tested this, under Windows in enhanced mode, and * if you never switch VM (ie start/stop DOS) these - * values should be the same as well. + * values should be the same as well. * * Also, Wine should adjust for the hardware timer - * to reduce the amount of error to ~1ms. + * to reduce the amount of error to ~1ms. * I can't be bothered, can you? */ pTimerInfo->dwmsSinceStart = pTimerInfo->dwmsThisVM = GetTickCount(); @@ -202,7 +202,7 @@ FARPROC16 WINAPI ToolHelpHook16(FARPROC16 lpfnNotifyHandler) /*********************************************************************** * CreateToolhelp32Snapshot (KERNEL32.@) */ -HANDLE WINAPI CreateToolhelp32Snapshot( DWORD flags, DWORD process ) +HANDLE WINAPI CreateToolhelp32Snapshot( DWORD flags, DWORD process ) { HANDLE ret; @@ -402,7 +402,7 @@ BOOL WINAPI Module32Next(HANDLE hSnapshot, LPMODULEENTRY32 lpme) * GlobalMasterHandle (KERNEL.28) * * - * Should return selector and handle of the information structure for + * Should return selector and handle of the information structure for * the global heap. selector and handle are stored in the THHOOK as * pGlobalHeap and hGlobalHeap. * As Wine doesn't have this structure, we return both values as zero diff --git a/dlls/kernel/utthunk.c b/dlls/kernel/utthunk.c index 82f92474a66..ba649b6bf6d 100644 --- a/dlls/kernel/utthunk.c +++ b/dlls/kernel/utthunk.c @@ -1,7 +1,7 @@ /* * Win32s Universal Thunk API * - * Copyright 1999 Ulrich Weigand + * Copyright 1999 Ulrich Weigand * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -56,7 +56,7 @@ typedef struct _UTINFO struct _UTINFO *next; HMODULE hModule; HMODULE16 hModule16; - + UT16THUNK ut16; UT32THUNK ut32; @@ -66,9 +66,9 @@ static UTINFO *UT_head; /* head of Universal Thunk list */ typedef DWORD (CALLBACK *UTGLUEPROC)( LPVOID lpBuff, DWORD dwUserDefined ); -BOOL WINAPI UTRegister( HMODULE hModule, LPSTR lpsz16BITDLL, +BOOL WINAPI UTRegister( HMODULE hModule, LPSTR lpsz16BITDLL, LPSTR lpszInitName, LPSTR lpszProcName, - FARPROC *ppfn32Thunk, FARPROC pfnUT32CallBack, + FARPROC *ppfn32Thunk, FARPROC pfnUT32CallBack, LPVOID lpBuff ); VOID WINAPI UTUnRegister( HMODULE hModule ); @@ -102,7 +102,7 @@ DWORD WINAPI UTGlue16( LPVOID lpBuff, DWORD dwUserDefined, SEGPTR *translationLi /**************************************************************************** * UTGlue32 */ -static DWORD WINAPI UTGlue32( FARPROC16 target, LPVOID lpBuff, DWORD dwUserDefined, +static DWORD WINAPI UTGlue32( FARPROC16 target, LPVOID lpBuff, DWORD dwUserDefined, LPVOID translationList[] ) { SEGPTR segBuff, *segptrList = NULL; @@ -125,7 +125,7 @@ static DWORD WINAPI UTGlue32( FARPROC16 target, LPVOID lpBuff, DWORD dwUserDefin } for ( i = 0; i < nList; i++ ) - segptrList[i] = *(SEGPTR *)translationList[i] + segptrList[i] = *(SEGPTR *)translationList[i] = MapLS( *(LPVOID *)translationList[i] ); } @@ -227,14 +227,14 @@ static UTINFO *UTFind( HMODULE hModule ) /**************************************************************************** * UTRegister (KERNEL32.@) */ -BOOL WINAPI UTRegister( HMODULE hModule, LPSTR lpsz16BITDLL, +BOOL WINAPI UTRegister( HMODULE hModule, LPSTR lpsz16BITDLL, LPSTR lpszInitName, LPSTR lpszProcName, - FARPROC *ppfn32Thunk, FARPROC pfnUT32CallBack, + FARPROC *ppfn32Thunk, FARPROC pfnUT32CallBack, LPVOID lpBuff ) { UTINFO *ut; - HMODULE16 hModule16; - FARPROC16 target16, init16; + HMODULE16 hModule16; + FARPROC16 target16, init16; /* Load 16-bit DLL and get UTProc16 entry point */ @@ -279,7 +279,7 @@ BOOL WINAPI UTRegister( HMODULE hModule, LPSTR lpsz16BITDLL, /* Return 32-bit thunk */ *ppfn32Thunk = (FARPROC) &ut->ut32; - + return TRUE; } @@ -300,7 +300,7 @@ VOID WINAPI UTUnRegister( HMODULE hModule ) } RtlReleasePebLock(); - if ( hModule16 ) + if ( hModule16 ) FreeLibrary16( hModule16 ); } diff --git a/dlls/kernel/win87em.c b/dlls/kernel/win87em.c index 394b7d66901..573607abe5a 100644 --- a/dlls/kernel/win87em.c +++ b/dlls/kernel/win87em.c @@ -40,7 +40,7 @@ struct Win87EmInfoStruct * (int13 error reporting of coprocessor) */ -/* have a look at /usr/src/linux/arch/i386/math-emu/ *.[ch] for more info +/* have a look at /usr/src/linux/arch/i386/math-emu/ *.[ch] for more info * especially control_w.h and status_w.h */ /* FIXME: Still rather skeletal implementation only */ @@ -122,7 +122,7 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context ) WIN87_Init(context); break; - case 2: /* deinstall emulator (decrease instanceref), deinstall NMI vector + case 2: /* deinstall emulator (decrease instanceref), deinstall NMI vector * if zero. Every '0' call should have a matching '2' call. */ WIN87_Init(context); @@ -131,7 +131,7 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context ) if (!RefCount && Installed) RestoreInt02h(); #endif - + break; case 3: @@ -173,8 +173,8 @@ void WINAPI WIN87_fpmath( CONTEXT86 *context ) /* OUT: DX:AX variable popped */ { DWORD dw=0; - /* I don't know much about asm() programming. This could be - * wrong. + /* I don't know much about asm() programming. This could be + * wrong. */ /* FIXME: could someone who really understands asm() fix this please? --AJ */ /* __asm__("fistp %0;wait" : "=m" (dw) : : "memory"); */ diff --git a/dlls/kernel/windebug.c b/dlls/kernel/windebug.c index 19c00891a13..e9717136372 100644 --- a/dlls/kernel/windebug.c +++ b/dlls/kernel/windebug.c @@ -39,7 +39,7 @@ void WINAPI WinNotify16(CONTEXT86 *context) case 0x000E: case 0x0060: /* do nothing */ break; - case 0x0062: + case 0x0062: break; case 0x0063: /* do something complicated */ break; @@ -54,5 +54,5 @@ void WINAPI WinNotify16(CONTEXT86 *context) break; default: break; - } + } } diff --git a/dlls/kernel/wowthunk.c b/dlls/kernel/wowthunk.c index a9c2155292f..8d29cbdfdae 100644 --- a/dlls/kernel/wowthunk.c +++ b/dlls/kernel/wowthunk.c @@ -1,7 +1,7 @@ /* * Win32 WOW Generic Thunk API * - * Copyright 1999 Ulrich Weigand + * Copyright 1999 Ulrich Weigand * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,8 +29,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(thunk); /* - * These are the 16-bit side WOW routines. They reside in wownt16.h - * in the SDK; since we don't support Win16 source code anyway, I've + * These are the 16-bit side WOW routines. They reside in wownt16.h + * in the SDK; since we don't support Win16 source code anyway, I've * placed them here for compilation with Wine ... */ @@ -55,7 +55,7 @@ DWORD WINAPI CallProcEx32W16(VOID); */ BOOL WINAPI K32WOWGetDescriptor( SEGPTR segptr, LPLDT_ENTRY ldtent ) { - return GetThreadSelectorEntry( GetCurrentThread(), + return GetThreadSelectorEntry( GetCurrentThread(), segptr >> 16, ldtent ); } @@ -77,15 +77,15 @@ LPVOID WINAPI K32WOWGetVDMPointer( DWORD vp, DWORD dwBytes, BOOL fProtectedMode */ LPVOID WINAPI K32WOWGetVDMPointerFix( DWORD vp, DWORD dwBytes, BOOL fProtectedMode ) { - /* + /* * Hmmm. According to the docu, we should call: * * GlobalFix16( SELECTOROF(vp) ); * * But this is unnecessary under Wine, as we never move global - * memory segments in linear memory anyway. + * memory segments in linear memory anyway. * - * (I'm not so sure what we are *supposed* to do if + * (I'm not so sure what we are *supposed* to do if * fProtectedMode is TRUE, anyway ...) */ @@ -145,7 +145,7 @@ DWORD WINAPI K32WOWGlobalAllocLock16( WORD wFlags, DWORD cb, WORD *phMem ) */ DWORD WINAPI K32WOWGlobalLockSize16( WORD hMem, PDWORD pcb ) { - if ( pcb ) + if ( pcb ) *pcb = GlobalSize16( (HGLOBAL16)hMem ); return K32WOWGlobalLock16( hMem ); @@ -169,7 +169,7 @@ WORD WINAPI K32WOWGlobalUnlockFree16( DWORD vpMem ) VOID WINAPI K32WOWYield16( void ) { /* - * This does the right thing for both Win16 and Win32 tasks. + * This does the right thing for both Win16 and Win32 tasks. * More or less, at least :-/ */ Yield16(); @@ -182,7 +182,7 @@ VOID WINAPI K32WOWDirectedYield16( WORD htask16 ) { /* * Argh. Our scheduler doesn't like DirectedYield by Win32 - * tasks at all. So we do hope that this routine is indeed + * tasks at all. So we do hope that this routine is indeed * only ever called by Win16 tasks that have thunked up ... */ DirectedYield16( (HTASK16)htask16 ); @@ -263,16 +263,16 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags, /* * Arguments must be prepared in the correct order by the caller * (both for PASCAL and CDECL calling convention), so we simply - * copy them to the 16-bit stack ... + * copy them to the 16-bit stack ... */ memcpy( (LPBYTE)CURRENT_STACK16 - cbArgs, (LPBYTE)pArgs, cbArgs ); /* * Actually, we should take care whether the called routine cleans up - * its stack or not. Fortunately, our wine_call_to_16 core doesn't rely on - * the callee to do so; after the routine has returned, the 16-bit - * stack pointer is always reset to the position it had before. + * its stack or not. Fortunately, our wine_call_to_16 core doesn't rely on + * the callee to do so; after the routine has returned, the 16-bit + * stack pointer is always reset to the position it had before. */ ret = wine_call_to_16_long( (FARPROC16)vpfn16, cbArgs ); @@ -290,7 +290,7 @@ DWORD WINAPI K32WOWCallback16( DWORD vpfn16, DWORD dwParam ) { DWORD ret; - if ( !K32WOWCallback16Ex( vpfn16, WCB16_PASCAL, + if ( !K32WOWCallback16Ex( vpfn16, WCB16_PASCAL, sizeof(DWORD), &dwParam, &ret ) ) ret = 0L; @@ -317,7 +317,7 @@ DWORD WINAPI GetVDMPointer32W16( SEGPTR vp, UINT16 fMode ) DWORD WINAPI LoadLibraryEx32W16( LPCSTR lpszLibFile, DWORD hFile, DWORD dwFlags ) { HMODULE hModule; - DOS_FULL_NAME full_name; + DOS_FULL_NAME full_name; DWORD mutex_count; /* if the file can not be found, call LoadLibraryExA anyway, since it might be @@ -468,7 +468,7 @@ DWORD WINAPI CallProc32W16( void ) /********************************************************************** * _CallProcEx32W (KERNEL.518) * - * DWORD CallProcEx32W( DWORD cParams, DWORD fAddressConvert, + * DWORD CallProcEx32W( DWORD cParams, DWORD fAddressConvert, * DWORD lpProcAddress, DWORD p1, ... ); */ DWORD WINAPI CallProcEx32W16( void ) @@ -483,7 +483,7 @@ DWORD WINAPI CallProcEx32W16( void ) * FIXME!!! * */ -DWORD WINAPI WOW16Call(WORD x,WORD y,WORD z) +DWORD WINAPI WOW16Call(WORD x,WORD y,WORD z) { int i; DWORD calladdr; diff --git a/dlls/lzexpand/lzexpand_main.c b/dlls/lzexpand/lzexpand_main.c index e0d11a2a633..a9a2a89a0e5 100644 --- a/dlls/lzexpand/lzexpand_main.c +++ b/dlls/lzexpand/lzexpand_main.c @@ -1,5 +1,5 @@ /* - * LZ Decompression functions + * LZ Decompression functions * * Copyright 1996 Marcus Meissner * @@ -17,7 +17,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* +/* * FIXME: return values might be wrong */ @@ -48,7 +48,7 @@ struct lzfileheader { BYTE magic[8]; BYTE compressiontype; CHAR lastchar; - DWORD reallength; + DWORD reallength; }; static BYTE LZMagic[8]={'S','Z','D','D',0x88,0xf0,0x27,0x33}; @@ -63,7 +63,7 @@ struct lzstate { BYTE table[0x1000]; /* the rotating LZ table */ UINT curtabent; /* CURrent TABle ENTry */ - BYTE stringlen; /* length and position of current string */ + BYTE stringlen; /* length and position of current string */ DWORD stringpos; /* from stringtable */ @@ -103,7 +103,7 @@ _lzget(struct lzstate *lzs,BYTE *b) { } /* internal function, reads lzheader * returns BADINHANDLE for non filedescriptors - * return 0 for file not compressed using LZ + * return 0 for file not compressed using LZ * return UNKNOWNALG for unknown algorithm * returns lzfileheader in *head */ @@ -114,7 +114,7 @@ static INT read_header(HFILE fd,struct lzfileheader *head) if (_llseek(fd,0,SEEK_SET)==-1) return LZERROR_BADINHANDLE; - /* We can't directly read the lzfileheader struct due to + /* We can't directly read the lzfileheader struct due to * structure element alignment */ if (_lread(fd,buf,14)<14) @@ -173,7 +173,7 @@ HFILE16 WINAPI LZInit16( HFILE16 hfSrc ) * on failure, returns error code <0 * lzfiledescriptors range from 0x400 to 0x410 (only 16 open files per process) * - * since _llseek uses the same types as libc.lseek, we just use the macros of + * since _llseek uses the same types as libc.lseek, we just use the macros of * libc */ HFILE WINAPI LZInit( HFILE hfSrc ) @@ -194,7 +194,7 @@ HFILE WINAPI LZInit( HFILE hfSrc ) if (i == MAX_LZSTATES) return LZERROR_GLOBALLOC; lzstates[i] = lzs = HeapAlloc( GetProcessHeap(), 0, sizeof(struct lzstate) ); if(lzs == NULL) return LZERROR_GLOBALLOC; - + memset(lzs,'\0',sizeof(*lzs)); lzs->realfd = hfSrc; lzs->lastchar = head.lastchar; @@ -209,11 +209,11 @@ HFILE WINAPI LZInit( HFILE hfSrc ) lzstates[i] = NULL; return LZERROR_GLOBALLOC; } - + /* Yes, preinitialize with spaces */ memset(lzs->table,' ',0x1000); /* Yes, start 16 byte from the END of the table */ - lzs->curtabent = 0xff0; + lzs->curtabent = 0xff0; return 0x400 + i; } @@ -298,7 +298,7 @@ INT WINAPI GetExpandedNameA( LPCSTR in, LPSTR out ) head.lastchar=tolower(head.lastchar); else head.lastchar=toupper(head.lastchar); - } + } /* now look where to replace the last character */ if (NULL!=(t=strchr(s,'.'))) { @@ -400,11 +400,11 @@ INT WINAPI LZRead( HFILE fd, LPVOID vbuf, UINT toread ) lzs->curtabent &= 0xFFF; \ lzs->realcurrent++; - /* if someone has seeked, we have to bring the decompressor + /* if someone has seeked, we have to bring the decompressor * to that position */ if (lzs->realcurrent!=lzs->realwanted) { - /* if the wanted position is before the current position + /* if the wanted position is before the current position * I see no easy way to unroll ... We have to restart at * the beginning. *sigh* */ @@ -531,7 +531,7 @@ LONG WINAPI LZCopy( HFILE src, HFILE dest ) if (!IS_LZ_HANDLE(src)) xread=_lread; else - xread=(_readfun)LZRead; + xread=(_readfun)LZRead; len=0; while (1) { ret=xread(src,buf,BUFLEN); diff --git a/dlls/mpr/mpr_main.c b/dlls/mpr/mpr_main.c index f81f684b597..6c5692b04c5 100644 --- a/dlls/mpr/mpr_main.c +++ b/dlls/mpr/mpr_main.c @@ -24,7 +24,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mpr); - /* + /* * FIXME: The following routines should use a private heap ... */ diff --git a/dlls/mpr/multinet.c b/dlls/mpr/multinet.c index 575eb55fc6e..9b7944991ef 100644 --- a/dlls/mpr/multinet.c +++ b/dlls/mpr/multinet.c @@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mpr); * Success: NO_ERROR * Failure: ERROR_NOT_SUPPORTED, ERROR_NOT_CONNECTED, * ERROR_NO_NET_OR_BAD_PATH, ERROR_BAD_DEVICE, - * ERROR_BAD_NET_NAME, ERROR_INVALID_PARAMETER, + * ERROR_BAD_NET_NAME, ERROR_INVALID_PARAMETER, * ERROR_NO_NETWORK, ERROR_EXTENDED_ERROR */ DWORD WINAPI MultinetGetConnectionPerformanceA( diff --git a/dlls/mpr/pwcache.c b/dlls/mpr/pwcache.c index a483700e93b..72f881657e2 100644 --- a/dlls/mpr/pwcache.c +++ b/dlls/mpr/pwcache.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mpr); * WNetCachePassword [MPR.@] Saves password in cache * * NOTES - * only the parameter count is verifyed + * only the parameter count is verifyed * * ---- everything below this line might be wrong (js) ----- * RETURNS @@ -43,9 +43,9 @@ DWORD WINAPI WNetCachePassword( WORD cbPassword, /* [in] Size of password */ BYTE nType, /* [in] Type of password to cache */ WORD x) - + { - FIXME( "(%p(%s), %d, %p(%s), %d, %d, 0x%08x): stub\n", + FIXME( "(%p(%s), %d, %p(%s), %d, %d, 0x%08x): stub\n", pbResource, debugstr_a(pbResource), cbResource, pbPassword, debugstr_a(pbPassword), cbPassword, nType, x ); @@ -56,10 +56,10 @@ DWORD WINAPI WNetCachePassword( /***************************************************************** * WNetRemoveCachedPassword [MPR.@] */ -UINT WINAPI WNetRemoveCachedPassword( LPSTR pbResource, WORD cbResource, +UINT WINAPI WNetRemoveCachedPassword( LPSTR pbResource, WORD cbResource, BYTE nType ) { - FIXME( "(%p(%s), %d, %d): stub\n", + FIXME( "(%p(%s), %d, %d): stub\n", pbResource, debugstr_a(pbResource), cbResource, nType ); return WN_SUCCESS; @@ -75,11 +75,11 @@ UINT WINAPI WNetRemoveCachedPassword( LPSTR pbResource, WORD cbResource, * arg3: ptr 0x40xxxxxx -> (no string) * arg4: ptr 0x40xxxxxx -> 0xc8 * arg5: type? 4 - * + * * ---- everything below this line might be wrong (js) ----- * RETURNS * Success: WN_SUCCESS - * Failure: WN_ACCESS_DENIED, WN_BAD_PASSWORD, WN_BAD_VALUE, + * Failure: WN_ACCESS_DENIED, WN_BAD_PASSWORD, WN_BAD_VALUE, * WN_NET_ERROR, WN_NOT_SUPPORTED, WN_OUT_OF_MEMORY */ DWORD WINAPI WNetGetCachedPassword( @@ -101,7 +101,7 @@ DWORD WINAPI WNetGetCachedPassword( * WNetEnumCachedPasswords [MPR.@] * * NOTES - * the parameter count is verifyed + * the parameter count is verifyed * * observed values: * arg1 ptr 0x40xxxxxx -> (no string) diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c index 367cc74dae6..8de75c65698 100644 --- a/dlls/mpr/wnet.c +++ b/dlls/mpr/wnet.c @@ -64,10 +64,10 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage, /********************************************************************* * WNetEnumResourceA [MPR.@] */ -DWORD WINAPI WNetEnumResourceA( HANDLE hEnum, LPDWORD lpcCount, +DWORD WINAPI WNetEnumResourceA( HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize ) { - FIXME( "(%04X, %p, %p, %p): stub\n", + FIXME( "(%04X, %p, %p, %p): stub\n", hEnum, lpcCount, lpBuffer, lpBufferSize ); SetLastError(WN_NO_NETWORK); @@ -77,10 +77,10 @@ DWORD WINAPI WNetEnumResourceA( HANDLE hEnum, LPDWORD lpcCount, /********************************************************************* * WNetEnumResourceW [MPR.@] */ -DWORD WINAPI WNetEnumResourceW( HANDLE hEnum, LPDWORD lpcCount, +DWORD WINAPI WNetEnumResourceW( HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize ) { - FIXME( "(%04X, %p, %p, %p): stub\n", + FIXME( "(%04X, %p, %p, %p): stub\n", hEnum, lpcCount, lpBuffer, lpBufferSize ); SetLastError(WN_NO_NETWORK); @@ -101,8 +101,8 @@ DWORD WINAPI WNetCloseEnum( HANDLE hEnum ) /********************************************************************* * WNetGetResourceInformationA [MPR.@] */ -DWORD WINAPI WNetGetResourceInformationA( LPNETRESOURCEA lpNetResource, - LPVOID lpBuffer, LPDWORD cbBuffer, +DWORD WINAPI WNetGetResourceInformationA( LPNETRESOURCEA lpNetResource, + LPVOID lpBuffer, LPDWORD cbBuffer, LPSTR *lplpSystem ) { FIXME( "(%p, %p, %p, %p): stub\n", @@ -115,8 +115,8 @@ DWORD WINAPI WNetGetResourceInformationA( LPNETRESOURCEA lpNetResource, /********************************************************************* * WNetGetResourceInformationW [MPR.@] */ -DWORD WINAPI WNetGetResourceInformationW( LPNETRESOURCEW lpNetResource, - LPVOID lpBuffer, LPDWORD cbBuffer, +DWORD WINAPI WNetGetResourceInformationW( LPNETRESOURCEW lpNetResource, + LPVOID lpBuffer, LPDWORD cbBuffer, LPWSTR *lplpSystem ) { FIXME( "(%p, %p, %p, %p): stub\n", @@ -132,7 +132,7 @@ DWORD WINAPI WNetGetResourceInformationW( LPNETRESOURCEW lpNetResource, DWORD WINAPI WNetGetResourceParentA( LPNETRESOURCEA lpNetResource, LPVOID lpBuffer, LPDWORD lpBufferSize ) { - FIXME( "(%p, %p, %p): stub\n", + FIXME( "(%p, %p, %p): stub\n", lpNetResource, lpBuffer, lpBufferSize ); SetLastError(WN_NO_NETWORK); @@ -145,7 +145,7 @@ DWORD WINAPI WNetGetResourceParentA( LPNETRESOURCEA lpNetResource, DWORD WINAPI WNetGetResourceParentW( LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, LPDWORD lpBufferSize ) { - FIXME( "(%p, %p, %p): stub\n", + FIXME( "(%p, %p, %p): stub\n", lpNetResource, lpBuffer, lpBufferSize ); SetLastError(WN_NO_NETWORK); @@ -164,7 +164,7 @@ DWORD WINAPI WNetGetResourceParentW( LPNETRESOURCEW lpNetResource, DWORD WINAPI WNetAddConnectionA( LPCSTR lpRemoteName, LPCSTR lpPassword, LPCSTR lpLocalName ) { - FIXME( "(%s, %p, %s): stub\n", + FIXME( "(%s, %p, %s): stub\n", debugstr_a(lpRemoteName), lpPassword, debugstr_a(lpLocalName) ); SetLastError(WN_NO_NETWORK); @@ -177,7 +177,7 @@ DWORD WINAPI WNetAddConnectionA( LPCSTR lpRemoteName, LPCSTR lpPassword, DWORD WINAPI WNetAddConnectionW( LPCWSTR lpRemoteName, LPCWSTR lpPassword, LPCWSTR lpLocalName ) { - FIXME( "(%s, %p, %s): stub\n", + FIXME( "(%s, %p, %s): stub\n", debugstr_w(lpRemoteName), lpPassword, debugstr_w(lpLocalName) ); SetLastError(WN_NO_NETWORK); @@ -188,10 +188,10 @@ DWORD WINAPI WNetAddConnectionW( LPCWSTR lpRemoteName, LPCWSTR lpPassword, * WNetAddConnection2A [MPR.@] */ DWORD WINAPI WNetAddConnection2A( LPNETRESOURCEA lpNetResource, - LPCSTR lpPassword, LPCSTR lpUserID, + LPCSTR lpPassword, LPCSTR lpUserID, DWORD dwFlags ) { - FIXME( "(%p, %p, %s, 0x%08lX): stub\n", + FIXME( "(%p, %p, %s, 0x%08lX): stub\n", lpNetResource, lpPassword, debugstr_a(lpUserID), dwFlags ); SetLastError(WN_NO_NETWORK); @@ -202,10 +202,10 @@ DWORD WINAPI WNetAddConnection2A( LPNETRESOURCEA lpNetResource, * WNetAddConnection2W [MPR.@] */ DWORD WINAPI WNetAddConnection2W( LPNETRESOURCEW lpNetResource, - LPCWSTR lpPassword, LPCWSTR lpUserID, + LPCWSTR lpPassword, LPCWSTR lpUserID, DWORD dwFlags ) { - FIXME( "(%p, %p, %s, 0x%08lX): stub\n", + FIXME( "(%p, %p, %s, 0x%08lX): stub\n", lpNetResource, lpPassword, debugstr_w(lpUserID), dwFlags ); SetLastError(WN_NO_NETWORK); @@ -216,10 +216,10 @@ DWORD WINAPI WNetAddConnection2W( LPNETRESOURCEW lpNetResource, * WNetAddConnection3A [MPR.@] */ DWORD WINAPI WNetAddConnection3A( HWND hwndOwner, LPNETRESOURCEA lpNetResource, - LPCSTR lpPassword, LPCSTR lpUserID, + LPCSTR lpPassword, LPCSTR lpUserID, DWORD dwFlags ) { - FIXME( "(%04x, %p, %p, %s, 0x%08lX), stub\n", + FIXME( "(%04x, %p, %p, %s, 0x%08lX), stub\n", hwndOwner, lpNetResource, lpPassword, debugstr_a(lpUserID), dwFlags ); SetLastError(WN_NO_NETWORK); @@ -230,25 +230,25 @@ DWORD WINAPI WNetAddConnection3A( HWND hwndOwner, LPNETRESOURCEA lpNetResource, * WNetAddConnection3W [MPR.@] */ DWORD WINAPI WNetAddConnection3W( HWND hwndOwner, LPNETRESOURCEW lpNetResource, - LPCWSTR lpPassword, LPCWSTR lpUserID, + LPCWSTR lpPassword, LPCWSTR lpUserID, DWORD dwFlags ) { - FIXME( "(%04x, %p, %p, %s, 0x%08lX), stub\n", + FIXME( "(%04x, %p, %p, %s, 0x%08lX), stub\n", hwndOwner, lpNetResource, lpPassword, debugstr_w(lpUserID), dwFlags ); SetLastError(WN_NO_NETWORK); return WN_NO_NETWORK; -} +} /***************************************************************** * WNetUseConnectionA [MPR.@] */ DWORD WINAPI WNetUseConnectionA( HWND hwndOwner, LPNETRESOURCEA lpNetResource, LPCSTR lpPassword, LPCSTR lpUserID, DWORD dwFlags, - LPSTR lpAccessName, LPDWORD lpBufferSize, + LPSTR lpAccessName, LPDWORD lpBufferSize, LPDWORD lpResult ) { - FIXME( "(%04x, %p, %p, %s, 0x%08lX, %s, %p, %p), stub\n", + FIXME( "(%04x, %p, %p, %s, 0x%08lX, %s, %p, %p), stub\n", hwndOwner, lpNetResource, lpPassword, debugstr_a(lpUserID), dwFlags, debugstr_a(lpAccessName), lpBufferSize, lpResult ); @@ -264,7 +264,7 @@ DWORD WINAPI WNetUseConnectionW( HWND hwndOwner, LPNETRESOURCEW lpNetResource, LPWSTR lpAccessName, LPDWORD lpBufferSize, LPDWORD lpResult ) { - FIXME( "(%04x, %p, %p, %s, 0x%08lX, %s, %p, %p), stub\n", + FIXME( "(%04x, %p, %p, %s, 0x%08lX, %s, %p, %p), stub\n", hwndOwner, lpNetResource, lpPassword, debugstr_w(lpUserID), dwFlags, debugstr_w(lpAccessName), lpBufferSize, lpResult ); @@ -285,7 +285,7 @@ DWORD WINAPI WNetCancelConnectionA( LPCSTR lpName, BOOL fForce ) /********************************************************************* * WNetCancelConnectionW [MPR.@] */ -DWORD WINAPI WNetCancelConnectionW( LPCWSTR lpName, BOOL fForce ) +DWORD WINAPI WNetCancelConnectionW( LPCWSTR lpName, BOOL fForce ) { FIXME( "(%s, %d), stub\n", debugstr_w(lpName), fForce ); @@ -295,7 +295,7 @@ DWORD WINAPI WNetCancelConnectionW( LPCWSTR lpName, BOOL fForce ) /********************************************************************* * WNetCancelConnection2A [MPR.@] */ -DWORD WINAPI WNetCancelConnection2A( LPCSTR lpName, DWORD dwFlags, BOOL fForce ) +DWORD WINAPI WNetCancelConnection2A( LPCSTR lpName, DWORD dwFlags, BOOL fForce ) { FIXME( "(%s, %08lX, %d), stub\n", debugstr_a(lpName), dwFlags, fForce ); @@ -305,7 +305,7 @@ DWORD WINAPI WNetCancelConnection2A( LPCSTR lpName, DWORD dwFlags, BOOL fForce ) /********************************************************************* * WNetCancelConnection2W [MPR.@] */ -DWORD WINAPI WNetCancelConnection2W( LPCWSTR lpName, DWORD dwFlags, BOOL fForce ) +DWORD WINAPI WNetCancelConnection2W( LPCWSTR lpName, DWORD dwFlags, BOOL fForce ) { FIXME( "(%s, %08lX, %d), stub\n", debugstr_w(lpName), dwFlags, fForce ); @@ -341,10 +341,10 @@ DWORD WINAPI WNetRestoreConnectionW( HWND hwndOwner, LPWSTR lpszDevice ) * - WN_BAD_LOCALNAME lpLocalName makes no sense * - WN_NOT_CONNECTED drive is a local drive * - WN_MORE_DATA buffer isn't big enough - * - WN_SUCCESS success (net path in buffer) + * - WN_SUCCESS success (net path in buffer) * */ -DWORD WINAPI WNetGetConnectionA( LPCSTR lpLocalName, +DWORD WINAPI WNetGetConnectionA( LPCSTR lpLocalName, LPSTR lpRemoteName, LPDWORD lpBufferSize ) { char label[40]; @@ -380,7 +380,7 @@ DWORD WINAPI WNetGetConnectionA( LPCSTR lpLocalName, /************************************************************************** * WNetGetConnectionW [MPR.@] */ -DWORD WINAPI WNetGetConnectionW( LPCWSTR lpLocalName, +DWORD WINAPI WNetGetConnectionW( LPCWSTR lpLocalName, LPWSTR lpRemoteName, LPDWORD lpBufferSize ) { CHAR buf[200]; @@ -407,7 +407,7 @@ DWORD WINAPI WNetGetConnectionW( LPCWSTR lpLocalName, /************************************************************************** * WNetSetConnectionA [MPR.@] */ -DWORD WINAPI WNetSetConnectionA( LPCSTR lpName, DWORD dwProperty, +DWORD WINAPI WNetSetConnectionA( LPCSTR lpName, DWORD dwProperty, LPVOID pvValue ) { FIXME( "(%s, %08lX, %p): stub\n", debugstr_a(lpName), dwProperty, pvValue ); @@ -419,7 +419,7 @@ DWORD WINAPI WNetSetConnectionA( LPCSTR lpName, DWORD dwProperty, /************************************************************************** * WNetSetConnectionW [MPR.@] */ -DWORD WINAPI WNetSetConnectionW( LPCWSTR lpName, DWORD dwProperty, +DWORD WINAPI WNetSetConnectionW( LPCWSTR lpName, DWORD dwProperty, LPVOID pvValue ) { FIXME( "(%s, %08lX, %p): stub\n", debugstr_w(lpName), dwProperty, pvValue ); @@ -431,10 +431,10 @@ DWORD WINAPI WNetSetConnectionW( LPCWSTR lpName, DWORD dwProperty, /***************************************************************** * WNetGetUniversalNameA [MPR.@] */ -DWORD WINAPI WNetGetUniversalNameA ( LPCSTR lpLocalPath, DWORD dwInfoLevel, +DWORD WINAPI WNetGetUniversalNameA ( LPCSTR lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize ) { - FIXME( "(%s, 0x%08lX, %p, %p): stub\n", + FIXME( "(%s, 0x%08lX, %p, %p): stub\n", debugstr_a(lpLocalPath), dwInfoLevel, lpBuffer, lpBufferSize); SetLastError(WN_NO_NETWORK); @@ -444,10 +444,10 @@ DWORD WINAPI WNetGetUniversalNameA ( LPCSTR lpLocalPath, DWORD dwInfoLevel, /***************************************************************** * WNetGetUniversalNameW [MPR.@] */ -DWORD WINAPI WNetGetUniversalNameW ( LPCWSTR lpLocalPath, DWORD dwInfoLevel, +DWORD WINAPI WNetGetUniversalNameW ( LPCWSTR lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize ) { - FIXME( "(%s, 0x%08lX, %p, %p): stub\n", + FIXME( "(%s, 0x%08lX, %p, %p): stub\n", debugstr_w(lpLocalPath), dwInfoLevel, lpBuffer, lpBufferSize); SetLastError(WN_NO_NETWORK); @@ -474,9 +474,9 @@ DWORD WINAPI WNetGetUserA( LPCSTR lpName, LPSTR lpUserID, LPDWORD lpBufferSize ) /***************************************************************** * WNetGetUserW [MPR.@] */ -DWORD WINAPI WNetGetUserW( LPCWSTR lpName, LPWSTR lpUserID, LPDWORD lpBufferSize ) +DWORD WINAPI WNetGetUserW( LPCWSTR lpName, LPWSTR lpUserID, LPDWORD lpBufferSize ) { - FIXME( "(%s, %p, %p): mostly stub\n", + FIXME( "(%s, %p, %p): mostly stub\n", debugstr_w(lpName), lpUserID, lpBufferSize ); SetLastError(WN_NO_NETWORK); @@ -485,9 +485,9 @@ DWORD WINAPI WNetGetUserW( LPCWSTR lpName, LPWSTR lpUserID, LPDWORD lpBufferSize /********************************************************************* * WNetConnectionDialog [MPR.@] - */ + */ DWORD WINAPI WNetConnectionDialog( HWND hwnd, DWORD dwType ) -{ +{ FIXME( "(%04x, %08lX): stub\n", hwnd, dwType ); SetLastError(WN_NO_NETWORK); @@ -498,7 +498,7 @@ DWORD WINAPI WNetConnectionDialog( HWND hwnd, DWORD dwType ) * WNetConnectionDialog1A [MPR.@] */ DWORD WINAPI WNetConnectionDialog1A( LPCONNECTDLGSTRUCTA lpConnDlgStruct ) -{ +{ FIXME( "(%p): stub\n", lpConnDlgStruct ); SetLastError(WN_NO_NETWORK); @@ -507,9 +507,9 @@ DWORD WINAPI WNetConnectionDialog1A( LPCONNECTDLGSTRUCTA lpConnDlgStruct ) /********************************************************************* * WNetConnectionDialog1W [MPR.@] - */ + */ DWORD WINAPI WNetConnectionDialog1W( LPCONNECTDLGSTRUCTW lpConnDlgStruct ) -{ +{ FIXME( "(%p): stub\n", lpConnDlgStruct ); SetLastError(WN_NO_NETWORK); @@ -518,9 +518,9 @@ DWORD WINAPI WNetConnectionDialog1W( LPCONNECTDLGSTRUCTW lpConnDlgStruct ) /********************************************************************* * WNetDisconnectDialog [MPR.@] - */ + */ DWORD WINAPI WNetDisconnectDialog( HWND hwnd, DWORD dwType ) -{ +{ FIXME( "(%04x, %08lX): stub\n", hwnd, dwType ); SetLastError(WN_NO_NETWORK); @@ -529,9 +529,9 @@ DWORD WINAPI WNetDisconnectDialog( HWND hwnd, DWORD dwType ) /********************************************************************* * WNetDisconnectDialog1A [MPR.@] - */ + */ DWORD WINAPI WNetDisconnectDialog1A( LPDISCDLGSTRUCTA lpConnDlgStruct ) -{ +{ FIXME( "(%p): stub\n", lpConnDlgStruct ); SetLastError(WN_NO_NETWORK); @@ -540,9 +540,9 @@ DWORD WINAPI WNetDisconnectDialog1A( LPDISCDLGSTRUCTA lpConnDlgStruct ) /********************************************************************* * WNetDisconnectDialog1W [MPR.@] - */ + */ DWORD WINAPI WNetDisconnectDialog1W( LPDISCDLGSTRUCTW lpConnDlgStruct ) -{ +{ FIXME( "(%p): stub\n", lpConnDlgStruct ); SetLastError(WN_NO_NETWORK); @@ -551,12 +551,12 @@ DWORD WINAPI WNetDisconnectDialog1W( LPDISCDLGSTRUCTW lpConnDlgStruct ) /********************************************************************* * WNetGetLastErrorA [MPR.@] - */ + */ DWORD WINAPI WNetGetLastErrorA( LPDWORD lpError, LPSTR lpErrorBuf, DWORD nErrorBufSize, LPSTR lpNameBuf, DWORD nNameBufSize ) { - FIXME( "(%p, %p, %ld, %p, %ld): stub\n", + FIXME( "(%p, %p, %ld, %p, %ld): stub\n", lpError, lpErrorBuf, nErrorBufSize, lpNameBuf, nNameBufSize ); SetLastError(WN_NO_NETWORK); @@ -565,12 +565,12 @@ DWORD WINAPI WNetGetLastErrorA( LPDWORD lpError, /********************************************************************* * WNetGetLastErrorW [MPR.@] - */ + */ DWORD WINAPI WNetGetLastErrorW( LPDWORD lpError, LPWSTR lpErrorBuf, DWORD nErrorBufSize, LPWSTR lpNameBuf, DWORD nNameBufSize ) { - FIXME( "(%p, %p, %ld, %p, %ld): stub\n", + FIXME( "(%p, %p, %ld, %p, %ld): stub\n", lpError, lpErrorBuf, nErrorBufSize, lpNameBuf, nNameBufSize ); SetLastError(WN_NO_NETWORK); @@ -579,8 +579,8 @@ DWORD WINAPI WNetGetLastErrorW( LPDWORD lpError, /********************************************************************* * WNetGetNetworkInformationA [MPR.@] - */ -DWORD WINAPI WNetGetNetworkInformationA( LPCSTR lpProvider, + */ +DWORD WINAPI WNetGetNetworkInformationA( LPCSTR lpProvider, LPNETINFOSTRUCT lpNetInfoStruct ) { FIXME( "(%s, %p): stub\n", debugstr_a(lpProvider), lpNetInfoStruct ); @@ -591,8 +591,8 @@ DWORD WINAPI WNetGetNetworkInformationA( LPCSTR lpProvider, /********************************************************************* * WNetGetNetworkInformationW [MPR.@] - */ -DWORD WINAPI WNetGetNetworkInformationW( LPCWSTR lpProvider, + */ +DWORD WINAPI WNetGetNetworkInformationW( LPCWSTR lpProvider, LPNETINFOSTRUCT lpNetInfoStruct ) { FIXME( "(%s, %p): stub\n", debugstr_w(lpProvider), lpNetInfoStruct ); @@ -604,7 +604,7 @@ DWORD WINAPI WNetGetNetworkInformationW( LPCWSTR lpProvider, /***************************************************************** * WNetGetProviderNameA [MPR.@] */ -DWORD WINAPI WNetGetProviderNameA( DWORD dwNetType, +DWORD WINAPI WNetGetProviderNameA( DWORD dwNetType, LPSTR lpProvider, LPDWORD lpBufferSize ) { FIXME( "(%ld, %p, %p): stub\n", dwNetType, lpProvider, lpBufferSize ); @@ -617,7 +617,7 @@ DWORD WINAPI WNetGetProviderNameA( DWORD dwNetType, * WNetGetProviderNameW [MPR.@] */ DWORD WINAPI WNetGetProviderNameW( DWORD dwNetType, - LPWSTR lpProvider, LPDWORD lpBufferSize ) + LPWSTR lpProvider, LPDWORD lpBufferSize ) { FIXME( "(%ld, %p, %p): stub\n", dwNetType, lpProvider, lpBufferSize ); diff --git a/dlls/msacm/driver.c b/dlls/msacm/driver.c index 2d3857aa9cb..e9867a530bf 100644 --- a/dlls/msacm/driver.c +++ b/dlls/msacm/driver.c @@ -40,7 +40,7 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msacm); - + /*********************************************************************** * acmDriverAddA (MSACM32.@) */ @@ -49,26 +49,26 @@ MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule, { if (!phadid) return MMSYSERR_INVALPARAM; - + /* Check if any unknown flags */ - if (fdwAdd & + if (fdwAdd & ~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND| ACM_DRIVERADDF_GLOBAL)) return MMSYSERR_INVALFLAG; - + /* Check if any incompatible flags */ - if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && + if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND)) return MMSYSERR_INVALFLAG; - - /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a + + /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a * LoadDriver on it, to be sure we can call SendDriverMessage on the * hDrvr handle. */ *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, NULL, hinstModule); - + /* FIXME: lParam, dwPriority and fdwAdd ignored */ - + return MMSYSERR_NOERROR; } @@ -82,7 +82,7 @@ MMRESULT WINAPI acmDriverAddW(PHACMDRIVERID phadid, HINSTANCE hinstModule, { FIXME("(%p, 0x%08x, %ld, %ld, %ld): stub\n", phadid, hinstModule, lParam, dwPriority, fdwAdd); - + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return MMSYSERR_ERROR; } @@ -98,7 +98,7 @@ MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose) if (fdwClose) return MMSYSERR_INVALFLAG; - + pad = MSACM_GetDriver(had); if (!pad) return MMSYSERR_INVALHANDLE; @@ -112,13 +112,13 @@ MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose) break; } } - + /* close driver if it has been opened */ if (pad->hDrvr && !padid->hInstModule) CloseDriver(pad->hDrvr, 0, 0); - + HeapFree(MSACM_hHeap, 0, pad); - + return MMSYSERR_NOERROR; } @@ -129,20 +129,20 @@ MMRESULT WINAPI acmDriverDetailsA(HACMDRIVERID hadid, PACMDRIVERDETAILSA padd, D { MMRESULT mmr; ACMDRIVERDETAILSW addw; - + addw.cbStruct = sizeof(addw); mmr = acmDriverDetailsW(hadid, &addw, fdwDetails); if (mmr == 0) { - padd->fccType = addw.fccType; - padd->fccComp = addw.fccComp; - padd->wMid = addw.wMid; - padd->wPid = addw.wPid; - padd->vdwACM = addw.vdwACM; - padd->vdwDriver = addw.vdwDriver; - padd->fdwSupport = addw.fdwSupport; - padd->cFormatTags = addw.cFormatTags; - padd->cFilterTags = addw.cFilterTags; - padd->hicon = addw.hicon; + padd->fccType = addw.fccType; + padd->fccComp = addw.fccComp; + padd->wMid = addw.wMid; + padd->wPid = addw.wPid; + padd->vdwACM = addw.vdwACM; + padd->vdwDriver = addw.vdwDriver; + padd->fdwSupport = addw.fdwSupport; + padd->cFormatTags = addw.cFormatTags; + padd->cFilterTags = addw.cFilterTags; + padd->hicon = addw.hicon; WideCharToMultiByte( CP_ACP, 0, addw.szShortName, -1, padd->szShortName, sizeof(padd->szShortName), NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, addw.szLongName, -1, padd->szLongName, @@ -164,17 +164,17 @@ MMRESULT WINAPI acmDriverDetailsW(HACMDRIVERID hadid, PACMDRIVERDETAILSW padd, D { HACMDRIVER acmDrvr; MMRESULT mmr; - + if (fdwDetails) return MMSYSERR_INVALFLAG; - + mmr = acmDriverOpen(&acmDrvr, hadid, 0); if (mmr == MMSYSERR_NOERROR) { mmr = (MMRESULT)MSACM_Message(acmDrvr, ACMDM_DRIVER_DETAILS, (LPARAM)padd, 0); - + acmDriverClose(acmDrvr, 0); } - + return mmr; } @@ -187,13 +187,13 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR DWORD fdwSupport; if (!fnCallback) return MMSYSERR_INVALPARAM; - + if (fdwEnum & ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) return MMSYSERR_INVALFLAG; - + for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { fdwSupport = padid->fdwSupport; - + if (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) { if (fdwEnum & ACM_DRIVERENUMF_DISABLED) fdwSupport |= ACMDRIVERDETAILS_SUPPORTF_DISABLED; @@ -203,7 +203,7 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR if (!(*fnCallback)((HACMDRIVERID)padid, dwInstance, fdwSupport)) break; } - + return MMSYSERR_NOERROR; } @@ -213,19 +213,19 @@ MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWOR MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID) { PWINE_ACMOBJ pao; - + if (!phadid) return MMSYSERR_INVALPARAM; - + if (fdwDriverID) return MMSYSERR_INVALFLAG; - + pao = MSACM_GetObj(hao, WINE_ACMOBJ_DONTCARE); if (!pao) return MMSYSERR_INVALHANDLE; - + *phadid = (HACMDRIVERID) pao->pACMDriverID; - + return MMSYSERR_NOERROR; } @@ -256,32 +256,32 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe if (!phad) return MMSYSERR_INVALPARAM; - + if (fdwOpen) return MMSYSERR_INVALFLAG; - - padid = MSACM_GetDriverID(hadid); + + padid = MSACM_GetDriverID(hadid); if (!padid) return MMSYSERR_INVALHANDLE; pad = HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER)); - if (!pad) + if (!pad) return MMSYSERR_NOMEM; pad->obj.dwType = WINE_ACMOBJ_DRIVER; pad->obj.pACMDriverID = padid; - if (!(pad->hDrvr = padid->hInstModule)) + if (!(pad->hDrvr = padid->hInstModule)) { ACMDRVOPENDESCW adod; int len; /* this is not an externally added driver... need to actually load it */ - if (!padid->pszDriverAlias) - { + if (!padid->pszDriverAlias) + { ret = MMSYSERR_ERROR; goto gotError; - } + } adod.cbStruct = sizeof(adod); adod.fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC; @@ -301,7 +301,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe HeapFree(MSACM_hHeap, 0, (LPWSTR)adod.pszSectionName); HeapFree(MSACM_hHeap, 0, (LPWSTR)adod.pszAliasName); - if (!pad->hDrvr) + if (!pad->hDrvr) { ret = adod.dwError; goto gotError; @@ -335,28 +335,28 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd LONG lError; HKEY hPriorityKey; DWORD dwPriorityCounter; - + padid = MSACM_GetDriverID(hadid); if (!padid) return MMSYSERR_INVALHANDLE; - + /* Check for unknown flags */ - if (fdwPriority & + if (fdwPriority & ~(ACM_DRIVERPRIORITYF_ENABLE|ACM_DRIVERPRIORITYF_DISABLE| ACM_DRIVERPRIORITYF_BEGIN|ACM_DRIVERPRIORITYF_END)) return MMSYSERR_INVALFLAG; - + /* Check for incompatible flags */ if ((fdwPriority & ACM_DRIVERPRIORITYF_ENABLE) && (fdwPriority & ACM_DRIVERPRIORITYF_DISABLE)) return MMSYSERR_INVALFLAG; - + /* Check for incompatible flags */ if ((fdwPriority & ACM_DRIVERPRIORITYF_BEGIN) && (fdwPriority & ACM_DRIVERPRIORITYF_END)) return MMSYSERR_INVALFLAG; - - lError = RegOpenKeyA(HKEY_CURRENT_USER, + + lError = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Microsoft\\Multimedia\\" "Audio Compression Manager\\Priority v4.00", &hPriorityKey @@ -364,20 +364,20 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd /* FIXME: Create key */ if (lError != ERROR_SUCCESS) return MMSYSERR_ERROR; - + for (dwPriorityCounter = 1; ; dwPriorityCounter++) { snprintf(szSubKey, 17, "Priorty%ld", dwPriorityCounter); lError = RegQueryValueA(hPriorityKey, szSubKey, szBuffer, &lBufferLength); if (lError != ERROR_SUCCESS) break; - - FIXME("(0x%08x, %ld, %ld): stub (partial)\n", + + FIXME("(0x%08x, %ld, %ld): stub (partial)\n", hadid, dwPriority, fdwPriority); break; } - + RegCloseKey(hPriorityKey); - + return MMSYSERR_ERROR; } @@ -387,16 +387,16 @@ MMRESULT WINAPI acmDriverPriority(HACMDRIVERID hadid, DWORD dwPriority, DWORD fd MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove) { PWINE_ACMDRIVERID padid; - + padid = MSACM_GetDriverID(hadid); if (!padid) return MMSYSERR_INVALHANDLE; - + if (fdwRemove) return MMSYSERR_INVALFLAG; - + MSACM_UnregisterDriver(padid); - + return MMSYSERR_NOERROR; } diff --git a/dlls/msacm/filter.c b/dlls/msacm/filter.c index 1c3cfcedad8..66ee816bb7c 100644 --- a/dlls/msacm/filter.c +++ b/dlls/msacm/filter.c @@ -55,7 +55,7 @@ MMRESULT WINAPI acmFilterChooseW(PACMFILTERCHOOSEW pafltrc) /*********************************************************************** * acmFilterDetailsA (MSACM32.@) */ -MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd, +MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd, DWORD fdwDetails) { ACMFILTERDETAILSW afdw; @@ -64,14 +64,14 @@ MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd, memset(&afdw, 0, sizeof(afdw)); afdw.cbStruct = sizeof(afdw); afdw.dwFilterIndex = pafd->dwFilterIndex; - afdw.dwFilterTag = pafd->dwFilterTag; + afdw.dwFilterTag = pafd->dwFilterTag; afdw.pwfltr = pafd->pwfltr; afdw.cbwfltr = pafd->cbwfltr; mmr = acmFilterDetailsW(had, &afdw, fdwDetails); if (mmr == MMSYSERR_NOERROR) { - pafd->dwFilterTag = afdw.dwFilterTag; - pafd->fdwSupport = afdw.fdwSupport; + pafd->dwFilterTag = afdw.dwFilterTag; + pafd->fdwSupport = afdw.fdwSupport; WideCharToMultiByte( CP_ACP, 0, afdw.szFilter, -1, pafd->szFilter, sizeof(pafd->szFilter), NULL, NULL ); } @@ -81,7 +81,7 @@ MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd, /*********************************************************************** * acmFilterDetailsW (MSACM32.@) */ -MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd, +MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd, DWORD fdwDetails) { MMRESULT mmr; @@ -93,7 +93,7 @@ MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd, aftd.cbStruct = sizeof(aftd); if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM; - + switch (fdwDetails) { case ACM_FILTERDETAILSF_FILTER: if (pafd->dwFilterTag != pafd->pwfltr->dwFilterTag) { @@ -113,7 +113,7 @@ MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd, acmDriverClose(had, 0); if (mmr == MMSYSERR_NOERROR) break; } - } + } } else { mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS, (LPARAM)pafd, fdwDetails); } @@ -139,29 +139,29 @@ struct MSACM_FilterEnumWtoA_Instance { }; static BOOL CALLBACK MSACM_FilterEnumCallbackWtoA(HACMDRIVERID hadid, - PACMFILTERDETAILSW pafdw, - DWORD dwInstance, + PACMFILTERDETAILSW pafdw, + DWORD dwInstance, DWORD fdwSupport) { struct MSACM_FilterEnumWtoA_Instance* pafei; pafei = (struct MSACM_FilterEnumWtoA_Instance*)dwInstance; - pafei->pafda->dwFilterIndex = pafdw->dwFilterIndex; - pafei->pafda->dwFilterTag = pafdw->dwFilterTag; - pafei->pafda->fdwSupport = pafdw->fdwSupport; + pafei->pafda->dwFilterIndex = pafdw->dwFilterIndex; + pafei->pafda->dwFilterTag = pafdw->dwFilterTag; + pafei->pafda->fdwSupport = pafdw->fdwSupport; WideCharToMultiByte( CP_ACP, 0, pafdw->szFilter, -1, pafei->pafda->szFilter, sizeof(pafei->pafda->szFilter), NULL, NULL ); - return (pafei->fnCallback)(hadid, pafei->pafda, + return (pafei->fnCallback)(hadid, pafei->pafda, pafei->dwInstance, fdwSupport); } /*********************************************************************** * acmFilterEnumA (MSACM32.@) */ -MMRESULT WINAPI acmFilterEnumA(HACMDRIVER had, PACMFILTERDETAILSA pafda, - ACMFILTERENUMCBA fnCallback, DWORD dwInstance, +MMRESULT WINAPI acmFilterEnumA(HACMDRIVER had, PACMFILTERDETAILSA pafda, + ACMFILTERENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum) { ACMFILTERDETAILSW afdw; @@ -178,13 +178,13 @@ MMRESULT WINAPI acmFilterEnumA(HACMDRIVER had, PACMFILTERDETAILSA pafda, afei.dwInstance = dwInstance; afei.fnCallback = fnCallback; - return acmFilterEnumW(had, &afdw, MSACM_FilterEnumCallbackWtoA, + return acmFilterEnumW(had, &afdw, MSACM_FilterEnumCallbackWtoA, (DWORD)&afei, fdwEnum); } -static BOOL MSACM_FilterEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, - PACMFILTERDETAILSW pafd, - ACMFILTERENUMCBW fnCallback, DWORD dwInstance, +static BOOL MSACM_FilterEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, + PACMFILTERDETAILSW pafd, + ACMFILTERENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum) { ACMFILTERTAGDETAILSW aftd; @@ -196,19 +196,19 @@ static BOOL MSACM_FilterEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, aftd.dwFilterTagIndex = i; if (acmFilterTagDetailsW(had, &aftd, ACM_FILTERTAGDETAILSF_INDEX) != MMSYSERR_NOERROR) continue; - - if ((fdwEnum & ACM_FILTERENUMF_DWFILTERTAG) && + + if ((fdwEnum & ACM_FILTERENUMF_DWFILTERTAG) && aftd.dwFilterTag != pafd->pwfltr->dwFilterTag) continue; - + for (j = 0; j < aftd.cStandardFilters; j++) { pafd->dwFilterIndex = j; pafd->dwFilterTag = aftd.dwFilterTag; - if (acmFilterDetailsW(had, pafd, ACM_FILTERDETAILSF_INDEX) != MMSYSERR_NOERROR) + if (acmFilterDetailsW(had, pafd, ACM_FILTERDETAILSF_INDEX) != MMSYSERR_NOERROR) continue; - + if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport)) - return FALSE; + return FALSE; } } return TRUE; @@ -217,8 +217,8 @@ static BOOL MSACM_FilterEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, /*********************************************************************** * acmFilterEnumW (MSACM32.@) */ -MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd, - ACMFILTERENUMCBW fnCallback, DWORD dwInstance, +MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd, + ACMFILTERENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum) { PWINE_ACMDRIVERID padid; @@ -243,10 +243,10 @@ MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd, } for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { /* should check for codec only */ - if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) || + if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) || acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR) continue; - ret = MSACM_FilterEnumHelper(padid, had, pafd, + ret = MSACM_FilterEnumHelper(padid, had, pafd, fnCallback, dwInstance, fdwEnum); acmDriverClose(had, 0); if (!ret) break; @@ -257,7 +257,7 @@ MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd, /*********************************************************************** * acmFilterTagDetailsA (MSACM32.@) */ -MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda, +MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda, DWORD fdwDetails) { ACMFILTERTAGDETAILSW aftdw; @@ -270,11 +270,11 @@ MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftd mmr = acmFilterTagDetailsW(had, &aftdw, fdwDetails); if (mmr == MMSYSERR_NOERROR) { - paftda->dwFilterTag = aftdw.dwFilterTag; + paftda->dwFilterTag = aftdw.dwFilterTag; paftda->dwFilterTagIndex = aftdw.dwFilterTagIndex; - paftda->cbFilterSize = aftdw.cbFilterSize; - paftda->fdwSupport = aftdw.fdwSupport; - paftda->cStandardFilters = aftdw.cStandardFilters; + paftda->cbFilterSize = aftdw.cbFilterSize; + paftda->fdwSupport = aftdw.fdwSupport; + paftda->cStandardFilters = aftdw.cStandardFilters; WideCharToMultiByte( CP_ACP, 0, aftdw.szFilterTag, -1, paftda->szFilterTag, sizeof(paftda->szFilterTag), NULL, NULL ); } @@ -284,7 +284,7 @@ MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftd /*********************************************************************** * acmFilterTagDetailsW (MSACM32.@) */ -MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd, +MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd, DWORD fdwDetails) { PWINE_ACMDRIVERID padid; @@ -327,20 +327,20 @@ MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd mmr = ACMERR_NOTPOSSIBLE; for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { /* should check for codec only */ - if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && + if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) { memset(&tmp, 0, sizeof(tmp)); tmp.cbStruct = sizeof(tmp); tmp.dwFilterTag = ft; - if (MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, + if (MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)&tmp, fdwDetails) == MMSYSERR_NOERROR) { if (mmr == ACMERR_NOTPOSSIBLE || paftd->cbFilterSize < tmp.cbFilterSize) { *paftd = tmp; mmr = MMSYSERR_NOERROR; - } + } } acmDriverClose(had, 0); } @@ -355,7 +355,7 @@ MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd mmr = MMSYSERR_ERROR; } - if (mmr == MMSYSERR_NOERROR && + if (mmr == MMSYSERR_NOERROR && paftd->dwFilterTag == WAVE_FORMAT_PCM && paftd->szFilterTag[0] == 0) MultiByteToWideChar( CP_ACP, 0, "PCM", -1, paftd->szFilterTag, sizeof(paftd->szFilterTag)/sizeof(WCHAR) ); @@ -370,23 +370,23 @@ struct MSACM_FilterTagEnumWtoA_Instance { }; static BOOL CALLBACK MSACM_FilterTagEnumCallbackWtoA(HACMDRIVERID hadid, - PACMFILTERTAGDETAILSW paftdw, - DWORD dwInstance, + PACMFILTERTAGDETAILSW paftdw, + DWORD dwInstance, DWORD fdwSupport) { struct MSACM_FilterTagEnumWtoA_Instance* paftei; paftei = (struct MSACM_FilterTagEnumWtoA_Instance*)dwInstance; - paftei->paftda->dwFilterTagIndex = paftdw->dwFilterTagIndex; - paftei->paftda->dwFilterTag = paftdw->dwFilterTag; - paftei->paftda->cbFilterSize = paftdw->cbFilterSize; - paftei->paftda->fdwSupport = paftdw->fdwSupport; - paftei->paftda->cStandardFilters = paftdw->cStandardFilters; + paftei->paftda->dwFilterTagIndex = paftdw->dwFilterTagIndex; + paftei->paftda->dwFilterTag = paftdw->dwFilterTag; + paftei->paftda->cbFilterSize = paftdw->cbFilterSize; + paftei->paftda->fdwSupport = paftdw->fdwSupport; + paftei->paftda->cStandardFilters = paftdw->cStandardFilters; WideCharToMultiByte( CP_ACP, 0, paftdw->szFilterTag, -1, paftei->paftda->szFilterTag, sizeof(paftei->paftda->szFilterTag), NULL, NULL ); - return (paftei->fnCallback)(hadid, paftei->paftda, + return (paftei->fnCallback)(hadid, paftei->paftda, paftei->dwInstance, fdwSupport); } @@ -394,7 +394,7 @@ static BOOL CALLBACK MSACM_FilterTagEnumCallbackWtoA(HACMDRIVERID hadid, * acmFilterTagEnumA (MSACM32.@) */ MMRESULT WINAPI acmFilterTagEnumA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda, - ACMFILTERTAGENUMCBA fnCallback, DWORD dwInstance, + ACMFILTERTAGENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum) { ACMFILTERTAGDETAILSW aftdw; @@ -409,7 +409,7 @@ MMRESULT WINAPI acmFilterTagEnumA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda, aftei.dwInstance = dwInstance; aftei.fnCallback = fnCallback; - return acmFilterTagEnumW(had, &aftdw, MSACM_FilterTagEnumCallbackWtoA, + return acmFilterTagEnumW(had, &aftdw, MSACM_FilterTagEnumCallbackWtoA, (DWORD)&aftei, fdwEnum); } @@ -417,19 +417,19 @@ MMRESULT WINAPI acmFilterTagEnumA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda, * acmFilterTagEnumW (MSACM32.@) */ MMRESULT WINAPI acmFilterTagEnumW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd, - ACMFILTERTAGENUMCBW fnCallback, DWORD dwInstance, + ACMFILTERTAGENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum) { PWINE_ACMDRIVERID padid; int i; TRACE("(0x%08x, %p, %p, %ld, %ld)\n", - had, paftd, fnCallback, dwInstance, fdwEnum); + had, paftd, fnCallback, dwInstance, fdwEnum); if (paftd->cbStruct < sizeof(*paftd)) return MMSYSERR_INVALPARAM; if (had) FIXME("had != NULL, not supported\n"); - + for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { /* should check for codec only */ if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && diff --git a/dlls/msacm/format.c b/dlls/msacm/format.c index 14c5eeb5d59..9847e063628 100644 --- a/dlls/msacm/format.c +++ b/dlls/msacm/format.c @@ -50,7 +50,7 @@ struct MSACM_FillFormatData { DWORD ret; }; -static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, +static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, PACMFORMATTAGDETAILSA paftd, DWORD dwInstance, DWORD fdwSupport) { @@ -58,10 +58,10 @@ static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, switch (affd->mode) { case WINE_ACMFF_TAG: - if (SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, - CB_FINDSTRINGEXACT, + if (SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, + CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)paftd->szFormatTag) == CB_ERR) - SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, + SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, CB_ADDSTRING, 0, (DWORD)paftd->szFormatTag); break; case WINE_ACMFF_FORMAT: @@ -87,22 +87,22 @@ static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, mmr = acmFormatDetailsA(had, &afd, ACM_FORMATDETAILSF_INDEX); if (mmr == MMSYSERR_NOERROR) { strncpy(buffer, afd.szFormat, ACMFORMATTAGDETAILS_FORMATTAG_CHARS); - for (idx = strlen(buffer); + for (idx = strlen(buffer); idx < ACMFORMATTAGDETAILS_FORMATTAG_CHARS; idx++) buffer[idx] = ' '; - wsprintfA(buffer + ACMFORMATTAGDETAILS_FORMATTAG_CHARS, - "%d Ko/s", + wsprintfA(buffer + ACMFORMATTAGDETAILS_FORMATTAG_CHARS, + "%d Ko/s", (afd.pwfx->nAvgBytesPerSec + 512) / 1024); - SendDlgItemMessageA(affd->hWnd, - IDD_ACMFORMATCHOOSE_CMB_FORMAT, + SendDlgItemMessageA(affd->hWnd, + IDD_ACMFORMATCHOOSE_CMB_FORMAT, CB_ADDSTRING, 0, (DWORD)buffer); } } acmDriverClose(had, 0); - SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, + SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, CB_SETCURSEL, 0, 0); HeapFree(MSACM_hHeap, 0, afd.pwfx); - } + } } break; case WINE_ACMFF_WFX: @@ -117,12 +117,12 @@ static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, afd.pwfx = affd->afc->pwfx; afd.cbwfx = affd->afc->cbwfx; - afd.dwFormatIndex = SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, - CB_GETCURSEL, 0, 0);; + afd.dwFormatIndex = SendDlgItemMessageA(affd->hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, + CB_GETCURSEL, 0, 0); affd->ret = acmFormatDetailsA(had, &afd, ACM_FORMATDETAILSF_INDEX); acmDriverClose(had, 0); return TRUE; - } + } } break; default: @@ -160,12 +160,12 @@ static BOOL MSACM_FillFormat(HWND hWnd) affd.hWnd = hWnd; affd.mode = WINE_ACMFF_FORMAT; - SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, + SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, CB_GETLBTEXT, - SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, + SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, CB_GETCURSEL, 0, 0), (DWORD)affd.szFormatTag); - + acmFormatTagEnumA((HACMDRIVER)0, &aftd, MSACM_FillFormatTagsCB, (DWORD)&affd, 0); SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMAT, CB_SETCURSEL, 0, 0); return TRUE; @@ -183,9 +183,9 @@ static MMRESULT MSACM_GetWFX(HWND hWnd, PACMFORMATCHOOSEA afc) affd.mode = WINE_ACMFF_WFX; affd.afc = afc; affd.ret = MMSYSERR_NOERROR; - SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, + SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, CB_GETLBTEXT, - SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, + SendDlgItemMessageA(hWnd, IDD_ACMFORMATCHOOSE_CMB_FORMATTAG, CB_GETCURSEL, 0, 0), (DWORD)affd.szFormatTag); @@ -193,12 +193,12 @@ static MMRESULT MSACM_GetWFX(HWND hWnd, PACMFORMATCHOOSEA afc) return affd.ret; } -static BOOL WINAPI FormatChooseDlgProc(HWND hWnd, UINT msg, +static BOOL WINAPI FormatChooseDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - + TRACE("hwnd=%i msg=%i 0x%08x 0x%08lx\n", hWnd, msg, wParam, lParam ); - + switch (msg) { case WM_INITDIALOG: afc = (PACMFORMATCHOOSEA)lParam; @@ -210,7 +210,7 @@ static BOOL WINAPI FormatChooseDlgProc(HWND hWnd, UINT msg, if (!(afc->fdwStyle & ACMFORMATCHOOSE_STYLEF_SHOWHELP)) ShowWindow(GetDlgItem(hWnd, IDD_ACMFORMATCHOOSE_BTN_HELP), SW_HIDE); return TRUE; - + case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: @@ -225,39 +225,39 @@ static BOOL WINAPI FormatChooseDlgProc(HWND hWnd, UINT msg, MSACM_FillFormat(hWnd); break; default: - TRACE("Dropped dlgNotif (fmtTag): 0x%08x 0x%08lx\n", + TRACE("Dropped dlgNotif (fmtTag): 0x%08x 0x%08lx\n", HIWORD(wParam), lParam); break; } break; case IDD_ACMFORMATCHOOSE_BTN_HELP: if (afc->fdwStyle & ACMFORMATCHOOSE_STYLEF_SHOWHELP) - SendMessageA(afc->hwndOwner, + SendMessageA(afc->hwndOwner, RegisterWindowMessageA(ACMHELPMSGSTRINGA), 0L, 0L); break; - + default: - TRACE("Dropped dlgCmd: ctl=%d ntf=0x%04x 0x%08lx\n", + TRACE("Dropped dlgCmd: ctl=%d ntf=0x%04x 0x%08lx\n", LOWORD(wParam), HIWORD(wParam), lParam); break; } break; case WM_CONTEXTMENU: if (afc->fdwStyle & ACMFORMATCHOOSE_STYLEF_CONTEXTHELP) - SendMessageA(afc->hwndOwner, - RegisterWindowMessageA(ACMHELPMSGCONTEXTMENUA), + SendMessageA(afc->hwndOwner, + RegisterWindowMessageA(ACMHELPMSGCONTEXTMENUA), wParam, lParam); break; #if defined(WM_CONTEXTHELP) case WM_CONTEXTHELP: if (afc->fdwStyle & ACMFORMATCHOOSE_STYLEF_CONTEXTHELP) - SendMessageA(afc->hwndOwner, - RegisterWindowMessageA(ACMHELPMSGCONTEXTHELPA), + SendMessageA(afc->hwndOwner, + RegisterWindowMessageA(ACMHELPMSGCONTEXTHELPA), wParam, lParam); break; -#endif +#endif default: - TRACE("Dropped dlgMsg: hwnd=%i msg=%i 0x%08x 0x%08lx\n", + TRACE("Dropped dlgMsg: hwnd=%i msg=%i 0x%08x 0x%08lx\n", hWnd, msg, wParam, lParam ); break; } @@ -286,7 +286,7 @@ MMRESULT WINAPI acmFormatChooseW(PACMFORMATCHOOSEW pafmtc) /*********************************************************************** * acmFormatDetailsA (MSACM32.@) */ -MMRESULT WINAPI acmFormatDetailsA(HACMDRIVER had, PACMFORMATDETAILSA pafd, +MMRESULT WINAPI acmFormatDetailsA(HACMDRIVER had, PACMFORMATDETAILSA pafd, DWORD fdwDetails) { ACMFORMATDETAILSW afdw; @@ -295,14 +295,14 @@ MMRESULT WINAPI acmFormatDetailsA(HACMDRIVER had, PACMFORMATDETAILSA pafd, memset(&afdw, 0, sizeof(afdw)); afdw.cbStruct = sizeof(afdw); afdw.dwFormatIndex = pafd->dwFormatIndex; - afdw.dwFormatTag = pafd->dwFormatTag; - afdw.pwfx = pafd->pwfx; - afdw.cbwfx = pafd->cbwfx; + afdw.dwFormatTag = pafd->dwFormatTag; + afdw.pwfx = pafd->pwfx; + afdw.cbwfx = pafd->cbwfx; mmr = acmFormatDetailsW(had, &afdw, fdwDetails); if (mmr == MMSYSERR_NOERROR) { - pafd->dwFormatTag = afdw.dwFormatTag; - pafd->fdwSupport = afdw.fdwSupport; + pafd->dwFormatTag = afdw.dwFormatTag; + pafd->fdwSupport = afdw.fdwSupport; WideCharToMultiByte( CP_ACP, 0, afdw.szFormat, -1, pafd->szFormat, sizeof(pafd->szFormat), NULL, NULL ); } @@ -325,7 +325,7 @@ MMRESULT WINAPI acmFormatDetailsW(HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD aftd.cbStruct = sizeof(aftd); if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM; - + switch (fdwDetails) { case ACM_FORMATDETAILSF_FORMAT: if (pafd->dwFormatTag != pafd->pwfx->wFormatTag) { @@ -338,13 +338,13 @@ MMRESULT WINAPI acmFormatDetailsW(HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD mmr = ACMERR_NOTPOSSIBLE; for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { /* should check for codec only */ - if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && + if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) { mmr = MSACM_Message(had, ACMDM_FORMAT_DETAILS, (LPARAM)pafd, fdwDetails); acmDriverClose(had, 0); if (mmr == MMSYSERR_NOERROR) break; } - } + } } else { mmr = MSACM_Message(had, ACMDM_FORMAT_DETAILS, (LPARAM)pafd, fdwDetails); } @@ -362,7 +362,7 @@ MMRESULT WINAPI acmFormatDetailsW(HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD if (mmr == MMSYSERR_NOERROR && pafd->szFormat[0] == (WCHAR)0) { wsprintfW(pafd->szFormat, fmt1, pafd->pwfx->nSamplesPerSec); if (pafd->pwfx->wBitsPerSample) { - wsprintfW(pafd->szFormat + lstrlenW(pafd->szFormat), fmt2, + wsprintfW(pafd->szFormat + lstrlenW(pafd->szFormat), fmt2, pafd->pwfx->wBitsPerSample); } MultiByteToWideChar( CP_ACP, 0, (pafd->pwfx->nChannels == 1) ? "; Mono" : "; Stereo", -1, @@ -381,21 +381,21 @@ struct MSACM_FormatEnumWtoA_Instance { }; static BOOL CALLBACK MSACM_FormatEnumCallbackWtoA(HACMDRIVERID hadid, - PACMFORMATDETAILSW pafdw, - DWORD dwInstance, + PACMFORMATDETAILSW pafdw, + DWORD dwInstance, DWORD fdwSupport) { struct MSACM_FormatEnumWtoA_Instance* pafei; pafei = (struct MSACM_FormatEnumWtoA_Instance*)dwInstance; - pafei->pafda->dwFormatIndex = pafdw->dwFormatIndex; - pafei->pafda->dwFormatTag = pafdw->dwFormatTag; - pafei->pafda->fdwSupport = pafdw->fdwSupport; + pafei->pafda->dwFormatIndex = pafdw->dwFormatIndex; + pafei->pafda->dwFormatTag = pafdw->dwFormatTag; + pafei->pafda->fdwSupport = pafdw->fdwSupport; WideCharToMultiByte( CP_ACP, 0, pafdw->szFormat, -1, pafei->pafda->szFormat, sizeof(pafei->pafda->szFormat), NULL, NULL ); - return (pafei->fnCallback)(hadid, pafei->pafda, + return (pafei->fnCallback)(hadid, pafei->pafda, pafei->dwInstance, fdwSupport); } @@ -403,7 +403,7 @@ static BOOL CALLBACK MSACM_FormatEnumCallbackWtoA(HACMDRIVERID hadid, * acmFormatEnumA (MSACM32.@) */ MMRESULT WINAPI acmFormatEnumA(HACMDRIVER had, PACMFORMATDETAILSA pafda, - ACMFORMATENUMCBA fnCallback, DWORD dwInstance, + ACMFORMATENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum) { ACMFORMATDETAILSW afdw; @@ -420,16 +420,16 @@ MMRESULT WINAPI acmFormatEnumA(HACMDRIVER had, PACMFORMATDETAILSA pafda, afei.dwInstance = dwInstance; afei.fnCallback = fnCallback; - return acmFormatEnumW(had, &afdw, MSACM_FormatEnumCallbackWtoA, + return acmFormatEnumW(had, &afdw, MSACM_FormatEnumCallbackWtoA, (DWORD)&afei, fdwEnum); } /*********************************************************************** * acmFormatEnumW (MSACM32.@) */ -static BOOL MSACM_FormatEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, - PACMFORMATDETAILSW pafd, PWAVEFORMATEX pwfxRef, - ACMFORMATENUMCBW fnCallback, DWORD dwInstance, +static BOOL MSACM_FormatEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, + PACMFORMATDETAILSW pafd, PWAVEFORMATEX pwfxRef, + ACMFORMATENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum) { ACMFORMATTAGDETAILSW aftd; @@ -441,33 +441,33 @@ static BOOL MSACM_FormatEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, aftd.dwFormatTagIndex = i; if (acmFormatTagDetailsW(had, &aftd, ACM_FORMATTAGDETAILSF_INDEX) != MMSYSERR_NOERROR) continue; - + if ((fdwEnum & ACM_FORMATENUMF_WFORMATTAG) && aftd.dwFormatTag != pwfxRef->wFormatTag) continue; - + for (j = 0; j < aftd.cStandardFormats; j++) { pafd->dwFormatIndex = j; pafd->dwFormatTag = aftd.dwFormatTag; - if (acmFormatDetailsW(had, pafd, ACM_FORMATDETAILSF_INDEX) != MMSYSERR_NOERROR) + if (acmFormatDetailsW(had, pafd, ACM_FORMATDETAILSF_INDEX) != MMSYSERR_NOERROR) continue; - - if ((fdwEnum & ACM_FORMATENUMF_NCHANNELS) && + + if ((fdwEnum & ACM_FORMATENUMF_NCHANNELS) && pafd->pwfx->nChannels != pwfxRef->nChannels) continue; - if ((fdwEnum & ACM_FORMATENUMF_NSAMPLESPERSEC) && + if ((fdwEnum & ACM_FORMATENUMF_NSAMPLESPERSEC) && pafd->pwfx->nSamplesPerSec != pwfxRef->nSamplesPerSec) continue; - if ((fdwEnum & ACM_FORMATENUMF_WBITSPERSAMPLE) && + if ((fdwEnum & ACM_FORMATENUMF_WBITSPERSAMPLE) && pafd->pwfx->wBitsPerSample != pwfxRef->wBitsPerSample) continue; if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) && !(pafd->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_HARDWARE)) continue; - + /* more checks to be done on fdwEnum */ if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport)) - return FALSE; + return FALSE; } /* the "formats" used by the filters are also reported */ } @@ -477,7 +477,7 @@ static BOOL MSACM_FormatEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, /**********************************************************************/ MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, PACMFORMATDETAILSW pafd, - ACMFORMATENUMCBW fnCallback, DWORD dwInstance, + ACMFORMATENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum) { PWINE_ACMDRIVERID padid; @@ -494,7 +494,7 @@ MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, PACMFORMATDETAILSW pafd, ACM_FORMATENUMF_CONVERT|ACM_FORMATENUMF_SUGGEST)) wfxRef = *pafd->pwfx; - if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) && + if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) && !(fdwEnum & (ACM_FORMATENUMF_INPUT|ACM_FORMATENUMF_OUTPUT))) return MMSYSERR_INVALPARAM; @@ -511,16 +511,16 @@ MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, PACMFORMATDETAILSW pafd, if (acmDriverID((HACMOBJ)had, &hadid, 0) != MMSYSERR_NOERROR) return MMSYSERR_INVALHANDLE; - MSACM_FormatEnumHelper(MSACM_GetDriverID(hadid), had, pafd, &wfxRef, + MSACM_FormatEnumHelper(MSACM_GetDriverID(hadid), had, pafd, &wfxRef, fnCallback, dwInstance, fdwEnum); return MMSYSERR_NOERROR; } for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { /* should check for codec only */ - if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) || + if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) || acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR) continue; - ret = MSACM_FormatEnumHelper(padid, had, pafd, &wfxRef, + ret = MSACM_FormatEnumHelper(padid, had, pafd, &wfxRef, fnCallback, dwInstance, fdwEnum); acmDriverClose(had, 0); if (!ret) break; @@ -531,13 +531,13 @@ MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, PACMFORMATDETAILSW pafd, /*********************************************************************** * acmFormatSuggest (MSACM32.@) */ -MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc, +MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc, PWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest) { ACMDRVFORMATSUGGEST adfg; MMRESULT mmr; - TRACE("(0x%08x, %p, %p, %ld, %ld)\n", + TRACE("(0x%08x, %p, %p, %ld, %ld)\n", had, pwfxSrc, pwfxDst, cbwfxDst, fdwSuggest); if (fdwSuggest & ~(ACM_FORMATSUGGESTF_NCHANNELS|ACM_FORMATSUGGESTF_NSAMPLESPERSEC| @@ -554,8 +554,8 @@ MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc, if (had == (HACMDRIVER)NULL) { PWINE_ACMDRIVERID padid; - - /* MS doc says: ACM finds the best suggestion. + + /* MS doc says: ACM finds the best suggestion. * Well, first found will be the "best" */ mmr = ACMERR_NOTPOSSIBLE; @@ -564,7 +564,7 @@ MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc, if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) || acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR) continue; - + if (MSACM_Message(had, ACMDM_FORMAT_SUGGEST, (LPARAM)&adfg, 0L) == MMSYSERR_NOERROR) { mmr = MMSYSERR_NOERROR; break; @@ -580,7 +580,7 @@ MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc, /*********************************************************************** * acmFormatTagDetailsA (MSACM32.@) */ -MMRESULT WINAPI acmFormatTagDetailsA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftda, +MMRESULT WINAPI acmFormatTagDetailsA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftda, DWORD fdwDetails) { ACMFORMATTAGDETAILSW aftdw; @@ -593,11 +593,11 @@ MMRESULT WINAPI acmFormatTagDetailsA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftd mmr = acmFormatTagDetailsW(had, &aftdw, fdwDetails); if (mmr == MMSYSERR_NOERROR) { - paftda->dwFormatTag = aftdw.dwFormatTag; + paftda->dwFormatTag = aftdw.dwFormatTag; paftda->dwFormatTagIndex = aftdw.dwFormatTagIndex; - paftda->cbFormatSize = aftdw.cbFormatSize; - paftda->fdwSupport = aftdw.fdwSupport; - paftda->cStandardFormats = aftdw.cStandardFormats; + paftda->cbFormatSize = aftdw.cbFormatSize; + paftda->fdwSupport = aftdw.fdwSupport; + paftda->cStandardFormats = aftdw.cStandardFormats; WideCharToMultiByte( CP_ACP, 0, aftdw.szFormatTag, -1, paftda->szFormatTag, sizeof(paftda->szFormatTag), NULL, NULL ); } @@ -607,7 +607,7 @@ MMRESULT WINAPI acmFormatTagDetailsA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftd /*********************************************************************** * acmFormatTagDetailsW (MSACM32.@) */ -MMRESULT WINAPI acmFormatTagDetailsW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, +MMRESULT WINAPI acmFormatTagDetailsW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, DWORD fdwDetails) { PWINE_ACMDRIVERID padid; @@ -624,7 +624,7 @@ MMRESULT WINAPI acmFormatTagDetailsW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd if (had == (HACMDRIVER)NULL) { for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { /* should check for codec only */ - if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && + if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && MSACM_FindFormatTagInCache(padid, paftd->dwFormatTag, NULL) && acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) { mmr = MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)paftd, fdwDetails); @@ -634,7 +634,7 @@ MMRESULT WINAPI acmFormatTagDetailsW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd } } else { PWINE_ACMDRIVER pad = MSACM_GetDriver(had); - + if (pad && MSACM_FindFormatTagInCache(pad->obj.pACMDriverID, paftd->dwFormatTag, NULL)) mmr = MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)paftd, fdwDetails); } @@ -643,10 +643,10 @@ MMRESULT WINAPI acmFormatTagDetailsW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd case ACM_FORMATTAGDETAILSF_INDEX: if (had != (HACMDRIVER)NULL) { PWINE_ACMDRIVER pad = MSACM_GetDriver(had); - + if (pad && paftd->dwFormatTagIndex < pad->obj.pACMDriverID->cFormatTags) mmr = MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)paftd, fdwDetails); - } + } break; case ACM_FORMATTAGDETAILSF_LARGESTSIZE: @@ -656,20 +656,20 @@ MMRESULT WINAPI acmFormatTagDetailsW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { /* should check for codec only */ - if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && + if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) { memset(&tmp, 0, sizeof(tmp)); tmp.cbStruct = sizeof(tmp); tmp.dwFormatTag = ft; - if (MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, + if (MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)&tmp, fdwDetails) == MMSYSERR_NOERROR) { if (mmr == ACMERR_NOTPOSSIBLE || paftd->cbFormatSize < tmp.cbFormatSize) { *paftd = tmp; mmr = MMSYSERR_NOERROR; - } + } } acmDriverClose(had, 0); } @@ -684,7 +684,7 @@ MMRESULT WINAPI acmFormatTagDetailsW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd mmr = MMSYSERR_ERROR; } - if (mmr == MMSYSERR_NOERROR && + if (mmr == MMSYSERR_NOERROR && paftd->dwFormatTag == WAVE_FORMAT_PCM && paftd->szFormatTag[0] == 0) MultiByteToWideChar( CP_ACP, 0, "PCM", -1, paftd->szFormatTag, sizeof(paftd->szFormatTag)/sizeof(WCHAR) ); @@ -699,23 +699,23 @@ struct MSACM_FormatTagEnumWtoA_Instance { }; static BOOL CALLBACK MSACM_FormatTagEnumCallbackWtoA(HACMDRIVERID hadid, - PACMFORMATTAGDETAILSW paftdw, - DWORD dwInstance, + PACMFORMATTAGDETAILSW paftdw, + DWORD dwInstance, DWORD fdwSupport) { struct MSACM_FormatTagEnumWtoA_Instance* paftei; paftei = (struct MSACM_FormatTagEnumWtoA_Instance*)dwInstance; - paftei->paftda->dwFormatTagIndex = paftdw->dwFormatTagIndex; - paftei->paftda->dwFormatTag = paftdw->dwFormatTag; - paftei->paftda->cbFormatSize = paftdw->cbFormatSize; - paftei->paftda->fdwSupport = paftdw->fdwSupport; - paftei->paftda->cStandardFormats = paftdw->cStandardFormats; + paftei->paftda->dwFormatTagIndex = paftdw->dwFormatTagIndex; + paftei->paftda->dwFormatTag = paftdw->dwFormatTag; + paftei->paftda->cbFormatSize = paftdw->cbFormatSize; + paftei->paftda->fdwSupport = paftdw->fdwSupport; + paftei->paftda->cStandardFormats = paftdw->cStandardFormats; WideCharToMultiByte( CP_ACP, 0, paftdw->szFormatTag, -1, paftei->paftda->szFormatTag, sizeof(paftei->paftda->szFormatTag), NULL, NULL ); - return (paftei->fnCallback)(hadid, paftei->paftda, + return (paftei->fnCallback)(hadid, paftei->paftda, paftei->dwInstance, fdwSupport); } @@ -723,7 +723,7 @@ static BOOL CALLBACK MSACM_FormatTagEnumCallbackWtoA(HACMDRIVERID hadid, * acmFormatTagEnumA (MSACM32.@) */ MMRESULT WINAPI acmFormatTagEnumA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftda, - ACMFORMATTAGENUMCBA fnCallback, DWORD dwInstance, + ACMFORMATTAGENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum) { ACMFORMATTAGDETAILSW aftdw; @@ -738,7 +738,7 @@ MMRESULT WINAPI acmFormatTagEnumA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftda, aftei.dwInstance = dwInstance; aftei.fnCallback = fnCallback; - return acmFormatTagEnumW(had, &aftdw, MSACM_FormatTagEnumCallbackWtoA, + return acmFormatTagEnumW(had, &aftdw, MSACM_FormatTagEnumCallbackWtoA, (DWORD)&aftei, fdwEnum); } @@ -746,7 +746,7 @@ MMRESULT WINAPI acmFormatTagEnumA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftda, * acmFormatTagEnumW (MSACM32.@) */ MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, - ACMFORMATTAGENUMCBW fnCallback, DWORD dwInstance, + ACMFORMATTAGENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum) { PWINE_ACMDRIVERID padid; @@ -754,15 +754,15 @@ MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, BOOL bPcmDone = FALSE; TRACE("(0x%08x, %p, %p, %ld, %ld)\n", - had, paftd, fnCallback, dwInstance, fdwEnum); + had, paftd, fnCallback, dwInstance, fdwEnum); if (paftd->cbStruct < sizeof(*paftd)) return MMSYSERR_INVALPARAM; if (had) FIXME("had != NULL, not supported\n"); - + for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { /* should check for codec only */ - if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && + if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == MMSYSERR_NOERROR) { for (i = 0; i < padid->cFormatTags; i++) { paftd->dwFormatTagIndex = i; @@ -772,9 +772,9 @@ MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, if (paftd->szFormatTag[0] == 0) MultiByteToWideChar( CP_ACP, 0, "PCM", -1, paftd->szFormatTag, sizeof(paftd->szFormatTag)/sizeof(WCHAR) ); - /* FIXME (EPP): I'm not sure this is the correct + /* FIXME (EPP): I'm not sure this is the correct * algorithm (should make more sense to apply the same - * for all already loaded formats, but this will do + * for all already loaded formats, but this will do * for now */ if (bPcmDone) continue; diff --git a/dlls/msacm/imaadp32/imaadp32.c b/dlls/msacm/imaadp32/imaadp32.c index ee270d9a0d6..41e74bf1464 100644 --- a/dlls/msacm/imaadp32/imaadp32.c +++ b/dlls/msacm/imaadp32/imaadp32.c @@ -52,9 +52,9 @@ static DWORD ADPCM_drvClose(DWORD dwDevID) return 1; } -typedef struct tagAcmAdpcmData +typedef struct tagAcmAdpcmData { - void (*convert)(PACMDRVSTREAMINSTANCE adsi, + void (*convert)(PACMDRVSTREAMINSTANCE adsi, const unsigned char*, LPDWORD, unsigned char*, LPDWORD); /* IMA encoding only */ BYTE stepIndexL; @@ -65,14 +65,14 @@ typedef struct tagAcmAdpcmData /* table to list all supported formats... those are the basic ones. this * also helps given a unique index to each of the supported formats */ -typedef struct +typedef struct { int nChannels; int nBits; int rate; } Format; -static Format PCM_Formats[] = +static Format PCM_Formats[] = { {1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000}, {1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025}, @@ -80,9 +80,9 @@ static Format PCM_Formats[] = {1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100}, }; -static Format ADPCM_Formats[] = +static Format ADPCM_Formats[] = { - {1, 4, 8000}, {2, 4, 8000}, {1, 4, 11025}, {2, 4, 11025}, + {1, 4, 8000}, {2, 4, 8000}, {1, 4, 11025}, {2, 4, 11025}, {1, 4, 22050}, {2, 4, 22050}, {1, 4, 44100}, {2, 4, 44100}, }; @@ -96,8 +96,8 @@ static DWORD ADPCM_GetFormatIndex(LPWAVEFORMATEX wfx) { int i, hi; Format* fmts; - - switch (wfx->wFormatTag) + + switch (wfx->wFormatTag) { case WAVE_FORMAT_PCM: hi = NUM_PCM_FORMATS; @@ -110,15 +110,15 @@ static DWORD ADPCM_GetFormatIndex(LPWAVEFORMATEX wfx) default: return 0xFFFFFFFF; } - - for (i = 0; i < hi; i++) + + for (i = 0; i < hi; i++) { if (wfx->nChannels == fmts[i].nChannels && wfx->nSamplesPerSec == fmts[i].rate && wfx->wBitsPerSample == fmts[i].nBits) return i; } - + return 0xFFFFFFFF; } @@ -145,7 +145,7 @@ static inline void W16(unsigned char* dst, short s) /* IMA (or DVI) APDCM codec routines */ -static const unsigned IMA_StepTable[89] = +static const unsigned IMA_StepTable[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, @@ -161,10 +161,10 @@ static const unsigned IMA_StepTable[89] = 32767 }; -static const int IMA_IndexTable[16] = +static const int IMA_IndexTable[16] = { -1, -1, -1, -1, 2, 4, 6, 8, - -1, -1, -1, -1, 2, 4, 6, 8 + -1, -1, -1, -1, 2, 4, 6, 8 }; static inline void clamp_step_index(int* stepIndex) @@ -183,9 +183,9 @@ static inline void process_nibble(unsigned char code, int* stepIndex, int* sampl { unsigned step; int diff; - + code &= 0x0F; - + step = IMA_StepTable[*stepIndex]; diff = step >> 3; if (code & 1) diff += step >> 2; @@ -204,38 +204,38 @@ static inline unsigned char generate_nibble(int in, int* stepIndex, int* sample) unsigned step; unsigned char code; - if (diff < 0) + if (diff < 0) { diff = -diff; - code = 8; + code = 8; } - else + else { code = 0; } - + step = IMA_StepTable[*stepIndex]; effdiff = (step >> 3); - if (diff >= step) + if (diff >= step) { code |= 4; diff -= step; effdiff += step; } step >>= 1; - if (diff >= step) + if (diff >= step) { code |= 2; diff -= step; effdiff += step; } step >>= 1; - if (diff >= step) + if (diff >= step) { code |= 1; effdiff += step; } - if (code & 8) *sample -= effdiff; + if (code & 8) *sample -= effdiff; else *sample += effdiff; clamp_sample(sample); *stepIndex += IMA_IndexTable[code]; @@ -243,8 +243,8 @@ static inline unsigned char generate_nibble(int in, int* stepIndex, int* sample) return code; } -static void cvtSSima16K(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD nsrc, +static void cvtSSima16K(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { int i; @@ -256,30 +256,30 @@ static void cvtSSima16K(PACMDRVSTREAMINSTANCE adsi, * it's the min of the number of entire blocks in source buffer and the number * of entire blocks in destination buffer */ - DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign, + DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign, *ndst / (nsamp_blk * 2 * 2)); - + *nsrc = nblock * adsi->pwfxSrc->nBlockAlign; *ndst = nblock * (nsamp_blk * 2 * 2); - + nsamp_blk--; /* remove the sample in block header */ - for (; nblock > 0; nblock--) + for (; nblock > 0; nblock--) { const unsigned char* in_src = src; - + /* handle headers first */ sampleL = R16(src); stepIndexL = (unsigned)*(src + 2); clamp_step_index(&stepIndexL); src += 4; W16(dst, sampleL); dst += 2; - + sampleR = R16(src); stepIndexR = (unsigned)*(src + 2); clamp_step_index(&stepIndexR); src += 4; W16(dst, sampleR); dst += 2; - + for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 8) { for (i = 0; i < 4; i++) @@ -303,8 +303,8 @@ static void cvtSSima16K(PACMDRVSTREAMINSTANCE adsi, } } -static void cvtMMima16K(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD nsrc, +static void cvtMMima16K(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { int sample; @@ -315,24 +315,24 @@ static void cvtMMima16K(PACMDRVSTREAMINSTANCE adsi, * it's the min of the number of entire blocks in source buffer and the number * of entire blocks in destination buffer */ - DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign, + DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign, *ndst / (nsamp_blk * 2)); - + *nsrc = nblock * adsi->pwfxSrc->nBlockAlign; *ndst = nblock * nsamp_blk * 2; - + nsamp_blk--; /* remove the sample in block header */ - for (; nblock > 0; nblock--) + for (; nblock > 0; nblock--) { const unsigned char* in_src = src; - + /* handle header first */ sample = R16(src); stepIndex = (unsigned)*(src + 2); clamp_step_index(&stepIndex); src += 4; W16(dst, sample); dst += 2; - + for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2) { process_nibble(*src >> 4, &stepIndex, &sample); @@ -345,8 +345,8 @@ static void cvtMMima16K(PACMDRVSTREAMINSTANCE adsi, } } -static void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD nsrc, +static void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { int stepIndexL, stepIndexR; @@ -359,7 +359,7 @@ static void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi, * of entire blocks in destination buffer */ DWORD nblock = min(*nsrc / (nsamp_blk * 2 * 2), - *ndst / adsi->pwfxDst->nBlockAlign); + *ndst / adsi->pwfxDst->nBlockAlign); *nsrc = nblock * (nsamp_blk * 2 * 2); *ndst = nblock * adsi->pwfxDst->nBlockAlign; @@ -383,22 +383,22 @@ static void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi, W16(dst, sampleR); dst += 2; *dst = (unsigned char)(unsigned)stepIndexR; dst += 2; - + for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 8) { for (i = 0; i < 4; i++) { - code1 = generate_nibble(R16(src + (2 * i + 0) * 2 + 0), + code1 = generate_nibble(R16(src + (2 * i + 0) * 2 + 0), &stepIndexL, &sampleL); - code2 = generate_nibble(R16(src + (2 * i + 1) * 2 + 0), + code2 = generate_nibble(R16(src + (2 * i + 1) * 2 + 0), &stepIndexL, &sampleL); *dst++ = (code1 << 4) | code2; } for (i = 0; i < 4; i++) { - code1 = generate_nibble(R16(src + (2 * i + 0) * 2 + 1), + code1 = generate_nibble(R16(src + (2 * i + 0) * 2 + 1), &stepIndexR, &sampleR); - code2 = generate_nibble(R16(src + (2 * i + 1) * 2 + 1), + code2 = generate_nibble(R16(src + (2 * i + 1) * 2 + 1), &stepIndexR, &sampleR); *dst++ = (code1 << 4) | code2; } @@ -410,8 +410,8 @@ static void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi, ((AcmAdpcmData*)adsi->dwDriver)->stepIndexR = stepIndexR; } -static void cvtMM16imaK(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD nsrc, +static void cvtMM16imaK(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { int stepIndex; @@ -424,8 +424,8 @@ static void cvtMM16imaK(PACMDRVSTREAMINSTANCE adsi, * of entire blocks in destination buffer */ DWORD nblock = min(*nsrc / (nsamp_blk * 2), - *ndst / adsi->pwfxDst->nBlockAlign); - + *ndst / adsi->pwfxDst->nBlockAlign); + *nsrc = nblock * (nsamp_blk * 2); *ndst = nblock * adsi->pwfxDst->nBlockAlign; @@ -449,7 +449,7 @@ static void cvtMM16imaK(PACMDRVSTREAMINSTANCE adsi, W16(dst, sample); dst += 2; *dst = (unsigned char)(unsigned)stepIndex; dst += 2; - + for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2) { code1 = generate_nibble(R16(src), &stepIndex, &sample); @@ -488,7 +488,7 @@ static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add) MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1, add->szLicensing, sizeof(add->szLicensing)/sizeof(WCHAR) ); add->szFeatures[0] = 0; - + return MMSYSERR_NOERROR; } @@ -500,21 +500,21 @@ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) { static WCHAR szPcm[]={'P','C','M',0}; static WCHAR szImaAdPcm[]={'I','M','A',' ','A','d','P','C','M',0}; - - switch (dwQuery) + + switch (dwQuery) { case ACM_FORMATTAGDETAILSF_INDEX: if (aftd->dwFormatTagIndex >= 2) return ACMERR_NOTPOSSIBLE; break; case ACM_FORMATTAGDETAILSF_LARGESTSIZE: - if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN) + if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN) { aftd->dwFormatTagIndex = 1; /* WAVE_FORMAT_IMA_ADPCM is bigger than PCM */ break; } /* fall thru */ - case ACM_FORMATTAGDETAILSF_FORMATTAG: - switch (aftd->dwFormatTag) + case ACM_FORMATTAGDETAILSF_FORMATTAG: + switch (aftd->dwFormatTag) { case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break; case WAVE_FORMAT_IMA_ADPCM: aftd->dwFormatTagIndex = 1; break; @@ -525,9 +525,9 @@ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) WARN("Unsupported query %08lx\n", dwQuery); return MMSYSERR_NOTSUPPORTED; } - + aftd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; - switch (aftd->dwFormatTagIndex) + switch (aftd->dwFormatTagIndex) { case 0: aftd->dwFormatTag = WAVE_FORMAT_PCM; @@ -551,14 +551,14 @@ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) */ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) { - switch (dwQuery) + switch (dwQuery) { case ACM_FORMATDETAILSF_FORMAT: if (ADPCM_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; break; case ACM_FORMATDETAILSF_INDEX: afd->pwfx->wFormatTag = afd->dwFormatTag; - switch (afd->dwFormatTag) + switch (afd->dwFormatTag) { case WAVE_FORMAT_PCM: if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE; @@ -566,11 +566,11 @@ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate; afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits; /* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not accessible - * afd->pwfx->cbSize = 0; + * afd->pwfx->cbSize = 0; */ - afd->pwfx->nBlockAlign = + afd->pwfx->nBlockAlign = (afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8; - afd->pwfx->nAvgBytesPerSec = + afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign; break; case WAVE_FORMAT_IMA_ADPCM: @@ -594,11 +594,11 @@ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) break; default: WARN("Unsupported query %08lx\n", dwQuery); - return MMSYSERR_NOTSUPPORTED; + return MMSYSERR_NOTSUPPORTED; } afd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; afd->szFormat[0] = 0; /* let MSACM format this for us... */ - + return MMSYSERR_NOERROR; } @@ -620,21 +620,21 @@ static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs) if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC)) adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec; - if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE)) + if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE)) { - if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) + if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) adfs->pwfxDst->wBitsPerSample = 4; else adfs->pwfxDst->wBitsPerSample = 16; } - if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)) + if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)) { - if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) + if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) adfs->pwfxDst->wFormatTag = WAVE_FORMAT_IMA_ADPCM; else adfs->pwfxDst->wFormatTag = WAVE_FORMAT_PCM; } - + /* check if result is ok */ if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; @@ -679,25 +679,25 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) unsigned nspb; assert(!(adsi->fdwOpen & ACM_STREAMOPENF_ASYNC)); - + if (ADPCM_GetFormatIndex(adsi->pwfxSrc) == 0xFFFFFFFF || ADPCM_GetFormatIndex(adsi->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; - + aad = HeapAlloc(GetProcessHeap(), 0, sizeof(AcmAdpcmData)); if (aad == 0) return MMSYSERR_NOMEM; - + adsi->dwDriver = (DWORD)aad; - + if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { goto theEnd; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_IMA_ADPCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { - /* resampling or mono <=> stereo not available + /* resampling or mono <=> stereo not available * ADPCM algo only define 16 bit per sample output */ if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || @@ -717,19 +717,19 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) goto theEnd; /* adpcm decoding... */ - if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 2) + if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 2) aad->convert = cvtSSima16K; - if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 1) + if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 1) aad->convert = cvtMMima16K; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM) { if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels || adsi->pwfxSrc->wBitsPerSample != 16) goto theEnd; - + nspb = ((LPIMAADPCMWAVEFORMAT)adsi->pwfxDst)->wSamplesPerBlock; FIXME("spb=%u\n", nspb); @@ -742,16 +742,16 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) goto theEnd; /* adpcm coding... */ - if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 2) + if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 2) aad->convert = cvtSS16imaK; - if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 1) + if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 1) aad->convert = cvtMM16imaK; } else goto theEnd; ADPCM_Reset(adsi, aad); return MMSYSERR_NOERROR; - + theEnd: HeapFree(GetProcessHeap(), 0, aad); adsi->dwDriver = 0L; @@ -785,23 +785,23 @@ static inline DWORD ADPCM_round(DWORD a, DWORD b, DWORD c) */ static LRESULT ADPCM_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss) { - switch (adss->fdwSize) + switch (adss->fdwSize) { case ACM_STREAMSIZEF_DESTINATION: /* cbDstLength => cbSrcLength */ if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM) { /* don't take block overhead into account, doesn't matter too much */ adss->cbSrcLength = adss->cbDstLength * 4; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_IMA_ADPCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { FIXME("misses the block header overhead\n"); adss->cbSrcLength = 256 + adss->cbDstLength / 4; } - else + else { return MMSYSERR_NOTSUPPORTED; } @@ -809,25 +809,25 @@ static LRESULT ADPCM_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad case ACM_STREAMSIZEF_SOURCE: /* cbSrcLength => cbDstLength */ if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM) { FIXME("misses the block header overhead\n"); adss->cbDstLength = 256 + adss->cbSrcLength / 4; - } + } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_IMA_ADPCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { /* don't take block overhead into account, doesn't matter too much */ adss->cbDstLength = adss->cbSrcLength * 4; } - else + else { return MMSYSERR_NOTSUPPORTED; } break; default: WARN("Unsupported query %08lx\n", adss->fdwSize); - return MMSYSERR_NOTSUPPORTED; + return MMSYSERR_NOTSUPPORTED; } return MMSYSERR_NOERROR; } @@ -841,11 +841,11 @@ static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEAD AcmAdpcmData* aad = (AcmAdpcmData*)adsi->dwDriver; DWORD nsrc = adsh->cbSrcLength; DWORD ndst = adsh->cbDstLength; - - if (adsh->fdwConvert & + + if (adsh->fdwConvert & ~(ACM_STREAMCONVERTF_BLOCKALIGN| ACM_STREAMCONVERTF_END| - ACM_STREAMCONVERTF_START)) + ACM_STREAMCONVERTF_START)) { FIXME("Unsupported fdwConvert (%08lx), ignoring it\n", adsh->fdwConvert); } @@ -854,7 +854,7 @@ static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEAD * ACM_STREAMCONVERTF_END * no pending data, so do nothing for this flag */ - if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START)) + if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START)) { ADPCM_Reset(adsi, aad); } @@ -862,60 +862,60 @@ static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEAD aad->convert(adsi, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst); adsh->cbSrcLengthUsed = nsrc; adsh->cbDstLengthUsed = ndst; - + return MMSYSERR_NOERROR; } /************************************************************************** * ADPCM_DriverProc [exported] */ -LRESULT CALLBACK ADPCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, +LRESULT CALLBACK ADPCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2) { - TRACE("(%08lx %08lx %04x %08lx %08lx);\n", + TRACE("(%08lx %08lx %04x %08lx %08lx);\n", dwDevID, (DWORD)hDriv, wMsg, dwParam1, dwParam2); - - switch (wMsg) + + switch (wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; case DRV_OPEN: return ADPCM_drvOpen((LPSTR)dwParam1); case DRV_CLOSE: return ADPCM_drvClose(dwDevID); - case DRV_ENABLE: return 1; + case DRV_ENABLE: return 1; case DRV_DISABLE: return 1; case DRV_QUERYCONFIGURE: return 1; case DRV_CONFIGURE: MessageBoxA(0, "MSACM IMA ADPCM filter !", "Wine Driver", MB_OK); return 1; case DRV_INSTALL: return DRVCNF_RESTART; case DRV_REMOVE: return DRVCNF_RESTART; - + case ACMDM_DRIVER_NOTIFY: /* no caching from other ACM drivers is done so far */ return MMSYSERR_NOERROR; - + case ACMDM_DRIVER_DETAILS: return ADPCM_DriverDetails((PACMDRIVERDETAILSW)dwParam1); - + case ACMDM_FORMATTAG_DETAILS: return ADPCM_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2); - + case ACMDM_FORMAT_DETAILS: return ADPCM_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2); - + case ACMDM_FORMAT_SUGGEST: return ADPCM_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1); - + case ACMDM_STREAM_OPEN: return ADPCM_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1); - + case ACMDM_STREAM_CLOSE: return ADPCM_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1); - + case ACMDM_STREAM_SIZE: return ADPCM_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2); - + case ACMDM_STREAM_CONVERT: return ADPCM_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2); - + case ACMDM_HARDWARE_WAVE_CAPS_INPUT: case ACMDM_HARDWARE_WAVE_CAPS_OUTPUT: /* this converter is not a hardware driver */ @@ -929,7 +929,7 @@ LRESULT CALLBACK ADPCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, case ACMDM_STREAM_UNPREPARE: /* nothing special to do here... so don't do anything */ return MMSYSERR_NOERROR; - + default: return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); } diff --git a/dlls/msacm/internal.c b/dlls/msacm/internal.c index 417f3e0f294..e852b40863e 100644 --- a/dlls/msacm/internal.c +++ b/dlls/msacm/internal.c @@ -47,14 +47,14 @@ PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL; /*********************************************************************** * MSACM_DumpCache */ -static void MSACM_DumpCache(PWINE_ACMDRIVERID padid) +static void MSACM_DumpCache(PWINE_ACMDRIVERID padid) { unsigned i; TRACE("cFilterTags=%lu cFormatTags=%lu fdwSupport=%08lx\n", padid->cFilterTags, padid->cFormatTags, padid->fdwSupport); for (i = 0; i < padid->cache->cFormatTags; i++) { - TRACE("\tdwFormatTag=%lu cbwfx=%lu\n", + TRACE("\tdwFormatTag=%lu cbwfx=%lu\n", padid->aFormatTag[i].dwFormatTag, padid->aFormatTag[i].cbwfx); } } @@ -62,7 +62,7 @@ static void MSACM_DumpCache(PWINE_ACMDRIVERID padid) /*********************************************************************** * MSACM_FindFormatTagInCache [internal] - * + * * Returns TRUE is the format tag fmtTag is present in the cache. * If so, idx is set to its index. */ @@ -82,7 +82,7 @@ BOOL MSACM_FindFormatTagInCache(WINE_ACMDRIVERID* padid, DWORD fmtTag, LPDWORD i /*********************************************************************** * MSACM_FillCache */ -static BOOL MSACM_FillCache(PWINE_ACMDRIVERID padid) +static BOOL MSACM_FillCache(PWINE_ACMDRIVERID padid) { HACMDRIVER had = 0; int ntag; @@ -98,7 +98,7 @@ static BOOL MSACM_FillCache(PWINE_ACMDRIVERID padid) goto errCleanUp; if (add.cFormatTags > 0) { - padid->aFormatTag = HeapAlloc(MSACM_hHeap, HEAP_ZERO_MEMORY, + padid->aFormatTag = HeapAlloc(MSACM_hHeap, HEAP_ZERO_MEMORY, add.cFormatTags * sizeof(padid->aFormatTag[0])); if (!padid->aFormatTag) goto errCleanUp; } @@ -108,7 +108,7 @@ static BOOL MSACM_FillCache(PWINE_ACMDRIVERID padid) padid->fdwSupport = add.fdwSupport; aftd.cbStruct = sizeof(aftd); - + for (ntag = 0; ntag < add.cFormatTags; ntag++) { aftd.dwFormatTagIndex = ntag; if (MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)&aftd, ACM_FORMATTAGDETAILSF_INDEX)) { @@ -216,8 +216,8 @@ static BOOL MSACM_WriteCache(PWINE_ACMDRIVERID padid) goto errCleanUp; if (RegSetValueExA(hKey, "fdwSupport", 0, REG_DWORD, (void*)&padid->fdwSupport, sizeof(DWORD))) goto errCleanUp; - if (RegSetValueExA(hKey, "aFormatTagCache", 0, REG_BINARY, - (void*)padid->aFormatTag, + if (RegSetValueExA(hKey, "aFormatTagCache", 0, REG_BINARY, + (void*)padid->aFormatTag, padid->cFormatTags * sizeof(padid->aFormatTag[0]))) goto errCleanUp; HeapFree(MSACM_hHeap, 0, key); @@ -229,11 +229,11 @@ static BOOL MSACM_WriteCache(PWINE_ACMDRIVERID padid) } /*********************************************************************** - * MSACM_RegisterDriver() + * MSACM_RegisterDriver() */ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName, HINSTANCE hinstModule) -{ +{ PWINE_ACMDRIVERID padid; TRACE("('%s', '%s', 0x%08x)\n", pszDriverAlias, pszFileName, hinstModule); @@ -254,7 +254,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName, strcpy( padid->pszFileName, pszFileName ); } padid->hInstModule = hinstModule; - + padid->pACMDriverList = NULL; padid->pNextACMDriverID = NULL; padid->pPrevACMDriverID = MSACM_pLastACMDriverID; @@ -273,24 +273,24 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName, } /*********************************************************************** - * MSACM_RegisterAllDrivers() + * MSACM_RegisterAllDrivers() */ void MSACM_RegisterAllDrivers(void) { LPSTR pszBuffer; DWORD dwBufferLength; - /* FIXME + /* FIXME * What if the user edits system.ini while the program is running? * Does Windows handle that? */ if (MSACM_pFirstACMDriverID) return; - + /* FIXME: Does not work! How do I determine the section length? */ dwBufferLength = 1024; /* EPP GetPrivateProfileSectionA("drivers32", NULL, 0, "system.ini"); */ - + pszBuffer = (LPSTR) HeapAlloc(MSACM_hHeap, 0, dwBufferLength); if (GetPrivateProfileSectionA("drivers32", pszBuffer, dwBufferLength, "system.ini")) { char* s = pszBuffer; @@ -303,11 +303,11 @@ void MSACM_RegisterAllDrivers(void) MSACM_RegisterDriver(s, s2 + 1, 0); *s2 = '='; } - } + } s += strlen(s) + 1; /* Either next char or \0 */ } } - + HeapFree(MSACM_hHeap, 0, pszBuffer); MSACM_RegisterDriver("msacm32.dll", "msacm32.dll", 0); @@ -319,10 +319,10 @@ void MSACM_RegisterAllDrivers(void) PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p) { PWINE_ACMDRIVERID pNextACMDriverID; - + while (p->pACMDriverList) acmDriverClose((HACMDRIVER) p->pACMDriverList, 0); - + if (p->pszDriverAlias) HeapFree(MSACM_hHeap, 0, p->pszDriverAlias); if (p->pszFileName) @@ -338,11 +338,11 @@ PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p) p->pPrevACMDriverID->pNextACMDriverID = p->pNextACMDriverID; if (p->pNextACMDriverID) p->pNextACMDriverID->pPrevACMDriverID = p->pPrevACMDriverID; - + pNextACMDriverID = p->pNextACMDriverID; - + HeapFree(MSACM_hHeap, 0, p); - + return pNextACMDriverID; } @@ -351,7 +351,7 @@ PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p) */ void MSACM_UnregisterAllDrivers(void) { - PWINE_ACMDRIVERID p = MSACM_pFirstACMDriverID; + PWINE_ACMDRIVERID p = MSACM_pFirstACMDriverID; while (p) { MSACM_WriteCache(p); @@ -373,7 +373,7 @@ PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type) } /*********************************************************************** - * MSACM_GetDriverID() + * MSACM_GetDriverID() */ PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID) { diff --git a/dlls/msacm/msacm32_main.c b/dlls/msacm/msacm32_main.c index 80f92f75dbc..a923d45046e 100644 --- a/dlls/msacm/msacm32_main.c +++ b/dlls/msacm/msacm32_main.c @@ -30,13 +30,13 @@ #include "wineacm.h" WINE_DEFAULT_DEBUG_CHANNEL(msacm); - + /**********************************************************************/ - + HINSTANCE MSACM_hInstance32 = 0; /*********************************************************************** - * MSACM_LibMain (MSACM32.init) + * MSACM_LibMain (MSACM32.init) */ BOOL WINAPI MSACM32_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -110,7 +110,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric) MMRESULT mmr = MMSYSERR_NOERROR; TRACE("(0x%08x, %d, %p);\n", hao, uMetric, pMetric); - + #define CheckLocal(padid) (!bLocal || ((padid)->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_LOCAL)) switch (uMetric) { @@ -131,7 +131,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric) case ACM_METRIC_COUNT_LOCAL_CODECS: if (hao) return MMSYSERR_INVALHANDLE; for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) - if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && + if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_CODEC) && CheckLocal(padid)) val++; @@ -144,7 +144,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric) case ACM_METRIC_COUNT_LOCAL_CONVERTERS: if (hao) return MMSYSERR_INVALHANDLE; for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) - if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && + if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_CONVERTER) && CheckLocal(padid)) val++; @@ -157,8 +157,8 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric) case ACM_METRIC_COUNT_LOCAL_FILTERS: if (hao) return MMSYSERR_INVALHANDLE; for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) - if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && - (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_FILTER) && + if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) && + (padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_FILTER) && CheckLocal(padid)) val++; *(LPDWORD)pMetric = val; @@ -174,7 +174,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric) val++; *(LPDWORD)pMetric = val; break; - + case ACM_METRIC_MAX_SIZE_FORMAT: if (hao == (HACMOBJ)NULL) { for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) { diff --git a/dlls/msacm/msacm_main.c b/dlls/msacm/msacm_main.c index be5947cbfea..1d1d017e8c9 100644 --- a/dlls/msacm/msacm_main.c +++ b/dlls/msacm/msacm_main.c @@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msacm); * MSACM DLL entry point * */ -BOOL WINAPI MSACM_DllEntryPoint(DWORD fdwReason, HINSTANCE16 hinstDLL, WORD ds, +BOOL WINAPI MSACM_DllEntryPoint(DWORD fdwReason, HINSTANCE16 hinstDLL, WORD ds, WORD wHeapSize, DWORD dwReserved1, WORD wReserved2) { static HANDLE hndl; @@ -210,7 +210,7 @@ MMRESULT16 WINAPI acmFormatTagEnum16( { FIXME("(0x%04x, %p, %p, %ld, %ld): stub\n", had, paftd, fnCallback, dwInstance, fdwEnum - ); + ); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return MMSYSERR_ERROR; } @@ -255,7 +255,7 @@ MMRESULT16 WINAPI acmFormatEnum16( * acmFormatSuggest (MSACM.45) */ MMRESULT16 WINAPI acmFormatSuggest16( - HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc, + HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest) { FIXME("(0x%04x, %p, %p, %ld, %ld): stub\n", @@ -358,7 +358,7 @@ MMRESULT16 WINAPI acmStreamClose16( * acmStreamSize (MSACM.72) */ MMRESULT16 WINAPI acmStreamSize16( - HACMSTREAM16 has, DWORD cbInput, + HACMSTREAM16 has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize) { FIXME("(0x%04x, %ld, %p, %ld): stub\n", diff --git a/dlls/msacm/msacmdrv.h b/dlls/msacm/msacmdrv.h index abf36d57c0b..cb8688f12d3 100644 --- a/dlls/msacm/msacmdrv.h +++ b/dlls/msacm/msacmdrv.h @@ -36,7 +36,7 @@ #define MAKE_ACM_VERSION(mjr, mnr, bld) \ (((long)(mjr)<<24) | ((long)(mnr)<<16) | ((long)bld)) -#define ACMDRVOPENDESC_SECTIONNAME_CHARS +#define ACMDRVOPENDESC_SECTIONNAME_CHARS #define ACMDM_DRIVER_NOTIFY (ACMDM_BASE + 1) #define ACMDM_DRIVER_DETAILS (ACMDM_BASE + 10) diff --git a/dlls/msacm/msadp32/msadp32.c b/dlls/msacm/msadp32/msadp32.c index f0f5b9b782f..aca54f1051d 100644 --- a/dlls/msacm/msadp32/msadp32.c +++ b/dlls/msacm/msadp32/msadp32.c @@ -50,23 +50,23 @@ static DWORD ADPCM_drvClose(DWORD dwDevID) return 1; } -typedef struct tagAcmAdpcmData +typedef struct tagAcmAdpcmData { - void (*convert)(PACMDRVSTREAMINSTANCE adsi, + void (*convert)(PACMDRVSTREAMINSTANCE adsi, const unsigned char*, LPDWORD, unsigned char*, LPDWORD); } AcmAdpcmData; /* table to list all supported formats... those are the basic ones. this * also helps given a unique index to each of the supported formats */ -typedef struct +typedef struct { int nChannels; int nBits; int rate; } Format; -static Format PCM_Formats[] = +static Format PCM_Formats[] = { {1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000}, {1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025}, @@ -74,9 +74,9 @@ static Format PCM_Formats[] = {1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100}, }; -static Format ADPCM_Formats[] = +static Format ADPCM_Formats[] = { - {1, 4, 8000}, {2, 4, 8000}, {1, 4, 11025}, {2, 4, 11025}, + {1, 4, 8000}, {2, 4, 8000}, {1, 4, 11025}, {2, 4, 11025}, {1, 4, 22050}, {2, 4, 22050}, {1, 4, 44100}, {2, 4, 44100}, }; @@ -102,8 +102,8 @@ static DWORD ADPCM_GetFormatIndex(WAVEFORMATEX* wfx) { int i, hi; Format* fmts; - - switch (wfx->wFormatTag) + + switch (wfx->wFormatTag) { case WAVE_FORMAT_PCM: hi = NUM_PCM_FORMATS; @@ -116,15 +116,15 @@ static DWORD ADPCM_GetFormatIndex(WAVEFORMATEX* wfx) default: return 0xFFFFFFFF; } - - for (i = 0; i < hi; i++) + + for (i = 0; i < hi; i++) { if (wfx->nChannels == fmts[i].nChannels && wfx->nSamplesPerSec == fmts[i].rate && wfx->wBitsPerSample == fmts[i].nBits) return i; } - + return 0xFFFFFFFF; } @@ -148,7 +148,7 @@ static void init_wfx_adpcm(ADPCMWAVEFORMAT* awfx) } pwfx->cbSize = 2 * sizeof(WORD) + 7 * sizeof(ADPCMCOEFSET); /* 7 is the size of the block head (which contains two samples) */ - + awfx->wSamplesPerBlock = (pwfx->nBlockAlign - (7 * pwfx->nChannels)) * (2 / pwfx->nChannels) + 2; pwfx->nAvgBytesPerSec = (pwfx->nSamplesPerSec * pwfx->nBlockAlign) / awfx->wSamplesPerBlock; awfx->wNumCoef = 7; @@ -182,7 +182,7 @@ static inline void clamp_sample(int* sample) if (*sample > 32767) *sample = 32767; } -static inline void process_nibble(unsigned nibble, int* idelta, +static inline void process_nibble(unsigned nibble, int* idelta, int* sample1, int* sample2, const ADPCMCOEFSET* coeff) { @@ -191,7 +191,7 @@ static inline void process_nibble(unsigned nibble, int* idelta, /* nibble is in fact a signed 4 bit integer => propagate sign if needed */ snibble = (nibble & 0x08) ? (nibble - 16) : nibble; - sample = ((*sample1 * coeff->iCoef1) + (*sample2 * coeff->iCoef2)) / 256 + + sample = ((*sample1 * coeff->iCoef1) + (*sample2 * coeff->iCoef2)) / 256 + snibble * *idelta; clamp_sample(&sample); @@ -201,8 +201,8 @@ static inline void process_nibble(unsigned nibble, int* idelta, if (*idelta < 16) *idelta = 16; } -static void cvtSSms16K(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD nsrc, +static void cvtSSms16K(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { int ideltaL, ideltaR; @@ -211,17 +211,17 @@ static void cvtSSms16K(PACMDRVSTREAMINSTANCE adsi, ADPCMCOEFSET coeffL, coeffR; int nsamp; int nsamp_blk = ((ADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock; - DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign, + DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign, *ndst / (nsamp_blk * 2 * 2)); - + *nsrc = nblock * adsi->pwfxSrc->nBlockAlign; *ndst = nblock * nsamp_blk * 2 * 2; nsamp_blk -= 2; /* see below for samples from block head */ - for (; nblock > 0; nblock--) + for (; nblock > 0; nblock--) { const unsigned char* in_src = src; - + assert(*src <= 6); coeffL = MSADPCM_CoeffSet[*src++]; assert(*src <= 6); @@ -246,13 +246,13 @@ static void cvtSSms16K(PACMDRVSTREAMINSTANCE adsi, W16(dst, sample1L); dst += 2; process_nibble(*src++ & 0x0F, &ideltaR, &sample1R, &sample2R, &coeffR); W16(dst, sample1R); dst += 2; - } + } src = in_src + adsi->pwfxSrc->nBlockAlign; } } -static void cvtMMms16K(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD nsrc, +static void cvtMMms16K(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { int idelta; @@ -260,17 +260,17 @@ static void cvtMMms16K(PACMDRVSTREAMINSTANCE adsi, ADPCMCOEFSET coeff; int nsamp; int nsamp_blk = ((ADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock; - DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign, + DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign, *ndst / (nsamp_blk * 2)); - + *nsrc = nblock * adsi->pwfxSrc->nBlockAlign; *ndst = nblock * nsamp_blk * 2; nsamp_blk -= 2; /* see below for samples from block head */ - for (; nblock > 0; nblock--) + for (; nblock > 0; nblock--) { const unsigned char* in_src = src; - + assert(*src <= 6); coeff = MSADPCM_CoeffSet[*src++]; @@ -288,20 +288,20 @@ static void cvtMMms16K(PACMDRVSTREAMINSTANCE adsi, W16(dst, sample1); dst += 2; process_nibble(*src++ & 0x0F, &idelta, &sample1, &sample2, &coeff); W16(dst, sample1); dst += 2; - } + } src = in_src + adsi->pwfxSrc->nBlockAlign; } } #if 0 -static void cvtSS16msK(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD nsrc, +static void cvtSS16msK(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { } -static void cvtMM16msK(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD nsrc, +static void cvtMM16msK(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { } @@ -332,7 +332,7 @@ static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add) MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1, add->szLicensing, sizeof(add->szLicensing)/sizeof(WCHAR) ); add->szFeatures[0] = 0; - + return MMSYSERR_NOERROR; } @@ -344,21 +344,21 @@ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) { static WCHAR szPcm[]={'P','C','M',0}; static WCHAR szMsAdPcm[]={'M','S',' ','A','d','P','C','M',0}; - - switch (dwQuery) + + switch (dwQuery) { case ACM_FORMATTAGDETAILSF_INDEX: if (aftd->dwFormatTagIndex >= 2) return ACMERR_NOTPOSSIBLE; break; case ACM_FORMATTAGDETAILSF_LARGESTSIZE: - if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN) + if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN) { aftd->dwFormatTagIndex = 1; /* WAVE_FORMAT_ADPCM is bigger than PCM */ break; } /* fall thru */ - case ACM_FORMATTAGDETAILSF_FORMATTAG: - switch (aftd->dwFormatTag) + case ACM_FORMATTAGDETAILSF_FORMATTAG: + switch (aftd->dwFormatTag) { case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break; case WAVE_FORMAT_ADPCM: aftd->dwFormatTagIndex = 1; break; @@ -369,9 +369,9 @@ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) WARN("Unsupported query %08lx\n", dwQuery); return MMSYSERR_NOTSUPPORTED; } - + aftd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; - switch (aftd->dwFormatTagIndex) + switch (aftd->dwFormatTagIndex) { case 0: aftd->dwFormatTag = WAVE_FORMAT_PCM; @@ -395,14 +395,14 @@ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) */ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) { - switch (dwQuery) + switch (dwQuery) { case ACM_FORMATDETAILSF_FORMAT: if (ADPCM_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; break; case ACM_FORMATDETAILSF_INDEX: afd->pwfx->wFormatTag = afd->dwFormatTag; - switch (afd->dwFormatTag) + switch (afd->dwFormatTag) { case WAVE_FORMAT_PCM: if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE; @@ -410,11 +410,11 @@ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate; afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits; /* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not accessible - * afd->pwfx->cbSize = 0; + * afd->pwfx->cbSize = 0; */ - afd->pwfx->nBlockAlign = + afd->pwfx->nBlockAlign = (afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8; - afd->pwfx->nAvgBytesPerSec = + afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign; break; case WAVE_FORMAT_ADPCM: @@ -433,11 +433,11 @@ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) break; default: WARN("Unsupported query %08lx\n", dwQuery); - return MMSYSERR_NOTSUPPORTED; + return MMSYSERR_NOTSUPPORTED; } afd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; afd->szFormat[0] = 0; /* let MSACM format this for us... */ - + return MMSYSERR_NOERROR; } @@ -459,21 +459,21 @@ static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs) if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC)) adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec; - if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE)) + if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE)) { - if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) + if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) adfs->pwfxDst->wBitsPerSample = 4; else adfs->pwfxDst->wBitsPerSample = 16; } - if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)) + if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)) { - if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) + if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) adfs->pwfxDst->wFormatTag = WAVE_FORMAT_ADPCM; else adfs->pwfxDst->wFormatTag = WAVE_FORMAT_PCM; } - + /* check if result is ok */ if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; @@ -513,25 +513,25 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) unsigned nspb; assert(!(adsi->fdwOpen & ACM_STREAMOPENF_ASYNC)); - + if (ADPCM_GetFormatIndex(adsi->pwfxSrc) == 0xFFFFFFFF || ADPCM_GetFormatIndex(adsi->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; - + aad = HeapAlloc(GetProcessHeap(), 0, sizeof(AcmAdpcmData)); if (aad == 0) return MMSYSERR_NOMEM; - + adsi->dwDriver = (DWORD)aad; - + if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { goto theEnd; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ADPCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { - /* resampling or mono <=> stereo not available + /* resampling or mono <=> stereo not available * ADPCM algo only define 16 bit per sample output */ if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || @@ -552,19 +552,19 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) #endif /* adpcm decoding... */ - if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 2) + if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 2) aad->convert = cvtSSms16K; - if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 1) + if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 1) aad->convert = cvtMMms16K; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM) { if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels || adsi->pwfxSrc->wBitsPerSample != 16) goto theEnd; -#if 0 +#if 0 nspb = ((IMAADPCMWAVEFORMAT*)adsi->pwfxDst)->wSamplesPerBlock; FIXME("spb=%u\n", nspb); @@ -578,9 +578,9 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) #endif #if 0 /* adpcm coding... */ - if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 2) + if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 2) aad->convert = cvtSS16msK; - if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 1) + if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 1) aad->convert = cvtMM16msK; #endif FIXME("We don't support encoding yet\n"); @@ -590,7 +590,7 @@ static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) ADPCM_Reset(adsi, aad); return MMSYSERR_NOERROR; - + theEnd: HeapFree(GetProcessHeap(), 0, aad); adsi->dwDriver = 0L; @@ -624,23 +624,23 @@ static inline DWORD ADPCM_round(DWORD a, DWORD b, DWORD c) */ static LRESULT ADPCM_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss) { - switch (adss->fdwSize) + switch (adss->fdwSize) { case ACM_STREAMSIZEF_DESTINATION: /* cbDstLength => cbSrcLength */ if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM) { /* don't take block overhead into account, doesn't matter too much */ adss->cbSrcLength = adss->cbDstLength * 4; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ADPCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { FIXME("misses the block header overhead\n"); adss->cbSrcLength = 256 + adss->cbDstLength / 4; } - else + else { return MMSYSERR_NOTSUPPORTED; } @@ -648,25 +648,25 @@ static LRESULT ADPCM_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad case ACM_STREAMSIZEF_SOURCE: /* cbSrcLength => cbDstLength */ if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM) { FIXME("misses the block header overhead\n"); adss->cbDstLength = 256 + adss->cbSrcLength / 4; - } + } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ADPCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { /* don't take block overhead into account, doesn't matter too much */ adss->cbDstLength = adss->cbSrcLength * 4; } - else + else { return MMSYSERR_NOTSUPPORTED; } break; default: WARN("Unsupported query %08lx\n", adss->fdwSize); - return MMSYSERR_NOTSUPPORTED; + return MMSYSERR_NOTSUPPORTED; } return MMSYSERR_NOERROR; } @@ -680,11 +680,11 @@ static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEAD AcmAdpcmData* aad = (AcmAdpcmData*)adsi->dwDriver; DWORD nsrc = adsh->cbSrcLength; DWORD ndst = adsh->cbDstLength; - - if (adsh->fdwConvert & + + if (adsh->fdwConvert & ~(ACM_STREAMCONVERTF_BLOCKALIGN| ACM_STREAMCONVERTF_END| - ACM_STREAMCONVERTF_START)) + ACM_STREAMCONVERTF_START)) { FIXME("Unsupported fdwConvert (%08lx), ignoring it\n", adsh->fdwConvert); } @@ -693,7 +693,7 @@ static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEAD * ACM_STREAMCONVERTF_END * no pending data, so do nothing for this flag */ - if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START)) + if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START)) { ADPCM_Reset(adsi, aad); } @@ -701,60 +701,60 @@ static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEAD aad->convert(adsi, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst); adsh->cbSrcLengthUsed = nsrc; adsh->cbDstLengthUsed = ndst; - + return MMSYSERR_NOERROR; } /************************************************************************** * ADPCM_DriverProc [exported] */ -LRESULT CALLBACK ADPCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, +LRESULT CALLBACK ADPCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2) { - TRACE("(%08lx %08lx %04x %08lx %08lx);\n", + TRACE("(%08lx %08lx %04x %08lx %08lx);\n", dwDevID, (DWORD)hDriv, wMsg, dwParam1, dwParam2); - - switch (wMsg) + + switch (wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; case DRV_OPEN: return ADPCM_drvOpen((LPSTR)dwParam1); case DRV_CLOSE: return ADPCM_drvClose(dwDevID); - case DRV_ENABLE: return 1; + case DRV_ENABLE: return 1; case DRV_DISABLE: return 1; case DRV_QUERYCONFIGURE: return 1; case DRV_CONFIGURE: MessageBoxA(0, "MSACM MS ADPCM filter !", "Wine Driver", MB_OK); return 1; case DRV_INSTALL: return DRVCNF_RESTART; case DRV_REMOVE: return DRVCNF_RESTART; - + case ACMDM_DRIVER_NOTIFY: /* no caching from other ACM drivers is done so far */ return MMSYSERR_NOERROR; - + case ACMDM_DRIVER_DETAILS: return ADPCM_DriverDetails((PACMDRIVERDETAILSW)dwParam1); - + case ACMDM_FORMATTAG_DETAILS: return ADPCM_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2); - + case ACMDM_FORMAT_DETAILS: return ADPCM_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2); - + case ACMDM_FORMAT_SUGGEST: return ADPCM_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1); - + case ACMDM_STREAM_OPEN: return ADPCM_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1); - + case ACMDM_STREAM_CLOSE: return ADPCM_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1); - + case ACMDM_STREAM_SIZE: return ADPCM_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2); - + case ACMDM_STREAM_CONVERT: return ADPCM_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2); - + case ACMDM_HARDWARE_WAVE_CAPS_INPUT: case ACMDM_HARDWARE_WAVE_CAPS_OUTPUT: /* this converter is not a hardware driver */ @@ -768,7 +768,7 @@ LRESULT CALLBACK ADPCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, case ACMDM_STREAM_UNPREPARE: /* nothing special to do here... so don't do anything */ return MMSYSERR_NOERROR; - + default: return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); } diff --git a/dlls/msacm/msg711/msg711.c b/dlls/msacm/msg711/msg711.c index 696bb368555..637eeb9ebba 100644 --- a/dlls/msacm/msg711/msg711.c +++ b/dlls/msacm/msg711/msg711.c @@ -48,23 +48,23 @@ static DWORD G711_drvClose(DWORD dwDevID) return 1; } -typedef struct tagAcmG711Data +typedef struct tagAcmG711Data { - void (*convert)(PACMDRVSTREAMINSTANCE adsi, + void (*convert)(PACMDRVSTREAMINSTANCE adsi, const unsigned char*, LPDWORD, unsigned char*, LPDWORD); } AcmG711Data; /* table to list all supported formats... those are the basic ones. this * also helps given a unique index to each of the supported formats */ -typedef struct +typedef struct { int nChannels; int nBits; int rate; } Format; -static Format PCM_Formats[] = +static Format PCM_Formats[] = { /*{1, 8, 8000}, {2, 8, 8000}, */{1, 16, 8000}, {2, 16, 8000}, /*{1, 8, 11025}, {2, 8, 11025}, */{1, 16, 11025}, {2, 16, 11025}, @@ -72,15 +72,15 @@ static Format PCM_Formats[] = /*{1, 8, 44100}, {2, 8, 44100}, */{1, 16, 44100}, {2, 16, 44100}, }; -static Format ALaw_Formats[] = +static Format ALaw_Formats[] = { - {1, 8, 8000}, {2, 8, 8000}, {1, 8, 11025}, {2, 8, 11025}, + {1, 8, 8000}, {2, 8, 8000}, {1, 8, 11025}, {2, 8, 11025}, {1, 8, 22050}, {2, 8, 22050}, {1, 8, 44100}, {2, 8, 44100}, }; -static Format ULaw_Formats[] = +static Format ULaw_Formats[] = { - {1, 8, 8000}, {2, 8, 8000}, {1, 8, 11025}, {2, 8, 11025}, + {1, 8, 8000}, {2, 8, 8000}, {1, 8, 11025}, {2, 8, 11025}, {1, 8, 22050}, {2, 8, 22050}, {1, 8, 44100}, {2, 8, 44100}, }; @@ -95,8 +95,8 @@ static DWORD G711_GetFormatIndex(LPWAVEFORMATEX wfx) { int i, hi; Format* fmts; - - switch (wfx->wFormatTag) + + switch (wfx->wFormatTag) { case WAVE_FORMAT_PCM: hi = NUM_PCM_FORMATS; @@ -113,15 +113,15 @@ static DWORD G711_GetFormatIndex(LPWAVEFORMATEX wfx) default: return 0xFFFFFFFF; } - - for (i = 0; i < hi; i++) + + for (i = 0; i < hi; i++) { if (wfx->nChannels == fmts[i].nChannels && wfx->nSamplesPerSec == fmts[i].rate && wfx->wBitsPerSample == fmts[i].nBits) return i; } - + return 0xFFFFFFFF; } @@ -198,7 +198,7 @@ static inline void W16(unsigned char* dst, short s) * bli@cpk.auc.dk * */ - + #define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ #define QUANT_MASK (0xf) /* Quantization field mask. */ #define NSEGS (8) /* Number of A-law segments. */ @@ -223,7 +223,7 @@ static unsigned char _u2a[128] = { /* u- to A-law conversions */ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, /* corrected: - 81, 82, 83, 84, 85, 86, 87, 88, + 81, 82, 83, 84, 85, 86, 87, 88, should be: */ 80, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, @@ -261,7 +261,7 @@ search( int size) /* changed from "short" *drago* */ { int i; /* changed from "short" *drago* */ - + for (i = 0; i < size; i++) { if (val <= *table++) return (i); @@ -295,21 +295,21 @@ linear2alaw(int pcm_val) /* 2's complement (16-bit range) */ int mask; /* changed from "short" *drago* */ int seg; /* changed from "short" *drago* */ unsigned char aval; - + pcm_val = pcm_val >> 3; - + if (pcm_val >= 0) { mask = 0xD5; /* sign (7th) bit = 1 */ } else { mask = 0x55; /* sign bit = 0 */ pcm_val = -pcm_val - 1; } - + /* Convert the scaled magnitude to segment number. */ seg = search(pcm_val, seg_aend, 8); - + /* Combine the sign, segment, and quantization bits. */ - + if (seg >= 8) /* out of range, return maximum value. */ return (unsigned char) (0x7F ^ mask); else { @@ -332,9 +332,9 @@ alaw2linear(unsigned char a_val) { int t; /* changed from "short" *drago* */ int seg; /* changed from "short" *drago* */ - + a_val ^= 0x55; - + t = (a_val & QUANT_MASK) << 4; seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT; switch (seg) { @@ -352,7 +352,7 @@ alaw2linear(unsigned char a_val) } #else /* EPP (for Wine): - * this array has been statically generated from the above routine + * this array has been statically generated from the above routine */ static unsigned short _a2l[] = { 0xEA80, 0xEB80, 0xE880, 0xE980, 0xEE80, 0xEF80, 0xEC80, 0xED80, @@ -433,7 +433,7 @@ linear2ulaw(short pcm_val) /* 2's complement (16-bit range) */ short mask; short seg; unsigned char uval; - + /* Get the sign and the magnitude of the value. */ pcm_val = pcm_val >> 2; if (pcm_val < 0) { @@ -444,10 +444,10 @@ linear2ulaw(short pcm_val) /* 2's complement (16-bit range) */ } if ( pcm_val > CLIP ) pcm_val = CLIP; /* clip the magnitude */ pcm_val += (BIAS >> 2); - + /* Convert the scaled magnitude to segment number. */ seg = search(pcm_val, seg_uend, 8); - + /* * Combine the sign, segment, quantization bits; * and complement the code word. @@ -474,22 +474,22 @@ static inline short ulaw2linear(unsigned char u_val) { short t; - + /* Complement to obtain normal u-law value. */ u_val = ~u_val; - + /* * Extract and bias the quantization bits. Then * shift up by the segment number and subtract out the bias. */ t = ((u_val & QUANT_MASK) << 3) + BIAS; t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT; - + return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS)); } #else /* EPP (for Wine): - * this array has been statically generated from the above routine + * this array has been statically generated from the above routine */ static unsigned short _u2l[] = { 0x8284, 0x8684, 0x8A84, 0x8E84, 0x9284, 0x9684, 0x9A84, 0x9E84, @@ -532,7 +532,7 @@ static inline short ulaw2linear(unsigned char u_val) #endif /* A-law to u-law conversion */ -static inline unsigned char +static inline unsigned char alaw2ulaw(unsigned char aval) { aval &= 0xff; @@ -551,14 +551,14 @@ ulaw2alaw(unsigned char uval) /* -------------------------------------------------------------------------------*/ -static void cvtXXalaw16K(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD srcsize, +static void cvtXXalaw16K(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD srcsize, unsigned char* dst, LPDWORD dstsize) { DWORD len = min(*srcsize, *dstsize / 2); DWORD i; short w; - + *srcsize = len; *dstsize = len * 2; for (i = 0; i < len; i++) @@ -568,8 +568,8 @@ static void cvtXXalaw16K(PACMDRVSTREAMINSTANCE adsi, } } -static void cvtXX16alawK(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD srcsize, +static void cvtXX16alawK(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD srcsize, unsigned char* dst, LPDWORD dstsize) { DWORD len = min(*srcsize / 2, *dstsize); @@ -583,8 +583,8 @@ static void cvtXX16alawK(PACMDRVSTREAMINSTANCE adsi, } } -static void cvtXXulaw16K(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD srcsize, +static void cvtXXulaw16K(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD srcsize, unsigned char* dst, LPDWORD dstsize) { DWORD len = min(*srcsize, *dstsize / 2); @@ -600,8 +600,8 @@ static void cvtXXulaw16K(PACMDRVSTREAMINSTANCE adsi, } } -static void cvtXX16ulawK(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD srcsize, +static void cvtXX16ulawK(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD srcsize, unsigned char* dst, LPDWORD dstsize) { DWORD len = min(*srcsize / 2, *dstsize); @@ -615,8 +615,8 @@ static void cvtXX16ulawK(PACMDRVSTREAMINSTANCE adsi, } } -static void cvtXXalawulawK(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD srcsize, +static void cvtXXalawulawK(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD srcsize, unsigned char* dst, LPDWORD dstsize) { DWORD len = min(*srcsize, *dstsize); @@ -630,8 +630,8 @@ static void cvtXXalawulawK(PACMDRVSTREAMINSTANCE adsi, } -static void cvtXXulawalawK(PACMDRVSTREAMINSTANCE adsi, - const unsigned char* src, LPDWORD srcsize, +static void cvtXXulawalawK(PACMDRVSTREAMINSTANCE adsi, + const unsigned char* src, LPDWORD srcsize, unsigned char* dst, LPDWORD dstsize) { DWORD len = min(*srcsize, *dstsize); @@ -669,7 +669,7 @@ static LRESULT G711_DriverDetails(PACMDRIVERDETAILSW add) MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1, add->szLicensing, sizeof(add->szLicensing)/sizeof(WCHAR) ); add->szFeatures[0] = 0; - + return MMSYSERR_NOERROR; } @@ -682,21 +682,21 @@ static LRESULT G711_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) static WCHAR szPcm[]={'P','C','M',0}; static WCHAR szALaw[]={'A','-','L','a','w',0}; static WCHAR szULaw[]={'U','-','L','a','w',0}; - - switch (dwQuery) + + switch (dwQuery) { case ACM_FORMATTAGDETAILSF_INDEX: if (aftd->dwFormatTagIndex >= 3) return ACMERR_NOTPOSSIBLE; break; case ACM_FORMATTAGDETAILSF_LARGESTSIZE: - if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN) + if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN) { aftd->dwFormatTagIndex = 1; break; } /* fall thru */ - case ACM_FORMATTAGDETAILSF_FORMATTAG: - switch (aftd->dwFormatTag) + case ACM_FORMATTAGDETAILSF_FORMATTAG: + switch (aftd->dwFormatTag) { case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break; case WAVE_FORMAT_ALAW: aftd->dwFormatTagIndex = 1; break; @@ -708,9 +708,9 @@ static LRESULT G711_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) WARN("Unsupported query %08lx\n", dwQuery); return MMSYSERR_NOTSUPPORTED; } - + aftd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; - switch (aftd->dwFormatTagIndex) + switch (aftd->dwFormatTagIndex) { case 0: aftd->dwFormatTag = WAVE_FORMAT_PCM; @@ -740,14 +740,14 @@ static LRESULT G711_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) */ static LRESULT G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) { - switch (dwQuery) + switch (dwQuery) { case ACM_FORMATDETAILSF_FORMAT: if (G711_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; break; case ACM_FORMATDETAILSF_INDEX: afd->pwfx->wFormatTag = afd->dwFormatTag; - switch (afd->dwFormatTag) + switch (afd->dwFormatTag) { case WAVE_FORMAT_PCM: if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE; @@ -763,7 +763,7 @@ static LRESULT G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) afd->pwfx->nSamplesPerSec = ALaw_Formats[afd->dwFormatIndex].rate; afd->pwfx->wBitsPerSample = ALaw_Formats[afd->dwFormatIndex].nBits; afd->pwfx->nBlockAlign = ALaw_Formats[afd->dwFormatIndex].nChannels; - afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nChannels; + afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nChannels; afd->pwfx->cbSize = 0; break; case WAVE_FORMAT_MULAW: @@ -772,7 +772,7 @@ static LRESULT G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) afd->pwfx->nSamplesPerSec = ULaw_Formats[afd->dwFormatIndex].rate; afd->pwfx->wBitsPerSample = ULaw_Formats[afd->dwFormatIndex].nBits; afd->pwfx->nBlockAlign = ULaw_Formats[afd->dwFormatIndex].nChannels; - afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nChannels; + afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nChannels; afd->pwfx->cbSize = 0; break; default: @@ -782,11 +782,11 @@ static LRESULT G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) break; default: WARN("Unsupported query %08lx\n", dwQuery); - return MMSYSERR_NOTSUPPORTED; + return MMSYSERR_NOTSUPPORTED; } afd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC; afd->szFormat[0] = 0; /* let MSACM format this for us... */ - + return MMSYSERR_NOERROR; } @@ -808,14 +808,14 @@ static LRESULT G711_FormatSuggest(PACMDRVFORMATSUGGEST adfs) if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC)) adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec; - if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE)) + if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE)) { - if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) + if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) adfs->pwfxDst->wBitsPerSample = 8; else adfs->pwfxDst->wBitsPerSample = 16; } - if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)) + if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)) { switch (adfs->pwfxSrc->wFormatTag) { @@ -867,25 +867,25 @@ static LRESULT G711_StreamOpen(PACMDRVSTREAMINSTANCE adsi) AcmG711Data* aad; assert(!(adsi->fdwOpen & ACM_STREAMOPENF_ASYNC)); - + if (G711_GetFormatIndex(adsi->pwfxSrc) == 0xFFFFFFFF || G711_GetFormatIndex(adsi->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; - + aad = HeapAlloc(GetProcessHeap(), 0, sizeof(AcmG711Data)); if (aad == 0) return MMSYSERR_NOMEM; - + adsi->dwDriver = (DWORD)aad; - + if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { goto theEnd; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { - /* resampling or mono <=> stereo not available + /* resampling or mono <=> stereo not available * G711 algo only define 16 bit per sample output */ if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || @@ -898,21 +898,21 @@ static LRESULT G711_StreamOpen(PACMDRVSTREAMINSTANCE adsi) aad->convert = cvtXXalaw16K; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW) { if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels || adsi->pwfxSrc->wBitsPerSample != 16) goto theEnd; - + /* g711 coding... */ if (adsi->pwfxSrc->wBitsPerSample == 16) aad->convert = cvtXX16alawK; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { - /* resampling or mono <=> stereo not available + /* resampling or mono <=> stereo not available * G711 algo only define 16 bit per sample output */ if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || @@ -925,34 +925,34 @@ static LRESULT G711_StreamOpen(PACMDRVSTREAMINSTANCE adsi) aad->convert = cvtXXulaw16K; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW) { if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels || adsi->pwfxSrc->wBitsPerSample != 16) goto theEnd; - + /* g711 coding... */ if (adsi->pwfxSrc->wBitsPerSample == 16) aad->convert = cvtXX16ulawK; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW) { if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels) goto theEnd; - + /* MU-Law => A-Law... */ aad->convert = cvtXXulawalawK; } else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MULAW) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_MULAW) { if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec || adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels) goto theEnd; - + /* A-Law => MU-Law... */ aad->convert = cvtXXalawulawK; } @@ -961,7 +961,7 @@ static LRESULT G711_StreamOpen(PACMDRVSTREAMINSTANCE adsi) G711_Reset(adsi, aad); return MMSYSERR_NOERROR; - + theEnd: HeapFree(GetProcessHeap(), 0, aad); adsi->dwDriver = 0L; @@ -995,7 +995,7 @@ static inline DWORD G711_round(DWORD a, DWORD b, DWORD c) */ static LRESULT G711_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss) { - switch (adss->fdwSize) + switch (adss->fdwSize) { case ACM_STREAMSIZEF_DESTINATION: /* cbDstLength => cbSrcLength */ @@ -1007,7 +1007,7 @@ static LRESULT G711_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ads } else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW || adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { adss->cbSrcLength = adss->cbDstLength * 2; } @@ -1018,7 +1018,7 @@ static LRESULT G711_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ads { adss->cbSrcLength = adss->cbDstLength; } - else + else { return MMSYSERR_NOTSUPPORTED; } @@ -1033,7 +1033,7 @@ static LRESULT G711_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ads } else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW || adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW) && - adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) + adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM) { adss->cbDstLength = adss->cbSrcLength / 2; } @@ -1044,14 +1044,14 @@ static LRESULT G711_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ads { adss->cbDstLength = adss->cbSrcLength; } - else + else { return MMSYSERR_NOTSUPPORTED; } break; default: WARN("Unsupported query %08lx\n", adss->fdwSize); - return MMSYSERR_NOTSUPPORTED; + return MMSYSERR_NOTSUPPORTED; } FIXME("\n"); return MMSYSERR_NOERROR; @@ -1066,11 +1066,11 @@ static LRESULT G711_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADE AcmG711Data* aad = (AcmG711Data*)adsi->dwDriver; DWORD nsrc = adsh->cbSrcLength; DWORD ndst = adsh->cbDstLength; - - if (adsh->fdwConvert & + + if (adsh->fdwConvert & ~(ACM_STREAMCONVERTF_BLOCKALIGN| ACM_STREAMCONVERTF_END| - ACM_STREAMCONVERTF_START)) + ACM_STREAMCONVERTF_START)) { FIXME("Unsupported fdwConvert (%08lx), ignoring it\n", adsh->fdwConvert); } @@ -1079,7 +1079,7 @@ static LRESULT G711_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADE * ACM_STREAMCONVERTF_END * no pending data, so do nothing for this flag */ - if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START)) + if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START)) { G711_Reset(adsi, aad); } @@ -1087,60 +1087,60 @@ static LRESULT G711_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADE aad->convert(adsi, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst); adsh->cbSrcLengthUsed = nsrc; adsh->cbDstLengthUsed = ndst; - + return MMSYSERR_NOERROR; } /************************************************************************** * G711_DriverProc [exported] */ -LRESULT CALLBACK G711_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, +LRESULT CALLBACK G711_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2) { - TRACE("(%08lx %08lx %04x %08lx %08lx);\n", + TRACE("(%08lx %08lx %04x %08lx %08lx);\n", dwDevID, (DWORD)hDriv, wMsg, dwParam1, dwParam2); - - switch (wMsg) + + switch (wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; case DRV_OPEN: return G711_drvOpen((LPSTR)dwParam1); case DRV_CLOSE: return G711_drvClose(dwDevID); - case DRV_ENABLE: return 1; + case DRV_ENABLE: return 1; case DRV_DISABLE: return 1; case DRV_QUERYCONFIGURE: return 1; case DRV_CONFIGURE: MessageBoxA(0, "MS G711 (a-Law & mu-Law) filter !", "Wine Driver", MB_OK); return 1; case DRV_INSTALL: return DRVCNF_RESTART; case DRV_REMOVE: return DRVCNF_RESTART; - + case ACMDM_DRIVER_NOTIFY: /* no caching from other ACM drivers is done so far */ return MMSYSERR_NOERROR; - + case ACMDM_DRIVER_DETAILS: return G711_DriverDetails((PACMDRIVERDETAILSW)dwParam1); - + case ACMDM_FORMATTAG_DETAILS: return G711_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2); - + case ACMDM_FORMAT_DETAILS: return G711_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2); - + case ACMDM_FORMAT_SUGGEST: return G711_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1); - + case ACMDM_STREAM_OPEN: return G711_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1); - + case ACMDM_STREAM_CLOSE: return G711_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1); - + case ACMDM_STREAM_SIZE: return G711_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2); - + case ACMDM_STREAM_CONVERT: return G711_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2); - + case ACMDM_HARDWARE_WAVE_CAPS_INPUT: case ACMDM_HARDWARE_WAVE_CAPS_OUTPUT: /* this converter is not a hardware driver */ @@ -1154,7 +1154,7 @@ LRESULT CALLBACK G711_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, case ACMDM_STREAM_UNPREPARE: /* nothing special to do here... so don't do anything */ return MMSYSERR_NOERROR; - + default: return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); } diff --git a/dlls/msacm/pcmconverter.c b/dlls/msacm/pcmconverter.c index f368538f8b2..891995f90f4 100644 --- a/dlls/msacm/pcmconverter.c +++ b/dlls/msacm/pcmconverter.c @@ -20,7 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * FIXME / TODO list - * + most of the computation should be done in fixed point arithmetic + * + most of the computation should be done in fixed point arithmetic * instead of floating point (16 bits for integral part, and 16 bits * for fractional part for example) * + implement PCM_FormatSuggest function @@ -76,13 +76,13 @@ typedef struct tagAcmPcmData { /* conversion routine, depending if rate conversion is required */ union { void (*cvtKeepRate)(const unsigned char*, int, unsigned char*); - void (*cvtChangeRate)(struct tagAcmPcmData*, const unsigned char*, + void (*cvtChangeRate)(struct tagAcmPcmData*, const unsigned char*, LPDWORD, unsigned char*, LPDWORD); } cvt; /* the following fields are used only with rate conversion) */ DWORD srcPos; /* position in source stream */ double dstPos; /* position in destination stream */ - double dstIncr; /* value to increment dst stream when src stream + double dstIncr; /* value to increment dst stream when src stream is incremented by 1 */ /* last source stream value read */ union { @@ -111,7 +111,7 @@ static struct { static DWORD PCM_GetFormatIndex(LPWAVEFORMATEX wfx) { int i; - + for (i = 0; i < NUM_PCM_FORMATS; i++) { if (wfx->nChannels == PCM_Formats[i].nChannels && wfx->nSamplesPerSec == PCM_Formats[i].rate && @@ -132,7 +132,7 @@ static DWORD PCM_GetFormatIndex(LPWAVEFORMATEX wfx) * mono => stereo: copy the same sample on Left & Right channels * stereo =) mono: use the average value of samples from Left & Right channels * resampling; we lookup for each destination sample the two source adjacent samples - * were src <= dst < src+1 (dst is increased by a fractional value which is + * were src <= dst < src+1 (dst is increased by a fractional value which is * equivalent to the increment by one on src); then we use a linear * interpolation between src and src+1 */ @@ -142,7 +142,7 @@ static DWORD PCM_GetFormatIndex(LPWAVEFORMATEX wfx) * * Converts a 8 bit sample to a 16 bit one */ -static inline short C816(unsigned char b) +static inline short C816(unsigned char b) { return (short)(b ^ 0x80) * 256; } @@ -152,7 +152,7 @@ static inline short C816(unsigned char b) * * Converts a 16 bit sample to a 8 bit one (data loss !!) */ -static inline unsigned char C168(short s) +static inline unsigned char C168(short s) { return HIBYTE(s) ^ (unsigned char)0x80; } @@ -181,7 +181,7 @@ static inline void W16(unsigned char* dst, short s) /*********************************************************************** * M16 * - * Convert the (l,r) 16 bit stereo sample into a 16 bit mono + * Convert the (l,r) 16 bit stereo sample into a 16 bit mono * (takes the mid-point of the two values) */ static inline short M16(short l, short r) @@ -192,7 +192,7 @@ static inline short M16(short l, short r) /*********************************************************************** * M8 * - * Convert the (l,r) 8 bit stereo sample into a 8 bit mono + * Convert the (l,r) 8 bit stereo sample into a 8 bit mono * (takes the mid-point of the two values) */ static inline unsigned char M8(unsigned char a, unsigned char b) @@ -242,7 +242,7 @@ static void cvtMS88K(const unsigned char* src, int ns, unsigned char* dst) static void cvtMS816K(const unsigned char* src, int ns, unsigned char* dst) { short v; - + while (ns--) { v = C816(*src++); W16(dst, v); dst += 2; @@ -253,7 +253,7 @@ static void cvtMS816K(const unsigned char* src, int ns, unsigned char* dst) static void cvtMS168K(const unsigned char* src, int ns, unsigned char* dst) { unsigned char v; - + while (ns--) { v = C168(R16(src)); src += 2; *dst++ = v; @@ -283,7 +283,7 @@ static void cvtSM88K(const unsigned char* src, int ns, unsigned char* dst) static void cvtSM816K(const unsigned char* src, int ns, unsigned char* dst) { short v; - + while (ns--) { v = M16(C816(src[0]), C816(src[1])); src += 2; @@ -356,7 +356,7 @@ static inline double I(double v1, double v2, double r) return (1.0 - r) * v1 + r * v2; } -static void cvtSS88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtSS88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -385,7 +385,7 @@ static void cvtSS88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, * is the number of bits of output channel (8 or 16) * */ -static void cvtSM88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtSM88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -405,7 +405,7 @@ static void cvtSM88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtMS88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtMS88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -425,7 +425,7 @@ static void cvtMS88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtMM88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtMM88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -444,11 +444,11 @@ static void cvtMM88C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtSS816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtSS816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; - + while (*nsrc != 0 && *ndst != 0) { while ((r = (double)apd->srcPos - apd->dstPos) <= 0) { if (*nsrc == 0) return; @@ -465,7 +465,7 @@ static void cvtSS816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtSM816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtSM816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -487,7 +487,7 @@ static void cvtSM816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtMS816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtMS816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -509,7 +509,7 @@ static void cvtMS816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtMM816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtMM816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -529,7 +529,7 @@ static void cvtMM816C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtSS168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtSS168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -550,7 +550,7 @@ static void cvtSS168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtSM168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtSM168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -564,7 +564,7 @@ static void cvtSM168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, (*nsrc)--; } /* now do the interpolation */ - *dst++ = C168(I(M16(apd->last[0].s, apd->last[1].s), + *dst++ = C168(I(M16(apd->last[0].s, apd->last[1].s), M16(R16(src), R16(src + 2)), r)); apd->dstPos += apd->dstIncr; (*ndst)--; @@ -572,7 +572,7 @@ static void cvtSM168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } -static void cvtMS168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtMS168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -592,7 +592,7 @@ static void cvtMS168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } -static void cvtMM168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtMM168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -611,7 +611,7 @@ static void cvtMM168C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtSS1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtSS1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -632,7 +632,7 @@ static void cvtSS1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtSM1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtSM1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -654,7 +654,7 @@ static void cvtSM1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtMS1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtMS1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -676,7 +676,7 @@ static void cvtMS1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void cvtMM1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, +static void cvtMM1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) { double r; @@ -695,8 +695,8 @@ static void cvtMM1616C(AcmPcmData* apd, const unsigned char* src, LPDWORD nsrc, } } -static void (*PCM_ConvertChangeRate[16])(AcmPcmData* apd, - const unsigned char* src, LPDWORD nsrc, +static void (*PCM_ConvertChangeRate[16])(AcmPcmData* apd, + const unsigned char* src, LPDWORD nsrc, unsigned char* dst, LPDWORD ndst) = { cvtSS88C, cvtSM88C, cvtMS88C, cvtMM88C, cvtSS816C, cvtSM816C, cvtMS816C, cvtMM816C, @@ -729,7 +729,7 @@ static LRESULT PCM_DriverDetails(PACMDRIVERDETAILSW add) MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1, add->szLicensing, sizeof(add->szLicensing)/sizeof(WCHAR) ); add->szFeatures[0] = 0; - + return MMSYSERR_NOERROR; } @@ -743,11 +743,11 @@ static LRESULT PCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) case ACM_FORMATTAGDETAILSF_INDEX: if (aftd->dwFormatTagIndex != 0) return ACMERR_NOTPOSSIBLE; break; - case ACM_FORMATTAGDETAILSF_FORMATTAG: + case ACM_FORMATTAGDETAILSF_FORMATTAG: if (aftd->dwFormatTag != WAVE_FORMAT_PCM) return ACMERR_NOTPOSSIBLE; break; case ACM_FORMATTAGDETAILSF_LARGESTSIZE: - if (aftd->dwFormatTag != WAVE_FORMAT_UNKNOWN && + if (aftd->dwFormatTag != WAVE_FORMAT_UNKNOWN && aftd->dwFormatTag != WAVE_FORMAT_PCM) return ACMERR_NOTPOSSIBLE; break; @@ -755,14 +755,14 @@ static LRESULT PCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) WARN("Unsupported query %08lx\n", dwQuery); return MMSYSERR_NOTSUPPORTED; } - + aftd->dwFormatTagIndex = 0; aftd->dwFormatTag = WAVE_FORMAT_PCM; aftd->cbFormatSize = sizeof(PCMWAVEFORMAT); aftd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CONVERTER; aftd->cStandardFormats = NUM_PCM_FORMATS; aftd->szFormatTag[0] = 0; - + return MMSYSERR_NOERROR; } @@ -783,18 +783,18 @@ static LRESULT PCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate; afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits; /* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not accessible - * afd->pwfx->cbSize = 0; + * afd->pwfx->cbSize = 0; */ - afd->pwfx->nBlockAlign = + afd->pwfx->nBlockAlign = (afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8; - afd->pwfx->nAvgBytesPerSec = + afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign; break; default: WARN("Unsupported query %08lx\n", dwQuery); - return MMSYSERR_NOTSUPPORTED; + return MMSYSERR_NOTSUPPORTED; } - + afd->dwFormatTag = WAVE_FORMAT_PCM; afd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CONVERTER; afd->szFormat[0] = 0; /* let MSACM format this for us... */ @@ -866,7 +866,7 @@ static LRESULT PCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) int idx = 0; assert(!(adsi->fdwOpen & ACM_STREAMOPENF_ASYNC)); - + if (PCM_GetFormatIndex(adsi->pwfxSrc) == 0xFFFFFFFF || PCM_GetFormatIndex(adsi->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; @@ -876,7 +876,7 @@ static LRESULT PCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi) adsi->dwDriver = (DWORD)apd; adsi->fdwDriver = 0; - + if (adsi->pwfxSrc->wBitsPerSample == 16) idx += 8; if (adsi->pwfxDst->wBitsPerSample == 16) idx += 4; if (adsi->pwfxSrc->nChannels == 1) idx += 2; @@ -929,18 +929,18 @@ static LRESULT PCM_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss case ACM_STREAMSIZEF_DESTINATION: /* cbDstLength => cbSrcLength */ adss->cbSrcLength = PCM_round(adss->cbDstLength & dstMask, - adsi->pwfxSrc->nAvgBytesPerSec, + adsi->pwfxSrc->nAvgBytesPerSec, adsi->pwfxDst->nAvgBytesPerSec) & srcMask; break; case ACM_STREAMSIZEF_SOURCE: /* cbSrcLength => cbDstLength */ adss->cbDstLength = PCM_round(adss->cbSrcLength & srcMask, - adsi->pwfxDst->nAvgBytesPerSec, + adsi->pwfxDst->nAvgBytesPerSec, adsi->pwfxSrc->nAvgBytesPerSec) & dstMask; break; default: WARN("Unsupported query %08lx\n", adss->fdwSize); - return MMSYSERR_NOTSUPPORTED; + return MMSYSERR_NOTSUPPORTED; } return MMSYSERR_NOERROR; } @@ -955,7 +955,7 @@ static LRESULT PCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER DWORD nsrc = NUM_OF(adsh->cbSrcLength, adsi->pwfxSrc->nBlockAlign); DWORD ndst = NUM_OF(adsh->cbDstLength, adsi->pwfxDst->nBlockAlign); - if (adsh->fdwConvert & + if (adsh->fdwConvert & ~(ACM_STREAMCONVERTF_BLOCKALIGN| ACM_STREAMCONVERTF_END| ACM_STREAMCONVERTF_START)) { @@ -966,7 +966,7 @@ static LRESULT PCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER * ACM_STREAMCONVERTF_END * no pending data, so do nothing for this flag */ - if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START) && + if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START) && (adsi->fdwDriver & PCM_RESAMPLE)) { PCM_Reset(apd, adsi->pwfxSrc->wBitsPerSample); } @@ -995,52 +995,52 @@ static LRESULT PCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER /************************************************************************** * DriverProc (MSACM32.@) */ -LRESULT CALLBACK PCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, +LRESULT CALLBACK PCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2) { - TRACE("(%08lx %08lx %u %08lx %08lx);\n", + TRACE("(%08lx %08lx %u %08lx %08lx);\n", dwDevID, (DWORD)hDriv, wMsg, dwParam1, dwParam2); - + switch (wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; case DRV_OPEN: return PCM_drvOpen((LPSTR)dwParam1, (PACMDRVOPENDESCW)dwParam2); case DRV_CLOSE: return PCM_drvClose(dwDevID); - case DRV_ENABLE: return 1; + case DRV_ENABLE: return 1; case DRV_DISABLE: return 1; case DRV_QUERYCONFIGURE: return 1; case DRV_CONFIGURE: MessageBoxA(0, "MSACM PCM filter !", "Wine Driver", MB_OK); return 1; case DRV_INSTALL: return DRVCNF_RESTART; case DRV_REMOVE: return DRVCNF_RESTART; - + case ACMDM_DRIVER_NOTIFY: /* no caching from other ACM drivers is done so far */ return MMSYSERR_NOERROR; - + case ACMDM_DRIVER_DETAILS: return PCM_DriverDetails((PACMDRIVERDETAILSW)dwParam1); - + case ACMDM_FORMATTAG_DETAILS: return PCM_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2); - + case ACMDM_FORMAT_DETAILS: return PCM_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2); - + case ACMDM_FORMAT_SUGGEST: return PCM_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1); - + case ACMDM_STREAM_OPEN: return PCM_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1); - + case ACMDM_STREAM_CLOSE: return PCM_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1); - + case ACMDM_STREAM_SIZE: return PCM_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2); - + case ACMDM_STREAM_CONVERT: return PCM_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2); - + case ACMDM_HARDWARE_WAVE_CAPS_INPUT: case ACMDM_HARDWARE_WAVE_CAPS_OUTPUT: /* this converter is not a hardware driver */ @@ -1053,7 +1053,7 @@ LRESULT CALLBACK PCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, case ACMDM_STREAM_UNPREPARE: /* nothing special to do here... so don't do anything */ return MMSYSERR_NOTSUPPORTED; - + default: return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); } diff --git a/dlls/msacm/stream.c b/dlls/msacm/stream.c index 62d4d2c7b27..9597025481b 100644 --- a/dlls/msacm/stream.c +++ b/dlls/msacm/stream.c @@ -39,7 +39,7 @@ #include "wineacm.h" WINE_DEFAULT_DEBUG_CHANNEL(msacm); - + static PWINE_ACMSTREAM ACM_GetStream(HACMSTREAM has) { return (PWINE_ACMSTREAM)has; @@ -52,16 +52,16 @@ MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose) { PWINE_ACMSTREAM was; MMRESULT ret; - + TRACE("(0x%08x, %ld)\n", has, fdwClose); - + if ((was = ACM_GetStream(has)) == NULL) { return MMSYSERR_INVALHANDLE; } ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (DWORD)&was->drvInst, 0); if (ret == MMSYSERR_NOERROR) { if (was->hAcmDriver) - acmDriverClose(was->hAcmDriver, 0L); + acmDriverClose(was->hAcmDriver, 0L); HeapFree(MSACM_hHeap, 0, was); } TRACE("=> (%d)\n", ret); @@ -71,7 +71,7 @@ MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose) /*********************************************************************** * acmStreamConvert (MSACM32.@) */ -MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwConvert) { PWINE_ACMSTREAM was; @@ -79,7 +79,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, PACMDRVSTREAMHEADER padsh; TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwConvert); - + if ((was = ACM_GetStream(has)) == NULL) return MMSYSERR_INVALHANDLE; if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) @@ -100,7 +100,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->pbPreparedDst != padsh->pbDst || padsh->cbPreparedDstLength < padsh->cbDstLength) { return MMSYSERR_INVALPARAM; - } + } padsh->fdwConvert = fdwConvert; @@ -115,7 +115,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, /*********************************************************************** * acmStreamMessage (MSACM32.@) */ -MMRESULT WINAPI acmStreamMessage(HACMSTREAM has, UINT uMsg, LPARAM lParam1, +MMRESULT WINAPI acmStreamMessage(HACMSTREAM has, UINT uMsg, LPARAM lParam1, LPARAM lParam2) { FIXME("(0x%08x, %u, %ld, %ld): stub\n", has, uMsg, lParam1, lParam2); @@ -135,16 +135,16 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw MMRESULT ret; int wfxSrcSize; int wfxDstSize; - + TRACE("(%p, 0x%08x, %p, %p, %p, %ld, %ld, %ld)\n", phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen); - TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", - pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec, + TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", + pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec, pwfxSrc->nBlockAlign, pwfxSrc->wBitsPerSample, pwfxSrc->cbSize); - TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", - pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec, + TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", + pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec, pwfxDst->nBlockAlign, pwfxDst->wBitsPerSample, pwfxDst->cbSize); if ((fdwOpen & ACM_STREAMOPENF_QUERY) && phas) return MMSYSERR_INVALPARAM; @@ -154,11 +154,11 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw if (pwfxSrc->wFormatTag != WAVE_FORMAT_PCM) wfxSrcSize += pwfxSrc->cbSize; if (pwfxDst->wFormatTag != WAVE_FORMAT_PCM) wfxDstSize += pwfxDst->cbSize; - was = HeapAlloc(MSACM_hHeap, 0, sizeof(*was) + wfxSrcSize + wfxDstSize + + was = HeapAlloc(MSACM_hHeap, 0, sizeof(*was) + wfxSrcSize + wfxDstSize + ((pwfltr) ? sizeof(WAVEFILTER) : 0)); if (was == NULL) return MMSYSERR_NOMEM; - + was->drvInst.cbStruct = sizeof(was->drvInst); was->drvInst.pwfxSrc = (PWAVEFORMATEX)((LPSTR)was + sizeof(*was)); memcpy(was->drvInst.pwfxSrc, pwfxSrc, wfxSrcSize); @@ -170,20 +170,20 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw } else { was->drvInst.pwfltr = NULL; } - was->drvInst.dwCallback = dwCallback; + was->drvInst.dwCallback = dwCallback; was->drvInst.dwInstance = dwInstance; was->drvInst.fdwOpen = fdwOpen; - was->drvInst.fdwDriver = 0L; - was->drvInst.dwDriver = 0L; + was->drvInst.fdwDriver = 0L; + was->drvInst.dwDriver = 0L; /* real value will be stored once ACMDM_STREAM_OPEN succeeds */ was->drvInst.has = 0L; - + if (had) { if (!(wad = MSACM_GetDriver(had))) { ret = MMSYSERR_INVALPARAM; goto errCleanUp; } - + was->obj.dwType = WINE_ACMOBJ_STREAM; was->obj.pACMDriverID = wad->obj.pACMDriverID; was->pDrv = wad; @@ -194,10 +194,10 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw goto errCleanUp; } else { PWINE_ACMDRIVERID wadi; - + ret = ACMERR_NOTPOSSIBLE; for (wadi = MSACM_pFirstACMDriverID; wadi; wadi = wadi->pNextACMDriverID) { - if ((wadi->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) || + if ((wadi->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) || !MSACM_FindFormatTagInCache(wadi, pwfxSrc->wFormatTag, NULL) || !MSACM_FindFormatTagInCache(wadi, pwfxDst->wFormatTag, NULL)) continue; @@ -209,7 +209,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw was->obj.pACMDriverID = wad->obj.pACMDriverID; was->pDrv = wad; was->hAcmDriver = had; - + ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L); TRACE("%s => %08x\n", wadi->pszDriverAlias, ret); if (ret == MMSYSERR_NOERROR) { @@ -235,7 +235,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw TRACE("=> (%d)\n", ret); return ret; } -errCleanUp: +errCleanUp: if (phas) *phas = (HACMSTREAM)0; HeapFree(MSACM_hHeap, 0, was); @@ -247,7 +247,7 @@ errCleanUp: /*********************************************************************** * acmStreamPrepareHeader (MSACM32.@) */ -MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwPrepare) { PWINE_ACMSTREAM was; @@ -255,7 +255,7 @@ MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, PACMDRVSTREAMHEADER padsh; TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwPrepare); - + if ((was = ACM_GetStream(has)) == NULL) return MMSYSERR_INVALHANDLE; if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) @@ -330,15 +330,15 @@ MMRESULT WINAPI acmStreamReset(HACMSTREAM has, DWORD fdwReset) /*********************************************************************** * acmStreamSize (MSACM32.@) */ -MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, +MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize) { PWINE_ACMSTREAM was; ACMDRVSTREAMSIZE adss; MMRESULT ret; - + TRACE("(0x%08x, %ld, %p, %ld)\n", has, cbInput, pdwOutputBytes, fdwSize); - + if ((was = ACM_GetStream(has)) == NULL) { return MMSYSERR_INVALHANDLE; } @@ -347,7 +347,7 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, } *pdwOutputBytes = 0L; - + switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { case ACM_STREAMSIZEF_DESTINATION: adss.cbDstLength = cbInput; @@ -357,13 +357,13 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, adss.cbSrcLength = cbInput; adss.cbDstLength = 0; break; - default: + default: return MMSYSERR_INVALFLAG; } - + adss.cbStruct = sizeof(adss); adss.fdwSize = fdwSize; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, + ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, (DWORD)&was->drvInst, (DWORD)&adss); if (ret == MMSYSERR_NOERROR) { switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { @@ -382,7 +382,7 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, /*********************************************************************** * acmStreamUnprepareHeader (MSACM32.@) */ -MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, +MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwUnprepare) { PWINE_ACMSTREAM was; @@ -390,7 +390,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, PACMDRVSTREAMHEADER padsh; TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwUnprepare); - + if ((was = ACM_GetStream(has)) == NULL) return MMSYSERR_INVALHANDLE; if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) @@ -411,7 +411,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, padsh->pbPreparedDst != padsh->pbDst || padsh->cbPreparedDstLength < padsh->cbDstLength) { return MMSYSERR_INVALPARAM; - } + } padsh->fdwConvert = fdwUnprepare; diff --git a/dlls/msacm/wineacm.h b/dlls/msacm/wineacm.h index 6b584348cc6..b9b4f72d5a4 100644 --- a/dlls/msacm/wineacm.h +++ b/dlls/msacm/wineacm.h @@ -81,7 +81,7 @@ typedef struct _ACMFILTERCHOOSE16 DWORD fdwEnum; LPWAVEFILTER pwfltrEnum; - + HINSTANCE16 hInstance; LPCSTR pszTemplateName; LPARAM lCustData; @@ -114,22 +114,22 @@ typedef struct _ACMFORMATCHOOSE16 { DWORD cbStruct; DWORD fdwStyle; - + HWND16 hwndOwner; LPWAVEFORMATEX pwfx; DWORD cbwfx; LPCSTR pszTitle; - + CHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]; - CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; + CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; LPSTR pszName; DWORD cchName; DWORD fdwEnum; LPWAVEFORMATEX pwfxEnum; - + HINSTANCE16 hInstance; LPCSTR pszTemplateName; LPARAM lCustData; @@ -235,7 +235,7 @@ MMRESULT16 WINAPI acmFormatEnum16( ACMFORMATENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum ); MMRESULT16 WINAPI acmFormatSuggest16( - HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc, + HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest ); MMRESULT16 WINAPI acmFilterTagDetails16( @@ -265,7 +265,7 @@ MMRESULT16 WINAPI acmStreamClose16( HACMSTREAM16 has, DWORD fdwClose ); MMRESULT16 WINAPI acmStreamSize16( - HACMSTREAM16 has, DWORD cbInput, + HACMSTREAM16 has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize ); MMRESULT16 WINAPI acmStreamConvert16( @@ -353,7 +353,7 @@ extern BOOL MSACM_FindFormatTagInCache(WINE_ACMDRIVERID*, DWORD, LPDWORD); extern HINSTANCE MSACM_hInstance32; /* From pcmcnvtr.c */ -LRESULT CALLBACK PCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, +LRESULT CALLBACK PCM_DriverProc(DWORD dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2); /* Dialog box templates */ diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c index e3933411836..9f9c731422d 100644 --- a/dlls/msvcrt/except.c +++ b/dlls/msvcrt/except.c @@ -259,8 +259,8 @@ int _abnormal_termination(void) typedef void (*MSVCRT_unwind_function)(const void*); /* - * The signatures of the setjmp/longjmp functions do not match that - * declared in the setjmp header so they don't follow the regular naming + * The signatures of the setjmp/longjmp functions do not match that + * declared in the setjmp header so they don't follow the regular naming * convention to avoid conflicts. */ @@ -382,7 +382,7 @@ DWORD __CxxFrameHandler(PEXCEPTION_RECORD rec, struct __EXCEPTION_FRAME* frame, { FIXME("(%p,%p,%p,%p):stub?\n",rec,frame,context,dispatch); - /* Copied from MSVCRT_nested_handler, I hope this is more + /* Copied from MSVCRT_nested_handler, I hope this is more * or less the right thing to do */ if (rec->ExceptionFlags & 0x6) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 0ce4124fbcb..ab9a7c0b9b8 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -223,7 +223,7 @@ static void msvcrt_alloc_buffer(MSVCRT_FILE* file) if(file->_base) { file->_bufsiz = MSVCRT_BUFSIZ; file->_flag |= MSVCRT__IOMYBUF; - } else { + } else { file->_base = (unsigned char *)(&file->_charbuf); /* put here 2 ??? */ file->_bufsiz = sizeof(file->_charbuf); @@ -359,11 +359,11 @@ int _close(int fd) if (hand == INVALID_HANDLE_VALUE) return -1; /* flush stdio buffers */ - if(MSVCRT_files[fd]) { - if(MSVCRT_files[fd]->_flag & MSVCRT__IOWRT) + if(MSVCRT_files[fd]) { + if(MSVCRT_files[fd]->_flag & MSVCRT__IOWRT) MSVCRT_fflush(MSVCRT_files[fd]); - if(MSVCRT_files[fd]->_flag & MSVCRT__IOMYBUF) + if(MSVCRT_files[fd]->_flag & MSVCRT__IOMYBUF) MSVCRT_free(MSVCRT_files[fd]->_base); } @@ -1105,7 +1105,7 @@ int _read(int fd, void *buf, unsigned int count) */ int _getw(MSVCRT_FILE* file) { - int i; + int i; if (_read(file->_file, &i, sizeof(int)) != 1) return MSVCRT_EOF; return i; @@ -1142,9 +1142,9 @@ int _stat(const char* path, struct _stat * buf) memset(buf,0,sizeof(struct _stat)); - /* FIXME: rdev isnt drive num,despite what the docs say-what is it? - Bon 011120: This FIXME seems incorrect - Also a letter as first char isn't enough to be classify + /* FIXME: rdev isnt drive num,despite what the docs say-what is it? + Bon 011120: This FIXME seems incorrect + Also a letter as first char isn't enough to be classify as drive letter */ if (isalpha(*path)&& (*(path+1)==':')) @@ -1411,10 +1411,10 @@ int MSVCRT_ferror(MSVCRT_FILE* file) */ int MSVCRT_fflush(MSVCRT_FILE* file) { - if(!file) { + if(!file) { _flushall(); return 0; - } else { + } else { int res=msvcrt_flush_buffer(file); return res; } @@ -1425,10 +1425,10 @@ int MSVCRT_fflush(MSVCRT_FILE* file) */ int MSVCRT_fgetc(MSVCRT_FILE* file) { - if (file->_cnt>0) { + if (file->_cnt>0) { file->_cnt--; return *(unsigned char *)file->_ptr++; - } else { + } else { return _filbuf(file); } } @@ -1446,29 +1446,29 @@ int _fgetchar(void) */ int _filbuf(MSVCRT_FILE* file) { - + /* Allocate buffer if needed */ - if(file->_bufsiz == 0 && !(file->_flag & MSVCRT__IONBF) ) { + if(file->_bufsiz == 0 && !(file->_flag & MSVCRT__IONBF) ) { msvcrt_alloc_buffer(file); } - if(!(file->_flag & MSVCRT__IOREAD)) { - if(file->_flag & MSVCRT__IORW) { + if(!(file->_flag & MSVCRT__IOREAD)) { + if(file->_flag & MSVCRT__IORW) { file->_flag |= MSVCRT__IOREAD; - } else { + } else { return MSVCRT_EOF; } } - if(file->_flag & MSVCRT__IONBF) { + if(file->_flag & MSVCRT__IONBF) { unsigned char c; - if (_read(file->_file,&c,1) != 1) { + if (_read(file->_file,&c,1) != 1) { file->_flag |= MSVCRT__IOEOF; return MSVCRT_EOF; } return c; - } else { + } else { file->_cnt = _read(file->_file, file->_base, file->_bufsiz); if(file->_cnt<0) file->_cnt = 0; - if(!file->_cnt) { + if(!file->_cnt) { file->_flag |= MSVCRT__IOEOF; return MSVCRT_EOF; } @@ -1523,7 +1523,7 @@ char *MSVCRT_fgets(char *s, int size, MSVCRT_FILE* file) */ MSVCRT_wint_t MSVCRT_fgetwc(MSVCRT_FILE* file) { - WCHAR wc; + WCHAR wc; if (_read(file->_file, &wc, sizeof(wc)) != sizeof(wc)) return MSVCRT_WEOF; return wc; @@ -1714,11 +1714,11 @@ MSVCRT_FILE* _wfsopen(const WCHAR *path, const WCHAR *mode, int share) */ int MSVCRT_fputc(int c, MSVCRT_FILE* file) { - if(file->_cnt>0) { + if(file->_cnt>0) { *file->_ptr++=c; file->_cnt--; return c; - } else { + } else { return _flsbuf(c, file); } } @@ -1732,17 +1732,17 @@ int _flsbuf(int c, MSVCRT_FILE* file) if(file->_bufsiz == 0 && !(file->_flag & MSVCRT__IONBF)) { msvcrt_alloc_buffer(file); } - if(!(file->_flag & MSVCRT__IOWRT)) { - if(file->_flag & MSVCRT__IORW) { + if(!(file->_flag & MSVCRT__IOWRT)) { + if(file->_flag & MSVCRT__IORW) { file->_flag |= MSVCRT__IOWRT; - } else { + } else { return MSVCRT_EOF; } } if(file->_bufsiz) { int res=msvcrt_flush_buffer(file); return res?res : MSVCRT_fputc(c, file); - } else { + } else { unsigned char cc=c; return _write(file->_file, &cc, 1) == 1? c : MSVCRT_EOF; } @@ -1764,7 +1764,7 @@ MSVCRT_size_t MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nmemb, M MSVCRT_size_t read=0; int pread=0; /* first buffered data */ - if(file->_cnt>0) { + if(file->_cnt>0) { int pcnt= (rcnt>file->_cnt)? file->_cnt:rcnt; memcpy(ptr, file->_ptr, pcnt); file->_cnt -= pcnt; @@ -1772,10 +1772,10 @@ MSVCRT_size_t MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nmemb, M read += pcnt ; rcnt -= pcnt ; ptr += pcnt; - } else if(!(file->_flag & MSVCRT__IOREAD )) { - if(file->_flag & MSVCRT__IORW) { + } else if(!(file->_flag & MSVCRT__IOREAD )) { + if(file->_flag & MSVCRT__IORW) { file->_flag |= MSVCRT__IOREAD; - } else + } else return 0; } if(rcnt) pread = _read(file->_file,ptr, rcnt); @@ -1805,7 +1805,7 @@ MSVCRT_FILE* MSVCRT_freopen(const char *path, const char *mode,MSVCRT_FILE* file MSVCRT__set_errno(ERROR_CALL_NOT_IMPLEMENTED); return NULL; #endif - if(MSVCRT_fclose(file)) + if(MSVCRT_fclose(file)) return NULL; return MSVCRT_fopen(path, mode); } @@ -1857,7 +1857,7 @@ static int char2digit(char c, int base) { /********************************************************************* * fscanf (MSVCRT.@) - * Implemented based on + * Implemented based on * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt_format_specification_fields_.2d_.scanf_and_wscanf_functions.asp * Extended by C. Scott Ananian to handle * more types of format spec. @@ -2113,15 +2113,15 @@ int MSVCRT_fscanf(MSVCRT_FILE* file, const char *format, ...) int MSVCRT_fseek(MSVCRT_FILE* file, long offset, int whence) { /* Flush output if needed */ - if(file->_flag & MSVCRT__IOWRT) + if(file->_flag & MSVCRT__IOWRT) msvcrt_flush_buffer(file); - + if(whence == SEEK_CUR && file->_flag & MSVCRT__IOREAD ) { offset -= file->_cnt; } /* Discard buffered input */ file->_cnt = 0; - file->_ptr = file->_base; + file->_ptr = file->_base; /* Reset direction of i/o */ if(file->_flag & MSVCRT__IORW) { file->_flag &= ~(MSVCRT__IOREAD|MSVCRT__IOWRT); @@ -2136,10 +2136,10 @@ LONG MSVCRT_ftell(MSVCRT_FILE* file) { int off=0; long pos; - if(file->_bufsiz) { + if(file->_bufsiz) { if( file->_flag & MSVCRT__IOWRT ) { off = file->_ptr - file->_base; - } else { + } else { off = -file->_cnt; } } @@ -2157,7 +2157,7 @@ MSVCRT_size_t MSVCRT_fwrite(const void *ptr, MSVCRT_size_t size, MSVCRT_size_t n int written = 0; if (size == 0) return 0; - if(file->_cnt) { + if(file->_cnt) { int pcnt=(file->_cnt>wrcnt)? wrcnt: file->_cnt; memcpy(file->_ptr, ptr, pcnt); file->_cnt -= pcnt; @@ -2165,16 +2165,16 @@ MSVCRT_size_t MSVCRT_fwrite(const void *ptr, MSVCRT_size_t size, MSVCRT_size_t n written = pcnt; wrcnt -= pcnt; ptr += pcnt; - } else if(!(file->_flag & MSVCRT__IOWRT)) { - if(file->_flag & MSVCRT__IORW) { + } else if(!(file->_flag & MSVCRT__IOWRT)) { + if(file->_flag & MSVCRT__IORW) { file->_flag |= MSVCRT__IOWRT; - } else + } else return 0; } if(wrcnt) { /* Flush buffer */ int res=msvcrt_flush_buffer(file); - if(!res) { + if(!res) { int pwritten = _write(file->_file, ptr, wrcnt); if (pwritten <= 0) pwritten=0; written += pwritten; @@ -2364,17 +2364,17 @@ int _wrename(const WCHAR *oldpath,const WCHAR *newpath) int MSVCRT_setvbuf(MSVCRT_FILE* file, char *buf, int mode, MSVCRT_size_t size) { /* TODO: Check if file busy */ - if(file->_bufsiz) { + if(file->_bufsiz) { MSVCRT_free(file->_base); file->_bufsiz = 0; file->_cnt = 0; } - if(mode == MSVCRT__IOFBF) { + if(mode == MSVCRT__IOFBF) { file->_flag &= ~MSVCRT__IONBF; file->_base = file->_ptr = buf; - if(buf) { + if(buf) { file->_bufsiz = size; - } + } } else { file->_flag |= MSVCRT__IONBF; } @@ -2449,7 +2449,7 @@ int MSVCRT_vfprintf(MSVCRT_FILE* file, const char *format, va_list valist) /********************************************************************* * vfwprintf (MSVCRT.@) - * FIXME: + * FIXME: * Is final char included in written (then resize is too big) or not * (then we must test for equality too)? */ @@ -2533,11 +2533,11 @@ int MSVCRT_printf(const char *format, ...) */ int MSVCRT_ungetc(int c, MSVCRT_FILE * file) { - if(file->_bufsiz == 0 && !(file->_flag & MSVCRT__IONBF)) { + if(file->_bufsiz == 0 && !(file->_flag & MSVCRT__IONBF)) { msvcrt_alloc_buffer(file); file->_ptr++; } - if(file->_ptr>file->_base) { + if(file->_ptr>file->_base) { file->_ptr--; *file->_ptr=c; file->_cnt++; @@ -2554,7 +2554,7 @@ MSVCRT_wint_t MSVCRT_ungetwc(MSVCRT_wint_t wc, MSVCRT_FILE * file) WCHAR mwc = wc; char * pp = (char *)&mwc; int i; - for(i=sizeof(WCHAR)-1;i>=0;i--) { + for(i=sizeof(WCHAR)-1;i>=0;i--) { if(pp[i] != MSVCRT_ungetc(pp[i],file)) return MSVCRT_WEOF; } diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c index dd6683f8147..1053ff508c7 100644 --- a/dlls/msvcrt/lock.c +++ b/dlls/msvcrt/lock.c @@ -25,7 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); typedef struct { - BOOL bInit; + BOOL bInit; CRITICAL_SECTION crit; } LOCKTABLEENTRY; @@ -39,7 +39,7 @@ static inline void msvcrt_mlock_set_entry_initialized( int locknum, BOOL initial static inline void msvcrt_initialize_mlock( int locknum ) { InitializeCriticalSection( &(lock_table[ locknum ].crit) ); - msvcrt_mlock_set_entry_initialized( locknum, TRUE ); + msvcrt_mlock_set_entry_initialized( locknum, TRUE ); } static inline void msvcrt_uninitialize_mlock( int locknum ) @@ -51,7 +51,7 @@ static inline void msvcrt_uninitialize_mlock( int locknum ) /********************************************************************** * msvcrt_init_mt_locks (internal) * - * Initialize the table lock. All other locks will be initialized + * Initialize the table lock. All other locks will be initialized * upon first use. * */ @@ -68,7 +68,7 @@ void msvcrt_init_mt_locks(void) } /* Initialize our lock table lock */ - msvcrt_initialize_mlock( _LOCKTAB_LOCK ); + msvcrt_initialize_mlock( _LOCKTAB_LOCK ); } /********************************************************************** @@ -119,7 +119,7 @@ void _lock( int locknum ) _unlock( _LOCKTAB_LOCK ); } - EnterCriticalSection( &(lock_table[ locknum ].crit) ); + EnterCriticalSection( &(lock_table[ locknum ].crit) ); } /********************************************************************** diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 5714aa0223c..0db7552f655 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -180,7 +180,7 @@ MSVCRT_size_t _mbstrlen(const char* str) MSVCRT_size_t len = 0; while(*str) { - /* FIXME: According to the documentation we are supposed to test for + /* FIXME: According to the documentation we are supposed to test for * multi-byte character validity. Whatever that means */ str += MSVCRT_isleadbyte(*str) ? 2 : 1; @@ -247,7 +247,7 @@ unsigned char* _mbsnbcpy(unsigned char* dst, const unsigned char* src, MSVCRT_si } if (*src && n && !MSVCRT_isleadbyte(*src)) { - /* If the last character is a multi-byte character then + /* If the last character is a multi-byte character then * we cannot copy it since we have only one byte left */ *dst++ = *src; diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index ba03a3df126..aa68e9777b3 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -53,7 +53,7 @@ void MSVCRT__set_errno(int); char* msvcrt_strndup(const char*,unsigned int); LPWSTR msvcrt_wstrndup(LPCWSTR, unsigned int); -/* FIXME: This should be declared in new.h but it's not an extern "C" so +/* FIXME: This should be declared in new.h but it's not an extern "C" so * it would not be much use anyway. Even for Winelib applications. */ int MSVCRT__set_new_mode(int mode); diff --git a/dlls/msvcrt/mtdll.h b/dlls/msvcrt/mtdll.h index d1ab2e978fa..1c899dfe7dd 100644 --- a/dlls/msvcrt/mtdll.h +++ b/dlls/msvcrt/mtdll.h @@ -42,7 +42,7 @@ void _lock( int locknum ); #define _OUTPUT_LOCK 5 #define _CSCANF_LOCK 6 #define _CPRINTF_LOCK 7 -#define _CONIO_LOCK 8 +#define _CONIO_LOCK 8 #define _HEAP_LOCK 9 #define _BHEAP_LOCK 10 /* No longer used? */ #define _TIME_LOCK 11 @@ -50,7 +50,7 @@ void _lock( int locknum ); #define _EXIT_LOCK1 13 #define _EXIT_LOCK2 14 /* No longer used? */ #define _THREADDATA_LOCK 15 /* No longer used? */ -#define _POPEN_LOCK 16 +#define _POPEN_LOCK 16 #define _LOCKTAB_LOCK 17 #define _OSFHND_LOCK 18 #define _SETLOCALE_LOCK 19 diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c index e9b66fee546..55857505c41 100644 --- a/dlls/msvcrt/process.c +++ b/dlls/msvcrt/process.c @@ -215,7 +215,7 @@ int _cwait(int *status, int pid, int action) /********************************************************************* * _execl (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _execl(const char* name, const char* arg0, ...) @@ -237,7 +237,7 @@ int _execl(const char* name, const char* arg0, ...) /********************************************************************* * _execlp (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _execlp(const char* name, const char* arg0, ...) @@ -262,7 +262,7 @@ int _execlp(const char* name, const char* arg0, ...) /********************************************************************* * _execv (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _execv(const char* name, char* const* argv) @@ -273,7 +273,7 @@ int _execv(const char* name, char* const* argv) /********************************************************************* * _execve (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _execve(const char* name, char* const* argv, const char* const* envv) @@ -284,7 +284,7 @@ int _execve(const char* name, char* const* argv, const char* const* envv) /********************************************************************* * _execvpe (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _execvpe(const char* name, char* const* argv, const char* const* envv) @@ -299,7 +299,7 @@ int _execvpe(const char* name, char* const* argv, const char* const* envv) /********************************************************************* * _execvp (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _execvp(const char* name, char* const* argv) @@ -310,7 +310,7 @@ int _execvp(const char* name, char* const* argv) /********************************************************************* * _spawnl (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _spawnl(int flags, const char* name, const char* arg0, ...) @@ -332,7 +332,7 @@ int _spawnl(int flags, const char* name, const char* arg0, ...) /********************************************************************* * _spawnlp (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _spawnlp(int flags, const char* name, const char* arg0, ...) @@ -357,7 +357,7 @@ int _spawnlp(int flags, const char* name, const char* arg0, ...) /********************************************************************* * _spawnve (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _spawnve(int flags, const char* name, const char* const* argv, @@ -385,7 +385,7 @@ int _spawnve(int flags, const char* name, const char* const* argv, /********************************************************************* * _spawnv (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _spawnv(int flags, const char* name, const char* const* argv) @@ -396,7 +396,7 @@ int _spawnv(int flags, const char* name, const char* const* argv) /********************************************************************* * _spawnvpe (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _spawnvpe(int flags, const char* name, const char* const* argv, @@ -410,7 +410,7 @@ int _spawnvpe(int flags, const char* name, const char* const* argv, /********************************************************************* * _spawnvp (MSVCRT.@) * - * Like on Windows, this function does not handle arguments with spaces + * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ int _spawnvp(int flags, const char* name, const char* const* argv) diff --git a/dlls/msvcrt/thread.c b/dlls/msvcrt/thread.c index 586561c11c2..b4f52c22b24 100644 --- a/dlls/msvcrt/thread.c +++ b/dlls/msvcrt/thread.c @@ -40,8 +40,8 @@ static DWORD CALLBACK _beginthread_trampoline(LPVOID arg) { _beginthread_trampoline_t local_trampoline; - /* Maybe it's just being paranoid, but freeing arg right - * away seems safer. + /* Maybe it's just being paranoid, but freeing arg right + * away seems safer. */ memcpy(&local_trampoline,arg,sizeof(local_trampoline)); MSVCRT_free(arg); @@ -62,7 +62,7 @@ unsigned long _beginthread( TRACE("(%p, %d, %p)\n", start_address, stack_size, arglist); - /* Allocate the trampoline here so that it is still valid when the thread + /* Allocate the trampoline here so that it is still valid when the thread * starts... typically after this function has returned. * _beginthread_trampoline is responsible for freeing the trampoline */ diff --git a/dlls/msvideo/drawdib.c b/dlls/msvideo/drawdib.c index abf20bd650b..6321c0fe5d3 100644 --- a/dlls/msvideo/drawdib.c +++ b/dlls/msvideo/drawdib.c @@ -1,4 +1,4 @@ -/* +/* * Copyright 2000 Bradley Baetz * * This library is free software; you can redistribute it and/or @@ -101,7 +101,7 @@ BOOL16 VFWAPI DrawDibClose16(HDRAWDIB16 hdd) { BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd) { BOOL ret = TRUE; WINE_HDD *whdd = GlobalLock16(hdd); - + TRACE("(0x%08lx)\n",(DWORD)hdd); whdd->hpal = 0; /* Do not free this */ @@ -127,7 +127,7 @@ BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd) { if (whdd->hDib) DeleteObject(whdd->hDib); - + if (whdd->hic) { ICDecompressEnd(whdd->hic); ICClose(whdd->hic); @@ -164,9 +164,9 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, hdd,(DWORD)hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,(DWORD)wFlags ); TRACE("lpbi: %ld,%ld/%ld,%d,%d,%ld,%ld,%ld,%ld,%ld,%ld\n", - lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, - lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, - lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, + lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, + lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, + lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, lpbi->biClrImportant); if (wFlags & ~(DDF_BUFFER)) @@ -222,7 +222,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, if (ret) { /*whdd->lpvbuf = HeapAlloc(GetProcessHeap(),0,whdd->lpbiOut->biSizeImage);*/ - + whdd->hMemDC = CreateCompatibleDC(hdc); TRACE("Creating: %ld,%p\n",whdd->lpbiOut->biSize,whdd->lpvbits); whdd->hDib = CreateDIBSection(whdd->hMemDC,(BITMAPINFO *)whdd->lpbiOut,DIB_RGB_COLORS,&(whdd->lpvbits),0,0); @@ -288,7 +288,7 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, hdd,(DWORD)hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,(DWORD)wFlags ); - if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | + if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | DDF_UPDATE | DDF_DONTDRAW)) FIXME("wFlags == 0x%08lx not handled\n",(DWORD)wFlags); @@ -321,16 +321,16 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, if (lpbi->biCompression) { DWORD flags = 0; - + TRACE("Compression == 0x%08lx\n",lpbi->biCompression); - + if (wFlags & DDF_NOTKEYFRAME) flags |= ICDECOMPRESS_NOTKEYFRAME; - + ICDecompress(whdd->hic,flags,lpbi,lpBits,whdd->lpbiOut,whdd->lpvbits); } else { memcpy(whdd->lpvbits,lpBits,lpbi->biSizeImage); - } + } } if (!(wFlags & DDF_DONTDRAW) && whdd->hpal) SelectPalette(hdc,whdd->hpal,FALSE); @@ -345,7 +345,7 @@ BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, /********************************************************************** * DrawDibDraw [MSVIDEO.106] */ -BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd, +BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd, HDC16 hdc, INT16 xDst, INT16 yDst, @@ -401,7 +401,7 @@ BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal) { whdd = GlobalLock16(hdd); whdd->hpal = hpal; - + if (whdd->begun) { SelectPalette(whdd->hdc,hpal,0); RealizePalette(whdd->hdc); @@ -448,20 +448,20 @@ UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground) { UINT ret = 0; FIXME("(%d,0x%08lx,%d), stub\n",hdd,(DWORD)hdc,fBackground); - + whdd = GlobalLock16(hdd); if (!whdd || !(whdd->begun)) { ret = 0; goto out; } - + if (!whdd->hpal) whdd->hpal = CreateHalftonePalette(hdc); oldPal = SelectPalette(hdc,whdd->hpal,fBackground); ret = RealizePalette(hdc); - + out: GlobalUnlock16(hdd); diff --git a/dlls/msvideo/mciwnd.c b/dlls/msvideo/mciwnd.c index c42217b3a72..1151f8af29f 100644 --- a/dlls/msvideo/mciwnd.c +++ b/dlls/msvideo/mciwnd.c @@ -1,5 +1,5 @@ /* - * Copyright 2000 Eric Pouech + * Copyright 2000 Eric Pouech * * * This library is free software; you can redistribute it and/or @@ -81,7 +81,7 @@ HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance, { DWORD wndStyle; MCIWndInfo* mwi; - + TRACE("%x %x %lx %s\n", hwndParent, hInstance, dwStyle, szFile); MCIWndRegisterClass(hInstance); @@ -99,12 +99,12 @@ HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance, wndStyle = ((hwndParent) ? (WS_CHILD|WS_BORDER) : WS_OVERLAPPEDWINDOW) | WS_VISIBLE | (dwStyle & 0xFFFF0000); - if (CreateWindowExA(0, "MCIWndClass", NULL, wndStyle, - CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, + if (CreateWindowExA(0, "MCIWndClass", NULL, wndStyle, + CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, hwndParent, (HMENU)0, hInstance, mwi)) return mwi->hWnd; - + if(mwi->lpName) HeapFree(GetProcessHeap(), 0, mwi->lpName); HeapFree(GetProcessHeap(), 0, mwi); return 0; @@ -126,7 +126,7 @@ HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance, static DWORD MCIWND_GetStatus(MCIWndInfo* mwi) { MCI_DGV_STATUS_PARMSA mdsp; - + memset(&mdsp, 0, sizeof(mdsp)); mdsp.dwItem = MCI_STATUS_MODE; if (mciSendCommandA(mwi->mci, MCI_STATUS, MCI_WAIT|MCI_STATUS_ITEM, (DWORD)&mdsp)) @@ -142,7 +142,7 @@ static DWORD MCIWND_GetStatus(MCIWndInfo* mwi) static DWORD MCIWND_Get(MCIWndInfo* mwi, DWORD what) { MCI_DGV_STATUS_PARMSA mdsp; - + memset(&mdsp, 0, sizeof(mdsp)); mdsp.dwItem = what; if (mciSendCommandA(mwi->mci, MCI_STATUS, MCI_WAIT|MCI_STATUS_ITEM, (DWORD)&mdsp)) @@ -216,7 +216,7 @@ static void MCIWND_Create(HWND hWnd, LPCREATESTRUCTA cs) return; } mwi->mci = mdopn.wDeviceID; - + /* grab AVI window size */ memset(&mdrct, 0, sizeof(mdrct)); mmr = mciSendCommandA(mwi->mci, MCI_WHERE, MCI_DGV_WHERE_DESTINATION, (LPARAM)&mdrct); @@ -228,17 +228,17 @@ static void MCIWND_Create(HWND hWnd, LPCREATESTRUCTA cs) cy = mdrct.rc.bottom - mdrct.rc.top; AdjustWindowRect(&mdrct.rc, GetWindowLongA(hWnd, GWL_STYLE), FALSE); - SetWindowPos(hWnd, 0, 0, 0, mdrct.rc.right - mdrct.rc.left, + SetWindowPos(hWnd, 0, 0, 0, mdrct.rc.right - mdrct.rc.left, mdrct.rc.bottom - mdrct.rc.top + 32, SWP_NOMOVE|SWP_NOZORDER); /* adding the other elements: play/stop button, menu button, status */ - hChld = CreateWindowExA(0, "BUTTON", "Play", WS_CHILD|WS_VISIBLE, 0, cy, 32, 32, + hChld = CreateWindowExA(0, "BUTTON", "Play", WS_CHILD|WS_VISIBLE, 0, cy, 32, 32, hWnd, (HMENU)CTL_PLAYSTOP, GetWindowLongA(hWnd, GWL_HINSTANCE), 0L); TRACE("Get Button1: %04x\n", hChld); - hChld = CreateWindowExA(0, "BUTTON", "Menu", WS_CHILD|WS_VISIBLE, 32, cy, 32, 32, + hChld = CreateWindowExA(0, "BUTTON", "Menu", WS_CHILD|WS_VISIBLE, 32, cy, 32, 32, hWnd, (HMENU)CTL_MENU, GetWindowLongA(hWnd, GWL_HINSTANCE), 0L); TRACE("Get Button2: %04x\n", hChld); - hChld = CreateWindowExA(0, TRACKBAR_CLASSA, "", WS_CHILD|WS_VISIBLE, 64, cy, cx - 64, 32, + hChld = CreateWindowExA(0, TRACKBAR_CLASSA, "", WS_CHILD|WS_VISIBLE, 64, cy, cx - 64, 32, hWnd, (HMENU)CTL_TRACKBAR, GetWindowLongA(hWnd, GWL_HINSTANCE), 0L); TRACE("Get status: %04x\n", hChld); SendMessageA(hChld, TBM_SETRANGEMIN, 0L, 0L); diff --git a/dlls/msvideo/msvideo_main.c b/dlls/msvideo/msvideo_main.c index 15eff37c607..66c0b8638d6 100644 --- a/dlls/msvideo/msvideo_main.c +++ b/dlls/msvideo/msvideo_main.c @@ -1,6 +1,6 @@ /* * Copyright 1998 Marcus Meissner - * Copyright 2000 Bradley Baetz + * Copyright 2000 Bradley Baetz * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -180,7 +180,7 @@ BOOL16 VFWAPI ICInfo16( ret = ICInfo(fccType,fccHandler,(ICINFO*)lParam); MSVIDEO_UnmapMsg16To32(ICM_GETINFO,lpv,&lParam,&size); - + return ret; } @@ -201,7 +201,7 @@ HIC VFWAPI ICOpen(DWORD fccType,DWORD fccHandler,UINT wMode) { sprintf(codecname,"%s.%s",type,handler); - /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the + /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the * same layout as ICOPEN */ icopen.fccType = fccType; @@ -253,12 +253,12 @@ HIC MSVIDEO_OpenFunc(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHa return 0; whic = GlobalLock16(hic); whic->driverproc = lpfnHandler; - + whic->private = bFrom32; - + /* Now try opening/loading the driver. Taken from DRIVER_AddToList */ /* What if the function is used more than once? */ - + if (MSVIDEO_SendMessage(hic,DRV_LOAD,0L,0L,bFrom32) != DRV_SUCCESS) { WARN("DRV_LOAD failed for hic 0x%08lx\n",(DWORD)hic); GlobalFree16(hic); @@ -346,7 +346,7 @@ HIC VFWAPI ICLocate( switch (wMode) { case ICMODE_FASTCOMPRESS: - case ICMODE_COMPRESS: + case ICMODE_COMPRESS: querymsg = ICM_COMPRESS_QUERY; break; case ICMODE_FASTDECOMPRESS: @@ -374,7 +374,7 @@ HIC VFWAPI ICLocate( /* Now try each driver in turn. 32 bit codecs only. */ /* FIXME: Move this to an init routine? */ - + pszBuffer = (LPSTR)HeapAlloc(GetProcessHeap(),0,1024); if (GetPrivateProfileSectionA("drivers32",pszBuffer,1024,"system.ini")) { char* s = pszBuffer; @@ -397,7 +397,7 @@ HIC VFWAPI ICLocate( } } HeapFree(GetProcessHeap(),0,pszBuffer); - + if (fccType==streamtypeVIDEO) { hic = ICLocate(ICTYPE_VIDEO,fccHandler,lpbiIn,lpbiOut,wMode); if (hic) @@ -424,7 +424,7 @@ HIC VFWAPI ICGetDisplayFormat( HIC hic,LPBITMAPINFOHEADER lpbiIn,LPBITMAPINFOHEADER lpbiOut, INT depth,INT dx,INT dy) { - HIC tmphic = hic; + HIC tmphic = hic; FIXME("(0x%08lx,%p,%p,%d,%d,%d),stub!\n",(DWORD)hic,lpbiIn,lpbiOut,depth,dx,dy); if (!tmphic) { @@ -461,7 +461,7 @@ HIC VFWAPI ICGetDisplayFormat( } if (lpbiIn->biBitCount == 8) depth = 8; - + TRACE("=> 0x%08lx\n",(DWORD)tmphic); return tmphic; errout: @@ -583,7 +583,7 @@ DWORD VFWAPIV ICDecompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFo ICDECOMPRESS icd; SEGPTR segptr; DWORD ret; - + TRACE("(0x%08lx,%ld,%p,%p,%p,%p)\n",(DWORD)hic,dwFlags,lpbiFormat,lpData,lpbi,lpBits); icd.dwFlags = dwFlags; @@ -607,7 +607,7 @@ LPVOID MSVIDEO_MapICDEX16To32(LPDWORD lParam) { ICDECOMPRESSEX *icdx = HeapAlloc(GetProcessHeap(),0,sizeof(ICDECOMPRESSEX)); ICDECOMPRESSEX16 *icdx16 = MapSL(*lParam); ret = icdx16; - + COPY(icdx,dwFlags); COPYPTR(icdx,lpbiSrc); COPYPTR(icdx,lpSrc); @@ -621,14 +621,14 @@ LPVOID MSVIDEO_MapICDEX16To32(LPDWORD lParam) { COPY(icdx,ySrc); COPY(icdx,dxSrc); COPY(icdx,dySrc); - + *lParam = (DWORD)(icdx); return ret; } LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) { LPVOID ret = 0; - + TRACE("Mapping %d\n",msg); switch (msg) { @@ -698,7 +698,7 @@ LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) { COPY(icc,dwQuality); COPYPTR(icc,lpbiPrev); COPYPTR(icc,lpPrev); - + *lParam1 = (DWORD)(icc); *lParam2 = sizeof(ICCOMPRESS); } @@ -707,17 +707,17 @@ LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) { { ICDECOMPRESS *icd = HeapAlloc(GetProcessHeap(),0,sizeof(ICDECOMPRESS)); ICDECOMPRESS *icd16; /* Same structure except for the pointers */ - + icd16 = MapSL(*lParam1); ret = icd16; - + COPY(icd,dwFlags); COPYPTR(icd,lpbiInput); COPYPTR(icd,lpInput); COPYPTR(icd,lpbiOutput); COPYPTR(icd,lpOutput); COPY(icd,ckid); - + *lParam1 = (DWORD)(icd); *lParam2 = sizeof(ICDECOMPRESS); } @@ -746,7 +746,7 @@ LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) { addr[1] = MSVIDEO_MapICDEX16To32(lParam2); else addr[1] = 0; - + ret = addr; } break;*/ @@ -785,7 +785,7 @@ LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) { { ICDRAWSUGGEST *icds = HeapAlloc(GetProcessHeap(),0,sizeof(ICDRAWSUGGEST)); ICDRAWSUGGEST16 *icds16 = MapSL(*lParam1); - + ret = icds16; COPY(icds,dwFlags); @@ -878,7 +878,7 @@ void MSVIDEO_UnmapMsg16To32(UINT msg, LPVOID data16, LPDWORD lParam1, LPDWORD lP default: ERR("Unmapping unmapped msg %d\n",msg); } -#undef UNCOPY +#undef UNCOPY } LRESULT MSVIDEO_SendMessage(HIC hic,UINT msg,DWORD lParam1,DWORD lParam2, BOOL bFrom32) { @@ -971,7 +971,7 @@ LRESULT MSVIDEO_SendMessage(HIC hic,UINT msg,DWORD lParam1,DWORD lParam2, BOOL b goto out; } } - + if (whic->driverproc) { if (bDrv32) { ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2); @@ -984,10 +984,10 @@ LRESULT MSVIDEO_SendMessage(HIC hic,UINT msg,DWORD lParam1,DWORD lParam2, BOOL b if (data16) MSVIDEO_UnmapMsg16To32(msg,data16,&lParam1,&lParam2); - + out: GlobalUnlock16(hic); - + TRACE(" -> 0x%08lx\n",ret); return ret; } @@ -1019,7 +1019,7 @@ LRESULT VFWAPIV ICMessage16(void) { UINT16 i; VA_LIST16 valist; - + VA_START16(valist); hic = VA_ARG16(valist, HIC16); msg = VA_ARG16(valist, UINT16); @@ -1032,7 +1032,7 @@ LRESULT VFWAPIV ICMessage16(void) { for(i=0;incb_lana_num); - if( (pncb->ncb_lana_num < MAX_LANA ) && + if( (pncb->ncb_lana_num < MAX_LANA ) && NETBIOS_Adapter[pncb->ncb_lana_num].valid) ret = NRC_GOODRET; else diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c index c5740ba1bf1..54c4b816704 100644 --- a/dlls/ntdll/cdrom.c +++ b/dlls/ntdll/cdrom.c @@ -95,7 +95,7 @@ struct linux_cdrom_generic_command #endif /* linux */ -/* FIXME: this is needed because we can't open simultaneously several times /dev/cdrom +/* FIXME: this is needed because we can't open simultaneously several times /dev/cdrom * this should be removed when a proper device interface is implemented */ struct cdrom_cache { @@ -107,7 +107,7 @@ static struct cdrom_cache cdrom_cache[26]; /****************************************************************** * CDROM_GetIdeInterface * - * Determines the ide interface (the number after the ide), and the + * Determines the ide interface (the number after the ide), and the * number of the device on that interface for ide cdroms. * Returns false if the info could not be get * @@ -160,7 +160,7 @@ static int CDROM_GetIdeInterface(int dev, int* iface, int* device) * Initializes registry to contain scsi info about the cdrom in NT. * All devices (even not real scsi ones) have this info in NT. * TODO: for now it only works for non scsi devices - * NOTE: programs usually read these registry entries after sending the + * NOTE: programs usually read these registry entries after sending the * IOCTL_SCSI_GET_ADDRESS ioctl to the cdrom */ void CDROM_InitRegistry(int dev) @@ -325,7 +325,7 @@ static int CDROM_Open(HANDLE hDevice, DWORD clientID) static void CDROM_Close(DWORD clientID, int fd) { int dev = LOWORD(clientID); - + if (dev >= 26 || fd != cdrom_cache[dev].fd) FIXME("how come\n"); if (--cdrom_cache[dev].count == 0) close(cdrom_cache[dev].fd); @@ -390,7 +390,7 @@ static DWORD CDROM_ResetAudio(int dev) #else return STATUS_NOT_SUPPORTED; #endif -} +} /****************************************************************** * CDROM_SetTray @@ -402,7 +402,7 @@ static DWORD CDROM_SetTray(int dev, BOOL doEject) #if defined(linux) return CDROM_GetStatusCode(ioctl(dev, doEject ? CDROMEJECT : CDROMCLOSETRAY)); #elif defined(__FreeBSD__) || defined(__NetBSD__) - return CDROM_GetStatusCode((ioctl(dev, CDIOCALLOW, NULL)) || + return CDROM_GetStatusCode((ioctl(dev, CDIOCALLOW, NULL)) || (ioctl(dev, doEject ? CDIOCEJECT : CDIOCCLOSE, NULL)) || (ioctl(dev, CDIOCPREVENT, NULL))); #else @@ -441,7 +441,7 @@ static DWORD CDROM_ReadTOC(int dev, CDROM_TOC* toc) struct cdrom_tocentry entry; io = ioctl(dev, CDROMREADTOCHDR, &hdr); - if (io == -1) + if (io == -1) { WARN("(%d) -- Error occurred (%s)!\n", dev, strerror(errno)); goto end; @@ -483,7 +483,7 @@ end: struct cd_toc_entry toc_buffer; io = ioctl(dev, CDIOREADTOCHEADER, &hdr); - if (io == -1) + if (io == -1) { WARN("(%d) -- Error occurred (%s)!\n", dev, strerror(errno)); goto end; @@ -555,7 +555,7 @@ static DWORD CDROM_GetDiskData(int dev, CDROM_DISK_DATA* data) * * */ -static DWORD CDROM_ReadQChannel(int dev, const CDROM_SUB_Q_DATA_FORMAT* fmt, +static DWORD CDROM_ReadQChannel(int dev, const CDROM_SUB_Q_DATA_FORMAT* fmt, SUB_Q_CHANNEL_DATA* data) { DWORD ret = STATUS_NOT_SUPPORTED; @@ -580,7 +580,7 @@ static DWORD CDROM_ReadQChannel(int dev, const CDROM_SUB_Q_DATA_FORMAT* fmt, case CDROM_AUDIO_INVALID: hdr->AudioStatus = AUDIO_STATUS_NOT_SUPPORTED; break; - case CDROM_AUDIO_NO_STATUS: + case CDROM_AUDIO_NO_STATUS: hdr->AudioStatus = AUDIO_STATUS_NO_STATUS; break; case CDROM_AUDIO_PLAY: @@ -901,7 +901,7 @@ static DWORD CDROM_GetVolume(int dev, VOLUME_CONTROL* vc) #if defined(linux) struct cdrom_volctrl volc; int io; - + io = ioctl(dev, CDROMVOLREAD, &volc); if (io != -1) { @@ -914,7 +914,7 @@ static DWORD CDROM_GetVolume(int dev, VOLUME_CONTROL* vc) #elif defined(__FreeBSD__) || defined(__NetBSD__) struct ioc_vol volc; int io; - + io = ioctl(dev, CDIOCGETVOL, &volc); if (io != -1) { @@ -922,7 +922,7 @@ static DWORD CDROM_GetVolume(int dev, VOLUME_CONTROL* vc) vc->PortVolume[1] = volc.vol[1]; vc->PortVolume[2] = volc.vol[2]; vc->PortVolume[3] = volc.vol[3]; - } + } return CDROM_GetStatusCode(io); #else return STATUS_NOT_SUPPORTED; @@ -943,7 +943,7 @@ static DWORD CDROM_SetVolume(int dev, const VOLUME_CONTROL* vc) volc.channel1 = vc->PortVolume[1]; volc.channel2 = vc->PortVolume[2]; volc.channel3 = vc->PortVolume[3]; - + return CDROM_GetStatusCode(ioctl(dev, CDROMVOLCTRL, &volc)); #elif defined(__FreeBSD__) || defined(__NetBSD__) struct ioc_vol volc; @@ -978,7 +978,7 @@ static DWORD CDROM_RawRead(int dev, const RAW_READ_INFO* raw, void* buffer, DWOR default: return STATUS_INVALID_PARAMETER; } if (len < raw->SectorCount * sectSize) return STATUS_BUFFER_TOO_SMALL; - /* strangely enough, it seems that sector offsets are always indicated with a size of 2048, + /* strangely enough, it seems that sector offsets are always indicated with a size of 2048, * even if a larger size if read... */ #if defined(linux) @@ -1000,7 +1000,7 @@ static DWORD CDROM_RawRead(int dev, const RAW_READ_INFO* raw, void* buffer, DWOR return ret; case CDDA: /* FIXME: the output doesn't seem 100% correct... in fact output is shifted - * between by NT2K box and this... should check on the same drive... + * between by NT2K box and this... should check on the same drive... * otherwise, I fear a 2352/2368 mismatch somewhere in one of the drivers * (linux/NT). * Anyway, that's not critical at all. We're talking of 16/32 bytes, we're @@ -1198,7 +1198,7 @@ static DWORD CDROM_ScsiPassThrough(int dev, PSCSI_PASS_THROUGH pPacket) /****************************************************************** * CDROM_GetAddress - * + * * implements IOCTL_SCSI_GET_ADDRESS */ static DWORD CDROM_GetAddress(int dev, SCSI_ADDRESS* address) @@ -1221,8 +1221,8 @@ static DWORD CDROM_GetAddress(int dev, SCSI_ADDRESS* address) * * */ -BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode, - LPVOID lpInBuffer, DWORD nInBufferSize, +BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode, + LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped) { @@ -1230,8 +1230,8 @@ BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode DWORD error = 0; int dev; - TRACE("%lx[%c] %lx %lx %ld %lx %ld %lx %lx\n", - (DWORD)hDevice, 'A' + LOWORD(clientID), dwIoControlCode, (DWORD)lpInBuffer, nInBufferSize, + TRACE("%lx[%c] %lx %lx %ld %lx %ld %lx %lx\n", + (DWORD)hDevice, 'A' + LOWORD(clientID), dwIoControlCode, (DWORD)lpInBuffer, nInBufferSize, (DWORD)lpOutBuffer, nOutBufferSize, (DWORD)lpBytesReturned, (DWORD)lpOverlapped); if (lpBytesReturned) *lpBytesReturned = 0; @@ -1283,7 +1283,7 @@ BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode case IOCTL_DISK_MEDIA_REMOVAL: case IOCTL_STORAGE_MEDIA_REMOVAL: case IOCTL_STORAGE_EJECTION_CONTROL: - /* FIXME the last ioctl:s is not the same as the two others... + /* FIXME the last ioctl:s is not the same as the two others... * lockcount/owner should be handled */ sz = 0; if (lpOutBuffer != NULL || nOutBufferSize != 0) error = STATUS_INVALID_PARAMETER; @@ -1332,7 +1332,7 @@ BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode case IOCTL_CDROM_READ_Q_CHANNEL: sz = sizeof(SUB_Q_CHANNEL_DATA); - if (lpInBuffer == NULL || nInBufferSize < sizeof(CDROM_SUB_Q_DATA_FORMAT)) + if (lpInBuffer == NULL || nInBufferSize < sizeof(CDROM_SUB_Q_DATA_FORMAT)) error = STATUS_INVALID_PARAMETER; else if (nOutBufferSize < sz) error = STATUS_BUFFER_TOO_SMALL; else error = CDROM_ReadQChannel(dev, (const CDROM_SUB_Q_DATA_FORMAT*)lpInBuffer, @@ -1394,7 +1394,7 @@ BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode sz = 0; if (nInBufferSize < sizeof(RAW_READ_INFO)) error = STATUS_INVALID_PARAMETER; else if (lpOutBuffer == NULL) error = STATUS_BUFFER_TOO_SMALL; - else error = CDROM_RawRead(dev, (const RAW_READ_INFO*)lpInBuffer, + else error = CDROM_RawRead(dev, (const RAW_READ_INFO*)lpInBuffer, lpOutBuffer, nOutBufferSize, &sz); break; case IOCTL_SCSI_GET_ADDRESS: @@ -1424,7 +1424,7 @@ BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode } if (lpBytesReturned) *lpBytesReturned = sz; - if (error) + if (error) { SetLastError(error); return FALSE; diff --git a/dlls/ntdll/error.c b/dlls/ntdll/error.c index 711337c929c..ca958d03ccd 100644 --- a/dlls/ntdll/error.c +++ b/dlls/ntdll/error.c @@ -1,6 +1,6 @@ /* * NTDLL error handling - * + * * Copyright 2000 Alexandre Julliard * * This library is free software; you can redistribute it and/or diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index f936b77a258..4fe4454e3c8 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -1,6 +1,6 @@ /* * NT exception handling routines - * + * * Copyright 1999 Turchanov Sergey * Copyright 1999 Alexandre Julliard * @@ -57,7 +57,7 @@ typedef struct extern void SIGNAL_Unblock(void); void WINAPI EXC_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT ); -void WINAPI EXC_RtlUnwind( PEXCEPTION_FRAME, LPVOID, +void WINAPI EXC_RtlUnwind( PEXCEPTION_FRAME, LPVOID, PEXCEPTION_RECORD, DWORD, PCONTEXT ); void WINAPI EXC_NtRaiseException( PEXCEPTION_RECORD, PCONTEXT, BOOL, PCONTEXT ); @@ -103,7 +103,7 @@ static DWORD EXC_UnwindHandler( EXCEPTION_RECORD *rec, EXCEPTION_FRAME *frame, * rely on Base Pointer (EBP) to have a fixed position related to the exception frame */ static DWORD EXC_CallHandler( EXCEPTION_RECORD *record, EXCEPTION_FRAME *frame, - CONTEXT *context, EXCEPTION_FRAME **dispatcher, + CONTEXT *context, EXCEPTION_FRAME **dispatcher, PEXCEPTION_HANDLER handler, PEXCEPTION_HANDLER nested_handler) { EXC_NESTED_FRAME newframe; @@ -251,9 +251,9 @@ void WINAPI EXC_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context ) /******************************************************************* * RtlUnwind (NTDLL.@) */ -DEFINE_REGS_ENTRYPOINT_4( RtlUnwind, EXC_RtlUnwind, +DEFINE_REGS_ENTRYPOINT_4( RtlUnwind, EXC_RtlUnwind, PEXCEPTION_FRAME, LPVOID, PEXCEPTION_RECORD, DWORD ); -void WINAPI EXC_RtlUnwind( PEXCEPTION_FRAME pEndFrame, LPVOID unusedEip, +void WINAPI EXC_RtlUnwind( PEXCEPTION_FRAME pEndFrame, LPVOID unusedEip, PEXCEPTION_RECORD pRecord, DWORD returnEax, CONTEXT *context ) { @@ -270,7 +270,7 @@ void WINAPI EXC_RtlUnwind( PEXCEPTION_FRAME pEndFrame, LPVOID unusedEip, record.ExceptionCode = STATUS_UNWIND; record.ExceptionFlags = 0; record.ExceptionRecord = NULL; - record.ExceptionAddress = GET_IP(context); + record.ExceptionAddress = GET_IP(context); record.NumberParameters = 0; pRecord = &record; } diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index dd17086519f..87f2debe1ba 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -47,7 +47,7 @@ NTSTATUS WINAPI NtOpenFile( ULONG OpenOptions) { FIXME("(%p,0x%08lx,%p,%p,0x%08lx,0x%08lx) stub\n", - FileHandle, DesiredAccess, ObjectAttributes, + FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, OpenOptions); dump_ObjectAttributes (ObjectAttributes); return 0; @@ -84,7 +84,7 @@ NTSTATUS WINAPI NtCreateFile( ULONG CreateDisposition, ULONG CreateOptions, PVOID EaBuffer, - ULONG EaLength) + ULONG EaLength) { FIXME("(%p,0x%08lx,%p,%p,%p,0x%08lx,0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx) stub\n", FileHandle,DesiredAccess,ObjectAttributes, @@ -178,7 +178,7 @@ NTSTATUS WINAPI NtSetVolumeInformationFile( PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, ULONG Length, - FS_INFORMATION_CLASS FsInformationClass) + FS_INFORMATION_CLASS FsInformationClass) { FIXME("(0x%08x,%p,%p,0x%08lx,0x%08x) stub\n", FileHandle,IoStatusBlock,FsInformation,Length,FsInformationClass); @@ -237,7 +237,7 @@ NTSTATUS WINAPI NtQueryDirectoryFile( { FIXME("(0x%08x 0x%08x %p %p %p %p 0x%08lx 0x%08x 0x%08x %p 0x%08x\n", FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, FileInformation, - Length, FileInformationClass, ReturnSingleEntry, + Length, FileInformationClass, ReturnSingleEntry, debugstr_us(FileName),RestartScan); return 0; } @@ -271,7 +271,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile ( len = sizeof( FILE_FS_SIZE_INFORMATION ); break; - case FileFsDeviceInformation: + case FileFsDeviceInformation: len = sizeof( FILE_FS_DEVICE_INFORMATION ); break; case FileFsAttributeInformation: @@ -308,11 +308,11 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile ( case FileFsSizeInformation: break; - case FileFsDeviceInformation: + case FileFsDeviceInformation: if (FSInformation) { FILE_FS_DEVICE_INFORMATION * DeviceInfo = FSInformation; - DeviceInfo->DeviceType = FILE_DEVICE_DISK; + DeviceInfo->DeviceType = FILE_DEVICE_DISK; DeviceInfo->Characteristics = 0; break; }; diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 94a02f2ced0..7821ef32be4 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -172,7 +172,7 @@ void HEAP_Dump( HEAP *heap ) DWORD freeSize = 0, usedSize = 0, arenaSize = subheap->headerSize; DPRINTF( "\n\nSub-heap %08lx: size=%08lx committed=%08lx\n", (DWORD)subheap, subheap->size, subheap->commitSize ); - + DPRINTF( "\n Block Stat Size Id\n" ); ptr = (char*)subheap + subheap->headerSize; while (ptr < (char *)subheap + subheap->size) @@ -529,7 +529,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags, /* Create the first free block */ - HEAP_CreateFreeBlock( subheap, (LPBYTE)subheap + subheap->headerSize, + HEAP_CreateFreeBlock( subheap, (LPBYTE)subheap + subheap->headerSize, subheap->size - subheap->headerSize ); return TRUE; @@ -699,8 +699,8 @@ static BOOL HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena ) /* Check that next arena is free */ if (!(pArena->next->size & ARENA_FLAG_FREE) || (pArena->next->magic != ARENA_FREE_MAGIC)) - { - ERR("Heap %08lx: next arena %08lx invalid for %08lx\n", + { + ERR("Heap %08lx: next arena %08lx invalid for %08lx\n", (DWORD)subheap->heap, (DWORD)pArena->next, (DWORD)pArena ); return FALSE; } @@ -714,10 +714,10 @@ static BOOL HEAP_ValidateFreeArena( SUBHEAP *subheap, ARENA_FREE *pArena ) /* Check that prev arena is free */ if (!(pArena->prev->size & ARENA_FLAG_FREE) || (pArena->prev->magic != ARENA_FREE_MAGIC)) - { + { /* this often means that the prev arena got overwritten * by a memory write before that prev arena */ - ERR("Heap %08lx: prev arena %08lx invalid for %08lx\n", + ERR("Heap %08lx: prev arena %08lx invalid for %08lx\n", (DWORD)subheap->heap, (DWORD)pArena->prev, (DWORD)pArena ); return FALSE; } @@ -789,7 +789,7 @@ static BOOL HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena, BOOL return FALSE; } /* Check size flags */ - if (pArena->size & ARENA_FLAG_FREE) + if (pArena->size & ARENA_FLAG_FREE) { ERR("Heap %08lx: bad flags %lx for in-use arena %08lx\n", (DWORD)subheap->heap, pArena->size & ~ARENA_SIZE_MASK, (DWORD)pArena ); @@ -823,8 +823,8 @@ static BOOL HEAP_ValidateInUseArena( SUBHEAP *subheap, ARENA_INUSE *pArena, BOOL /* Check that prev arena is free */ if (!(pPrev->size & ARENA_FLAG_FREE) || (pPrev->magic != ARENA_FREE_MAGIC)) - { - ERR("Heap %08lx: prev arena %08lx invalid for in-use %08lx\n", + { + ERR("Heap %08lx: prev arena %08lx invalid for in-use %08lx\n", (DWORD)subheap->heap, (DWORD)pPrev, (DWORD)pArena ); return FALSE; } @@ -877,9 +877,9 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */ ((char *)block < (char *)subheap + subheap->headerSize + sizeof(ARENA_INUSE))) { - if (quiet == NOISY) + if (quiet == NOISY) ERR("Heap %p: block %p is not inside heap\n", heapPtr, block ); - else if (WARN_ON(heap)) + else if (WARN_ON(heap)) WARN("Heap %p: block %p is not inside heap\n", heapPtr, block ); ret = FALSE; } else diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 56913b48db3..691d19d186c 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -1,6 +1,6 @@ /* * NT basis DLL - * + * * This file contains the Nt* API functions of NTDLL.DLL. * In the original ntdll.dll they all seem to just call int 0x2e (down to the NTOSKRNL) * @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll); /* * Timer object */ - + /************************************************************************** * NtCreateTimer [NTDLL.@] * ZwCreateTimer [NTDLL.@] @@ -73,7 +73,7 @@ NTSTATUS WINAPI NtSetTimer( /****************************************************************************** * NtQueryTimerResolution [NTDLL.@] */ -NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3) +NTSTATUS WINAPI NtQueryTimerResolution(DWORD x1,DWORD x2,DWORD x3) { FIXME("(0x%08lx,0x%08lx,0x%08lx), stub!\n",x1,x2,x3); return 1; @@ -171,7 +171,7 @@ NTSTATUS WINAPI NtSetInformationProcess( */ NTSTATUS WINAPI NtResumeThread( IN HANDLE ThreadHandle, - IN PULONG SuspendCount) + IN PULONG SuspendCount) { FIXME("(0x%08x,%p),stub!\n", ThreadHandle,SuspendCount); @@ -269,8 +269,8 @@ NTSTATUS WINAPI NtDuplicateToken( */ NTSTATUS WINAPI NtOpenProcessToken( HANDLE ProcessHandle, - DWORD DesiredAccess, - HANDLE *TokenHandle) + DWORD DesiredAccess, + HANDLE *TokenHandle) { FIXME("(0x%08x,0x%08lx,%p): stub\n", ProcessHandle,DesiredAccess, TokenHandle); @@ -284,9 +284,9 @@ NTSTATUS WINAPI NtOpenProcessToken( */ NTSTATUS WINAPI NtOpenThreadToken( HANDLE ThreadHandle, - DWORD DesiredAccess, + DWORD DesiredAccess, BOOLEAN OpenAsSelf, - HANDLE *TokenHandle) + HANDLE *TokenHandle) { FIXME("(0x%08x,0x%08lx,0x%08x,%p): stub\n", ThreadHandle,DesiredAccess, OpenAsSelf, TokenHandle); @@ -325,10 +325,10 @@ NTSTATUS WINAPI NtAdjustPrivilegesToken( */ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, - DWORD tokeninfoclass, + DWORD tokeninfoclass, LPVOID tokeninfo, DWORD tokeninfolength, - LPDWORD retlen ) + LPDWORD retlen ) { unsigned int len = 0; @@ -416,7 +416,7 @@ NTSTATUS WINAPI NtQueryInformationToken( /* * Section */ - + /****************************************************************************** * NtCreateSection [NTDLL.@] * ZwCreateSection [NTDLL.@] @@ -480,7 +480,7 @@ NTSTATUS WINAPI NtQuerySection( * ZeroBits Number of high order address bits that must be zero * CommitSize Size in bytes of the initially committed section of the view * SectionOffset Offset in bytes from the beginning of the section to the beginning of the view - * ViewSize Desired length of map (or zero to map all) on entry + * ViewSize Desired length of map (or zero to map all) on entry Actual length mapped on exit * InheritDisposition Specified how the view is to be shared with * child processes @@ -513,7 +513,7 @@ NTSTATUS WINAPI NtMapViewOfSection( * NtCreatePort [NTDLL.@] * ZwCreatePort [NTDLL.@] */ -NTSTATUS WINAPI NtCreatePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) +NTSTATUS WINAPI NtCreatePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) { FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5); return 0; @@ -523,7 +523,7 @@ NTSTATUS WINAPI NtCreatePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) * NtConnectPort [NTDLL.@] * ZwConnectPort [NTDLL.@] */ -NTSTATUS WINAPI NtConnectPort(DWORD x1,PUNICODE_STRING uni,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8) +NTSTATUS WINAPI NtConnectPort(DWORD x1,PUNICODE_STRING uni,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8) { FIXME("(0x%08lx,%s,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n", x1,debugstr_w(uni->Buffer),x3,x4,x5,x6,x7,x8); @@ -534,7 +534,7 @@ NTSTATUS WINAPI NtConnectPort(DWORD x1,PUNICODE_STRING uni,DWORD x3,DWORD x4,DWO * NtListenPort [NTDLL.@] * ZwListenPort [NTDLL.@] */ -NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2) +NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2) { FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2); return 0; @@ -544,7 +544,7 @@ NTSTATUS WINAPI NtListenPort(DWORD x1,DWORD x2) * NtAcceptConnectPort [NTDLL.@] * ZwAcceptConnectPort [NTDLL.@] */ -NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6) +NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6) { FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6); return 0; @@ -554,7 +554,7 @@ NTSTATUS WINAPI NtAcceptConnectPort(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5 * NtCompleteConnectPort [NTDLL.@] * ZwCompleteConnectPort [NTDLL.@] */ -NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1) +NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1) { FIXME("(0x%08lx),stub!\n",x1); return 0; @@ -564,7 +564,7 @@ NTSTATUS WINAPI NtCompleteConnectPort(DWORD x1) * NtRegisterThreadTerminatePort [NTDLL.@] * ZwRegisterThreadTerminatePort [NTDLL.@] */ -NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1) +NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1) { FIXME("(0x%08lx),stub!\n",x1); return 0; @@ -574,7 +574,7 @@ NTSTATUS WINAPI NtRegisterThreadTerminatePort(DWORD x1) * NtRequestWaitReplyPort [NTDLL.@] * ZwRequestWaitReplyPort [NTDLL.@] */ -NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,DWORD x2,DWORD x3) +NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,DWORD x2,DWORD x3) { FIXME("(0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3); return 0; @@ -584,7 +584,7 @@ NTSTATUS WINAPI NtRequestWaitReplyPort(DWORD x1,DWORD x2,DWORD x3) * NtReplyWaitReceivePort [NTDLL.@] * ZwReplyWaitReceivePort [NTDLL.@] */ -NTSTATUS WINAPI NtReplyWaitReceivePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4) +NTSTATUS WINAPI NtReplyWaitReceivePort(DWORD x1,DWORD x2,DWORD x3,DWORD x4) { FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4); return 0; @@ -608,7 +608,7 @@ NTSTATUS WINAPI NtSetIntervalProfile(DWORD x1,DWORD x2) { */ NTSTATUS WINAPI NtQueryPerformanceCounter( IN PLARGE_INTEGER Counter, - IN PLARGE_INTEGER Frequency) + IN PLARGE_INTEGER Frequency) { FIXME("(%p, 0%p) stub\n", Counter, Frequency); @@ -619,7 +619,7 @@ NTSTATUS WINAPI NtQueryPerformanceCounter( * NtCreateMailslotFile [NTDLL.@] * ZwCreateMailslotFile [NTDLL.@] */ -NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8) +NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8) { FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4,x5,x6,x7,x8); return 0; @@ -634,7 +634,7 @@ NTSTATUS WINAPI NtCreateMailslotFile(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT * SystemCacheInformation SYSTEM_CACHE_INFORMATION * SystemConfigurationInformation CONFIGURATION_INFORMATION - * observed (class/len): + * observed (class/len): * 0x0/0x2c * 0x12/0x18 * 0x2/0x138 @@ -692,7 +692,7 @@ NTSTATUS WINAPI NtCreatePagingFile( /****************************************************************************** * NtDisplayString [NTDLL.@] - * + * * writes a string to the nt-textmode screen eg. during startup */ NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string ) @@ -710,7 +710,7 @@ NTSTATUS WINAPI NtDisplayString ( PUNICODE_STRING string ) /****************************************************************************** * NtPowerInformation [NTDLL.@] - * + * */ NTSTATUS WINAPI NtPowerInformation(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) { diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c index 217d41ed6ef..56f65232dec 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -35,7 +35,7 @@ typedef void * POBJDIR_INFORMATION; /* * Generic object functions */ - + /****************************************************************************** * NtQueryObject [NTDLL.@] * ZwQueryObject [NTDLL.@] @@ -59,12 +59,12 @@ NTSTATUS WINAPI NtQueryObject( * * NOTES * only the lowest 4 bit of SecurityObjectInformationClass are used - * 0x7-0xf returns STATUS_ACCESS_DENIED (even running with system privileges) + * 0x7-0xf returns STATUS_ACCESS_DENIED (even running with system privileges) * - * FIXME: we are constructing a fake sid + * FIXME: we are constructing a fake sid * (Administrators:Full, System:Full, Everyone:Read) */ -NTSTATUS WINAPI +NTSTATUS WINAPI NtQuerySecurityObject( IN HANDLE Object, IN SECURITY_INFORMATION RequestedInformation, @@ -77,7 +77,7 @@ NtQuerySecurityObject( BYTE Buffer[256]; PISECURITY_DESCRIPTOR_RELATIVE psd = (PISECURITY_DESCRIPTOR_RELATIVE)Buffer; UINT BufferIndex = sizeof(SECURITY_DESCRIPTOR_RELATIVE); - + FIXME("(0x%08x,0x%08lx,%p,0x%08lx,%p) stub!\n", Object, RequestedInformation, pSecurityDesriptor, Length, ResultLength); @@ -87,7 +87,7 @@ NtQuerySecurityObject( ZeroMemory(Buffer, 256); RtlCreateSecurityDescriptor((PSECURITY_DESCRIPTOR)psd, SECURITY_DESCRIPTOR_REVISION); - psd->Control = SE_SELF_RELATIVE | + psd->Control = SE_SELF_RELATIVE | ((RequestedInformation & DACL_SECURITY_INFORMATION) ? SE_DACL_PRESENT:0); /* owner: administrator S-1-5-20-220*/ @@ -104,7 +104,7 @@ NtQuerySecurityObject( psid->SubAuthority[0] = SECURITY_BUILTIN_DOMAIN_RID; psid->SubAuthority[1] = DOMAIN_ALIAS_RID_ADMINS; } - + /* group: built in domain S-1-5-12 */ if (GROUP_SECURITY_INFORMATION & RequestedInformation) { @@ -126,7 +126,7 @@ NtQuerySecurityObject( PACL pacl = (PACL)&(Buffer[BufferIndex]); PACCESS_ALLOWED_ACE pace; PSID psid; - + psd->Dacl = BufferIndex; pacl->AclRevision = MIN_ACL_REVISION; @@ -134,7 +134,7 @@ NtQuerySecurityObject( pacl->AclSize = BufferIndex; /* storing the start index temporary */ BufferIndex += sizeof(ACL); - + /* ACE System - full access */ pace = (PACCESS_ALLOWED_ACE)&(Buffer[BufferIndex]); BufferIndex += sizeof(ACCESS_ALLOWED_ACE)-sizeof(DWORD); @@ -154,7 +154,7 @@ NtQuerySecurityObject( psid->SubAuthorityCount = 1; psid->IdentifierAuthority = localSidAuthority; psid->SubAuthority[0] = SECURITY_LOCAL_SYSTEM_RID; - + /* ACE Administrators - full access*/ pace = (PACCESS_ALLOWED_ACE) &(Buffer[BufferIndex]); BufferIndex += sizeof(ACCESS_ALLOWED_ACE)-sizeof(DWORD); @@ -175,7 +175,7 @@ NtQuerySecurityObject( psid->IdentifierAuthority = localSidAuthority; psid->SubAuthority[0] = SECURITY_BUILTIN_DOMAIN_RID; psid->SubAuthority[1] = DOMAIN_ALIAS_RID_ADMINS; - + /* ACE Everyone - read access */ pace = (PACCESS_ALLOWED_ACE)&(Buffer[BufferIndex]); BufferIndex += sizeof(ACCESS_ALLOWED_ACE)-sizeof(DWORD); @@ -277,7 +277,7 @@ NTSTATUS WINAPI NtOpenDirectoryObject( ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes) { - FIXME("(%p,0x%08lx,%p): stub\n", + FIXME("(%p,0x%08lx,%p): stub\n", DirectoryHandle, DesiredAccess, ObjectAttributes); dump_ObjectAttributes(ObjectAttributes); return 0; @@ -290,7 +290,7 @@ NTSTATUS WINAPI NtOpenDirectoryObject( NTSTATUS WINAPI NtCreateDirectoryObject( PHANDLE DirectoryHandle, ACCESS_MASK DesiredAccess, - POBJECT_ATTRIBUTES ObjectAttributes) + POBJECT_ATTRIBUTES ObjectAttributes) { FIXME("(%p,0x%08lx,%p),stub!\n", DirectoryHandle,DesiredAccess,ObjectAttributes); @@ -330,7 +330,7 @@ NTSTATUS WINAPI NtQueryDirectoryObject( /* * Link objects */ - + /****************************************************************************** * NtOpenSymbolicLinkObject [NTDLL.@] */ diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index b2b99c9ac8d..740fe0dd66d 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -86,7 +86,7 @@ NTSTATUS WINAPI NtCreateKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_AT * * OUT PHANDLE retkey (returns 0 when failure) * IN ACCESS_MASK access - * IN POBJECT_ATTRIBUTES attr + * IN POBJECT_ATTRIBUTES attr */ NTSTATUS WINAPI NtOpenKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) { @@ -248,7 +248,7 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i * ZwEnumerateKey [NTDLL.@] * * NOTES - * the name copied into the buffer is NOT 0-terminated + * the name copied into the buffer is NOT 0-terminated */ NTSTATUS WINAPI NtEnumerateKey( HANDLE handle, ULONG index, KEY_INFORMATION_CLASS info_class, void *info, DWORD length, DWORD *result_len ) @@ -540,7 +540,7 @@ NTSTATUS WINAPI NtSetInformationKey( * ZwSetValueKey [NTDLL.@] * * NOTES - * win95 does not care about count for REG_SZ and finds out the len by itself (js) + * win95 does not care about count for REG_SZ and finds out the len by itself (js) * NT does definitely care (aj) */ NTSTATUS WINAPI NtSetValueKey( HANDLE hkey, const UNICODE_STRING *name, ULONG TitleIndex, diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 23431cbab0d..3b96138f0b9 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -1,8 +1,8 @@ /* * NT basis DLL - * + * * This file contains the Rtl* API functions. These should be implementable. - * + * * Copyright 1996-1998 Marcus Meissner * 1999 Alex Korobka * @@ -121,7 +121,7 @@ wait: else /* one or more shared locks are in progress */ if( fWait ) goto wait; - + if( retVal == 1 ) rwl->hOwningThreadId = GetCurrentThreadId(); done: @@ -148,7 +148,7 @@ start: retVal = 1; goto done; } - + if( fWait ) { rwl->uSharedWaiters++; @@ -158,7 +158,7 @@ start: goto start; } } - else + else { if( dwWait != WAIT_OBJECT_0 ) /* otherwise RtlReleaseResource() has already done it */ rwl->iNumberActive++; @@ -189,7 +189,7 @@ wake_exclusive: } } } - else + else if( rwl->iNumberActive < 0 ) /* have a writer, possibly recursive */ { if( ++rwl->iNumberActive == 0 ) @@ -219,7 +219,7 @@ void WINAPI RtlDumpResource(LPRTL_RWLOCK rwl) { if( rwl ) { - MESSAGE("RtlDumpResource(%p):\n\tactive count = %i\n\twaiting readers = %i\n\twaiting writers = %i\n", + MESSAGE("RtlDumpResource(%p):\n\tactive count = %i\n\twaiting readers = %i\n\twaiting writers = %i\n", rwl, rwl->iNumberActive, rwl->uSharedWaiters, rwl->uExclusiveWaiters ); if( rwl->iNumberActive ) MESSAGE("\towner thread = %08x\n", rwl->hOwningThreadId ); @@ -240,7 +240,7 @@ void WINAPIV DbgPrint(LPCSTR fmt, ...) va_start(args, fmt); vsprintf(buf,fmt, args); - va_end(args); + va_end(args); MESSAGE("DbgPrint says: %s",buf); /* hmm, raise exception? */ @@ -398,7 +398,7 @@ DWORD WINAPI RtlInitializeGenericTable(void) /****************************************************************************** * RtlInitializeBitMap [NTDLL.@] - * + * */ NTSTATUS WINAPI RtlInitializeBitMap(DWORD x1,DWORD x2,DWORD x3) { @@ -408,7 +408,7 @@ NTSTATUS WINAPI RtlInitializeBitMap(DWORD x1,DWORD x2,DWORD x3) /****************************************************************************** * RtlSetBits [NTDLL.@] - * + * */ NTSTATUS WINAPI RtlSetBits(DWORD x1,DWORD x2,DWORD x3) { @@ -418,7 +418,7 @@ NTSTATUS WINAPI RtlSetBits(DWORD x1,DWORD x2,DWORD x3) /****************************************************************************** * RtlFindClearBits [NTDLL.@] - * + * */ NTSTATUS WINAPI RtlFindClearBits(DWORD x1,DWORD x2,DWORD x3) { @@ -428,7 +428,7 @@ NTSTATUS WINAPI RtlFindClearBits(DWORD x1,DWORD x2,DWORD x3) /****************************************************************************** * RtlClearBits [NTDLL.@] - * + * */ NTSTATUS WINAPI RtlClearBits(DWORD x1,DWORD x2,DWORD x3) { @@ -437,14 +437,14 @@ NTSTATUS WINAPI RtlClearBits(DWORD x1,DWORD x2,DWORD x3) } /****************************************************************************** - * RtlCopyMemory [NTDLL] - * + * RtlCopyMemory [NTDLL] + * */ #undef RtlCopyMemory VOID WINAPI RtlCopyMemory( VOID *Destination, CONST VOID *Source, SIZE_T Length ) { memcpy(Destination, Source, Length); -} +} /****************************************************************************** * RtlMoveMemory [NTDLL.@] diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index 2d026b5dc66..25eb86e2186 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -123,7 +123,7 @@ BOOL WINAPI RtlEqualSid( PSID pSid1, PSID pSid2 ) /****************************************************************************** * RtlEqualPrefixSid [NTDLL.@] */ -BOOL WINAPI RtlEqualPrefixSid (PSID pSid1, PSID pSid2) +BOOL WINAPI RtlEqualPrefixSid (PSID pSid1, PSID pSid2) { if (!RtlValidSid(pSid1) || !RtlValidSid(pSid2)) return FALSE; @@ -141,7 +141,7 @@ BOOL WINAPI RtlEqualPrefixSid (PSID pSid1, PSID pSid2) /****************************************************************************** * RtlFreeSid [NTDLL.@] */ -DWORD WINAPI RtlFreeSid(PSID pSid) +DWORD WINAPI RtlFreeSid(PSID pSid) { TRACE("(%p)\n", pSid); RtlFreeHeap( GetProcessHeap(), 0, pSid ); @@ -165,7 +165,7 @@ DWORD WINAPI RtlLengthRequiredSid(DWORD nrofsubauths) DWORD WINAPI RtlLengthSid(PSID pSid) { TRACE("sid=%p\n",pSid); - if (!pSid) return 0; + if (!pSid) return 0; return RtlLengthRequiredSid(*RtlSubAuthorityCountSid(pSid)); } @@ -279,9 +279,9 @@ RtlValidSid( PSID pSid ) * RtlCreateSecurityDescriptor [NTDLL.@] * * RETURNS: - * 0 success, + * 0 success, * STATUS_INVALID_OWNER, STATUS_PRIVILEGE_NOT_HELD, STATUS_NO_INHERITANCE, - * STATUS_NO_MEMORY + * STATUS_NO_MEMORY */ NTSTATUS WINAPI RtlCreateSecurityDescriptor( PSECURITY_DESCRIPTOR lpsd, @@ -360,7 +360,7 @@ NTSTATUS WINAPI RtlGetDaclSecurityDescriptor( } *lpbDaclDefaulted = (( SE_DACL_DEFAULTED & pSecurityDescriptor->Control ) ? 1 : 0); - + return STATUS_SUCCESS; } @@ -378,7 +378,7 @@ NTSTATUS WINAPI RtlSetDaclSecurityDescriptor ( if (lpsd->Control & SE_SELF_RELATIVE) return STATUS_INVALID_SECURITY_DESCR; - if (!daclpresent) + if (!daclpresent) { lpsd->Control &= ~SE_DACL_PRESENT; return TRUE; } @@ -421,7 +421,7 @@ NTSTATUS WINAPI RtlGetSaclSecurityDescriptor( } *lpbSaclDefaulted = (( SE_SACL_DEFAULTED & pSecurityDescriptor->Control ) ? 1 : 0); - + return STATUS_SUCCESS; } @@ -532,7 +532,7 @@ NTSTATUS WINAPI RtlGetGroupSecurityDescriptor( *GroupDefaulted = FALSE; } return STATUS_SUCCESS; -} +} /************************************************************************** * RtlMakeSelfRelativeSD [NTDLL.@] @@ -646,7 +646,7 @@ BOOL WINAPI RtlAddAccessAllowedAce( /****************************************************************************** * RtlGetAce [NTDLL.@] */ -DWORD WINAPI RtlGetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce ) +DWORD WINAPI RtlGetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce ) { FIXME("(%p,%ld,%p),stub!\n",pAcl,dwAceIndex,pAce); return 0; @@ -659,7 +659,7 @@ DWORD WINAPI RtlGetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce ) /****************************************************************************** * RtlAdjustPrivilege [NTDLL.@] */ -DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4) +DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4) { FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx),stub!\n",x1,x2,x3,x4); return 0; @@ -678,7 +678,7 @@ RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel) /****************************************************************************** * NtAccessCheck [NTDLL.@] */ -NTSTATUS WINAPI +NTSTATUS WINAPI NtAccessCheck( IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN HANDLE ClientToken, @@ -690,7 +690,7 @@ NtAccessCheck( OUT PBOOLEAN AccessStatus) { FIXME("(%p, %04x, %08lx, %p, %p, %p, %p, %p), stub\n", - SecurityDescriptor, ClientToken, DesiredAccess, GenericMapping, + SecurityDescriptor, ClientToken, DesiredAccess, GenericMapping, PrivilegeSet, ReturnLength, GrantedAccess, AccessStatus); *AccessStatus = TRUE; return STATUS_SUCCESS; @@ -703,7 +703,7 @@ NTSTATUS WINAPI NtSetSecurityObject( IN HANDLE Handle, IN SECURITY_INFORMATION SecurityInformation, - IN PSECURITY_DESCRIPTOR SecurityDescriptor) + IN PSECURITY_DESCRIPTOR SecurityDescriptor) { FIXME("0x%08x 0x%08lx %p\n", Handle, SecurityInformation, SecurityDescriptor); return STATUS_SUCCESS; @@ -720,7 +720,7 @@ NTSTATUS WINAPI RtlGetControlSecurityDescriptor( { FIXME("(%p,%p,%p),stub!\n",pSecurityDescriptor,pControl,lpdwRevision); return STATUS_SUCCESS; -} +} /****************************************************************************** * RtlConvertSidToUnicodeString (NTDLL.@) diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index addd3d2b9b5..d93ce8666e5 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -1,6 +1,6 @@ /* * i386 signal handling routines - * + * * Copyright 1999 Alexandre Julliard * * This library is free software; you can redistribute it and/or @@ -179,7 +179,7 @@ __ASM_GLOBAL_FUNC(vm86_enter, #define ESI_sig(context) ((context)->tf_esi) #define EDI_sig(context) ((context)->tf_edi) #define EBP_sig(context) ((context)->tf_ebp) - + #define CS_sig(context) ((context)->tf_cs) #define DS_sig(context) ((context)->tf_ds) #define ES_sig(context) ((context)->tf_es) @@ -259,13 +259,13 @@ typedef struct #define ESI_sig(context) ((context)->sc_esi) #define EDI_sig(context) ((context)->sc_edi) #define EBP_sig(context) ((context)->sc_ebp) - + #define CS_sig(context) ((context)->sc_cs) #define DS_sig(context) ((context)->sc_ds) #define ES_sig(context) ((context)->sc_es) #define SS_sig(context) ((context)->sc_ss) - -/* FS and GS are now in the sigcontext struct of FreeBSD, but not + +/* FS and GS are now in the sigcontext struct of FreeBSD, but not * saved by the exception handling. duh. * Actually they are in -current (have been for a while), and that * patch now finally has been MFC'd to -stable too (Nov 15 1999). @@ -291,12 +291,12 @@ typedef struct #ifndef __FreeBSD__ #define EFL_sig(context) ((context)->sc_eflags) -#else +#else #define EFL_sig(context) ((context)->sc_efl) /* FreeBSD, see i386/i386/traps.c::trap_pfault va->err kludge */ #define CR2_sig(context) ((context)->sc_err) #define TRAP_sig(context) ((context)->sc_trapno) -#endif +#endif #define EIP_sig(context) (*((unsigned long*)&(context)->sc_eip)) #define ESP_sig(context) (*((unsigned long*)&(context)->sc_esp)) @@ -316,17 +316,17 @@ typedef struct #define ESI_sig(context) ((context)->uc_mcontext.gregs[ESI]) #define EDI_sig(context) ((context)->uc_mcontext.gregs[EDI]) #define EBP_sig(context) ((context)->uc_mcontext.gregs[EBP]) - + #define CS_sig(context) ((context)->uc_mcontext.gregs[CS]) #define DS_sig(context) ((context)->uc_mcontext.gregs[DS]) #define ES_sig(context) ((context)->uc_mcontext.gregs[ES]) #define SS_sig(context) ((context)->uc_mcontext.gregs[SS]) - + #define FS_sig(context) ((context)->uc_mcontext.gregs[FS]) #define GS_sig(context) ((context)->uc_mcontext.gregs[GS]) #define EFL_sig(context) ((context)->uc_mcontext.gregs[EFL]) - + #define EIP_sig(context) ((context)->uc_mcontext.gregs[EIP]) #ifdef R_ESP #define ESP_sig(context) ((context)->uc_mcontext.gregs[R_ESP]) @@ -483,7 +483,7 @@ static void restore_vm86_context( const CONTEXT *context, struct vm86plus_struct /*********************************************************************** * save_context * - * Set the register values from a sigcontext. + * Set the register values from a sigcontext. */ static void save_context( CONTEXT *context, const SIGCONTEXT *sigcontext ) { @@ -594,7 +594,7 @@ static void restore_context( const CONTEXT *context, SIGCONTEXT *sigcontext ) /*********************************************************************** * save_fpu * - * Set the FPU context from a sigcontext. + * Set the FPU context from a sigcontext. */ inline static void save_fpu( CONTEXT *context, const SIGCONTEXT *sigcontext ) { @@ -614,7 +614,7 @@ inline static void save_fpu( CONTEXT *context, const SIGCONTEXT *sigcontext ) /*********************************************************************** * restore_fpu * - * Restore the FPU context to a sigcontext. + * Restore the FPU context to a sigcontext. */ inline static void restore_fpu( CONTEXT *context, const SIGCONTEXT *sigcontext ) { diff --git a/dlls/ntdll/signal_sparc.c b/dlls/ntdll/signal_sparc.c index d50e16d79dd..93871a8584d 100644 --- a/dlls/ntdll/signal_sparc.c +++ b/dlls/ntdll/signal_sparc.c @@ -1,6 +1,6 @@ /* * Sparc signal handling routines - * + * * Copyright 1999 Ulrich Weigand * * This library is free software; you can redistribute it and/or @@ -151,7 +151,7 @@ static void segv_handler( int signal, siginfo_t *info, ucontext_t *ucontext ) rec.NumberParameters = 2; rec.ExceptionInformation[0] = 0; /* FIXME: read/write access ? */ rec.ExceptionInformation[1] = (DWORD)info->si_addr; - + EXC_RtlRaiseException( &rec, &context ); restore_context( &context, ucontext ); } @@ -176,7 +176,7 @@ static void bus_handler( int signal, siginfo_t *info, ucontext_t *ucontext ) rec.ExceptionCode = EXCEPTION_DATATYPE_MISALIGNMENT; else rec.ExceptionCode = EXCEPTION_ACCESS_VIOLATION; - + EXC_RtlRaiseException( &rec, &context ); restore_context( &context, ucontext ); } @@ -210,7 +210,7 @@ static void ill_handler( int signal, siginfo_t *info, ucontext_t *ucontext ) rec.ExceptionCode = EXCEPTION_STACK_OVERFLOW; break; } - + save_context( &context, ucontext ); rec.ExceptionRecord = NULL; rec.ExceptionFlags = EXCEPTION_CONTINUABLE; diff --git a/dlls/ntdll/string.c b/dlls/ntdll/string.c index 3e041a0dccc..e504a0b0521 100644 --- a/dlls/ntdll/string.c +++ b/dlls/ntdll/string.c @@ -54,7 +54,7 @@ LPSTR __cdecl _strupr( LPSTR str ) /********************************************************************* * _strlwr (NTDLL.@) * - * convert a string in place to lowercase + * convert a string in place to lowercase */ LPSTR __cdecl _strlwr( LPSTR str ) { diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index ad6e4142c68..51071b32c03 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -95,7 +95,7 @@ NTSTATUS WINAPI NtQuerySemaphore( PVOID SemaphoreInformationClass, OUT PVOID SemaphoreInformation, ULONG Length, - PULONG ReturnLength) + PULONG ReturnLength) { FIXME("(0x%08x,%p,%p,0x%08lx,%p) stub!\n", SemaphoreHandle, SemaphoreInformationClass, SemaphoreInformation, Length, ReturnLength); @@ -124,7 +124,7 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, PULONG previous /* * Events */ - + /************************************************************************** * NtCreateEvent (NTDLL.@) * ZwCreateEvent (NTDLL.@) diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index 3dd48a2426d..6d69becdb22 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -1,10 +1,10 @@ /* * Conversion between Time and TimeFields * - * RtlTimeToTimeFields, RtlTimeFieldsToTime and defines are taken from ReactOS and - * adapted to wine with special permissions of the author + * RtlTimeToTimeFields, RtlTimeFieldsToTime and defines are taken from ReactOS and + * adapted to wine with special permissions of the author * Rex Jolliff (rex@lvcablemodem.com) - * + * * Copyright 1999 Juergen Schmied * * This library is free software; you can redistribute it and/or @@ -100,11 +100,11 @@ VOID WINAPI RtlTimeToTimeFields( /* Adjust the values for GMT and leap seconds */ SecondsInDay += (GMTOffset - LeapSecondCorrections); - while (SecondsInDay < 0) + while (SecondsInDay < 0) { SecondsInDay += SECSPERDAY; Days--; } - while (SecondsInDay >= SECSPERDAY) + while (SecondsInDay >= SECSPERDAY) { SecondsInDay -= SECSPERDAY; Days++; } diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 4cf86efdf06..4e8518e1f1d 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -1,6 +1,6 @@ /* * Win32 ODBC functions - * + * * Proxy ODBC driver manager. This manager delegates all ODBC calls to a real ODBC driver manager which is either: * 1) its name is defined in the environment variable LIB_ODBC_DRIVER_MANAGER * 2) if LIB_ODBC_DRIVER_MANAGER is not defined, a default library libodbc.so will be used. @@ -138,7 +138,7 @@ static PROXYHANDLE gProxyHandle = { "", "", "" -}; +}; /* What is the difference between these two (dmHandle cf READY_AND_dmHandle)? When does one use one and when the other? */ diff --git a/dlls/odbc32/proxyodbc.h b/dlls/odbc32/proxyodbc.h index 7d9e54afce3..5a750e269f3 100644 --- a/dlls/odbc32/proxyodbc.h +++ b/dlls/odbc32/proxyodbc.h @@ -46,7 +46,7 @@ typedef struct proxyhandle char driverLibName[200]; /* ODBC driver SO name */ char dmLibName[200]; /* driver manager library name */ char ServerName[200]; /* keep server name */ - char UserName[50]; /* keep username */ + char UserName[50]; /* keep username */ } PROXYHANDLE; #define /* 00 */ SQLAPI_INDEX_SQLALLOCCONNECT 0 diff --git a/dlls/ole32/antimoniker.c b/dlls/ole32/antimoniker.c index 45738b173aa..9664eb4bad0 100644 --- a/dlls/ole32/antimoniker.c +++ b/dlls/ole32/antimoniker.c @@ -36,7 +36,7 @@ typedef struct AntiMonikerImpl{ ICOM_VTABLE(IMoniker)* lpvtbl1; /* VTable relative to the IMoniker interface.*/ - /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether + /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether * two monikers are equal. That's whay IROTData interface is implemented by monikers. */ ICOM_VTABLE(IROTData)* lpvtbl2; /* VTable relative to the IROTData interface.*/ @@ -142,13 +142,13 @@ static ICOM_VTABLE(IROTData) VT_ROTDataImpl = HRESULT WINAPI AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) { ICOM_THIS(AntiMonikerImpl,iface); - + TRACE("(%p,%p,%p)\n",This,riid,ppvObject); /* Perform a sanity check on the parameters.*/ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* Initialize the return parameter */ *ppvObject = 0; @@ -165,7 +165,7 @@ HRESULT WINAPI AntiMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** /* Check that we obtained an interface.*/ if ((*ppvObject)==0) return E_NOINTERFACE; - + /* Query Interface always increases the reference count by one when it is successful */ AntiMonikerImpl_AddRef(iface); @@ -202,7 +202,7 @@ ULONG WINAPI AntiMonikerImpl_Release(IMoniker* iface) return 0; } - return This->ref;; + return This->ref; } /****************************************************************************** @@ -214,9 +214,9 @@ HRESULT WINAPI AntiMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID) if (pClassID==NULL) return E_POINTER; - + *pClassID = CLSID_AntiMoniker; - + return S_OK; } @@ -258,7 +258,7 @@ HRESULT WINAPI AntiMonikerImpl_Save(IMoniker* iface,IStream* pStm,BOOL fClearDir { DWORD constant=1; HRESULT res; - + /* data writen by this function is only a DWORD constant seted to 1 ! */ res=IStream_Write(pStm,&constant,sizeof(constant),NULL); @@ -277,7 +277,7 @@ HRESULT WINAPI AntiMonikerImpl_GetSizeMax(IMoniker* iface, return E_POINTER; /* for more details see AntiMonikerImpl_Save coments */ - + /* Normaly the sizemax must be the size of DWORD ! but I tested this function it ususlly return 16 bytes */ /* more than the number of bytes used by AntiMoniker::Save function */ pcbSize->s.LowPart = sizeof(DWORD)+16; @@ -356,7 +356,7 @@ HRESULT WINAPI AntiMonikerImpl_Reduce(IMoniker* iface, AntiMonikerImpl_AddRef(iface); *ppmkReduced=iface; - + return MK_S_REDUCED_TO_SELF; } /****************************************************************************** @@ -374,7 +374,7 @@ HRESULT WINAPI AntiMonikerImpl_ComposeWith(IMoniker* iface, return E_POINTER; *ppmkComposite=0; - + if (fOnlyIfNotGeneric) return MK_E_NEEDGENERIC; else @@ -390,7 +390,7 @@ HRESULT WINAPI AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker* if (ppenumMoniker == NULL) return E_POINTER; - + *ppenumMoniker = NULL; return S_OK; @@ -402,12 +402,12 @@ HRESULT WINAPI AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker* HRESULT WINAPI AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker) { DWORD mkSys; - + TRACE("(%p,%p)\n",iface,pmkOtherMoniker); if (pmkOtherMoniker==NULL) return S_FALSE; - + IMoniker_IsSystemMoniker(pmkOtherMoniker,&mkSys); if (mkSys==MKSYS_ANTIMONIKER) @@ -490,7 +490,7 @@ HRESULT WINAPI AntiMonikerImpl_Inverse(IMoniker* iface,IMoniker** ppmk) HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix) { DWORD mkSys; - + IMoniker_IsSystemMoniker(pmkOther,&mkSys); if(mkSys==MKSYS_ITEMMONIKER){ @@ -500,7 +500,7 @@ HRESULT WINAPI AntiMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOth *ppmkPrefix=iface; IMoniker_AddRef(iface); - + return MK_S_US; } else @@ -533,7 +533,7 @@ HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface, LPOLESTR *ppszDisplayName) { WCHAR back[]={'\\','.','.',0}; - + TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName); if (ppszDisplayName==NULL) @@ -550,7 +550,7 @@ HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface, return E_OUTOFMEMORY; strcpyW(*ppszDisplayName,back); - + return S_OK; } @@ -577,7 +577,7 @@ HRESULT WINAPI AntiMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys) if (!pwdMksys) return E_POINTER; - + (*pwdMksys)=MKSYS_ANTIMONIKER; return S_OK; @@ -614,7 +614,7 @@ ULONG WINAPI AntiMonikerROTDataImpl_AddRef(IROTData *iface) ULONG WINAPI AntiMonikerROTDataImpl_Release(IROTData* iface) { ICOM_THIS_From_IROTData(IMoniker, iface); - + TRACE("(%p)\n",iface); return AntiMonikerImpl_Release(This); @@ -640,7 +640,7 @@ HRESULT WINAPI CreateAntiMoniker(LPMONIKER * ppmk) AntiMonikerImpl* newAntiMoniker = 0; HRESULT hr = S_OK; IID riid=IID_IMoniker; - + TRACE("(%p)\n",ppmk); newAntiMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(AntiMonikerImpl)); diff --git a/dlls/ole32/bindctx.c b/dlls/ole32/bindctx.c index 8dda0991392..e66cc325c88 100644 --- a/dlls/ole32/bindctx.c +++ b/dlls/ole32/bindctx.c @@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); /* represent the first size table and it's increment block size */ -#define BLOCK_TAB_SIZE 10 +#define BLOCK_TAB_SIZE 10 #define MAX_TAB_SIZE 0xFFFFFFFF /* data structure of the BindCtx table elements */ @@ -50,7 +50,7 @@ typedef struct BindCtxObject{ typedef struct BindCtxImpl{ ICOM_VFIELD(IBindCtx); /* VTable relative to the IBindCtx interface.*/ - + ULONG ref; /* reference counter for this object */ BindCtxObject* bindCtxTable; /* this is a table in which all bounded objects are stored*/ @@ -114,7 +114,7 @@ HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppv /* Perform a sanity check on the parameters.*/ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* Initialize the return parameter.*/ *ppvObject = 0; @@ -128,7 +128,7 @@ HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx* iface,REFIID riid,void** ppv /* Check that we obtained an interface.*/ if ((*ppvObject)==0) return E_NOINTERFACE; - + /* Query Interface always increases the reference count by one when it is successful */ BindCtxImpl_AddRef(iface); @@ -167,7 +167,7 @@ ULONG WINAPI BindCtxImpl_Release(IBindCtx* iface) return 0; } - return This->ref;; + return This->ref; } @@ -235,9 +235,9 @@ HRESULT WINAPI BindCtxImpl_RegisterObjectBound(IBindCtx* iface,IUnknown* punk) if (punk==NULL) return E_POINTER; - + IUnknown_AddRef(punk); - + /* put the object in the first free element in the table */ This->bindCtxTable[lastIndex].pObj = punk; This->bindCtxTable[lastIndex].pkeyObj = NULL; @@ -275,15 +275,15 @@ HRESULT WINAPI BindCtxImpl_RevokeObjectBound(IBindCtx* iface, IUnknown* punk) /* check if the object was registred or not */ if (BindCtxImpl_GetObjectIndex(This,punk,NULL,&index)==S_FALSE) - + return MK_E_NOTBOUND; IUnknown_Release(This->bindCtxTable[index].pObj); - + /* left-shift all elements in the right side of the current revoked object */ for(j=index; jbindCtxTableLastIndex-1; j++) This->bindCtxTable[j]= This->bindCtxTable[j+1]; - + This->bindCtxTableLastIndex--; return S_OK; @@ -319,7 +319,7 @@ HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,LPBIND_OPTS2 pbindopts if (pbindopts==NULL) return E_POINTER; - + if (pbindopts->cbStruct > sizeof(BIND_OPTS2)) { WARN("invalid size\n"); @@ -363,7 +363,7 @@ HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(IBindCtx* iface,IRunningObjectT if (pprot==NULL) return E_POINTER; - + res=GetRunningObjectTable(0, pprot); return res; @@ -380,7 +380,7 @@ HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, if (punk==NULL) return E_INVALIDARG; - + IUnknown_AddRef(punk); This->bindCtxTable[This->bindCtxTableLastIndex].pObj = punk; @@ -401,7 +401,7 @@ HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey, } This->bindCtxTableLastIndex++; - + if (This->bindCtxTableLastIndex == This->bindCtxTableSize){ /* table is full ! must be resized */ This->bindCtxTableSize+=BLOCK_TAB_SIZE; /* new table size */ @@ -431,12 +431,12 @@ HRESULT WINAPI BindCtxImpl_GetObjectParam(IBindCtx* iface,LPOLESTR pszkey, IUnkn return E_POINTER; *punk=0; - + if (BindCtxImpl_GetObjectIndex(This,NULL,pszkey,&index)==S_FALSE) return E_FAIL; IUnknown_AddRef(This->bindCtxTable[index].pObj); - + *punk = This->bindCtxTable[index].pObj; return S_OK; @@ -458,11 +458,11 @@ HRESULT WINAPI BindCtxImpl_RevokeObjectParam(IBindCtx* iface,LPOLESTR ppenum) /* release the object if it's found */ IUnknown_Release(This->bindCtxTable[index].pObj); - + /* remove the object from the table with a left-shifting of all objects in the right side */ for(j=index; jbindCtxTableLastIndex-1; j++) This->bindCtxTable[j]= This->bindCtxTable[j+1]; - + This->bindCtxTableLastIndex--; return S_OK; @@ -488,7 +488,7 @@ HRESULT WINAPI BindCtxImpl_GetObjectIndex(BindCtxImpl* This, DWORD i; BYTE found=0; - + TRACE("(%p,%p,%p,%p)\n",This,punk,pszkey,index); if (punk==NULL) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 02e08ca542a..d7fdf0c07e3 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -94,7 +94,7 @@ struct OLEClipbrd ICOM_VTABLE(IDataObject)* lpvtbl1; /* IDataObject VTable */ /* - * The hidden OLE clipboard window. This window is used as the bridge between the + * The hidden OLE clipboard window. This window is used as the bridge between the * the OLE and windows clipboard API. (Windows creates one such window per process) */ HWND hWndClipboard; @@ -127,11 +127,11 @@ typedef struct OLEClipbrd OLEClipbrd; * IEnumFORMATETC implementation * DO NOT add any members before the VTables declaration! */ -typedef struct +typedef struct { /* IEnumFORMATETC VTable */ ICOM_VFIELD(IEnumFORMATETC); - + /* IEnumFORMATETC fields */ UINT posFmt; /* current enumerator position */ UINT countFmt; /* number of EnumFORMATETC's in array */ @@ -146,7 +146,7 @@ typedef struct * IUnknown implementation of the parent data object. */ IUnknown* pUnkDataObj; - + } IEnumFORMATETCImpl; typedef struct PresentationDataHeader @@ -185,39 +185,39 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( IDataObject* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( +static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( IDataObject* iface); -static ULONG WINAPI OLEClipbrd_IDataObject_Release( +static ULONG WINAPI OLEClipbrd_IDataObject_Release( IDataObject* iface); static HRESULT WINAPI OLEClipbrd_IDataObject_GetData( IDataObject* iface, - LPFORMATETC pformatetcIn, + LPFORMATETC pformatetcIn, STGMEDIUM* pmedium); static HRESULT WINAPI OLEClipbrd_IDataObject_GetDataHere( - IDataObject* iface, + IDataObject* iface, LPFORMATETC pformatetc, STGMEDIUM* pmedium); static HRESULT WINAPI OLEClipbrd_IDataObject_QueryGetData( IDataObject* iface, LPFORMATETC pformatetc); static HRESULT WINAPI OLEClipbrd_IDataObject_GetCanonicalFormatEtc( - IDataObject* iface, - LPFORMATETC pformatectIn, + IDataObject* iface, + LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut); static HRESULT WINAPI OLEClipbrd_IDataObject_SetData( IDataObject* iface, - LPFORMATETC pformatetc, - STGMEDIUM* pmedium, + LPFORMATETC pformatetc, + STGMEDIUM* pmedium, BOOL fRelease); static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc( - IDataObject* iface, + IDataObject* iface, DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc); static HRESULT WINAPI OLEClipbrd_IDataObject_DAdvise( - IDataObject* iface, - FORMATETC* pformatetc, - DWORD advf, - IAdviseSink* pAdvSink, + IDataObject* iface, + FORMATETC* pformatetc, + DWORD advf, + IAdviseSink* pAdvSink, DWORD* pdwConnection); static HRESULT WINAPI OLEClipbrd_IDataObject_DUnadvise( IDataObject* iface, @@ -278,7 +278,7 @@ static struct ICOM_VTABLE(IEnumFORMATETC) efvt = }; /* - * Name of our registered OLE clipboard window class + * Name of our registered OLE clipboard window class */ CHAR OLEClipbrd_WNDCLASS[] = "CLIPBRDWNDCLASS"; @@ -292,7 +292,7 @@ typedef struct tagClipboardWindowInfo */ /*---------------------------------------------------------------------* - * Win32 OLE clipboard API + * Win32 OLE clipboard API *---------------------------------------------------------------------*/ /*********************************************************************** @@ -303,8 +303,8 @@ typedef struct tagClipboardWindowInfo * RETURNS: * * S_OK IDataObject pointer placed on the clipboard - * CLIPBRD_E_CANT_OPEN OpenClipboard failed - * CLIPBRD_E_CANT_EMPTY EmptyClipboard failed + * CLIPBRD_E_CANT_OPEN OpenClipboard failed + * CLIPBRD_E_CANT_EMPTY EmptyClipboard failed * CLIPBRD_E_CANT_CLOSE CloseClipboard failed * CLIPBRD_E_CANT_SET SetClipboard failed */ @@ -319,9 +319,9 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) HGLOBAL hDataObject = 0; OLEClipbrd **ppDataObject; */ - + TRACE("(%p)\n", pDataObj); - + /* * Make sure we have a clipboard object */ @@ -344,7 +344,7 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) /* * Empty the current clipboard and make our window the clipboard owner - * NOTE: This will trigger a WM_DESTROYCLIPBOARD message + * NOTE: This will trigger a WM_DESTROYCLIPBOARD message */ if ( !EmptyClipboard() ) HANDLE_ERROR( CLIPBRD_E_CANT_EMPTY ); @@ -369,10 +369,10 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) } /* - * Enumerate all HGLOBAL formats supported by the source and make + * Enumerate all HGLOBAL formats supported by the source and make * those formats available using delayed rendering using SetClipboardData. - * Only global memory based data items may be made available to non-OLE - * applications via the standard Windows clipboard API. Data based on other + * Only global memory based data items may be made available to non-OLE + * applications via the standard Windows clipboard API. Data based on other * mediums(non TYMED_HGLOBAL) can only be accessed via the Ole Clipboard API. * * TODO: Do we need to additionally handle TYMED_IStorage media by copying @@ -386,7 +386,7 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) { HANDLE_ERROR( hr ); } - + while ( S_OK == IEnumFORMATETC_Next(penumFormatetc, 1, &rgelt, NULL) ) { if ( rgelt.tymed == TYMED_HGLOBAL ) @@ -395,7 +395,7 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) TRACE("(cfFormat=%d:%s)\n", rgelt.cfFormat, GetClipboardFormatNameA(rgelt.cfFormat, szFmtName, sizeof(szFmtName)-1) ? szFmtName : ""); - + SetClipboardData( rgelt.cfFormat, (HANDLE)NULL); } } @@ -404,7 +404,7 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) /* * Windows additionally creates a new "DataObject" clipboard format - * and stores in on the clipboard. We could possibly store a pointer + * and stores in on the clipboard. We could possibly store a pointer * to our internal IDataObject interface on the clipboard. I'm not * sure what the use of this is though. * Enable the code below for this functionality. @@ -415,7 +415,7 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) sizeof(OLEClipbrd *)); if (hDataObject==0) HANDLE_ERROR( E_OUTOFMEMORY ); - + ppDataObject = (OLEClipbrd**)GlobalLock(hDataObject); *ppDataObject = theOleClipboard; GlobalUnlock(hDataObject); @@ -423,7 +423,7 @@ HRESULT WINAPI OleSetClipboard(IDataObject* pDataObj) if ( !SetClipboardData( theOleClipboard->cfDataObj, hDataObject ) ) HANDLE_ERROR( CLIPBRD_E_CANT_SET ); */ - + hr = S_OK; CLEANUP: @@ -452,15 +452,15 @@ CLEANUP: /*********************************************************************** * OleGetClipboard [OLE32.105] - * Returns a pointer to our internal IDataObject which represents the conceptual - * state of the Windows clipboard. If the current clipboard already contains + * Returns a pointer to our internal IDataObject which represents the conceptual + * state of the Windows clipboard. If the current clipboard already contains * an IDataObject, our internal IDataObject will delegate to this object. */ HRESULT WINAPI OleGetClipboard(IDataObject** ppDataObj) { HRESULT hr = S_OK; TRACE("()\n"); - + /* * Make sure we have a clipboard object */ @@ -501,7 +501,7 @@ HRESULT WINAPI OleFlushClipboard() HRESULT hr = S_OK; BOOL bClipboardOpen = FALSE; IDataObject* pIDataObjectSrc = NULL; - + TRACE("()\n"); /* @@ -521,7 +521,7 @@ HRESULT WINAPI OleFlushClipboard() */ pIDataObjectSrc = theOleClipboard->pIDataObjectSrc; IDataObject_AddRef(pIDataObjectSrc); - + /* * Open the Windows clipboard */ @@ -561,9 +561,9 @@ HRESULT WINAPI OleFlushClipboard() continue; } } - + IEnumFORMATETC_Release(penumFormatetc); - + /* * Release the source data object we are holding on to */ @@ -584,7 +584,7 @@ CLEANUP: /*********************************************************************** * OleIsCurrentClipboard [OLE32.110] */ -HRESULT WINAPI OleIsCurrentClipboard ( IDataObject *pDataObject) +HRESULT WINAPI OleIsCurrentClipboard ( IDataObject *pDataObject) { TRACE("()\n"); /* @@ -600,17 +600,17 @@ HRESULT WINAPI OleIsCurrentClipboard ( IDataObject *pDataObject) /*---------------------------------------------------------------------* - * Internal implementation methods for the OLE clipboard + * Internal implementation methods for the OLE clipboard *---------------------------------------------------------------------*/ /*********************************************************************** * OLEClipbrd_Initialize() - * Initializes the OLE clipboard. + * Initializes the OLE clipboard. */ void OLEClipbrd_Initialize() { /* - * Create the clipboard if necessary + * Create the clipboard if necessary */ if ( !theOleClipboard ) { @@ -622,7 +622,7 @@ void OLEClipbrd_Initialize() /*********************************************************************** * OLEClipbrd_UnInitialize() - * Un-Initializes the OLE clipboard + * Un-Initializes the OLE clipboard */ void OLEClipbrd_UnInitialize() { @@ -649,7 +649,7 @@ static OLEClipbrd* OLEClipbrd_Construct() { OLEClipbrd* newObject = NULL; HGLOBAL hNewObject = 0; - + /* * Allocate space for the object. We use GlobalAlloc since we need * an HGLOBAL to expose our DataObject as a registered clipboard type. @@ -663,20 +663,20 @@ static OLEClipbrd* OLEClipbrd_Construct() * Lock the handle for the entire lifetime of the clipboard. */ newObject = GlobalLock(hNewObject); - + /* * Initialize the virtual function table. */ newObject->lpvtbl1 = &OLEClipbrd_IDataObject_VTable; /* - * Start with one reference count. The caller of this function + * Start with one reference count. The caller of this function * must release the interface pointer when it is done. */ newObject->ref = 1; newObject->hSelf = hNewObject; - + /* * The Ole clipboard is a singleton - save the global handle and pointer */ @@ -689,12 +689,12 @@ static OLEClipbrd* OLEClipbrd_Construct() static void OLEClipbrd_Destroy(OLEClipbrd* ptrToDestroy) { TRACE("()\n"); - + if ( !ptrToDestroy ) return; /* - * Destroy the Ole clipboard window + * Destroy the Ole clipboard window */ if ( ptrToDestroy->hWndClipboard ) OLEClipbrd_DestroyWindow(ptrToDestroy->hWndClipboard); @@ -716,15 +716,15 @@ static void OLEClipbrd_Destroy(OLEClipbrd* ptrToDestroy) /*********************************************************************** * OLEClipbrd_CreateWindow() - * Create the clipboard window + * Create the clipboard window */ static HWND OLEClipbrd_CreateWindow() { HWND hwnd = 0; WNDCLASSEXA wcex; - /* - * Register the clipboard window class if necessary + /* + * Register the clipboard window class if necessary */ ZeroMemory( &wcex, sizeof(WNDCLASSEXA)); @@ -740,7 +740,7 @@ static HWND OLEClipbrd_CreateWindow() RegisterClassExA(&wcex); /* - * Create a hidden window to receive OLE clipboard messages + * Create a hidden window to receive OLE clipboard messages */ /* @@ -750,7 +750,7 @@ static HWND OLEClipbrd_CreateWindow() * ZeroMemory( &trackerInfo, sizeof(ClipboardWindowInfo)); */ - hwnd = CreateWindowA(OLEClipbrd_WNDCLASS, + hwnd = CreateWindowA(OLEClipbrd_WNDCLASS, "ClipboardWindow", WS_POPUP | WS_CLIPSIBLINGS | WS_OVERLAPPED, CW_USEDEFAULT, CW_USEDEFAULT, @@ -769,8 +769,8 @@ static HWND OLEClipbrd_CreateWindow() */ static void OLEClipbrd_DestroyWindow(HWND hwnd) { - /* - * Destroy clipboard window and unregister its WNDCLASS + /* + * Destroy clipboard window and unregister its WNDCLASS */ DestroyWindow(hwnd); UnregisterClassA( OLEClipbrd_WNDCLASS, 0 ); @@ -778,32 +778,32 @@ static void OLEClipbrd_DestroyWindow(HWND hwnd) /*********************************************************************** * OLEClipbrd_WndProc(HWND, unsigned, WORD, LONG) - * Processes messages sent to the OLE clipboard window. - * Note that we will intercept messages in our WndProc only when data - * has been placed in the clipboard via OleSetClipboard(). + * Processes messages sent to the OLE clipboard window. + * Note that we will intercept messages in our WndProc only when data + * has been placed in the clipboard via OleSetClipboard(). * i.e. Only when OLE owns the windows clipboard. */ LRESULT CALLBACK OLEClipbrd_WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - switch (message) + switch (message) { /* - * WM_RENDERFORMAT + * WM_RENDERFORMAT * We receive this message to allow us to handle delayed rendering of - * a specific clipboard format when an application requests data in + * a specific clipboard format when an application requests data in * that format by calling GetClipboardData. - * (Recall that in OleSetClipboard, we used SetClipboardData to + * (Recall that in OleSetClipboard, we used SetClipboardData to * make all HGLOBAL formats supported by the source IDataObject * available using delayed rendering) - * On receiving this mesage we must actually render the data in the - * specified format and place it on the clipboard by calling the - * SetClipboardData function. + * On receiving this mesage we must actually render the data in the + * specified format and place it on the clipboard by calling the + * SetClipboardData function. */ case WM_RENDERFORMAT: { FORMATETC rgelt; - + ZeroMemory( &rgelt, sizeof(FORMATETC)); /* @@ -815,7 +815,7 @@ LRESULT CALLBACK OLEClipbrd_WndProc rgelt.tymed = TYMED_HGLOBAL; TRACE("(): WM_RENDERFORMAT(cfFormat=%d)\n", rgelt.cfFormat); - + /* * Render the clipboard data. * (We must have a source data object or we wouldn't be in this WndProc) @@ -839,9 +839,9 @@ LRESULT CALLBACK OLEClipbrd_WndProc { IEnumFORMATETC* penumFormatetc = NULL; FORMATETC rgelt; - + TRACE("(): WM_RENDERALLFORMATS\n"); - + /* * Render all HGLOBAL formats supported by the source into * the windows clipboard. @@ -858,15 +858,15 @@ LRESULT CALLBACK OLEClipbrd_WndProc if ( rgelt.tymed == TYMED_HGLOBAL ) { /* - * Render the clipboard data. + * Render the clipboard data. */ if ( FAILED(OLEClipbrd_RenderFormat( (IDataObject*)&(theOleClipboard->lpvtbl1), &rgelt )) ) continue; - + TRACE("(): WM_RENDERALLFORMATS(cfFormat=%d)\n", rgelt.cfFormat); } } - + IEnumFORMATETC_Release(penumFormatetc); break; @@ -1005,7 +1005,7 @@ static HRESULT OLEClipbrd_RenderFormat(IDataObject *pIDataObject, LPFORMATETC pF IStream_Release(pStream); HeapFree(GetProcessHeap(), 0, mfBits); - + GlobalUnlock(std2.u.hGlobal); ReadClassStg(std.u.pstg, &clsID); @@ -1033,10 +1033,10 @@ static HRESULT OLEClipbrd_RenderFormat(IDataObject *pIDataObject, LPFORMATETC pF /* * Put a copy of the rendered data back on the clipboard */ - + if ( !(hDup = OLEClipbrd_GlobalDupMem(hStorage)) ) HANDLE_ERROR( E_OUTOFMEMORY ); - + if ( !SetClipboardData( pFormatetc->cfFormat, hDup ) ) { GlobalFree(hDup); @@ -1044,9 +1044,9 @@ static HRESULT OLEClipbrd_RenderFormat(IDataObject *pIDataObject, LPFORMATETC pF } CLEANUP: - + ReleaseStgMedium(&std); - + return hr; } @@ -1060,26 +1060,26 @@ static HGLOBAL OLEClipbrd_GlobalDupMem( HGLOBAL hGlobalSrc ) HGLOBAL hGlobalDest; PVOID pGlobalSrc, pGlobalDest; DWORD cBytes; - + if ( !hGlobalSrc ) return 0; cBytes = GlobalSize(hGlobalSrc); if ( 0 == cBytes ) return 0; - + hGlobalDest = GlobalAlloc( GMEM_DDESHARE|GMEM_MOVEABLE, cBytes ); if ( !hGlobalDest ) return 0; - + pGlobalSrc = GlobalLock(hGlobalSrc); pGlobalDest = GlobalLock(hGlobalDest); if ( !pGlobalSrc || !pGlobalDest ) return 0; memcpy(pGlobalDest, pGlobalSrc, cBytes); - + GlobalUnlock(hGlobalSrc); GlobalUnlock(hGlobalDest); @@ -1088,7 +1088,7 @@ static HGLOBAL OLEClipbrd_GlobalDupMem( HGLOBAL hGlobalSrc ) /*---------------------------------------------------------------------* - * Implementation of the internal IDataObject interface exposed by + * Implementation of the internal IDataObject interface exposed by * the OLE clipboard. *---------------------------------------------------------------------*/ @@ -1103,18 +1103,18 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( REFIID riid, void** ppvObject) { - /* - * Declare "This" pointer + /* + * Declare "This" pointer */ ICOM_THIS(OLEClipbrd, iface); TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObject); - + /* * Perform a sanity check on the parameters. */ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ @@ -1123,11 +1123,11 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = iface; } - else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) + else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) { *ppvObject = (IDataObject*)&(This->lpvtbl1); } @@ -1136,10 +1136,10 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( WARN( "() : asking for unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } - + /* * Query Interface always increases the reference count by one when it is - * successful. + * successful. */ IUnknown_AddRef((IUnknown*)*ppvObject); @@ -1151,16 +1151,16 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( +static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( IDataObject* iface) { - /* - * Declare "This" pointer + /* + * Declare "This" pointer */ ICOM_THIS(OLEClipbrd, iface); TRACE("(%p)->(count=%lu)\n",This, This->ref); - + This->ref++; return This->ref; @@ -1171,16 +1171,16 @@ static ULONG WINAPI OLEClipbrd_IDataObject_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI OLEClipbrd_IDataObject_Release( +static ULONG WINAPI OLEClipbrd_IDataObject_Release( IDataObject* iface) { - /* - * Declare "This" pointer + /* + * Declare "This" pointer */ ICOM_THIS(OLEClipbrd, iface); TRACE("(%p)->(count=%lu)\n",This, This->ref); - + /* * Decrease the reference count on this object. */ @@ -1193,22 +1193,22 @@ static ULONG WINAPI OLEClipbrd_IDataObject_Release( { OLEClipbrd_Destroy(This); } - + return This->ref; } - + /************************************************************************ * OLEClipbrd_IDataObject_GetData (IDataObject) * - * The OLE Clipboard's implementation of this method delegates to + * The OLE Clipboard's implementation of this method delegates to * a data source if there is one or wraps around the windows clipboard * * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData( IDataObject* iface, - LPFORMATETC pformatetcIn, + LPFORMATETC pformatetcIn, STGMEDIUM* pmedium) { HANDLE hData = 0; @@ -1217,10 +1217,10 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData( LPVOID src; /* - * Declare "This" pointer + * Declare "This" pointer */ ICOM_THIS(OLEClipbrd, iface); - + TRACE("(%p,%p,%p)\n", iface, pformatetcIn, pmedium); if ( !pformatetcIn || !pmedium ) @@ -1246,7 +1246,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData( return DV_E_DVASPECT; */ - /* + /* * Otherwise, get the data from the windows clipboard using GetClipboardData */ if ( !(bClipboardOpen = OpenClipboard(theOleClipboard->hWndClipboard)) ) @@ -1273,15 +1273,15 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData( hData = hDest; } - /* + /* * Return the clipboard data in the storage medium structure */ pmedium->tymed = (hData == 0) ? TYMED_NULL : TYMED_HGLOBAL; pmedium->u.hGlobal = (HGLOBAL)hData; pmedium->pUnkForRelease = NULL; - + hr = S_OK; - + CLEANUP: /* * Close Windows clipboard @@ -1295,7 +1295,7 @@ CLEANUP: } static HRESULT WINAPI OLEClipbrd_IDataObject_GetDataHere( - IDataObject* iface, + IDataObject* iface, LPFORMATETC pformatetc, STGMEDIUM* pmedium) { @@ -1306,7 +1306,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetDataHere( /************************************************************************ * OLEClipbrd_IDataObject_QueryGetData (IDataObject) * - * The OLE Clipboard's implementation of this method delegates to + * The OLE Clipboard's implementation of this method delegates to * a data source if there is one or wraps around the windows clipboard * function IsClipboardFormatAvailable() otherwise. * @@ -1316,8 +1316,8 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryGetData( IDataObject* iface, LPFORMATETC pformatetc) { - /* - * Declare "This" pointer + /* + * Declare "This" pointer */ ICOM_THIS(OLEClipbrd, iface); @@ -1347,7 +1347,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryGetData( */ if ( pformatetc->tymed != TYMED_HGLOBAL ) return DV_E_TYMED; - + /* * Delegate to the Windows clipboard function IsClipboardFormatAvailable */ @@ -1360,8 +1360,8 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_QueryGetData( * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI OLEClipbrd_IDataObject_GetCanonicalFormatEtc( - IDataObject* iface, - LPFORMATETC pformatectIn, + IDataObject* iface, + LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut) { TRACE("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut); @@ -1376,14 +1376,14 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetCanonicalFormatEtc( /************************************************************************ * OLEClipbrd_IDataObject_SetData (IDataObject) * - * The OLE Clipboard's does not implement this method + * The OLE Clipboard's does not implement this method * * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI OLEClipbrd_IDataObject_SetData( IDataObject* iface, - LPFORMATETC pformatetc, - STGMEDIUM* pmedium, + LPFORMATETC pformatetc, + STGMEDIUM* pmedium, BOOL fRelease) { TRACE("\n"); @@ -1405,9 +1405,9 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc( int cfmt, i; UINT format; BOOL bClipboardOpen; - - /* - * Declare "This" pointer + + /* + * Declare "This" pointer */ ICOM_THIS(OLEClipbrd, iface); @@ -1460,7 +1460,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc( ERR("EnumClipboardFormats failed to return format!\n"); HANDLE_ERROR( E_FAIL ); } - + /* Init the FORMATETC struct */ afmt[i].cfFormat = format; afmt[i].ptd = NULL; @@ -1479,16 +1479,16 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc( if (FAILED( hr = IEnumFORMATETC_AddRef(*ppenumFormatEtc))) HANDLE_ERROR( hr ); - + hr = S_OK; - + CLEANUP: /* * Free the array of FORMATETC's */ if (afmt) HeapFree(GetProcessHeap(), 0, afmt); - + /* * Close Windows clipboard */ @@ -1501,15 +1501,15 @@ CLEANUP: /************************************************************************ * OLEClipbrd_IDataObject_DAdvise (IDataObject) * - * The OLE Clipboard's does not implement this method + * The OLE Clipboard's does not implement this method * * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI OLEClipbrd_IDataObject_DAdvise( - IDataObject* iface, - FORMATETC* pformatetc, - DWORD advf, - IAdviseSink* pAdvSink, + IDataObject* iface, + FORMATETC* pformatetc, + DWORD advf, + IAdviseSink* pAdvSink, DWORD* pdwConnection) { TRACE("\n"); @@ -1519,7 +1519,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_DAdvise( /************************************************************************ * OLEClipbrd_IDataObject_DUnadvise (IDataObject) * - * The OLE Clipboard's does not implement this method + * The OLE Clipboard's does not implement this method * * See Windows documentation for more details on IDataObject methods. */ @@ -1566,27 +1566,27 @@ LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORMATETC a IEnumFORMATETCImpl* ef; DWORD size=cfmt * sizeof(FORMATETC); LPMALLOC pIMalloc; - + ef = (IEnumFORMATETCImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumFORMATETCImpl)); if (!ef) return NULL; - + ef->ref = 0; ICOM_VTBL(ef) = &efvt; ef->pUnkDataObj = pUnkDataObj; - + ef->posFmt = 0; ef->countFmt = cfmt; if (FAILED(CoGetMalloc(MEMCTX_TASK, &pIMalloc))) return NULL; ef->pFmt = (LPFORMATETC)IMalloc_Alloc(pIMalloc, size); IMalloc_Release(pIMalloc); - + if (ef->pFmt) memcpy(ef->pFmt, afmt, size); - + TRACE("(%p)->()\n",ef); return (LPENUMFORMATETC)ef; } @@ -1608,9 +1608,9 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_QueryInterface * Since enumerators are separate objects from the parent data object * we only need to support the IUnknown and IEnumFORMATETC interfaces */ - + *ppvObj = NULL; - + if(IsEqualIID(riid, &IID_IUnknown)) { *ppvObj = This; @@ -1618,15 +1618,15 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_QueryInterface else if(IsEqualIID(riid, &IID_IEnumFORMATETC)) { *ppvObj = (IDataObject*)This; - } - + } + if(*ppvObj) { IEnumFORMATETC_AddRef((IEnumFORMATETC*)*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } - + TRACE("-- Interface: E_NOINTERFACE\n"); return E_NOINTERFACE; } @@ -1647,7 +1647,7 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_AddRef(LPENUMFORMATETC iface) if (This->pUnkDataObj) IUnknown_AddRef(This->pUnkDataObj); - + return ++(This->ref); } @@ -1665,8 +1665,8 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_Release(LPENUMFORMATETC iface) if (This->pUnkDataObj) IUnknown_Release(This->pUnkDataObj); /* Release parent data object */ - - if (!--(This->ref)) + + if (!--(This->ref)) { TRACE("() - destroying IEnumFORMATETC(%p)\n",This); if (SUCCEEDED(CoGetMalloc(MEMCTX_TASK, &pIMalloc))) @@ -1674,7 +1674,7 @@ static ULONG WINAPI OLEClipbrd_IEnumFORMATETC_Release(LPENUMFORMATETC iface) IMalloc_Free(pIMalloc, This->pFmt); IMalloc_Release(pIMalloc); } - + HeapFree(GetProcessHeap(),0,This); return 0; } @@ -1693,9 +1693,9 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Next ICOM_THIS(IEnumFORMATETCImpl,iface); UINT cfetch; HRESULT hres = S_FALSE; - + TRACE("(%p)->(pos=%u)\n", This, This->posFmt); - + if (This->posFmt < This->countFmt) { cfetch = This->countFmt - This->posFmt; @@ -1704,7 +1704,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Next cfetch = celt; hres = S_OK; } - + memcpy(rgelt, &This->pFmt[This->posFmt], cfetch * sizeof(FORMATETC)); This->posFmt += cfetch; } @@ -1712,12 +1712,12 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Next { cfetch = 0; } - + if (pceltFethed) { *pceltFethed = cfetch; } - + return hres; } @@ -1730,7 +1730,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Skip(LPENUMFORMATETC iface, ULON { ICOM_THIS(IEnumFORMATETCImpl,iface); TRACE("(%p)->(num=%lu)\n", This, celt); - + This->posFmt += celt; if (This->posFmt > This->countFmt) { @@ -1749,7 +1749,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Reset(LPENUMFORMATETC iface) { ICOM_THIS(IEnumFORMATETCImpl,iface); TRACE("(%p)->()\n", This); - + This->posFmt = 0; return S_OK; } @@ -1764,7 +1764,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Clone { ICOM_THIS(IEnumFORMATETCImpl,iface); HRESULT hr = S_OK; - + TRACE("(%p)->(ppenum=%p)\n", This, ppenum); if ( !ppenum ) @@ -1776,7 +1776,7 @@ static HRESULT WINAPI OLEClipbrd_IEnumFORMATETC_Clone if (FAILED( hr = IEnumFORMATETC_AddRef(*ppenum))) return ( hr ); - + return (*ppenum) ? S_OK : E_OUTOFMEMORY; } diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index dc716ace643..557e8d21a49 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -1297,7 +1297,7 @@ end: * CoGetClassObject [COMPOBJ.7] * CoGetClassObject [OLE32.16] * - * FIXME. If request allows of several options and there is a failure + * FIXME. If request allows of several options and there is a failure * with one (other than not being registered) do we try the * others or return failure? (E.g. inprocess is registered but * the DLL is not found but the server version works) @@ -1382,7 +1382,7 @@ HRESULT WINAPI CoGetClassObject( return DllGetClassObject(rclsid, iid, ppv); } } - + /* Next try out of process */ if (CLSCTX_LOCAL_SERVER & dwClsContext) diff --git a/dlls/ole32/compositemoniker.c b/dlls/ole32/compositemoniker.c index 90aa77f4aaa..a2878c8b8a7 100644 --- a/dlls/ole32/compositemoniker.c +++ b/dlls/ole32/compositemoniker.c @@ -39,8 +39,8 @@ typedef struct CompositeMonikerImpl{ ICOM_VTABLE(IMoniker)* lpvtbl1; /* VTable relative to the IMoniker interface.*/ - /* The ROT (RunningObjectTable implementation) uses the IROTData - * interface to test whether two monikers are equal. That's why IROTData + /* The ROT (RunningObjectTable implementation) uses the IROTData + * interface to test whether two monikers are equal. That's why IROTData * interface is implemented by monikers. */ ICOM_VTABLE(IROTData)* lpvtbl2; /* VTable relative to the IROTData interface.*/ @@ -200,13 +200,13 @@ static ICOM_VTABLE(IEnumMoniker) VT_EnumMonikerImpl = HRESULT WINAPI CompositeMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) { ICOM_THIS(CompositeMonikerImpl,iface); - + TRACE("(%p,%p,%p)\n",This,riid,ppvObject); /* Perform a sanity check on the parameters.*/ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* Initialize the return parameter */ *ppvObject = 0; @@ -249,7 +249,7 @@ ULONG WINAPI CompositeMonikerImpl_Release(IMoniker* iface) { ICOM_THIS(CompositeMonikerImpl,iface); ULONG i; - + TRACE("(%p)\n",This); This->ref--; @@ -260,12 +260,12 @@ ULONG WINAPI CompositeMonikerImpl_Release(IMoniker* iface) /* release all the components before destroying this object */ for (i=0;itabLastIndex;i++) IMoniker_Release(This->tabMoniker[i]); - + CompositeMonikerImpl_Destroy(This); return 0; } - return This->ref;; + return This->ref; } /****************************************************************************** @@ -277,9 +277,9 @@ HRESULT WINAPI CompositeMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID) if (pClassID==NULL) return E_POINTER; - + *pClassID = CLSID_CompositeMoniker; - + return S_OK; } @@ -306,8 +306,8 @@ HRESULT WINAPI CompositeMonikerImpl_Load(IMoniker* iface,IStream* pStm) DWORD constant; CLSID clsid; WCHAR string[1]={0}; - - ICOM_THIS(CompositeMonikerImpl,iface); + + ICOM_THIS(CompositeMonikerImpl,iface); TRACE("(%p,%p)\n",iface,pStm); @@ -365,7 +365,7 @@ HRESULT WINAPI CompositeMonikerImpl_Load(IMoniker* iface,IStream* pStm) /* resize the table if needed */ if (++This->tabLastIndex==This->tabSize){ - + This->tabSize+=BLOCK_TAB_SIZE; This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker)); @@ -386,13 +386,13 @@ HRESULT WINAPI CompositeMonikerImpl_Save(IMoniker* iface,IStream* pStm,BOOL fCle IEnumMoniker *enumMk; IMoniker *pmk; DWORD constant=3; - + TRACE("(%p,%p,%d)\n",iface,pStm,fClearDirty); - /* This function calls OleSaveToStream function for each moniker within + /* This function calls OleSaveToStream function for each moniker within * this object. - * When I tested this function in windows, I usually found this constant - * at the beginning of the stream. I don't known why (there's no + * When I tested this function in windows, I usually found this constant + * at the beginning of the stream. I don't known why (there's no * indication in the specification) ! */ res=IStream_Write(pStm,&constant,sizeof(constant),NULL); @@ -426,7 +426,7 @@ HRESULT WINAPI CompositeMonikerImpl_GetSizeMax(IMoniker* iface,ULARGE_INTEGER* p IMoniker *pmk; ULARGE_INTEGER ptmpSize; - /* The sizeMax of this object is calculated by calling GetSizeMax on + /* The sizeMax of this object is calculated by calling GetSizeMax on * each moniker within this object then summing all returned values */ @@ -464,7 +464,7 @@ HRESULT WINAPI CompositeMonikerImpl_Construct(CompositeMonikerImpl* This,LPMONIK IEnumMoniker *enumMoniker; IMoniker *tempMk; HRESULT res; - + TRACE("(%p,%p,%p)\n",This,pmkFirst,pmkRest); /* Initialize the virtual function table. */ @@ -490,12 +490,12 @@ HRESULT WINAPI CompositeMonikerImpl_Construct(CompositeMonikerImpl* This,LPMONIK else{ IMoniker_Enum(pmkFirst,TRUE,&enumMoniker); - + while(IEnumMoniker_Next(enumMoniker,1,&This->tabMoniker[This->tabLastIndex],NULL)==S_OK){ if (++This->tabLastIndex==This->tabSize){ - + This->tabSize+=BLOCK_TAB_SIZE; This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker)); @@ -510,14 +510,14 @@ HRESULT WINAPI CompositeMonikerImpl_Construct(CompositeMonikerImpl* This,LPMONIK /* put the rest moniker contents after the first one and make simplification if needed */ IMoniker_IsSystemMoniker(pmkRest,&mkSys); - + if (mkSys!=MKSYS_GENERICCOMPOSITE){ /* add a simple moniker to the moniker table */ res=IMoniker_ComposeWith(This->tabMoniker[This->tabLastIndex-1],pmkRest,TRUE,&tempMk); - if (res==MK_E_NEEDGENERIC){ + if (res==MK_E_NEEDGENERIC){ /* there's no simplification in this case */ This->tabMoniker[This->tabLastIndex]=pmkRest; @@ -526,7 +526,7 @@ HRESULT WINAPI CompositeMonikerImpl_Construct(CompositeMonikerImpl* This,LPMONIK IMoniker_AddRef(pmkRest); } - else if (tempMk==NULL){ + else if (tempMk==NULL){ /* we have an antimoniker after a simple moniker so we can make a simplification in this case */ IMoniker_Release(This->tabMoniker[This->tabLastIndex-1]); @@ -544,7 +544,7 @@ HRESULT WINAPI CompositeMonikerImpl_Construct(CompositeMonikerImpl* This,LPMONIK /* resize tabMoniker if needed */ if (This->tabLastIndex==This->tabSize){ - + This->tabSize+=BLOCK_TAB_SIZE; This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker)); @@ -555,8 +555,8 @@ HRESULT WINAPI CompositeMonikerImpl_Construct(CompositeMonikerImpl* This,LPMONIK } else{ - /* add a composite moniker to the moniker table (do the same thing - * for each moniker within the composite moniker as a simple moniker + /* add a composite moniker to the moniker table (do the same thing + * for each moniker within the composite moniker as a simple moniker * (see above for how to add a simple moniker case) ) */ IMoniker_Enum(pmkRest,TRUE,&enumMoniker); @@ -583,7 +583,7 @@ HRESULT WINAPI CompositeMonikerImpl_Construct(CompositeMonikerImpl* This,LPMONIK } if (This->tabLastIndex==This->tabSize){ - + This->tabSize+=BLOCK_TAB_SIZE; This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker)); @@ -626,12 +626,12 @@ HRESULT WINAPI CompositeMonikerImpl_BindToObject(IMoniker* iface, IRunningObjectTable *prot; IMoniker *tempMk,*antiMk,*mostRigthMk; IEnumMoniker *enumMoniker; - + TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); if (ppvResult==NULL) return E_POINTER; - + *ppvResult=0; /* If pmkToLeft is NULL, this method looks for the moniker in the ROT, and if found, queries the retrieved */ /* object for the requested interface pointer. */ @@ -655,11 +655,11 @@ HRESULT WINAPI CompositeMonikerImpl_BindToObject(IMoniker* iface, IMoniker_Enum(iface,FALSE,&enumMoniker); IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL); IEnumMoniker_Release(enumMoniker); - + res=CreateAntiMoniker(&antiMk); res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); IMoniker_Release(antiMk); - + res=CompositeMonikerImpl_BindToObject(mostRigthMk,pbc,tempMk,riid,ppvResult); IMoniker_Release(tempMk); @@ -690,15 +690,15 @@ HRESULT WINAPI CompositeMonikerImpl_BindToStorage(IMoniker* iface, /* passing the rest of the composite as the pmkToLeft parameter for that call. */ if (pmkToLeft!=NULL){ - + IMoniker_Enum(iface,FALSE,&enumMoniker); IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL); IEnumMoniker_Release(enumMoniker); - + res=CreateAntiMoniker(&antiMk); res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); IMoniker_Release(antiMk); - + res=CompositeMonikerImpl_BindToStorage(mostRigthMk,pbc,tempMk,riid,ppvResult); IMoniker_Release(tempMk); @@ -736,7 +736,7 @@ HRESULT WINAPI CompositeMonikerImpl_Reduce(IMoniker* iface, IMoniker_Enum(iface,FALSE,&enumMoniker); IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL); IEnumMoniker_Release(enumMoniker); - + res=CreateAntiMoniker(&antiMk); res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); IMoniker_Release(antiMk); @@ -753,7 +753,7 @@ HRESULT WINAPI CompositeMonikerImpl_Reduce(IMoniker* iface, IMoniker_Enum(iface,FALSE,&enumMoniker); IEnumMoniker_Next(enumMoniker,1,&mostRigthMk,NULL); IEnumMoniker_Release(enumMoniker); - + res=CreateAntiMoniker(&antiMk); res=IMoniker_ComposeWith(iface,antiMk,0,&tempMk); IMoniker_Release(antiMk); @@ -796,10 +796,10 @@ HRESULT WINAPI CompositeMonikerImpl_ComposeWith(IMoniker* iface, /* If fOnlyIfNotGeneric is TRUE, this method sets *pmkComposite to NULL and returns MK_E_NEEDGENERIC; */ /* otherwise, the method returns the result of combining the two monikers by calling the */ /* CreateGenericComposite function */ - + if (fOnlyIfNotGeneric) return MK_E_NEEDGENERIC; - + return CreateGenericComposite(iface,pmkRight,ppmkComposite); } @@ -814,7 +814,7 @@ HRESULT WINAPI CompositeMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMon if (ppenumMoniker == NULL) return E_POINTER; - + return EnumMonikerImpl_CreateEnumMoniker(This->tabMoniker,This->tabLastIndex,0,fForward,ppenumMoniker); } @@ -826,7 +826,7 @@ HRESULT WINAPI CompositeMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMo IEnumMoniker *enumMoniker1,*enumMoniker2; IMoniker *tempMk1,*tempMk2; HRESULT res1,res2,res; - + TRACE("(%p,%p)\n",iface,pmkOtherMoniker); if (pmkOtherMoniker==NULL) @@ -838,14 +838,14 @@ HRESULT WINAPI CompositeMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMo if (enumMoniker1==NULL) return S_FALSE; - + IMoniker_Enum(iface,TRUE,&enumMoniker2); while(1){ res1=IEnumMoniker_Next(enumMoniker1,1,&tempMk1,NULL); res2=IEnumMoniker_Next(enumMoniker2,1,&tempMk2,NULL); - + if((res1==S_OK)&&(res2==S_OK)){ if(IMoniker_IsEqual(tempMk1,tempMk2)==S_FALSE){ @@ -915,7 +915,7 @@ HRESULT WINAPI CompositeMonikerImpl_IsRunning(IMoniker* iface, else /* If pmkToLeft is NULL, this method returns S_OK if pmkNewlyRunning is non-NULL and is equal */ /* to this moniker */ - + if (pmkNewlyRunning!=NULL) if (IMoniker_IsEqual(iface,pmkNewlyRunning)==S_OK) @@ -933,7 +933,7 @@ HRESULT WINAPI CompositeMonikerImpl_IsRunning(IMoniker* iface, /* the moniker is running. If so, the method returns S_OK; otherwise, it recursively calls */ /* IMoniker::IsRunning on the rightmost component of the composite, passing the remainder of */ /* the composite as the pmkToLeft parameter for that call. */ - + res=IBindCtx_GetRunningObjectTable(pbc,&rot); if (FAILED(res)) @@ -977,7 +977,7 @@ HRESULT WINAPI CompositeMonikerImpl_GetTimeOfLastChange(IMoniker* iface, HRESULT res; IMoniker *tempMk,*antiMk,*mostRigthMk; IEnumMoniker *enumMoniker; - + TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pCompositeTime); if (pCompositeTime==NULL) @@ -1074,19 +1074,19 @@ HRESULT WINAPI CompositeMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* p IMoniker *tempMk1,*tempMk2,*mostLeftMk1,*mostLeftMk2; IEnumMoniker *enumMoniker1,*enumMoniker2; ULONG i,nbCommonMk=0; - + /* If the other moniker is a composite, this method compares the components of each composite from left */ /* to right. The returned common prefix moniker might also be a composite moniker, depending on how many */ /* of the leftmost components were common to both monikers. */ if (ppmkPrefix==NULL) return E_POINTER; - + *ppmkPrefix=0; if (pmkOther==NULL) return MK_E_NOPREFIX; - + IMoniker_IsSystemMoniker(pmkOther,&mkSys); if((mkSys==MKSYS_GENERICCOMPOSITE)){ @@ -1150,7 +1150,7 @@ HRESULT WINAPI CompositeMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* p CreateGenericComposite(tempMk1,tempMk2,ppmkPrefix); IMoniker_Release(tempMk1); IMoniker_Release(tempMk2); - + /* compose all common monikers in a composite moniker */ for(i=0;iref==0){ - + for(i=0;itabSize;i++) IMoniker_Release(This->tabMoniker[i]); @@ -1550,7 +1550,7 @@ ULONG WINAPI EnumMonikerImpl_Release(IEnumMoniker* iface) return 0; } - return This->ref;; + return This->ref; } /****************************************************************************** @@ -1568,7 +1568,7 @@ HRESULT WINAPI EnumMonikerImpl_Next(IEnumMoniker* iface,ULONG celt, IMoniker** r if (pceltFethed!=NULL) *pceltFethed= i; - + if (i==celt) return S_OK; else @@ -1586,7 +1586,7 @@ HRESULT WINAPI EnumMonikerImpl_Skip(IEnumMoniker* iface,ULONG celt){ return S_FALSE; This->currentPos+=celt; - + return S_OK; } @@ -1632,7 +1632,7 @@ HRESULT WINAPI EnumMonikerImpl_CreateEnumMoniker(IMoniker** tabMoniker, if (currentPos > tabSize) return E_INVALIDARG; - + /* Initialize the virtual function table. */ ICOM_VTBL(newEnumMoniker) = &VT_EnumMonikerImpl; newEnumMoniker->ref = 0; @@ -1675,7 +1675,7 @@ HRESULT WINAPI CreateGenericComposite(LPMONIKER pmkFirst, LPMONIKER pmkRest, LPM if (ppmkComposite==NULL) return E_POINTER; - + *ppmkComposite=0; if (pmkFirst==NULL && pmkRest!=NULL){ diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c index 9a44559dead..86ea590cb51 100644 --- a/dlls/ole32/datacache.c +++ b/dlls/ole32/datacache.c @@ -30,17 +30,17 @@ * NOTES * - This implementation of the datacache will let your application * load documents that have embedded OLE objects in them and it will - * also retrieve the metafile representation of those objects. + * also retrieve the metafile representation of those objects. * - This implementation of the datacache will also allow your * application to save new documents with OLE objects in them. - * - The main thing that it doesn't do is allow you to activate + * - The main thing that it doesn't do is allow you to activate * or modify the OLE objects in any way. * - I haven't found any good documentation on the real usage of * the streams created by the data cache. In particular, How to * determine what the XXX stands for in the stream name * "\002OlePresXXX". It appears to just be a counter. * - Also, I don't know the real content of the presentation stream - * header. I was able to figure-out where the extent of the object + * header. I was able to figure-out where the extent of the object * was stored and the aspect, but that's about it. */ #include @@ -94,10 +94,10 @@ struct DataCache /* * List all interface VTables here */ - ICOM_VTABLE(IDataObject)* lpvtbl1; + ICOM_VTABLE(IDataObject)* lpvtbl1; ICOM_VTABLE(IUnknown)* lpvtbl2; ICOM_VTABLE(IPersistStorage)* lpvtbl3; - ICOM_VTABLE(IViewObject2)* lpvtbl4; + ICOM_VTABLE(IViewObject2)* lpvtbl4; ICOM_VTABLE(IOleCache2)* lpvtbl5; ICOM_VTABLE(IOleCacheControl)* lpvtbl6; @@ -132,17 +132,17 @@ struct DataCache typedef struct DataCache DataCache; /* - * Here, I define utility macros to help with the casting of the + * Here, I define utility macros to help with the casting of the * "this" parameter. * There is a version to accomodate all of the VTables implemented * by this object. */ #define _ICOM_THIS_From_IDataObject(class,name) class* this = (class*)name; -#define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*)); -#define _ICOM_THIS_From_IPersistStorage(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)); -#define _ICOM_THIS_From_IViewObject2(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)); -#define _ICOM_THIS_From_IOleCache2(class, name) class* this = (class*)(((char*)name)-4*sizeof(void*)); -#define _ICOM_THIS_From_IOleCacheControl(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*)); +#define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*)); +#define _ICOM_THIS_From_IPersistStorage(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)); +#define _ICOM_THIS_From_IViewObject2(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)); +#define _ICOM_THIS_From_IOleCache2(class, name) class* this = (class*)(((char*)name)-4*sizeof(void*)); +#define _ICOM_THIS_From_IOleCacheControl(class, name) class* this = (class*)(((char*)name)-5*sizeof(void*)); /* * Prototypes for the methods of the DataCache class. @@ -170,9 +170,9 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface( IUnknown* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DataCache_NDIUnknown_AddRef( +static ULONG WINAPI DataCache_NDIUnknown_AddRef( IUnknown* iface); -static ULONG WINAPI DataCache_NDIUnknown_Release( +static ULONG WINAPI DataCache_NDIUnknown_Release( IUnknown* iface); /* @@ -183,39 +183,39 @@ static HRESULT WINAPI DataCache_IDataObject_QueryInterface( IDataObject* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DataCache_IDataObject_AddRef( +static ULONG WINAPI DataCache_IDataObject_AddRef( IDataObject* iface); -static ULONG WINAPI DataCache_IDataObject_Release( +static ULONG WINAPI DataCache_IDataObject_Release( IDataObject* iface); static HRESULT WINAPI DataCache_GetData( IDataObject* iface, - LPFORMATETC pformatetcIn, + LPFORMATETC pformatetcIn, STGMEDIUM* pmedium); static HRESULT WINAPI DataCache_GetDataHere( - IDataObject* iface, + IDataObject* iface, LPFORMATETC pformatetc, STGMEDIUM* pmedium); static HRESULT WINAPI DataCache_QueryGetData( IDataObject* iface, LPFORMATETC pformatetc); static HRESULT WINAPI DataCache_GetCanonicalFormatEtc( - IDataObject* iface, - LPFORMATETC pformatectIn, + IDataObject* iface, + LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut); static HRESULT WINAPI DataCache_IDataObject_SetData( IDataObject* iface, - LPFORMATETC pformatetc, - STGMEDIUM* pmedium, + LPFORMATETC pformatetc, + STGMEDIUM* pmedium, BOOL fRelease); static HRESULT WINAPI DataCache_EnumFormatEtc( - IDataObject* iface, + IDataObject* iface, DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc); static HRESULT WINAPI DataCache_DAdvise( - IDataObject* iface, - FORMATETC* pformatetc, - DWORD advf, - IAdviseSink* pAdvSink, + IDataObject* iface, + FORMATETC* pformatetc, + DWORD advf, + IAdviseSink* pAdvSink, DWORD* pdwConnection); static HRESULT WINAPI DataCache_DUnadvise( IDataObject* iface, @@ -232,27 +232,27 @@ static HRESULT WINAPI DataCache_IPersistStorage_QueryInterface( IPersistStorage* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DataCache_IPersistStorage_AddRef( +static ULONG WINAPI DataCache_IPersistStorage_AddRef( IPersistStorage* iface); -static ULONG WINAPI DataCache_IPersistStorage_Release( +static ULONG WINAPI DataCache_IPersistStorage_Release( IPersistStorage* iface); -static HRESULT WINAPI DataCache_GetClassID( +static HRESULT WINAPI DataCache_GetClassID( IPersistStorage* iface, CLSID* pClassID); -static HRESULT WINAPI DataCache_IsDirty( +static HRESULT WINAPI DataCache_IsDirty( IPersistStorage* iface); -static HRESULT WINAPI DataCache_InitNew( - IPersistStorage* iface, - IStorage* pStg); -static HRESULT WINAPI DataCache_Load( +static HRESULT WINAPI DataCache_InitNew( IPersistStorage* iface, IStorage* pStg); -static HRESULT WINAPI DataCache_Save( +static HRESULT WINAPI DataCache_Load( IPersistStorage* iface, - IStorage* pStg, + IStorage* pStg); +static HRESULT WINAPI DataCache_Save( + IPersistStorage* iface, + IStorage* pStg, BOOL fSameAsLoad); -static HRESULT WINAPI DataCache_SaveCompleted( - IPersistStorage* iface, +static HRESULT WINAPI DataCache_SaveCompleted( + IPersistStorage* iface, IStorage* pStgNew); static HRESULT WINAPI DataCache_HandsOffStorage( IPersistStorage* iface); @@ -265,54 +265,54 @@ static HRESULT WINAPI DataCache_IViewObject2_QueryInterface( IViewObject2* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DataCache_IViewObject2_AddRef( +static ULONG WINAPI DataCache_IViewObject2_AddRef( IViewObject2* iface); -static ULONG WINAPI DataCache_IViewObject2_Release( +static ULONG WINAPI DataCache_IViewObject2_Release( IViewObject2* iface); static HRESULT WINAPI DataCache_Draw( IViewObject2* iface, DWORD dwDrawAspect, LONG lindex, void* pvAspect, - DVTARGETDEVICE* ptd, - HDC hdcTargetDev, + DVTARGETDEVICE* ptd, + HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, IVO_ContCallback pfnContinue, DWORD dwContinue); static HRESULT WINAPI DataCache_GetColorSet( - IViewObject2* iface, - DWORD dwDrawAspect, - LONG lindex, - void* pvAspect, - DVTARGETDEVICE* ptd, - HDC hicTargetDevice, + IViewObject2* iface, + DWORD dwDrawAspect, + LONG lindex, + void* pvAspect, + DVTARGETDEVICE* ptd, + HDC hicTargetDevice, LOGPALETTE** ppColorSet); static HRESULT WINAPI DataCache_Freeze( IViewObject2* iface, DWORD dwDrawAspect, LONG lindex, - void* pvAspect, + void* pvAspect, DWORD* pdwFreeze); static HRESULT WINAPI DataCache_Unfreeze( IViewObject2* iface, DWORD dwFreeze); static HRESULT WINAPI DataCache_SetAdvise( IViewObject2* iface, - DWORD aspects, - DWORD advf, + DWORD aspects, + DWORD advf, IAdviseSink* pAdvSink); static HRESULT WINAPI DataCache_GetAdvise( - IViewObject2* iface, - DWORD* pAspects, - DWORD* pAdvf, + IViewObject2* iface, + DWORD* pAspects, + DWORD* pAdvf, IAdviseSink** ppAdvSink); static HRESULT WINAPI DataCache_GetExtent( - IViewObject2* iface, - DWORD dwDrawAspect, - LONG lindex, - DVTARGETDEVICE* ptd, + IViewObject2* iface, + DWORD dwDrawAspect, + LONG lindex, + DVTARGETDEVICE* ptd, LPSIZEL lpsizel); /* @@ -323,9 +323,9 @@ static HRESULT WINAPI DataCache_IOleCache2_QueryInterface( IOleCache2* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DataCache_IOleCache2_AddRef( +static ULONG WINAPI DataCache_IOleCache2_AddRef( IOleCache2* iface); -static ULONG WINAPI DataCache_IOleCache2_Release( +static ULONG WINAPI DataCache_IOleCache2_Release( IOleCache2* iface); static HRESULT WINAPI DataCache_Cache( IOleCache2* iface, @@ -348,7 +348,7 @@ static HRESULT WINAPI DataCache_IOleCache2_SetData( BOOL fRelease); static HRESULT WINAPI DataCache_UpdateCache( IOleCache2* iface, - LPDATAOBJECT pDataObject, + LPDATAOBJECT pDataObject, DWORD grfUpdf, LPVOID pReserved); static HRESULT WINAPI DataCache_DiscardCache( @@ -363,9 +363,9 @@ static HRESULT WINAPI DataCache_IOleCacheControl_QueryInterface( IOleCacheControl* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DataCache_IOleCacheControl_AddRef( +static ULONG WINAPI DataCache_IOleCacheControl_AddRef( IOleCacheControl* iface); -static ULONG WINAPI DataCache_IOleCacheControl_Release( +static ULONG WINAPI DataCache_IOleCacheControl_Release( IOleCacheControl* iface); static HRESULT WINAPI DataCache_OnRun( IOleCacheControl* iface, @@ -460,9 +460,9 @@ static ICOM_VTABLE(IOleCacheControl) DataCache_IOleCacheControl_VTable = * CreateDataCache [OLE32.54] */ HRESULT WINAPI CreateDataCache( - LPUNKNOWN pUnkOuter, - REFCLSID rclsid, - REFIID riid, + LPUNKNOWN pUnkOuter, + REFCLSID rclsid, + REFIID riid, LPVOID* ppvObj) { DataCache* newCache = NULL; @@ -484,14 +484,14 @@ HRESULT WINAPI CreateDataCache( * This is necessary because it's the only time the non-delegating * IUnknown pointer can be returned to the outside. */ - if ( (pUnkOuter!=NULL) && + if ( (pUnkOuter!=NULL) && (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) ) return CLASS_E_NOAGGREGATION; /* * Try to construct a new instance of the class. */ - newCache = DataCache_Construct(rclsid, + newCache = DataCache_Construct(rclsid, pUnkOuter); if (newCache == 0) @@ -527,7 +527,7 @@ static DataCache* DataCache_Construct( if (newObject==0) return newObject; - + /* * Initialize the virtual function table. */ @@ -537,16 +537,16 @@ static DataCache* DataCache_Construct( newObject->lpvtbl4 = &DataCache_IViewObject2_VTable; newObject->lpvtbl5 = &DataCache_IOleCache2_VTable; newObject->lpvtbl6 = &DataCache_IOleCacheControl_VTable; - + /* - * Start with one reference count. The caller of this function + * Start with one reference count. The caller of this function * must release the interface pointer when it is done. */ newObject->ref = 1; /* * Initialize the outer unknown - * We don't keep a reference on the outer unknown since, the way + * We don't keep a reference on the outer unknown since, the way * aggregation works, our lifetime is at least as large as it's * lifetime. */ @@ -592,7 +592,7 @@ static void DataCache_Destroy( /************************************************************************ * DataCache_ReadPresentationData * - * This method will read information for the requested presentation + * This method will read information for the requested presentation * into the given structure. * * Param: @@ -795,7 +795,7 @@ static HRESULT DataCache_OpenPresStream( /************************************************************************ * DataCache_ReadPresentationData * - * This method will read information for the requested presentation + * This method will read information for the requested presentation * into the given structure. * * Param: @@ -821,7 +821,7 @@ static HMETAFILE DataCache_ReadPresMetafile( * Open the presentation stream. */ hres = DataCache_OpenPresStream( - this, + this, drawAspect, &presStream); @@ -852,8 +852,8 @@ static HMETAFILE DataCache_ReadPresMetafile( /* * Allocate a buffer for the metafile bits. */ - metafileBits = HeapAlloc(GetProcessHeap(), - 0, + metafileBits = HeapAlloc(GetProcessHeap(), + 0, streamInfo.cbSize.s.LowPart); /* @@ -910,7 +910,7 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface( */ if ( (this==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ @@ -919,11 +919,11 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface( /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = iface; } - else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) + else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) { *ppvObject = (IDataObject*)&(this->lpvtbl1); } @@ -942,7 +942,7 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface( { *ppvObject = (IOleCache2*)&(this->lpvtbl5); } - else if (memcmp(&IID_IOleCacheControl, riid, sizeof(IID_IOleCacheControl)) == 0) + else if (memcmp(&IID_IOleCacheControl, riid, sizeof(IID_IOleCacheControl)) == 0) { *ppvObject = (IOleCacheControl*)&(this->lpvtbl6); } @@ -955,14 +955,14 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface( WARN( "() : asking for unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } - + /* * Query Interface always increases the reference count by one when it is - * successful. + * successful. */ IUnknown_AddRef((IUnknown*)*ppvObject); - return S_OK;; + return S_OK; } /************************************************************************ @@ -973,7 +973,7 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface( * This version of QueryInterface will not delegate it's implementation * to the outer unknown. */ -static ULONG WINAPI DataCache_NDIUnknown_AddRef( +static ULONG WINAPI DataCache_NDIUnknown_AddRef( IUnknown* iface) { _ICOM_THIS_From_NDIUnknown(DataCache, iface); @@ -991,7 +991,7 @@ static ULONG WINAPI DataCache_NDIUnknown_AddRef( * This version of QueryInterface will not delegate it's implementation * to the outer unknown. */ -static ULONG WINAPI DataCache_NDIUnknown_Release( +static ULONG WINAPI DataCache_NDIUnknown_Release( IUnknown* iface) { _ICOM_THIS_From_NDIUnknown(DataCache, iface); @@ -1010,7 +1010,7 @@ static ULONG WINAPI DataCache_NDIUnknown_Release( return 0; } - + return this->ref; } @@ -1031,7 +1031,7 @@ static HRESULT WINAPI DataCache_IDataObject_QueryInterface( { _ICOM_THIS_From_IDataObject(DataCache, iface); - return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); + return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); } /************************************************************************ @@ -1039,12 +1039,12 @@ static HRESULT WINAPI DataCache_IDataObject_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IDataObject_AddRef( +static ULONG WINAPI DataCache_IDataObject_AddRef( IDataObject* iface) { _ICOM_THIS_From_IDataObject(DataCache, iface); - return IUnknown_AddRef(this->outerUnknown); + return IUnknown_AddRef(this->outerUnknown); } /************************************************************************ @@ -1052,12 +1052,12 @@ static ULONG WINAPI DataCache_IDataObject_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IDataObject_Release( +static ULONG WINAPI DataCache_IDataObject_Release( IDataObject* iface) { _ICOM_THIS_From_IDataObject(DataCache, iface); - return IUnknown_Release(this->outerUnknown); + return IUnknown_Release(this->outerUnknown); } /************************************************************************ @@ -1069,7 +1069,7 @@ static ULONG WINAPI DataCache_IDataObject_Release( */ static HRESULT WINAPI DataCache_GetData( IDataObject* iface, - LPFORMATETC pformatetcIn, + LPFORMATETC pformatetcIn, STGMEDIUM* pmedium) { HRESULT hr = 0; @@ -1167,7 +1167,7 @@ cleanup: } static HRESULT WINAPI DataCache_GetDataHere( - IDataObject* iface, + IDataObject* iface, LPFORMATETC pformatetc, STGMEDIUM* pmedium) { @@ -1191,8 +1191,8 @@ static HRESULT WINAPI DataCache_QueryGetData( * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI DataCache_GetCanonicalFormatEtc( - IDataObject* iface, - LPFORMATETC pformatectIn, + IDataObject* iface, + LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut) { TRACE("()\n"); @@ -1208,8 +1208,8 @@ static HRESULT WINAPI DataCache_GetCanonicalFormatEtc( */ static HRESULT WINAPI DataCache_IDataObject_SetData( IDataObject* iface, - LPFORMATETC pformatetc, - STGMEDIUM* pmedium, + LPFORMATETC pformatetc, + STGMEDIUM* pmedium, BOOL fRelease) { IOleCache2* oleCache = NULL; @@ -1226,7 +1226,7 @@ static HRESULT WINAPI DataCache_IDataObject_SetData( IOleCache2_Release(oleCache); - return hres;; + return hres; } /************************************************************************ @@ -1237,7 +1237,7 @@ static HRESULT WINAPI DataCache_IDataObject_SetData( * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI DataCache_EnumFormatEtc( - IDataObject* iface, + IDataObject* iface, DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc) { @@ -1253,10 +1253,10 @@ static HRESULT WINAPI DataCache_EnumFormatEtc( * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI DataCache_DAdvise( - IDataObject* iface, - FORMATETC* pformatetc, - DWORD advf, - IAdviseSink* pAdvSink, + IDataObject* iface, + FORMATETC* pformatetc, + DWORD advf, + IAdviseSink* pAdvSink, DWORD* pdwConnection) { TRACE("()\n"); @@ -1310,7 +1310,7 @@ static HRESULT WINAPI DataCache_IPersistStorage_QueryInterface( { _ICOM_THIS_From_IPersistStorage(DataCache, iface); - return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); + return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); } /************************************************************************ @@ -1318,12 +1318,12 @@ static HRESULT WINAPI DataCache_IPersistStorage_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IPersistStorage_AddRef( +static ULONG WINAPI DataCache_IPersistStorage_AddRef( IPersistStorage* iface) { _ICOM_THIS_From_IPersistStorage(DataCache, iface); - return IUnknown_AddRef(this->outerUnknown); + return IUnknown_AddRef(this->outerUnknown); } /************************************************************************ @@ -1331,12 +1331,12 @@ static ULONG WINAPI DataCache_IPersistStorage_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IPersistStorage_Release( +static ULONG WINAPI DataCache_IPersistStorage_Release( IPersistStorage* iface) { _ICOM_THIS_From_IPersistStorage(DataCache, iface); - return IUnknown_Release(this->outerUnknown); + return IUnknown_Release(this->outerUnknown); } /************************************************************************ @@ -1346,7 +1346,7 @@ static ULONG WINAPI DataCache_IPersistStorage_Release( * * See Windows documentation for more details on IPersistStorage methods. */ -static HRESULT WINAPI DataCache_GetClassID( +static HRESULT WINAPI DataCache_GetClassID( IPersistStorage* iface, CLSID* pClassID) { @@ -1357,12 +1357,12 @@ static HRESULT WINAPI DataCache_GetClassID( /************************************************************************ * DataCache_IsDirty (IPersistStorage) * - * Until we actully connect to a running object and retrieve new + * Until we actully connect to a running object and retrieve new * information to it, we never get dirty. * * See Windows documentation for more details on IPersistStorage methods. */ -static HRESULT WINAPI DataCache_IsDirty( +static HRESULT WINAPI DataCache_IsDirty( IPersistStorage* iface) { TRACE("(%p)\n", iface); @@ -1378,8 +1378,8 @@ static HRESULT WINAPI DataCache_IsDirty( * * See Windows documentation for more details on IPersistStorage methods. */ -static HRESULT WINAPI DataCache_InitNew( - IPersistStorage* iface, +static HRESULT WINAPI DataCache_InitNew( + IPersistStorage* iface, IStorage* pStg) { TRACE("(%p, %p)\n", iface, pStg); @@ -1390,14 +1390,14 @@ static HRESULT WINAPI DataCache_InitNew( /************************************************************************ * DataCache_Load (IPersistStorage) * - * The data cache implementation of IPersistStorage_Load doesn't + * The data cache implementation of IPersistStorage_Load doesn't * actually load anything. Instead, it holds on to the storage pointer - * and it will load the presentation information when the + * and it will load the presentation information when the * IDataObject_GetData or IViewObject2_Draw methods are called. * * See Windows documentation for more details on IPersistStorage methods. */ -static HRESULT WINAPI DataCache_Load( +static HRESULT WINAPI DataCache_Load( IPersistStorage* iface, IStorage* pStg) { @@ -1422,23 +1422,23 @@ static HRESULT WINAPI DataCache_Load( /************************************************************************ * DataCache_Save (IPersistStorage) * - * Until we actully connect to a running object and retrieve new + * Until we actully connect to a running object and retrieve new * information to it, we never have to save anything. However, it is * our responsability to copy the information when saving to a new * storage. * * See Windows documentation for more details on IPersistStorage methods. */ -static HRESULT WINAPI DataCache_Save( +static HRESULT WINAPI DataCache_Save( IPersistStorage* iface, - IStorage* pStg, + IStorage* pStg, BOOL fSameAsLoad) { _ICOM_THIS_From_IPersistStorage(DataCache, iface); TRACE("(%p, %p, %d)\n", iface, pStg, fSameAsLoad); - if ( (!fSameAsLoad) && + if ( (!fSameAsLoad) && (this->presentationStorage!=NULL) ) { return IStorage_CopyTo(this->presentationStorage, @@ -1459,8 +1459,8 @@ static HRESULT WINAPI DataCache_Save( * * See Windows documentation for more details on IPersistStorage methods. */ -static HRESULT WINAPI DataCache_SaveCompleted( - IPersistStorage* iface, +static HRESULT WINAPI DataCache_SaveCompleted( + IPersistStorage* iface, IStorage* pStgNew) { TRACE("(%p, %p)\n", iface, pStgNew); @@ -1524,7 +1524,7 @@ static HRESULT WINAPI DataCache_IViewObject2_QueryInterface( { _ICOM_THIS_From_IViewObject2(DataCache, iface); - return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); + return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); } /************************************************************************ @@ -1532,12 +1532,12 @@ static HRESULT WINAPI DataCache_IViewObject2_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IViewObject2_AddRef( +static ULONG WINAPI DataCache_IViewObject2_AddRef( IViewObject2* iface) { _ICOM_THIS_From_IViewObject2(DataCache, iface); - return IUnknown_AddRef(this->outerUnknown); + return IUnknown_AddRef(this->outerUnknown); } /************************************************************************ @@ -1545,12 +1545,12 @@ static ULONG WINAPI DataCache_IViewObject2_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IViewObject2_Release( +static ULONG WINAPI DataCache_IViewObject2_Release( IViewObject2* iface) { _ICOM_THIS_From_IViewObject2(DataCache, iface); - return IUnknown_Release(this->outerUnknown); + return IUnknown_Release(this->outerUnknown); } /************************************************************************ @@ -1566,8 +1566,8 @@ static HRESULT WINAPI DataCache_Draw( DWORD dwDrawAspect, LONG lindex, void* pvAspect, - DVTARGETDEVICE* ptd, - HDC hdcTargetDev, + DVTARGETDEVICE* ptd, + HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, @@ -1585,7 +1585,7 @@ static HRESULT WINAPI DataCache_Draw( dwDrawAspect, lindex, pvAspect, - hdcTargetDev, + hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, @@ -1636,7 +1636,7 @@ static HRESULT WINAPI DataCache_Draw( presData.dwObjectExtentY, &oldWindowExt); - SetViewportExtEx(hdcDraw, + SetViewportExtEx(hdcDraw, lprcBounds->right - lprcBounds->left, lprcBounds->bottom - lprcBounds->top, &oldViewportExt); @@ -1653,7 +1653,7 @@ static HRESULT WINAPI DataCache_Draw( oldWindowExt.cy, NULL); - SetViewportExtEx(hdcDraw, + SetViewportExtEx(hdcDraw, oldViewportExt.cx, oldViewportExt.cy, NULL); @@ -1672,12 +1672,12 @@ static HRESULT WINAPI DataCache_Draw( } static HRESULT WINAPI DataCache_GetColorSet( - IViewObject2* iface, - DWORD dwDrawAspect, - LONG lindex, - void* pvAspect, - DVTARGETDEVICE* ptd, - HDC hicTargetDevice, + IViewObject2* iface, + DWORD dwDrawAspect, + LONG lindex, + void* pvAspect, + DVTARGETDEVICE* ptd, + HDC hicTargetDevice, LOGPALETTE** ppColorSet) { FIXME("stub\n"); @@ -1688,7 +1688,7 @@ static HRESULT WINAPI DataCache_Freeze( IViewObject2* iface, DWORD dwDrawAspect, LONG lindex, - void* pvAspect, + void* pvAspect, DWORD* pdwFreeze) { FIXME("stub\n"); @@ -1713,8 +1713,8 @@ static HRESULT WINAPI DataCache_Unfreeze( */ static HRESULT WINAPI DataCache_SetAdvise( IViewObject2* iface, - DWORD aspects, - DWORD advf, + DWORD aspects, + DWORD advf, IAdviseSink* pAdvSink) { _ICOM_THIS_From_IViewObject2(DataCache, iface); @@ -1728,7 +1728,7 @@ static HRESULT WINAPI DataCache_SetAdvise( { IAdviseSink_Release(this->sinkInterface); this->sinkInterface = NULL; - this->sinkAspects = 0; + this->sinkAspects = 0; this->sinkAdviseFlag = 0; } @@ -1738,8 +1738,8 @@ static HRESULT WINAPI DataCache_SetAdvise( if (pAdvSink!=NULL) { this->sinkInterface = pAdvSink; - this->sinkAspects = aspects; - this->sinkAdviseFlag = advf; + this->sinkAspects = aspects; + this->sinkAdviseFlag = advf; IAdviseSink_AddRef(this->sinkInterface); } @@ -1761,15 +1761,15 @@ static HRESULT WINAPI DataCache_SetAdvise( /************************************************************************ * DataCache_GetAdvise (IViewObject2) * - * This method queries the current state of the advise sink + * This method queries the current state of the advise sink * installed on the data cache. * * See Windows documentation for more details on IViewObject2 methods. */ static HRESULT WINAPI DataCache_GetAdvise( - IViewObject2* iface, - DWORD* pAspects, - DWORD* pAdvf, + IViewObject2* iface, + DWORD* pAspects, + DWORD* pAdvf, IAdviseSink** ppAdvSink) { _ICOM_THIS_From_IViewObject2(DataCache, iface); @@ -1787,8 +1787,8 @@ static HRESULT WINAPI DataCache_GetAdvise( if (ppAdvSink!=NULL) { - IAdviseSink_QueryInterface(this->sinkInterface, - &IID_IAdviseSink, + IAdviseSink_QueryInterface(this->sinkInterface, + &IID_IAdviseSink, (void**)ppAdvSink); } @@ -1803,10 +1803,10 @@ static HRESULT WINAPI DataCache_GetAdvise( * See Windows documentation for more details on IViewObject2 methods. */ static HRESULT WINAPI DataCache_GetExtent( - IViewObject2* iface, - DWORD dwDrawAspect, - LONG lindex, - DVTARGETDEVICE* ptd, + IViewObject2* iface, + DWORD dwDrawAspect, + LONG lindex, + DVTARGETDEVICE* ptd, LPSIZEL lpsizel) { PresentationDataHeader presData; @@ -1814,7 +1814,7 @@ static HRESULT WINAPI DataCache_GetExtent( _ICOM_THIS_From_IViewObject2(DataCache, iface); - TRACE("(%p, %lx, %ld, %p, %p)\n", + TRACE("(%p, %lx, %ld, %p, %p)\n", iface, dwDrawAspect, lindex, ptd, lpsizel); /* @@ -1841,9 +1841,9 @@ static HRESULT WINAPI DataCache_GetExtent( */ if (ptd!=NULL) FIXME("Unimplemented ptd = %p\n", ptd); - + /* - * Get the presentation information from the + * Get the presentation information from the * cache. */ hres = DataCache_ReadPresentationData(this, @@ -1883,7 +1883,7 @@ static HRESULT WINAPI DataCache_IOleCache2_QueryInterface( { _ICOM_THIS_From_IOleCache2(DataCache, iface); - return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); + return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); } /************************************************************************ @@ -1891,12 +1891,12 @@ static HRESULT WINAPI DataCache_IOleCache2_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IOleCache2_AddRef( +static ULONG WINAPI DataCache_IOleCache2_AddRef( IOleCache2* iface) { _ICOM_THIS_From_IOleCache2(DataCache, iface); - return IUnknown_AddRef(this->outerUnknown); + return IUnknown_AddRef(this->outerUnknown); } /************************************************************************ @@ -1904,12 +1904,12 @@ static ULONG WINAPI DataCache_IOleCache2_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IOleCache2_Release( +static ULONG WINAPI DataCache_IOleCache2_Release( IOleCache2* iface) { _ICOM_THIS_From_IOleCache2(DataCache, iface); - return IUnknown_Release(this->outerUnknown); + return IUnknown_Release(this->outerUnknown); } static HRESULT WINAPI DataCache_Cache( @@ -1958,7 +1958,7 @@ static HRESULT WINAPI DataCache_IOleCache2_SetData( static HRESULT WINAPI DataCache_UpdateCache( IOleCache2* iface, - LPDATAOBJECT pDataObject, + LPDATAOBJECT pDataObject, DWORD grfUpdf, LPVOID pReserved) { @@ -1992,7 +1992,7 @@ static HRESULT WINAPI DataCache_IOleCacheControl_QueryInterface( { _ICOM_THIS_From_IOleCacheControl(DataCache, iface); - return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); + return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); } /************************************************************************ @@ -2000,12 +2000,12 @@ static HRESULT WINAPI DataCache_IOleCacheControl_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IOleCacheControl_AddRef( +static ULONG WINAPI DataCache_IOleCacheControl_AddRef( IOleCacheControl* iface) { _ICOM_THIS_From_IOleCacheControl(DataCache, iface); - return IUnknown_AddRef(this->outerUnknown); + return IUnknown_AddRef(this->outerUnknown); } /************************************************************************ @@ -2013,12 +2013,12 @@ static ULONG WINAPI DataCache_IOleCacheControl_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataCache_IOleCacheControl_Release( +static ULONG WINAPI DataCache_IOleCacheControl_Release( IOleCacheControl* iface) { _ICOM_THIS_From_IOleCacheControl(DataCache, iface); - return IUnknown_Release(this->outerUnknown); + return IUnknown_Release(this->outerUnknown); } static HRESULT WINAPI DataCache_OnRun( diff --git a/dlls/ole32/defaulthandler.c b/dlls/ole32/defaulthandler.c index 14adf2a0051..7a46610b761 100644 --- a/dlls/ole32/defaulthandler.c +++ b/dlls/ole32/defaulthandler.c @@ -38,7 +38,7 @@ * another one and go into emulation mode. Nothing has been * done in this area. * - * - Some functions still return E_NOTIMPL they have to be + * - Some functions still return E_NOTIMPL they have to be * implemented. Most of those are related to the running of the * actual server. * @@ -66,7 +66,7 @@ struct DefaultHandler /* * List all interface VTables here */ - ICOM_VTABLE(IOleObject)* lpvtbl1; + ICOM_VTABLE(IOleObject)* lpvtbl1; ICOM_VTABLE(IUnknown)* lpvtbl2; ICOM_VTABLE(IDataObject)* lpvtbl3; ICOM_VTABLE(IRunnableObject)* lpvtbl4; @@ -103,7 +103,7 @@ struct DefaultHandler IOleAdviseHolder* oleAdviseHolder; /* - * The IDataAdviseHolder maintains the data + * The IDataAdviseHolder maintains the data * connections on behalf of the default handler. */ IDataAdviseHolder* dataAdviseHolder; @@ -111,7 +111,7 @@ struct DefaultHandler /* * Name of the container and object contained */ - LPWSTR containerApp; + LPWSTR containerApp; LPWSTR containerObj; }; @@ -119,15 +119,15 @@ struct DefaultHandler typedef struct DefaultHandler DefaultHandler; /* - * Here, I define utility macros to help with the casting of the + * Here, I define utility macros to help with the casting of the * "this" parameter. * There is a version to accomodate all of the VTables implemented * by this object. */ #define _ICOM_THIS_From_IOleObject(class,name) class* this = (class*)name; -#define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*)); -#define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)); -#define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)); +#define _ICOM_THIS_From_NDIUnknown(class, name) class* this = (class*)(((char*)name)-sizeof(void*)); +#define _ICOM_THIS_From_IDataObject(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)); +#define _ICOM_THIS_From_IRunnableObject(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)); /* * Prototypes for the methods of the DefaultHandler class. @@ -144,9 +144,9 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface( IUnknown* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( +static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( IUnknown* iface); -static ULONG WINAPI DefaultHandler_NDIUnknown_Release( +static ULONG WINAPI DefaultHandler_NDIUnknown_Release( IUnknown* iface); /* @@ -157,9 +157,9 @@ static HRESULT WINAPI DefaultHandler_QueryInterface( IOleObject* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DefaultHandler_AddRef( +static ULONG WINAPI DefaultHandler_AddRef( IOleObject* iface); -static ULONG WINAPI DefaultHandler_Release( +static ULONG WINAPI DefaultHandler_Release( IOleObject* iface); static HRESULT WINAPI DefaultHandler_SetClientSite( IOleObject* iface, @@ -169,13 +169,13 @@ static HRESULT WINAPI DefaultHandler_GetClientSite( IOleClientSite** ppClientSite); static HRESULT WINAPI DefaultHandler_SetHostNames( IOleObject* iface, - LPCOLESTR szContainerApp, + LPCOLESTR szContainerApp, LPCOLESTR szContainerObj); static HRESULT WINAPI DefaultHandler_Close( - IOleObject* iface, + IOleObject* iface, DWORD dwSaveOption); static HRESULT WINAPI DefaultHandler_SetMoniker( - IOleObject* iface, + IOleObject* iface, DWORD dwWhichMoniker, IMoniker* pmk); static HRESULT WINAPI DefaultHandler_GetMoniker( @@ -184,57 +184,57 @@ static HRESULT WINAPI DefaultHandler_GetMoniker( DWORD dwWhichMoniker, IMoniker** ppmk); static HRESULT WINAPI DefaultHandler_InitFromData( - IOleObject* iface, - IDataObject* pDataObject, + IOleObject* iface, + IDataObject* pDataObject, BOOL fCreation, DWORD dwReserved); static HRESULT WINAPI DefaultHandler_GetClipboardData( - IOleObject* iface, - DWORD dwReserved, + IOleObject* iface, + DWORD dwReserved, IDataObject** ppDataObject); static HRESULT WINAPI DefaultHandler_DoVerb( - IOleObject* iface, - LONG iVerb, - struct tagMSG* lpmsg, - IOleClientSite* pActiveSite, - LONG lindex, - HWND hwndParent, + IOleObject* iface, + LONG iVerb, + struct tagMSG* lpmsg, + IOleClientSite* pActiveSite, + LONG lindex, + HWND hwndParent, LPCRECT lprcPosRect); static HRESULT WINAPI DefaultHandler_EnumVerbs( - IOleObject* iface, + IOleObject* iface, IEnumOLEVERB** ppEnumOleVerb); static HRESULT WINAPI DefaultHandler_Update( IOleObject* iface); static HRESULT WINAPI DefaultHandler_IsUpToDate( IOleObject* iface); static HRESULT WINAPI DefaultHandler_GetUserClassID( - IOleObject* iface, + IOleObject* iface, CLSID* pClsid); static HRESULT WINAPI DefaultHandler_GetUserType( - IOleObject* iface, - DWORD dwFormOfType, + IOleObject* iface, + DWORD dwFormOfType, LPOLESTR* pszUserType); static HRESULT WINAPI DefaultHandler_SetExtent( - IOleObject* iface, - DWORD dwDrawAspect, + IOleObject* iface, + DWORD dwDrawAspect, SIZEL* psizel); static HRESULT WINAPI DefaultHandler_GetExtent( - IOleObject* iface, - DWORD dwDrawAspect, + IOleObject* iface, + DWORD dwDrawAspect, SIZEL* psizel); static HRESULT WINAPI DefaultHandler_Advise( - IOleObject* iface, - IAdviseSink* pAdvSink, + IOleObject* iface, + IAdviseSink* pAdvSink, DWORD* pdwConnection); static HRESULT WINAPI DefaultHandler_Unadvise( - IOleObject* iface, + IOleObject* iface, DWORD dwConnection); static HRESULT WINAPI DefaultHandler_EnumAdvise( - IOleObject* iface, + IOleObject* iface, IEnumSTATDATA** ppenumAdvise); static HRESULT WINAPI DefaultHandler_GetMiscStatus( - IOleObject* iface, - DWORD dwAspect, + IOleObject* iface, + DWORD dwAspect, DWORD* pdwStatus); static HRESULT WINAPI DefaultHandler_SetColorScheme( IOleObject* iface, @@ -248,39 +248,39 @@ static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface( IDataObject* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DefaultHandler_IDataObject_AddRef( +static ULONG WINAPI DefaultHandler_IDataObject_AddRef( IDataObject* iface); -static ULONG WINAPI DefaultHandler_IDataObject_Release( +static ULONG WINAPI DefaultHandler_IDataObject_Release( IDataObject* iface); static HRESULT WINAPI DefaultHandler_GetData( IDataObject* iface, - LPFORMATETC pformatetcIn, + LPFORMATETC pformatetcIn, STGMEDIUM* pmedium); static HRESULT WINAPI DefaultHandler_GetDataHere( - IDataObject* iface, + IDataObject* iface, LPFORMATETC pformatetc, STGMEDIUM* pmedium); static HRESULT WINAPI DefaultHandler_QueryGetData( IDataObject* iface, LPFORMATETC pformatetc); static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc( - IDataObject* iface, - LPFORMATETC pformatectIn, + IDataObject* iface, + LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut); static HRESULT WINAPI DefaultHandler_SetData( IDataObject* iface, - LPFORMATETC pformatetc, - STGMEDIUM* pmedium, + LPFORMATETC pformatetc, + STGMEDIUM* pmedium, BOOL fRelease); static HRESULT WINAPI DefaultHandler_EnumFormatEtc( - IDataObject* iface, + IDataObject* iface, DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc); static HRESULT WINAPI DefaultHandler_DAdvise( - IDataObject* iface, - FORMATETC* pformatetc, - DWORD advf, - IAdviseSink* pAdvSink, + IDataObject* iface, + FORMATETC* pformatetc, + DWORD advf, + IAdviseSink* pAdvSink, DWORD* pdwConnection); static HRESULT WINAPI DefaultHandler_DUnadvise( IDataObject* iface, @@ -297,24 +297,24 @@ static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface( IRunnableObject* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( +static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( IRunnableObject* iface); -static ULONG WINAPI DefaultHandler_IRunnableObject_Release( +static ULONG WINAPI DefaultHandler_IRunnableObject_Release( IRunnableObject* iface); -static HRESULT WINAPI DefaultHandler_GetRunningClass( - IRunnableObject* iface, +static HRESULT WINAPI DefaultHandler_GetRunningClass( + IRunnableObject* iface, LPCLSID lpClsid); -static HRESULT WINAPI DefaultHandler_Run( +static HRESULT WINAPI DefaultHandler_Run( IRunnableObject* iface, IBindCtx* pbc); -static BOOL WINAPI DefaultHandler_IsRunning( +static BOOL WINAPI DefaultHandler_IsRunning( IRunnableObject* iface); -static HRESULT WINAPI DefaultHandler_LockRunning( - IRunnableObject* iface, - BOOL fLock, +static HRESULT WINAPI DefaultHandler_LockRunning( + IRunnableObject* iface, + BOOL fLock, BOOL fLastUnlockCloses); -static HRESULT WINAPI DefaultHandler_SetContainedObject( - IRunnableObject* iface, +static HRESULT WINAPI DefaultHandler_SetContainedObject( + IRunnableObject* iface, BOOL fContained); @@ -416,14 +416,14 @@ HRESULT WINAPI OleCreateDefaultHandler( * This is necessary because it's the only time the non-delegating * IUnknown pointer can be returned to the outside. */ - if ( (pUnkOuter!=NULL) && + if ( (pUnkOuter!=NULL) && (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) != 0) ) return CLASS_E_NOAGGREGATION; /* * Try to construct a new instance of the class. */ - newHandler = DefaultHandler_Construct(clsid, + newHandler = DefaultHandler_Construct(clsid, pUnkOuter); if (newHandler == 0) @@ -459,7 +459,7 @@ static DefaultHandler* DefaultHandler_Construct( if (newObject==0) return newObject; - + /* * Initialize the virtual function table. */ @@ -469,14 +469,14 @@ static DefaultHandler* DefaultHandler_Construct( newObject->lpvtbl4 = &DefaultHandler_IRunnableObject_VTable; /* - * Start with one reference count. The caller of this function + * Start with one reference count. The caller of this function * must release the interface pointer when it is done. */ newObject->ref = 1; /* * Initialize the outer unknown - * We don't keep a reference on the outer unknown since, the way + * We don't keep a reference on the outer unknown since, the way * aggregation works, our lifetime is at least as large as it's * lifetime. */ @@ -488,7 +488,7 @@ static DefaultHandler* DefaultHandler_Construct( /* * Create a datacache object. * We aggregate with the datacache. Make sure we pass our outer - * unknown as the datacache's outer unknown. + * unknown as the datacache's outer unknown. */ CreateDataCache(newObject->outerUnknown, clsid, @@ -525,7 +525,7 @@ static void DefaultHandler_Destroy( HeapFree( GetProcessHeap(), 0, ptrToDestroy->containerObj ); ptrToDestroy->containerObj = NULL; } - + /* * Release our reference to the data cache. */ @@ -594,7 +594,7 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface( */ if ( (this==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ @@ -603,19 +603,19 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface( /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = iface; } - else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0) + else if (memcmp(&IID_IOleObject, riid, sizeof(IID_IOleObject)) == 0) { *ppvObject = (IOleObject*)&(this->lpvtbl1); } - else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) + else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0) { *ppvObject = (IDataObject*)&(this->lpvtbl3); } - else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0) + else if (memcmp(&IID_IRunnableObject, riid, sizeof(IID_IRunnableObject)) == 0) { *ppvObject = (IRunnableObject*)&(this->lpvtbl4); } @@ -627,7 +627,7 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface( if (IUnknown_QueryInterface(this->dataCache, riid, ppvObject) == S_OK) return S_OK; } - + /* * Check that we obtained an interface. */ @@ -636,14 +636,14 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface( WARN( "() : asking for un supported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } - + /* * Query Interface always increases the reference count by one when it is - * successful. + * successful. */ IUnknown_AddRef((IUnknown*)*ppvObject); - return S_OK;; + return S_OK; } /************************************************************************ @@ -654,7 +654,7 @@ static HRESULT WINAPI DefaultHandler_NDIUnknown_QueryInterface( * This version of QueryInterface will not delegate it's implementation * to the outer unknown. */ -static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( +static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( IUnknown* iface) { _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface); @@ -672,7 +672,7 @@ static ULONG WINAPI DefaultHandler_NDIUnknown_AddRef( * This version of QueryInterface will not delegate it's implementation * to the outer unknown. */ -static ULONG WINAPI DefaultHandler_NDIUnknown_Release( +static ULONG WINAPI DefaultHandler_NDIUnknown_Release( IUnknown* iface) { _ICOM_THIS_From_NDIUnknown(DefaultHandler, iface); @@ -691,7 +691,7 @@ static ULONG WINAPI DefaultHandler_NDIUnknown_Release( return 0; } - + return this->ref; } @@ -712,7 +712,7 @@ static HRESULT WINAPI DefaultHandler_QueryInterface( { _ICOM_THIS_From_IOleObject(DefaultHandler, iface); - return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); + return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); } /************************************************************************ @@ -720,7 +720,7 @@ static HRESULT WINAPI DefaultHandler_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DefaultHandler_AddRef( +static ULONG WINAPI DefaultHandler_AddRef( IOleObject* iface) { _ICOM_THIS_From_IOleObject(DefaultHandler, iface); @@ -733,7 +733,7 @@ static ULONG WINAPI DefaultHandler_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DefaultHandler_Release( +static ULONG WINAPI DefaultHandler_Release( IOleObject* iface) { _ICOM_THIS_From_IOleObject(DefaultHandler, iface); @@ -816,19 +816,19 @@ static HRESULT WINAPI DefaultHandler_GetClientSite( */ static HRESULT WINAPI DefaultHandler_SetHostNames( IOleObject* iface, - LPCOLESTR szContainerApp, + LPCOLESTR szContainerApp, LPCOLESTR szContainerObj) { _ICOM_THIS_From_IOleObject(DefaultHandler, iface); TRACE("(%p, %s, %s)\n", iface, - debugstr_w(szContainerApp), + debugstr_w(szContainerApp), debugstr_w(szContainerObj)); /* * Be sure to cleanup before re-assinging the strings. - */ + */ if (this->containerApp!=NULL) { HeapFree( GetProcessHeap(), 0, this->containerApp ); @@ -869,7 +869,7 @@ static HRESULT WINAPI DefaultHandler_SetHostNames( * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_Close( - IOleObject* iface, + IOleObject* iface, DWORD dwSaveOption) { TRACE("()\n"); @@ -884,13 +884,13 @@ static HRESULT WINAPI DefaultHandler_Close( * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_SetMoniker( - IOleObject* iface, + IOleObject* iface, DWORD dwWhichMoniker, IMoniker* pmk) { TRACE("(%p, %ld, %p)\n", - iface, - dwWhichMoniker, + iface, + dwWhichMoniker, pmk); return S_OK; @@ -920,7 +920,7 @@ static HRESULT WINAPI DefaultHandler_GetMoniker( dwAssign, dwWhichMoniker, ppmk); - + } return E_UNSPEC; @@ -930,12 +930,12 @@ static HRESULT WINAPI DefaultHandler_GetMoniker( * DefaultHandler_InitFromData (IOleObject) * * This method is meaningless if the server is not running - * + * * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_InitFromData( - IOleObject* iface, - IDataObject* pDataObject, + IOleObject* iface, + IDataObject* pDataObject, BOOL fCreation, DWORD dwReserved) { @@ -949,12 +949,12 @@ static HRESULT WINAPI DefaultHandler_InitFromData( * DefaultHandler_GetClipboardData (IOleObject) * * This method is meaningless if the server is not running - * + * * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_GetClipboardData( - IOleObject* iface, - DWORD dwReserved, + IOleObject* iface, + DWORD dwReserved, IDataObject** ppDataObject) { TRACE("(%p, %ld, %p)\n", @@ -964,12 +964,12 @@ static HRESULT WINAPI DefaultHandler_GetClipboardData( } static HRESULT WINAPI DefaultHandler_DoVerb( - IOleObject* iface, - LONG iVerb, - struct tagMSG* lpmsg, - IOleClientSite* pActiveSite, - LONG lindex, - HWND hwndParent, + IOleObject* iface, + LONG iVerb, + struct tagMSG* lpmsg, + IOleClientSite* pActiveSite, + LONG lindex, + HWND hwndParent, LPCRECT lprcPosRect) { FIXME(": Stub\n"); @@ -981,11 +981,11 @@ static HRESULT WINAPI DefaultHandler_DoVerb( * * The default handler implementation of this method simply delegates * to OleRegEnumVerbs - * + * * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_EnumVerbs( - IOleObject* iface, + IOleObject* iface, IEnumOLEVERB** ppEnumOleVerb) { _ICOM_THIS_From_IOleObject(DefaultHandler, iface); @@ -1006,7 +1006,7 @@ static HRESULT WINAPI DefaultHandler_Update( * DefaultHandler_IsUpToDate (IOleObject) * * This method is meaningless if the server is not running - * + * * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_IsUpToDate( @@ -1021,11 +1021,11 @@ static HRESULT WINAPI DefaultHandler_IsUpToDate( * DefaultHandler_GetUserClassID (IOleObject) * * TODO: Map to a new class ID if emulation is active. - * + * * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_GetUserClassID( - IOleObject* iface, + IOleObject* iface, CLSID* pClsid) { _ICOM_THIS_From_IOleObject(DefaultHandler, iface); @@ -1048,12 +1048,12 @@ static HRESULT WINAPI DefaultHandler_GetUserClassID( * * The default handler implementation of this method simply delegates * to OleRegGetUserType - * + * * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_GetUserType( - IOleObject* iface, - DWORD dwFormOfType, + IOleObject* iface, + DWORD dwFormOfType, LPOLESTR* pszUserType) { _ICOM_THIS_From_IOleObject(DefaultHandler, iface); @@ -1071,8 +1071,8 @@ static HRESULT WINAPI DefaultHandler_GetUserType( * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_SetExtent( - IOleObject* iface, - DWORD dwDrawAspect, + IOleObject* iface, + DWORD dwDrawAspect, SIZEL* psizel) { TRACE("(%p, %lx, (%ld x %ld))\n", iface, @@ -1089,15 +1089,15 @@ static HRESULT WINAPI DefaultHandler_SetExtent( * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_GetExtent( - IOleObject* iface, - DWORD dwDrawAspect, + IOleObject* iface, + DWORD dwDrawAspect, SIZEL* psizel) { DVTARGETDEVICE* targetDevice; IViewObject2* cacheView = NULL; HRESULT hres; - _ICOM_THIS_From_IOleObject(DefaultHandler, iface); + _ICOM_THIS_From_IOleObject(DefaultHandler, iface); TRACE("(%p, %lx, %p)\n", iface, dwDrawAspect, psizel); @@ -1110,8 +1110,8 @@ static HRESULT WINAPI DefaultHandler_GetExtent( * Prepare the call to the cache's GetExtent method. * * Here we would build a valid DVTARGETDEVICE structure - * but, since we are calling into the data cache, we - * know it's implementation and we'll skip this + * but, since we are calling into the data cache, we + * know it's implementation and we'll skip this * extra work until later. */ targetDevice = NULL; @@ -1139,12 +1139,12 @@ static HRESULT WINAPI DefaultHandler_GetExtent( * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_Advise( - IOleObject* iface, - IAdviseSink* pAdvSink, + IOleObject* iface, + IAdviseSink* pAdvSink, DWORD* pdwConnection) { HRESULT hres = S_OK; - _ICOM_THIS_From_IOleObject(DefaultHandler, iface); + _ICOM_THIS_From_IOleObject(DefaultHandler, iface); TRACE("(%p, %p, %p)\n", iface, pAdvSink, pdwConnection); @@ -1158,8 +1158,8 @@ static HRESULT WINAPI DefaultHandler_Advise( if (SUCCEEDED(hres)) { - hres = IOleAdviseHolder_Advise(this->oleAdviseHolder, - pAdvSink, + hres = IOleAdviseHolder_Advise(this->oleAdviseHolder, + pAdvSink, pdwConnection); } @@ -1175,10 +1175,10 @@ static HRESULT WINAPI DefaultHandler_Advise( * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_Unadvise( - IOleObject* iface, + IOleObject* iface, DWORD dwConnection) { - _ICOM_THIS_From_IOleObject(DefaultHandler, iface); + _ICOM_THIS_From_IOleObject(DefaultHandler, iface); TRACE("(%p, %ld)\n", iface, dwConnection); @@ -1202,10 +1202,10 @@ static HRESULT WINAPI DefaultHandler_Unadvise( * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_EnumAdvise( - IOleObject* iface, + IOleObject* iface, IEnumSTATDATA** ppenumAdvise) { - _ICOM_THIS_From_IOleObject(DefaultHandler, iface); + _ICOM_THIS_From_IOleObject(DefaultHandler, iface); TRACE("(%p, %p)\n", iface, ppenumAdvise); @@ -1236,8 +1236,8 @@ static HRESULT WINAPI DefaultHandler_EnumAdvise( * See Windows documentation for more details on IOleObject methods. */ static HRESULT WINAPI DefaultHandler_GetMiscStatus( - IOleObject* iface, - DWORD dwAspect, + IOleObject* iface, + DWORD dwAspect, DWORD* pdwStatus) { HRESULT hres; @@ -1279,13 +1279,13 @@ static HRESULT WINAPI DefaultHandler_SetColorScheme( * See Windows documentation for more details on IUnknown methods. */ static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface( - IDataObject* iface, + IDataObject* iface, REFIID riid, void** ppvObject) { _ICOM_THIS_From_IDataObject(DefaultHandler, iface); - return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); + return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); } /************************************************************************ @@ -1293,12 +1293,12 @@ static HRESULT WINAPI DefaultHandler_IDataObject_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DefaultHandler_IDataObject_AddRef( +static ULONG WINAPI DefaultHandler_IDataObject_AddRef( IDataObject* iface) { _ICOM_THIS_From_IDataObject(DefaultHandler, iface); - return IUnknown_AddRef(this->outerUnknown); + return IUnknown_AddRef(this->outerUnknown); } /************************************************************************ @@ -1306,12 +1306,12 @@ static ULONG WINAPI DefaultHandler_IDataObject_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DefaultHandler_IDataObject_Release( +static ULONG WINAPI DefaultHandler_IDataObject_Release( IDataObject* iface) { _ICOM_THIS_From_IDataObject(DefaultHandler, iface); - return IUnknown_Release(this->outerUnknown); + return IUnknown_Release(this->outerUnknown); } /************************************************************************ @@ -1323,7 +1323,7 @@ static ULONG WINAPI DefaultHandler_IDataObject_Release( */ static HRESULT WINAPI DefaultHandler_GetData( IDataObject* iface, - LPFORMATETC pformatetcIn, + LPFORMATETC pformatetcIn, STGMEDIUM* pmedium) { IDataObject* cacheDataObject = NULL; @@ -1333,7 +1333,7 @@ static HRESULT WINAPI DefaultHandler_GetData( TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pmedium); - hres = IUnknown_QueryInterface(this->dataCache, + hres = IUnknown_QueryInterface(this->dataCache, &IID_IDataObject, (void**)&cacheDataObject); @@ -1343,14 +1343,14 @@ static HRESULT WINAPI DefaultHandler_GetData( hres = IDataObject_GetData(cacheDataObject, pformatetcIn, pmedium); - + IDataObject_Release(cacheDataObject); - + return hres; } static HRESULT WINAPI DefaultHandler_GetDataHere( - IDataObject* iface, + IDataObject* iface, LPFORMATETC pformatetc, STGMEDIUM* pmedium) { @@ -1361,7 +1361,7 @@ static HRESULT WINAPI DefaultHandler_GetDataHere( /************************************************************************ * DefaultHandler_QueryGetData (IDataObject) * - * The default handler's implementation of this method delegates to + * The default handler's implementation of this method delegates to * the cache. * * See Windows documentation for more details on IDataObject methods. @@ -1377,7 +1377,7 @@ static HRESULT WINAPI DefaultHandler_QueryGetData( TRACE("(%p, %p)\n", iface, pformatetc); - hres = IUnknown_QueryInterface(this->dataCache, + hres = IUnknown_QueryInterface(this->dataCache, &IID_IDataObject, (void**)&cacheDataObject); @@ -1388,7 +1388,7 @@ static HRESULT WINAPI DefaultHandler_QueryGetData( pformatetc); IDataObject_Release(cacheDataObject); - + return hres; } @@ -1400,8 +1400,8 @@ static HRESULT WINAPI DefaultHandler_QueryGetData( * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc( - IDataObject* iface, - LPFORMATETC pformatectIn, + IDataObject* iface, + LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut) { FIXME("(%p, %p, %p)\n", iface, pformatectIn, pformatetcOut); @@ -1412,15 +1412,15 @@ static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc( /************************************************************************ * DefaultHandler_SetData (IDataObject) * - * The default handler's implementation of this method delegates to + * The default handler's implementation of this method delegates to * the cache. * * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI DefaultHandler_SetData( IDataObject* iface, - LPFORMATETC pformatetc, - STGMEDIUM* pmedium, + LPFORMATETC pformatetc, + STGMEDIUM* pmedium, BOOL fRelease) { IDataObject* cacheDataObject = NULL; @@ -1430,7 +1430,7 @@ static HRESULT WINAPI DefaultHandler_SetData( TRACE("(%p, %p, %p, %d)\n", iface, pformatetc, pmedium, fRelease); - hres = IUnknown_QueryInterface(this->dataCache, + hres = IUnknown_QueryInterface(this->dataCache, &IID_IDataObject, (void**)&cacheDataObject); @@ -1441,9 +1441,9 @@ static HRESULT WINAPI DefaultHandler_SetData( pformatetc, pmedium, fRelease); - + IDataObject_Release(cacheDataObject); - + return hres; } @@ -1456,7 +1456,7 @@ static HRESULT WINAPI DefaultHandler_SetData( * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI DefaultHandler_EnumFormatEtc( - IDataObject* iface, + IDataObject* iface, DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc) { @@ -1479,16 +1479,16 @@ static HRESULT WINAPI DefaultHandler_EnumFormatEtc( * See Windows documentation for more details on IDataObject methods. */ static HRESULT WINAPI DefaultHandler_DAdvise( - IDataObject* iface, - FORMATETC* pformatetc, - DWORD advf, - IAdviseSink* pAdvSink, + IDataObject* iface, + FORMATETC* pformatetc, + DWORD advf, + IAdviseSink* pAdvSink, DWORD* pdwConnection) { HRESULT hres = S_OK; - _ICOM_THIS_From_IDataObject(DefaultHandler, iface); + _ICOM_THIS_From_IDataObject(DefaultHandler, iface); - TRACE("(%p, %p, %ld, %p, %p)\n", + TRACE("(%p, %p, %ld, %p, %p)\n", iface, pformatetc, advf, pAdvSink, pdwConnection); /* @@ -1501,11 +1501,11 @@ static HRESULT WINAPI DefaultHandler_DAdvise( if (SUCCEEDED(hres)) { - hres = IDataAdviseHolder_Advise(this->dataAdviseHolder, + hres = IDataAdviseHolder_Advise(this->dataAdviseHolder, iface, - pformatetc, - advf, - pAdvSink, + pformatetc, + advf, + pAdvSink, pdwConnection); } @@ -1524,7 +1524,7 @@ static HRESULT WINAPI DefaultHandler_DUnadvise( IDataObject* iface, DWORD dwConnection) { - _ICOM_THIS_From_IDataObject(DefaultHandler, iface); + _ICOM_THIS_From_IDataObject(DefaultHandler, iface); TRACE("(%p, %ld)\n", iface, dwConnection); @@ -1537,7 +1537,7 @@ static HRESULT WINAPI DefaultHandler_DUnadvise( return OLE_E_NOCONNECTION; } - return IDataAdviseHolder_Unadvise(this->dataAdviseHolder, + return IDataAdviseHolder_Unadvise(this->dataAdviseHolder, dwConnection); } @@ -1553,7 +1553,7 @@ static HRESULT WINAPI DefaultHandler_EnumDAdvise( IDataObject* iface, IEnumSTATDATA** ppenumAdvise) { - _ICOM_THIS_From_IDataObject(DefaultHandler, iface); + _ICOM_THIS_From_IDataObject(DefaultHandler, iface); TRACE("(%p, %p)\n", iface, ppenumAdvise); @@ -1573,7 +1573,7 @@ static HRESULT WINAPI DefaultHandler_EnumDAdvise( */ if (this->dataAdviseHolder!=NULL) { - return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder, + return IDataAdviseHolder_EnumAdvise(this->dataAdviseHolder, ppenumAdvise); } @@ -1581,7 +1581,7 @@ static HRESULT WINAPI DefaultHandler_EnumDAdvise( } /********************************************************* - * Methods implementation for the IRunnableObject part + * Methods implementation for the IRunnableObject part * of the DefaultHandler class. */ @@ -1597,7 +1597,7 @@ static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface( { _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface); - return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); + return IUnknown_QueryInterface(this->outerUnknown, riid, ppvObject); } /************************************************************************ @@ -1605,7 +1605,7 @@ static HRESULT WINAPI DefaultHandler_IRunnableObject_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( +static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( IRunnableObject* iface) { _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface); @@ -1618,7 +1618,7 @@ static ULONG WINAPI DefaultHandler_IRunnableObject_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DefaultHandler_IRunnableObject_Release( +static ULONG WINAPI DefaultHandler_IRunnableObject_Release( IRunnableObject* iface) { _ICOM_THIS_From_IRunnableObject(DefaultHandler, iface); @@ -1629,21 +1629,21 @@ static ULONG WINAPI DefaultHandler_IRunnableObject_Release( /************************************************************************ * DefaultHandler_GetRunningClass (IRunnableObject) * - * According to Brockscmidt, Chapter 19, the default handler's + * According to Brockscmidt, Chapter 19, the default handler's * implementation of IRunnableobject does nothing until the object * is actually running. * * See Windows documentation for more details on IRunnableObject methods. */ -static HRESULT WINAPI DefaultHandler_GetRunningClass( - IRunnableObject* iface, +static HRESULT WINAPI DefaultHandler_GetRunningClass( + IRunnableObject* iface, LPCLSID lpClsid) { TRACE("()\n"); return S_OK; } -static HRESULT WINAPI DefaultHandler_Run( +static HRESULT WINAPI DefaultHandler_Run( IRunnableObject* iface, IBindCtx* pbc) { @@ -1654,13 +1654,13 @@ static HRESULT WINAPI DefaultHandler_Run( /************************************************************************ * DefaultHandler_IsRunning (IRunnableObject) * - * According to Brockscmidt, Chapter 19, the default handler's + * According to Brockscmidt, Chapter 19, the default handler's * implementation of IRunnableobject does nothing until the object * is actually running. * * See Windows documentation for more details on IRunnableObject methods. */ -static BOOL WINAPI DefaultHandler_IsRunning( +static BOOL WINAPI DefaultHandler_IsRunning( IRunnableObject* iface) { TRACE("()\n"); @@ -1670,15 +1670,15 @@ static BOOL WINAPI DefaultHandler_IsRunning( /************************************************************************ * DefaultHandler_LockRunning (IRunnableObject) * - * According to Brockscmidt, Chapter 19, the default handler's + * According to Brockscmidt, Chapter 19, the default handler's * implementation of IRunnableobject does nothing until the object * is actually running. * * See Windows documentation for more details on IRunnableObject methods. */ -static HRESULT WINAPI DefaultHandler_LockRunning( - IRunnableObject* iface, - BOOL fLock, +static HRESULT WINAPI DefaultHandler_LockRunning( + IRunnableObject* iface, + BOOL fLock, BOOL fLastUnlockCloses) { TRACE("()\n"); @@ -1688,14 +1688,14 @@ static HRESULT WINAPI DefaultHandler_LockRunning( /************************************************************************ * DefaultHandler_SetContainedObject (IRunnableObject) * - * According to Brockscmidt, Chapter 19, the default handler's + * According to Brockscmidt, Chapter 19, the default handler's * implementation of IRunnableobject does nothing until the object * is actually running. * * See Windows documentation for more details on IRunnableObject methods. */ -static HRESULT WINAPI DefaultHandler_SetContainedObject( - IRunnableObject* iface, +static HRESULT WINAPI DefaultHandler_SetContainedObject( + IRunnableObject* iface, BOOL fContained) { TRACE("()\n"); diff --git a/dlls/ole32/errorinfo.c b/dlls/ole32/errorinfo.c index 268762647b5..2e4598bf875 100644 --- a/dlls/ole32/errorinfo.c +++ b/dlls/ole32/errorinfo.c @@ -19,7 +19,7 @@ * * NOTES: * - * The errorinfo is a per-thread object. The reference is stored in the + * The errorinfo is a per-thread object. The reference is stored in the * TEB at offset 0xf80 */ @@ -47,7 +47,7 @@ static BSTR WINAPI ERRORINFO_SysAllocString(const OLECHAR* in) DWORD* newBuffer; WCHAR* stringBuffer; DWORD len; - + if (in == NULL) return NULL; /* @@ -106,7 +106,7 @@ static BSTR WINAPI ERRORINFO_SysAllocString(const OLECHAR* in) static VOID WINAPI ERRORINFO_SysFreeString(BSTR in) { DWORD* bufferPointer; - + /* NULL is a valid parameter */ if(!in) return; @@ -132,7 +132,7 @@ typedef struct ErrorInfoImpl ICOM_VTABLE(ICreateErrorInfo) *lpvtcei; ICOM_VTABLE(ISupportErrorInfo) *lpvtsei; DWORD ref; - + GUID m_Guid; BSTR bstrSource; BSTR bstrDescription; @@ -147,14 +147,14 @@ static ICOM_VTABLE(ISupportErrorInfo) ISupportErrorInfoImpl_VTable; /* converts a objectpointer to This */ -#define _IErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtei))) -#define _ICOM_THIS_From_IErrorInfo(class, name) class* This = (class*)(((char*)name)-_IErrorInfo_Offset); +#define _IErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtei))) +#define _ICOM_THIS_From_IErrorInfo(class, name) class* This = (class*)(((char*)name)-_IErrorInfo_Offset); -#define _ICreateErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtcei))) -#define _ICOM_THIS_From_ICreateErrorInfo(class, name) class* This = (class*)(((char*)name)-_ICreateErrorInfo_Offset); +#define _ICreateErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtcei))) +#define _ICOM_THIS_From_ICreateErrorInfo(class, name) class* This = (class*)(((char*)name)-_ICreateErrorInfo_Offset); -#define _ISupportErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtsei))) -#define _ICOM_THIS_From_ISupportErrorInfo(class, name) class* This = (class*)(((char*)name)-_ISupportErrorInfo_Offset); +#define _ISupportErrorInfo_Offset ((int)(&(((ErrorInfoImpl*)0)->lpvtsei))) +#define _ICOM_THIS_From_ISupportErrorInfo(class, name) class* This = (class*)(((char*)name)-_ISupportErrorInfo_Offset); /* converts This to a objectpointer @@ -193,7 +193,7 @@ static HRESULT WINAPI IErrorInfoImpl_QueryInterface( if(IsEqualIID(riid, &IID_IErrorInfo)) { - *ppvoid = _IErrorInfo_(This); + *ppvoid = _IErrorInfo_(This); } else if(IsEqualIID(riid, &IID_ICreateErrorInfo)) { @@ -239,7 +239,7 @@ static ULONG WINAPI IErrorInfoImpl_Release( static HRESULT WINAPI IErrorInfoImpl_GetGUID( IErrorInfo* iface, - GUID * pGUID) + GUID * pGUID) { _ICOM_THIS_From_IErrorInfo(ErrorInfoImpl, iface); TRACE("(%p)->(count=%lu)\n",This,This->ref); @@ -270,7 +270,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetDescription( if (pBstrDescription == NULL) return E_INVALIDARG; *pBstrDescription = ERRORINFO_SysAllocString(This->bstrDescription); - + return S_OK; } @@ -284,7 +284,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetHelpFile( if (pBstrHelpFile == NULL) return E_INVALIDARG; *pBstrHelpFile = ERRORINFO_SysAllocString(This->bstrHelpFile); - + return S_OK; } @@ -297,7 +297,7 @@ static HRESULT WINAPI IErrorInfoImpl_GetHelpContext( if (pdwHelpContext == NULL) return E_INVALIDARG; *pdwHelpContext = This->m_dwHelpContext; - + return S_OK; } @@ -307,7 +307,7 @@ static ICOM_VTABLE(IErrorInfo) IErrorInfoImpl_VTable = IErrorInfoImpl_QueryInterface, IErrorInfoImpl_AddRef, IErrorInfoImpl_Release, - + IErrorInfoImpl_GetGUID, IErrorInfoImpl_GetSource, IErrorInfoImpl_GetDescription, @@ -362,7 +362,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetSource( if (This->bstrSource != NULL) ERRORINFO_SysFreeString(This->bstrSource); This->bstrSource = ERRORINFO_SysAllocString(szSource); - + return S_OK; } @@ -375,7 +375,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetDescription( if (This->bstrDescription != NULL) ERRORINFO_SysFreeString(This->bstrDescription); This->bstrDescription = ERRORINFO_SysAllocString(szDescription); - + return S_OK; } @@ -399,7 +399,7 @@ static HRESULT WINAPI ICreateErrorInfoImpl_SetHelpContext( _ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface); TRACE("(%p)\n",This); This->m_dwHelpContext = dwHelpContext; - + return S_OK; } @@ -424,7 +424,7 @@ static HRESULT WINAPI ISupportErrorInfoImpl_QueryInterface( { _ICOM_THIS_From_ISupportErrorInfo(ErrorInfoImpl, iface); TRACE("(%p)\n", This); - + return IErrorInfo_QueryInterface(_IErrorInfo_(This), riid, ppvoid); } @@ -474,7 +474,7 @@ HRESULT WINAPI CreateErrorInfo(ICreateErrorInfo **pperrinfo) TRACE("(%p): stub:\n", pperrinfo); if(! pperrinfo ) return E_INVALIDARG; if(!(pei=IErrorInfoImpl_Constructor()))return E_OUTOFMEMORY; - + res = IErrorInfo_QueryInterface(pei, &IID_ICreateErrorInfo, (LPVOID*)pperrinfo); IErrorInfo_Release(pei); return res; diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c index a7d023542ee..105236683e2 100644 --- a/dlls/ole32/filemoniker.c +++ b/dlls/ole32/filemoniker.c @@ -39,7 +39,7 @@ typedef struct FileMonikerImpl{ ICOM_VTABLE(IMoniker)* lpvtbl1; /* VTable relative to the IMoniker interface.*/ - /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether + /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether * two monikers are equal. That's whay IROTData interface is implemented by monikers. */ ICOM_VTABLE(IROTData)* lpvtbl2; /* VTable relative to the IROTData interface.*/ @@ -149,13 +149,13 @@ static ICOM_VTABLE(IROTData) VT_ROTDataImpl = HRESULT WINAPI FileMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) { ICOM_THIS(FileMonikerImpl,iface); - + TRACE("(%p,%p,%p)\n",This,riid,ppvObject); /* Perform a sanity check on the parameters.*/ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* Initialize the return parameter */ *ppvObject = 0; @@ -166,14 +166,14 @@ HRESULT WINAPI FileMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** IsEqualIID(&IID_IMoniker, riid) ) *ppvObject = iface; - + else if (IsEqualIID(&IID_IROTData, riid)) *ppvObject = (IROTData*)&(This->lpvtbl2); /* Check that we obtained an interface.*/ if ((*ppvObject)==0) return E_NOINTERFACE; - + /* Query Interface always increases the reference count by one when it is successful */ FileMonikerImpl_AddRef(iface); @@ -210,7 +210,7 @@ ULONG WINAPI FileMonikerImpl_Release(IMoniker* iface) return 0; } - return This->ref;; + return This->ref; } /****************************************************************************** @@ -225,7 +225,7 @@ HRESULT WINAPI FileMonikerImpl_GetClassID(IMoniker* iface, return E_POINTER; *pClassID = CLSID_FileMoniker; - + return S_OK; } @@ -265,7 +265,7 @@ HRESULT WINAPI FileMonikerImpl_Load(IMoniker* iface,IStream* pStm) res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread); if (bread!=sizeof(WORD) || wbuffer!=0) return E_FAIL; - + /* read filePath string length (plus one) */ res=IStream_Read(pStm,&length,sizeof(DWORD),&bread); if (bread != sizeof(DWORD)) @@ -281,18 +281,18 @@ HRESULT WINAPI FileMonikerImpl_Load(IMoniker* iface,IStream* pStm) IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread); if (bread != sizeof(DWORD) || dwbuffer != 0xDEADFFFF) return E_FAIL; - + length--; - + for(i=0;i<10;i++){ res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread); if (bread!=sizeof(WORD) || wbuffer!=0) return E_FAIL; } - + if (length>8) length=0; - + doubleLenHex=doubleLenDec=2*length; if (length > 5) doubleLenDec+=6; @@ -303,7 +303,7 @@ HRESULT WINAPI FileMonikerImpl_Load(IMoniker* iface,IStream* pStm) if (length==0) return res; - + res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread); if (bread!=sizeof(DWORD) || dwbuffer!=doubleLenHex) return E_FAIL; @@ -324,7 +324,7 @@ HRESULT WINAPI FileMonikerImpl_Load(IMoniker* iface,IStream* pStm) This->filePathName=filePathW; HeapFree(GetProcessHeap(),0,filePathA); - + return res; } @@ -335,11 +335,11 @@ HRESULT WINAPI FileMonikerImpl_Save(IMoniker* iface, IStream* pStm,/* pointer to the stream where the object is to be saved */ BOOL fClearDirty)/* Specifies whether to clear the dirty flag */ { - /* this function saves data of this object. In the beginning I thougth - * that I have just to write the filePath string on Stream. But, when I - * tested this function whith windows programs samples, I noticed that it - * was not the case. So I analysed data written by this function on - * Windows and what this did function exactly ! But I have no idea about + /* this function saves data of this object. In the beginning I thougth + * that I have just to write the filePath string on Stream. But, when I + * tested this function whith windows programs samples, I noticed that it + * was not the case. So I analysed data written by this function on + * Windows and what this did function exactly ! But I have no idea about * its logic ! * I guessed data which must be written on stream is: * 1) WORD constant:zero @@ -347,14 +347,14 @@ HRESULT WINAPI FileMonikerImpl_Save(IMoniker* iface, * 3) path string type A * 4) DWORD constant : 0xDEADFFFF * 5) ten WORD constant: zero - * 6) DWORD: double-length of the the path string type W ("\0" not + * 6) DWORD: double-length of the the path string type W ("\0" not * included) * 7) WORD constant: 0x3 * 8) filePath unicode string. * if the length(filePath) > 8 or length(filePath) == 8 stop at step 5) */ - ICOM_THIS(FileMonikerImpl,iface); + ICOM_THIS(FileMonikerImpl,iface); HRESULT res; LPOLESTR filePathW=This->filePathName; @@ -389,15 +389,15 @@ HRESULT WINAPI FileMonikerImpl_Save(IMoniker* iface, /* write a DWORD set to 0xDEADFFFF: constant */ res=IStream_Write(pStm,&constant1,sizeof(DWORD),NULL); - + len--; /* write 10 times a DWORD set to 0 : constants */ for(i=0;i<10;i++) res=IStream_Write(pStm,&zero,sizeof(WORD),NULL); - + if (len>8) len=0; - + doubleLenHex=doubleLenDec=2*len; if (len > 5) doubleLenDec+=6; @@ -436,7 +436,7 @@ HRESULT WINAPI FileMonikerImpl_GetSizeMax(IMoniker* iface, return E_POINTER; /* for more details see FileMonikerImpl_Save coments */ - + sizeMAx = sizeof(WORD) + /* first WORD is 0 */ sizeof(DWORD)+ /* length of filePath including "\0" in the end of the string */ (len+1)+ /* filePath string */ @@ -446,11 +446,11 @@ HRESULT WINAPI FileMonikerImpl_GetSizeMax(IMoniker* iface, if (len==0 || len > 8) return S_OK; - + sizeMAx += sizeof(DWORD)+ /* size of the unicode filePath: "\0" not included */ sizeof(WORD)+ /* constant : 0x3 */ len*sizeof(WCHAR); /* unicde filePath string */ - + pcbSize->s.LowPart=sizeMAx; pcbSize->s.HighPart=0; @@ -468,7 +468,7 @@ HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa WCHAR twoPoint[]={'.','.',0}; WCHAR bkSlash[]={'\\',0}; BYTE addBkSlash; - + TRACE("(%p,%p)\n",This,lpszPathName); /* Initialize the virtual fgunction table. */ @@ -513,10 +513,10 @@ HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa This->filePathName=HeapReAlloc(GetProcessHeap(),0,This->filePathName,(sizeStr+1)*sizeof(WCHAR)); *This->filePathName=0; - + for(i=0;tabStr[i]!=NULL;i++) strcatW(This->filePathName,tabStr[i]); - + if (addBkSlash) strcatW(This->filePathName,bkSlash); } @@ -559,15 +559,15 @@ HRESULT WINAPI FileMonikerImpl_BindToObject(IMoniker* iface, IPersistFile *ppf=0; IClassFactory *pcf=0; IClassActivator *pca=0; - - ICOM_THIS(FileMonikerImpl,iface); + + ICOM_THIS(FileMonikerImpl,iface); *ppvResult=0; TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); if(pmkToLeft==NULL){ - + res=IBindCtx_GetRunningObjectTable(pbc,&prot); if (SUCCEEDED(res)){ @@ -599,7 +599,7 @@ HRESULT WINAPI FileMonikerImpl_BindToObject(IMoniker* iface, if (res==E_NOINTERFACE){ res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IClassActivator,(void**)&pca); - + if (res==E_NOINTERFACE) return MK_E_INTERMEDIATEINTERFACENOTSUPPORTED; } @@ -618,7 +618,7 @@ HRESULT WINAPI FileMonikerImpl_BindToObject(IMoniker* iface, if (pca!=NULL){ FIXME("()\n"); - + /*res=GetClassFile(This->filePathName,&clsID); if (SUCCEEDED(res)){ @@ -654,7 +654,7 @@ HRESULT WINAPI FileMonikerImpl_BindToObject(IMoniker* iface, if (pcf!=NULL) IClassFactory_Release(pcf); - + return res; } @@ -760,7 +760,7 @@ HRESULT WINAPI FileMonikerImpl_ComposeWith(IMoniker* iface, return E_INVALIDARG; *ppmkComposite=0; - + IMoniker_IsSystemMoniker(pmkRight,&mkSys); /* check if we have two filemonikers to compose or not */ @@ -789,7 +789,7 @@ HRESULT WINAPI FileMonikerImpl_ComposeWith(IMoniker* iface, /* the length of the composed path string is raised by the sum of the two paths lengths */ newStr=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(lstrlenW(str1)+lstrlenW(str2)+1)); - + if (newStr==NULL) return E_OUTOFMEMORY; @@ -799,10 +799,10 @@ HRESULT WINAPI FileMonikerImpl_ComposeWith(IMoniker* iface, if ((strDec2[i]==NULL && lastIdx1>-1 && lastIdx2>-1) || lstrcmpW(strDec2[i],bkSlash)!=0) strcatW(newStr,bkSlash); - + for(j=i;j<=lastIdx2;j++) strcatW(newStr,strDec2[j]); - + /* create a new moniker with the new string */ res=CreateFileMoniker(newStr,ppmkComposite); @@ -878,12 +878,12 @@ HRESULT WINAPI FileMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker return res; IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&filePath); - + if (lstrcmpiW(filePath, This->filePathName)!=0) return S_FALSE; - + return S_OK; } @@ -900,7 +900,7 @@ HRESULT WINAPI FileMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash) if (pdwHash==NULL) return E_POINTER; - + val = This->filePathName; len = lstrlenW(val); @@ -984,7 +984,7 @@ HRESULT WINAPI FileMonikerImpl_GetTimeOfLastChange(IMoniker* iface, if (!GetFileAttributesExW(This->filePathName,GetFileExInfoStandard,&info)) return MK_E_NOOBJECT; - + *pFileTime=info.ftLastWriteTime; } @@ -1019,9 +1019,9 @@ HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOth if (pmkOther==NULL) return E_INVALIDARG; - + *ppmkPrefix=0; - + /* check if we have the same type of moniker */ IMoniker_IsSystemMoniker(pmkOther,&mkSys); @@ -1043,7 +1043,7 @@ HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOth commonPath=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1)); *commonPath=0; - + for(sameIdx=0; ( (stringTable1[sameIdx]!=NULL) && (stringTable2[sameIdx]!=NULL) && (lstrcmpiW(stringTable1[sameIdx],stringTable2[sameIdx])==0)); sameIdx++); @@ -1062,13 +1062,13 @@ HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOth if (machimeNameCase && *stringTable1[sameIdx-1]=='\\') sameIdx--; - + if (machimeNameCase && (sameIdx<=3) && (nb1 > 3 || nb2 > 3) ) return MK_E_NOPREFIX; for(i=0;ifilePathName); - + return S_OK; } @@ -1267,7 +1267,7 @@ HRESULT WINAPI FileMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys) if (!pwdMksys) return E_POINTER; - + (*pwdMksys)=MKSYS_FILEMONIKER; return S_OK; @@ -1304,7 +1304,7 @@ ULONG WINAPI FileMonikerROTDataImpl_AddRef(IROTData *iface) ULONG WINAPI FileMonikerROTDataImpl_Release(IROTData* iface) { ICOM_THIS_From_IROTData(IMoniker, iface); - + TRACE("(%p)\n",This); return FileMonikerImpl_Release(This); @@ -1348,9 +1348,9 @@ HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER * ppmk) if(lpszPathName==NULL) return MK_E_SYNTAX; - + *ppmk=0; - + newFileMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(FileMonikerImpl)); if (newFileMoniker == 0) diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c index 6fa7750ec7e..8e76f3f4806 100644 --- a/dlls/ole32/hglobalstream.c +++ b/dlls/ole32/hglobalstream.c @@ -48,7 +48,7 @@ struct HGLOBALStreamImpl { ICOM_VFIELD(IStream); /* Needs to be the first item in the stuct * since we want to cast this in a IStream pointer */ - + /* * Reference count */ @@ -93,71 +93,71 @@ void HGLOBALStreamImpl_OpenBlockChain( HRESULT WINAPI HGLOBALStreamImpl_QueryInterface( IStream* iface, - REFIID riid, /* [in] */ - void** ppvObject); /* [iid_is][out] */ - + REFIID riid, /* [in] */ + void** ppvObject); /* [iid_is][out] */ + ULONG WINAPI HGLOBALStreamImpl_AddRef( IStream* iface); - + ULONG WINAPI HGLOBALStreamImpl_Release( IStream* iface); - -HRESULT WINAPI HGLOBALStreamImpl_Read( + +HRESULT WINAPI HGLOBALStreamImpl_Read( IStream* iface, void* pv, /* [length_is][size_is][out] */ - ULONG cb, /* [in] */ - ULONG* pcbRead); /* [out] */ - + ULONG cb, /* [in] */ + ULONG* pcbRead); /* [out] */ + HRESULT WINAPI HGLOBALStreamImpl_Write( IStream* iface, - const void* pv, /* [size_is][in] */ - ULONG cb, /* [in] */ - ULONG* pcbWritten); /* [out] */ - -HRESULT WINAPI HGLOBALStreamImpl_Seek( - IStream* iface, - LARGE_INTEGER dlibMove, /* [in] */ - DWORD dwOrigin, /* [in] */ - ULARGE_INTEGER* plibNewPosition); /* [out] */ - -HRESULT WINAPI HGLOBALStreamImpl_SetSize( - IStream* iface, - ULARGE_INTEGER libNewSize); /* [in] */ - -HRESULT WINAPI HGLOBALStreamImpl_CopyTo( - IStream* iface, - IStream* pstm, /* [unique][in] */ - ULARGE_INTEGER cb, /* [in] */ - ULARGE_INTEGER* pcbRead, /* [out] */ - ULARGE_INTEGER* pcbWritten); /* [out] */ + const void* pv, /* [size_is][in] */ + ULONG cb, /* [in] */ + ULONG* pcbWritten); /* [out] */ -HRESULT WINAPI HGLOBALStreamImpl_Commit( +HRESULT WINAPI HGLOBALStreamImpl_Seek( + IStream* iface, + LARGE_INTEGER dlibMove, /* [in] */ + DWORD dwOrigin, /* [in] */ + ULARGE_INTEGER* plibNewPosition); /* [out] */ + +HRESULT WINAPI HGLOBALStreamImpl_SetSize( + IStream* iface, + ULARGE_INTEGER libNewSize); /* [in] */ + +HRESULT WINAPI HGLOBALStreamImpl_CopyTo( + IStream* iface, + IStream* pstm, /* [unique][in] */ + ULARGE_INTEGER cb, /* [in] */ + ULARGE_INTEGER* pcbRead, /* [out] */ + ULARGE_INTEGER* pcbWritten); /* [out] */ + +HRESULT WINAPI HGLOBALStreamImpl_Commit( IStream* iface, - DWORD grfCommitFlags); /* [in] */ - -HRESULT WINAPI HGLOBALStreamImpl_Revert( + DWORD grfCommitFlags); /* [in] */ + +HRESULT WINAPI HGLOBALStreamImpl_Revert( IStream* iface); - -HRESULT WINAPI HGLOBALStreamImpl_LockRegion( + +HRESULT WINAPI HGLOBALStreamImpl_LockRegion( IStream* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType); /* [in] */ - -HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion( + ULARGE_INTEGER libOffset, /* [in] */ + ULARGE_INTEGER cb, /* [in] */ + DWORD dwLockType); /* [in] */ + +HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion( IStream* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType); /* [in] */ - -HRESULT WINAPI HGLOBALStreamImpl_Stat( + ULARGE_INTEGER libOffset, /* [in] */ + ULARGE_INTEGER cb, /* [in] */ + DWORD dwLockType); /* [in] */ + +HRESULT WINAPI HGLOBALStreamImpl_Stat( IStream* iface, STATSTG* pstatstg, /* [out] */ - DWORD grfStatFlag); /* [in] */ - -HRESULT WINAPI HGLOBALStreamImpl_Clone( + DWORD grfStatFlag); /* [in] */ + +HRESULT WINAPI HGLOBALStreamImpl_Clone( IStream* iface, - IStream** ppstm); /* [out] */ + IStream** ppstm); /* [out] */ /* @@ -186,8 +186,8 @@ static ICOM_VTABLE(IStream) HGLOBALStreamImpl_Vtbl = * CreateStreamOnHGlobal [OLE32.61] */ HRESULT WINAPI CreateStreamOnHGlobal( - HGLOBAL hGlobal, - BOOL fDeleteOnRelease, + HGLOBAL hGlobal, + BOOL fDeleteOnRelease, LPSTREAM* ppstm) { HGLOBALStreamImpl* newStream; @@ -197,7 +197,7 @@ HRESULT WINAPI CreateStreamOnHGlobal( if (newStream!=NULL) { - return IUnknown_QueryInterface((IUnknown*)newStream, + return IUnknown_QueryInterface((IUnknown*)newStream, &IID_IStream, (void**)ppstm); } @@ -240,7 +240,7 @@ HRESULT WINAPI GetHGlobalFromStream(IStream* pstm, HGLOBAL* phglobal) * * Params: * hGlobal - Handle that will support the stream. can be NULL. - * fDeleteOnRelease - Flag set to TRUE if the HGLOBAL will be released + * fDeleteOnRelease - Flag set to TRUE if the HGLOBAL will be released * when the IStream object is destroyed. */ HGLOBALStreamImpl* HGLOBALStreamImpl_Construct( @@ -250,7 +250,7 @@ HGLOBALStreamImpl* HGLOBALStreamImpl_Construct( HGLOBALStreamImpl* newStream; newStream = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALStreamImpl)); - + if (newStream!=0) { /* @@ -258,7 +258,7 @@ HGLOBALStreamImpl* HGLOBALStreamImpl_Construct( */ ICOM_VTBL(newStream) = &HGLOBALStreamImpl_Vtbl; newStream->ref = 0; - + /* * Initialize the support. */ @@ -273,27 +273,27 @@ HGLOBALStreamImpl* HGLOBALStreamImpl_Construct( newStream->supportHandle = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD | GMEM_SHARE, 0); } - + /* * Start the stream at the beginning. */ newStream->currentPosition.s.HighPart = 0; newStream->currentPosition.s.LowPart = 0; - + /* * Initialize the size of the stream to the size of the handle. */ newStream->streamSize.s.HighPart = 0; newStream->streamSize.s.LowPart = GlobalSize(newStream->supportHandle); } - + return newStream; } /*** * This is the destructor of the HGLOBALStreamImpl class. * - * This method will clean-up all the resources used-up by the given HGLOBALStreamImpl + * This method will clean-up all the resources used-up by the given HGLOBALStreamImpl * class. The pointer passed-in to this function will be freed and will not * be valid anymore. */ @@ -313,7 +313,7 @@ void HGLOBALStreamImpl_Destroy(HGLOBALStreamImpl* This) /* * Finally, free the memory used-up by the class. */ - HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, This); } /*** @@ -322,8 +322,8 @@ void HGLOBALStreamImpl_Destroy(HGLOBALStreamImpl* This) */ HRESULT WINAPI HGLOBALStreamImpl_QueryInterface( IStream* iface, - REFIID riid, /* [in] */ - void** ppvObject) /* [iid_is][out] */ + REFIID riid, /* [in] */ + void** ppvObject) /* [iid_is][out] */ { HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; @@ -332,37 +332,37 @@ HRESULT WINAPI HGLOBALStreamImpl_QueryInterface( */ if (ppvObject==0) return E_INVALIDARG; - + /* * Initialize the return parameter. */ *ppvObject = 0; - + /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = (IStream*)This; } - else if (memcmp(&IID_IStream, riid, sizeof(IID_IStream)) == 0) + else if (memcmp(&IID_IStream, riid, sizeof(IID_IStream)) == 0) { *ppvObject = (IStream*)This; } - + /* * Check that we obtained an interface. */ if ((*ppvObject)==0) return E_NOINTERFACE; - + /* * Query Interface always increases the reference count by one when it is * successful */ HGLOBALStreamImpl_AddRef(iface); - - return S_OK;; + + return S_OK; } /*** @@ -375,7 +375,7 @@ ULONG WINAPI HGLOBALStreamImpl_AddRef( HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; This->ref++; - + return This->ref; } @@ -389,11 +389,11 @@ ULONG WINAPI HGLOBALStreamImpl_Release( HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; ULONG newRef; - + This->ref--; - + newRef = This->ref; - + /* * If the reference count goes down to 0, perform suicide. */ @@ -401,7 +401,7 @@ ULONG WINAPI HGLOBALStreamImpl_Release( { HGLOBALStreamImpl_Destroy(This); } - + return newRef; } @@ -414,11 +414,11 @@ ULONG WINAPI HGLOBALStreamImpl_Release( * * See the documentation of ISequentialStream for more info. */ -HRESULT WINAPI HGLOBALStreamImpl_Read( +HRESULT WINAPI HGLOBALStreamImpl_Read( IStream* iface, void* pv, /* [length_is][size_is][out] */ - ULONG cb, /* [in] */ - ULONG* pcbRead) /* [out] */ + ULONG cb, /* [in] */ + ULONG* pcbRead) /* [out] */ { HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; @@ -428,14 +428,14 @@ HRESULT WINAPI HGLOBALStreamImpl_Read( TRACE("(%p, %p, %ld, %p)\n", iface, pv, cb, pcbRead); - - /* + + /* * If the caller is not interested in the nubmer of bytes read, * we use another buffer to avoid "if" statements in the code. */ if (pcbRead==0) pcbRead = &bytesReadBuffer; - + /* * Using the known size of the stream, calculate the number of bytes * to read from the block chain @@ -463,7 +463,7 @@ HRESULT WINAPI HGLOBALStreamImpl_Read( * Cleanup */ GlobalUnlock(This->supportHandle); - + /* * The function returns S_OK if the buffer was filled completely * it returns S_FALSE if the end of the stream is reached before the @@ -471,10 +471,10 @@ HRESULT WINAPI HGLOBALStreamImpl_Read( */ if(*pcbRead == cb) return S_OK; - + return S_FALSE; } - + /*** * This method is part of the ISequentialStream interface. * @@ -487,9 +487,9 @@ HRESULT WINAPI HGLOBALStreamImpl_Read( */ HRESULT WINAPI HGLOBALStreamImpl_Write( IStream* iface, - const void* pv, /* [size_is][in] */ - ULONG cb, /* [in] */ - ULONG* pcbWritten) /* [out] */ + const void* pv, /* [size_is][in] */ + ULONG cb, /* [in] */ + ULONG* pcbWritten) /* [out] */ { HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; @@ -499,14 +499,14 @@ HRESULT WINAPI HGLOBALStreamImpl_Write( TRACE("(%p, %p, %ld, %p)\n", iface, pv, cb, pcbWritten); - + /* * If the caller is not interested in the number of bytes written, * we use another buffer to avoid "if" statements in the code. */ if (pcbWritten == 0) pcbWritten = &bytesWritten; - + if (cb == 0) { return S_OK; @@ -516,7 +516,7 @@ HRESULT WINAPI HGLOBALStreamImpl_Write( newSize.s.HighPart = 0; newSize.s.LowPart = This->currentPosition.s.LowPart + cb; } - + /* * Verify if we need to grow the stream */ @@ -525,13 +525,13 @@ HRESULT WINAPI HGLOBALStreamImpl_Write( /* grow stream */ IStream_SetSize(iface, newSize); } - + /* * Lock the buffer in position and copy the data. */ supportBuffer = GlobalLock(This->supportHandle); - memcpy((char *) supportBuffer+This->currentPosition.s.LowPart, pv, cb); + memcpy((char *) supportBuffer+This->currentPosition.s.LowPart, pv, cb); /* * Move the current position to the new position @@ -547,7 +547,7 @@ HRESULT WINAPI HGLOBALStreamImpl_Write( * Cleanup */ GlobalUnlock(This->supportHandle); - + return S_OK; } @@ -558,11 +558,11 @@ HRESULT WINAPI HGLOBALStreamImpl_Write( * given. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI HGLOBALStreamImpl_Seek( + */ +HRESULT WINAPI HGLOBALStreamImpl_Seek( IStream* iface, - LARGE_INTEGER dlibMove, /* [in] */ - DWORD dwOrigin, /* [in] */ + LARGE_INTEGER dlibMove, /* [in] */ + DWORD dwOrigin, /* [in] */ ULARGE_INTEGER* plibNewPosition) /* [out] */ { HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; @@ -572,7 +572,7 @@ HRESULT WINAPI HGLOBALStreamImpl_Seek( TRACE("(%p, %ld, %ld, %p)\n", iface, dlibMove.s.LowPart, dwOrigin, plibNewPosition); - /* + /* * The caller is allowed to pass in NULL as the new position return value. * If it happens, we assign it to a dynamic variable to avoid special cases * in the code below. @@ -626,7 +626,7 @@ HRESULT WINAPI HGLOBALStreamImpl_Seek( */ plibNewPosition->s.LowPart += dlibMove.s.LowPart; This->currentPosition = *plibNewPosition; - + return S_OK; } @@ -639,9 +639,9 @@ HRESULT WINAPI HGLOBALStreamImpl_Seek( * * See the documentation of IStream for more info. */ -HRESULT WINAPI HGLOBALStreamImpl_SetSize( +HRESULT WINAPI HGLOBALStreamImpl_SetSize( IStream* iface, - ULARGE_INTEGER libNewSize) /* [in] */ + ULARGE_INTEGER libNewSize) /* [in] */ { HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; @@ -652,22 +652,22 @@ HRESULT WINAPI HGLOBALStreamImpl_SetSize( */ if (libNewSize.s.HighPart != 0) return STG_E_INVALIDFUNCTION; - + if (This->streamSize.s.LowPart == libNewSize.s.LowPart) return S_OK; /* * Re allocate the HGlobal to fit the new size of the stream. */ - This->supportHandle = GlobalReAlloc(This->supportHandle, + This->supportHandle = GlobalReAlloc(This->supportHandle, libNewSize.s.LowPart, 0); This->streamSize.s.LowPart = libNewSize.s.LowPart; - + return S_OK; } - + /*** * This method is part of the IStream interface. * @@ -675,12 +675,12 @@ HRESULT WINAPI HGLOBALStreamImpl_SetSize( * * See the documentation of IStream for more info. */ -HRESULT WINAPI HGLOBALStreamImpl_CopyTo( +HRESULT WINAPI HGLOBALStreamImpl_CopyTo( IStream* iface, - IStream* pstm, /* [unique][in] */ - ULARGE_INTEGER cb, /* [in] */ - ULARGE_INTEGER* pcbRead, /* [out] */ - ULARGE_INTEGER* pcbWritten) /* [out] */ + IStream* pstm, /* [unique][in] */ + ULARGE_INTEGER cb, /* [in] */ + ULARGE_INTEGER* pcbRead, /* [out] */ + ULARGE_INTEGER* pcbWritten) /* [out] */ { HRESULT hr = S_OK; BYTE tmpBuffer[128]; @@ -688,7 +688,7 @@ HRESULT WINAPI HGLOBALStreamImpl_CopyTo( ULARGE_INTEGER totalBytesRead; ULARGE_INTEGER totalBytesWritten; - TRACE("(%p, %p, %ld, %p, %p)\n", iface, pstm, + TRACE("(%p, %p, %ld, %p, %p)\n", iface, pstm, cb.s.LowPart, pcbRead, pcbWritten); /* @@ -711,11 +711,11 @@ HRESULT WINAPI HGLOBALStreamImpl_CopyTo( copySize = 128; else copySize = cb.s.LowPart; - + IStream_Read(iface, tmpBuffer, copySize, &bytesRead); totalBytesRead.s.LowPart += bytesRead; - + IStream_Write(pstm, tmpBuffer, bytesRead, &bytesWritten); totalBytesWritten.s.LowPart += bytesWritten; @@ -728,7 +728,7 @@ HRESULT WINAPI HGLOBALStreamImpl_CopyTo( hr = STG_E_MEDIUMFULL; break; } - + if (bytesRead!=copySize) cb.s.LowPart = 0; else @@ -755,14 +755,14 @@ HRESULT WINAPI HGLOBALStreamImpl_CopyTo( /*** * This method is part of the IStream interface. * - * For streams supported by HGLOBALS, this function does nothing. + * For streams supported by HGLOBALS, this function does nothing. * This is what the documentation tells us. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI HGLOBALStreamImpl_Commit( + */ +HRESULT WINAPI HGLOBALStreamImpl_Commit( IStream* iface, - DWORD grfCommitFlags) /* [in] */ + DWORD grfCommitFlags) /* [in] */ { return S_OK; } @@ -770,12 +770,12 @@ HRESULT WINAPI HGLOBALStreamImpl_Commit( /*** * This method is part of the IStream interface. * - * For streams supported by HGLOBALS, this function does nothing. + * For streams supported by HGLOBALS, this function does nothing. * This is what the documentation tells us. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI HGLOBALStreamImpl_Revert( + */ +HRESULT WINAPI HGLOBALStreamImpl_Revert( IStream* iface) { return S_OK; @@ -784,16 +784,16 @@ HRESULT WINAPI HGLOBALStreamImpl_Revert( /*** * This method is part of the IStream interface. * - * For streams supported by HGLOBALS, this function does nothing. + * For streams supported by HGLOBALS, this function does nothing. * This is what the documentation tells us. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI HGLOBALStreamImpl_LockRegion( + */ +HRESULT WINAPI HGLOBALStreamImpl_LockRegion( IStream* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType) /* [in] */ + ULARGE_INTEGER libOffset, /* [in] */ + ULARGE_INTEGER cb, /* [in] */ + DWORD dwLockType) /* [in] */ { return S_OK; } @@ -801,16 +801,16 @@ HRESULT WINAPI HGLOBALStreamImpl_LockRegion( /* * This method is part of the IStream interface. * - * For streams supported by HGLOBALS, this function does nothing. + * For streams supported by HGLOBALS, this function does nothing. * This is what the documentation tells us. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion( + */ +HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion( IStream* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType) /* [in] */ + ULARGE_INTEGER libOffset, /* [in] */ + ULARGE_INTEGER cb, /* [in] */ + DWORD dwLockType) /* [in] */ { return S_OK; } @@ -822,11 +822,11 @@ HRESULT WINAPI HGLOBALStreamImpl_UnlockRegion( * stream. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI HGLOBALStreamImpl_Stat( + */ +HRESULT WINAPI HGLOBALStreamImpl_Stat( IStream* iface, STATSTG* pstatstg, /* [out] */ - DWORD grfStatFlag) /* [in] */ + DWORD grfStatFlag) /* [in] */ { HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; @@ -838,10 +838,10 @@ HRESULT WINAPI HGLOBALStreamImpl_Stat( return S_OK; } - -HRESULT WINAPI HGLOBALStreamImpl_Clone( + +HRESULT WINAPI HGLOBALStreamImpl_Clone( IStream* iface, - IStream** ppstm) /* [out] */ + IStream** ppstm) /* [out] */ { FIXME("not implemented!\n"); return E_NOTIMPL; diff --git a/dlls/ole32/ifs.c b/dlls/ole32/ifs.c index b88abc0ef46..0e37e4d7eea 100644 --- a/dlls/ole32/ifs.c +++ b/dlls/ole32/ifs.c @@ -49,7 +49,7 @@ typedef struct /****************************************************************************** * IUnknown_AddRef [VTABLE:IUNKNOWN.1] */ -static ULONG WINAPI IUnknown_fnAddRef(LPUNKNOWN iface) { +static ULONG WINAPI IUnknown_fnAddRef(LPUNKNOWN iface) { ICOM_THIS(IUnknownImpl,iface); TRACE("(%p)->AddRef()\n",This); return ++(This->ref); @@ -78,12 +78,12 @@ static HRESULT WINAPI IUnknown_fnQueryInterface(LPUNKNOWN iface,REFIID refiid,LP if (!memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown))) { *obj = This; - return 0; + return 0; } - return OLE_E_ENUM_NOMORE; + return OLE_E_ENUM_NOMORE; } -static ICOM_VTABLE(IUnknown) uvt = +static ICOM_VTABLE(IUnknown) uvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IUnknown_fnQueryInterface, @@ -129,7 +129,7 @@ HRESULT WINAPI IMalloc16_fnQueryInterface(IMalloc16* iface,REFIID refiid,LPVOID *obj = This; return 0; } - return OLE_E_ENUM_NOMORE; + return OLE_E_ENUM_NOMORE; } /****************************************************************************** @@ -267,7 +267,7 @@ static HRESULT WINAPI IMalloc_fnQueryInterface(LPMALLOC iface,REFIID refiid,LPVO *obj = This; return S_OK; } - return OLE_E_ENUM_NOMORE; + return OLE_E_ENUM_NOMORE; } /****************************************************************************** @@ -343,7 +343,7 @@ static VOID WINAPI IMalloc_fnHeapMinimize(LPMALLOC iface) { TRACE("(%p)->HeapMinimize()\n",This); } -static ICOM_VTABLE(IMalloc) VT_IMalloc32 = +static ICOM_VTABLE(IMalloc) VT_IMalloc32 = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IMalloc_fnQueryInterface, diff --git a/dlls/ole32/itemmoniker.c b/dlls/ole32/itemmoniker.c index 4a74cf9bcf7..13342b49386 100644 --- a/dlls/ole32/itemmoniker.c +++ b/dlls/ole32/itemmoniker.c @@ -38,7 +38,7 @@ typedef struct ItemMonikerImpl{ ICOM_VTABLE(IMoniker)* lpvtbl1; /* VTable relative to the IMoniker interface.*/ - /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether + /* The ROT (RunningObjectTable implementation) uses the IROTData interface to test whether * two monikers are equal. That's whay IROTData interface is implemented by monikers. */ ICOM_VTABLE(IROTData)* lpvtbl2; /* VTable relative to the IROTData interface.*/ @@ -48,7 +48,7 @@ typedef struct ItemMonikerImpl{ LPOLESTR itemName; /* item name identified by this ItemMoniker */ LPOLESTR itemDelimiter; /* Delimiter string */ - + } ItemMonikerImpl; /********************************************************************************/ @@ -154,7 +154,7 @@ HRESULT WINAPI ItemMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** /* Perform a sanity check on the parameters.*/ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* Initialize the return parameter */ *ppvObject = 0; @@ -165,14 +165,14 @@ HRESULT WINAPI ItemMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** IsEqualIID(&IID_IMoniker, riid) ) *ppvObject = iface; - + else if (IsEqualIID(&IID_IROTData, riid)) *ppvObject = (IROTData*)&(This->lpvtbl2); /* Check that we obtained an interface.*/ if ((*ppvObject)==0) return E_NOINTERFACE; - + /* Query Interface always increases the reference count by one when it is successful */ ItemMonikerImpl_AddRef(iface); @@ -209,7 +209,7 @@ ULONG WINAPI ItemMonikerImpl_Release(IMoniker* iface) return 0; } - return This->ref;; + return This->ref; } /****************************************************************************** @@ -221,9 +221,9 @@ HRESULT WINAPI ItemMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID) if (pClassID==NULL) return E_POINTER; - + *pClassID = CLSID_ItemMoniker; - + return S_OK; } @@ -355,7 +355,7 @@ HRESULT WINAPI ItemMonikerImpl_GetSizeMax(IMoniker* iface, return E_POINTER; /* for more details see ItemMonikerImpl_Save coments */ - + pcbSize->s.LowPart = sizeof(DWORD) + /* DWORD which contains delimiter length */ delimiterLength + /* item delimiter string */ sizeof(DWORD) + /* DWORD which contains item name length */ @@ -432,7 +432,7 @@ HRESULT WINAPI ItemMonikerImpl_BindToObject(IMoniker* iface, VOID** ppvResult) { ICOM_THIS(ItemMonikerImpl,iface); - + HRESULT res; IID refid=IID_IOleItemContainer; IOleItemContainer *poic=0; @@ -479,7 +479,7 @@ HRESULT WINAPI ItemMonikerImpl_BindToStorage(IMoniker* iface, if(pmkToLeft==NULL) return E_INVALIDARG; - + res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic); if (SUCCEEDED(res)){ @@ -509,7 +509,7 @@ HRESULT WINAPI ItemMonikerImpl_Reduce(IMoniker* iface, ItemMonikerImpl_AddRef(iface); *ppmkReduced=iface; - + return MK_S_REDUCED_TO_SELF; } /****************************************************************************** @@ -532,7 +532,7 @@ HRESULT WINAPI ItemMonikerImpl_ComposeWith(IMoniker* iface, return E_POINTER; *ppmkComposite=0; - + IMoniker_IsSystemMoniker(pmkRight,&mkSys); /* If pmkRight is an anti-moniker, the returned moniker is NULL */ @@ -542,7 +542,7 @@ HRESULT WINAPI ItemMonikerImpl_ComposeWith(IMoniker* iface, else /* if pmkRight is a composite whose leftmost component is an anti-moniker, */ /* the returned moniker is the composite after the leftmost anti-moniker is removed. */ - + if(mkSys==MKSYS_GENERICCOMPOSITE){ res=IMoniker_Enum(pmkRight,TRUE,&penumMk); @@ -560,7 +560,7 @@ HRESULT WINAPI ItemMonikerImpl_ComposeWith(IMoniker* iface, tempMkComposite=iface; IMoniker_AddRef(iface); - + while(IEnumMoniker_Next(penumMk,1,&pmostLeftMk,NULL)==S_OK){ res=CreateGenericComposite(tempMkComposite,pmostLeftMk,ppmkComposite); @@ -617,7 +617,7 @@ HRESULT WINAPI ItemMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker if (pmkOtherMoniker==NULL) return S_FALSE; - + /* This method returns S_OK if both monikers are item monikers and their display names are */ /* identical (using a case-insensitive comparison); otherwise, the method returns S_FALSE. */ @@ -632,10 +632,10 @@ HRESULT WINAPI ItemMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker IMoniker_GetDisplayName(iface,bind,NULL,&dispName1); IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&dispName2); - + if (lstrcmpW(dispName1,dispName2)!=0) return S_FALSE; - + return S_OK; } @@ -652,7 +652,7 @@ HRESULT WINAPI ItemMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash) if (pdwHash==NULL) return E_POINTER; - + val = This->itemName; len = lstrlenW(val); @@ -711,7 +711,7 @@ HRESULT WINAPI ItemMonikerImpl_IsRunning(IMoniker* iface, /* If pmkToLeft is non-NULL, the method calls IMoniker::BindToObject on the pmkToLeft parameter, */ /* requesting an IOleItemContainer interface pointer. The method then calls IOleItemContainer::IsRunning,*/ /* passing the string contained within this moniker. */ - + res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IOleItemContainer,(void**)&poic); if (SUCCEEDED(res)){ @@ -792,9 +792,9 @@ HRESULT WINAPI ItemMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOth if((mkSys==MKSYS_ITEMMONIKER) && (IMoniker_IsEqual(iface,pmkOther)==S_OK) ){ *ppmkPrefix=iface; - + IMoniker_AddRef(iface); - + return MK_S_US; } else @@ -814,7 +814,7 @@ HRESULT WINAPI ItemMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, return E_POINTER; *ppmkRelPath=0; - + return MK_E_NOTBINDABLE; } @@ -844,7 +844,7 @@ HRESULT WINAPI ItemMonikerImpl_GetDisplayName(IMoniker* iface, strcpyW(*ppszDisplayName,This->itemDelimiter); strcatW(*ppszDisplayName,This->itemName); - + return S_OK; } @@ -899,7 +899,7 @@ HRESULT WINAPI ItemMonikerImpl_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys) if (!pwdMksys) return E_POINTER; - + (*pwdMksys)=MKSYS_ITEMMONIKER; return S_OK; @@ -936,7 +936,7 @@ ULONG WINAPI ItemMonikerROTDataImpl_AddRef(IROTData *iface) ULONG WINAPI ItemMonikerROTDataImpl_Release(IROTData* iface) { ICOM_THIS_From_IROTData(IMoniker, iface); - + TRACE("(%p)\n",iface); return ItemMonikerImpl_Release(This); diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index 57242f149fa..2256dcc1ca3 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -540,8 +540,8 @@ release_marshal: /*********************************************************************** * CoMarshalInterThreadInterfaceInStream [OLE32.33] * - * Marshal interfaces across threads. We don't have a thread distinction, - * meaning most interfaces just work across different threads, the RPC + * Marshal interfaces across threads. We don't have a thread distinction, + * meaning most interfaces just work across different threads, the RPC * handles it. */ HRESULT WINAPI @@ -600,7 +600,7 @@ SMCF_CreateInstance( if (IsEqualIID(riid,&IID_IMarshal)) { StdMarshalImpl *dm; dm=(StdMarshalImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(StdMarshalImpl)); - if (!dm) + if (!dm) return E_FAIL; dm->lpvtbl = &stdmvtbl; dm->ref = 1; diff --git a/dlls/ole32/memlockbytes.c b/dlls/ole32/memlockbytes.c index 8ad655b7047..31e97530c54 100644 --- a/dlls/ole32/memlockbytes.c +++ b/dlls/ole32/memlockbytes.c @@ -42,7 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); struct HGLOBALLockBytesImpl { /* - * Needs to be the first item in the stuct + * Needs to be the first item in the stuct * since we want to cast this in an ILockBytes pointer */ ICOM_VFIELD(ILockBytes); @@ -205,7 +205,7 @@ HGLOBALLockBytesImpl* HGLOBALLockBytesImpl_Construct(HGLOBAL hGlobal, { HGLOBALLockBytesImpl* newLockBytes; newLockBytes = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALLockBytesImpl)); - + if (newLockBytes!=0) { /* @@ -213,7 +213,7 @@ HGLOBALLockBytesImpl* HGLOBALLockBytesImpl_Construct(HGLOBAL hGlobal, */ ICOM_VTBL(newLockBytes) = &HGLOBALLockBytesImpl_Vtbl; newLockBytes->ref = 0; - + /* * Initialize the support. */ @@ -311,7 +311,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_QueryInterface( */ HGLOBALLockBytesImpl_AddRef(iface); - return S_OK;; + return S_OK; } /****************************************************************************** @@ -415,7 +415,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt( /* * The function returns S_OK if the specified number of bytes were read * or the end of the array was reached. - * It returns STG_E_READFAULT if the number of bytes to read does not equal + * It returns STG_E_READFAULT if the number of bytes to read does not equal * the number of bytes actually read. */ if(*pcbRead == cb) @@ -520,7 +520,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_SetSize( */ if (libNewSize.s.HighPart != 0) return STG_E_INVALIDFUNCTION; - + if (This->byteArraySize.s.LowPart == libNewSize.s.LowPart) return S_OK; @@ -535,7 +535,7 @@ HRESULT WINAPI HGLOBALLockBytesImpl_SetSize( return STG_E_MEDIUMFULL; This->byteArraySize.s.LowPart = libNewSize.s.LowPart; - + return S_OK; } diff --git a/dlls/ole32/moniker.c b/dlls/ole32/moniker.c index ce28586e6d4..103d450896b 100644 --- a/dlls/ole32/moniker.c +++ b/dlls/ole32/moniker.c @@ -58,7 +58,7 @@ typedef struct RunningObjectTableImpl{ DWORD runObjTabSize; /* current table size */ DWORD runObjTabLastIndx; /* first free index element in the table. */ DWORD runObjTabRegister; /* registration key of the next registered object */ - + } RunningObjectTableImpl; RunningObjectTableImpl* runningObjectTableInstance=0; @@ -148,7 +148,7 @@ ULONG WINAPI RunningObjectTableImpl_AddRef(IRunningObjectTable* iface) HRESULT WINAPI RunningObjectTableImpl_Destroy() { TRACE("()\n"); - + if (runningObjectTableInstance==NULL) return E_INVALIDARG; @@ -181,7 +181,7 @@ ULONG WINAPI RunningObjectTableImpl_Release(IRunningObjectTable* iface) { if (( This->runObjTab[i].regTypeObj & ROTFLAGS_REGISTRATIONKEEPSALIVE) != 0) IUnknown_Release(This->runObjTab[i].pObj); - + IMoniker_Release(This->runObjTab[i].pmkObj); } /* RunningObjectTable data structure will be not destroyed here ! the destruction will be done only @@ -241,7 +241,7 @@ HRESULT WINAPI RunningObjectTableImpl_UnInitialize() if (runningObjectTableInstance==NULL) return E_POINTER; - + RunningObjectTableImpl_Release((IRunningObjectTable*)runningObjectTableInstance); RunningObjectTableImpl_Destroy(); @@ -282,7 +282,7 @@ HRESULT WINAPI RunningObjectTableImpl_Register(IRunningObjectTable* iface, This->runObjTab[This->runObjTabLastIndx].regTypeObj = grfFlags; This->runObjTab[This->runObjTabLastIndx].identRegObj = This->runObjTabRegister; CoFileTimeNow(&(This->runObjTab[This->runObjTabLastIndx].lastModifObj)); - + /* gives a registration identifier to the registered object*/ (*pdwRegister)= This->runObjTabRegister; @@ -293,7 +293,7 @@ HRESULT WINAPI RunningObjectTableImpl_Register(IRunningObjectTable* iface, } This->runObjTabRegister++; This->runObjTabLastIndx++; - + if (This->runObjTabLastIndx == This->runObjTabSize){ /* table is full ! so it must be resized */ This->runObjTabSize+=BLOCK_TAB_SIZE; /* newsize table */ @@ -307,7 +307,7 @@ HRESULT WINAPI RunningObjectTableImpl_Register(IRunningObjectTable* iface, IUnknown_AddRef(punkObject); IMoniker_AddRef(pmkObjectName); - + return res; } @@ -333,11 +333,11 @@ HRESULT WINAPI RunningObjectTableImpl_Revoke( IRunningObjectTable* iface, IUnknown_Release(This->runObjTab[index].pObj); IMoniker_Release(This->runObjTab[index].pmkObj); - + /* remove the object from the table */ for(j=index; jrunObjTabLastIndx-1; j++) This->runObjTab[j]= This->runObjTab[j+1]; - + This->runObjTabLastIndx--; return S_OK; @@ -348,7 +348,7 @@ HRESULT WINAPI RunningObjectTableImpl_Revoke( IRunningObjectTable* iface, */ HRESULT WINAPI RunningObjectTableImpl_IsRunning( IRunningObjectTable* iface, IMoniker *pmkObjectName) /* Pointer to the moniker of the object whose status is desired */ -{ +{ ICOM_THIS(RunningObjectTableImpl,iface); TRACE("(%p,%p)\n",This,pmkObjectName); @@ -370,7 +370,7 @@ HRESULT WINAPI RunningObjectTableImpl_GetObject( IRunningObjectTable* iface, if (ppunkObject==NULL) return E_POINTER; - + *ppunkObject=0; /* verify if the object was registered before or not */ @@ -405,7 +405,7 @@ HRESULT WINAPI RunningObjectTableImpl_NoteChangeTime(IRunningObjectTable* iface, return S_OK; } - + /*********************************************************************** * RunningObjectTable_GetTimeOfLastChange */ @@ -423,7 +423,7 @@ HRESULT WINAPI RunningObjectTableImpl_GetTimeOfLastChange(IRunningObjectTable* i /* verify if the object was registered before or not */ if (RunningObjectTableImpl_GetObjectIndex(This,-1,pmkObjectName,&index)==S_FALSE) - return MK_E_UNAVAILABLE;; + return MK_E_UNAVAILABLE; (*pfiletime)= This->runObjTab[index].lastModifObj; @@ -459,7 +459,7 @@ HRESULT WINAPI RunningObjectTableImpl_GetObjectIndex(RunningObjectTableImpl* Thi else /* search object identified by a register identifier */ for(i=0;((irunObjTabLastIndx)&&(This->runObjTab[i].identRegObj!=identReg));i++); - + if (i==This->runObjTabLastIndx) return S_FALSE; if (indx != NULL) *indx=i; @@ -507,7 +507,7 @@ HRESULT WINAPI OleRun(LPUNKNOWN pUnknown) LRESULT ret; ret = IRunnableObject_QueryInterface(This,&IID_IRunnableObject,(LPVOID*)&runable); - if (ret) + if (ret) return 0; /* Appears to return no error. */ ret = IRunnableObject_Run(runable,NULL); IRunnableObject_Release(runable); diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index a4f3aa62253..066457e0f3a 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -4,7 +4,7 @@ * * Copyright 1995 Martin von Loewis * Copyright 1999 Francis Beaudet - * Copyright 1999 Noel Borthwick + * Copyright 1999 Noel Borthwick * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -49,7 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DECLARE_DEBUG_CHANNEL(accel); /****************************************************************************** - * These are static/global variables and internal data structures that the + * These are static/global variables and internal data structures that the * OLE module uses to maintain it's state. */ typedef struct tagDropTargetNode @@ -111,7 +111,7 @@ static const char OLEDD_DRAGTRACKERCLASS[] = "WineDragDropTracker32"; static DropTargetNode* targetListHead = NULL; /****************************************************************************** - * These are the prototypes of miscelaneous utility methods + * These are the prototypes of miscelaneous utility methods */ static void OLEUTL_ReadRegistryDWORDValue(HKEY regKey, DWORD* pdwValue); @@ -146,9 +146,9 @@ static DropTargetNode* OLEDD_ExtractDropTarget( static DropTargetNode* OLEDD_FindDropTarget( HWND hwndOfTarget); static LRESULT WINAPI OLEDD_DragTrackerWindowProc( - HWND hwnd, + HWND hwnd, UINT uMsg, - WPARAM wParam, + WPARAM wParam, LPARAM lParam); static void OLEDD_TrackMouseMove( TrackerWindowInfo* trackerInfo, @@ -187,11 +187,11 @@ HRESULT WINAPI OleInitialize(LPVOID reserved) hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); /* - * If the CoInitializeEx call failed, the OLE libraries can't be + * If the CoInitializeEx call failed, the OLE libraries can't be * initialized. */ if (FAILED(hr)) - return hr; + return hr; /* * Then, it has to initialize the OLE specific modules. @@ -203,7 +203,7 @@ HRESULT WINAPI OleInitialize(LPVOID reserved) */ if (OLE_moduleLockCount==0) { - /* + /* * Initialize the libraries. */ TRACE("() - Initializing the OLE libraries\n"); @@ -227,7 +227,7 @@ HRESULT WINAPI OleInitialize(LPVOID reserved) /* * Then, we increase the lock count on the OLE module. */ - OLE_moduleLockCount++; + OLE_moduleLockCount++; return hr; } @@ -276,13 +276,13 @@ void WINAPI OleUninitialize(void) * Drag and Drop */ OLEDD_UnInitialize(); - + /* * OLE shared menu */ OLEMenu_UnInitialize(); } - + /* * Then, uninitialize the COM libraries. */ @@ -327,7 +327,7 @@ HRESULT WINAPI RegisterDragDrop16( */ HRESULT WINAPI RegisterDragDrop( HWND hwnd, - LPDROPTARGET pDropTarget) + LPDROPTARGET pDropTarget) { DropTargetNode* dropTargetInfo; @@ -359,7 +359,7 @@ HRESULT WINAPI RegisterDragDrop( */ dropTargetInfo->dropTarget = pDropTarget; IDropTarget_AddRef(dropTargetInfo->dropTarget); - + OLEDD_InsertDropTarget(dropTargetInfo); return S_OK; @@ -401,7 +401,7 @@ HRESULT WINAPI RevokeDragDrop( * references */ IDropTarget_Release(dropTargetInfo->dropTarget); - HeapFree(GetProcessHeap(), 0, dropTargetInfo); + HeapFree(GetProcessHeap(), 0, dropTargetInfo); return S_OK; } @@ -414,8 +414,8 @@ HRESULT WINAPI RevokeDragDrop( * not too bad since this is the case for many objects because of the * way they are registered. */ -HRESULT WINAPI OleRegGetUserType( - REFCLSID clsid, +HRESULT WINAPI OleRegGetUserType( + REFCLSID clsid, DWORD dwFormOfType, LPOLESTR* pszUserType) { @@ -499,7 +499,7 @@ HRESULT WINAPI OleRegGetUserType( RegCloseKey(clsidKey); - + if (hres!=ERROR_SUCCESS) { CoTaskMemFree(*pszUserType); @@ -566,7 +566,7 @@ HRESULT WINAPI DoDragDrop ( */ while (!trackerInfo.trackingDone && GetMessageA(&msg, 0, 0, 0) ) { - if ( (msg.message >= WM_KEYFIRST) && + if ( (msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST) ) { /* @@ -583,7 +583,7 @@ HRESULT WINAPI DoDragDrop ( /* * Notify the drop source. - */ + */ OLEDD_TrackStateChange(&trackerInfo, msg.pt, OLEDD_GetButtonState()); @@ -664,7 +664,7 @@ HRESULT WINAPI OleRegGetMiscStatus( "MiscStatus", &miscStatusKey); - + if (result != ERROR_SUCCESS) { RegCloseKey(clsidKey); @@ -684,7 +684,7 @@ HRESULT WINAPI OleRegGetMiscStatus( result = RegOpenKeyA(miscStatusKey, keyName, &aspectKey); - + if (result == ERROR_SUCCESS) { OLEUTL_ReadRegistryDWORDValue(aspectKey, pdwStatus); @@ -704,7 +704,7 @@ HRESULT WINAPI OleRegGetMiscStatus( * OleSetContainedObject [OLE32.128] */ HRESULT WINAPI OleSetContainedObject( - LPUNKNOWN pUnknown, + LPUNKNOWN pUnknown, BOOL fContained) { IRunnableObject* runnable = NULL; @@ -732,9 +732,9 @@ HRESULT WINAPI OleSetContainedObject( * OleLoad [OLE32.112] */ HRESULT WINAPI OleLoad( - LPSTORAGE pStg, - REFIID riid, - LPOLECLIENTSITE pClientSite, + LPSTORAGE pStg, + REFIID riid, + LPOLECLIENTSITE pClientSite, LPVOID* ppvObj) { IPersistStorage* persistStorage = NULL; @@ -743,7 +743,7 @@ HRESULT WINAPI OleLoad( HRESULT hres; TRACE("(%p,%p,%p,%p)\n", pStg, riid, pClientSite, ppvObj); - + /* * TODO, Conversion ... OleDoAutoConvert */ @@ -792,7 +792,7 @@ HRESULT WINAPI OleLoad( &IID_IPersistStorage, (void**)&persistStorage); - if (SUCCEEDED(hres)) + if (SUCCEEDED(hres)) { IPersistStorage_Load(persistStorage, pStg); @@ -847,7 +847,7 @@ HRESULT WINAPI OleSave( IStorage_Commit(pStg, STGC_DEFAULT); } - + return hres; } @@ -855,7 +855,7 @@ HRESULT WINAPI OleSave( /****************************************************************************** * OleLockRunning [OLE32.114] */ -HRESULT WINAPI OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses) +HRESULT WINAPI OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses) { IRunnableObject* runnable = NULL; HRESULT hres; @@ -920,7 +920,7 @@ BOOL OLEMenu_InstallHooks( DWORD tid ) pHookItem->tid = tid; pHookItem->hHeap = GetProcessHeap(); - + /* Install a thread scope message hook for WH_GETMESSAGE */ pHookItem->GetMsg_hHook = SetWindowsHookExA( WH_GETMESSAGE, OLEMenu_GetMsgProc, 0, GetCurrentThreadId() ); @@ -936,9 +936,9 @@ BOOL OLEMenu_InstallHooks( DWORD tid ) /* Insert the hook table entry */ pHookItem->next = hook_list; hook_list = pHookItem; - + return TRUE; - + CLEANUP: /* Unhook any hooks */ if ( pHookItem->GetMsg_hHook ) @@ -947,7 +947,7 @@ CLEANUP: UnhookWindowsHookEx( pHookItem->CallWndProc_hHook ); /* Release the hook table entry */ HeapFree(pHookItem->hHeap, 0, pHookItem ); - + return FALSE; } @@ -1012,7 +1012,7 @@ OleMenuHookItem * OLEMenu_IsHookInstalled( DWORD tid ) if ( tid == pHookItem->tid ) return pHookItem; } - + return NULL; } @@ -1033,7 +1033,7 @@ static BOOL OLEMenu_FindMainMenuIndex( HMENU hMainMenu, HMENU hPopupMenu, UINT * for (i = 0; i < nItems; i++) { HMENU hsubmenu; - + /* Is the current item a submenu? */ if ( (hsubmenu = GetSubMenu(hMainMenu, i)) ) { @@ -1080,7 +1080,7 @@ BOOL OLEMenu_SetIsServerMenu( HMENU hmenu, OleMenuDescriptor *pOleMenuDescriptor /* Find the menu item index in the shared OLE menu that this item belongs to */ if ( !OLEMenu_FindMainMenuIndex( pOleMenuDescriptor->hmenuCombined, hmenu, &nPos ) ) return FALSE; - + /* The group widths array has counts for the number of elements * in the groups File, Edit, Container, Object, Window, Help. * The Edit, Object & Help groups belong to the server object @@ -1113,13 +1113,13 @@ LRESULT CALLBACK OLEMenu_CallWndProc(INT code, WPARAM wParam, LPARAM lParam) OleMenuDescriptor *pOleMenuDescriptor = NULL; OleMenuHookItem *pHookItem = NULL; WORD fuFlags; - + TRACE("%i, %04x, %08x\n", code, wParam, (unsigned)lParam ); /* Check if we're being asked to process the message */ if ( HC_ACTION != code ) goto NEXTHOOK; - + /* Retrieve the current message being dispatched from lParam */ pMsg = (LPCWPSTRUCT)lParam; @@ -1149,14 +1149,14 @@ LRESULT CALLBACK OLEMenu_CallWndProc(INT code, WPARAM wParam, LPARAM lParam) pMsg->message, pMsg->wParam, pMsg->lParam ); goto NEXTHOOK; } - + case WM_INITMENUPOPUP: { /* Save the state for whether this is a server owned menu */ OLEMenu_SetIsServerMenu( (HMENU)pMsg->wParam, pOleMenuDescriptor ); break; } - + case WM_MENUSELECT: { fuFlags = HIWORD(pMsg->wParam); /* Get flags */ @@ -1169,7 +1169,7 @@ LRESULT CALLBACK OLEMenu_CallWndProc(INT code, WPARAM wParam, LPARAM lParam) break; } - + case WM_DRAWITEM: { LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT) pMsg->lParam; @@ -1189,11 +1189,11 @@ LRESULT CALLBACK OLEMenu_CallWndProc(INT code, WPARAM wParam, LPARAM lParam) SendMessageA( pOleMenuDescriptor->hwndActiveObject, pMsg->message, pMsg->wParam, pMsg->lParam ); } - + NEXTHOOK: if ( pOleMenuDescriptor ) GlobalUnlock( hOleMenu ); - + /* Lookup the hook item for the current thread */ if ( !( pHookItem = OLEMenu_IsHookInstalled( GetCurrentThreadId() ) ) ) { @@ -1201,7 +1201,7 @@ NEXTHOOK: WARN("could not retrieve hHook for current thread!\n" ); return 0; } - + /* Pass on the message to the next hooker */ return CallNextHookEx( pHookItem->CallWndProc_hHook, code, wParam, lParam ); } @@ -1218,13 +1218,13 @@ LRESULT CALLBACK OLEMenu_GetMsgProc(INT code, WPARAM wParam, LPARAM lParam) OleMenuDescriptor *pOleMenuDescriptor = NULL; OleMenuHookItem *pHookItem = NULL; WORD wCode; - + TRACE("%i, %04x, %08x\n", code, wParam, (unsigned)lParam ); /* Check if we're being asked to process a messages */ if ( HC_ACTION != code ) goto NEXTHOOK; - + /* Retrieve the current message being dispatched from lParam */ pMsg = (LPMSG)lParam; @@ -1263,11 +1263,11 @@ LRESULT CALLBACK OLEMenu_GetMsgProc(INT code, WPARAM wParam, LPARAM lParam) * dispatch it to the embedded objects window. */ pMsg->hwnd = pOleMenuDescriptor->hwndActiveObject; } - + NEXTHOOK: if ( pOleMenuDescriptor ) GlobalUnlock( hOleMenu ); - + /* Lookup the hook item for the current thread */ if ( !( pHookItem = OLEMenu_IsHookInstalled( GetCurrentThreadId() ) ) ) { @@ -1275,7 +1275,7 @@ NEXTHOOK: WARN("could not retrieve hHook for current thread!\n" ); return FALSE; } - + /* Pass on the message to the next hooker */ return CallNextHookEx( pHookItem->GetMsg_hHook, code, wParam, lParam ); } @@ -1313,11 +1313,11 @@ HOLEMENU WINAPI OleCreateMenuDescriptor( /* Initialize menu group widths and hmenu */ for ( i = 0; i < 6; i++ ) pOleMenuDescriptor->mgw.width[i] = lpMenuWidths->width[i]; - + pOleMenuDescriptor->hmenuCombined = hmenuCombined; pOleMenuDescriptor->bIsServerItem = FALSE; GlobalUnlock( hOleMenu ); - + return hOleMenu; } @@ -1339,7 +1339,7 @@ HRESULT WINAPI OleDestroyMenuDescriptor( * FIXME: The lpFrame and lpActiveObject parameters are currently ignored * OLE should install context sensitive help F1 filtering for the app when * these are non null. - * + * * PARAMS: * hOleMenu Handle to composite menu descriptor * hwndFrame Handle to containers frame window @@ -1387,7 +1387,7 @@ HRESULT WINAPI OleSetMenuDescriptor( * without first calling it with a null hOleMenu to uninstall */ if ( OLEMenu_IsHookInstalled( GetCurrentThreadId() ) ) return E_FAIL; - + /* Get the menu descriptor */ pOleMenuDescriptor = (OleMenuDescriptor *) GlobalLock( hOleMenu ); if ( !pOleMenuDescriptor ) @@ -1399,7 +1399,7 @@ HRESULT WINAPI OleSetMenuDescriptor( GlobalUnlock( hOleMenu ); pOleMenuDescriptor = NULL; - + /* Add a menu descriptor windows property to the frame window */ SetPropA( hwndFrame, "PROP_OLEMenuDescriptor", hOleMenu ); @@ -1412,11 +1412,11 @@ HRESULT WINAPI OleSetMenuDescriptor( /* Uninstall the hooks */ if ( !OLEMenu_UnInstallHooks( GetCurrentThreadId() ) ) return E_FAIL; - + /* Remove the menu descriptor property from the frame window */ RemovePropA( hwndFrame, "PROP_OLEMenuDescriptor" ); } - + return S_OK; } @@ -1484,7 +1484,7 @@ BOOL WINAPI IsAccelerator(HACCEL hAccel, int cAccelEntries, LPMSG lpMsg, WORD* l } } } - } + } WARN_(accel)("couldn't translate accelerator key\n"); return FALSE; @@ -1504,7 +1504,7 @@ void WINAPI ReleaseStgMedium( { case TYMED_HGLOBAL: { - if ( (pmedium->pUnkForRelease==0) && + if ( (pmedium->pUnkForRelease==0) && (pmedium->u.hGlobal!=0) ) GlobalFree(pmedium->u.hGlobal); @@ -1519,7 +1519,7 @@ void WINAPI ReleaseStgMedium( { DeleteFileW(pmedium->u.lpszFileName); } - + CoTaskMemFree(pmedium->u.lpszFileName); } @@ -1548,7 +1548,7 @@ void WINAPI ReleaseStgMedium( } case TYMED_GDI: { - if ( (pmedium->pUnkForRelease==0) && + if ( (pmedium->pUnkForRelease==0) && (pmedium->u.hGlobal!=0) ) DeleteObject(pmedium->u.hGlobal); @@ -1557,7 +1557,7 @@ void WINAPI ReleaseStgMedium( } case TYMED_MFPICT: { - if ( (pmedium->pUnkForRelease==0) && + if ( (pmedium->pUnkForRelease==0) && (pmedium->u.hMetaFilePict!=0) ) { LPMETAFILEPICT pMP = GlobalLock(pmedium->u.hGlobal); @@ -1571,7 +1571,7 @@ void WINAPI ReleaseStgMedium( } case TYMED_ENHMF: { - if ( (pmedium->pUnkForRelease==0) && + if ( (pmedium->pUnkForRelease==0) && (pmedium->u.hEnhMetaFile!=0) ) { DeleteEnhMetaFile(pmedium->u.hEnhMetaFile); @@ -1612,7 +1612,7 @@ static void OLEDD_Initialize() wndClass.hCursor = 0; wndClass.hbrBackground = 0; wndClass.lpszClassName = OLEDD_DRAGTRACKERCLASS; - + RegisterClassA (&wndClass); } @@ -1678,7 +1678,7 @@ static void OLEDD_InsertDropTarget(DropTargetNode* nodeToAdd) /* * If we get here, we have found a spot for our item. The parentNodeLink - * pointer points to the pointer that we have to modify. + * pointer points to the pointer that we have to modify. * The curNode should be NULL. We just have to establish the link and Voila! */ assert(curNode==NULL); @@ -1725,7 +1725,7 @@ static DropTargetNode* OLEDD_ExtractDropTarget(HWND hwndOfTarget) else { /* - * The item was found in the list. Detach it from it's parent and + * The item was found in the list. Detach it from it's parent and * re-insert it's kids in the tree. */ assert(parentNodeLink!=NULL); @@ -1815,9 +1815,9 @@ static DropTargetNode* OLEDD_FindDropTarget(HWND hwndOfTarget) * of this behavior. */ static LRESULT WINAPI OLEDD_DragTrackerWindowProc( - HWND hwnd, + HWND hwnd, UINT uMsg, - WPARAM wParam, + WPARAM wParam, LPARAM lParam) { switch (uMsg) @@ -1826,9 +1826,9 @@ static LRESULT WINAPI OLEDD_DragTrackerWindowProc( { LPCREATESTRUCTA createStruct = (LPCREATESTRUCTA)lParam; - SetWindowLongA(hwnd, 0, (LONG)createStruct->lpCreateParams); + SetWindowLongA(hwnd, 0, (LONG)createStruct->lpCreateParams); + - break; } case WM_MOUSEMOVE: @@ -1923,11 +1923,11 @@ static void OLEDD_TrackMouseMove( * If we are hovering over the same target as before, send the * DragOver notification */ - if ( (trackerInfo->curDragTarget != 0) && + if ( (trackerInfo->curDragTarget != 0) && (trackerInfo->curDragTargetHWND==hwndNewTarget) ) { POINTL mousePosParam; - + /* * The documentation tells me that the coordinate should be in the target * window's coordinate space. However, the tests I made tell me the @@ -1935,7 +1935,7 @@ static void OLEDD_TrackMouseMove( */ mousePosParam.x = mousePos.x; mousePosParam.y = mousePos.y; - + IDropTarget_DragOver(trackerInfo->curDragTarget, keyState, mousePosParam, @@ -1944,7 +1944,7 @@ static void OLEDD_TrackMouseMove( else { DropTargetNode* newDropTargetNode = 0; - + /* * If we changed window, we have to notify our old target and check for * the new one. @@ -1953,7 +1953,7 @@ static void OLEDD_TrackMouseMove( { IDropTarget_DragLeave(trackerInfo->curDragTarget); } - + /* * Make sure we're hovering over a window. */ @@ -1970,14 +1970,14 @@ static void OLEDD_TrackMouseMove( trackerInfo->curDragTargetHWND = hwndNewTarget; trackerInfo->curDragTarget = newDropTargetNode ? newDropTargetNode->dropTarget : 0; - + /* * If there is, notify it that we just dragged-in */ if (trackerInfo->curDragTarget!=0) { POINTL mousePosParam; - + /* * The documentation tells me that the coordinate should be in the target * window's coordinate space. However, the tests I made tell me the @@ -1985,7 +1985,7 @@ static void OLEDD_TrackMouseMove( */ mousePosParam.x = mousePos.x; mousePosParam.y = mousePos.y; - + IDropTarget_DragEnter(trackerInfo->curDragTarget, trackerInfo->dataObject, keyState, @@ -2004,8 +2004,8 @@ static void OLEDD_TrackMouseMove( } /* - * Now that we have done that, we have to tell the source to give - * us feedback on the work being done by the target. If we don't + * Now that we have done that, we have to tell the source to give + * us feedback on the work being done by the target. If we don't * have a target, simulate no effect. */ if (trackerInfo->curDragTarget==0) @@ -2040,7 +2040,7 @@ static void OLEDD_TrackMouseMove( { SetCursor(LoadCursorA(OLE32_hInstance, MAKEINTRESOURCEA(0))); } - } + } } /*** @@ -2069,9 +2069,9 @@ static void OLEDD_TrackStateChange( */ trackerInfo->returnValue = IDropSource_QueryContinueDrag( trackerInfo->dropSource, - trackerInfo->escPressed, + trackerInfo->escPressed, keyState); - + /* * All the return valued will stop the operation except the S_OK * return value. @@ -2084,13 +2084,13 @@ static void OLEDD_TrackStateChange( trackerInfo->trackingDone = TRUE; /* - * Release the mouse in case the drop target decides to show a popup + * Release the mouse in case the drop target decides to show a popup * or a menu or something. */ ReleaseCapture(); - + /* - * If we end-up over a target, drop the object in the target or + * If we end-up over a target, drop the object in the target or * inform the target that the operation was cancelled. */ if (trackerInfo->curDragTarget!=0) @@ -2098,21 +2098,21 @@ static void OLEDD_TrackStateChange( switch (trackerInfo->returnValue) { /* - * If the source wants us to complete the operation, we tell + * If the source wants us to complete the operation, we tell * the drop target that we just dropped the object in it. */ case DRAGDROP_S_DROP: { POINTL mousePosParam; - + /* - * The documentation tells me that the coordinate should be + * The documentation tells me that the coordinate should be * in the target window's coordinate space. However, the tests * I made tell me the coordinates should be in screen coordinates. */ mousePosParam.x = mousePos.x; mousePosParam.y = mousePos.y; - + IDropTarget_Drop(trackerInfo->curDragTarget, trackerInfo->dataObject, keyState, @@ -2121,9 +2121,9 @@ static void OLEDD_TrackStateChange( break; } /* - * If the source told us that we should cancel, fool the drop + * If the source told us that we should cancel, fool the drop * target by telling it that the mouse left it's window. - * Also set the drop effect to "NONE" in case the application + * Also set the drop effect to "NONE" in case the application * ignores the result of DoDragDrop. */ case DRAGDROP_S_CANCEL: @@ -2176,13 +2176,13 @@ static DWORD OLEDD_GetButtonState() * * params: * regKey - Key to read the default value from - * pdwValue - Pointer to the location where the DWORD + * pdwValue - Pointer to the location where the DWORD * value is returned. This value is not modified * if the value is not found. */ static void OLEUTL_ReadRegistryDWORDValue( - HKEY regKey, + HKEY regKey, DWORD* pdwValue) { char buffer[20]; diff --git a/dlls/ole32/ole2nls.c b/dlls/ole32/ole2nls.c index a18682ba13a..27602d91f20 100644 --- a/dlls/ole32/ole2nls.c +++ b/dlls/ole32/ole2nls.c @@ -131,5 +131,5 @@ BOOL16 WINAPI RegisterNLSInfoChanged16(LPVOID lpNewNLSInfo) /* [???] FIXME */ } return FALSE; /* ptr not set */ -} +} diff --git a/dlls/ole32/ole2stubs.c b/dlls/ole32/ole2stubs.c index 52d6085a155..46989e027cb 100644 --- a/dlls/ole32/ole2stubs.c +++ b/dlls/ole32/ole2stubs.c @@ -49,7 +49,7 @@ HRESULT WINAPI OleDuplicateData(HANDLE hSrc, CLIPFORMAT cfFormat, return E_NOTIMPL; } - + /*********************************************************************** * WriteFmtUserTypeStg (OLE32.160) */ @@ -94,7 +94,7 @@ HRESULT WINAPI OleCreate( { HRESULT hres, hres1; IUnknown * pUnk = NULL; - + FIXME("\n\t%s\n\t%s stub!\n", debugstr_guid(rclsid), debugstr_guid(riid)); if (SUCCEEDED((hres = CoCreateInstance(rclsid, 0, CLSCTX_INPROC_SERVER, riid, (LPVOID*)&pUnk)))) @@ -211,7 +211,7 @@ HRESULT WINAPI OleRegEnumVerbs (REFCLSID clsid, LPENUMOLEVERB* ppenum) * OleRegEnumFormatEtc [OLE32.119] */ HRESULT WINAPI OleRegEnumFormatEtc ( - REFCLSID clsid, + REFCLSID clsid, DWORD dwDirection, LPENUMFORMATETC* ppenumFormatetc) { diff --git a/dlls/ole32/oleobj.c b/dlls/ole32/oleobj.c index d5af7b93acb..80a90b47b11 100644 --- a/dlls/ole32/oleobj.c +++ b/dlls/ole32/oleobj.c @@ -86,7 +86,7 @@ static LPOLEADVISEHOLDER OleAdviseHolderImpl_Constructor() lpoah= (OleAdviseHolderImpl*)HeapAlloc(GetProcessHeap(), 0, sizeof(OleAdviseHolderImpl)); - + ICOM_VTBL(lpoah) = &oahvt; lpoah->ref = 1; lpoah->maxSinks = INITIAL_SINKS; @@ -118,11 +118,11 @@ static void OleAdviseHolderImpl_Destructor( ptrToDestroy->arrayOfSinks[index] = NULL; } } - + HeapFree(GetProcessHeap(), 0, ptrToDestroy->arrayOfSinks); - + HeapFree(GetProcessHeap(), 0, @@ -134,10 +134,10 @@ static void OleAdviseHolderImpl_Destructor( */ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface( LPOLEADVISEHOLDER iface, - REFIID riid, + REFIID riid, LPVOID* ppvObj) { - ICOM_THIS(OleAdviseHolderImpl, iface); + ICOM_THIS(OleAdviseHolderImpl, iface); TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObj); /* * Sanity check @@ -147,12 +147,12 @@ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface( *ppvObj = NULL; - if (IsEqualIID(riid, &IID_IUnknown)) + if (IsEqualIID(riid, &IID_IUnknown)) { /* IUnknown */ - *ppvObj = This; + *ppvObj = This; } - else if(IsEqualIID(riid, &IID_IOleAdviseHolder)) + else if(IsEqualIID(riid, &IID_IOleAdviseHolder)) { /* IOleAdviseHolder */ *ppvObj = (IOleAdviseHolder*) This; @@ -160,7 +160,7 @@ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface( if(*ppvObj == NULL) return E_NOINTERFACE; - + /* * A successful QI always increments the reference count. */ @@ -175,8 +175,8 @@ static HRESULT WINAPI OleAdviseHolderImpl_QueryInterface( static ULONG WINAPI OleAdviseHolderImpl_AddRef( LPOLEADVISEHOLDER iface) { - ICOM_THIS(OleAdviseHolderImpl, iface); - TRACE("(%p)->(ref=%ld)\n", This, This->ref); + ICOM_THIS(OleAdviseHolderImpl, iface); + TRACE("(%p)->(ref=%ld)\n", This, This->ref); return ++(This->ref); } @@ -186,8 +186,8 @@ static ULONG WINAPI OleAdviseHolderImpl_AddRef( static ULONG WINAPI OleAdviseHolderImpl_Release( LPOLEADVISEHOLDER iface) { - ICOM_THIS(OleAdviseHolderImpl, iface); - TRACE("(%p)->(ref=%ld)\n", This, This->ref); + ICOM_THIS(OleAdviseHolderImpl, iface); + TRACE("(%p)->(ref=%ld)\n", This, This->ref); This->ref--; if (This->ref == 0) @@ -209,8 +209,8 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise( DWORD* pdwConnection) { DWORD index; - - ICOM_THIS(OleAdviseHolderImpl, iface); + + ICOM_THIS(OleAdviseHolderImpl, iface); TRACE("(%p)->(%p, %p)\n", This, pAdvise, pdwConnection); @@ -219,7 +219,7 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise( */ if (pdwConnection==NULL) return E_POINTER; - + *pdwConnection = 0; /* @@ -240,13 +240,13 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise( This->maxSinks+=INITIAL_SINKS; - This->arrayOfSinks = HeapReAlloc(GetProcessHeap(), + This->arrayOfSinks = HeapReAlloc(GetProcessHeap(), 0, This->arrayOfSinks, This->maxSinks*sizeof(IAdviseSink*)); for (i=index;i < This->maxSinks; i++) - This->arrayOfSinks[i]=0; + This->arrayOfSinks[i]=0; } /* @@ -271,24 +271,24 @@ static HRESULT WINAPI OleAdviseHolderImpl_Advise( * OleAdviseHolderImpl_Unadvise */ static HRESULT WINAPI OleAdviseHolderImpl_Unadvise( - LPOLEADVISEHOLDER iface, + LPOLEADVISEHOLDER iface, DWORD dwConnection) { - ICOM_THIS(OleAdviseHolderImpl, iface); + ICOM_THIS(OleAdviseHolderImpl, iface); TRACE("(%p)->(%lu)\n", This, dwConnection); /* - * So we don't return 0 as a cookie, the index was + * So we don't return 0 as a cookie, the index was * incremented by 1 in OleAdviseHolderImpl_Advise * we have to compensate. */ dwConnection--; - + /* * Check for invalid cookies. */ - if ( (dwConnection < 0) || + if ( (dwConnection < 0) || (dwConnection >= This->maxSinks) ) return OLE_E_NOCONNECTION; @@ -310,7 +310,7 @@ static HRESULT WINAPI OleAdviseHolderImpl_Unadvise( static HRESULT WINAPI OleAdviseHolderImpl_EnumAdvise (LPOLEADVISEHOLDER iface, IEnumSTATDATA **ppenumAdvise) { - ICOM_THIS(OleAdviseHolderImpl, iface); + ICOM_THIS(OleAdviseHolderImpl, iface); FIXME("(%p)->(%p)\n", This, ppenumAdvise); *ppenumAdvise = NULL; @@ -324,7 +324,7 @@ OleAdviseHolderImpl_EnumAdvise (LPOLEADVISEHOLDER iface, IEnumSTATDATA **ppenumA static HRESULT WINAPI OleAdviseHolderImpl_SendOnRename (LPOLEADVISEHOLDER iface, IMoniker *pmk) { - ICOM_THIS(OleAdviseHolderImpl, iface); + ICOM_THIS(OleAdviseHolderImpl, iface); FIXME("(%p)->(%p)\n", This, pmk); @@ -337,7 +337,7 @@ OleAdviseHolderImpl_SendOnRename (LPOLEADVISEHOLDER iface, IMoniker *pmk) static HRESULT WINAPI OleAdviseHolderImpl_SendOnSave (LPOLEADVISEHOLDER iface) { - ICOM_THIS(OleAdviseHolderImpl, iface); + ICOM_THIS(OleAdviseHolderImpl, iface); FIXME("(%p)\n", This); return S_OK; @@ -349,7 +349,7 @@ OleAdviseHolderImpl_SendOnSave (LPOLEADVISEHOLDER iface) static HRESULT WINAPI OleAdviseHolderImpl_SendOnClose (LPOLEADVISEHOLDER iface) { - ICOM_THIS(OleAdviseHolderImpl, iface); + ICOM_THIS(OleAdviseHolderImpl, iface); FIXME("(%p)\n", This); @@ -363,7 +363,7 @@ typedef struct DataAdviseConnection { IAdviseSink *sink; FORMATETC fmat; DWORD advf; -} DataAdviseConnection; +} DataAdviseConnection; typedef struct DataAdviseHolder { @@ -383,27 +383,27 @@ static HRESULT WINAPI DataAdviseHolder_QueryInterface( IDataAdviseHolder* iface, REFIID riid, void** ppvObject); -static ULONG WINAPI DataAdviseHolder_AddRef( +static ULONG WINAPI DataAdviseHolder_AddRef( IDataAdviseHolder* iface); -static ULONG WINAPI DataAdviseHolder_Release( +static ULONG WINAPI DataAdviseHolder_Release( IDataAdviseHolder* iface); -static HRESULT WINAPI DataAdviseHolder_Advise( +static HRESULT WINAPI DataAdviseHolder_Advise( IDataAdviseHolder* iface, - IDataObject* pDataObject, - FORMATETC* pFetc, - DWORD advf, - IAdviseSink* pAdvise, + IDataObject* pDataObject, + FORMATETC* pFetc, + DWORD advf, + IAdviseSink* pAdvise, DWORD* pdwConnection); -static HRESULT WINAPI DataAdviseHolder_Unadvise( +static HRESULT WINAPI DataAdviseHolder_Unadvise( IDataAdviseHolder* iface, DWORD dwConnection); -static HRESULT WINAPI DataAdviseHolder_EnumAdvise( - IDataAdviseHolder* iface, +static HRESULT WINAPI DataAdviseHolder_EnumAdvise( + IDataAdviseHolder* iface, IEnumSTATDATA** ppenumAdvise); -static HRESULT WINAPI DataAdviseHolder_SendOnDataChange( - IDataAdviseHolder* iface, - IDataObject* pDataObject, - DWORD dwReserved, +static HRESULT WINAPI DataAdviseHolder_SendOnDataChange( + IDataAdviseHolder* iface, + IDataObject* pDataObject, + DWORD dwReserved, DWORD advf); /************************************************************************** @@ -431,13 +431,13 @@ static IDataAdviseHolder* DataAdviseHolder_Constructor() newHolder = (DataAdviseHolder*)HeapAlloc(GetProcessHeap(), 0, sizeof(DataAdviseHolder)); - + ICOM_VTBL(newHolder) = &DataAdviseHolderImpl_VTable; newHolder->ref = 1; newHolder->maxCons = INITIAL_SINKS; newHolder->Connections = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - newHolder->maxCons * + newHolder->maxCons * sizeof(DataAdviseConnection)); TRACE("returning %p\n", newHolder); @@ -460,7 +460,7 @@ static void DataAdviseHolder_Destructor(DataAdviseHolder* ptrToDestroy) ptrToDestroy->Connections[index].sink = NULL; } } - + HeapFree(GetProcessHeap(), 0, ptrToDestroy->Connections); HeapFree(GetProcessHeap(), 0, ptrToDestroy); } @@ -475,14 +475,14 @@ static HRESULT WINAPI DataAdviseHolder_QueryInterface( REFIID riid, void** ppvObject) { - ICOM_THIS(DataAdviseHolder, iface); + ICOM_THIS(DataAdviseHolder, iface); TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* * Perform a sanity check on the parameters. */ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ @@ -496,7 +496,7 @@ static HRESULT WINAPI DataAdviseHolder_QueryInterface( { *ppvObject = iface; } - + /* * Check that we obtained an interface. */ @@ -504,14 +504,14 @@ static HRESULT WINAPI DataAdviseHolder_QueryInterface( { return E_NOINTERFACE; } - + /* * Query Interface always increases the reference count by one when it is - * successful. + * successful. */ IUnknown_AddRef((IUnknown*)*ppvObject); - return S_OK;; + return S_OK; } /************************************************************************ @@ -519,10 +519,10 @@ static HRESULT WINAPI DataAdviseHolder_QueryInterface( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataAdviseHolder_AddRef( +static ULONG WINAPI DataAdviseHolder_AddRef( IDataAdviseHolder* iface) { - ICOM_THIS(DataAdviseHolder, iface); + ICOM_THIS(DataAdviseHolder, iface); TRACE("(%p) (ref=%ld)\n", This, This->ref); This->ref++; @@ -534,7 +534,7 @@ static ULONG WINAPI DataAdviseHolder_AddRef( * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI DataAdviseHolder_Release( +static ULONG WINAPI DataAdviseHolder_Release( IDataAdviseHolder* iface) { ICOM_THIS(DataAdviseHolder, iface); @@ -554,7 +554,7 @@ static ULONG WINAPI DataAdviseHolder_Release( return 0; } - + return This->ref; } @@ -564,15 +564,15 @@ static ULONG WINAPI DataAdviseHolder_Release( */ static HRESULT WINAPI DataAdviseHolder_Advise( IDataAdviseHolder* iface, - IDataObject* pDataObject, - FORMATETC* pFetc, - DWORD advf, - IAdviseSink* pAdvise, + IDataObject* pDataObject, + FORMATETC* pFetc, + DWORD advf, + IAdviseSink* pAdvise, DWORD* pdwConnection) { DWORD index; - - ICOM_THIS(DataAdviseHolder, iface); + + ICOM_THIS(DataAdviseHolder, iface); TRACE("(%p)->(%p, %p, %08lx, %p, %p)\n", This, pDataObject, pFetc, advf, pAdvise, pdwConnection); @@ -581,7 +581,7 @@ static HRESULT WINAPI DataAdviseHolder_Advise( */ if (pdwConnection==NULL) return E_POINTER; - + *pdwConnection = 0; /* @@ -629,25 +629,25 @@ static HRESULT WINAPI DataAdviseHolder_Advise( /****************************************************************************** * DataAdviseHolder_Unadvise */ -static HRESULT WINAPI DataAdviseHolder_Unadvise( +static HRESULT WINAPI DataAdviseHolder_Unadvise( IDataAdviseHolder* iface, DWORD dwConnection) { - ICOM_THIS(DataAdviseHolder, iface); + ICOM_THIS(DataAdviseHolder, iface); TRACE("(%p)->(%lu)\n", This, dwConnection); /* - * So we don't return 0 as a cookie, the index was + * So we don't return 0 as a cookie, the index was * incremented by 1 in OleAdviseHolderImpl_Advise * we have to compensate. */ dwConnection--; - + /* * Check for invalid cookies. */ - if ( (dwConnection < 0) || + if ( (dwConnection < 0) || (dwConnection >= This->maxCons) ) return OLE_E_NOCONNECTION; @@ -662,11 +662,11 @@ static HRESULT WINAPI DataAdviseHolder_Unadvise( return S_OK; } -static HRESULT WINAPI DataAdviseHolder_EnumAdvise( - IDataAdviseHolder* iface, +static HRESULT WINAPI DataAdviseHolder_EnumAdvise( + IDataAdviseHolder* iface, IEnumSTATDATA** ppenumAdvise) { - ICOM_THIS(DataAdviseHolder, iface); + ICOM_THIS(DataAdviseHolder, iface); FIXME("(%p)->(%p)\n", This, ppenumAdvise); return E_NOTIMPL; @@ -675,13 +675,13 @@ static HRESULT WINAPI DataAdviseHolder_EnumAdvise( /****************************************************************************** * DataAdviseHolder_SendOnDataChange */ -static HRESULT WINAPI DataAdviseHolder_SendOnDataChange( - IDataAdviseHolder* iface, - IDataObject* pDataObject, - DWORD dwReserved, +static HRESULT WINAPI DataAdviseHolder_SendOnDataChange( + IDataAdviseHolder* iface, + IDataObject* pDataObject, + DWORD dwReserved, DWORD advf) { - ICOM_THIS(DataAdviseHolder, iface); + ICOM_THIS(DataAdviseHolder, iface); DWORD index; STGMEDIUM stg; HRESULT res; diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c index 8ca812f6793..d366ad8c1c4 100644 --- a/dlls/ole32/oleproxy.c +++ b/dlls/ole32/oleproxy.c @@ -249,8 +249,8 @@ CFStub_Construct(LPRPCSTUBBUFFER *ppv) { return S_OK; } -/* Since we create proxy buffers and classfactory in a pair, there is - * no need for 2 seperate structs. Just put them in one, but remember +/* Since we create proxy buffers and classfactory in a pair, there is + * no need for 2 seperate structs. Just put them in one, but remember * the refcount. */ typedef struct _CFProxy { @@ -347,7 +347,7 @@ static HRESULT WINAPI CFProxy_CreateInstance( TRACE("(%p,%s,%p)\n",pUnkOuter,debugstr_guid(riid),ppv); - /* Send CreateInstance to the remote classfactory. + /* Send CreateInstance to the remote classfactory. * * Data: Only the 'IID'. */ @@ -436,7 +436,7 @@ CFProxy_Construct(LPVOID *ppv,LPVOID *ppProxy) { static HRESULT WINAPI PSFacBuf_QueryInterface(LPPSFACTORYBUFFER iface, REFIID iid, LPVOID *ppv) { if (IsEqualIID(iid,&IID_IPSFactoryBuffer)||IsEqualIID(iid,&IID_IUnknown)) { - *ppv = (LPVOID)iface; + *ppv = (LPVOID)iface; /* No ref counting, static class */ return S_OK; } @@ -497,7 +497,7 @@ HRESULT WINAPI OLE32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) *ppv = NULL; if (IsEqualIID(rclsid,&CLSID_PSFactoryBuffer)) { *ppv = &lppsfac; - /* If we create a ps factory, we might need a stub manager later + /* If we create a ps factory, we might need a stub manager later * anyway */ STUBMGR_Start(); diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index 2eeafbcdd3b..2ff255eb2fb 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -187,7 +187,7 @@ PIPE_GetFromMID(wine_marshal_id *mid) { return NULL; } -static HRESULT +static HRESULT RPC_GetRequest(wine_rpc_request **req) { static int reqid = 0xdeadbeef; int i; @@ -538,7 +538,7 @@ HRESULT create_marshalled_proxy(REFCLSID rclsid, REFIID iid, LPVOID *ppv) { CloseHandle(hPipe); break; } - if (tries>=MAXTRIES) + if (tries>=MAXTRIES) return E_NOINTERFACE; hres = CreateStreamOnHGlobal(0,TRUE,&pStm); if (hres) return hres; diff --git a/dlls/ole32/stg_bigblockfile.c b/dlls/ole32/stg_bigblockfile.c index e5957d19dc2..c425ecf7b14 100644 --- a/dlls/ole32/stg_bigblockfile.c +++ b/dlls/ole32/stg_bigblockfile.c @@ -2,15 +2,15 @@ * * BigBlockFile * - * This is the implementation of a file that consists of blocks of + * This is the implementation of a file that consists of blocks of * a predetermined size. - * This class is used in the Compound File implementation of the - * IStorage and IStream interfaces. It provides the functionality - * to read and write any blocks in the file as well as setting and + * This class is used in the Compound File implementation of the + * IStorage and IStream interfaces. It provides the functionality + * to read and write any blocks in the file as well as setting and * obtaining the size of the file. * The blocks are indexed sequentially from the start of the file * starting with -1. - * + * * TODO: * - Support for a transacted mode * @@ -72,7 +72,7 @@ typedef struct /*** * This structure identifies the paged that are mapped - * from the file and their position in memory. It is + * from the file and their position in memory. It is * also used to hold a reference count to those pages. * * page_index identifies which PAGE_SIZE chunk from the @@ -105,7 +105,7 @@ static void BIGBLOCKFILE_RemapAllMappedPages(LPBIGBLOCKFILE This); static void* BIGBLOCKFILE_GetBigBlockPointer(LPBIGBLOCKFILE This, ULONG index, DWORD desired_access); -static MappedPage* BIGBLOCKFILE_GetPageFromPointer(LPBIGBLOCKFILE This, +static MappedPage* BIGBLOCKFILE_GetPageFromPointer(LPBIGBLOCKFILE This, void* pBlock); static MappedPage* BIGBLOCKFILE_CreatePage(LPBIGBLOCKFILE This, ULONG page_index); @@ -153,7 +153,7 @@ static inline void BIGBLOCKFILE_Zero(BlockBits *bb) /****************************************************************************** * BIGBLOCKFILE_Construct * - * Construct a big block file. Create the file mapping object. + * Construct a big block file. Create the file mapping object. * Create the read only mapped pages list, the writable mapped page list * and the blocks in use list. */ @@ -326,7 +326,7 @@ void* BIGBLOCKFILE_GetROBigBlock( /* * validate the block index - * + * */ if (This->blocksize * (index + 1) > ROUND_UP(This->filesize.s.LowPart, This->blocksize)) @@ -396,7 +396,7 @@ void BIGBLOCKFILE_ReleaseBigBlock(LPBIGBLOCKFILE This, void *pBlock) * BIGBLOCKFILE_SetSize * * Sets the size of the file. - * + * */ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize) { @@ -408,7 +408,7 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize) * unmap all views, must be done before call to SetEndFile */ BIGBLOCKFILE_UnmapAllMappedPages(This); - + if (This->fileBased) { char buf[10]; @@ -426,7 +426,7 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize) * to that dir: crash. * * The problem is that the SetFilePointer-SetEndOfFile combo below - * doesn't always succeed. The file is not grown. It seems like the + * doesn't always succeed. The file is not grown. It seems like the * operation is cached. By doing the WriteFile, the file is actually * grown on disk. * This hack is only needed when saving to smbfs. @@ -435,7 +435,7 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize) SetFilePointer(This->hfile, newSize.s.LowPart, NULL, FILE_BEGIN); WriteFile(This->hfile, buf, 10, NULL, NULL); /* - * END HACK + * END HACK */ /* @@ -443,14 +443,14 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize) */ SetFilePointer(This->hfile, newSize.s.LowPart, NULL, FILE_BEGIN); SetEndOfFile(This->hfile); - + /* * re-create the file mapping object */ This->hfilemap = CreateFileMappingA(This->hfile, NULL, This->flProtect, - 0, 0, + 0, 0, NULL); } else @@ -479,7 +479,7 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize) * BIGBLOCKFILE_GetSize * * Returns the size of the file. - * + * */ ULARGE_INTEGER BIGBLOCKFILE_GetSize(LPBIGBLOCKFILE This) { @@ -522,8 +522,8 @@ static BOOL BIGBLOCKFILE_AccessCheck(MappedPage *page, ULONG block_index, * Returns a pointer to the specified block. */ static void* BIGBLOCKFILE_GetBigBlockPointer( - LPBIGBLOCKFILE This, - ULONG block_index, + LPBIGBLOCKFILE This, + ULONG block_index, DWORD desired_access) { DWORD page_index = block_index / BLOCKS_PER_PAGE; diff --git a/dlls/ole32/stg_stream.c b/dlls/ole32/stg_stream.c index 0c1f3a38c6f..4b24d27649b 100644 --- a/dlls/ole32/stg_stream.c +++ b/dlls/ole32/stg_stream.c @@ -78,7 +78,7 @@ StgStreamImpl* StgStreamImpl_Construct( StgStreamImpl* newStream; newStream = HeapAlloc(GetProcessHeap(), 0, sizeof(StgStreamImpl)); - + if (newStream!=0) { /* @@ -86,7 +86,7 @@ StgStreamImpl* StgStreamImpl_Construct( */ ICOM_VTBL(newStream) = &StgStreamImpl_Vtbl; newStream->ref = 0; - + /* * We want to nail-down the reference to the storage in case the * stream out-lives the storage in the client application. @@ -94,15 +94,15 @@ StgStreamImpl* StgStreamImpl_Construct( newStream->parentStorage = parentStorage; IStorage_AddRef((IStorage*)newStream->parentStorage); - newStream->grfMode = grfMode; + newStream->grfMode = grfMode; newStream->ownerProperty = ownerProperty; - + /* * Start the stream at the beginning. */ newStream->currentPosition.s.HighPart = 0; newStream->currentPosition.s.LowPart = 0; - + /* * Initialize the rest of the data. */ @@ -110,21 +110,21 @@ StgStreamImpl* StgStreamImpl_Construct( newStream->streamSize.s.LowPart = 0; newStream->bigBlockChain = 0; newStream->smallBlockChain = 0; - + /* * Read the size from the property and determine if the blocks forming * this stream are large or small. */ StgStreamImpl_OpenBlockChain(newStream); } - + return newStream; } /*** * This is the destructor of the StgStreamImpl class. * - * This method will clean-up all the resources used-up by the given StgStreamImpl + * This method will clean-up all the resources used-up by the given StgStreamImpl * class. The pointer passed-in to this function will be freed and will not * be valid anymore. */ @@ -156,7 +156,7 @@ void StgStreamImpl_Destroy(StgStreamImpl* This) /* * Finally, free the memory used-up by the class. */ - HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, This); } /*** @@ -165,8 +165,8 @@ void StgStreamImpl_Destroy(StgStreamImpl* This) */ HRESULT WINAPI StgStreamImpl_QueryInterface( IStream* iface, - REFIID riid, /* [in] */ - void** ppvObject) /* [iid_is][out] */ + REFIID riid, /* [in] */ + void** ppvObject) /* [iid_is][out] */ { StgStreamImpl* const This=(StgStreamImpl*)iface; @@ -175,37 +175,37 @@ HRESULT WINAPI StgStreamImpl_QueryInterface( */ if (ppvObject==0) return E_INVALIDARG; - + /* * Initialize the return parameter. */ *ppvObject = 0; - + /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = (IStream*)This; } - else if (memcmp(&IID_IStream, riid, sizeof(IID_IStream)) == 0) + else if (memcmp(&IID_IStream, riid, sizeof(IID_IStream)) == 0) { *ppvObject = (IStream*)This; } - + /* * Check that we obtained an interface. */ if ((*ppvObject)==0) return E_NOINTERFACE; - + /* * Query Interface always increases the reference count by one when it is * successful */ StgStreamImpl_AddRef(iface); - - return S_OK;; + + return S_OK; } /*** @@ -218,7 +218,7 @@ ULONG WINAPI StgStreamImpl_AddRef( StgStreamImpl* const This=(StgStreamImpl*)iface; This->ref++; - + return This->ref; } @@ -232,11 +232,11 @@ ULONG WINAPI StgStreamImpl_Release( StgStreamImpl* const This=(StgStreamImpl*)iface; ULONG newRef; - + This->ref--; - + newRef = This->ref; - + /* * If the reference count goes down to 0, perform suicide. */ @@ -244,7 +244,7 @@ ULONG WINAPI StgStreamImpl_Release( { StgStreamImpl_Destroy(This); } - + return newRef; } @@ -280,16 +280,16 @@ void StgStreamImpl_OpenBlockChain( readSucessful = StorageImpl_ReadProperty(This->parentStorage->ancestorStorage, This->ownerProperty, &curProperty); - + if (readSucessful) { This->streamSize = curProperty.size; - + /* * This code supports only streams that are <32 bits in size. */ assert(This->streamSize.s.HighPart == 0); - + if(curProperty.startingBlock == BLOCK_END_OF_CHAIN) { assert( (This->streamSize.s.HighPart == 0) && (This->streamSize.s.LowPart == 0) ); @@ -300,7 +300,7 @@ void StgStreamImpl_OpenBlockChain( (This->streamSize.s.LowPart < LIMIT_TO_USE_SMALL_BLOCK) ) { This->smallBlockChain = SmallBlockChainStream_Construct( - This->parentStorage->ancestorStorage, + This->parentStorage->ancestorStorage, This->ownerProperty); } else @@ -323,11 +323,11 @@ void StgStreamImpl_OpenBlockChain( * * See the documentation of ISequentialStream for more info. */ -HRESULT WINAPI StgStreamImpl_Read( +HRESULT WINAPI StgStreamImpl_Read( IStream* iface, void* pv, /* [length_is][size_is][out] */ - ULONG cb, /* [in] */ - ULONG* pcbRead) /* [out] */ + ULONG cb, /* [in] */ + ULONG* pcbRead) /* [out] */ { StgStreamImpl* const This=(StgStreamImpl*)iface; @@ -338,19 +338,19 @@ HRESULT WINAPI StgStreamImpl_Read( TRACE("(%p, %p, %ld, %p)\n", iface, pv, cb, pcbRead); - /* + /* * If the caller is not interested in the number of bytes read, * we use another buffer to avoid "if" statements in the code. */ if (pcbRead==0) pcbRead = &bytesReadBuffer; - + /* * Using the known size of the stream, calculate the number of bytes * to read from the block chain */ bytesToReadFromBuffer = min( This->streamSize.s.LowPart - This->currentPosition.s.LowPart, cb); - + /* * Depending on the type of chain that was opened when the stream was constructed, * we delegate the work to the method that reads the block chains. @@ -362,7 +362,7 @@ HRESULT WINAPI StgStreamImpl_Read( bytesToReadFromBuffer, pv, pcbRead); - + } else if (This->bigBlockChain!=0) { @@ -394,7 +394,7 @@ HRESULT WINAPI StgStreamImpl_Read( * Advance the pointer for the number of positions read. */ This->currentPosition.s.LowPart += *pcbRead; - + if(*pcbRead != cb) { WARN("read %ld instead of the required %ld bytes !\n", *pcbRead, cb); @@ -408,12 +408,12 @@ HRESULT WINAPI StgStreamImpl_Read( } else res = S_OK; - + end: TRACE("<-- %08lx\n", res); return res; } - + /*** * This method is part of the ISequentialStream interface. * @@ -426,9 +426,9 @@ end: */ HRESULT WINAPI StgStreamImpl_Write( IStream* iface, - const void* pv, /* [size_is][in] */ - ULONG cb, /* [in] */ - ULONG* pcbWritten) /* [out] */ + const void* pv, /* [size_is][in] */ + ULONG cb, /* [in] */ + ULONG* pcbWritten) /* [out] */ { StgStreamImpl* const This=(StgStreamImpl*)iface; @@ -437,7 +437,7 @@ HRESULT WINAPI StgStreamImpl_Write( TRACE("(%p, %p, %ld, %p)\n", iface, pv, cb, pcbWritten); - + /* * Do we have permission to write to this stream? */ @@ -451,7 +451,7 @@ HRESULT WINAPI StgStreamImpl_Write( */ if (pcbWritten == 0) pcbWritten = &bytesWritten; - + /* * Initialize the out parameter */ @@ -466,7 +466,7 @@ HRESULT WINAPI StgStreamImpl_Write( newSize.s.HighPart = 0; newSize.s.LowPart = This->currentPosition.s.LowPart + cb; } - + /* * Verify if we need to grow the stream */ @@ -475,7 +475,7 @@ HRESULT WINAPI StgStreamImpl_Write( /* grow stream */ IStream_SetSize(iface, newSize); } - + /* * Depending on the type of chain that was opened when the stream was constructed, * we delegate the work to the method that readwrites to the block chains. @@ -487,7 +487,7 @@ HRESULT WINAPI StgStreamImpl_Write( cb, pv, pcbWritten); - + } else if (This->bigBlockChain!=0) { @@ -499,12 +499,12 @@ HRESULT WINAPI StgStreamImpl_Write( } else assert(FALSE); - + /* * Advance the position pointer for the number of positions written. */ This->currentPosition.s.LowPart += *pcbWritten; - + return S_OK; } @@ -515,11 +515,11 @@ HRESULT WINAPI StgStreamImpl_Write( * given. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI StgStreamImpl_Seek( + */ +HRESULT WINAPI StgStreamImpl_Seek( IStream* iface, - LARGE_INTEGER dlibMove, /* [in] */ - DWORD dwOrigin, /* [in] */ + LARGE_INTEGER dlibMove, /* [in] */ + DWORD dwOrigin, /* [in] */ ULARGE_INTEGER* plibNewPosition) /* [out] */ { StgStreamImpl* const This=(StgStreamImpl*)iface; @@ -529,7 +529,7 @@ HRESULT WINAPI StgStreamImpl_Seek( TRACE("(%p, %ld, %ld, %p)\n", iface, dlibMove.s.LowPart, dwOrigin, plibNewPosition); - /* + /* * The caller is allowed to pass in NULL as the new position return value. * If it happens, we assign it to a dynamic variable to avoid special cases * in the code below. @@ -565,7 +565,7 @@ HRESULT WINAPI StgStreamImpl_Seek( * tell the caller what we calculated */ This->currentPosition = *plibNewPosition; - + return S_OK; } @@ -578,9 +578,9 @@ HRESULT WINAPI StgStreamImpl_Seek( * * See the documentation of IStream for more info. */ -HRESULT WINAPI StgStreamImpl_SetSize( +HRESULT WINAPI StgStreamImpl_SetSize( IStream* iface, - ULARGE_INTEGER libNewSize) /* [in] */ + ULARGE_INTEGER libNewSize) /* [in] */ { StgStreamImpl* const This=(StgStreamImpl*)iface; @@ -629,11 +629,11 @@ HRESULT WINAPI StgStreamImpl_SetSize( */ Success = StorageImpl_ReadProperty(This->parentStorage->ancestorStorage, This->ownerProperty, - &curProperty); + &curProperty); /* * Determine if we have to switch from small to big blocks or vice versa - */ - if ( (This->smallBlockChain!=0) && + */ + if ( (This->smallBlockChain!=0) && (curProperty.size.s.LowPart < LIMIT_TO_USE_SMALL_BLOCK) ) { if (libNewSize.s.LowPart >= LIMIT_TO_USE_SMALL_BLOCK) @@ -665,19 +665,19 @@ HRESULT WINAPI StgStreamImpl_SetSize( curProperty.size.s.HighPart = libNewSize.s.HighPart; curProperty.size.s.LowPart = libNewSize.s.LowPart; - + if (Success) { StorageImpl_WriteProperty(This->parentStorage->ancestorStorage, This->ownerProperty, &curProperty); } - + This->streamSize = libNewSize; - + return S_OK; } - + /*** * This method is part of the IStream interface. * @@ -685,12 +685,12 @@ HRESULT WINAPI StgStreamImpl_SetSize( * * See the documentation of IStream for more info. */ -HRESULT WINAPI StgStreamImpl_CopyTo( +HRESULT WINAPI StgStreamImpl_CopyTo( IStream* iface, - IStream* pstm, /* [unique][in] */ - ULARGE_INTEGER cb, /* [in] */ - ULARGE_INTEGER* pcbRead, /* [out] */ - ULARGE_INTEGER* pcbWritten) /* [out] */ + IStream* pstm, /* [unique][in] */ + ULARGE_INTEGER cb, /* [in] */ + ULARGE_INTEGER* pcbRead, /* [out] */ + ULARGE_INTEGER* pcbWritten) /* [out] */ { HRESULT hr = S_OK; BYTE tmpBuffer[128]; @@ -698,7 +698,7 @@ HRESULT WINAPI StgStreamImpl_CopyTo( ULARGE_INTEGER totalBytesRead; ULARGE_INTEGER totalBytesWritten; - TRACE("(%p, %p, %ld, %p, %p)\n", + TRACE("(%p, %p, %ld, %p, %p)\n", iface, pstm, cb.s.LowPart, pcbRead, pcbWritten); /* @@ -721,11 +721,11 @@ HRESULT WINAPI StgStreamImpl_CopyTo( copySize = 128; else copySize = cb.s.LowPart; - + IStream_Read(iface, tmpBuffer, copySize, &bytesRead); totalBytesRead.s.LowPart += bytesRead; - + IStream_Write(pstm, tmpBuffer, bytesRead, &bytesWritten); totalBytesWritten.s.LowPart += bytesWritten; @@ -738,7 +738,7 @@ HRESULT WINAPI StgStreamImpl_CopyTo( hr = STG_E_MEDIUMFULL; break; } - + if (bytesRead!=copySize) cb.s.LowPart = 0; else @@ -769,10 +769,10 @@ HRESULT WINAPI StgStreamImpl_CopyTo( * does nothing. This is what the documentation tells us. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI StgStreamImpl_Commit( + */ +HRESULT WINAPI StgStreamImpl_Commit( IStream* iface, - DWORD grfCommitFlags) /* [in] */ + DWORD grfCommitFlags) /* [in] */ { return S_OK; } @@ -784,28 +784,28 @@ HRESULT WINAPI StgStreamImpl_Commit( * does nothing. This is what the documentation tells us. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI StgStreamImpl_Revert( + */ +HRESULT WINAPI StgStreamImpl_Revert( IStream* iface) { return S_OK; } -HRESULT WINAPI StgStreamImpl_LockRegion( +HRESULT WINAPI StgStreamImpl_LockRegion( IStream* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType) /* [in] */ + ULARGE_INTEGER libOffset, /* [in] */ + ULARGE_INTEGER cb, /* [in] */ + DWORD dwLockType) /* [in] */ { FIXME("not implemented!\n"); return E_NOTIMPL; } -HRESULT WINAPI StgStreamImpl_UnlockRegion( +HRESULT WINAPI StgStreamImpl_UnlockRegion( IStream* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType) /* [in] */ + ULARGE_INTEGER libOffset, /* [in] */ + ULARGE_INTEGER cb, /* [in] */ + DWORD dwLockType) /* [in] */ { FIXME("not implemented!\n"); return E_NOTIMPL; @@ -818,38 +818,38 @@ HRESULT WINAPI StgStreamImpl_UnlockRegion( * stream. * * See the documentation of IStream for more info. - */ -HRESULT WINAPI StgStreamImpl_Stat( + */ +HRESULT WINAPI StgStreamImpl_Stat( IStream* iface, STATSTG* pstatstg, /* [out] */ - DWORD grfStatFlag) /* [in] */ + DWORD grfStatFlag) /* [in] */ { StgStreamImpl* const This=(StgStreamImpl*)iface; StgProperty curProperty; BOOL readSucessful; - + /* * Read the information from the property. */ readSucessful = StorageImpl_ReadProperty(This->parentStorage->ancestorStorage, This->ownerProperty, &curProperty); - + if (readSucessful) { - StorageUtl_CopyPropertyToSTATSTG(pstatstg, - &curProperty, + StorageUtl_CopyPropertyToSTATSTG(pstatstg, + &curProperty, grfStatFlag); pstatstg->grfMode = This->grfMode; - + return S_OK; } - + return E_FAIL; } - + /*** * This method is part of the IStream interface. * @@ -861,10 +861,10 @@ HRESULT WINAPI StgStreamImpl_Stat( * I am not totally sure what I am doing here but I presume that this * should be basically as simple as creating a new stream with the same * parent etc and positioning its seek cursor. - */ -HRESULT WINAPI StgStreamImpl_Clone( + */ +HRESULT WINAPI StgStreamImpl_Clone( IStream* iface, - IStream** ppstm) /* [out] */ + IStream** ppstm) /* [out] */ { StgStreamImpl* const This=(StgStreamImpl*)iface; HRESULT hres; @@ -884,9 +884,9 @@ HRESULT WINAPI StgStreamImpl_Clone( *ppstm = (IStream*) new_stream; seek_pos.QuadPart = This->currentPosition.QuadPart; - + hres=StgStreamImpl_Seek (*ppstm, seek_pos, STREAM_SEEK_SET, NULL); - + assert (SUCCEEDED(hres)); return S_OK; diff --git a/dlls/ole32/storage.c b/dlls/ole32/storage.c index d861fff2933..ac9c791057d 100644 --- a/dlls/ole32/storage.c +++ b/dlls/ole32/storage.c @@ -141,7 +141,7 @@ STORAGE_get_next_big_blocknr(HFILE hf,int blocknr) { struct storage_header sth; READ_HEADER; - + assert(blocknr>>7>7]==0xffffffff) return -5; @@ -161,7 +161,7 @@ STORAGE_get_nth_next_big_blocknr(HFILE hf,int blocknr,int nr) { struct storage_header sth; READ_HEADER; - + assert(blocknr>=0); while (nr--) { assert((blocknr>>7)=0) { if (!STORAGE_get_big_block(hf,blocknr,block)) return -1; - for (i=0;i<4;i++) + for (i=0;i<4;i++) if (stde[i].pps_sizeofname==0) /* free */ return curblock*4+i; lastblocknr = blocknr; @@ -670,7 +670,7 @@ STORAGE_get_free_pps_entry(HFILE hf) { /* sth invalidated */ if (blocknr<0) return -1; - + if (!STORAGE_set_big_chain(hf,lastblocknr,blocknr)) return -1; if (!STORAGE_set_big_chain(hf,blocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) @@ -708,7 +708,7 @@ HRESULT WINAPI IStream16_fnQueryInterface( return 0; } return OLE_E_ENUM_NOMORE; - + } /****************************************************************************** @@ -809,7 +809,7 @@ HRESULT WINAPI IStream16_fnRead( WARN("small block read failed!!!\n"); return E_FAIL; } - cc = cb; + cc = cb; if (cc>SMALLSIZE-(This->offset.s.LowPart&(SMALLSIZE-1))) cc=SMALLSIZE-(This->offset.s.LowPart&(SMALLSIZE-1)); memcpy((LPBYTE)pv,block+(This->offset.s.LowPart&(SMALLSIZE-1)),cc); @@ -829,7 +829,7 @@ HRESULT WINAPI IStream16_fnRead( WARN("big block read failed!!!\n"); return E_FAIL; } - cc = cb; + cc = cb; if (cc>BIGSIZE-(This->offset.s.LowPart&(BIGSIZE-1))) cc=BIGSIZE-(This->offset.s.LowPart&(BIGSIZE-1)); memcpy((LPBYTE)pv,block+(This->offset.s.LowPart&(BIGSIZE-1)),cc); @@ -881,7 +881,7 @@ HRESULT WINAPI IStream16_fnWrite( if (!STORAGE_set_big_chain(hf,blocknr,STORAGE_CHAINENTRY_ENDOFCHAIN)) return E_FAIL; } else { - /* Migrate large blocks to small blocks + /* Migrate large blocks to small blocks * (we just migrate newsize bytes) */ LPBYTE curdata,data = HeapAlloc(GetProcessHeap(),0,newsize+BIGSIZE); @@ -1190,7 +1190,7 @@ HRESULT WINAPI IStream_fnQueryInterface( return 0; } return OLE_E_ENUM_NOMORE; - + } /****************************************************************************** @@ -1660,8 +1660,8 @@ HRESULT WINAPI StgIsStorageFile16(LPCOLESTR16 fn) { /****************************************************************************** * StgIsStorageFile [OLE32.146] */ -HRESULT WINAPI -StgIsStorageFile(LPCOLESTR fn) +HRESULT WINAPI +StgIsStorageFile(LPCOLESTR fn) { HRESULT ret; DWORD len = WideCharToMultiByte( CP_ACP, 0, fn, -1, NULL, 0, NULL, NULL ); @@ -1712,7 +1712,7 @@ HRESULT WINAPI StgOpenStorage16( return E_FAIL; } return S_OK; - + } diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index c73e407165b..2e35ed25f32 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -54,7 +54,7 @@ static const char rootPropertyName[] = "Root Entry"; /* OLESTREAM memory structure to use for Get and Put Routines */ /* Used for OleConvertIStorageToOLESTREAM and OleConvertOLESTREAMToIStorage */ -typedef struct +typedef struct { DWORD dwOleID; DWORD dwTypeID; @@ -92,7 +92,7 @@ typedef struct BYTE byUnknown1[28]; DWORD dwExtentX; DWORD dwExtentY; - DWORD dwSize; + DWORD dwSize; BYTE *pData; }OLECONVERT_ISTORAGE_OLEPRES; @@ -117,7 +117,7 @@ static HRESULT findPlaceholder( ULONG storagePropertyIndex, INT typeOfRelation); -static HRESULT adjustPropertyChain( +static HRESULT adjustPropertyChain( StorageImpl *This, StgProperty propertyToDelete, StgProperty parentProperty, @@ -144,7 +144,7 @@ static LONG propertyNameCmp( /*********************************************************************** * Declaration of miscellaneous functions... */ -static HRESULT validateSTGM(DWORD stgmValue); +static HRESULT validateSTGM(DWORD stgmValue); static DWORD GetShareModeFromSTGM(DWORD stgm); static DWORD GetAccessModeFromSTGM(DWORD stgm); @@ -230,7 +230,7 @@ static ICOM_VTABLE(IEnumSTATSTG) IEnumSTATSTGImpl_Vtbl = * * This method implements the common QueryInterface for all IStorage32 * implementations contained in this file. - * + * * See Windows documentation for more details on IUnknown methods. */ HRESULT WINAPI StorageBaseImpl_QueryInterface( @@ -244,30 +244,30 @@ HRESULT WINAPI StorageBaseImpl_QueryInterface( */ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ *ppvObject = 0; - + /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = (IStorage*)This; } - else if (memcmp(&IID_IStorage, riid, sizeof(IID_IStorage)) == 0) + else if (memcmp(&IID_IStorage, riid, sizeof(IID_IStorage)) == 0) { *ppvObject = (IStorage*)This; } - + /* * Check that we obtained an interface. */ if ((*ppvObject)==0) return E_NOINTERFACE; - + /* * Query Interface always increases the reference count by one when it is * successful @@ -276,16 +276,16 @@ HRESULT WINAPI StorageBaseImpl_QueryInterface( return S_OK; } - + /************************************************************************ * Storage32BaseImpl_AddRef (IUnknown) * * This method implements the common AddRef for all IStorage32 * implementations contained in this file. - * + * * See Windows documentation for more details on IUnknown methods. */ -ULONG WINAPI StorageBaseImpl_AddRef( +ULONG WINAPI StorageBaseImpl_AddRef( IStorage* iface) { ICOM_THIS(StorageBaseImpl,iface); @@ -293,16 +293,16 @@ ULONG WINAPI StorageBaseImpl_AddRef( return This->ref; } - + /************************************************************************ * Storage32BaseImpl_Release (IUnknown) * * This method implements the common Release for all IStorage32 * implementations contained in this file. - * + * * See Windows documentation for more details on IUnknown methods. */ -ULONG WINAPI StorageBaseImpl_Release( +ULONG WINAPI StorageBaseImpl_Release( IStorage* iface) { ICOM_THIS(StorageBaseImpl,iface); @@ -317,15 +317,15 @@ ULONG WINAPI StorageBaseImpl_Release( if (This->ref==0) { /* - * Since we are using a system of base-classes, we want to call the - * destructor of the appropriate derived class. To do this, we are + * Since we are using a system of base-classes, we want to call the + * destructor of the appropriate derived class. To do this, we are * using virtual functions to implement the destructor. */ This->v_destructor(This); return 0; } - + return This->ref; } @@ -336,13 +336,13 @@ ULONG WINAPI StorageBaseImpl_Release( * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageBaseImpl_OpenStream( +HRESULT WINAPI StorageBaseImpl_OpenStream( IStorage* iface, const OLECHAR* pwcsName, /* [string][in] */ void* reserved1, /* [unique][in] */ - DWORD grfMode, /* [in] */ - DWORD reserved2, /* [in] */ - IStream** ppstm) /* [out] */ + DWORD grfMode, /* [in] */ + DWORD reserved2, /* [in] */ + IStream** ppstm) /* [out] */ { ICOM_THIS(StorageBaseImpl,iface); IEnumSTATSTGImpl* propertyEnumeration; @@ -351,7 +351,7 @@ HRESULT WINAPI StorageBaseImpl_OpenStream( ULONG foundPropertyIndex; HRESULT res = STG_E_UNKNOWN; - TRACE("(%p, %s, %p, %lx, %ld, %p)\n", + TRACE("(%p, %s, %p, %lx, %ld, %p)\n", iface, debugstr_w(pwcsName), reserved1, grfMode, reserved2, ppstm); /* @@ -362,12 +362,12 @@ HRESULT WINAPI StorageBaseImpl_OpenStream( res = E_INVALIDARG; goto end; } - + /* * Initialize the out parameter */ *ppstm = NULL; - + /* * Validate the STGM flags */ @@ -392,9 +392,9 @@ HRESULT WINAPI StorageBaseImpl_OpenStream( * Create a property enumeration to search the properties */ propertyEnumeration = IEnumSTATSTGImpl_Construct( - This->ancestorStorage, + This->ancestorStorage, This->rootPropertySetIndex); - + /* * Search the enumeration for the property with the given name */ @@ -402,39 +402,39 @@ HRESULT WINAPI StorageBaseImpl_OpenStream( propertyEnumeration, pwcsName, ¤tProperty); - + /* * Delete the property enumeration since we don't need it anymore */ IEnumSTATSTGImpl_Destroy(propertyEnumeration); - + /* * If it was found, construct the stream object and return a pointer to it. */ - if ( (foundPropertyIndex!=PROPERTY_NULL) && + if ( (foundPropertyIndex!=PROPERTY_NULL) && (currentProperty.propertyType==PROPTYPE_STREAM) ) { newStream = StgStreamImpl_Construct(This, grfMode, foundPropertyIndex); - + if (newStream!=0) { newStream->grfMode = grfMode; *ppstm = (IStream*)newStream; /* - * Since we are returning a pointer to the interface, we have to + * Since we are returning a pointer to the interface, we have to * nail down the reference. */ StgStreamImpl_AddRef(*ppstm); - + res = S_OK; goto end; } - + res = E_OUTOFMEMORY; goto end; } - + res = STG_E_FILENOTFOUND; end: @@ -448,17 +448,17 @@ end: * Storage32BaseImpl_OpenStorage (IStorage) * * This method will open a new storage object from the current storage. - * + * * See Windows documentation for more details on IStorage methods. - */ -HRESULT WINAPI StorageBaseImpl_OpenStorage( + */ +HRESULT WINAPI StorageBaseImpl_OpenStorage( IStorage* iface, - const OLECHAR* pwcsName, /* [string][unique][in] */ - IStorage* pstgPriority, /* [unique][in] */ - DWORD grfMode, /* [in] */ - SNB snbExclude, /* [unique][in] */ - DWORD reserved, /* [in] */ - IStorage** ppstg) /* [out] */ + const OLECHAR* pwcsName, /* [string][unique][in] */ + IStorage* pstgPriority, /* [unique][in] */ + DWORD grfMode, /* [in] */ + SNB snbExclude, /* [unique][in] */ + DWORD reserved, /* [in] */ + IStorage** ppstg) /* [out] */ { ICOM_THIS(StorageBaseImpl,iface); StorageInternalImpl* newStorage; @@ -467,10 +467,10 @@ HRESULT WINAPI StorageBaseImpl_OpenStorage( ULONG foundPropertyIndex; HRESULT res = STG_E_UNKNOWN; - TRACE("(%p, %s, %p, %lx, %p, %ld, %p)\n", - iface, debugstr_w(pwcsName), pstgPriority, + TRACE("(%p, %s, %p, %lx, %p, %ld, %p)\n", + iface, debugstr_w(pwcsName), pstgPriority, grfMode, snbExclude, reserved, ppstg); - + /* * Perform a sanity check on the parameters. */ @@ -479,14 +479,14 @@ HRESULT WINAPI StorageBaseImpl_OpenStorage( res = E_INVALIDARG; goto end; } - + /* as documented */ if (snbExclude != NULL) { res = STG_E_INVALIDPARAMETER; goto end; } - + /* * Validate the STGM flags */ @@ -499,7 +499,7 @@ HRESULT WINAPI StorageBaseImpl_OpenStorage( /* * As documented. */ - if ( !(grfMode & STGM_SHARE_EXCLUSIVE) || + if ( !(grfMode & STGM_SHARE_EXCLUSIVE) || (grfMode & STGM_DELETEONRELEASE) || (grfMode & STGM_PRIORITY) ) { @@ -511,14 +511,14 @@ HRESULT WINAPI StorageBaseImpl_OpenStorage( * Initialize the out parameter */ *ppstg = NULL; - + /* * Create a property enumeration to search the properties */ propertyEnumeration = IEnumSTATSTGImpl_Construct( - This->ancestorStorage, + This->ancestorStorage, This->rootPropertySetIndex); - + /* * Search the enumeration for the property with the given name */ @@ -526,16 +526,16 @@ HRESULT WINAPI StorageBaseImpl_OpenStorage( propertyEnumeration, pwcsName, ¤tProperty); - + /* * Delete the property enumeration since we don't need it anymore */ IEnumSTATSTGImpl_Destroy(propertyEnumeration); - + /* * If it was found, construct the stream object and return a pointer to it. */ - if ( (foundPropertyIndex!=PROPERTY_NULL) && + if ( (foundPropertyIndex!=PROPERTY_NULL) && (currentProperty.propertyType==PROPTYPE_STORAGE) ) { /* @@ -544,25 +544,25 @@ HRESULT WINAPI StorageBaseImpl_OpenStorage( newStorage = StorageInternalImpl_Construct( This->ancestorStorage, foundPropertyIndex); - + if (newStorage != 0) { *ppstg = (IStorage*)newStorage; /* - * Since we are returning a pointer to the interface, + * Since we are returning a pointer to the interface, * we have to nail down the reference. */ StorageBaseImpl_AddRef(*ppstg); - + res = S_OK; goto end; } - + res = STG_E_INSUFFICIENTMEMORY; goto end; } - + res = STG_E_FILENOTFOUND; end: @@ -573,22 +573,22 @@ end: /************************************************************************ * Storage32BaseImpl_EnumElements (IStorage) * - * This method will create an enumerator object that can be used to + * This method will create an enumerator object that can be used to * retrieve informatino about all the properties in the storage object. - * + * * See Windows documentation for more details on IStorage methods. - */ -HRESULT WINAPI StorageBaseImpl_EnumElements( + */ +HRESULT WINAPI StorageBaseImpl_EnumElements( IStorage* iface, - DWORD reserved1, /* [in] */ - void* reserved2, /* [size_is][unique][in] */ - DWORD reserved3, /* [in] */ - IEnumSTATSTG** ppenum) /* [out] */ + DWORD reserved1, /* [in] */ + void* reserved2, /* [size_is][unique][in] */ + DWORD reserved3, /* [in] */ + IEnumSTATSTG** ppenum) /* [out] */ { ICOM_THIS(StorageBaseImpl,iface); IEnumSTATSTGImpl* newEnum; - TRACE("(%p, %ld, %p, %ld, %p)\n", + TRACE("(%p, %ld, %p, %ld, %p)\n", iface, reserved1, reserved2, reserved3, ppenum); /* @@ -596,7 +596,7 @@ HRESULT WINAPI StorageBaseImpl_EnumElements( */ if ( (This==0) || (ppenum==0)) return E_INVALIDARG; - + /* * Construct the enumerator. */ @@ -613,7 +613,7 @@ HRESULT WINAPI StorageBaseImpl_EnumElements( * returning it. */ IEnumSTATSTGImpl_AddRef(*ppenum); - + return S_OK; } @@ -624,20 +624,20 @@ HRESULT WINAPI StorageBaseImpl_EnumElements( * Storage32BaseImpl_Stat (IStorage) * * This method will retrieve information about this storage object. - * + * * See Windows documentation for more details on IStorage methods. - */ -HRESULT WINAPI StorageBaseImpl_Stat( + */ +HRESULT WINAPI StorageBaseImpl_Stat( IStorage* iface, - STATSTG* pstatstg, /* [out] */ - DWORD grfStatFlag) /* [in] */ + STATSTG* pstatstg, /* [out] */ + DWORD grfStatFlag) /* [in] */ { ICOM_THIS(StorageBaseImpl,iface); StgProperty curProperty; BOOL readSuccessful; HRESULT res = STG_E_UNKNOWN; - TRACE("(%p, %p, %lx)\n", + TRACE("(%p, %p, %lx)\n", iface, pstatstg, grfStatFlag); /* @@ -660,14 +660,14 @@ HRESULT WINAPI StorageBaseImpl_Stat( if (readSuccessful) { StorageUtl_CopyPropertyToSTATSTG( - pstatstg, - &curProperty, + pstatstg, + &curProperty, grfStatFlag); - + res = S_OK; goto end; } - + res = E_FAIL; end: @@ -682,12 +682,12 @@ end: /************************************************************************ * Storage32BaseImpl_RenameElement (IStorage) * - * This method will rename the specified element. + * This method will rename the specified element. * * See Windows documentation for more details on IStorage methods. - * - * Implementation notes: The method used to rename consists of creating a clone - * of the deleted StgProperty object setting it with the new name and to + * + * Implementation notes: The method used to rename consists of creating a clone + * of the deleted StgProperty object setting it with the new name and to * perform a DestroyElement of the old StgProperty. */ HRESULT WINAPI StorageBaseImpl_RenameElement( @@ -700,7 +700,7 @@ HRESULT WINAPI StorageBaseImpl_RenameElement( StgProperty currentProperty; ULONG foundPropertyIndex; - TRACE("(%p, %s, %s)\n", + TRACE("(%p, %s, %s)\n", iface, debugstr_w(pwcsOldName), debugstr_w(pwcsNewName)); /* @@ -747,65 +747,65 @@ HRESULT WINAPI StorageBaseImpl_RenameElement( /* * Setup a new property for the renamed property */ - renamedProperty.sizeOfNameString = + renamedProperty.sizeOfNameString = ( lstrlenW(pwcsNewName)+1 ) * sizeof(WCHAR); - + if (renamedProperty.sizeOfNameString > PROPERTY_NAME_BUFFER_LEN) return STG_E_INVALIDNAME; - + strcpyW(renamedProperty.name, pwcsNewName); - + renamedProperty.propertyType = currentProperty.propertyType; renamedProperty.startingBlock = currentProperty.startingBlock; renamedProperty.size.s.LowPart = currentProperty.size.s.LowPart; renamedProperty.size.s.HighPart = currentProperty.size.s.HighPart; - + renamedProperty.previousProperty = PROPERTY_NULL; renamedProperty.nextProperty = PROPERTY_NULL; - + /* * Bring the dirProperty link in case it is a storage and in which * case the renamed storage elements don't require to be reorganized. */ renamedProperty.dirProperty = currentProperty.dirProperty; - - /* call CoFileTime to get the current time + + /* call CoFileTime to get the current time renamedProperty.timeStampS1 renamedProperty.timeStampD1 renamedProperty.timeStampS2 renamedProperty.timeStampD2 - renamedProperty.propertyUniqueID + renamedProperty.propertyUniqueID */ - - /* + + /* * Obtain a free property in the property chain */ renamedPropertyIndex = getFreeProperty(This->ancestorStorage); - + /* * Save the new property into the new property spot - */ + */ StorageImpl_WriteProperty( This->ancestorStorage, - renamedPropertyIndex, + renamedPropertyIndex, &renamedProperty); - - /* + + /* * Find a spot in the property chain for our newly created property. */ updatePropertyChain( (StorageImpl*)This, - renamedPropertyIndex, + renamedPropertyIndex, renamedProperty); /* - * At this point the renamed property has been inserted in the tree, - * now, before to Destroy the old property we must zeroed it's dirProperty - * otherwise the DestroyProperty below will zap it all and we do not want + * At this point the renamed property has been inserted in the tree, + * now, before to Destroy the old property we must zeroed it's dirProperty + * otherwise the DestroyProperty below will zap it all and we do not want * this to happen. * Also, we fake that the old property is a storage so the DestroyProperty * will not do a SetSize(0) on the stream data. - * + * * This means that we need to tweek the StgProperty if it is a stream or a * non empty storage. */ @@ -817,14 +817,14 @@ HRESULT WINAPI StorageBaseImpl_RenameElement( currentProperty.propertyType = PROPTYPE_STORAGE; StorageImpl_WriteProperty( This->ancestorStorage, - foundPropertyIndex, + foundPropertyIndex, ¤tProperty); - /* - * Invoke Destroy to get rid of the ole property and automatically redo - * the linking of it's previous and next members... - */ - StorageImpl_DestroyElement((IStorage*)This->ancestorStorage, pwcsOldName); + /* + * Invoke Destroy to get rid of the ole property and automatically redo + * the linking of it's previous and next members... + */ + StorageImpl_DestroyElement((IStorage*)This->ancestorStorage, pwcsOldName); } else @@ -841,7 +841,7 @@ HRESULT WINAPI StorageBaseImpl_RenameElement( /************************************************************************ * Storage32BaseImpl_CreateStream (IStorage) * - * This method will create a stream object within this storage + * This method will create a stream object within this storage * * See Windows documentation for more details on IStorage methods. */ @@ -859,8 +859,8 @@ HRESULT WINAPI StorageBaseImpl_CreateStream( StgProperty currentProperty, newStreamProperty; ULONG foundPropertyIndex, newPropertyIndex; - TRACE("(%p, %s, %lx, %ld, %ld, %p)\n", - iface, debugstr_w(pwcsName), grfMode, + TRACE("(%p, %s, %lx, %ld, %ld, %p)\n", + iface, debugstr_w(pwcsName), grfMode, reserved1, reserved2, ppstm); /* @@ -906,18 +906,18 @@ HRESULT WINAPI StorageBaseImpl_CreateStream( if (foundPropertyIndex != PROPERTY_NULL) { /* - * An element with this name already exists + * An element with this name already exists */ if (grfMode & STGM_CREATE) { - IStorage_DestroyElement(iface, pwcsName); + IStorage_DestroyElement(iface, pwcsName); } - else + else return STG_E_FILEALREADYEXISTS; } - /* - * memset the empty property + /* + * memset the empty property */ memset(&newStreamProperty, 0, sizeof(StgProperty)); @@ -938,7 +938,7 @@ HRESULT WINAPI StorageBaseImpl_CreateStream( newStreamProperty.nextProperty = PROPERTY_NULL; newStreamProperty.dirProperty = PROPERTY_NULL; - /* call CoFileTime to get the current time + /* call CoFileTime to get the current time newStreamProperty.timeStampS1 newStreamProperty.timeStampD1 newStreamProperty.timeStampS2 @@ -948,27 +948,27 @@ HRESULT WINAPI StorageBaseImpl_CreateStream( /* newStreamProperty.propertyUniqueID */ /* - * Get a free property or create a new one + * Get a free property or create a new one */ newPropertyIndex = getFreeProperty(This->ancestorStorage); /* * Save the new property into the new property spot - */ + */ StorageImpl_WriteProperty( This->ancestorStorage, - newPropertyIndex, + newPropertyIndex, &newStreamProperty); - /* + /* * Find a spot in the property chain for our newly created property. */ updatePropertyChain( (StorageImpl*)This, - newPropertyIndex, + newPropertyIndex, newStreamProperty); - /* + /* * Open the stream to return it. */ newStream = StgStreamImpl_Construct(This, grfMode, newPropertyIndex); @@ -994,7 +994,7 @@ HRESULT WINAPI StorageBaseImpl_CreateStream( /************************************************************************ * Storage32BaseImpl_SetClass (IStorage) * - * This method will write the specified CLSID in the property of this + * This method will write the specified CLSID in the property of this * storage. * * See Windows documentation for more details on IStorage methods. @@ -1009,7 +1009,7 @@ HRESULT WINAPI StorageBaseImpl_SetClass( BOOL success; TRACE("(%p, %p)\n", iface, clsid); - + success = StorageImpl_ReadProperty(This->ancestorStorage, This->rootPropertySetIndex, &curProperty); @@ -1030,7 +1030,7 @@ HRESULT WINAPI StorageBaseImpl_SetClass( /************************************************************************ ** Storage32Impl implementation */ - + /************************************************************************ * Storage32Impl_CreateStorage (IStorage) * @@ -1038,13 +1038,13 @@ HRESULT WINAPI StorageBaseImpl_SetClass( * * See Windows documentation for more details on IStorage methods. */ -HRESULT WINAPI StorageImpl_CreateStorage( +HRESULT WINAPI StorageImpl_CreateStorage( IStorage* iface, - const OLECHAR *pwcsName, /* [string][in] */ - DWORD grfMode, /* [in] */ - DWORD reserved1, /* [in] */ - DWORD reserved2, /* [in] */ - IStorage **ppstg) /* [out] */ + const OLECHAR *pwcsName, /* [string][in] */ + DWORD grfMode, /* [in] */ + DWORD reserved1, /* [in] */ + DWORD reserved2, /* [in] */ + IStorage **ppstg) /* [out] */ { StorageImpl* const This=(StorageImpl*)iface; @@ -1055,10 +1055,10 @@ HRESULT WINAPI StorageImpl_CreateStorage( ULONG newPropertyIndex; HRESULT hr; - TRACE("(%p, %s, %lx, %ld, %ld, %p)\n", - iface, debugstr_w(pwcsName), grfMode, + TRACE("(%p, %s, %lx, %ld, %ld, %p)\n", + iface, debugstr_w(pwcsName), grfMode, reserved1, reserved2, ppstg); - + /* * Validate parameters */ @@ -1094,16 +1094,16 @@ HRESULT WINAPI StorageImpl_CreateStorage( if (foundPropertyIndex != PROPERTY_NULL) { /* - * An element with this name already exists + * An element with this name already exists */ if (grfMode & STGM_CREATE) - IStorage_DestroyElement(iface, pwcsName); - else + IStorage_DestroyElement(iface, pwcsName); + else return STG_E_FILEALREADYEXISTS; } - /* - * memset the empty property + /* + * memset the empty property */ memset(&newProperty, 0, sizeof(StgProperty)); @@ -1123,7 +1123,7 @@ HRESULT WINAPI StorageImpl_CreateStorage( newProperty.nextProperty = PROPERTY_NULL; newProperty.dirProperty = PROPERTY_NULL; - /* call CoFileTime to get the current time + /* call CoFileTime to get the current time newProperty.timeStampS1 newProperty.timeStampD1 newProperty.timeStampS2 @@ -1132,28 +1132,28 @@ HRESULT WINAPI StorageImpl_CreateStorage( /* newStorageProperty.propertyUniqueID */ - /* + /* * Obtain a free property in the property chain */ newPropertyIndex = getFreeProperty(This->ancestorStorage); /* * Save the new property into the new property spot - */ + */ StorageImpl_WriteProperty( This->ancestorStorage, - newPropertyIndex, + newPropertyIndex, &newProperty); - /* + /* * Find a spot in the property chain for our newly created property. */ updatePropertyChain( This, - newPropertyIndex, + newPropertyIndex, newProperty); - /* + /* * Open it to get a pointer to return. */ hr = IStorage_OpenStorage( @@ -1170,7 +1170,7 @@ HRESULT WINAPI StorageImpl_CreateStorage( return hr; } - + return S_OK; } @@ -1201,7 +1201,7 @@ static ULONG getFreeProperty( { if (currentProperty.sizeOfNameString == 0) { - /* + /* * The property existis and is available, we found it. */ newPropertyIndex = currentPropertyIndex; @@ -1218,8 +1218,8 @@ static ULONG getFreeProperty( } while (newPropertyIndex == PROPERTY_NULL); - /* - * grow the property chain + /* + * grow the property chain */ if (! readSuccessful) { @@ -1229,34 +1229,34 @@ static ULONG getFreeProperty( ULONG lastProperty = 0; ULONG blockCount = 0; - /* - * obtain the new count of property blocks + /* + * obtain the new count of property blocks */ blockCount = BlockChainStream_GetCount( storage->ancestorStorage->rootBlockChain)+1; - /* - * initialize the size used by the property stream + /* + * initialize the size used by the property stream */ newSize.s.HighPart = 0; newSize.s.LowPart = storage->bigBlockSize * blockCount; - /* - * add a property block to the property chain + /* + * add a property block to the property chain */ BlockChainStream_SetSize(storage->ancestorStorage->rootBlockChain, newSize); - /* - * memset the empty property in order to initialize the unused newly + /* + * memset the empty property in order to initialize the unused newly * created property */ memset(&emptyProperty, 0, sizeof(StgProperty)); - /* + /* * initialize them */ - lastProperty = storage->bigBlockSize / PROPSET_BLOCK_SIZE * blockCount; - + lastProperty = storage->bigBlockSize / PROPSET_BLOCK_SIZE * blockCount; + for( propertyIndex = newPropertyIndex; propertyIndex < lastProperty; @@ -1264,7 +1264,7 @@ static ULONG getFreeProperty( { StorageImpl_WriteProperty( storage->ancestorStorage, - propertyIndex, + propertyIndex, &emptyProperty); } } @@ -1276,7 +1276,7 @@ static ULONG getFreeProperty( * * Internal Method * - * Case insensitive comparaison of StgProperty.name by first considering + * Case insensitive comparaison of StgProperty.name by first considering * their size. * * Returns <0 when newPrpoerty < currentProperty @@ -1289,15 +1289,15 @@ static LONG propertyNameCmp( { LONG diff = lstrlenW(newProperty) - lstrlenW(currentProperty); - if (diff == 0) + if (diff == 0) { - /* + /* * We compare the string themselves only when they are of the same lenght */ diff = lstrcmpiW( newProperty, currentProperty); } - return diff; + return diff; } /**************************************************************************** @@ -1309,7 +1309,7 @@ static LONG propertyNameCmp( static void updatePropertyChain( StorageImpl *storage, ULONG newPropertyIndex, - StgProperty newProperty) + StgProperty newProperty) { StgProperty currentProperty; @@ -1322,7 +1322,7 @@ static void updatePropertyChain( if (currentProperty.dirProperty != PROPERTY_NULL) { - /* + /* * The root storage contains some element, therefore, start the research * for the appropriate location. */ @@ -1335,7 +1335,7 @@ static void updatePropertyChain( currentPropertyId = currentProperty.dirProperty; /* - * Read + * Read */ StorageImpl_ReadProperty(storage->ancestorStorage, currentProperty.dirProperty, @@ -1348,7 +1348,7 @@ static void updatePropertyChain( while (found == 0) { LONG diff = propertyNameCmp( newProperty.name, currentProperty.name); - + if (diff < 0) { if (previous != PROPERTY_NULL) @@ -1400,7 +1400,7 @@ static void updatePropertyChain( } else { - /* + /* * The root storage is empty, link the new property to it's dir property */ currentProperty.dirProperty = newPropertyIndex; @@ -1410,16 +1410,16 @@ static void updatePropertyChain( } } - + /************************************************************************* * CopyTo (IStorage) */ -HRESULT WINAPI StorageImpl_CopyTo( +HRESULT WINAPI StorageImpl_CopyTo( IStorage* iface, - DWORD ciidExclude, /* [in] */ - const IID* rgiidExclude, /* [size_is][unique][in] */ - SNB snbExclude, /* [unique][in] */ - IStorage* pstgDest) /* [unique][in] */ + DWORD ciidExclude, /* [in] */ + const IID* rgiidExclude, /* [size_is][unique][in] */ + SNB snbExclude, /* [unique][in] */ + IStorage* pstgDest) /* [unique][in] */ { IEnumSTATSTG *elements = 0; STATSTG curElement, strStat; @@ -1430,8 +1430,8 @@ HRESULT WINAPI StorageImpl_CopyTo( if ((ciidExclude != 0) || (rgiidExclude != NULL) || (snbExclude != NULL)) FIXME("Exclude option not implemented\n"); - TRACE("(%p, %ld, %p, %p, %p)\n", - iface, ciidExclude, rgiidExclude, + TRACE("(%p, %ld, %p, %p, %p)\n", + iface, ciidExclude, rgiidExclude, snbExclude, pstgDest); /* @@ -1440,7 +1440,7 @@ HRESULT WINAPI StorageImpl_CopyTo( if ( pstgDest == 0 ) return STG_E_INVALIDPOINTER; - /* + /* * Enumerate the elements */ hr = IStorage_EnumElements( iface, 0, 0, 0, &elements ); @@ -1453,7 +1453,7 @@ HRESULT WINAPI StorageImpl_CopyTo( */ IStorage_Stat( iface, &curElement, STATFLAG_NONAME); IStorage_SetClass( pstgDest, &curElement.clsid ); - + do { /* @@ -1489,7 +1489,7 @@ HRESULT WINAPI StorageImpl_CopyTo( return STG_E_ACCESSDENIED; } - + /* * create a new storage in destination storage */ @@ -1506,17 +1506,17 @@ HRESULT WINAPI StorageImpl_CopyTo( STGM_WRITE|STGM_SHARE_EXCLUSIVE, NULL, 0, &pstgTmp ); } - + if (hr != S_OK) break; - + /* * do the copy recursively */ hr = IStorage_CopyTo( pstgChild, ciidExclude, rgiidExclude, snbExclude, pstgTmp ); - + IStorage_Release( pstgTmp ); IStorage_Release( pstgChild ); } @@ -1552,13 +1552,13 @@ HRESULT WINAPI StorageImpl_CopyTo( * Set the size of the destination stream. */ IStream_SetSize(pstrTmp, strStat.cbSize); - + /* * do the copy */ hr = IStream_CopyTo( pstrChild, pstrTmp, strStat.cbSize, NULL, NULL ); - + IStream_Release( pstrTmp ); IStream_Release( pstrChild ); } @@ -1573,39 +1573,39 @@ HRESULT WINAPI StorageImpl_CopyTo( * Clean-up */ IEnumSTATSTG_Release(elements); - + return hr; } - + /************************************************************************* * MoveElementTo (IStorage) */ -HRESULT WINAPI StorageImpl_MoveElementTo( +HRESULT WINAPI StorageImpl_MoveElementTo( IStorage* iface, - const OLECHAR *pwcsName, /* [string][in] */ - IStorage *pstgDest, /* [unique][in] */ - const OLECHAR *pwcsNewName,/* [string][in] */ - DWORD grfFlags) /* [in] */ + const OLECHAR *pwcsName, /* [string][in] */ + IStorage *pstgDest, /* [unique][in] */ + const OLECHAR *pwcsNewName,/* [string][in] */ + DWORD grfFlags) /* [in] */ { FIXME("not implemented!\n"); return E_NOTIMPL; } - + /************************************************************************* * Commit (IStorage) */ -HRESULT WINAPI StorageImpl_Commit( +HRESULT WINAPI StorageImpl_Commit( IStorage* iface, - DWORD grfCommitFlags)/* [in] */ + DWORD grfCommitFlags)/* [in] */ { FIXME("(%ld): stub!\n", grfCommitFlags); return S_OK; } - + /************************************************************************* * Revert (IStorage) */ -HRESULT WINAPI StorageImpl_Revert( +HRESULT WINAPI StorageImpl_Revert( IStorage* iface) { FIXME("not implemented!\n"); @@ -1615,17 +1615,17 @@ HRESULT WINAPI StorageImpl_Revert( /************************************************************************* * DestroyElement (IStorage) * - * Stategy: This implementation is build this way for simplicity not for speed. + * Stategy: This implementation is build this way for simplicity not for speed. * I always delete the top most element of the enumeration and adjust - * the deleted element pointer all the time. This takes longer to - * do but allow to reinvoke DestroyElement whenever we encounter a + * the deleted element pointer all the time. This takes longer to + * do but allow to reinvoke DestroyElement whenever we encounter a * storage object. The optimisation reside in the usage of another - * enumeration stategy that would give all the leaves of a storage + * enumeration stategy that would give all the leaves of a storage * first. (postfix order) */ -HRESULT WINAPI StorageImpl_DestroyElement( +HRESULT WINAPI StorageImpl_DestroyElement( IStorage* iface, - const OLECHAR *pwcsName)/* [string][in] */ + const OLECHAR *pwcsName)/* [string][in] */ { StorageImpl* const This=(StorageImpl*)iface; @@ -1638,22 +1638,22 @@ HRESULT WINAPI StorageImpl_DestroyElement( ULONG typeOfRelation; ULONG parentPropertyId; - TRACE("(%p, %s)\n", + TRACE("(%p, %s)\n", iface, debugstr_w(pwcsName)); /* * Perform a sanity check on the parameters. */ - if (pwcsName==NULL) + if (pwcsName==NULL) return STG_E_INVALIDPOINTER; - + /* * Create a property enumeration to search the property with the given name */ propertyEnumeration = IEnumSTATSTGImpl_Construct( - This->ancestorStorage, + This->ancestorStorage, This->rootPropertySetIndex); - + foundPropertyIndexToDelete = IEnumSTATSTGImpl_FindProperty( propertyEnumeration, pwcsName, @@ -1661,51 +1661,51 @@ HRESULT WINAPI StorageImpl_DestroyElement( IEnumSTATSTGImpl_Destroy(propertyEnumeration); - if ( foundPropertyIndexToDelete == PROPERTY_NULL ) + if ( foundPropertyIndexToDelete == PROPERTY_NULL ) { return STG_E_FILENOTFOUND; } - /* - * Find the parent property of the property to delete (the one that - * link to it). If This->dirProperty == foundPropertyIndexToDelete, + /* + * Find the parent property of the property to delete (the one that + * link to it). If This->dirProperty == foundPropertyIndexToDelete, * the parent is This. Otherwise, the parent is one of it's sibling... */ - /* + /* * First, read This's StgProperty.. */ - res = StorageImpl_ReadProperty( + res = StorageImpl_ReadProperty( This->ancestorStorage, This->rootPropertySetIndex, &parentProperty); assert(res==TRUE); - /* + /* * Second, check to see if by any chance the actual storage (This) is not * the parent of the property to delete... We never know... */ if ( parentProperty.dirProperty == foundPropertyIndexToDelete ) { - /* + /* * Set data as it would have been done in the else part... */ typeOfRelation = PROPERTY_RELATION_DIR; parentPropertyId = This->rootPropertySetIndex; } - else - { + else + { /* - * Create a property enumeration to search the parent properties, and + * Create a property enumeration to search the parent properties, and * delete it once done. */ IEnumSTATSTGImpl* propertyEnumeration2; propertyEnumeration2 = IEnumSTATSTGImpl_Construct( - This->ancestorStorage, + This->ancestorStorage, This->rootPropertySetIndex); - + typeOfRelation = IEnumSTATSTGImpl_FindParentProperty( propertyEnumeration2, foundPropertyIndexToDelete, @@ -1715,22 +1715,22 @@ HRESULT WINAPI StorageImpl_DestroyElement( IEnumSTATSTGImpl_Destroy(propertyEnumeration2); } - if ( propertyToDelete.propertyType == PROPTYPE_STORAGE ) + if ( propertyToDelete.propertyType == PROPTYPE_STORAGE ) { hr = deleteStorageProperty( - This, + This, foundPropertyIndexToDelete, propertyToDelete); - } + } else if ( propertyToDelete.propertyType == PROPTYPE_STREAM ) { hr = deleteStreamProperty( - This, + This, foundPropertyIndexToDelete, propertyToDelete); } - if (hr!=S_OK) + if (hr!=S_OK) return hr; /* @@ -1738,7 +1738,7 @@ HRESULT WINAPI StorageImpl_DestroyElement( */ hr = adjustPropertyChain( This, - propertyToDelete, + propertyToDelete, parentProperty, parentPropertyId, typeOfRelation); @@ -1747,12 +1747,12 @@ HRESULT WINAPI StorageImpl_DestroyElement( } -/************************************************************************ - * StorageImpl_Stat (IStorage) - * - * This method will retrieve information about this storage object. - * - * See Windows documentation for more details on IStorage methods. +/************************************************************************ + * StorageImpl_Stat (IStorage) + * + * This method will retrieve information about this storage object. + * + * See Windows documentation for more details on IStorage methods. */ HRESULT WINAPI StorageImpl_Stat( IStorage* iface, STATSTG* pstatstg, /* [out] */ @@ -1808,7 +1808,7 @@ static HRESULT deleteStorageProperty( return hr; } - /* + /* * Enumerate the elements */ IStorage_EnumElements( childStorage, 0, 0, 0, &elements); @@ -1822,7 +1822,7 @@ static HRESULT deleteStorageProperty( if (hr==S_OK) { destroyHr = StorageImpl_DestroyElement( - (IStorage*)childStorage, + (IStorage*)childStorage, (OLECHAR*)currentElement.pwcsName); CoTaskMemFree(currentElement.pwcsName); @@ -1847,7 +1847,7 @@ static HRESULT deleteStorageProperty( IStorage_Release(childStorage); IEnumSTATSTG_Release(elements); - + return destroyHr; } @@ -1877,16 +1877,16 @@ static HRESULT deleteStreamProperty( STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, &pis); - + if (hr!=S_OK) { return(hr); } - /* - * Zap the stream - */ - hr = IStream_SetSize(pis, size); + /* + * Zap the stream + */ + hr = IStream_SetSize(pis, size); if(hr != S_OK) { @@ -1898,17 +1898,17 @@ static HRESULT deleteStreamProperty( */ IStream_Release(pis); - /* + /* * Invalidate the property by zeroing it's name member. */ propertyToDelete.sizeOfNameString = 0; - /* + /* * Here we should re-read the property so we get the updated pointer * but since we are here to zap it, I don't do it... */ StorageImpl_WriteProperty( - parentStorage->ancestorStorage, + parentStorage->ancestorStorage, indexOfPropertyToDelete, &propertyToDelete); @@ -1937,7 +1937,7 @@ static HRESULT findPlaceholder( */ res = StorageImpl_ReadProperty( storage->ancestorStorage, - storePropertyIndex, + storePropertyIndex, &storeProperty); if(! res) @@ -1951,7 +1951,7 @@ static HRESULT findPlaceholder( { return findPlaceholder( storage, - propertyIndexToStore, + propertyIndexToStore, storeProperty.previousProperty, typeOfRelation); } @@ -1966,7 +1966,7 @@ static HRESULT findPlaceholder( { return findPlaceholder( storage, - propertyIndexToStore, + propertyIndexToStore, storeProperty.nextProperty, typeOfRelation); } @@ -1974,14 +1974,14 @@ static HRESULT findPlaceholder( { storeProperty.nextProperty = propertyIndexToStore; } - } + } else if (typeOfRelation == PROPERTY_RELATION_DIR) { if (storeProperty.dirProperty != PROPERTY_NULL) { return findPlaceholder( storage, - propertyIndexToStore, + propertyIndexToStore, storeProperty.dirProperty, typeOfRelation); } @@ -1993,7 +1993,7 @@ static HRESULT findPlaceholder( hr = StorageImpl_WriteProperty( storage->ancestorStorage, - storePropertyIndex, + storePropertyIndex, &storeProperty); if(! hr) @@ -2008,10 +2008,10 @@ static HRESULT findPlaceholder( * * Internal Method * - * This method takes the previous and the next property link of a property + * This method takes the previous and the next property link of a property * to be deleted and find them a place in the Storage. */ -static HRESULT adjustPropertyChain( +static HRESULT adjustPropertyChain( StorageImpl *This, StgProperty propertyToDelete, StgProperty parentProperty, @@ -2025,116 +2025,116 @@ static HRESULT adjustPropertyChain( INT relationType = 0; HRESULT hr = S_OK; BOOL res = TRUE; - - if (typeOfRelation == PROPERTY_RELATION_PREVIOUS) + + if (typeOfRelation == PROPERTY_RELATION_PREVIOUS) { - if (propertyToDelete.previousProperty != PROPERTY_NULL) + if (propertyToDelete.previousProperty != PROPERTY_NULL) { - /* + /* * Set the parent previous to the property to delete previous */ newLinkProperty = propertyToDelete.previousProperty; - if (propertyToDelete.nextProperty != PROPERTY_NULL) + if (propertyToDelete.nextProperty != PROPERTY_NULL) { /* - * We also need to find a storage for the other link, setup variables + * We also need to find a storage for the other link, setup variables * to do this at the end... - */ + */ needToFindAPlaceholder = TRUE; storeNode = propertyToDelete.previousProperty; toStoreNode = propertyToDelete.nextProperty; relationType = PROPERTY_RELATION_NEXT; } - } - else if (propertyToDelete.nextProperty != PROPERTY_NULL) + } + else if (propertyToDelete.nextProperty != PROPERTY_NULL) { - /* + /* * Set the parent previous to the property to delete next */ newLinkProperty = propertyToDelete.nextProperty; } - - /* + + /* * Link it for real... - */ + */ parentProperty.previousProperty = newLinkProperty; - - } - else if (typeOfRelation == PROPERTY_RELATION_NEXT) + + } + else if (typeOfRelation == PROPERTY_RELATION_NEXT) { - if (propertyToDelete.previousProperty != PROPERTY_NULL) + if (propertyToDelete.previousProperty != PROPERTY_NULL) { - /* + /* * Set the parent next to the property to delete next previous */ newLinkProperty = propertyToDelete.previousProperty; - - if (propertyToDelete.nextProperty != PROPERTY_NULL) + + if (propertyToDelete.nextProperty != PROPERTY_NULL) { /* - * We also need to find a storage for the other link, setup variables + * We also need to find a storage for the other link, setup variables * to do this at the end... - */ + */ needToFindAPlaceholder = TRUE; storeNode = propertyToDelete.previousProperty; toStoreNode = propertyToDelete.nextProperty; relationType = PROPERTY_RELATION_NEXT; } - } - else if (propertyToDelete.nextProperty != PROPERTY_NULL) + } + else if (propertyToDelete.nextProperty != PROPERTY_NULL) { - /* + /* * Set the parent next to the property to delete next */ newLinkProperty = propertyToDelete.nextProperty; } - /* + /* * Link it for real... - */ + */ parentProperty.nextProperty = newLinkProperty; - } + } else /* (typeOfRelation == PROPERTY_RELATION_DIR) */ { - if (propertyToDelete.previousProperty != PROPERTY_NULL) + if (propertyToDelete.previousProperty != PROPERTY_NULL) { - /* + /* * Set the parent dir to the property to delete previous */ newLinkProperty = propertyToDelete.previousProperty; - if (propertyToDelete.nextProperty != PROPERTY_NULL) + if (propertyToDelete.nextProperty != PROPERTY_NULL) { /* - * We also need to find a storage for the other link, setup variables + * We also need to find a storage for the other link, setup variables * to do this at the end... - */ + */ needToFindAPlaceholder = TRUE; storeNode = propertyToDelete.previousProperty; toStoreNode = propertyToDelete.nextProperty; relationType = PROPERTY_RELATION_NEXT; } - } - else if (propertyToDelete.nextProperty != PROPERTY_NULL) + } + else if (propertyToDelete.nextProperty != PROPERTY_NULL) { - /* + /* * Set the parent dir to the property to delete next */ newLinkProperty = propertyToDelete.nextProperty; } - /* + /* * Link it for real... - */ + */ parentProperty.dirProperty = newLinkProperty; } - /* - * Write back the parent property + /* + * Write back the parent property */ res = StorageImpl_WriteProperty( - This->ancestorStorage, + This->ancestorStorage, parentPropertyId, &parentProperty); if(! res) @@ -2143,14 +2143,14 @@ static HRESULT adjustPropertyChain( } /* - * If a placeholder is required for the other link, then, find one and + * If a placeholder is required for the other link, then, find one and * get out of here... */ - if (needToFindAPlaceholder) + if (needToFindAPlaceholder) { hr = findPlaceholder( - This, - toStoreNode, + This, + toStoreNode, storeNode, relationType); } @@ -2162,12 +2162,12 @@ static HRESULT adjustPropertyChain( /****************************************************************************** * SetElementTimes (IStorage) */ -HRESULT WINAPI StorageImpl_SetElementTimes( +HRESULT WINAPI StorageImpl_SetElementTimes( IStorage* iface, - const OLECHAR *pwcsName,/* [string][in] */ - const FILETIME *pctime, /* [in] */ - const FILETIME *patime, /* [in] */ - const FILETIME *pmtime) /* [in] */ + const OLECHAR *pwcsName,/* [string][in] */ + const FILETIME *pctime, /* [in] */ + const FILETIME *patime, /* [in] */ + const FILETIME *pmtime) /* [in] */ { FIXME("(%s,...), stub!\n",debugstr_w(pwcsName)); return S_OK; @@ -2176,10 +2176,10 @@ HRESULT WINAPI StorageImpl_SetElementTimes( /****************************************************************************** * SetStateBits (IStorage) */ -HRESULT WINAPI StorageImpl_SetStateBits( +HRESULT WINAPI StorageImpl_SetStateBits( IStorage* iface, - DWORD grfStateBits,/* [in] */ - DWORD grfMask) /* [in] */ + DWORD grfStateBits,/* [in] */ + DWORD grfMask) /* [in] */ { FIXME("not implemented!\n"); return E_NOTIMPL; @@ -2203,33 +2203,33 @@ HRESULT StorageImpl_Construct( return STG_E_INVALIDFLAG; memset(This, 0, sizeof(StorageImpl)); - + /* * Initialize the virtual function table. */ ICOM_VTBL(This) = &Storage32Impl_Vtbl; This->v_destructor = &StorageImpl_Destroy; - + /* * This is the top-level storage so initialize the ancestor pointer * to this. */ This->ancestorStorage = This; - + /* * Initialize the physical support of the storage. */ This->hFile = hFile; - + /* * Store copy of file path. */ if(pwcsName) { - This->pwcsName = HeapAlloc(GetProcessHeap(), 0, + This->pwcsName = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pwcsName)+1)*sizeof(WCHAR)); if (!This->pwcsName) return STG_E_INSUFFICIENTMEMORY; - strcpyW(This->pwcsName, pwcsName); + strcpyW(This->pwcsName, pwcsName); } /* @@ -2245,7 +2245,7 @@ HRESULT StorageImpl_Construct( if (This->bigBlockFile == 0) return E_FAIL; - + if (fileCreate) { ULARGE_INTEGER size; @@ -2257,8 +2257,8 @@ HRESULT StorageImpl_Construct( * - The properties start at block 1 * - There is no small block depot */ - memset( This->bigBlockDepotStart, - BLOCK_UNUSED, + memset( This->bigBlockDepotStart, + BLOCK_UNUSED, sizeof(This->bigBlockDepotStart)); This->bigBlockDepotCount = 1; @@ -2312,20 +2312,20 @@ HRESULT StorageImpl_Construct( * Start searching for free blocks with block 0. */ This->prevFreeBlock = 0; - + /* * Create the block chain abstractions. */ - This->rootBlockChain = + This->rootBlockChain = BlockChainStream_Construct(This, &This->rootStartBlock, PROPERTY_NULL); This->smallBlockDepotChain = BlockChainStream_Construct( - This, - &This->smallBlockDepotStart, + This, + &This->smallBlockDepotStart, PROPERTY_NULL); /* - * Write the root property + * Write the root property */ if (fileCreate) { @@ -2352,14 +2352,14 @@ HRESULT StorageImpl_Construct( * Find the ID of the root in the property sets. */ currentPropertyIndex = 0; - + do { readSuccessful = StorageImpl_ReadProperty( - This, - currentPropertyIndex, + This, + currentPropertyIndex, ¤tProperty); - + if (readSuccessful) { if ( (currentProperty.sizeOfNameString != 0 ) && @@ -2370,9 +2370,9 @@ HRESULT StorageImpl_Construct( } currentPropertyIndex++; - + } while (readSuccessful && (This->rootPropertySetIndex == PROPERTY_NULL) ); - + if (!readSuccessful) { /* TODO CLEANUP */ @@ -2383,10 +2383,10 @@ HRESULT StorageImpl_Construct( * Create the block chain abstraction for the small block root chain. */ This->smallBlockRootChain = BlockChainStream_Construct( - This, - NULL, + This, + NULL, This->rootPropertySetIndex); - + return hr; } @@ -2922,48 +2922,48 @@ HRESULT StorageImpl_LoadFileHeader( } StorageUtl_ReadWord( - headerBigBlock, - OFFSET_BIGBLOCKSIZEBITS, + headerBigBlock, + OFFSET_BIGBLOCKSIZEBITS, &This->bigBlockSizeBits); StorageUtl_ReadWord( - headerBigBlock, - OFFSET_SMALLBLOCKSIZEBITS, + headerBigBlock, + OFFSET_SMALLBLOCKSIZEBITS, &This->smallBlockSizeBits); StorageUtl_ReadDWord( - headerBigBlock, - OFFSET_BBDEPOTCOUNT, + headerBigBlock, + OFFSET_BBDEPOTCOUNT, &This->bigBlockDepotCount); StorageUtl_ReadDWord( - headerBigBlock, - OFFSET_ROOTSTARTBLOCK, + headerBigBlock, + OFFSET_ROOTSTARTBLOCK, &This->rootStartBlock); StorageUtl_ReadDWord( - headerBigBlock, - OFFSET_SBDEPOTSTART, + headerBigBlock, + OFFSET_SBDEPOTSTART, &This->smallBlockDepotStart); - StorageUtl_ReadDWord( - headerBigBlock, - OFFSET_EXTBBDEPOTSTART, + StorageUtl_ReadDWord( + headerBigBlock, + OFFSET_EXTBBDEPOTSTART, &This->extBigBlockDepotStart); StorageUtl_ReadDWord( - headerBigBlock, - OFFSET_EXTBBDEPOTCOUNT, + headerBigBlock, + OFFSET_EXTBBDEPOTCOUNT, &This->extBigBlockDepotCount); - + for (index = 0; index < COUNT_BBDEPOTINHEADER; index ++) { StorageUtl_ReadDWord( - headerBigBlock, + headerBigBlock, OFFSET_BBDEPOTSTART + (sizeof(ULONG)*index), &(This->bigBlockDepotStart[index])); } - + /* * Make the bitwise arithmetic to get the size of the blocks in bytes. */ @@ -2977,9 +2977,9 @@ HRESULT StorageImpl_LoadFileHeader( This->bigBlockSize = 0x000000001 >> (DWORD)This->bigBlockSizeBits; This->smallBlockSize = 0x000000001 >> (DWORD)This->smallBlockSizeBits; } - + /* - * Right now, the code is making some assumptions about the size of the + * Right now, the code is making some assumptions about the size of the * blocks, just make sure they are what we're expecting. */ if (This->bigBlockSize != DEF_BIG_BLOCK_SIZE || @@ -2990,13 +2990,13 @@ HRESULT StorageImpl_LoadFileHeader( } else hr = S_OK; - + /* * Release the block. */ StorageImpl_ReleaseBigBlock(This, headerBigBlock); } - + return hr; } @@ -3016,7 +3016,7 @@ void StorageImpl_SaveFileHeader( * Get a pointer to the big block of data containing the header. */ success = StorageImpl_ReadBigBlock(This, -1, headerBigBlock); - + /* * If the block read failed, the file is probably new. */ @@ -3026,12 +3026,12 @@ void StorageImpl_SaveFileHeader( * Initialize for all unknown fields. */ memset(headerBigBlock, 0, BIG_BLOCK_SIZE); - + /* * Initialize the magic number. */ memcpy(headerBigBlock, STORAGE_magic, sizeof(STORAGE_magic)); - + /* * And a bunch of things we don't know what they mean */ @@ -3041,56 +3041,56 @@ void StorageImpl_SaveFileHeader( StorageUtl_WriteDWord(headerBigBlock, 0x38, (DWORD)0x1000); StorageUtl_WriteDWord(headerBigBlock, 0x40, (DWORD)0x0001); } - + /* * Write the information to the header. */ if (headerBigBlock!=0) { StorageUtl_WriteWord( - headerBigBlock, - OFFSET_BIGBLOCKSIZEBITS, + headerBigBlock, + OFFSET_BIGBLOCKSIZEBITS, This->bigBlockSizeBits); StorageUtl_WriteWord( - headerBigBlock, - OFFSET_SMALLBLOCKSIZEBITS, + headerBigBlock, + OFFSET_SMALLBLOCKSIZEBITS, This->smallBlockSizeBits); StorageUtl_WriteDWord( - headerBigBlock, - OFFSET_BBDEPOTCOUNT, + headerBigBlock, + OFFSET_BBDEPOTCOUNT, This->bigBlockDepotCount); StorageUtl_WriteDWord( - headerBigBlock, - OFFSET_ROOTSTARTBLOCK, + headerBigBlock, + OFFSET_ROOTSTARTBLOCK, This->rootStartBlock); StorageUtl_WriteDWord( - headerBigBlock, - OFFSET_SBDEPOTSTART, + headerBigBlock, + OFFSET_SBDEPOTSTART, This->smallBlockDepotStart); StorageUtl_WriteDWord( - headerBigBlock, - OFFSET_EXTBBDEPOTSTART, + headerBigBlock, + OFFSET_EXTBBDEPOTSTART, This->extBigBlockDepotStart); StorageUtl_WriteDWord( - headerBigBlock, - OFFSET_EXTBBDEPOTCOUNT, + headerBigBlock, + OFFSET_EXTBBDEPOTCOUNT, This->extBigBlockDepotCount); for (index = 0; index < COUNT_BBDEPOTINHEADER; index ++) { StorageUtl_WriteDWord( - headerBigBlock, + headerBigBlock, OFFSET_BBDEPOTSTART + (sizeof(ULONG)*index), (This->bigBlockDepotStart[index])); } } - + /* * Write the big block back to the file. */ @@ -3114,7 +3114,7 @@ BOOL StorageImpl_ReadProperty( offsetInPropSet.s.HighPart = 0; offsetInPropSet.s.LowPart = index * PROPSET_BLOCK_SIZE; - + readSuccessful = BlockChainStream_ReadAt( This->rootBlockChain, offsetInPropSet, @@ -3130,66 +3130,66 @@ BOOL StorageImpl_ReadProperty( memset(buffer->name, 0, sizeof(buffer->name)); memcpy( - buffer->name, - propName, + buffer->name, + propName, PROPERTY_NAME_BUFFER_LEN ); TRACE("storage name: %s\n", debugstr_w(buffer->name)); memcpy(&buffer->propertyType, currentProperty + OFFSET_PS_PROPERTYTYPE, 1); - + StorageUtl_ReadWord( - currentProperty, - OFFSET_PS_NAMELENGTH, + currentProperty, + OFFSET_PS_NAMELENGTH, &buffer->sizeOfNameString); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_PREVIOUSPROP, + currentProperty, + OFFSET_PS_PREVIOUSPROP, &buffer->previousProperty); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_NEXTPROP, + currentProperty, + OFFSET_PS_NEXTPROP, &buffer->nextProperty); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_DIRPROP, + currentProperty, + OFFSET_PS_DIRPROP, &buffer->dirProperty); StorageUtl_ReadGUID( - currentProperty, - OFFSET_PS_GUID, + currentProperty, + OFFSET_PS_GUID, &buffer->propertyUniqueID); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_TSS1, + currentProperty, + OFFSET_PS_TSS1, &buffer->timeStampS1); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_TSD1, + currentProperty, + OFFSET_PS_TSD1, &buffer->timeStampD1); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_TSS2, + currentProperty, + OFFSET_PS_TSS2, &buffer->timeStampS2); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_TSD2, + currentProperty, + OFFSET_PS_TSD2, &buffer->timeStampD2); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_STARTBLOCK, + currentProperty, + OFFSET_PS_STARTBLOCK, &buffer->startingBlock); StorageUtl_ReadDWord( - currentProperty, - OFFSET_PS_SIZE, + currentProperty, + OFFSET_PS_SIZE, &buffer->size.s.LowPart); buffer->size.s.HighPart = 0; @@ -3217,65 +3217,65 @@ BOOL StorageImpl_WriteProperty( memset(currentProperty, 0, PROPSET_BLOCK_SIZE); memcpy( - currentProperty + OFFSET_PS_NAME, - buffer->name, + currentProperty + OFFSET_PS_NAME, + buffer->name, PROPERTY_NAME_BUFFER_LEN ); memcpy(currentProperty + OFFSET_PS_PROPERTYTYPE, &buffer->propertyType, 1); StorageUtl_WriteWord( - currentProperty, - OFFSET_PS_NAMELENGTH, + currentProperty, + OFFSET_PS_NAMELENGTH, buffer->sizeOfNameString); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_PREVIOUSPROP, + currentProperty, + OFFSET_PS_PREVIOUSPROP, buffer->previousProperty); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_NEXTPROP, + currentProperty, + OFFSET_PS_NEXTPROP, buffer->nextProperty); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_DIRPROP, + currentProperty, + OFFSET_PS_DIRPROP, buffer->dirProperty); StorageUtl_WriteGUID( - currentProperty, - OFFSET_PS_GUID, + currentProperty, + OFFSET_PS_GUID, &buffer->propertyUniqueID); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_TSS1, + currentProperty, + OFFSET_PS_TSS1, buffer->timeStampS1); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_TSD1, + currentProperty, + OFFSET_PS_TSD1, buffer->timeStampD1); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_TSS2, + currentProperty, + OFFSET_PS_TSS2, buffer->timeStampS2); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_TSD2, + currentProperty, + OFFSET_PS_TSD2, buffer->timeStampD2); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_STARTBLOCK, + currentProperty, + OFFSET_PS_STARTBLOCK, buffer->startingBlock); StorageUtl_WriteDWord( - currentProperty, - OFFSET_PS_SIZE, + currentProperty, + OFFSET_PS_SIZE, buffer->size.s.LowPart); writeSuccessful = BlockChainStream_WriteAt(This->rootBlockChain, @@ -3321,10 +3321,10 @@ BOOL StorageImpl_WriteBigBlock( memcpy(bigBlockBuffer, buffer, This->bigBlockSize); StorageImpl_ReleaseBigBlock(This, bigBlockBuffer); - + return TRUE; } - + return FALSE; } @@ -3454,7 +3454,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks( */ StorageInternalImpl* StorageInternalImpl_Construct( - StorageImpl* ancestorStorage, + StorageImpl* ancestorStorage, ULONG rootPropertyIndex) { StorageInternalImpl* newStorage; @@ -3505,13 +3505,13 @@ void StorageInternalImpl_Destroy( ** The non-root storages cannot be opened in transacted mode thus this function ** does nothing. */ -HRESULT WINAPI StorageInternalImpl_Commit( +HRESULT WINAPI StorageInternalImpl_Commit( IStorage* iface, - DWORD grfCommitFlags) /* [in] */ + DWORD grfCommitFlags) /* [in] */ { return S_OK; } - + /****************************************************************************** ** ** Storage32InternalImpl_Revert @@ -3519,7 +3519,7 @@ HRESULT WINAPI StorageInternalImpl_Commit( ** The non-root storages cannot be opened in transacted mode thus this function ** does nothing. */ -HRESULT WINAPI StorageInternalImpl_Revert( +HRESULT WINAPI StorageInternalImpl_Revert( IStorage* iface) { return S_OK; @@ -3536,7 +3536,7 @@ IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct( IEnumSTATSTGImpl* newEnumeration; newEnumeration = HeapAlloc(GetProcessHeap(), 0, sizeof(IEnumSTATSTGImpl)); - + if (newEnumeration!=0) { /* @@ -3544,30 +3544,30 @@ IEnumSTATSTGImpl* IEnumSTATSTGImpl_Construct( */ ICOM_VTBL(newEnumeration) = &IEnumSTATSTGImpl_Vtbl; newEnumeration->ref = 0; - + /* * We want to nail-down the reference to the storage in case the * enumeration out-lives the storage in the client application. */ newEnumeration->parentStorage = parentStorage; IStorage_AddRef((IStorage*)newEnumeration->parentStorage); - + newEnumeration->firstPropertyNode = firstPropertyNode; - + /* * Initialize the search stack */ newEnumeration->stackSize = 0; newEnumeration->stackMaxSize = ENUMSTATSGT_SIZE_INCREMENT; - newEnumeration->stackToVisit = + newEnumeration->stackToVisit = HeapAlloc(GetProcessHeap(), 0, sizeof(ULONG)*ENUMSTATSGT_SIZE_INCREMENT); - + /* * Make sure the current node of the iterator is the first one. */ IEnumSTATSTGImpl_Reset((IEnumSTATSTG*)newEnumeration); } - + return newEnumeration; } @@ -3599,11 +3599,11 @@ HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface( /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = (IEnumSTATSTG*)This; } - else if (memcmp(&IID_IStorage, riid, sizeof(IID_IEnumSTATSTG)) == 0) + else if (memcmp(&IID_IStorage, riid, sizeof(IID_IEnumSTATSTG)) == 0) { *ppvObject = (IEnumSTATSTG*)This; } @@ -3622,7 +3622,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface( return S_OK; } - + ULONG WINAPI IEnumSTATSTGImpl_AddRef( IEnumSTATSTG* iface) { @@ -3631,7 +3631,7 @@ ULONG WINAPI IEnumSTATSTGImpl_AddRef( This->ref++; return This->ref; } - + ULONG WINAPI IEnumSTATSTGImpl_Release( IEnumSTATSTG* iface) { @@ -3650,7 +3650,7 @@ ULONG WINAPI IEnumSTATSTGImpl_Release( IEnumSTATSTGImpl_Destroy(This); } - return newRef;; + return newRef; } HRESULT WINAPI IEnumSTATSTGImpl_Next( @@ -3670,15 +3670,15 @@ HRESULT WINAPI IEnumSTATSTGImpl_Next( * Perform a sanity check on the parameters. */ if ( (rgelt==0) || ( (celt!=1) && (pceltFetched==0) ) ) - return E_INVALIDARG; - + return E_INVALIDARG; + /* * To avoid the special case, get another pointer to a ULONG value if * the caller didn't supply one. */ if (pceltFetched==0) pceltFetched = &objectFetched; - + /* * Start the iteration, we will iterate until we hit the end of the * linked list or until we hit the number of items to iterate through @@ -3690,10 +3690,10 @@ HRESULT WINAPI IEnumSTATSTGImpl_Next( */ currentSearchNode = IEnumSTATSTGImpl_PopSearchNode(This, FALSE); - while ( ( *pceltFetched < celt) && + while ( ( *pceltFetched < celt) && ( currentSearchNode!=PROPERTY_NULL) ) { - /* + /* * Remove the top node from the stack */ IEnumSTATSTGImpl_PopSearchNode(This, TRUE); @@ -3702,7 +3702,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Next( * Read the property from the storage. */ StorageImpl_ReadProperty(This->parentStorage, - currentSearchNode, + currentSearchNode, ¤tProperty); /* @@ -3711,7 +3711,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Next( StorageUtl_CopyPropertyToSTATSTG(currentReturnStruct, ¤tProperty, STATFLAG_DEFAULT); - + /* * Step to the next item in the iteration */ @@ -3735,7 +3735,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Next( return S_FALSE; } - + HRESULT WINAPI IEnumSTATSTGImpl_Skip( IEnumSTATSTG* iface, ULONG celt) @@ -3751,10 +3751,10 @@ HRESULT WINAPI IEnumSTATSTGImpl_Skip( */ currentSearchNode = IEnumSTATSTGImpl_PopSearchNode(This, FALSE); - while ( (objectFetched < celt) && + while ( (objectFetched < celt) && (currentSearchNode!=PROPERTY_NULL) ) { - /* + /* * Remove the top node from the stack */ IEnumSTATSTGImpl_PopSearchNode(This, TRUE); @@ -3763,9 +3763,9 @@ HRESULT WINAPI IEnumSTATSTGImpl_Skip( * Read the property from the storage. */ StorageImpl_ReadProperty(This->parentStorage, - currentSearchNode, + currentSearchNode, ¤tProperty); - + /* * Step to the next item in the iteration */ @@ -3787,7 +3787,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Skip( return S_FALSE; } - + HRESULT WINAPI IEnumSTATSTGImpl_Reset( IEnumSTATSTG* iface) { @@ -3806,7 +3806,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Reset( */ readSuccessful = StorageImpl_ReadProperty( This->parentStorage, - This->firstPropertyNode, + This->firstPropertyNode, &rootProperty); if (readSuccessful) @@ -3821,7 +3821,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Reset( return S_OK; } - + HRESULT WINAPI IEnumSTATSTGImpl_Clone( IEnumSTATSTG* iface, IEnumSTATSTG** ppenum) @@ -3835,23 +3835,23 @@ HRESULT WINAPI IEnumSTATSTGImpl_Clone( */ if (ppenum==0) return E_INVALIDARG; - + newClone = IEnumSTATSTGImpl_Construct(This->parentStorage, This->firstPropertyNode); - + /* * The new clone enumeration must point to the same current node as * the ole one. */ newClone->stackSize = This->stackSize ; newClone->stackMaxSize = This->stackMaxSize ; - newClone->stackToVisit = + newClone->stackToVisit = HeapAlloc(GetProcessHeap(), 0, sizeof(ULONG) * newClone->stackMaxSize); memcpy( - newClone->stackToVisit, - This->stackToVisit, + newClone->stackToVisit, + This->stackToVisit, sizeof(ULONG) * newClone->stackSize); *ppenum = (IEnumSTATSTG*)newClone; @@ -3867,7 +3867,7 @@ HRESULT WINAPI IEnumSTATSTGImpl_Clone( INT IEnumSTATSTGImpl_FindParentProperty( IEnumSTATSTGImpl *This, - ULONG childProperty, + ULONG childProperty, StgProperty *currentProperty, ULONG *thisNodeId) { @@ -3885,7 +3885,7 @@ INT IEnumSTATSTGImpl_FindParentProperty( * Start with the node at the top of the stack. */ currentSearchNode = IEnumSTATSTGImpl_PopSearchNode(This, FALSE); - + while (currentSearchNode!=PROPERTY_NULL) { @@ -3894,7 +3894,7 @@ INT IEnumSTATSTGImpl_FindParentProperty( */ *thisNodeId = currentSearchNode; - /* + /* * Remove the top node from the stack */ IEnumSTATSTGImpl_PopSearchNode(This, TRUE); @@ -3904,18 +3904,18 @@ INT IEnumSTATSTGImpl_FindParentProperty( */ StorageImpl_ReadProperty( This->parentStorage, - currentSearchNode, + currentSearchNode, currentProperty); - + if (currentProperty->previousProperty == childProperty) return PROPERTY_RELATION_PREVIOUS; - else if (currentProperty->nextProperty == childProperty) + else if (currentProperty->nextProperty == childProperty) return PROPERTY_RELATION_NEXT; - + else if (currentProperty->dirProperty == childProperty) return PROPERTY_RELATION_DIR; - + /* * Push the next search node in the search stack. */ @@ -3944,7 +3944,7 @@ ULONG IEnumSTATSTGImpl_FindProperty( while (currentSearchNode!=PROPERTY_NULL) { - /* + /* * Remove the top node from the stack */ IEnumSTATSTGImpl_PopSearchNode(This, TRUE); @@ -3953,11 +3953,11 @@ ULONG IEnumSTATSTGImpl_FindProperty( * Read the property from the storage. */ StorageImpl_ReadProperty(This->parentStorage, - currentSearchNode, + currentSearchNode, currentProperty); if ( propertyNameCmp( - (OLECHAR*)currentProperty->name, + (OLECHAR*)currentProperty->name, (OLECHAR*)lpszPropName) == 0) return currentSearchNode; @@ -3996,7 +3996,7 @@ void IEnumSTATSTGImpl_PushSearchNode( This->stackMaxSize += ENUMSTATSGT_SIZE_INCREMENT; This->stackToVisit = HeapReAlloc( - GetProcessHeap(), + GetProcessHeap(), 0, This->stackToVisit, sizeof(ULONG) * This->stackMaxSize); @@ -4010,7 +4010,7 @@ void IEnumSTATSTGImpl_PushSearchNode( */ readSuccessful = StorageImpl_ReadProperty( This->parentStorage, - nodeToPush, + nodeToPush, &rootProperty); if (readSuccessful) @@ -4097,12 +4097,12 @@ void StorageUtl_CopyPropertyToSTATSTG( } else { - destination->pwcsName = + destination->pwcsName = CoTaskMemAlloc((lstrlenW(source->name)+1)*sizeof(WCHAR)); strcpyW((LPWSTR)destination->pwcsName, source->name); } - + switch (source->propertyType) { case PROPTYPE_STORAGE: @@ -4114,20 +4114,20 @@ void StorageUtl_CopyPropertyToSTATSTG( break; default: destination->type = STGTY_STREAM; - break; + break; } destination->cbSize = source->size; -/* +/* currentReturnStruct->mtime = {0}; TODO currentReturnStruct->ctime = {0}; - currentReturnStruct->atime = {0}; + currentReturnStruct->atime = {0}; */ destination->grfMode = 0; - destination->grfLocksSupported = 0; + destination->grfLocksSupported = 0; destination->clsid = source->propertyUniqueID; - destination->grfStateBits = 0; - destination->reserved = 0; + destination->grfStateBits = 0; + destination->reserved = 0; } /****************************************************************************** @@ -4135,7 +4135,7 @@ void StorageUtl_CopyPropertyToSTATSTG( */ BlockChainStream* BlockChainStream_Construct( - StorageImpl* parentStorage, + StorageImpl* parentStorage, ULONG* headOfStreamPlaceHolder, ULONG propertyIndex) { @@ -4208,7 +4208,7 @@ ULONG BlockChainStream_GetHeadOfChain(BlockChainStream* This) * * Returns the number of blocks that comprises this chain. * This is not the size of the stream as the last block may not be full! - * + * */ ULONG BlockChainStream_GetCount(BlockChainStream* This) { @@ -4222,7 +4222,7 @@ ULONG BlockChainStream_GetCount(BlockChainStream* This) count++; blockIndex = StorageImpl_GetNextBlockInChain( - This->parentStorage, + This->parentStorage, blockIndex); } @@ -4230,7 +4230,7 @@ ULONG BlockChainStream_GetCount(BlockChainStream* This) } /****************************************************************************** - * BlockChainStream_ReadAt + * BlockChainStream_ReadAt * * Reads a specified number of bytes from this chain at the specified offset. * bytesRead may be NULL. @@ -4270,9 +4270,9 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This, while ( (blockNoInSequence > 0) && (blockIndex != BLOCK_END_OF_CHAIN)) { - blockIndex = + blockIndex = StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex); - + blockNoInSequence--; } @@ -4283,29 +4283,29 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This, */ *bytesRead = 0; bufferWalker = buffer; - + while ( (size > 0) && (blockIndex != BLOCK_END_OF_CHAIN) ) { /* * Calculate how many bytes we can copy from this big block. */ - bytesToReadInBuffer = + bytesToReadInBuffer = min(This->parentStorage->bigBlockSize - offsetInBlock, size); - + /* * Copy those bytes to the buffer */ - bigBlockBuffer = + bigBlockBuffer = StorageImpl_GetROBigBlock(This->parentStorage, blockIndex); - + memcpy(bufferWalker, bigBlockBuffer + offsetInBlock, bytesToReadInBuffer); - + StorageImpl_ReleaseBigBlock(This->parentStorage, bigBlockBuffer); - + /* * Step to the next big block. */ - blockIndex = + blockIndex = StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex); bufferWalker += bytesToReadInBuffer; @@ -4314,7 +4314,7 @@ BOOL BlockChainStream_ReadAt(BlockChainStream* This, offsetInBlock = 0; /* There is no offset on the next block */ } - + return (size == 0); } @@ -4359,9 +4359,9 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This, while ( (blockNoInSequence > 0) && (blockIndex != BLOCK_END_OF_CHAIN)) { - blockIndex = + blockIndex = StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex); - + blockNoInSequence--; } @@ -4379,22 +4379,22 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This, /* * Calculate how many bytes we can copy from this big block. */ - bytesToWrite = + bytesToWrite = min(This->parentStorage->bigBlockSize - offsetInBlock, size); - + /* * Copy those bytes to the buffer */ bigBlockBuffer = StorageImpl_GetBigBlock(This->parentStorage, blockIndex); - + memcpy(bigBlockBuffer + offsetInBlock, bufferWalker, bytesToWrite); - + StorageImpl_ReleaseBigBlock(This->parentStorage, bigBlockBuffer); - + /* * Step to the next big block. */ - blockIndex = + blockIndex = StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex); bufferWalker += bytesToWrite; @@ -4402,7 +4402,7 @@ BOOL BlockChainStream_WriteAt(BlockChainStream* This, *bytesWritten += bytesToWrite; offsetInBlock = 0; /* There is no offset on the next block */ } - + return (size == 0); } @@ -4439,20 +4439,20 @@ BOOL BlockChainStream_Shrink(BlockChainStream* This, */ while (count < numBlocks) { - blockIndex = + blockIndex = StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex); count++; } /* Get the next block before marking the new end */ - extraBlock = + extraBlock = StorageImpl_GetNextBlockInChain(This->parentStorage, blockIndex); /* Mark the new end of chain */ StorageImpl_SetNextBlockInChain( - This->parentStorage, - blockIndex, + This->parentStorage, + blockIndex, BLOCK_END_OF_CHAIN); This->tailIndex = blockIndex; @@ -4463,7 +4463,7 @@ BOOL BlockChainStream_Shrink(BlockChainStream* This, */ while (extraBlock != BLOCK_END_OF_CHAIN) { - blockIndex = + blockIndex = StorageImpl_GetNextBlockInChain(This->parentStorage, extraBlock); StorageImpl_FreeBigBlock(This->parentStorage, extraBlock); @@ -4507,14 +4507,14 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This, assert(This->ownerPropertyIndex != PROPERTY_NULL); StorageImpl_ReadProperty( - This->parentStorage, + This->parentStorage, This->ownerPropertyIndex, &chainProp); - chainProp.startingBlock = blockIndex; + chainProp.startingBlock = blockIndex; StorageImpl_WriteProperty( - This->parentStorage, + This->parentStorage, This->ownerPropertyIndex, &chainProp); } @@ -4563,13 +4563,13 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This, blockIndex = StorageImpl_GetNextFreeBigBlock(This->parentStorage); StorageImpl_SetNextBlockInChain( - This->parentStorage, - currentBlock, + This->parentStorage, + currentBlock, blockIndex); StorageImpl_SetNextBlockInChain( - This->parentStorage, - blockIndex, + This->parentStorage, + blockIndex, BLOCK_END_OF_CHAIN); currentBlock = blockIndex; @@ -4591,7 +4591,7 @@ BOOL BlockChainStream_Enlarge(BlockChainStream* This, * * TODO: Free the actual blocks in the file when we shrink the chain. * Currently, the blocks are still in the file. So the file size - * doesn't shrink even if we shrink streams. + * doesn't shrink even if we shrink streams. */ BOOL BlockChainStream_SetSize( BlockChainStream* This, @@ -4608,7 +4608,7 @@ BOOL BlockChainStream_SetSize( } else { - ULARGE_INTEGER fileSize = + ULARGE_INTEGER fileSize = BIGBLOCKFILE_GetSize(This->parentStorage->bigBlockFile); ULONG diff = newSize.s.LowPart - size.s.LowPart; @@ -4617,7 +4617,7 @@ BOOL BlockChainStream_SetSize( * Make sure the file stays a multiple of blocksize */ if ((diff % This->parentStorage->bigBlockSize) != 0) - diff += (This->parentStorage->bigBlockSize - + diff += (This->parentStorage->bigBlockSize - (diff % This->parentStorage->bigBlockSize) ); fileSize.s.LowPart += diff; @@ -4641,8 +4641,8 @@ ULARGE_INTEGER BlockChainStream_GetSize(BlockChainStream* This) if(This->headOfStreamPlaceHolder == NULL) { - /* - * This chain is a data stream read the property and return + /* + * This chain is a data stream read the property and return * the appropriate size */ StorageImpl_ReadProperty( @@ -4655,15 +4655,15 @@ ULARGE_INTEGER BlockChainStream_GetSize(BlockChainStream* This) else { /* - * this chain is a chain that does not have a property, figure out the - * size by making the product number of used blocks times the + * this chain is a chain that does not have a property, figure out the + * size by making the product number of used blocks times the * size of them */ ULARGE_INTEGER result; result.s.HighPart = 0; - result.s.LowPart = - BlockChainStream_GetCount(This) * + result.s.LowPart = + BlockChainStream_GetCount(This) * This->parentStorage->bigBlockSize; return result; @@ -4675,7 +4675,7 @@ ULARGE_INTEGER BlockChainStream_GetSize(BlockChainStream* This) */ SmallBlockChainStream* SmallBlockChainStream_Construct( - StorageImpl* parentStorage, + StorageImpl* parentStorage, ULONG propertyIndex) { SmallBlockChainStream* newStream; @@ -4726,7 +4726,7 @@ ULONG SmallBlockChainStream_GetHeadOfChain( * SmallBlockChainStream_GetNextBlockInChain * * Returns the index of the next small block in this chain. - * + * * Return Values: * - BLOCK_END_OF_CHAIN: end of this chain * - BLOCK_UNUSED: small block 'blockIndex' is free @@ -4853,7 +4853,7 @@ ULONG SmallBlockChainStream_GetNextFreeBlock( } else { - ULONG count = + ULONG count = BlockChainStream_GetCount(This->parentStorage->smallBlockDepotChain); ULONG sbdIndex = This->parentStorage->smallBlockDepotStart; @@ -4864,26 +4864,26 @@ ULONG SmallBlockChainStream_GetNextFreeBlock( while (nextBlock != BLOCK_END_OF_CHAIN) { sbdIndex = nextBlock; - nextBlock = + nextBlock = StorageImpl_GetNextBlockInChain(This->parentStorage, sbdIndex); } newsbdIndex = StorageImpl_GetNextFreeBigBlock(This->parentStorage); if (sbdIndex != BLOCK_END_OF_CHAIN) StorageImpl_SetNextBlockInChain( - This->parentStorage, - sbdIndex, + This->parentStorage, + sbdIndex, newsbdIndex); StorageImpl_SetNextBlockInChain( - This->parentStorage, - newsbdIndex, + This->parentStorage, + newsbdIndex, BLOCK_END_OF_CHAIN); /* * Initialize all the small blocks to free */ - smallBlockDepot = + smallBlockDepot = StorageImpl_GetBigBlock(This->parentStorage, newsbdIndex); memset(smallBlockDepot, BLOCK_UNUSED, This->parentStorage->bigBlockSize); @@ -4895,7 +4895,7 @@ ULONG SmallBlockChainStream_GetNextFreeBlock( * We have just created the small block depot. */ StgProperty rootProp; - ULONG sbStartIndex; + ULONG sbStartIndex; /* * Save it in the header @@ -4904,19 +4904,19 @@ ULONG SmallBlockChainStream_GetNextFreeBlock( StorageImpl_SaveFileHeader(This->parentStorage); /* - * And allocate the first big block that will contain small blocks + * And allocate the first big block that will contain small blocks */ - sbStartIndex = + sbStartIndex = StorageImpl_GetNextFreeBigBlock(This->parentStorage); StorageImpl_SetNextBlockInChain( - This->parentStorage, - sbStartIndex, + This->parentStorage, + sbStartIndex, BLOCK_END_OF_CHAIN); StorageImpl_ReadProperty( - This->parentStorage, - This->parentStorage->rootPropertySetIndex, + This->parentStorage, + This->parentStorage->rootPropertySetIndex, &rootProp); rootProp.startingBlock = sbStartIndex; @@ -4924,14 +4924,14 @@ ULONG SmallBlockChainStream_GetNextFreeBlock( rootProp.size.s.LowPart = This->parentStorage->bigBlockSize; StorageImpl_WriteProperty( - This->parentStorage, - This->parentStorage->rootPropertySetIndex, + This->parentStorage, + This->parentStorage->rootPropertySetIndex, &rootProp); } } } - smallBlocksPerBigBlock = + smallBlocksPerBigBlock = This->parentStorage->bigBlockSize / This->parentStorage->smallBlockSize; /* @@ -4943,22 +4943,22 @@ ULONG SmallBlockChainStream_GetNextFreeBlock( ULONG blocksRequired = (blockIndex / smallBlocksPerBigBlock) + 1; StorageImpl_ReadProperty( - This->parentStorage, - This->parentStorage->rootPropertySetIndex, + This->parentStorage, + This->parentStorage->rootPropertySetIndex, &rootProp); - if (rootProp.size.s.LowPart < + if (rootProp.size.s.LowPart < (blocksRequired * This->parentStorage->bigBlockSize)) { rootProp.size.s.LowPart += This->parentStorage->bigBlockSize; BlockChainStream_SetSize( - This->parentStorage->smallBlockRootChain, + This->parentStorage->smallBlockRootChain, rootProp.size); StorageImpl_WriteProperty( - This->parentStorage, - This->parentStorage->rootPropertySetIndex, + This->parentStorage, + This->parentStorage->rootPropertySetIndex, &rootProp); } } @@ -4971,7 +4971,7 @@ ULONG SmallBlockChainStream_GetNextFreeBlock( * * Reads a specified number of bytes from this chain at the specified offset. * bytesRead may be NULL. - * Failure will be returned if the specified number of bytes has not been read. + * Failure will be returned if the specified number of bytes has not been read. */ BOOL SmallBlockChainStream_ReadAt( SmallBlockChainStream* This, @@ -4981,7 +4981,7 @@ BOOL SmallBlockChainStream_ReadAt( ULONG* bytesRead) { ULARGE_INTEGER offsetInBigBlockFile; - ULONG blockNoInSequence = + ULONG blockNoInSequence = offset.s.LowPart / This->parentStorage->smallBlockSize; ULONG offsetInBlock = offset.s.LowPart % This->parentStorage->smallBlockSize; @@ -5018,14 +5018,14 @@ BOOL SmallBlockChainStream_ReadAt( /* * Calculate how many bytes we can copy from this small block. */ - bytesToReadInBuffer = + bytesToReadInBuffer = min(This->parentStorage->smallBlockSize - offsetInBlock, size); /* * Calculate the offset of the small block in the small block file. */ offsetInBigBlockFile.s.HighPart = 0; - offsetInBigBlockFile.s.LowPart = + offsetInBigBlockFile.s.LowPart = blockIndex * This->parentStorage->smallBlockSize; offsetInBigBlockFile.s.LowPart += offsetInBlock; @@ -5069,7 +5069,7 @@ BOOL SmallBlockChainStream_WriteAt( ULONG* bytesWritten) { ULARGE_INTEGER offsetInBigBlockFile; - ULONG blockNoInSequence = + ULONG blockNoInSequence = offset.s.LowPart / This->parentStorage->smallBlockSize; ULONG offsetInBlock = offset.s.LowPart % This->parentStorage->smallBlockSize; @@ -5077,24 +5077,24 @@ BOOL SmallBlockChainStream_WriteAt( ULONG blockIndex; ULONG bytesWrittenFromBigBlockFile; BYTE* bufferWalker; - + /* * This should never happen on a small block file. */ assert(offset.s.HighPart==0); - + /* * Find the first block in the stream that contains part of the buffer. */ blockIndex = SmallBlockChainStream_GetHeadOfChain(This); - + while ( (blockNoInSequence > 0) && (blockIndex != BLOCK_END_OF_CHAIN)) { blockIndex = SmallBlockChainStream_GetNextBlockInChain(This, blockIndex); - + blockNoInSequence--; } - + /* * Start writing the buffer. * @@ -5108,18 +5108,18 @@ BOOL SmallBlockChainStream_WriteAt( /* * Calculate how many bytes we can copy to this small block. */ - bytesToWriteInBuffer = + bytesToWriteInBuffer = min(This->parentStorage->smallBlockSize - offsetInBlock, size); - + /* * Calculate the offset of the small block in the small block file. */ offsetInBigBlockFile.s.HighPart = 0; - offsetInBigBlockFile.s.LowPart = + offsetInBigBlockFile.s.LowPart = blockIndex * This->parentStorage->smallBlockSize; offsetInBigBlockFile.s.LowPart += offsetInBlock; - + /* * Write those bytes in the buffer to the small block file. */ @@ -5128,9 +5128,9 @@ BOOL SmallBlockChainStream_WriteAt( bytesToWriteInBuffer, bufferWalker, &bytesWrittenFromBigBlockFile); - + assert(bytesWrittenFromBigBlockFile == bytesToWriteInBuffer); - + /* * Step to the next big block. */ @@ -5140,14 +5140,14 @@ BOOL SmallBlockChainStream_WriteAt( *bytesWritten += bytesToWriteInBuffer; offsetInBlock = 0; /* There is no offset on the next block */ } - + return (size == 0); } /****************************************************************************** * SmallBlockChainStream_Shrink * - * Shrinks this chain in the small block depot. + * Shrinks this chain in the small block depot. */ BOOL SmallBlockChainStream_Shrink( SmallBlockChainStream* This, @@ -5175,13 +5175,13 @@ BOOL SmallBlockChainStream_Shrink( /* * If the count is 0, we have a special case, the head of the chain was - * just freed. + * just freed. */ if (count == 0) { StgProperty chainProp; - StorageImpl_ReadProperty(This->parentStorage, + StorageImpl_ReadProperty(This->parentStorage, This->ownerPropertyIndex, &chainProp); @@ -5203,8 +5203,8 @@ BOOL SmallBlockChainStream_Shrink( /* Mark the new end of chain */ SmallBlockChainStream_SetNextBlockInChain( - This, - blockIndex, + This, + blockIndex, BLOCK_END_OF_CHAIN); } @@ -5218,7 +5218,7 @@ BOOL SmallBlockChainStream_Shrink( extraBlock = blockIndex; } - return TRUE; + return TRUE; } /****************************************************************************** @@ -5254,8 +5254,8 @@ BOOL SmallBlockChainStream_Enlarge( blockIndex = chainProp.startingBlock; SmallBlockChainStream_SetNextBlockInChain( - This, - blockIndex, + This, + blockIndex, BLOCK_END_OF_CHAIN); } @@ -5288,8 +5288,8 @@ BOOL SmallBlockChainStream_Enlarge( SmallBlockChainStream_SetNextBlockInChain(This, currentBlock, blockIndex); SmallBlockChainStream_SetNextBlockInChain( - This, - blockIndex, + This, + blockIndex, BLOCK_END_OF_CHAIN); currentBlock = blockIndex; @@ -5330,7 +5330,7 @@ ULONG SmallBlockChainStream_GetCount(SmallBlockChainStream* This) * * TODO: Free the actual blocks in the file when we shrink the chain. * Currently, the blocks are still in the file. So the file size - * doesn't shrink even if we shrink streams. + * doesn't shrink even if we shrink streams. */ BOOL SmallBlockChainStream_SetSize( SmallBlockChainStream* This, @@ -5388,8 +5388,8 @@ HRESULT WINAPI StgCreateDocfile( DWORD fileAttributes; WCHAR tempFileName[MAX_PATH]; - TRACE("(%s, %lx, %ld, %p)\n", - debugstr_w(pwcsName), grfMode, + TRACE("(%s, %lx, %ld, %p)\n", + debugstr_w(pwcsName), grfMode, reserved, ppstgOpen); /* @@ -5436,7 +5436,7 @@ HRESULT WINAPI StgCreateDocfile( } /* - * Interpret the STGM value grfMode + * Interpret the STGM value grfMode */ shareMode = GetShareModeFromSTGM(grfMode); accessMode = GetAccessModeFromSTGM(grfMode); @@ -5461,7 +5461,7 @@ HRESULT WINAPI StgCreateDocfile( creationMode, fileAttributes, 0); - + if (hFile == INVALID_HANDLE_VALUE) { return E_FAIL; @@ -5471,7 +5471,7 @@ HRESULT WINAPI StgCreateDocfile( * Allocate and initialize the new IStorage32object. */ newStorage = HeapAlloc(GetProcessHeap(), 0, sizeof(StorageImpl)); - + if (newStorage == 0) return STG_E_INSUFFICIENTMEMORY; @@ -5483,7 +5483,7 @@ HRESULT WINAPI StgCreateDocfile( grfMode, TRUE, TRUE); - + if (FAILED(hr)) { HeapFree(GetProcessHeap(), 0, newStorage); @@ -5509,7 +5509,7 @@ HRESULT WINAPI StgOpenStorage( IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, - DWORD reserved, + DWORD reserved, IStorage **ppstgOpen) { StorageImpl* newStorage = 0; @@ -5520,7 +5520,7 @@ HRESULT WINAPI StgOpenStorage( WCHAR fullname[MAX_PATH]; DWORD length; - TRACE("(%s, %p, %lx, %p, %ld, %p)\n", + TRACE("(%s, %p, %lx, %p, %ld, %p)\n", debugstr_w(pwcsName), pstgPriority, grfMode, snbExclude, reserved, ppstgOpen); @@ -5552,17 +5552,17 @@ HRESULT WINAPI StgOpenStorage( * Initialize the "out" parameter. */ *ppstgOpen = 0; - - hFile = CreateFileW( pwcsName, + + hFile = CreateFileW( pwcsName, accessMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, 0); - + length = GetFileSize(hFile, NULL); - + if (hFile==INVALID_HANDLE_VALUE) { DWORD last_error = GetLastError(); @@ -5599,7 +5599,7 @@ HRESULT WINAPI StgOpenStorage( * Allocate and initialize the new IStorage32object. */ newStorage = HeapAlloc(GetProcessHeap(), 0, sizeof(StorageImpl)); - + if (newStorage == 0) { hr = STG_E_INSUFFICIENTMEMORY; @@ -5615,7 +5615,7 @@ HRESULT WINAPI StgOpenStorage( grfMode, TRUE, !length ); - + if (FAILED(hr)) { HeapFree(GetProcessHeap(), 0, newStorage); @@ -5626,7 +5626,7 @@ HRESULT WINAPI StgOpenStorage( hr = STG_E_FILEALREADYEXISTS; goto end; } - + /* prepare the file name string given in lieu of the root property name */ GetFullPathNameW(pwcsName, MAX_PATH, fullname, NULL); memcpy(newStorage->filename, fullname, PROPERTY_NAME_BUFFER_LEN); @@ -5639,7 +5639,7 @@ HRESULT WINAPI StgOpenStorage( (IStorage*)newStorage, (REFIID)&IID_IStorage, (void**)ppstgOpen); - + end: TRACE("<-- %08lx, IStorage %p\n", hr, ppstgOpen ? *ppstgOpen : NULL); return hr; @@ -5694,7 +5694,7 @@ HRESULT WINAPI StgCreateDocfileOnILockBytes( (REFIID)&IID_IStorage, (void**)ppstgOpen); - return hr; + return hr; } /****************************************************************************** @@ -5732,7 +5732,7 @@ HRESULT WINAPI StgOpenStorageOnILockBytes( * Allocate and initialize the new IStorage object. */ newStorage = HeapAlloc(GetProcessHeap(), 0, sizeof(StorageImpl)); - + if (newStorage == 0) return STG_E_INSUFFICIENTMEMORY; @@ -5820,7 +5820,7 @@ HRESULT WINAPI ReadClassStg(IStorage *pstg,CLSID *pclsid){ STATSTG pstatstg; HRESULT hRes; - + TRACE("()\n"); if(pclsid==NULL) @@ -5881,13 +5881,13 @@ HRESULT WINAPI OleSaveToStream(IPersistStream *pPStm,IStream *pStm) CLSID clsid; HRESULT res; - + TRACE("(%p,%p)\n",pPStm,pStm); res=IPersistStream_GetClassID(pPStm,&clsid); if (SUCCEEDED(res)){ - + res=WriteClassStm(pStm,&clsid); if (SUCCEEDED(res)) @@ -5905,16 +5905,16 @@ HRESULT WINAPI OleSaveToStream(IPersistStream *pPStm,IStream *pStm) * STGM_DIRECT 0x00000000 * STGM_TRANSACTED 0x00010000 * STGM_SIMPLE 0x08000000 - * + * * STGM_READ 0x00000000 * STGM_WRITE 0x00000001 * STGM_READWRITE 0x00000002 - * + * * STGM_SHARE_DENY_NONE 0x00000040 * STGM_SHARE_DENY_READ 0x00000030 * STGM_SHARE_DENY_WRITE 0x00000020 * STGM_SHARE_EXCLUSIVE 0x00000010 - * + * * STGM_PRIORITY 0x00040000 * STGM_DELETEONRELEASE 0x04000000 * @@ -5930,11 +5930,11 @@ static HRESULT validateSTGM(DWORD stgm) BOOL bSTGM_TRANSACTED = ((stgm & STGM_TRANSACTED) == STGM_TRANSACTED); BOOL bSTGM_SIMPLE = ((stgm & STGM_SIMPLE) == STGM_SIMPLE); BOOL bSTGM_DIRECT = ! (bSTGM_TRANSACTED || bSTGM_SIMPLE); - + BOOL bSTGM_WRITE = ((stgm & STGM_WRITE) == STGM_WRITE); BOOL bSTGM_READWRITE = ((stgm & STGM_READWRITE) == STGM_READWRITE); BOOL bSTGM_READ = ! (bSTGM_WRITE || bSTGM_READWRITE); - + BOOL bSTGM_SHARE_DENY_NONE = ((stgm & STGM_SHARE_DENY_NONE) == STGM_SHARE_DENY_NONE); @@ -5949,18 +5949,18 @@ static HRESULT validateSTGM(DWORD stgm) BOOL bSTGM_CREATE = ((stgm & STGM_CREATE) == STGM_CREATE); BOOL bSTGM_CONVERT = ((stgm & STGM_CONVERT) == STGM_CONVERT); - + BOOL bSTGM_NOSCRATCH = ((stgm & STGM_NOSCRATCH) == STGM_NOSCRATCH); BOOL bSTGM_NOSNAPSHOT = ((stgm & STGM_NOSNAPSHOT) == STGM_NOSNAPSHOT); - /* + /* * STGM_DIRECT | STGM_TRANSACTED | STGM_SIMPLE */ if ( ! bSTGM_DIRECT ) if( bSTGM_TRANSACTED && bSTGM_SIMPLE ) return E_FAIL; - /* + /* * STGM_WRITE | STGM_READWRITE | STGM_READ */ if ( ! bSTGM_READ ) @@ -5968,13 +5968,13 @@ static HRESULT validateSTGM(DWORD stgm) return E_FAIL; /* - * STGM_SHARE_DENY_NONE | others + * STGM_SHARE_DENY_NONE | others * (I assume here that DENY_READ implies DENY_WRITE) */ if ( bSTGM_SHARE_DENY_NONE ) if ( bSTGM_SHARE_DENY_READ || - bSTGM_SHARE_DENY_WRITE || - bSTGM_SHARE_EXCLUSIVE) + bSTGM_SHARE_DENY_WRITE || + bSTGM_SHARE_EXCLUSIVE) return E_FAIL; /* @@ -5989,14 +5989,14 @@ static HRESULT validateSTGM(DWORD stgm) */ if ( bSTGM_NOSCRATCH && ! bSTGM_TRANSACTED ) return E_FAIL; - + /* - * STGM_NOSNAPSHOT requires STGM_TRANSACTED and + * STGM_NOSNAPSHOT requires STGM_TRANSACTED and * not STGM_SHARE_EXCLUSIVE or STGM_SHARE_DENY_WRITE` */ if (bSTGM_NOSNAPSHOT) { - if ( ! ( bSTGM_TRANSACTED && + if ( ! ( bSTGM_TRANSACTED && !(bSTGM_SHARE_EXCLUSIVE || bSTGM_SHARE_DENY_WRITE)) ) return E_FAIL; } @@ -6008,7 +6008,7 @@ static HRESULT validateSTGM(DWORD stgm) * GetShareModeFromSTGM * * This method will return a share mode flag from a STGM value. - * The STGM value is assumed valid. + * The STGM value is assumed valid. */ static DWORD GetShareModeFromSTGM(DWORD stgm) { @@ -6084,9 +6084,9 @@ static DWORD GetCreationModeFromSTGM(DWORD stgm) /************************************************************************* - * OLECONVERT_LoadOLE10 [Internal] + * OLECONVERT_LoadOLE10 [Internal] * - * Loads the OLE10 STREAM to memory + * Loads the OLE10 STREAM to memory * * PARAMS * pOleStream [I] The OLESTREAM @@ -6099,7 +6099,7 @@ static DWORD GetCreationModeFromSTGM(DWORD stgm) * * NOTES * This function is used by OleConvertOLESTREAMToIStorage only. - * + * * Memory allocated for pData must be freed by the caller */ HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *pData, BOOL bStrem1) @@ -6254,9 +6254,9 @@ HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA * } /************************************************************************* - * OLECONVERT_SaveOLE10 [Internal] + * OLECONVERT_SaveOLE10 [Internal] * - * Saves the OLE10 STREAM From memory + * Saves the OLE10 STREAM From memory * * PARAMS * pData [I] Data Structure for the OLESTREAM Data @@ -6268,7 +6268,7 @@ HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA * * * NOTES * This function is used by OleConvertIStorageToOLESTREAM only. - * + * */ HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleStream) { @@ -6362,12 +6362,12 @@ HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleS } /************************************************************************* - * OLECONVERT_GetOLE20FromOLE10[Internal] + * OLECONVERT_GetOLE20FromOLE10[Internal] * * This function copies OLE10 Data (the IStorage in the OLESTREAM) to disk, - * opens it, and copies the content to the dest IStorage for + * opens it, and copies the content to the dest IStorage for * OleConvertOLESTREAMToIStorage - * + * * * PARAMS * pDestStorage [I] The IStorage to copy the data to @@ -6378,8 +6378,8 @@ HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleS * Nothing * * NOTES - * - * + * + * */ void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD nBufferLength) { @@ -6414,9 +6414,9 @@ void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD n /************************************************************************* - * OLECONVERT_WriteOLE20ToBuffer [Internal] + * OLECONVERT_WriteOLE20ToBuffer [Internal] * - * Saves the OLE10 STREAM From memory + * Saves the OLE10 STREAM From memory * * PARAMS * pStorage [I] The Src IStorage to copy @@ -6429,7 +6429,7 @@ void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, BYTE *pBuffer, DWORD n * Memory allocated for pData must be freed by the caller * * Used by OleConvertIStorageToOLESTREAM only. - * + * */ DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData) { @@ -6441,7 +6441,7 @@ DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData) WCHAR wstrPrefix[] = {'s', 'i', 's', 0}; *pData = NULL; - + /* Create temp Storage */ GetTempPathW(MAX_PATH, wstrTempDir); GetTempFileNameW(wstrTempDir, wstrPrefix, 0, wstrTempFile); @@ -6468,7 +6468,7 @@ DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData) } /************************************************************************* - * OLECONVERT_CreateOleStream [Internal] + * OLECONVERT_CreateOleStream [Internal] * * Creates the "\001OLE" stream in the IStorage if neccessary. * @@ -6483,24 +6483,24 @@ DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData) * * This stream is still unknown, MS Word seems to have extra data * but since the data is stored in the OLESTREAM there should be - * no need to recreate the stream. If the stream is manually + * no need to recreate the stream. If the stream is manually * deleted it will create it with this default data. - * + * */ void OLECONVERT_CreateOleStream(LPSTORAGE pStorage) { HRESULT hRes; IStream *pStream; WCHAR wstrStreamName[] = {1,'O', 'l', 'e', 0}; - BYTE pOleStreamHeader [] = + BYTE pOleStreamHeader [] = { - 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 + 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; - + /* Create stream if not present */ - hRes = IStorage_CreateStream(pStorage, wstrStreamName, + hRes = IStorage_CreateStream(pStorage, wstrStreamName, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream ); if(hRes == S_OK) @@ -6513,12 +6513,12 @@ void OLECONVERT_CreateOleStream(LPSTORAGE pStorage) /************************************************************************* - * OLECONVERT_CreateCompObjStream [Internal] + * OLECONVERT_CreateCompObjStream [Internal] * * Creates a "\001CompObj" is the destination IStorage if necessary. * * PARAMS - * pStorage [I] The dest IStorage to create the CompObj Stream + * pStorage [I] The dest IStorage to create the CompObj Stream * if necessary. * strOleTypeName [I] The ProgID * @@ -6530,10 +6530,10 @@ void OLECONVERT_CreateOleStream(LPSTORAGE pStorage) * This function is used by OleConvertOLESTREAMToIStorage only. * * The stream data is stored in the OLESTREAM and there should be - * no need to recreate the stream. If the stream is manually + * no need to recreate the stream. If the stream is manually * deleted it will attempt to create it by querying the registry. * - * + * */ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName) { @@ -6552,7 +6552,7 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName /* Create a CompObj stream if it doesn't exist */ - hStorageRes = IStorage_CreateStream(pStorage, wstrStreamName, + hStorageRes = IStorage_CreateStream(pStorage, wstrStreamName, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream ); if(hStorageRes == S_OK) { @@ -6573,7 +6573,7 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName HKEY hKey; LONG hErr; /* Get the CLSID Default Name from the Registry */ - hErr = RegOpenKeyA(HKEY_CLASSES_ROOT, IStorageCompObj.strProgIDName, &hKey); + hErr = RegOpenKeyA(HKEY_CLASSES_ROOT, IStorageCompObj.strProgIDName, &hKey); if(hErr == ERROR_SUCCESS) { char strTemp[OLESTREAM_MAX_STR_LEN]; @@ -6615,14 +6615,14 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName /************************************************************************* - * OLECONVERT_CreateOlePresStream[Internal] + * OLECONVERT_CreateOlePresStream[Internal] * * Creates the "\002OlePres000" Stream with the Metafile data * * PARAMS * pStorage [I] The dest IStorage to create \002OLEPres000 stream in. * dwExtentX [I] Width of the Metafile - * dwExtentY [I] Height of the Metafile + * dwExtentY [I] Height of the Metafile * pData [I] Metafile data * dwDataLength [I] Size of the Metafile data * @@ -6632,31 +6632,31 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName * * NOTES * This function is used by OleConvertOLESTREAMToIStorage only. - * + * */ void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD dwExtentY , BYTE *pData, DWORD dwDataLength) { HRESULT hRes; IStream *pStream; WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0}; - BYTE pOlePresStreamHeader [] = + BYTE pOlePresStreamHeader [] = { - 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - BYTE pOlePresStreamHeaderEmpty [] = + BYTE pOlePresStreamHeaderEmpty [] = { - 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - + /* Create the OlePres000 Stream */ - hRes = IStorage_CreateStream(pStorage, wstrStreamName, + hRes = IStorage_CreateStream(pStorage, wstrStreamName, STGM_CREATE | STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream ); if(hRes == S_OK) @@ -6700,7 +6700,7 @@ void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD d } /************************************************************************* - * OLECONVERT_CreateOle10NativeStream [Internal] + * OLECONVERT_CreateOle10NativeStream [Internal] * * Creates the "\001Ole10Native" Stream (should contain a BMP) * @@ -6716,16 +6716,16 @@ void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD d * This function is used by OleConvertOLESTREAMToIStorage only. * * Might need to verify the data and return appropriate error message - * + * */ void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD dwDataLength) { HRESULT hRes; IStream *pStream; WCHAR wstrStreamName[] = {1, 'O', 'l', 'e', '1', '0', 'N', 'a', 't', 'i', 'v', 'e', 0}; - + /* Create the Ole10Native Stream */ - hRes = IStorage_CreateStream(pStorage, wstrStreamName, + hRes = IStorage_CreateStream(pStorage, wstrStreamName, STGM_CREATE | STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream ); if(hRes == S_OK) @@ -6739,7 +6739,7 @@ void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD d } /************************************************************************* - * OLECONVERT_GetOLE10ProgID [Internal] + * OLECONVERT_GetOLE10ProgID [Internal] * * Finds the ProgID (or OleTypeID) from the IStorage * @@ -6755,7 +6755,7 @@ void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, BYTE *pData, DWORD d * NOTES * This function is used by OleConvertIStorageToOLESTREAM only. * - * + * */ HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dwSize) { @@ -6766,7 +6766,7 @@ HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dw WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; /* Open the CompObj Stream */ - hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, + hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream ); if(hRes == S_OK) { @@ -6803,13 +6803,13 @@ HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dw { *dwSize = WideCharToMultiByte(CP_ACP, 0, wstrProgID, -1, strProgID, *dwSize, NULL, FALSE); } - + } return hRes; } /************************************************************************* - * OLECONVERT_GetOle10PresData [Internal] + * OLECONVERT_GetOle10PresData [Internal] * * Converts IStorage "/001Ole10Native" stream to a OLE10 Stream * @@ -6824,8 +6824,8 @@ HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dw * This function is used by OleConvertIStorageToOLESTREAM only. * * Memory allocated for pData must be freed by the caller - * - * + * + * */ void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData) { @@ -6845,7 +6845,7 @@ void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA * pOleStreamData[1].pData = NULL; /* Open Ole10Native Stream */ - hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, + hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream ); if(hRes == S_OK) { @@ -6864,7 +6864,7 @@ void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA * /************************************************************************* - * OLECONVERT_GetOle20PresData[Internal] + * OLECONVERT_GetOle20PresData[Internal] * * Converts IStorage "/002OlePres000" stream to a OLE10 Stream * @@ -6877,7 +6877,7 @@ void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA * * * NOTES * This function is used by OleConvertIStorageToOLESTREAM only. - * + * * Memory allocated for pData must be freed by the caller */ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData) @@ -6904,7 +6904,7 @@ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA * /* Open OlePress000 stream */ - hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, + hRes = IStorage_OpenStream(pStorage, wstrStreamName, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream ); if(hRes == S_OK) { @@ -6952,7 +6952,7 @@ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA * } /************************************************************************* - * OleConvertOLESTREAMToIStorage [OLE32.87] + * OleConvertOLESTREAMToIStorage [OLE32.87] * * Read info on MSDN * @@ -6961,11 +6961,11 @@ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA * * Still unsure of some mem fields for OLE 10 Stream * Still some unknowns for the IStorage: "\002OlePres000", "\001CompObj", * and "\001OLE" streams - * + * */ HRESULT WINAPI OleConvertOLESTREAMToIStorage ( - LPOLESTREAM pOleStream, - LPSTORAGE pstg, + LPOLESTREAM pOleStream, + LPSTORAGE pstg, const DVTARGETDEVICE* ptd) { int i; @@ -7056,10 +7056,10 @@ HRESULT WINAPI OleConvertOLESTREAMToIStorage ( * Still unsure of some mem fields for OLE 10 Stream * Still some unknowns for the IStorage: "\002OlePres000", "\001CompObj", * and "\001OLE" streams. - * + * */ HRESULT WINAPI OleConvertIStorageToOLESTREAM ( - LPSTORAGE pstg, + LPSTORAGE pstg, LPOLESTREAM pOleStream) { int i; @@ -7084,7 +7084,7 @@ HRESULT WINAPI OleConvertIStorageToOLESTREAM ( if(hRes == S_OK) { /* Was it originally Ole10 */ - hRes = IStorage_OpenStream(pstg, wstrStreamName, 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream); + hRes = IStorage_OpenStream(pstg, wstrStreamName, 0, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream); if(hRes == S_OK) { IStream_Release(pStream); diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index c1d16f21e9d..5e8316ce265 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -6,7 +6,7 @@ * (Thanks to Martin Schwartz ) * * This include file contains definitions of types and function - * prototypes that are used in the many files implementing the + * prototypes that are used in the many files implementing the * storage functionality * * Copyright 1998,1999 Francis Beaudet @@ -49,15 +49,15 @@ static const ULONG OFFSET_PS_NAME = 0x00000000; static const ULONG OFFSET_PS_NAMELENGTH = 0x00000040; static const ULONG OFFSET_PS_PROPERTYTYPE = 0x00000042; static const ULONG OFFSET_PS_PREVIOUSPROP = 0x00000044; -static const ULONG OFFSET_PS_NEXTPROP = 0x00000048; +static const ULONG OFFSET_PS_NEXTPROP = 0x00000048; static const ULONG OFFSET_PS_DIRPROP = 0x0000004C; static const ULONG OFFSET_PS_GUID = 0x00000050; static const ULONG OFFSET_PS_TSS1 = 0x00000064; static const ULONG OFFSET_PS_TSD1 = 0x00000068; static const ULONG OFFSET_PS_TSS2 = 0x0000006C; static const ULONG OFFSET_PS_TSD2 = 0x00000070; -static const ULONG OFFSET_PS_STARTBLOCK = 0x00000074; -static const ULONG OFFSET_PS_SIZE = 0x00000078; +static const ULONG OFFSET_PS_STARTBLOCK = 0x00000074; +static const ULONG OFFSET_PS_SIZE = 0x00000078; static const WORD DEF_BIG_BLOCK_SIZE_BITS = 0x0009; static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006; static const WORD DEF_BIG_BLOCK_SIZE = 0x0200; @@ -69,7 +69,7 @@ static const ULONG BLOCK_UNUSED = 0xFFFFFFFF; static const ULONG PROPERTY_NULL = 0xFFFFFFFF; #define PROPERTY_NAME_MAX_LEN 0x20 -#define PROPERTY_NAME_BUFFER_LEN 0x40 +#define PROPERTY_NAME_BUFFER_LEN 0x40 #define PROPSET_BLOCK_SIZE 0x00000080 @@ -141,7 +141,7 @@ struct StgProperty * Big Block File support * * The big block file is an abstraction of a flat file separated in - * same sized blocks. The implementation for the methods described in + * same sized blocks. The implementation for the methods described in * this section appear in stg_bigblockfile.c */ @@ -208,19 +208,19 @@ struct StorageBaseImpl * Reference count of this object */ ULONG ref; - - /* - * Ancestor storage (top level) + + /* + * Ancestor storage (top level) */ - StorageImpl* ancestorStorage; - + StorageImpl* ancestorStorage; + /* * Index of the property for the root of * this storage */ ULONG rootPropertySetIndex; - - /* + + /* * virtual Destructor method. */ void (*v_destructor)(StorageBaseImpl*); @@ -234,41 +234,41 @@ HRESULT WINAPI StorageBaseImpl_QueryInterface( IStorage* iface, REFIID riid, void** ppvObject); - -ULONG WINAPI StorageBaseImpl_AddRef( + +ULONG WINAPI StorageBaseImpl_AddRef( IStorage* iface); - -ULONG WINAPI StorageBaseImpl_Release( + +ULONG WINAPI StorageBaseImpl_Release( IStorage* iface); - -HRESULT WINAPI StorageBaseImpl_OpenStream( + +HRESULT WINAPI StorageBaseImpl_OpenStream( IStorage* iface, const OLECHAR* pwcsName, /* [string][in] */ void* reserved1, /* [unique][in] */ - DWORD grfMode, /* [in] */ - DWORD reserved2, /* [in] */ - IStream** ppstm); /* [out] */ - -HRESULT WINAPI StorageBaseImpl_OpenStorage( - IStorage* iface, - const OLECHAR* pwcsName, /* [string][unique][in] */ - IStorage* pstgPriority, /* [unique][in] */ - DWORD grfMode, /* [in] */ - SNB snbExclude, /* [unique][in] */ - DWORD reserved, /* [in] */ - IStorage** ppstg); /* [out] */ - -HRESULT WINAPI StorageBaseImpl_EnumElements( - IStorage* iface, - DWORD reserved1, /* [in] */ - void* reserved2, /* [size_is][unique][in] */ - DWORD reserved3, /* [in] */ - IEnumSTATSTG** ppenum); /* [out] */ + DWORD grfMode, /* [in] */ + DWORD reserved2, /* [in] */ + IStream** ppstm); /* [out] */ -HRESULT WINAPI StorageBaseImpl_Stat( +HRESULT WINAPI StorageBaseImpl_OpenStorage( IStorage* iface, - STATSTG* pstatstg, /* [out] */ - DWORD grfStatFlag); /* [in] */ + const OLECHAR* pwcsName, /* [string][unique][in] */ + IStorage* pstgPriority, /* [unique][in] */ + DWORD grfMode, /* [in] */ + SNB snbExclude, /* [unique][in] */ + DWORD reserved, /* [in] */ + IStorage** ppstg); /* [out] */ + +HRESULT WINAPI StorageBaseImpl_EnumElements( + IStorage* iface, + DWORD reserved1, /* [in] */ + void* reserved2, /* [size_is][unique][in] */ + DWORD reserved3, /* [in] */ + IEnumSTATSTG** ppenum); /* [out] */ + +HRESULT WINAPI StorageBaseImpl_Stat( + IStorage* iface, + STATSTG* pstatstg, /* [out] */ + DWORD grfStatFlag); /* [in] */ HRESULT WINAPI StorageBaseImpl_RenameElement( IStorage* iface, @@ -303,10 +303,10 @@ struct StorageImpl * casting as a Storage32BaseImpl */ ULONG ref; - struct StorageImpl* ancestorStorage; + struct StorageImpl* ancestorStorage; ULONG rootPropertySetIndex; void (*v_destructor)(struct StorageImpl*); - + /* * The following data members are specific to the Storage32Impl * class @@ -340,62 +340,62 @@ struct StorageImpl */ BlockChainStream* rootBlockChain; BlockChainStream* smallBlockDepotChain; - BlockChainStream* smallBlockRootChain; + BlockChainStream* smallBlockRootChain; /* * Pointer to the big block file abstraction */ - BigBlockFile* bigBlockFile; + BigBlockFile* bigBlockFile; }; /* * Method declaration for the Storage32Impl class - */ + */ -HRESULT WINAPI StorageImpl_CreateStorage( +HRESULT WINAPI StorageImpl_CreateStorage( IStorage* iface, - const OLECHAR* pwcsName, /* [string][in] */ - DWORD grfMode, /* [in] */ - DWORD dwStgFmt, /* [in] */ - DWORD reserved2, /* [in] */ - IStorage** ppstg); /* [out] */ - -HRESULT WINAPI StorageImpl_CopyTo( + const OLECHAR* pwcsName, /* [string][in] */ + DWORD grfMode, /* [in] */ + DWORD dwStgFmt, /* [in] */ + DWORD reserved2, /* [in] */ + IStorage** ppstg); /* [out] */ + +HRESULT WINAPI StorageImpl_CopyTo( IStorage* iface, - DWORD ciidExclude, /* [in] */ - const IID* rgiidExclude, /* [size_is][unique][in] */ - SNB snbExclude, /* [unique][in] */ - IStorage* pstgDest); /* [unique][in] */ - -HRESULT WINAPI StorageImpl_MoveElementTo( + DWORD ciidExclude, /* [in] */ + const IID* rgiidExclude, /* [size_is][unique][in] */ + SNB snbExclude, /* [unique][in] */ + IStorage* pstgDest); /* [unique][in] */ + +HRESULT WINAPI StorageImpl_MoveElementTo( IStorage* iface, - const OLECHAR* pwcsName, /* [string][in] */ - IStorage* pstgDest, /* [unique][in] */ - const OLECHAR* pwcsNewName, /* [string][in] */ - DWORD grfFlags); /* [in] */ - -HRESULT WINAPI StorageImpl_Commit( + const OLECHAR* pwcsName, /* [string][in] */ + IStorage* pstgDest, /* [unique][in] */ + const OLECHAR* pwcsNewName, /* [string][in] */ + DWORD grfFlags); /* [in] */ + +HRESULT WINAPI StorageImpl_Commit( IStorage* iface, - DWORD grfCommitFlags); /* [in] */ - -HRESULT WINAPI StorageImpl_Revert( + DWORD grfCommitFlags); /* [in] */ + +HRESULT WINAPI StorageImpl_Revert( IStorage* iface); - -HRESULT WINAPI StorageImpl_DestroyElement( - IStorage* iface, - const OLECHAR* pwcsName); /* [string][in] */ - -HRESULT WINAPI StorageImpl_SetElementTimes( - IStorage* iface, - const OLECHAR* pwcsName, /* [string][in] */ - const FILETIME* pctime, /* [in] */ - const FILETIME* patime, /* [in] */ - const FILETIME* pmtime); /* [in] */ -HRESULT WINAPI StorageImpl_SetStateBits( +HRESULT WINAPI StorageImpl_DestroyElement( IStorage* iface, - DWORD grfStateBits, /* [in] */ - DWORD grfMask); /* [in] */ + const OLECHAR* pwcsName); /* [string][in] */ + +HRESULT WINAPI StorageImpl_SetElementTimes( + IStorage* iface, + const OLECHAR* pwcsName, /* [string][in] */ + const FILETIME* pctime, /* [in] */ + const FILETIME* patime, /* [in] */ + const FILETIME* pmtime); /* [in] */ + +HRESULT WINAPI StorageImpl_SetStateBits( + IStorage* iface, + DWORD grfStateBits, /* [in] */ + DWORD grfMask); /* [in] */ HRESULT WINAPI StorageImpl_Stat(IStorage* iface, STATSTG* pstatstg, /* [out] */ @@ -502,7 +502,7 @@ struct StorageInternalImpl * casting as a Storage32BaseImpl */ ULONG ref; - struct StorageImpl* ancestorStorage; + struct StorageImpl* ancestorStorage; ULONG rootPropertySetIndex; void (*v_destructor)(struct StorageInternalImpl*); @@ -515,17 +515,17 @@ struct StorageInternalImpl * Method definitions for the Storage32InternalImpl class. */ StorageInternalImpl* StorageInternalImpl_Construct( - StorageImpl* ancestorStorage, + StorageImpl* ancestorStorage, ULONG rootTropertyIndex); void StorageInternalImpl_Destroy( StorageInternalImpl* This); -HRESULT WINAPI StorageInternalImpl_Commit( +HRESULT WINAPI StorageInternalImpl_Commit( IStorage* iface, - DWORD grfCommitFlags); /* [in] */ + DWORD grfCommitFlags); /* [in] */ -HRESULT WINAPI StorageInternalImpl_Revert( +HRESULT WINAPI StorageInternalImpl_Revert( IStorage* iface); @@ -540,7 +540,7 @@ struct IEnumSTATSTGImpl { ICOM_VFIELD(IEnumSTATSTG); /* Needs to be the first item in the struct * since we want to cast this in a IEnumSTATSTG pointer */ - + ULONG ref; /* Reference count */ StorageImpl* parentStorage; /* Reference to the parent storage */ ULONG firstPropertyNode; /* Index of the root of the storage to enumerate */ @@ -564,26 +564,26 @@ HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface( IEnumSTATSTG* iface, REFIID riid, void** ppvObject); - + ULONG WINAPI IEnumSTATSTGImpl_AddRef( - IEnumSTATSTG* iface); - + IEnumSTATSTG* iface); + ULONG WINAPI IEnumSTATSTGImpl_Release( IEnumSTATSTG* iface); - + HRESULT WINAPI IEnumSTATSTGImpl_Next( IEnumSTATSTG* iface, ULONG celt, STATSTG* rgelt, ULONG* pceltFetched); - + HRESULT WINAPI IEnumSTATSTGImpl_Skip( IEnumSTATSTG* iface, ULONG celt); - + HRESULT WINAPI IEnumSTATSTGImpl_Reset( IEnumSTATSTG* iface); - + HRESULT WINAPI IEnumSTATSTGImpl_Clone( IEnumSTATSTG* iface, IEnumSTATSTG** ppenum); @@ -625,7 +625,7 @@ struct StgStreamImpl { ICOM_VFIELD(IStream); /* Needs to be the first item in the struct * since we want to cast this in a IStream pointer */ - + /* * Reference count */ @@ -655,7 +655,7 @@ struct StgStreamImpl * This is the current position of the cursor in the stream */ ULARGE_INTEGER currentPosition; - + /* * The information in the stream is represented by a chain of small blocks * or a chain of large blocks. Depending on the case, one of the two @@ -681,76 +681,76 @@ void StgStreamImpl_OpenBlockChain( HRESULT WINAPI StgStreamImpl_QueryInterface( IStream* iface, - REFIID riid, /* [in] */ - void** ppvObject); /* [iid_is][out] */ - + REFIID riid, /* [in] */ + void** ppvObject); /* [iid_is][out] */ + ULONG WINAPI StgStreamImpl_AddRef( IStream* iface); - + ULONG WINAPI StgStreamImpl_Release( IStream* iface); - -HRESULT WINAPI StgStreamImpl_Read( + +HRESULT WINAPI StgStreamImpl_Read( IStream* iface, void* pv, /* [length_is][size_is][out] */ - ULONG cb, /* [in] */ - ULONG* pcbRead); /* [out] */ - + ULONG cb, /* [in] */ + ULONG* pcbRead); /* [out] */ + HRESULT WINAPI StgStreamImpl_Write( IStream* iface, - const void* pv, /* [size_is][in] */ - ULONG cb, /* [in] */ - ULONG* pcbWritten); /* [out] */ - -HRESULT WINAPI StgStreamImpl_Seek( - IStream* iface, - LARGE_INTEGER dlibMove, /* [in] */ - DWORD dwOrigin, /* [in] */ - ULARGE_INTEGER* plibNewPosition); /* [out] */ - -HRESULT WINAPI StgStreamImpl_SetSize( - IStream* iface, - ULARGE_INTEGER libNewSize); /* [in] */ - -HRESULT WINAPI StgStreamImpl_CopyTo( - IStream* iface, - IStream* pstm, /* [unique][in] */ - ULARGE_INTEGER cb, /* [in] */ - ULARGE_INTEGER* pcbRead, /* [out] */ - ULARGE_INTEGER* pcbWritten); /* [out] */ + const void* pv, /* [size_is][in] */ + ULONG cb, /* [in] */ + ULONG* pcbWritten); /* [out] */ -HRESULT WINAPI StgStreamImpl_Commit( +HRESULT WINAPI StgStreamImpl_Seek( + IStream* iface, + LARGE_INTEGER dlibMove, /* [in] */ + DWORD dwOrigin, /* [in] */ + ULARGE_INTEGER* plibNewPosition); /* [out] */ + +HRESULT WINAPI StgStreamImpl_SetSize( + IStream* iface, + ULARGE_INTEGER libNewSize); /* [in] */ + +HRESULT WINAPI StgStreamImpl_CopyTo( + IStream* iface, + IStream* pstm, /* [unique][in] */ + ULARGE_INTEGER cb, /* [in] */ + ULARGE_INTEGER* pcbRead, /* [out] */ + ULARGE_INTEGER* pcbWritten); /* [out] */ + +HRESULT WINAPI StgStreamImpl_Commit( IStream* iface, - DWORD grfCommitFlags); /* [in] */ - -HRESULT WINAPI StgStreamImpl_Revert( + DWORD grfCommitFlags); /* [in] */ + +HRESULT WINAPI StgStreamImpl_Revert( IStream* iface); - -HRESULT WINAPI StgStreamImpl_LockRegion( + +HRESULT WINAPI StgStreamImpl_LockRegion( IStream* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType); /* [in] */ - -HRESULT WINAPI StgStreamImpl_UnlockRegion( + ULARGE_INTEGER libOffset, /* [in] */ + ULARGE_INTEGER cb, /* [in] */ + DWORD dwLockType); /* [in] */ + +HRESULT WINAPI StgStreamImpl_UnlockRegion( IStream* iface, - ULARGE_INTEGER libOffset, /* [in] */ - ULARGE_INTEGER cb, /* [in] */ - DWORD dwLockType); /* [in] */ - -HRESULT WINAPI StgStreamImpl_Stat( + ULARGE_INTEGER libOffset, /* [in] */ + ULARGE_INTEGER cb, /* [in] */ + DWORD dwLockType); /* [in] */ + +HRESULT WINAPI StgStreamImpl_Stat( IStream* iface, STATSTG* pstatstg, /* [out] */ - DWORD grfStatFlag); /* [in] */ - -HRESULT WINAPI StgStreamImpl_Clone( + DWORD grfStatFlag); /* [in] */ + +HRESULT WINAPI StgStreamImpl_Clone( IStream* iface, - IStream** ppstm); /* [out] */ + IStream** ppstm); /* [out] */ /******************************************************************************** * The StorageUtl_ functions are miscelaneous utility functions. Most of which are - * abstractions used to read values from file buffers without having to worry + * abstractions used to read values from file buffers without having to worry * about bit order */ void StorageUtl_ReadWord(void* buffer, ULONG offset, WORD* value); @@ -784,7 +784,7 @@ struct BlockChainStream * Methods for the BlockChainStream class. */ BlockChainStream* BlockChainStream_Construct( - StorageImpl* parentStorage, + StorageImpl* parentStorage, ULONG* headOfStreamPlaceHolder, ULONG propertyIndex); @@ -834,7 +834,7 @@ struct SmallBlockChainStream * Methods of the SmallBlockChainStream class. */ SmallBlockChainStream* SmallBlockChainStream_Construct( - StorageImpl* parentStorage, + StorageImpl* parentStorage, ULONG propertyIndex); void SmallBlockChainStream_Destroy( diff --git a/dlls/oleaut32/connpt.c b/dlls/oleaut32/connpt.c index 516d1e380eb..fe99c985954 100644 --- a/dlls/oleaut32/connpt.c +++ b/dlls/oleaut32/connpt.c @@ -81,7 +81,7 @@ typedef struct EnumConnectionsImpl { /* Connection Data */ CONNECTDATA *pCD; DWORD nConns; - + /* Next connection to enumerate from */ DWORD nCur; @@ -106,7 +106,7 @@ static ConnectionPointImpl *ConnectionPointImpl_Construct(IUnknown *pUnk, Obj->ref = 1; Obj->iid = *riid; Obj->maxSinks = MAXSINKS; - Obj->sinks = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + Obj->sinks = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IUnknown*) * MAXSINKS); Obj->nSinks = 0; return Obj; @@ -148,24 +148,24 @@ static HRESULT WINAPI ConnectionPointImpl_QueryInterface( */ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ *ppvObject = 0; - + /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = (IConnectionPoint*)This; } - else if (memcmp(&IID_IConnectionPoint, riid, sizeof(IID_IConnectionPoint)) == 0) + else if (memcmp(&IID_IConnectionPoint, riid, sizeof(IID_IConnectionPoint)) == 0) { *ppvObject = (IConnectionPoint*)This; } - + /* * Check that we obtained an interface. */ @@ -174,14 +174,14 @@ static HRESULT WINAPI ConnectionPointImpl_QueryInterface( FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid)); return E_NOINTERFACE; } - + /* * Query Interface always increases the reference count by one when it is * successful */ ConnectionPointImpl_AddRef((IConnectionPoint*)This); - return S_OK;; + return S_OK; } @@ -198,13 +198,13 @@ static ULONG WINAPI ConnectionPointImpl_AddRef(IConnectionPoint* iface) return This->ref; } - + /************************************************************************ * ConnectionPointImpl_Release (IUnknown) * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI ConnectionPointImpl_Release( +static ULONG WINAPI ConnectionPointImpl_Release( IConnectionPoint* iface) { ICOM_THIS(ConnectionPointImpl, iface); @@ -224,7 +224,7 @@ static ULONG WINAPI ConnectionPointImpl_Release( return 0; } - + return This->ref; } @@ -318,7 +318,7 @@ static HRESULT WINAPI ConnectionPointImpl_Unadvise(IConnectionPoint *iface, static HRESULT WINAPI ConnectionPointImpl_EnumConnections( IConnectionPoint *iface, LPENUMCONNECTIONS *ppEnum) -{ +{ ICOM_THIS(ConnectionPointImpl, iface); CONNECTDATA *pCD; DWORD i, nextslot; @@ -326,7 +326,7 @@ static HRESULT WINAPI ConnectionPointImpl_EnumConnections( HRESULT hr; TRACE("(%p)->(%p)\n", This, ppEnum); - + *ppEnum = NULL; if(This->nSinks == 0) return OLE_E_NOCONNECTION; @@ -429,24 +429,24 @@ static HRESULT WINAPI EnumConnectionsImpl_QueryInterface( */ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ *ppvObject = 0; - + /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = (IEnumConnections*)This; } - else if (memcmp(&IID_IEnumConnections, riid, sizeof(IID_IEnumConnections)) == 0) + else if (memcmp(&IID_IEnumConnections, riid, sizeof(IID_IEnumConnections)) == 0) { *ppvObject = (IEnumConnections*)This; } - + /* * Check that we obtained an interface. */ @@ -455,14 +455,14 @@ static HRESULT WINAPI EnumConnectionsImpl_QueryInterface( FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid)); return E_NOINTERFACE; } - + /* * Query Interface always increases the reference count by one when it is * successful */ EnumConnectionsImpl_AddRef((IEnumConnections*)This); - return S_OK;; + return S_OK; } @@ -479,7 +479,7 @@ static ULONG WINAPI EnumConnectionsImpl_AddRef(IEnumConnections* iface) IUnknown_AddRef(This->pUnk); return This->ref; } - + /************************************************************************ * EnumConnectionsImpl_Release (IUnknown) * @@ -506,7 +506,7 @@ static ULONG WINAPI EnumConnectionsImpl_Release(IEnumConnections* iface) return 0; } - + return This->ref; } @@ -590,14 +590,14 @@ static HRESULT WINAPI EnumConnectionsImpl_Clone(IEnumConnections* iface, ICOM_THIS(EnumConnectionsImpl, iface); EnumConnectionsImpl *newObj; TRACE("(%p)->(%p)\n", This, ppEnum); - + newObj = EnumConnectionsImpl_Construct(This->pUnk, This->nConns, This->pCD); newObj->nCur = This->nCur; *ppEnum = (LPENUMCONNECTIONS)newObj; IUnknown_AddRef(This->pUnk); return S_OK; } - + static ICOM_VTABLE(IEnumConnections) EnumConnectionsImpl_VTable = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE @@ -633,7 +633,7 @@ HRESULT CreateConnectionPoint(IUnknown *pUnk, REFIID riid, Obj = ConnectionPointImpl_Construct(pUnk, riid); if(!Obj) return E_OUTOFMEMORY; - hr = IConnectionPoint_QueryInterface((IConnectionPoint *)Obj, + hr = IConnectionPoint_QueryInterface((IConnectionPoint *)Obj, &IID_IConnectionPoint, (LPVOID)pCP); IConnectionPoint_Release((IConnectionPoint *)Obj); return hr; diff --git a/dlls/oleaut32/dispatch.c b/dlls/oleaut32/dispatch.c index c29f955d32e..fedcef8f193 100644 --- a/dlls/oleaut32/dispatch.c +++ b/dlls/oleaut32/dispatch.c @@ -87,9 +87,9 @@ HRESULT WINAPI DispInvoke( /****************************************************************************** * DispGetIDsOfNames (OLEAUT32.29) * - * Convert a set of names to dispids, based on information + * Convert a set of names to dispids, based on information * contained in object's type library. - * + * * NOTES * - Defers to ITypeInfo::GetIDsOfNames() * diff --git a/dlls/oleaut32/ole2disp.c b/dlls/oleaut32/ole2disp.c index bc5bdf9819a..500d377b8fc 100644 --- a/dlls/oleaut32/ole2disp.c +++ b/dlls/oleaut32/ole2disp.c @@ -75,9 +75,9 @@ static void* BSTR_GetAddr(BSTR16 in) BSTR16 WINAPI SysAllocString16(LPCOLESTR16 in) { BSTR16 out; - + if (!in) return 0; - + out = BSTR_AllocBytes(strlen(in)+1); if (!out) return 0; strcpy(BSTR_GetAddr(out),in); @@ -94,7 +94,7 @@ BSTR16 WINAPI SysAllocString16(LPCOLESTR16 in) BSTR WINAPI SysAllocString(LPCOLESTR in) { if (!in) return 0; - + /* Delegate this to the SysAllocStringLen32 method. */ return SysAllocStringLen(in, lstrlenW(in)); } @@ -118,13 +118,13 @@ INT WINAPI SysReAllocString(LPBSTR old,LPCOLESTR in) /* * Sanity check */ - if (old==NULL) + if (old==NULL) return 0; /* * Make sure we free the old string. */ - if (*old!=NULL) + if (*old!=NULL) SysFreeString(*old); /* @@ -165,7 +165,7 @@ BSTR16 WINAPI SysAllocStringLen16(const char *in, int len) * section, he describes the DWORD value placed *before* the BSTR data type. * he describes it as a "DWORD count of characters". By experimenting with * a windows application, this count seems to be a DWORD count of bytes in - * the string. Meaning that the count is double the number of wide + * the string. Meaning that the count is double the number of wide * characters in the string. */ BSTR WINAPI SysAllocStringLen(const OLECHAR *in, unsigned int len) @@ -236,7 +236,7 @@ int WINAPI SysReAllocStringLen16(BSTR16 *old,const char *in,int len) return 1; } - + /****************************************************************************** * SysReAllocStringLen [OLEAUT32.5] */ @@ -245,13 +245,13 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* in, unsigned int len) /* * Sanity check */ - if (old==NULL) + if (old==NULL) return 0; /* * Make sure we free the old string. */ - if (*old!=NULL) + if (*old!=NULL) SysFreeString(*old); /* @@ -276,7 +276,7 @@ void WINAPI SysFreeString16(BSTR16 in) void WINAPI SysFreeString(BSTR in) { DWORD* bufferPointer; - + /* NULL is a valid parameter */ if(!in) return; @@ -317,7 +317,7 @@ int WINAPI SysStringLen(BSTR str) if (!str) return 0; /* - * The length of the string (in bytes) is contained in a DWORD placed + * The length of the string (in bytes) is contained in a DWORD placed * just before the BSTR pointer */ bufferPointer = (DWORD*)str; @@ -341,7 +341,7 @@ int WINAPI SysStringByteLen(BSTR str) if (!str) return 0; /* - * The length of the string (in bytes) is contained in a DWORD placed + * The length of the string (in bytes) is contained in a DWORD placed * just before the BSTR pointer */ bufferPointer = (DWORD*)str; @@ -418,7 +418,7 @@ HRESULT WINAPI RegisterActiveObject16( * * Converts an OLE_COLOR to a COLORREF. * See the documentation for conversion rules. - * pColorRef can be NULL. In that case the user only wants to test the + * pColorRef can be NULL. In that case the user only wants to test the * conversion. */ HRESULT WINAPI OleTranslateColor( diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c index 30b74551ed6..7087d9e5d15 100644 --- a/dlls/oleaut32/oleaut.c +++ b/dlls/oleaut32/oleaut.c @@ -53,7 +53,7 @@ HRESULT WINAPI RegisterActiveObject( StringFromGUID2(rcid,guidbuf,39); ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker); - if (FAILED(ret)) + if (FAILED(ret)) return ret; ret = GetRunningObjectTable(0,&runobtable); if (FAILED(ret)) { @@ -94,7 +94,7 @@ HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk) StringFromGUID2(rcid,guidbuf,39); ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker); - if (FAILED(ret)) + if (FAILED(ret)) return ret; ret = GetRunningObjectTable(0,&runobtable); if (FAILED(ret)) { @@ -153,7 +153,7 @@ UINT WINAPI OaBuildVersion() /*********************************************************************** * DllRegisterServer (OLEAUT32.320) */ -HRESULT WINAPI OLEAUT32_DllRegisterServer() { +HRESULT WINAPI OLEAUT32_DllRegisterServer() { FIXME("stub!\n"); return S_OK; } diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 164f8df9a20..3b753454967 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -53,7 +53,7 @@ typedef struct OLEFontImpl OLEFontImpl; struct OLEFontImpl { /* - * This class supports many interfaces. IUnknown, IFont, + * This class supports many interfaces. IUnknown, IFont, * IDispatch, IDispFont IPersistStream and IConnectionPointContainer. * The first two are supported by the first vtable, the next two are * supported by the second table and the last two have their own. @@ -92,15 +92,15 @@ struct OLEFontImpl }; /* - * Here, I define utility macros to help with the casting of the + * Here, I define utility macros to help with the casting of the * "this" parameter. * There is a version to accomodate all of the VTables implemented * by this object. */ #define _ICOM_THIS(class,name) class* this = (class*)name; -#define _ICOM_THIS_From_IDispatch(class, name) class* this = (class*)(((char*)name)-sizeof(void*)); -#define _ICOM_THIS_From_IPersistStream(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)); -#define _ICOM_THIS_From_IConnectionPointContainer(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)); +#define _ICOM_THIS_From_IDispatch(class, name) class* this = (class*)(((char*)name)-sizeof(void*)); +#define _ICOM_THIS_From_IPersistStream(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)); +#define _ICOM_THIS_From_IConnectionPointContainer(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)); /*********************************************************************** @@ -141,60 +141,60 @@ static HRESULT WINAPI OLEFontImpl_SetHdc(IFont* iface, HDC hdc); * Prototypes for the implementation functions for the IDispatch * interface */ -static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface(IDispatch* iface, - REFIID riid, +static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface(IDispatch* iface, + REFIID riid, VOID** ppvoid); static ULONG WINAPI OLEFontImpl_IDispatch_AddRef(IDispatch* iface); static ULONG WINAPI OLEFontImpl_IDispatch_Release(IDispatch* iface); -static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount(IDispatch* iface, +static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount(IDispatch* iface, unsigned int* pctinfo); -static HRESULT WINAPI OLEFontImpl_GetTypeInfo(IDispatch* iface, +static HRESULT WINAPI OLEFontImpl_GetTypeInfo(IDispatch* iface, UINT iTInfo, - LCID lcid, + LCID lcid, ITypeInfo** ppTInfo); static HRESULT WINAPI OLEFontImpl_GetIDsOfNames(IDispatch* iface, - REFIID riid, - LPOLESTR* rgszNames, - UINT cNames, + REFIID riid, + LPOLESTR* rgszNames, + UINT cNames, LCID lcid, DISPID* rgDispId); static HRESULT WINAPI OLEFontImpl_Invoke(IDispatch* iface, - DISPID dispIdMember, - REFIID riid, - LCID lcid, + DISPID dispIdMember, + REFIID riid, + LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, - VARIANT* pVarResult, + VARIANT* pVarResult, EXCEPINFO* pExepInfo, - UINT* puArgErr); + UINT* puArgErr); /*********************************************************************** * Prototypes for the implementation functions for the IPersistStream * interface */ -static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface(IPersistStream* iface, - REFIID riid, +static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface(IPersistStream* iface, + REFIID riid, VOID** ppvoid); static ULONG WINAPI OLEFontImpl_IPersistStream_AddRef(IPersistStream* iface); static ULONG WINAPI OLEFontImpl_IPersistStream_Release(IPersistStream* iface); -static HRESULT WINAPI OLEFontImpl_GetClassID(IPersistStream* iface, +static HRESULT WINAPI OLEFontImpl_GetClassID(IPersistStream* iface, CLSID* pClassID); static HRESULT WINAPI OLEFontImpl_IsDirty(IPersistStream* iface); static HRESULT WINAPI OLEFontImpl_Load(IPersistStream* iface, IStream* pLoadStream); static HRESULT WINAPI OLEFontImpl_Save(IPersistStream* iface, IStream* pOutStream, - BOOL fClearDirty); + BOOL fClearDirty); static HRESULT WINAPI OLEFontImpl_GetSizeMax(IPersistStream* iface, - ULARGE_INTEGER* pcbSize); + ULARGE_INTEGER* pcbSize); /*********************************************************************** * Prototypes for the implementation functions for the * IConnectionPointContainer interface */ static HRESULT WINAPI OLEFontImpl_IConnectionPointContainer_QueryInterface( - IConnectionPointContainer* iface, - REFIID riid, + IConnectionPointContainer* iface, + REFIID riid, VOID** ppvoid); static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_AddRef( IConnectionPointContainer* iface); @@ -234,7 +234,7 @@ static ICOM_VTABLE(IFont) OLEFontImpl_VTable = OLEFontImpl_get_Charset, OLEFontImpl_put_Charset, OLEFontImpl_get_hFont, - OLEFontImpl_Clone, + OLEFontImpl_Clone, OLEFontImpl_IsEqual, OLEFontImpl_SetRatio, OLEFontImpl_QueryTextMetrics, @@ -341,7 +341,7 @@ static void OLEFont_SendNotify(OLEFontImpl* this, DISPID dispID) CONNECTDATA CD; IConnectionPoint_EnumConnections(this->pCP, &pEnum); - + while(IEnumConnections_Next(pEnum, 1, &CD, NULL) == S_OK) { IPropertyNotifySink *sink; @@ -353,7 +353,7 @@ static void OLEFont_SendNotify(OLEFontImpl* this, DISPID dispID) IEnumConnections_Release(pEnum); return; } - + /************************************************************************ * OLEFontImpl_Construct * @@ -374,7 +374,7 @@ static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc) if (newObject==0) return newObject; - + /* * Initialize the virtual function table. */ @@ -382,9 +382,9 @@ static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc) newObject->lpvtbl2 = &OLEFontImpl_IDispatch_VTable; newObject->lpvtbl3 = &OLEFontImpl_IPersistStream_VTable; newObject->lpvtbl4 = &OLEFontImpl_IConnectionPointContainer_VTable; - + /* - * Start with one reference count. The caller of this function + * Start with one reference count. The caller of this function * must release the interface pointer when it is done. */ newObject->ref = 1; @@ -396,7 +396,7 @@ static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc) newObject->description.cbSizeofstruct = sizeof(FONTDESC); newObject->description.lpstrName = HeapAlloc(GetProcessHeap(), - 0, + 0, (lstrlenW(fontDesc->lpstrName)+1) * sizeof(WCHAR)); strcpyW(newObject->description.lpstrName, fontDesc->lpstrName); newObject->description.cySize = fontDesc->cySize; @@ -458,41 +458,41 @@ HRESULT WINAPI OLEFontImpl_QueryInterface( */ if ( (this==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ *ppvObject = 0; - + /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = (IFont*)this; } - else if (memcmp(&IID_IFont, riid, sizeof(IID_IFont)) == 0) + else if (memcmp(&IID_IFont, riid, sizeof(IID_IFont)) == 0) { *ppvObject = (IFont*)this; } - else if (memcmp(&IID_IDispatch, riid, sizeof(IID_IDispatch)) == 0) + else if (memcmp(&IID_IDispatch, riid, sizeof(IID_IDispatch)) == 0) { *ppvObject = (IDispatch*)&(this->lpvtbl2); } - else if (memcmp(&IID_IFontDisp, riid, sizeof(IID_IFontDisp)) == 0) + else if (memcmp(&IID_IFontDisp, riid, sizeof(IID_IFontDisp)) == 0) { *ppvObject = (IDispatch*)&(this->lpvtbl2); } - else if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0) + else if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0) { *ppvObject = (IPersistStream*)&(this->lpvtbl3); } else if (memcmp(&IID_IConnectionPointContainer, riid, - sizeof(IID_IConnectionPointContainer)) == 0) + sizeof(IID_IConnectionPointContainer)) == 0) { *ppvObject = (IPersistStream*)&(this->lpvtbl4); } - + /* * Check that we obtained an interface. */ @@ -501,22 +501,22 @@ HRESULT WINAPI OLEFontImpl_QueryInterface( FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid)); return E_NOINTERFACE; } - + /* * Query Interface always increases the reference count by one when it is * successful */ OLEFontImpl_AddRef((IFont*)this); - return S_OK;; + return S_OK; } - + /************************************************************************ * OLEFontImpl_AddRef (IUnknown) * * See Windows documentation for more details on IUnknown methods. */ -ULONG WINAPI OLEFontImpl_AddRef( +ULONG WINAPI OLEFontImpl_AddRef( IFont* iface) { _ICOM_THIS(OLEFontImpl, iface); @@ -525,13 +525,13 @@ ULONG WINAPI OLEFontImpl_AddRef( return this->ref; } - + /************************************************************************ * OLEFontImpl_Release (IUnknown) * * See Windows documentation for more details on IUnknown methods. */ -ULONG WINAPI OLEFontImpl_Release( +ULONG WINAPI OLEFontImpl_Release( IFont* iface) { _ICOM_THIS(OLEFontImpl, iface); @@ -551,17 +551,17 @@ ULONG WINAPI OLEFontImpl_Release( return 0; } - + return this->ref; } - + /************************************************************************ * OLEFontImpl_get_Name (IFont) * * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_get_Name( - IFont* iface, + IFont* iface, BSTR* pname) { _ICOM_THIS(OLEFontImpl, iface); @@ -586,7 +586,7 @@ static HRESULT WINAPI OLEFontImpl_get_Name( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_put_Name( - IFont* iface, + IFont* iface, BSTR name) { _ICOM_THIS(OLEFontImpl, iface); @@ -595,13 +595,13 @@ static HRESULT WINAPI OLEFontImpl_put_Name( if (this->description.lpstrName==0) { this->description.lpstrName = HeapAlloc(GetProcessHeap(), - 0, + 0, (lstrlenW(name)+1) * sizeof(WCHAR)); } else { this->description.lpstrName = HeapReAlloc(GetProcessHeap(), - 0, + 0, this->description.lpstrName, (lstrlenW(name)+1) * sizeof(WCHAR)); } @@ -621,7 +621,7 @@ static HRESULT WINAPI OLEFontImpl_put_Name( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_get_Size( - IFont* iface, + IFont* iface, CY* psize) { _ICOM_THIS(OLEFontImpl, iface); @@ -645,7 +645,7 @@ static HRESULT WINAPI OLEFontImpl_get_Size( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_put_Size( - IFont* iface, + IFont* iface, CY size) { _ICOM_THIS(OLEFontImpl, iface); @@ -663,7 +663,7 @@ static HRESULT WINAPI OLEFontImpl_put_Size( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_get_Bold( - IFont* iface, + IFont* iface, BOOL* pbold) { _ICOM_THIS(OLEFontImpl, iface); @@ -702,7 +702,7 @@ static HRESULT WINAPI OLEFontImpl_put_Bold( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_get_Italic( - IFont* iface, + IFont* iface, BOOL* pitalic) { _ICOM_THIS(OLEFontImpl, iface); @@ -724,7 +724,7 @@ static HRESULT WINAPI OLEFontImpl_get_Italic( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_put_Italic( - IFont* iface, + IFont* iface, BOOL italic) { _ICOM_THIS(OLEFontImpl, iface); @@ -742,7 +742,7 @@ static HRESULT WINAPI OLEFontImpl_put_Italic( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_get_Underline( - IFont* iface, + IFont* iface, BOOL* punderline) { _ICOM_THIS(OLEFontImpl, iface); @@ -783,7 +783,7 @@ static HRESULT WINAPI OLEFontImpl_put_Underline( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_get_Strikethrough( - IFont* iface, + IFont* iface, BOOL* pstrikethrough) { _ICOM_THIS(OLEFontImpl, iface); @@ -806,7 +806,7 @@ static HRESULT WINAPI OLEFontImpl_get_Strikethrough( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_put_Strikethrough( - IFont* iface, + IFont* iface, BOOL strikethrough) { _ICOM_THIS(OLEFontImpl, iface); @@ -824,7 +824,7 @@ static HRESULT WINAPI OLEFontImpl_put_Strikethrough( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_get_Weight( - IFont* iface, + IFont* iface, short* pweight) { _ICOM_THIS(OLEFontImpl, iface); @@ -847,7 +847,7 @@ static HRESULT WINAPI OLEFontImpl_get_Weight( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_put_Weight( - IFont* iface, + IFont* iface, short weight) { _ICOM_THIS(OLEFontImpl, iface); @@ -865,7 +865,7 @@ static HRESULT WINAPI OLEFontImpl_put_Weight( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_get_Charset( - IFont* iface, + IFont* iface, short* pcharset) { _ICOM_THIS(OLEFontImpl, iface); @@ -888,7 +888,7 @@ static HRESULT WINAPI OLEFontImpl_get_Charset( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_put_Charset( - IFont* iface, + IFont* iface, short charset) { _ICOM_THIS(OLEFontImpl, iface); @@ -922,7 +922,7 @@ static HRESULT WINAPI OLEFontImpl_get_hFont( LOGFONTW logFont; INT fontHeight; CY cySize; - + /* * The height of the font returned by the get_Size property is the * height of the font in points multiplied by 10000... Using some @@ -1033,7 +1033,7 @@ static HRESULT WINAPI OLEFontImpl_Clone( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_IsEqual( - IFont* iface, + IFont* iface, IFont* pFontOther) { FIXME("():Stub\n"); @@ -1065,7 +1065,7 @@ static HRESULT WINAPI OLEFontImpl_SetRatio( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_QueryTextMetrics( - IFont* iface, + IFont* iface, TEXTMETRICOLE* ptm) { FIXME("():Stub\n"); @@ -1078,7 +1078,7 @@ static HRESULT WINAPI OLEFontImpl_QueryTextMetrics( * See Windows documentation for more details on IFont methods. */ static HRESULT WINAPI OLEFontImpl_AddRefHfont( - IFont* iface, + IFont* iface, HFONT hfont) { _ICOM_THIS(OLEFontImpl, iface); @@ -1117,7 +1117,7 @@ static HRESULT WINAPI OLEFontImpl_ReleaseHfont( if (this->fontLock==0) { DeleteObject(this->gdiFont); - this->gdiFont = 0; + this->gdiFont = 0; } return S_OK; @@ -1184,7 +1184,7 @@ static ULONG WINAPI OLEFontImpl_IDispatch_AddRef( * See Windows documentation for more details on IDispatch methods. */ static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount( - IDispatch* iface, + IDispatch* iface, unsigned int* pctinfo) { _ICOM_THIS_From_IDispatch(IFont, iface); @@ -1199,9 +1199,9 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount( * See Windows documentation for more details on IDispatch methods. */ static HRESULT WINAPI OLEFontImpl_GetTypeInfo( - IDispatch* iface, + IDispatch* iface, UINT iTInfo, - LCID lcid, + LCID lcid, ITypeInfo** ppTInfo) { _ICOM_THIS_From_IDispatch(IFont, iface); @@ -1217,9 +1217,9 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo( */ static HRESULT WINAPI OLEFontImpl_GetIDsOfNames( IDispatch* iface, - REFIID riid, - LPOLESTR* rgszNames, - UINT cNames, + REFIID riid, + LPOLESTR* rgszNames, + UINT cNames, LCID lcid, DISPID* rgDispId) { @@ -1236,12 +1236,12 @@ static HRESULT WINAPI OLEFontImpl_GetIDsOfNames( */ static HRESULT WINAPI OLEFontImpl_Invoke( IDispatch* iface, - DISPID dispIdMember, - REFIID riid, - LCID lcid, + DISPID dispIdMember, + REFIID riid, + LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, - VARIANT* pVarResult, + VARIANT* pVarResult, EXCEPINFO* pExepInfo, UINT* puArgErr) { @@ -1299,7 +1299,7 @@ static ULONG WINAPI OLEFontImpl_IPersistStream_AddRef( * See Windows documentation for more details on IPersistStream methods. */ static HRESULT WINAPI OLEFontImpl_GetClassID( - IPersistStream* iface, + IPersistStream* iface, CLSID* pClassID) { if (pClassID==0) @@ -1354,7 +1354,7 @@ static HRESULT WINAPI OLEFontImpl_Load( INT len; _ICOM_THIS_From_IPersistStream(OLEFontImpl, iface); - + /* * Read the version byte */ @@ -1383,7 +1383,7 @@ static HRESULT WINAPI OLEFontImpl_Load( this->description.fItalic = (bAttributes & FONTPERSIST_ITALIC) != 0; this->description.fStrikethrough = (bAttributes & FONTPERSIST_STRIKETHROUGH) != 0; this->description.fUnderline = (bAttributes & FONTPERSIST_UNDERLINE) != 0; - + /* * Weight */ @@ -1441,7 +1441,7 @@ static HRESULT WINAPI OLEFontImpl_Save( BYTE bVersion = 0x01; BYTE bAttributes; BYTE bStringSize; - + _ICOM_THIS_From_IPersistStream(OLEFontImpl, iface); /* @@ -1470,7 +1470,7 @@ static HRESULT WINAPI OLEFontImpl_Save( if (this->description.fStrikethrough) bAttributes |= FONTPERSIST_STRIKETHROUGH; - + if (this->description.fUnderline) bAttributes |= FONTPERSIST_UNDERLINE; @@ -1478,7 +1478,7 @@ static HRESULT WINAPI OLEFontImpl_Save( if (cbWritten!=1) return E_FAIL; - + /* * Weight */ @@ -1646,7 +1646,7 @@ typedef struct DWORD ref; } IClassFactoryImpl; -static HRESULT WINAPI +static HRESULT WINAPI SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { ICOM_THIS(IClassFactoryImpl,iface); diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index c7bea43d012..a93142e1f80 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -57,7 +57,7 @@ #ifdef HAVE_LIBJPEG /* This is a hack, so jpeglib.h does not redefine INT32 and the like*/ -#define XMD_H +#define XMD_H #define UINT16 JPEG_UINT16 #ifdef HAVE_JPEGLIB_H # include @@ -87,7 +87,7 @@ typedef struct OLEPictureImpl { /* We own the object and must destroy it ourselves */ BOOL fOwn; - + /* Picture description */ PICTDESC desc; @@ -171,7 +171,7 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn) if (newObject==0) return newObject; - + /* * Initialize the virtual function table. */ @@ -183,7 +183,7 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn) CreateConnectionPoint((IUnknown*)newObject,&IID_IPropertyNotifySink,&newObject->pCP); /* - * Start with one reference count. The caller of this function + * Start with one reference count. The caller of this function * must release the interface pointer when it is done. */ newObject->ref = 1; @@ -222,7 +222,7 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn) } else { newObject->desc.picType = PICTYPE_UNINITIALIZED; } - + TRACE("returning %p\n", newObject); return newObject; } @@ -234,7 +234,7 @@ static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn) * count goes down to 0. It will free all resources used by * this object. */ static void OLEPictureImpl_Destroy(OLEPictureImpl* Obj) -{ +{ TRACE("(%p)\n", Obj); if(Obj->fOwn) { /* We need to destroy the picture */ @@ -279,36 +279,36 @@ static HRESULT WINAPI OLEPictureImpl_QueryInterface( */ if ( (This==0) || (ppvObject==0) ) return E_INVALIDARG; - + /* * Initialize the return parameter. */ *ppvObject = 0; - + /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) + if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) { *ppvObject = (IPicture*)This; } - else if (memcmp(&IID_IPicture, riid, sizeof(IID_IPicture)) == 0) + else if (memcmp(&IID_IPicture, riid, sizeof(IID_IPicture)) == 0) { *ppvObject = (IPicture*)This; } - else if (memcmp(&IID_IDispatch, riid, sizeof(IID_IDispatch)) == 0) + else if (memcmp(&IID_IDispatch, riid, sizeof(IID_IDispatch)) == 0) { *ppvObject = (IDispatch*)&(This->lpvtbl2); } - else if (memcmp(&IID_IPictureDisp, riid, sizeof(IID_IPictureDisp)) == 0) + else if (memcmp(&IID_IPictureDisp, riid, sizeof(IID_IPictureDisp)) == 0) { *ppvObject = (IDispatch*)&(This->lpvtbl2); } - else if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0) + else if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0) { *ppvObject = (IPersistStream*)&(This->lpvtbl3); } - else if (memcmp(&IID_IConnectionPointContainer, riid, sizeof(IID_IConnectionPointContainer)) == 0) + else if (memcmp(&IID_IConnectionPointContainer, riid, sizeof(IID_IConnectionPointContainer)) == 0) { *ppvObject = (IConnectionPointContainer*)&(This->lpvtbl4); } @@ -320,14 +320,14 @@ static HRESULT WINAPI OLEPictureImpl_QueryInterface( FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid)); return E_NOINTERFACE; } - + /* * Query Interface always increases the reference count by one when it is * successful */ OLEPictureImpl_AddRef((IPicture*)This); - return S_OK;; + return S_OK; } /*********************************************************************** * OLEPicture_SendNotify (internal) @@ -359,7 +359,7 @@ static void OLEPicture_SendNotify(OLEPictureImpl* this, DISPID dispID) * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI OLEPictureImpl_AddRef( +static ULONG WINAPI OLEPictureImpl_AddRef( IPicture* iface) { ICOM_THIS(OLEPictureImpl, iface); @@ -368,13 +368,13 @@ static ULONG WINAPI OLEPictureImpl_AddRef( return This->ref; } - + /************************************************************************ * OLEPictureImpl_Release (IUnknown) * * See Windows documentation for more details on IUnknown methods. */ -static ULONG WINAPI OLEPictureImpl_Release( +static ULONG WINAPI OLEPictureImpl_Release( IPicture* iface) { ICOM_THIS(OLEPictureImpl, iface); @@ -394,14 +394,14 @@ static ULONG WINAPI OLEPictureImpl_Release( return 0; } - + return This->ref; } /************************************************************************ * OLEPictureImpl_get_Handle - */ + */ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface, OLE_HANDLE *phandle) { @@ -430,7 +430,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface, /************************************************************************ * OLEPictureImpl_get_hPal - */ + */ static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface, OLE_HANDLE *phandle) { @@ -441,7 +441,7 @@ static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface, /************************************************************************ * OLEPictureImpl_get_Type - */ + */ static HRESULT WINAPI OLEPictureImpl_get_Type(IPicture *iface, short *ptype) { @@ -453,7 +453,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Type(IPicture *iface, /************************************************************************ * OLEPictureImpl_get_Width - */ + */ static HRESULT WINAPI OLEPictureImpl_get_Width(IPicture *iface, OLE_XSIZE_HIMETRIC *pwidth) { @@ -465,7 +465,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Width(IPicture *iface, /************************************************************************ * OLEPictureImpl_get_Height - */ + */ static HRESULT WINAPI OLEPictureImpl_get_Height(IPicture *iface, OLE_YSIZE_HIMETRIC *pheight) { @@ -477,7 +477,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Height(IPicture *iface, /************************************************************************ * OLEPictureImpl_Render - */ + */ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, long x, long y, long cx, long cy, OLE_XPOS_HIMETRIC xSrc, @@ -539,7 +539,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, /************************************************************************ * OLEPictureImpl_set_hPal - */ + */ static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface, OLE_HANDLE hpal) { @@ -551,7 +551,7 @@ static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface, /************************************************************************ * OLEPictureImpl_get_CurDC - */ + */ static HRESULT WINAPI OLEPictureImpl_get_CurDC(IPicture *iface, HDC *phdc) { @@ -563,7 +563,7 @@ static HRESULT WINAPI OLEPictureImpl_get_CurDC(IPicture *iface, /************************************************************************ * OLEPictureImpl_SelectPicture - */ + */ static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface, HDC hdcIn, HDC *phdcOut, @@ -588,7 +588,7 @@ static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface, /************************************************************************ * OLEPictureImpl_get_KeepOriginalFormat - */ + */ static HRESULT WINAPI OLEPictureImpl_get_KeepOriginalFormat(IPicture *iface, BOOL *pfKeep) { @@ -602,7 +602,7 @@ static HRESULT WINAPI OLEPictureImpl_get_KeepOriginalFormat(IPicture *iface, /************************************************************************ * OLEPictureImpl_put_KeepOriginalFormat - */ + */ static HRESULT WINAPI OLEPictureImpl_put_KeepOriginalFormat(IPicture *iface, BOOL keep) { @@ -615,7 +615,7 @@ static HRESULT WINAPI OLEPictureImpl_put_KeepOriginalFormat(IPicture *iface, /************************************************************************ * OLEPictureImpl_PictureChanged - */ + */ static HRESULT WINAPI OLEPictureImpl_PictureChanged(IPicture *iface) { ICOM_THIS(OLEPictureImpl, iface); @@ -626,7 +626,7 @@ static HRESULT WINAPI OLEPictureImpl_PictureChanged(IPicture *iface) /************************************************************************ * OLEPictureImpl_SaveAsFile - */ + */ static HRESULT WINAPI OLEPictureImpl_SaveAsFile(IPicture *iface, IStream *pstream, BOOL SaveMemCopy, @@ -639,7 +639,7 @@ static HRESULT WINAPI OLEPictureImpl_SaveAsFile(IPicture *iface, /************************************************************************ * OLEPictureImpl_get_Attributes - */ + */ static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface, DWORD *pdwAttr) { @@ -703,7 +703,7 @@ static HRESULT WINAPI OLEPictureImpl_FindConnectionPoint( ) { ICOM_THIS_From_IConnectionPointContainer(OLEPictureImpl, iface); TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppCP); - if (!ppCP) + if (!ppCP) return E_POINTER; *ppCP = NULL; if (IsEqualGUID(riid,&IID_IPropertyNotifySink)) @@ -825,7 +825,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) { xread = 0; xbuf = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,header[1]); while (xread < header[1]) { - ULONG nread; + ULONG nread; hr = IStream_Read(pStm,xbuf+xread,header[1]-xread,&nread); xread+=nread; if (hr || !nread) @@ -1071,7 +1071,7 @@ static ULONG WINAPI OLEPictureImpl_IDispatch_Release( * See Windows documentation for more details on IDispatch methods. */ static HRESULT WINAPI OLEPictureImpl_GetTypeInfoCount( - IDispatch* iface, + IDispatch* iface, unsigned int* pctinfo) { FIXME("():Stub\n"); @@ -1085,9 +1085,9 @@ static HRESULT WINAPI OLEPictureImpl_GetTypeInfoCount( * See Windows documentation for more details on IDispatch methods. */ static HRESULT WINAPI OLEPictureImpl_GetTypeInfo( - IDispatch* iface, + IDispatch* iface, UINT iTInfo, - LCID lcid, + LCID lcid, ITypeInfo** ppTInfo) { FIXME("():Stub\n"); @@ -1102,9 +1102,9 @@ static HRESULT WINAPI OLEPictureImpl_GetTypeInfo( */ static HRESULT WINAPI OLEPictureImpl_GetIDsOfNames( IDispatch* iface, - REFIID riid, - LPOLESTR* rgszNames, - UINT cNames, + REFIID riid, + LPOLESTR* rgszNames, + UINT cNames, LCID lcid, DISPID* rgDispId) { @@ -1120,12 +1120,12 @@ static HRESULT WINAPI OLEPictureImpl_GetIDsOfNames( */ static HRESULT WINAPI OLEPictureImpl_Invoke( IDispatch* iface, - DISPID dispIdMember, - REFIID riid, - LCID lcid, + DISPID dispIdMember, + REFIID riid, + LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, - VARIANT* pVarResult, + VARIANT* pVarResult, EXCEPINFO* pExepInfo, UINT* puArgErr) { @@ -1279,4 +1279,4 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode, lpstream, lSize, fRunmode, reed, xsiz, ysiz, flags, ppvObj); return S_OK; } - + diff --git a/dlls/oleaut32/parsedt.c b/dlls/oleaut32/parsedt.c index 96762da45eb..b1072e3e52d 100644 --- a/dlls/oleaut32/parsedt.c +++ b/dlls/oleaut32/parsedt.c @@ -65,10 +65,10 @@ static const char * const months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", static const char * const days[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", NULL}; -/* those three vars are useless, and not even initialized, so +/* those three vars are useless, and not even initialized, so * I'd rather remove them all (EPP) */ -int DateStyle; +int DateStyle; bool EuroDates; int CTimeZone; diff --git a/dlls/oleaut32/safearray.c b/dlls/oleaut32/safearray.c index 257c13608a9..72d58c997fe 100644 --- a/dlls/oleaut32/safearray.c +++ b/dlls/oleaut32/safearray.c @@ -35,31 +35,31 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); #define SYSDUPSTRING(str) SysAllocStringLen((str), SysStringLen(str)) /* Locally used methods */ -static INT +static INT endOfDim(LONG *coor, SAFEARRAYBOUND *mat, LONG dim, LONG realDim); -static ULONG +static ULONG calcDisplacement(LONG *coor, SAFEARRAYBOUND *mat, LONG dim); -static BOOL +static BOOL isPointer(USHORT feature); -static INT +static INT getFeatures(VARTYPE vt); -static BOOL +static BOOL validCoordinate(LONG *coor, SAFEARRAY *psa); -static BOOL +static BOOL resizeSafeArray(SAFEARRAY *psa, LONG lDelta); -static BOOL +static BOOL validArg(SAFEARRAY *psa); -static ULONG +static ULONG getArraySize(SAFEARRAY *psa); -static HRESULT +static HRESULT duplicateData(SAFEARRAY *psa, SAFEARRAY **ppsaOut); /* Association between VARTYPE and their size. @@ -122,9 +122,9 @@ static const int LAST_VARTYPE = sizeof(VARTYPE_SIZE)/sizeof(VARTYPE_SIZE[0]); * SafeArrayAllocDescriptor (OLEAUT32.36) * Allocate the appropriate amount of memory for the SafeArray descriptor */ -HRESULT WINAPI SafeArrayAllocDescriptor( - UINT cDims, - SAFEARRAY **ppsaOut) +HRESULT WINAPI SafeArrayAllocDescriptor( + UINT cDims, + SAFEARRAY **ppsaOut) { SAFEARRAYBOUND *sab; LONG allocSize = 0; @@ -134,7 +134,7 @@ HRESULT WINAPI SafeArrayAllocDescriptor( allocSize = sizeof(**ppsaOut) + (sizeof(*sab) * (cDims-1)); /* Allocate memory for SAFEARRAY struc */ - if(( (*ppsaOut)=HeapAlloc( + if(( (*ppsaOut)=HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, allocSize)) == NULL){ return(E_UNEXPECTED); } @@ -151,10 +151,10 @@ HRESULT WINAPI SafeArrayAllocDescriptor( * * The MSDN documentation on this doesn't tell us much. */ -HRESULT WINAPI SafeArrayAllocDescriptorEx( +HRESULT WINAPI SafeArrayAllocDescriptorEx( VARTYPE vt, - UINT cDims, - SAFEARRAY **ppsaOut) + UINT cDims, + SAFEARRAY **ppsaOut) { if ( (vt >= LAST_VARTYPE) || ( VARTYPE_SIZE[vt] == VARTYPE_NOT_SUPPORTED ) ) @@ -168,21 +168,21 @@ HRESULT WINAPI SafeArrayAllocDescriptorEx( * Allocate the appropriate amount of data for the SafeArray data */ HRESULT WINAPI SafeArrayAllocData( - SAFEARRAY *psa) + SAFEARRAY *psa) { ULONG ulWholeArraySize; /* to store the size of the whole thing */ - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; ulWholeArraySize = getArraySize(psa); /* Allocate memory for the data itself */ - if((psa->pvData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + if((psa->pvData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, psa->cbElements*ulWholeArraySize)) == NULL) return(E_UNEXPECTED); - TRACE("SafeArray: %lu bytes allocated for data at %p (%lu objects).\n", + TRACE("SafeArray: %lu bytes allocated for data at %p (%lu objects).\n", psa->cbElements*ulWholeArraySize, psa->pvData, ulWholeArraySize); return(S_OK); @@ -190,11 +190,11 @@ HRESULT WINAPI SafeArrayAllocData( /************************************************************************* * SafeArrayCreate (OLEAUT32.15) - * Create a SafeArray object by encapsulating AllocDescriptor and AllocData + * Create a SafeArray object by encapsulating AllocDescriptor and AllocData */ SAFEARRAY* WINAPI SafeArrayCreate( - VARTYPE vt, - UINT cDims, + VARTYPE vt, + UINT cDims, SAFEARRAYBOUND *rgsabound) { SAFEARRAY *psa; @@ -210,7 +210,7 @@ SAFEARRAY* WINAPI SafeArrayCreate( if( FAILED( hRes = SafeArrayAllocDescriptor(cDims, &psa))) return NULL; - /* setup data members... */ + /* setup data members... */ psa->cDims = cDims; psa->fFeatures = getFeatures(vt); psa->cLocks = 0; @@ -223,14 +223,14 @@ SAFEARRAY* WINAPI SafeArrayCreate( psa->rgsabound[cDim].lLbound = rgsabound[psa->cDims-cDim-1].lLbound; } - /* allocate memory for the data... */ + /* allocate memory for the data... */ if( FAILED( hRes = SafeArrayAllocData(psa))) { - SafeArrayDestroyDescriptor(psa); + SafeArrayDestroyDescriptor(psa); ERR("() : Failed to allocate the Safe Array data\n"); return NULL; } - return(psa); + return(psa); } /************************************************************************* @@ -241,13 +241,13 @@ HRESULT WINAPI SafeArrayDestroyDescriptor( SAFEARRAY *psa) { /* Check for lockness before to free... */ - if(psa->cLocks > 0) + if(psa->cLocks > 0) return DISP_E_ARRAYISLOCKED; /* The array is unlocked, then, deallocate memory */ - if(HeapFree( GetProcessHeap(), 0, psa) == FALSE) + if(HeapFree( GetProcessHeap(), 0, psa) == FALSE) return E_UNEXPECTED; - + return(S_OK); } @@ -257,13 +257,13 @@ HRESULT WINAPI SafeArrayDestroyDescriptor( * Increment the lock counter * * Doc says (MSDN Library ) that psa->pvData should be made available (!= NULL) - * only when psa->cLocks is > 0... I don't get it since pvData is allocated - * before the array is locked, therefore + * only when psa->cLocks is > 0... I don't get it since pvData is allocated + * before the array is locked, therefore */ HRESULT WINAPI SafeArrayLock( SAFEARRAY *psa) { - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; psa->cLocks++; @@ -278,10 +278,10 @@ HRESULT WINAPI SafeArrayLock( HRESULT WINAPI SafeArrayUnlock( SAFEARRAY *psa) { - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; - if (psa->cLocks > 0) + if (psa->cLocks > 0) psa->cLocks--; return(S_OK); @@ -293,16 +293,16 @@ HRESULT WINAPI SafeArrayUnlock( * Set the data at the given coordinate */ HRESULT WINAPI SafeArrayPutElement( - SAFEARRAY *psa, - LONG *rgIndices, + SAFEARRAY *psa, + LONG *rgIndices, void *pv) { - ULONG stepCountInSAData = 0; /* Number of array item to skip to get to + ULONG stepCountInSAData = 0; /* Number of array item to skip to get to the desired one... */ PVOID elementStorageAddress = NULL; /* Adress to store the data */ /* Validate the index given */ - if(! validCoordinate(rgIndices, psa)) + if(! validCoordinate(rgIndices, psa)) return DISP_E_BADINDEX; if(! validArg(psa)) return E_INVALIDARG; @@ -311,24 +311,24 @@ HRESULT WINAPI SafeArrayPutElement( /* Figure out the number of items to skip */ stepCountInSAData = calcDisplacement(rgIndices, psa->rgsabound, psa->cDims); - + /* Figure out the number of byte to skip ... */ elementStorageAddress = (char *) psa->pvData+(stepCountInSAData*psa->cbElements); - + if(isPointer(psa->fFeatures)) { /* increment ref count for this pointer */ - *((PVOID*)elementStorageAddress) = *(PVOID*)pv; + *((PVOID*)elementStorageAddress) = *(PVOID*)pv; IUnknown_AddRef( *(IUnknown**)pv); - } else { + } else { if(psa->fFeatures == FADF_BSTR) { /* Create a new object */ BSTR pbstrReAllocStr = NULL; if(pv && ((pbstrReAllocStr = SYSDUPSTRING( (OLECHAR*)pv )) == NULL)) { - SafeArrayUnlock(psa); + SafeArrayUnlock(psa); return E_OUTOFMEMORY; - } else + } else *((BSTR*)elementStorageAddress) = pbstrReAllocStr; } else if(psa->fFeatures == FADF_VARIANT) { @@ -348,7 +348,7 @@ HRESULT WINAPI SafeArrayPutElement( } TRACE("SafeArray: item put at adress %p.\n",elementStorageAddress); - return SafeArrayUnlock(psa); + return SafeArrayUnlock(psa); } @@ -357,17 +357,17 @@ HRESULT WINAPI SafeArrayPutElement( * Return the data element corresponding the the given coordinate */ HRESULT WINAPI SafeArrayGetElement( - SAFEARRAY *psa, - LONG *rgIndices, + SAFEARRAY *psa, + LONG *rgIndices, void *pv) { - ULONG stepCountInSAData = 0; /* Number of array item to skip to get to + ULONG stepCountInSAData = 0; /* Number of array item to skip to get to the desired one... */ PVOID elementStorageAddress = NULL; /* Adress to store the data */ - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; - + if(! validCoordinate(rgIndices, psa)) /* Validate the index given */ return(DISP_E_BADINDEX); @@ -375,10 +375,10 @@ HRESULT WINAPI SafeArrayGetElement( /* Figure out the number of items to skip */ stepCountInSAData = calcDisplacement(rgIndices, psa->rgsabound, psa->cDims); - + /* Figure out the number of byte to skip ... */ elementStorageAddress = (char *) psa->pvData+(stepCountInSAData*psa->cbElements); - + if( psa->fFeatures == FADF_BSTR) { /* reallocate the obj */ BSTR pbstrStoredStr = *(OLECHAR**)elementStorageAddress; BSTR pbstrReturnedStr = NULL; @@ -386,8 +386,8 @@ HRESULT WINAPI SafeArrayGetElement( ((pbstrReturnedStr = SYSDUPSTRING( pbstrStoredStr )) == NULL) ) { SafeArrayUnlock(psa); return E_OUTOFMEMORY; - } else - *((BSTR*)pv) = pbstrReturnedStr; + } else + *((BSTR*)pv) = pbstrReturnedStr; } else if( psa->fFeatures == FADF_VARIANT) { HRESULT hr; @@ -399,7 +399,7 @@ HRESULT WINAPI SafeArrayGetElement( } } else if( isPointer(psa->fFeatures) ) /* simply copy the pointer */ - *(PVOID*)pv = *((PVOID*)elementStorageAddress); + *(PVOID*)pv = *((PVOID*)elementStorageAddress); else /* copy the bytes */ memcpy(pv, elementStorageAddress, psa->cbElements ); @@ -408,7 +408,7 @@ HRESULT WINAPI SafeArrayGetElement( return E_UNEXPECTED; /* UNDOC error condition */ } - return( SafeArrayUnlock(psa) ); + return( SafeArrayUnlock(psa) ); } /************************************************************************* @@ -416,20 +416,20 @@ HRESULT WINAPI SafeArrayGetElement( * return the UP bound for a given array dimension */ HRESULT WINAPI SafeArrayGetUBound( - SAFEARRAY *psa, + SAFEARRAY *psa, UINT nDim, LONG *plUbound) { - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; - if(nDim > psa->cDims) + if(nDim > psa->cDims) return DISP_E_BADINDEX; if(0 == nDim) return DISP_E_BADINDEX; - *plUbound = psa->rgsabound[nDim-1].lLbound + + *plUbound = psa->rgsabound[nDim-1].lLbound + psa->rgsabound[nDim-1].cElements - 1; return S_OK; @@ -437,22 +437,22 @@ HRESULT WINAPI SafeArrayGetUBound( /************************************************************************* * SafeArrayGetLBound (OLEAUT32.20) - * Return the LO bound for a given array dimension + * Return the LO bound for a given array dimension */ HRESULT WINAPI SafeArrayGetLBound( SAFEARRAY *psa, - UINT nDim, + UINT nDim, LONG *plLbound) { - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; - if(nDim > psa->cDims) + if(nDim > psa->cDims) return DISP_E_BADINDEX; if(0 == nDim) return DISP_E_BADINDEX; - + *plLbound = psa->rgsabound[nDim-1].lLbound; return S_OK; } @@ -463,12 +463,12 @@ HRESULT WINAPI SafeArrayGetLBound( */ UINT WINAPI SafeArrayGetDim( SAFEARRAY * psa) -{ +{ /* * A quick test in Windows shows that the behavior here for an invalid * pointer is to return 0. */ - if(! validArg(psa)) + if(! validArg(psa)) return 0; return psa->cDims; @@ -480,12 +480,12 @@ UINT WINAPI SafeArrayGetDim( */ UINT WINAPI SafeArrayGetElemsize( SAFEARRAY * psa) -{ +{ /* * A quick test in Windows shows that the behavior here for an invalid * pointer is to return 0. */ - if(! validArg(psa)) + if(! validArg(psa)) return 0; return psa->cbElements; @@ -493,28 +493,28 @@ UINT WINAPI SafeArrayGetElemsize( /************************************************************************* * SafeArrayAccessData (OLEAUT32.23) - * increment the access count and return the data + * increment the access count and return the data */ HRESULT WINAPI SafeArrayAccessData( - SAFEARRAY *psa, + SAFEARRAY *psa, void **ppvData) -{ +{ HRESULT hRes; - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; hRes = SafeArrayLock(psa); switch (hRes) { - case S_OK: + case S_OK: (*ppvData) = psa->pvData; break; case E_INVALIDARG: (*ppvData) = NULL; return E_INVALIDARG; } - + return S_OK; } @@ -525,29 +525,29 @@ HRESULT WINAPI SafeArrayAccessData( */ HRESULT WINAPI SafeArrayUnaccessData( SAFEARRAY * psa) -{ - if(! validArg(psa)) +{ + if(! validArg(psa)) return E_INVALIDARG; return(SafeArrayUnlock(psa)); } -/************************************************************************ +/************************************************************************ * SafeArrayPtrOfIndex (OLEAUT32.148) * Return a pointer to the element at rgIndices */ HRESULT WINAPI SafeArrayPtrOfIndex( - SAFEARRAY *psa, - LONG *rgIndices, + SAFEARRAY *psa, + LONG *rgIndices, void **ppvData) -{ - ULONG stepCountInSAData = 0; /* Number of array item to skip to get to +{ + ULONG stepCountInSAData = 0; /* Number of array item to skip to get to the desired one... */ - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; - if(! validCoordinate(rgIndices, psa)) + if(! validCoordinate(rgIndices, psa)) return DISP_E_BADINDEX; /* Although it is dangerous to do this without having a lock, it is not @@ -556,27 +556,27 @@ HRESULT WINAPI SafeArrayPtrOfIndex( /* Figure out the number of items to skip */ stepCountInSAData = calcDisplacement(rgIndices, psa->rgsabound, psa->cDims); - + *ppvData = (char *) psa->pvData+(stepCountInSAData*psa->cbElements); return S_OK; } -/************************************************************************ +/************************************************************************ * SafeArrayDestroyData (OLEAUT32.39) * Frees the memory data bloc */ HRESULT WINAPI SafeArrayDestroyData( SAFEARRAY *psa) -{ +{ HRESULT hRes; ULONG ulWholeArraySize; /* count spot in array */ ULONG ulDataIter; /* to iterate the data space */ - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; - if(psa->cLocks > 0) + if(psa->cLocks > 0) return DISP_E_ARRAYISLOCKED; ulWholeArraySize = getArraySize(psa); @@ -585,9 +585,9 @@ HRESULT WINAPI SafeArrayDestroyData( IUnknown *punk; for(ulDataIter=0; ulDataIter < ulWholeArraySize; ulDataIter++) { - punk = *(IUnknown**)((char *) psa->pvData+(ulDataIter*(psa->cbElements))); + punk = *(IUnknown**)((char *) psa->pvData+(ulDataIter*(psa->cbElements))); - if( punk != NULL) + if( punk != NULL) IUnknown_Release(punk); } @@ -598,7 +598,7 @@ HRESULT WINAPI SafeArrayDestroyData( for(ulDataIter=0; ulDataIter < ulWholeArraySize; ulDataIter++) { bstr = *(BSTR*)((char *) psa->pvData+(ulDataIter*(psa->cbElements))); - if( bstr != NULL) + if( bstr != NULL) SysFreeString( bstr ); } } @@ -608,8 +608,8 @@ HRESULT WINAPI SafeArrayDestroyData( VariantClear((VARIANT*)((char *) psa->pvData+(ulDataIter*(psa->cbElements)))); } } - - /* check if this array is a Vector, in which case do not free the data + + /* check if this array is a Vector, in which case do not free the data block since it has been allocated by AllocDescriptor and therefore deserve to be freed by DestroyDescriptor */ if(!(psa->fFeatures & FADF_CREATEVECTOR)) { /* Set when we do CreateVector */ @@ -620,11 +620,11 @@ HRESULT WINAPI SafeArrayDestroyData( psa->pvData = NULL; } - + return S_OK; } -/************************************************************************ +/************************************************************************ * SafeArrayCopyData (OLEAUT32.412) * Copy the psaSource's data block into psaTarget if dimension and size * permits it. @@ -632,45 +632,45 @@ HRESULT WINAPI SafeArrayDestroyData( HRESULT WINAPI SafeArrayCopyData( SAFEARRAY *psaSource, SAFEARRAY **psaTarget) -{ +{ USHORT cDimCount; /* looper */ LONG lDelta; /* looper */ - IUnknown *punk; + IUnknown *punk; ULONG ulWholeArraySize; /* Number of item in SA */ BSTR bstr; - if(! (validArg(psaSource) && validArg(*psaTarget)) ) + if(! (validArg(psaSource) && validArg(*psaTarget)) ) return E_INVALIDARG; if(SafeArrayGetDim(psaSource) != SafeArrayGetDim(*psaTarget)) return E_INVALIDARG; - ulWholeArraySize = getArraySize(psaSource); + ulWholeArraySize = getArraySize(psaSource); /* The two arrays boundaries must be of same lenght */ for(cDimCount=0;cDimCount < psaSource->cDims; cDimCount++) - if( psaSource->rgsabound[cDimCount].cElements != + if( psaSource->rgsabound[cDimCount].cElements != (*psaTarget)->rgsabound[cDimCount].cElements) return E_INVALIDARG; - if( isPointer((*psaTarget)->fFeatures) ) { /* the target contains ptr + if( isPointer((*psaTarget)->fFeatures) ) { /* the target contains ptr that must be released */ for(lDelta=0;lDelta < ulWholeArraySize; lDelta++) { punk = *(IUnknown**) ((char *) (*psaTarget)->pvData + (lDelta * (*psaTarget)->cbElements)); - if( punk != NULL) + if( punk != NULL) IUnknown_Release(punk); } } else if( (*psaTarget)->fFeatures & FADF_BSTR) { /* the target contain BSTR - that must be freed */ + that must be freed */ for(lDelta=0;lDelta < ulWholeArraySize; lDelta++) { - bstr = + bstr = *(BSTR*)((char *) (*psaTarget)->pvData + (lDelta * (*psaTarget)->cbElements)); - if( bstr != NULL) + if( bstr != NULL) SysFreeString( bstr ); } } @@ -684,19 +684,19 @@ HRESULT WINAPI SafeArrayCopyData( return duplicateData(psaSource, psaTarget); } -/************************************************************************ +/************************************************************************ * SafeArrayDestroy (OLEAUT32.16) * Deallocates all memory reserved for the SafeArray */ HRESULT WINAPI SafeArrayDestroy( SAFEARRAY * psa) -{ +{ HRESULT hRes; - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; - if(psa->cLocks > 0) + if(psa->cLocks > 0) return DISP_E_ARRAYISLOCKED; if((hRes = SafeArrayDestroyData( psa )) == S_OK) @@ -706,38 +706,38 @@ HRESULT WINAPI SafeArrayDestroy( return E_UNEXPECTED; /* UNDOC error condition */ } -/************************************************************************ +/************************************************************************ * SafeArrayCopy (OLEAUT32.27) * Make a dupplicate of a SafeArray */ HRESULT WINAPI SafeArrayCopy( - SAFEARRAY *psa, + SAFEARRAY *psa, SAFEARRAY **ppsaOut) -{ +{ HRESULT hRes; DWORD dAllocSize; ULONG ulWholeArraySize; /* size of the thing */ - if(! validArg(psa)) + if(! validArg(psa)) return E_INVALIDARG; if((hRes=SafeArrayAllocDescriptor(psa->cDims, ppsaOut)) == S_OK){ /* Duplicate the SAFEARRAY struc */ - memcpy(*ppsaOut, psa, + memcpy(*ppsaOut, psa, sizeof(*psa)+(sizeof(*(psa->rgsabound))*(psa->cDims-1))); (*ppsaOut)->pvData = NULL; /* do not point to the same data area */ /* make sure the new safe array doesn't have the FADF_CREATEVECTOR flag, because the data has not been allocated with the descriptor. */ - (*ppsaOut)->fFeatures &= ~FADF_CREATEVECTOR; - - /* Get the allocated memory size for source and allocate it for target */ + (*ppsaOut)->fFeatures &= ~FADF_CREATEVECTOR; + + /* Get the allocated memory size for source and allocate it for target */ ulWholeArraySize = getArraySize(psa); /* Number of item in SA */ dAllocSize = ulWholeArraySize*psa->cbElements; - (*ppsaOut)->pvData = + (*ppsaOut)->pvData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dAllocSize); if( (*ppsaOut)->pvData != NULL) { /* HeapAlloc succeed */ @@ -747,7 +747,7 @@ HRESULT WINAPI SafeArrayCopy( SafeArrayDestroyDescriptor(*ppsaOut); return hRes; } - + } else { /* failed to allocate or dupplicate... */ SafeArrayDestroyDescriptor(*ppsaOut); return E_UNEXPECTED; /* UNDOC error condition */ @@ -759,16 +759,16 @@ HRESULT WINAPI SafeArrayCopy( return S_OK; } -/************************************************************************ +/************************************************************************ * SafeArrayCreateVector (OLEAUT32.411) - * Creates a one dimension safearray where the data is next to the + * Creates a one dimension safearray where the data is next to the * SAFEARRAY structure. */ SAFEARRAY* WINAPI SafeArrayCreateVector( - VARTYPE vt, - LONG lLbound, - ULONG cElements) -{ + VARTYPE vt, + LONG lLbound, + ULONG cElements) +{ SAFEARRAY *psa; /* Validate supported VARTYPE */ @@ -777,13 +777,13 @@ SAFEARRAY* WINAPI SafeArrayCreateVector( return NULL; /* Allocate memory for the array descriptor and data contiguously */ - if( FAILED( psa = HeapAlloc( GetProcessHeap(), - HEAP_ZERO_MEMORY, + if( FAILED( psa = HeapAlloc( GetProcessHeap(), + HEAP_ZERO_MEMORY, (sizeof(*psa) + (VARTYPE_SIZE[vt] * cElements))))) { return NULL; } - - /* setup data members... */ + + /* setup data members... */ psa->cDims = 1; /* always and forever */ psa->fFeatures = getFeatures(vt) | FADF_CREATEVECTOR; /* undocumented flag used by Microsoft */ psa->cLocks = 0; @@ -793,30 +793,30 @@ SAFEARRAY* WINAPI SafeArrayCreateVector( psa->rgsabound[0].cElements = cElements; psa->rgsabound[0].lLbound = lLbound; - return(psa); -} + return(psa); +} -/************************************************************************ +/************************************************************************ * SafeArrayRedim (OLEAUT32.40) * Changes the caracteristics of the last dimension of the SafeArray */ HRESULT WINAPI SafeArrayRedim( - SAFEARRAY *psa, + SAFEARRAY *psa, SAFEARRAYBOUND *psaboundNew) -{ +{ LONG lDelta; /* hold difference in size */ USHORT cDims=1; /* dims counter */ - if( !validArg(psa) ) + if( !validArg(psa) ) return E_INVALIDARG; - if( psa->cLocks > 0 ) + if( psa->cLocks > 0 ) return DISP_E_ARRAYISLOCKED; - if( psa->fFeatures & FADF_FIXEDSIZE ) + if( psa->fFeatures & FADF_FIXEDSIZE ) return E_INVALIDARG; - if( SafeArrayLock(psa)==E_UNEXPECTED ) + if( SafeArrayLock(psa)==E_UNEXPECTED ) return E_UNEXPECTED;/* UNDOC error condition */ /* find the delta in number of array spot to apply to the new array */ @@ -830,10 +830,10 @@ HRESULT WINAPI SafeArrayRedim( if (lDelta == 0) { ;/* same size, maybe a change of lLbound, just set it */ } else /* need to enlarge (lDelta +) reduce (lDelta -) */ - if(! resizeSafeArray(psa, lDelta)) + if(! resizeSafeArray(psa, lDelta)) return E_UNEXPECTED; /* UNDOC error condition */ - /* the only modifyable dimension sits in [0] as the dimensions were reversed + /* the only modifyable dimension sits in [0] as the dimensions were reversed at array creation time... */ psa->rgsabound[0].cElements = psaboundNew->cElements; psa->rgsabound[0].lLbound = psaboundNew->lLbound; @@ -845,11 +845,11 @@ HRESULT WINAPI SafeArrayRedim( * NOT WINDOWS API - SafeArray* Utility functions ************************************************************************/ -/************************************************************************ +/************************************************************************ * Used to validate the SAFEARRAY type of arg */ static BOOL validArg( - SAFEARRAY *psa) + SAFEARRAY *psa) { SAFEARRAYBOUND *sab; LONG psaSize = 0; @@ -879,15 +879,15 @@ static BOOL validArg( return((psaSize >= descSize) || (psaSize >= fullSize)); } -/************************************************************************ +/************************************************************************ * Used to reallocate memory */ static BOOL resizeSafeArray( - SAFEARRAY *psa, + SAFEARRAY *psa, LONG lDelta) { ULONG ulWholeArraySize; /* use as multiplicator */ - PVOID pvNewBlock = NULL; + PVOID pvNewBlock = NULL; IUnknown *punk; BSTR bstr; @@ -898,7 +898,7 @@ static BOOL resizeSafeArray( for(;lDelta < 0; lDelta++) { punk = *(IUnknown**) ((char *) psa->pvData+((ulWholeArraySize+lDelta)*psa->cbElements)); - + if( punk != NULL ) IUnknown_Release(punk); } @@ -919,13 +919,13 @@ static BOOL resizeSafeArray( if (!(psa->fFeatures & FADF_CREATEVECTOR)) { - /* Ok now, if we are enlarging the array, we *MUST* move the whole block + /* Ok now, if we are enlarging the array, we *MUST* move the whole block pointed to by pvData. If we are shorthening the array, this move is - optional but we do it anyway becuase the benefit is that we are + optional but we do it anyway becuase the benefit is that we are releasing to the system the unused memory */ - if((pvNewBlock = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, psa->pvData, - (ulWholeArraySize + lDelta) * psa->cbElements)) == NULL) + if((pvNewBlock = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, psa->pvData, + (ulWholeArraySize + lDelta) * psa->cbElements)) == NULL) return FALSE; /* TODO If we get here it means: SHRINK situation : we've deleted the undesired data and did not release the memory @@ -934,11 +934,11 @@ static BOOL resizeSafeArray( } else { - /* Allocate a new block, because the previous data has been allocated with + /* Allocate a new block, because the previous data has been allocated with the descriptor in SafeArrayCreateVector function. */ if((pvNewBlock = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - ulWholeArraySize * psa->cbElements)) == NULL) + ulWholeArraySize * psa->cbElements)) == NULL) return FALSE; psa->fFeatures &= ~FADF_CREATEVECTOR; @@ -948,11 +948,11 @@ static BOOL resizeSafeArray( return TRUE; } -/************************************************************************ - * Used to set the fFeatures data member of the SAFEARRAY structure. +/************************************************************************ + * Used to set the fFeatures data member of the SAFEARRAY structure. */ static INT getFeatures( - VARTYPE vt) + VARTYPE vt) { switch(vt) { case VT_BSTR: return FADF_BSTR; @@ -963,12 +963,12 @@ static INT getFeatures( return 0; } -/************************************************************************ - * Used to figure out if the fFeatures data member of the SAFEARRAY - * structure contain any information about the type of data stored... +/************************************************************************ + * Used to figure out if the fFeatures data member of the SAFEARRAY + * structure contain any information about the type of data stored... */ static BOOL isPointer( - USHORT feature) + USHORT feature) { switch(feature) { case FADF_UNKNOWN: return TRUE; /* those are pointers */ @@ -977,8 +977,8 @@ static BOOL isPointer( return FALSE; } -/************************************************************************ - * Used to calculate the displacement when accessing or modifying +/************************************************************************ + * Used to calculate the displacement when accessing or modifying * safearray data set. * * Parameters: - LONG *coor is the desired location in the multidimension @@ -988,46 +988,46 @@ static BOOL isPointer( * - USHORT dim is the number of dimension of the SafeArray */ static ULONG calcDisplacement( - LONG *coor, - SAFEARRAYBOUND *mat, - LONG dim) + LONG *coor, + SAFEARRAYBOUND *mat, + LONG dim) { ULONG res = 0; LONG iterDim; - for(iterDim=0; iterDim lUBound) - return FALSE; + + if(lLBound > lUBound) + return FALSE; if((coor[iter] < lLBound) || (coor[iter] > lUBound)) return FALSE; } return TRUE; -} +} -/************************************************************************ +/************************************************************************ * Method used to calculate the number of cells of the SA */ static ULONG getArraySize( - SAFEARRAY *psa) + SAFEARRAY *psa) { - USHORT cCount; + USHORT cCount; ULONG ulWholeArraySize = 1; for(cCount=0; cCount < psa->cDims; cCount++) /* foreach dimensions... */ ulWholeArraySize *= psa->rgsabound[cCount].cElements; - return ulWholeArraySize; + return ulWholeArraySize; } -/************************************************************************ +/************************************************************************ * Method used to handle data space dupplication for Copy32 and CopyData32 */ static HRESULT duplicateData( - SAFEARRAY *psa, - SAFEARRAY **ppsaOut) + SAFEARRAY *psa, + SAFEARRAY **ppsaOut) { ULONG ulWholeArraySize; /* size of the thing */ LONG lDelta; ulWholeArraySize = getArraySize(psa); /* Number of item in SA */ - + SafeArrayLock(*ppsaOut); - if( isPointer(psa->fFeatures) ) { /* If datatype is object increment + if( isPointer(psa->fFeatures) ) { /* If datatype is object increment object's reference count */ IUnknown *punk; @@ -1093,11 +1093,11 @@ static HRESULT duplicateData( } /* Copy the source array data into target array */ - memcpy((*ppsaOut)->pvData, psa->pvData, + memcpy((*ppsaOut)->pvData, psa->pvData, ulWholeArraySize*psa->cbElements); } - else if( psa->fFeatures & FADF_BSTR ) { /* if datatype is BSTR allocate + else if( psa->fFeatures & FADF_BSTR ) { /* if datatype is BSTR allocate the BSTR in the new array */ BSTR pbstrReAllocStr = NULL; @@ -1109,7 +1109,7 @@ static HRESULT duplicateData( return E_OUTOFMEMORY; } - *((BSTR*)((char *) (*ppsaOut)->pvData+(lDelta * psa->cbElements))) = + *((BSTR*)((char *) (*ppsaOut)->pvData+(lDelta * psa->cbElements))) = pbstrReAllocStr; } @@ -1124,7 +1124,7 @@ static HRESULT duplicateData( } else { /* Simply copy the source array data into target array */ - memcpy((*ppsaOut)->pvData, psa->pvData, + memcpy((*ppsaOut)->pvData, psa->pvData, ulWholeArraySize*psa->cbElements); } @@ -1134,7 +1134,7 @@ static HRESULT duplicateData( } -/************************************************************************ +/************************************************************************ * SafeArrayGetVarType (OLEAUT32.77) * Returns the VARTYPE stored in the given safearray */ diff --git a/dlls/oleaut32/stubs.c b/dlls/oleaut32/stubs.c index d1d3c63f0b3..4078bcc999a 100644 --- a/dlls/oleaut32/stubs.c +++ b/dlls/oleaut32/stubs.c @@ -47,13 +47,13 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect( LPOCPFIPARAMS lpParams) FIXME("(%p), not implemented (olepro32.dll)\n",lpParams); return S_OK; } - + /*********************************************************************** * OleCreatePropertyFrame (OLEAUT32.417) */ HRESULT WINAPI OleCreatePropertyFrame( HWND hwndOwner, UINT x, UINT y, LPCOLESTR lpszCaption,ULONG cObjects, - LPUNKNOWN* ppUnk, ULONG cPages, LPCLSID pPageClsID, LCID lcid, + LPUNKNOWN* ppUnk, ULONG cPages, LPCLSID pPageClsID, LCID lcid, DWORD dwReserved, LPVOID pvReserved ) { FIXME("(%x,%d,%d,%s,%ld,%p,%ld,%p,%x,%ld,%p), not implemented (olepro32.dll)\n", @@ -61,4 +61,4 @@ HRESULT WINAPI OleCreatePropertyFrame( pPageClsID, (int)lcid,dwReserved,pvReserved); return S_OK; } - + diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index e63ec6aed0e..b5b822dc596 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1627,7 +1627,7 @@ START_TEST(vartest) float* pFloat = &f; double d = 0; double* pDouble = &d; - + BSTR bstr = NULL; int off, i = 0; int nOlePtrs = 120; @@ -1696,7 +1696,7 @@ START_TEST(vartest) pOleChar[57] = AtoW( "65536" ); pOleChar[58] = AtoW( "4294967295" ); pOleChar[59] = AtoW( "4294967296" ); - + pOleChar[60] = AtoW( "1 January 99" ); pOleChar[61] = AtoW( "December 31, 2078" ); pOleChar[62] = AtoW( "January 1, 1900" ); @@ -1857,7 +1857,7 @@ START_TEST(vartest) /* unsigned short from ... */ trace( "\n\n======== Testing VarUI2FromXXX ========\n"); - + ok(DISP_E_OVERFLOW == VarUI2FromI2( -1, pUShort ), XOV); /* ok(S_OK == VarUI2FromI2( 0, NULL ), XOK); */ @@ -2088,7 +2088,7 @@ START_TEST(vartest) sprintf(msg,"offset %d, expect retval %d",i,strrets_I2[i].retval); ok(strrets_I2[i].retval == *pShort,msg); } - + /* long from ... */ trace( "\n\n======== Testing VarI4FromXXX ========\n"); @@ -2151,7 +2151,7 @@ START_TEST(vartest) ok(-16777216.0 == *pFloat,"should be -16777216.0"); ok(S_OK == VarR4FromR8( -16777217.0, pFloat ), XOK); ok(-16777216.0 == *pFloat,"should be -16777216.0"); - + ok(S_OK == VarR4FromR8( 16777218e31, pFloat ), XOK); ok(*pFloat == 167772177736353110000000000000000000000.000000, "should be 167772177736353110000000000000000000000.000000"); @@ -2234,7 +2234,7 @@ START_TEST(vartest) sprintf(msg,"offset %d, retval %g ",i,strrets_DATE[i].retval); ok(*pDouble == strrets_DATE[i].retval,msg); } -#endif +#endif /* bool from ... */ trace( "\n\n======== Testing VarBoolFromXXX ========\n"); @@ -2258,7 +2258,7 @@ START_TEST(vartest) ok(VARIANT_TRUE == *pBool, "expected TRUE"); ok(S_OK == VarBoolFromUI1( (unsigned char)0xFFFF, pBool ), XOK); ok(VARIANT_TRUE == *pBool, "expected TRUE"); - + ok(S_OK == VarBoolFromR8( 0.0, pBool ), XOK); ok(VARIANT_FALSE == *pBool, "expected FALSE"); ok(S_OK == VarBoolFromR8( 1.1, pBool ), XOK); @@ -2276,7 +2276,7 @@ START_TEST(vartest) ok(S_OK == VarBoolFromR8( -0.51, pBool ), XOK); ok(VARIANT_TRUE == *pBool, "expected TRUE"); - + for( i = 0; i < nOlePtrs; i ++ ) { char msg[200]; diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index 0baab08fbd4..f206998c623 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -182,7 +182,7 @@ fail: static HRESULT WINAPI PSFacBuf_QueryInterface(LPPSFACTORYBUFFER iface, REFIID iid, LPVOID *ppv) { if (IsEqualIID(iid,&IID_IPSFactoryBuffer)||IsEqualIID(iid,&IID_IUnknown)) { - *ppv = (LPVOID)iface; + *ppv = (LPVOID)iface; /* No ref counting, static class */ return S_OK; } @@ -251,7 +251,7 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) { } /* Determine nr of functions. Since we use the toplevel interface and all - * inherited ones have lower numbers, we are ok to not to descent into + * inherited ones have lower numbers, we are ok to not to descent into * the inheritance tree I think. */ static int _nroffuncs(ITypeInfo *tinfo) { @@ -498,7 +498,7 @@ unmarshall_param( ITypeInfo_Release(tinfo2); return hres; } - case VT_VOID: + case VT_VOID: /* Hacky. If we are LPVOID* we apparently have to guess the IID * for the interface. This sucks pretty badly. */ return _unmarshal_interface(buf,&(buf->iid),(LPUNKNOWN*)arg); @@ -563,7 +563,7 @@ _get_funcdesc( } /* how much space do we use on stack in DWORD steps. */ -static int +static int _argsize(DWORD vt_type) { switch (vt_type) { case VT_VARIANT: @@ -708,7 +708,7 @@ PSFacBuf_CreateProxy( int i, nroffuncs; FUNCDESC *fdesc; TMProxyImpl *proxy; - + TRACE("(...%s...)\n",debugstr_guid(riid)); hres = _get_typeinfo_for_iid(riid,&tinfo); if (hres) { @@ -949,7 +949,7 @@ stubunalloc_param( switch (tdesc->vt) { case VT_BOOL: - case VT_I4: + case VT_I4: hres = S_OK; if (elem->u.paramdesc.wParamFlags & PARAMFLAG_FOUT) hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD)); diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 11aa4f45515..fae272efd52 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -19,18 +19,18 @@ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * * -------------------------------------------------------------------------------------- * Known problems (2000, Francois Jacques) * * - Tested using OLEVIEW (Platform SDK tool) only. - * - * - dual interface dispinterfaces. vtable-interface ITypeInfo instances are - * creating by doing a straight copy of the dispinterface instance and just changing + * + * - dual interface dispinterfaces. vtable-interface ITypeInfo instances are + * creating by doing a straight copy of the dispinterface instance and just changing * its typekind. Pointed structures aren't copied - only the address of the pointers. * So when you release the dispinterface, you delete the vtable-interface structures * as well... fortunately, clean up of structures is not implemented. - * + * * - locale stuff is partially implemented but hasn't been tested. * * - typelib file is still read in its entirety, but it is released now. @@ -49,7 +49,7 @@ * -. lousy fatal error handling * -. some methods just return pointers to internal data structures, this is * partly laziness, partly I want to check how windows does it. - * + * */ #include "config.h" @@ -82,7 +82,7 @@ WINE_DECLARE_DEBUG_CHANNEL(typelib); * path of typelib */ HRESULT WINAPI -QueryPathOfRegTypeLib16( +QueryPathOfRegTypeLib16( REFGUID guid, /* [in] referenced guid */ WORD wMaj, /* [in] major version */ WORD wMin, /* [in] minor version */ @@ -117,14 +117,14 @@ QueryPathOfRegTypeLib16( *path = SysAllocString16(pathname); return S_OK; } - + /**************************************************************************** * QueryPathOfRegTypeLib [OLEAUT32.164] * RETURNS * path of typelib */ HRESULT WINAPI -QueryPathOfRegTypeLib( +QueryPathOfRegTypeLib( REFGUID guid, /* [in] referenced guid */ WORD wMaj, /* [in] major version */ WORD wMin, /* [in] minor version */ @@ -158,7 +158,7 @@ QueryPathOfRegTypeLib( sprintf(szTypeLibKey, "SOFTWARE\\Classes\\Typelib\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\%d.%d\\%lx\\win32", guid->Data1, guid->Data2, guid->Data3, - guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], + guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7], wMaj, wMin, @@ -198,10 +198,10 @@ QueryPathOfRegTypeLib( hr = S_OK; } } - + if (hr != S_OK) TRACE_(typelib)("%s not found\n", szTypeLibKey); - + return hr; } @@ -279,7 +279,7 @@ HRESULT WINAPI LoadTypeLibEx( HRESULT res; INT index = 1; TRACE("(%s,%d,%p)\n",debugstr_w(szFile), regkind, pptLib); - + if(!SearchPathW(NULL,szFile,NULL,sizeof(szPath)/sizeof(WCHAR),szPath, NULL)) { @@ -331,7 +331,7 @@ HRESULT WINAPI LoadTypeLibEx( /****************************************************************************** * LoadRegTypeLib [OLEAUT32.162] */ -HRESULT WINAPI LoadRegTypeLib( +HRESULT WINAPI LoadRegTypeLib( REFGUID rguid, /* [in] referenced guid */ WORD wVerMajor, /* [in] major version */ WORD wVerMinor, /* [in] minor version */ @@ -350,12 +350,12 @@ HRESULT WINAPI LoadRegTypeLib( TRACE("(IID: %s) load %s (%p)\n",debugstr_guid(rguid), SUCCEEDED(res)? "SUCCESS":"FAILED", *ppTLib); return res; -} +} /****************************************************************************** * RegisterTypeLib [OLEAUT32.163] - * Adds information about a type library to the System Registry + * Adds information about a type library to the System Registry * NOTES * Docs: ITypeLib FAR * ptlib * Docs: OLECHAR FAR* szFullPath @@ -554,7 +554,7 @@ HRESULT WINAPI RegisterTypeLib( /****************************************************************************** * UnRegisterTypeLib [OLEAUT32.186] - * Removes information about a type library from the System Registry + * Removes information about a type library from the System Registry * NOTES * * RETURNS @@ -567,7 +567,7 @@ HRESULT WINAPI UnRegisterTypeLib( WORD wVerMinor, /* [in] minor version */ LCID lcid, /* [in] locale id */ SYSKIND syskind) -{ +{ TRACE("(IID: %s): stub\n",debugstr_guid(libid)); return S_OK; /* FIXME: pretend everything is OK */ } @@ -614,7 +614,7 @@ DWORD WINAPI OaBuildVersion16(void) /*======================= ITypeLib implementation =======================*/ -typedef struct tagTLBCustData +typedef struct tagTLBCustData { GUID guid; VARIANT data; @@ -647,7 +647,7 @@ typedef struct tagITypeLibImpl ICOM_VFIELD(ITypeLib2); UINT ref; TLIBATTR LibAttr; /* guid,lcid,syskind,version,flags */ - + /* strings can be stored in tlb as multibyte strings BUT they are *always* * exported to the application as a UNICODE string. */ @@ -688,7 +688,7 @@ typedef struct tagTLBRefType TLBImpLib *pImpTLInfo; /* If ref is external ptr to library data TLB_REF_INTERNAL for internal refs TLB_REF_NOT_FOUND for broken refs */ - + struct tagTLBRefType * next; } TLBRefType; @@ -717,7 +717,7 @@ typedef struct tagTLBFuncDesc BSTR Entry; /* if its Hiword==0, it numeric; -1 is not present*/ int ctCustData; TLBCustData * pCustData; /* linked list to cust data; */ - struct tagTLBFuncDesc * next; + struct tagTLBFuncDesc * next; } TLBFuncDesc; /* internal Variable data */ @@ -730,7 +730,7 @@ typedef struct tagTLBVarDesc BSTR HelpString; int ctCustData; TLBCustData * pCustData;/* linked list to cust data; */ - struct tagTLBVarDesc * next; + struct tagTLBVarDesc * next; } TLBVarDesc; /* internal implemented interface data */ @@ -751,7 +751,7 @@ typedef struct tagITypeInfoImpl TYPEATTR TypeAttr ; /* _lots_ of type information. */ ITypeLibImpl * pTypeLib; /* back pointer to typelib */ int index; /* index in this typelib; */ - /* type libs seem to store the doc strings in ascii + /* type libs seem to store the doc strings in ascii * so why should we do it in unicode? */ BSTR Name; @@ -987,18 +987,18 @@ static void dump_TLBImplType(TLBImplType * impl) impl = impl->next; } } - + static void dump_Variant(VARIANT * pvar) { char szVarType[32]; LPVOID ref; - + TRACE("(%p)\n", pvar); - + if (!pvar) return; - + ZeroMemory(szVarType, sizeof(szVarType)); - + /* FIXME : we could have better trace here, depending on the VARTYPE * of the variant */ @@ -1059,13 +1059,13 @@ static void dump_Variant(VARIANT * pvar) default: TRACE("(?)%ld\n", *(long*)ref); break; - } + } } static void dump_DispParms(DISPPARAMS * pdp) { int index = 0; - + TRACE("args=%u named args=%u\n", pdp->cArgs, pdp->cNamedArgs); while (index < pdp->cArgs) @@ -1242,7 +1242,7 @@ BSTR MSFT_ReadString( TLBContext *pcx, int offset) return bstr; } /* - * read a value and fill a VARIANT structure + * read a value and fill a VARIANT structure */ static void MSFT_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx ) { @@ -1255,7 +1255,7 @@ static void MSFT_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx ) V_UNION(pVar, iVal) = offset & 0xffff; return; } - MSFT_Read(&(V_VT(pVar)), sizeof(VARTYPE), pcx, + MSFT_Read(&(V_VT(pVar)), sizeof(VARTYPE), pcx, pcx->pTblDir->pCustData.offset + offset ); TRACE_(typelib)("Vartype = %x\n", V_VT(pVar)); switch (V_VT(pVar)){ @@ -1264,22 +1264,22 @@ static void MSFT_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx ) case VT_I2 : /* this should not happen */ case VT_I4 : case VT_R4 : - case VT_ERROR : - case VT_BOOL : - case VT_I1 : - case VT_UI1 : - case VT_UI2 : - case VT_UI4 : - case VT_INT : - case VT_UINT : + case VT_ERROR : + case VT_BOOL : + case VT_I1 : + case VT_UI1 : + case VT_UI2 : + case VT_UI4 : + case VT_INT : + case VT_UINT : case VT_VOID : /* FIXME: is this right? */ - case VT_HRESULT : + case VT_HRESULT : size=4; break; case VT_R8 : case VT_CY : - case VT_DATE : - case VT_I8 : - case VT_UI8 : + case VT_DATE : + case VT_I8 : + case VT_UI8 : case VT_DECIMAL : /* FIXME: is this right? */ case VT_FILETIME : size=8;break; @@ -1302,24 +1302,24 @@ static void MSFT_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx ) size=-4; break; /* FIXME: this will not work AT ALL when the variant contains a pointer */ case VT_DISPATCH : - case VT_VARIANT : - case VT_UNKNOWN : - case VT_PTR : + case VT_VARIANT : + case VT_UNKNOWN : + case VT_PTR : case VT_SAFEARRAY : - case VT_CARRAY : - case VT_USERDEFINED : - case VT_LPSTR : - case VT_LPWSTR : - case VT_BLOB : - case VT_STREAM : - case VT_STORAGE : - case VT_STREAMED_OBJECT : - case VT_STORED_OBJECT : - case VT_BLOB_OBJECT : - case VT_CF : - case VT_CLSID : - default: - size=0; + case VT_CARRAY : + case VT_USERDEFINED : + case VT_LPSTR : + case VT_LPWSTR : + case VT_BLOB : + case VT_STREAM : + case VT_STORAGE : + case VT_STREAMED_OBJECT : + case VT_STORED_OBJECT : + case VT_BLOB_OBJECT : + case VT_CF : + case VT_CLSID : + default: + size=0; FIXME("VARTYPE %d is not supported, setting pointer to NULL\n", V_VT(pVar)); } @@ -1342,7 +1342,7 @@ static int MSFT_CustData( TLBContext *pcx, int offset, TLBCustData** ppCustData while(offset >=0){ count++; pNew=TLB_Alloc(sizeof(TLBCustData)); - MSFT_Read(&entry, sizeof(entry), pcx, + MSFT_Read(&entry, sizeof(entry), pcx, pcx->pTblDir->pCDGuids.offset+offset); MSFT_ReadGuid(&(pNew->guid), entry.GuidOffset , pcx); MSFT_ReadValue(&(pNew->data), entry.DataOffset, pcx); @@ -1368,35 +1368,35 @@ static void MSFT_GetTdesc(TLBContext *pcx, INT type, TYPEDESC *pTd, TRACE_(typelib)("vt type = %X\n", pTd->vt); } -static void +static void MSFT_DoFuncs(TLBContext* pcx, ITypeInfoImpl* pTI, - int cFuncs, + int cFuncs, int cVars, - int offset, + int offset, TLBFuncDesc** pptfd) { - /* + /* * member information is stored in a data structure at offset * indicated by the memoffset field of the typeinfo structure * There are several distinctive parts. - * the first part starts with a field that holds the total length + * the first part starts with a field that holds the total length * of this (first) part excluding this field. Then follow the records, * for each member there is one record. * * First entry is always the length of the record (excluding this - * length word). - * Rest of the record depends on the type of the member. If there is + * length word). + * Rest of the record depends on the type of the member. If there is * a field indicating the member type (function variable intereface etc) * I have not found it yet. At this time we depend on the information * in the type info and the usual order how things are stored. * * Second follows an array sized nrMEM*sizeof(INT) with a memeber id * for each member; - * - * Third is a equal sized array with file offsets to the name entry + * + * Third is a equal sized array with file offsets to the name entry * of each member. - * + * * Forth and last (?) part is an array with offsets to the records in the * first part of this file segment. */ @@ -1416,19 +1416,19 @@ MSFT_DoFuncs(TLBContext* pcx, *pptfd = TLB_Alloc(sizeof(TLBFuncDesc)); /* name, eventually add to a hash table */ - MSFT_Read(&nameoffset, - sizeof(INT), - pcx, + MSFT_Read(&nameoffset, + sizeof(INT), + pcx, offset + infolen + (cFuncs + cVars + i + 1) * sizeof(INT)); (*pptfd)->Name = MSFT_ReadName(pcx, nameoffset); /* read the function information record */ MSFT_Read(&reclength, sizeof(INT), pcx, recoffset); - + reclength &= 0x1ff; - MSFT_Read(pFuncRec, reclength - sizeof(INT), pcx, DO_NOT_SEEK) ; + MSFT_Read(pFuncRec, reclength - sizeof(INT), pcx, DO_NOT_SEEK) ; /* do the attributes */ nrattributes = (reclength - pFuncRec->nrargs * 3 * sizeof(int) - 0x18) @@ -1437,7 +1437,7 @@ MSFT_DoFuncs(TLBContext* pcx, if ( nrattributes > 0 ) { (*pptfd)->helpcontext = pFuncRec->OptAttr[0] ; - + if ( nrattributes > 1 ) { (*pptfd)->HelpString = MSFT_ReadString(pcx, @@ -1460,7 +1460,7 @@ MSFT_DoFuncs(TLBContext* pcx, if ( nrattributes > 6 && pFuncRec->FKCCIC & 0x80 ) { - MSFT_CustData(pcx, + MSFT_CustData(pcx, pFuncRec->OptAttr[6], &(*pptfd)->pCustData); } @@ -1470,8 +1470,8 @@ MSFT_DoFuncs(TLBContext* pcx, } /* fill the FuncDesc Structure */ - MSFT_Read( & (*pptfd)->funcdesc.memid, - sizeof(INT), pcx, + MSFT_Read( & (*pptfd)->funcdesc.memid, + sizeof(INT), pcx, offset + infolen + ( i + 1) * sizeof(INT)); (*pptfd)->funcdesc.funckind = (pFuncRec->FKCCIC) & 0x7; @@ -1482,8 +1482,8 @@ MSFT_DoFuncs(TLBContext* pcx, (*pptfd)->funcdesc.oVft = pFuncRec->VtableOffset ; (*pptfd)->funcdesc.wFuncFlags = LOWORD(pFuncRec->Flags) ; - MSFT_GetTdesc(pcx, - pFuncRec->DataType, + MSFT_GetTdesc(pcx, + pFuncRec->DataType, &(*pptfd)->funcdesc.elemdescFunc.tdesc, pTI); @@ -1493,15 +1493,15 @@ MSFT_DoFuncs(TLBContext* pcx, int j = 0; MSFT_ParameterInfo paraminfo; - (*pptfd)->funcdesc.lprgelemdescParam = + (*pptfd)->funcdesc.lprgelemdescParam = TLB_Alloc(pFuncRec->nrargs * sizeof(ELEMDESC)); - (*pptfd)->pParamDesc = + (*pptfd)->pParamDesc = TLB_Alloc(pFuncRec->nrargs * sizeof(TLBParDesc)); MSFT_Read(¶minfo, - sizeof(paraminfo), - pcx, + sizeof(paraminfo), + pcx, recoffset + reclength - pFuncRec->nrargs * sizeof(MSFT_ParameterInfo)); @@ -1509,8 +1509,8 @@ MSFT_DoFuncs(TLBContext* pcx, { TYPEDESC* lpArgTypeDesc = 0; - MSFT_GetTdesc(pcx, - paraminfo.DataType, + MSFT_GetTdesc(pcx, + paraminfo.DataType, &(*pptfd)->funcdesc.lprgelemdescParam[j].tdesc, pTI); @@ -1518,15 +1518,15 @@ MSFT_DoFuncs(TLBContext* pcx, (*pptfd)->pParamDesc[j].Name = (void *) paraminfo.oName; - /* SEEK value = jump to offset, + /* SEEK value = jump to offset, * from there jump to the end of record, * go back by (j-1) arguments */ MSFT_Read( ¶minfo , sizeof(MSFT_ParameterInfo), pcx, - recoffset + reclength - ((pFuncRec->nrargs - j - 1) + recoffset + reclength - ((pFuncRec->nrargs - j - 1) * sizeof(MSFT_ParameterInfo))); - lpArgTypeDesc = + lpArgTypeDesc = & ((*pptfd)->funcdesc.lprgelemdescParam[j].tdesc); while ( lpArgTypeDesc != NULL ) @@ -1542,7 +1542,7 @@ MSFT_DoFuncs(TLBContext* pcx, break; case VT_USERDEFINED: - MSFT_DoRefType(pcx, pTI, + MSFT_DoRefType(pcx, pTI, lpArgTypeDesc->u.hreftype); lpArgTypeDesc = NULL; @@ -1560,7 +1560,7 @@ MSFT_DoFuncs(TLBContext* pcx, { TYPEDESC* lpArgTypeDesc; - (*pptfd)->funcdesc.elemdescFunc = + (*pptfd)->funcdesc.elemdescFunc = (*pptfd)->funcdesc.lprgelemdescParam[j]; lpArgTypeDesc = & ((*pptfd)->funcdesc.elemdescFunc.tdesc) ; @@ -1573,13 +1573,13 @@ MSFT_DoFuncs(TLBContext* pcx, lpArgTypeDesc = lpArgTypeDesc->u.lptdesc; break; case VT_CARRAY: - lpArgTypeDesc = + lpArgTypeDesc = & (lpArgTypeDesc->u.lpadesc->tdescElem); break; case VT_USERDEFINED: - MSFT_DoRefType(pcx, + MSFT_DoRefType(pcx, pTI, lpArgTypeDesc->u.hreftype); @@ -1600,12 +1600,12 @@ MSFT_DoFuncs(TLBContext* pcx, MSFT_ReadName( pcx, (int)(*pptfd)->pParamDesc[j].Name ); /* default value */ - if ( (PARAMFLAG_FHASDEFAULT & + if ( (PARAMFLAG_FHASDEFAULT & (*pptfd)->funcdesc.lprgelemdescParam[j].u.paramdesc.wParamFlags) && ((pFuncRec->FKCCIC) & 0x1000) ) { - INT* pInt = (INT *)((char *)pFuncRec + - reclength - + INT* pInt = (INT *)((char *)pFuncRec + + reclength - (pFuncRec->nrargs * 4 + 1) * sizeof(INT) ); PARAMDESC* pParamDesc = & (*pptfd)->funcdesc.lprgelemdescParam[j].u.paramdesc; @@ -1613,13 +1613,13 @@ MSFT_DoFuncs(TLBContext* pcx, pParamDesc->pparamdescex = TLB_Alloc(sizeof(PARAMDESCEX)); pParamDesc->pparamdescex->cBytes = sizeof(PARAMDESCEX); - MSFT_ReadValue(&(pParamDesc->pparamdescex->varDefaultValue), + MSFT_ReadValue(&(pParamDesc->pparamdescex->varDefaultValue), pInt[j], pcx); } /* custom info */ if ( nrattributes > 7 + j && pFuncRec->FKCCIC & 0x80 ) { - MSFT_CustData(pcx, + MSFT_CustData(pcx, pFuncRec->OptAttr[7+j], &(*pptfd)->pParamDesc[j].pCustData); } @@ -1646,19 +1646,19 @@ static void MSFT_DoVars(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, TRACE_(typelib)("\n"); MSFT_Read(&infolen,sizeof(INT), pcx, offset); - MSFT_Read(&recoffset,sizeof(INT), pcx, offset + infolen + + MSFT_Read(&recoffset,sizeof(INT), pcx, offset + infolen + ((cFuncs+cVars)*2+cFuncs + 1)*sizeof(INT)); recoffset += offset+sizeof(INT); for(i=0;iName=MSFT_ReadName(pcx, nameoffset); /* read the variable information record */ MSFT_Read(&reclength, sizeof(INT), pcx, recoffset); reclength &=0xff; - MSFT_Read(pVarRec, reclength - sizeof(INT), pcx, DO_NOT_SEEK) ; + MSFT_Read(pVarRec, reclength - sizeof(INT), pcx, DO_NOT_SEEK) ; /* Optional data */ if(reclength >(6*sizeof(INT)) ) (*pptvd)->HelpContext=pVarRec->HelpContext; @@ -1668,11 +1668,11 @@ static void MSFT_DoVars(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, if(reclength >(9*sizeof(INT)) ) (*pptvd)->HelpStringContext=pVarRec->HelpStringContext; /* fill the VarDesc Structure */ - MSFT_Read(&(*pptvd)->vardesc.memid, sizeof(INT), pcx, + MSFT_Read(&(*pptvd)->vardesc.memid, sizeof(INT), pcx, offset + infolen + ( i + 1) * sizeof(INT)); (*pptvd)->vardesc.varkind = pVarRec->VarKind; (*pptvd)->vardesc.wVarFlags = pVarRec->Flags; - MSFT_GetTdesc(pcx, pVarRec->DataType, + MSFT_GetTdesc(pcx, pVarRec->DataType, &(*pptvd)->vardesc.elemdescVar.tdesc, pTI); /* (*pptvd)->vardesc.lpstrSchema; is reserved (SDK) FIXME?? */ if(pVarRec->VarKind == VAR_CONST ){ @@ -1713,7 +1713,7 @@ static void MSFT_DoRefType(TLBContext *pcx, ITypeInfoImpl *pTI, TRACE_(typelib)("offset %x, masked offset %x\n", offset, offset + (offset & 0xfffffffc)); - MSFT_Read(&impinfo, sizeof(impinfo), pcx, + MSFT_Read(&impinfo, sizeof(impinfo), pcx, pcx->pTblDir->pImpInfo.offset + (offset & 0xfffffffc)); for(j=0;pImpLib;j++){ /* search the known offsets of all import libraries */ if(pImpLib->offset==impinfo.oImpFile) break; @@ -1751,7 +1751,7 @@ static void MSFT_DoImplTypes(TLBContext *pcx, ITypeInfoImpl *pTI, int count, if(offset<0) break; /* paranoia */ *ppImpl=TLB_Alloc(sizeof(**ppImpl)); MSFT_Read(&refrec,sizeof(refrec),pcx,offset+pcx->pTblDir->pRefTab.offset); - MSFT_DoRefType(pcx, pTI, refrec.reftype); + MSFT_DoRefType(pcx, pTI, refrec.reftype); (*ppImpl)->hRef = refrec.reftype; (*ppImpl)->implflags=refrec.flags; (*ppImpl)->ctCustData= @@ -1799,7 +1799,7 @@ ITypeInfoImpl * MSFT_DoTypeInfo( ptiRet->TypeAttr.cImplTypes=tiBase.cImplTypes; ptiRet->TypeAttr.cbSizeVft=tiBase.cbSizeVft; /* FIXME: this is only the non inherited part */ if(ptiRet->TypeAttr.typekind == TKIND_ALIAS) - MSFT_GetTdesc(pcx, tiBase.datatype1, + MSFT_GetTdesc(pcx, tiBase.datatype1, &ptiRet->TypeAttr.tdescAlias, ptiRet); /* FIXME: */ @@ -1818,23 +1818,23 @@ ITypeInfoImpl * MSFT_DoTypeInfo( /* functions */ if(ptiRet->TypeAttr.cFuncs >0 ) MSFT_DoFuncs(pcx, ptiRet, ptiRet->TypeAttr.cFuncs, - ptiRet->TypeAttr.cVars, + ptiRet->TypeAttr.cVars, tiBase.memoffset, & ptiRet->funclist); /* variables */ if(ptiRet->TypeAttr.cVars >0 ) MSFT_DoVars(pcx, ptiRet, ptiRet->TypeAttr.cFuncs, - ptiRet->TypeAttr.cVars, + ptiRet->TypeAttr.cVars, tiBase.memoffset, & ptiRet->varlist); if(ptiRet->TypeAttr.cImplTypes >0 ) { switch(ptiRet->TypeAttr.typekind) { case TKIND_COCLASS: - MSFT_DoImplTypes(pcx, ptiRet, ptiRet->TypeAttr.cImplTypes , + MSFT_DoImplTypes(pcx, ptiRet, ptiRet->TypeAttr.cImplTypes , tiBase.datatype1); break; case TKIND_DISPATCH: ptiRet->impltypelist=TLB_Alloc(sizeof(TLBImplType)); - + if (tiBase.datatype1 != -1) { MSFT_DoRefType(pcx, ptiRet, tiBase.datatype1); @@ -1857,17 +1857,17 @@ ITypeInfoImpl * MSFT_DoTypeInfo( (*ppRef)->reference = -1; (*ppRef)->index = TLB_REF_USE_GUID; (*ppRef)->pImpTLInfo = TLB_Alloc(sizeof(TLBImpLib)); - (*ppRef)->pImpTLInfo->guid = IID_StdOle; + (*ppRef)->pImpTLInfo->guid = IID_StdOle; (*ppRef)->pImpTLInfo->name = SysAllocStringLen(NULL, nStdOleLen + 1); - + MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szStdOle, -1, (*ppRef)->pImpTLInfo->name, SysStringLen((*ppRef)->pImpTLInfo->name)); - + (*ppRef)->pImpTLInfo->lcid = 0; (*ppRef)->pImpTLInfo->wVersionMajor = 2; (*ppRef)->pImpTLInfo->wVersionMinor = 0; @@ -1956,7 +1956,7 @@ int TLB_ReadTypeLib(LPCWSTR pszFileName, INT index, ITypeLib2 **ppTypeLib) { LPVOID pBase = LockResource(hGlobal); DWORD dwTLBLength = SizeofResource(hinstDLL, hrsrc); - + if (pBase) { /* try to load as incore resource */ @@ -2019,7 +2019,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) cx.mapping = pLib; cx.pLibInfo = pTypeLibImpl; cx.length = dwTLBLength; - + /* read header */ MSFT_Read((void*)&tlbHeader, sizeof(tlbHeader), &cx, 0); TRACE("header:\n"); @@ -2035,7 +2035,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) /* now read the segment directory */ TRACE("read segment directory (at %ld)\n",lPSegDir); - MSFT_Read((void*)&tlbSegDir, sizeof(tlbSegDir), &cx, lPSegDir); + MSFT_Read((void*)&tlbSegDir, sizeof(tlbSegDir), &cx, lPSegDir); cx.pTblDir = &tlbSegDir; /* just check two entries */ @@ -2133,9 +2133,9 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) for(j = 0; jpTypeDesc[i].u.lpadesc->rgbounds[j].cElements, + MSFT_Read(& pTypeLibImpl->pTypeDesc[i].u.lpadesc->rgbounds[j].cElements, sizeof(INT), &cx, DO_NOT_SEEK); - MSFT_Read(& pTypeLibImpl->pTypeDesc[i].u.lpadesc->rgbounds[j].lLbound, + MSFT_Read(& pTypeLibImpl->pTypeDesc[i].u.lpadesc->rgbounds[j].lLbound, sizeof(INT), &cx, DO_NOT_SEEK); } } @@ -2630,7 +2630,7 @@ static SLTG_TypeInfoTail *SLTG_ProcessInterface(char *pBlk, ITypeInfoImpl *pTI, TLB_MultiByteToBSTR(paramName); } } - + ppFuncDesc = &((*ppFuncDesc)->next); if(pFunc->next == 0xffff) break; } @@ -2776,7 +2776,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) pTypeLibImpl->ref = 1; pHeader = pLib; - + TRACE("header:\n"); TRACE("\tmagic=0x%08lx, file blocks = %d\n", pHeader->SLTG_magic, pHeader->nrOfFileBlks ); @@ -2785,7 +2785,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) pHeader->SLTG_magic); return NULL; } - + /* There are pHeader->nrOfFileBlks - 2 TypeInfo records in this typelib */ pTypeLibImpl->TypeInfoCount = pHeader->nrOfFileBlks - 2; @@ -2837,7 +2837,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) ptr = (char*)pLibBlk + len; - + for(i = 0; i < pTypeLibImpl->TypeInfoCount; i++) { WORD w, extra; len = 0; @@ -2888,7 +2888,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) table */ pNameTable = (char*)pLibBlk + len + 0x216; - + pNameTable += 2; TRACE("Library name is %s\n", pNameTable + pLibBlk->name); @@ -2936,7 +2936,7 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) (*ppTypeInfoImpl)->TypeAttr.wMinorVerNum = pTIHeader->minor_version; (*ppTypeInfoImpl)->TypeAttr.wTypeFlags = (pTIHeader->typeflags1 >> 3) | (pTIHeader->typeflags2 << 5); - + if((pTIHeader->typeflags1 & 7) != 2) FIXME("typeflags1 = %02x\n", pTIHeader->typeflags1); if(pTIHeader->typeflags3 != 2) @@ -2950,11 +2950,11 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) switch(pTIHeader->typekind) { case TKIND_ENUM: - pTITail = SLTG_ProcessEnum(pBlk, *ppTypeInfoImpl, pNameTable); + pTITail = SLTG_ProcessEnum(pBlk, *ppTypeInfoImpl, pNameTable); break; case TKIND_RECORD: - pTITail = SLTG_ProcessRecord(pBlk, *ppTypeInfoImpl, pNameTable); + pTITail = SLTG_ProcessRecord(pBlk, *ppTypeInfoImpl, pNameTable); break; case TKIND_INTERFACE: @@ -3003,7 +3003,7 @@ static HRESULT WINAPI ITypeLib2_fnQueryInterface( TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid)); *ppvObject=NULL; - if(IsEqualIID(riid, &IID_IUnknown) || + if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid,&IID_ITypeLib)|| IsEqualIID(riid,&IID_ITypeLib2)) { @@ -3038,7 +3038,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) ICOM_THIS( ITypeLibImpl, iface); --(This->ref); - + TRACE("(%p)->(%u)\n",This, This->ref); if (!This->ref) @@ -3070,7 +3070,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) SysFreeString(This->HelpStringDll); This->HelpStringDll = NULL; } - + ITypeInfo_Release((ITypeInfo*) This->pTypeInfo); HeapFree(GetProcessHeap(),0,This); return 0; @@ -3080,7 +3080,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) } /* ITypeLib::GetTypeInfoCount - * + * * Returns the number of type descriptions in the type library */ static UINT WINAPI ITypeLib2_fnGetTypeInfoCount( ITypeLib2 *iface) @@ -3096,18 +3096,18 @@ static UINT WINAPI ITypeLib2_fnGetTypeInfoCount( ITypeLib2 *iface) */ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo( ITypeLib2 *iface, - UINT index, + UINT index, ITypeInfo **ppTInfo) { int i; - + ICOM_THIS( ITypeLibImpl, iface); ITypeInfoImpl *pTypeInfo = This->pTypeInfo; TRACE("(%p)->(index=%d) \n", This, index); if (!ppTInfo) return E_INVALIDARG; - + /* search element n in list */ for(i=0; i < index; i++) { @@ -3117,10 +3117,10 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo( TRACE("-- element not found\n"); return TYPE_E_ELEMENTNOTFOUND; } - } + } *ppTInfo = (ITypeInfo *) pTypeInfo; - + ITypeInfo_AddRef(*ppTInfo); TRACE("-- found (%p)\n",*ppTInfo); return S_OK; @@ -3143,7 +3143,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType( TRACE("(%p) index %d \n",This, index); if(!pTKind) return E_INVALIDARG; - + /* search element n in list */ for(i=0; i < index; i++) { @@ -3190,8 +3190,8 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid( } } - TRACE("-- found (%p, %s)\n", - pTypeInfo, + TRACE("-- found (%p, %s)\n", + pTypeInfo, debugstr_w(pTypeInfo->Name)); *ppTInfo = (ITypeInfo*)pTypeInfo; @@ -3205,7 +3205,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid( * */ static HRESULT WINAPI ITypeLib2_fnGetLibAttr( - ITypeLib2 *iface, + ITypeLib2 *iface, LPTLIBATTR *ppTLibAttr) { ICOM_THIS( ITypeLibImpl, iface); @@ -3244,23 +3244,23 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation( INT index, BSTR *pBstrName, BSTR *pBstrDocString, - DWORD *pdwHelpContext, + DWORD *pdwHelpContext, BSTR *pBstrHelpFile) { ICOM_THIS( ITypeLibImpl, iface); - + HRESULT result = E_INVALIDARG; - + ITypeInfo *pTInfo; - + TRACE("(%p) index %d Name(%p) DocString(%p) HelpContext(%p) HelpFile(%p)\n", This, index, - pBstrName, pBstrDocString, + pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile); - + if(index<0) - { + { /* documentation for the typelib */ if(pBstrName) { @@ -3292,19 +3292,19 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation( result = S_OK; } - else + else { /* for a typeinfo */ result = ITypeLib2_fnGetTypeInfo(iface, index, &pTInfo); if(SUCCEEDED(result)) { - result = ITypeInfo_GetDocumentation(pTInfo, - MEMBERID_NIL, + result = ITypeInfo_GetDocumentation(pTInfo, + MEMBERID_NIL, pBstrName, - pBstrDocString, + pBstrDocString, pdwHelpContext, pBstrHelpFile); - + ITypeInfo_Release(pTInfo); } } @@ -3350,14 +3350,14 @@ static HRESULT WINAPI ITypeLib2_fnIsName( } for(pVInfo=pTInfo->varlist;pVInfo;pVInfo=pVInfo->next) if(!memcmp(szNameBuf,pVInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit; - + } *pfName=FALSE; ITypeLib2_fnIsName_exit: TRACE("(%p)slow! search for %s: %s found!\n", This, debugstr_w(szNameBuf), *pfName?"NOT":""); - + return S_OK; } @@ -3380,7 +3380,7 @@ static HRESULT WINAPI ITypeLib2_fnFindName( TLBFuncDesc *pFInfo; TLBVarDesc *pVInfo; int i,j = 0; - + UINT nNameBufLen = SysStringLen(szNameBuf); for(pTInfo=This->pTypeInfo;pTInfo && j<*pcFound; pTInfo=pTInfo->next){ @@ -3403,7 +3403,7 @@ ITypeLib2_fnFindName_exit: This, *pcFound, debugstr_w(szNameBuf), j); *pcFound=j; - + return S_OK; } @@ -3428,7 +3428,7 @@ static VOID WINAPI ITypeLib2_fnReleaseTLibAttr( */ static HRESULT WINAPI ITypeLib2_fnGetCustData( ITypeLib2 * iface, - REFGUID guid, + REFGUID guid, VARIANT *pVarVal) { ICOM_THIS( ITypeLibImpl, iface); @@ -3438,7 +3438,7 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData( { if( IsEqualIID(guid, &pCData->guid)) break; } - + TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT"); if(pCData) @@ -3457,7 +3457,7 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData( * */ static HRESULT WINAPI ITypeLib2_fnGetLibStatistics( - ITypeLib2 * iface, + ITypeLib2 * iface, ULONG *pcUniqueNames, ULONG *pcchUniqueNames) { @@ -3478,7 +3478,7 @@ static HRESULT WINAPI ITypeLib2_fnGetLibStatistics( * */ static HRESULT WINAPI ITypeLib2_fnGetDocumentation2( - ITypeLib2 * iface, + ITypeLib2 * iface, INT index, LCID lcid, BSTR *pbstrHelpString, @@ -3511,26 +3511,26 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation2( { /* for a typeinfo */ result=ITypeLib2_GetTypeInfo(iface, index, &pTInfo); - + if(SUCCEEDED(result)) - { + { ITypeInfo2 * pTInfo2; - result = ITypeInfo_QueryInterface(pTInfo, - &IID_ITypeInfo2, + result = ITypeInfo_QueryInterface(pTInfo, + &IID_ITypeInfo2, (LPVOID*) &pTInfo2); if(SUCCEEDED(result)) { - result = ITypeInfo2_GetDocumentation2(pTInfo2, - MEMBERID_NIL, + result = ITypeInfo2_GetDocumentation2(pTInfo2, + MEMBERID_NIL, lcid, - pbstrHelpString, - pdwHelpStringContext, + pbstrHelpString, + pdwHelpStringContext, pbstrHelpStringDll); - + ITypeInfo2_Release(pTInfo2); } - + ITypeInfo_Release(pTInfo); } } @@ -3539,7 +3539,7 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation2( /* ITypeLib2::GetAllCustData * - * Gets all custom data items for the library. + * Gets all custom data items for the library. * */ static HRESULT WINAPI ITypeLib2_fnGetAllCustData( @@ -3549,7 +3549,7 @@ static HRESULT WINAPI ITypeLib2_fnGetAllCustData( ICOM_THIS( ITypeLibImpl, iface); TLBCustData *pCData; int i; - TRACE("(%p) returning %d items\n", This, This->ctCustData); + TRACE("(%p) returning %d items\n", This, This->ctCustData); pCustData->prgCustData = TLB_Alloc(This->ctCustData * sizeof(CUSTDATAITEM)); if(pCustData->prgCustData ){ pCustData->cCustData=This->ctCustData; @@ -3613,7 +3613,7 @@ static HRESULT WINAPI ITypeInfo_fnQueryInterface( TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid)); *ppvObject=NULL; - if(IsEqualIID(riid, &IID_IUnknown) || + if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid,&IID_ITypeInfo)|| IsEqualIID(riid,&IID_ITypeInfo2)) *ppvObject = This; @@ -3646,20 +3646,20 @@ static ULONG WINAPI ITypeInfo_fnRelease( ITypeInfo2 *iface) ICOM_THIS( ITypeInfoImpl, iface); --(This->ref); - + TRACE("(%p)->(%u)\n",This, This->ref); if (!This->ref) { FIXME("destroy child objects\n"); - TRACE("destroying ITypeInfo(%p)\n",This); + TRACE("destroying ITypeInfo(%p)\n",This); if (This->Name) { SysFreeString(This->Name); This->Name = 0; } - + if (This->DocString) { SysFreeString(This->DocString); @@ -3718,7 +3718,7 @@ static HRESULT WINAPI ITypeInfo_fnGetFuncDesc( ITypeInfo2 *iface, UINT index, { ICOM_THIS( ITypeInfoImpl, iface); int i; - TLBFuncDesc * pFDesc; + TLBFuncDesc * pFDesc; TRACE("(%p) index %d\n", This, index); for(i=0, pFDesc=This->funclist; i!=index && pFDesc; i++, pFDesc=pFDesc->next) ; @@ -3732,7 +3732,7 @@ static HRESULT WINAPI ITypeInfo_fnGetFuncDesc( ITypeInfo2 *iface, UINT index, /* ITypeInfo::GetVarDesc * - * Retrieves a VARDESC structure that describes the specified variable. + * Retrieves a VARDESC structure that describes the specified variable. * */ static HRESULT WINAPI ITypeInfo_fnGetVarDesc( ITypeInfo2 *iface, UINT index, @@ -3740,7 +3740,7 @@ static HRESULT WINAPI ITypeInfo_fnGetVarDesc( ITypeInfo2 *iface, UINT index, { ICOM_THIS( ITypeInfoImpl, iface); int i; - TLBVarDesc * pVDesc; + TLBVarDesc * pVDesc; TRACE("(%p) index %d\n", This, index); for(i=0, pVDesc=This->varlist; i!=index && pVDesc; i++, pVDesc=pVDesc->next) ; @@ -3762,8 +3762,8 @@ static HRESULT WINAPI ITypeInfo_fnGetNames( ITypeInfo2 *iface, MEMBERID memid, BSTR *rgBstrNames, UINT cMaxNames, UINT *pcNames) { ICOM_THIS( ITypeInfoImpl, iface); - TLBFuncDesc * pFDesc; - TLBVarDesc * pVDesc; + TLBFuncDesc * pFDesc; + TLBVarDesc * pVDesc; int i; TRACE("(%p) memid=0x%08lx Maxname=%d\n", This, memid, cMaxNames); for(pFDesc=This->funclist; pFDesc && pFDesc->funcdesc.memid != memid; pFDesc=pFDesc->next); @@ -3842,7 +3842,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType( retrieve the associated TKIND_INTERFACE handle for the current TKIND_DISPATCH */ if( This->TypeAttr.typekind != TKIND_DISPATCH) return E_INVALIDARG; - + if (This->TypeAttr.wTypeFlags & TYPEFLAG_FDISPATCHABLE && This->TypeAttr.wTypeFlags & TYPEFLAG_FDUAL ) { @@ -3861,21 +3861,21 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType( { pImpl = pImpl->next; } - + if (!pImpl) return TYPE_E_ELEMENTNOTFOUND; - + *pRefType = pImpl->hRef; - + TRACE("-- 0x%08lx\n", pImpl->hRef ); } - + return S_OK; - + } /* ITypeInfo::GetImplTypeFlags - * - * Retrieves the IMPLTYPEFLAGS enumeration for one implemented interface + * + * Retrieves the IMPLTYPEFLAGS enumeration for one implemented interface * or base interface in a type description. */ static HRESULT WINAPI ITypeInfo_fnGetImplTypeFlags( ITypeInfo2 *iface, @@ -3905,8 +3905,8 @@ static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames( ITypeInfo2 *iface, LPOLESTR *rgszNames, UINT cNames, MEMBERID *pMemId) { ICOM_THIS( ITypeInfoImpl, iface); - TLBFuncDesc * pFDesc; - TLBVarDesc * pVDesc; + TLBFuncDesc * pFDesc; + TLBVarDesc * pVDesc; HRESULT ret=S_OK; TRACE("(%p) Name %s cNames %d\n", This, debugstr_w(*rgszNames), @@ -3926,19 +3926,19 @@ static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames( ITypeInfo2 *iface, }; return ret; } - } + } for(pVDesc=This->varlist; pVDesc; pVDesc=pVDesc->next) { if(!lstrcmpiW(*rgszNames, pVDesc->Name)) { if(cNames) *pMemId=pVDesc->vardesc.memid; return ret; } } - /* not found, see if this is and interface with an inheritance */ - if(This->TypeAttr.typekind==TKIND_INTERFACE && + /* not found, see if this is and interface with an inheritance */ + if(This->TypeAttr.typekind==TKIND_INTERFACE && This->TypeAttr.cImplTypes ){ /* recursive search */ ITypeInfo *pTInfo; - ret=ITypeInfo_GetRefTypeInfo(iface, + ret=ITypeInfo_GetRefTypeInfo(iface, This->impltypelist->hRef, &pTInfo); if(SUCCEEDED(ret)){ ret=ITypeInfo_GetIDsOfNames(pTInfo, rgszNames, cNames, pMemId ); @@ -3952,7 +3952,7 @@ static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames( ITypeInfo2 *iface, } /* ITypeInfo::Invoke - * + * * Invokes a method, or accesses a property of an object, that implements the * interface described by the type description. */ @@ -4037,8 +4037,8 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( UINT *pArgErr) { ICOM_THIS( ITypeInfoImpl, iface); - TLBFuncDesc * pFDesc; - TLBVarDesc * pVDesc; + TLBFuncDesc * pFDesc; + TLBVarDesc * pVDesc; int i; TRACE("(%p)(%p,id=%ld,flags=0x%08x,%p,%p,%p,%p) partial stub!\n", @@ -4173,7 +4173,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( } /* ITypeInfo::GetDocumentation - * + * * Retrieves the documentation string, the complete Help file name and path, * and the context ID for the Help topic for a specified type description. */ @@ -4182,8 +4182,8 @@ static HRESULT WINAPI ITypeInfo_fnGetDocumentation( ITypeInfo2 *iface, DWORD *pdwHelpContext, BSTR *pBstrHelpFile) { ICOM_THIS( ITypeInfoImpl, iface); - TLBFuncDesc * pFDesc; - TLBVarDesc * pVDesc; + TLBFuncDesc * pFDesc; + TLBVarDesc * pVDesc; TRACE("(%p) memid %ld Name(%p) DocString(%p)" " HelpContext(%p) HelpFile(%p)\n", This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile); @@ -4218,7 +4218,7 @@ static HRESULT WINAPI ITypeInfo_fnGetDocumentation( ITypeInfo2 *iface, } /* ITypeInfo::GetDllEntry - * + * * Retrieves a description or specification of an entry point for a function * in a DLL. */ @@ -4232,7 +4232,7 @@ static HRESULT WINAPI ITypeInfo_fnGetDllEntry( ITypeInfo2 *iface, MEMBERID memid } /* ITypeInfo::GetRefTypeInfo - * + * * If a type description references other type descriptions, it retrieves * the referenced type descriptions. */ @@ -4245,25 +4245,25 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo( HRESULT result = E_FAIL; - if (hRefType == -1 && + if (hRefType == -1 && (((ITypeInfoImpl*) This)->TypeAttr.typekind == TKIND_DISPATCH) && (((ITypeInfoImpl*) This)->TypeAttr.wTypeFlags & TYPEFLAG_FDUAL)) { - /* when we meet a DUAL dispinterface, we must create the interface + /* when we meet a DUAL dispinterface, we must create the interface * version of it. */ ITypeInfoImpl* pTypeInfoImpl = (ITypeInfoImpl*) ITypeInfo_Constructor(); - + /* the interface version contains the same information as the dispinterface * copy the contents of the structs. */ *pTypeInfoImpl = *This; pTypeInfoImpl->ref = 1; - + /* change the type to interface */ pTypeInfoImpl->TypeAttr.typekind = TKIND_INTERFACE; - + *ppTInfo = (ITypeInfo*) pTypeInfoImpl; ITypeInfo_AddRef((ITypeInfo*) pTypeInfoImpl); @@ -4311,8 +4311,8 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo( } if(SUCCEEDED(result)) { if(pRefType->index == TLB_REF_USE_GUID) - result = ITypeLib2_GetTypeInfoOfGuid(pTLib, - &pRefType->guid, + result = ITypeLib2_GetTypeInfoOfGuid(pTLib, + &pRefType->guid, ppTInfo); else result = ITypeLib2_GetTypeInfo(pTLib, pRefType->index, @@ -4329,7 +4329,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo( } /* ITypeInfo::AddressOfMember - * + * * Retrieves the addresses of static functions or variables, such as those * defined in a DLL. */ @@ -4342,12 +4342,12 @@ static HRESULT WINAPI ITypeInfo_fnAddressOfMember( ITypeInfo2 *iface, } /* ITypeInfo::CreateInstance - * - * Creates a new instance of a type that describes a component object class + * + * Creates a new instance of a type that describes a component object class * (coclass). */ -static HRESULT WINAPI ITypeInfo_fnCreateInstance( ITypeInfo2 *iface, - IUnknown *pUnk, REFIID riid, VOID **ppvObj) +static HRESULT WINAPI ITypeInfo_fnCreateInstance( ITypeInfo2 *iface, + IUnknown *pUnk, REFIID riid, VOID **ppvObj) { ICOM_THIS( ITypeInfoImpl, iface); FIXME("(%p) stub!\n", This); @@ -4367,7 +4367,7 @@ static HRESULT WINAPI ITypeInfo_fnGetMops( ITypeInfo2 *iface, MEMBERID memid, } /* ITypeInfo::GetContainingTypeLib - * + * * Retrieves the containing type library and the index of the type description * within that type library. */ @@ -4440,7 +4440,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetTypeKind( ITypeInfo2 * iface, * * Returns the type flags without any allocations. This returns a DWORD type * flag, which expands the type flags without growing the TYPEATTR (type - * attribute). + * attribute). * */ static HRESULT WINAPI ITypeInfo2_fnGetTypeFlags( ITypeInfo2 * iface, @@ -4465,7 +4465,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncIndexOfMemId( ITypeInfo2 * iface, int i; HRESULT result; /* FIXME: should check for invKind??? */ - for(i=0, pFuncInfo=This->funclist;pFuncInfo && + for(i=0, pFuncInfo=This->funclist;pFuncInfo && memid != pFuncInfo->funcdesc.memid; i++, pFuncInfo=pFuncInfo->next); if(pFuncInfo){ *pFuncIndex=i; @@ -4482,7 +4482,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncIndexOfMemId( ITypeInfo2 * iface, /* TypeInfo2::GetVarIndexOfMemId * * Binds to a specific member based on a known DISPID, where the member name - * is not known (for example, when binding to a default member). + * is not known (for example, when binding to a default member). * */ static HRESULT WINAPI ITypeInfo2_fnGetVarIndexOfMemId( ITypeInfo2 * iface, @@ -4492,7 +4492,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetVarIndexOfMemId( ITypeInfo2 * iface, TLBVarDesc *pVarInfo; int i; HRESULT result; - for(i=0, pVarInfo=This->varlist; pVarInfo && + for(i=0, pVarInfo=This->varlist; pVarInfo && memid != pVarInfo->vardesc.memid; i++, pVarInfo=pVarInfo->next) ; if(pVarInfo){ @@ -4545,7 +4545,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncCustData( { ICOM_THIS( ITypeInfoImpl, iface); TLBCustData *pCData=NULL; - TLBFuncDesc * pFDesc; + TLBFuncDesc * pFDesc; int i; for(i=0, pFDesc=This->funclist; i!=index && pFDesc; i++, pFDesc=pFDesc->next); @@ -4574,16 +4574,16 @@ static HRESULT WINAPI ITypeInfo2_fnGetParamCustData( UINT indexParam, REFGUID guid, VARIANT *pVarVal) -{ +{ ICOM_THIS( ITypeInfoImpl, iface); TLBCustData *pCData=NULL; - TLBFuncDesc * pFDesc; + TLBFuncDesc * pFDesc; int i; for(i=0, pFDesc=This->funclist; i!=indexFunc && pFDesc; i++,pFDesc=pFDesc->next); if(pFDesc && indexParam >=0 && indexParamfuncdesc.cParams) - for(pCData=pFDesc->pParamDesc[indexParam].pCustData; pCData; + for(pCData=pFDesc->pParamDesc[indexParam].pCustData; pCData; pCData = pCData->next) if( IsEqualIID(guid, &pCData->guid)) break; @@ -4607,10 +4607,10 @@ static HRESULT WINAPI ITypeInfo2_fnGetVarCustData( UINT index, REFGUID guid, VARIANT *pVarVal) -{ +{ ICOM_THIS( ITypeInfoImpl, iface); TLBCustData *pCData=NULL; - TLBVarDesc * pVDesc; + TLBVarDesc * pVDesc; int i; for(i=0, pVDesc=This->varlist; i!=index && pVDesc; i++, pVDesc=pVDesc->next); @@ -4643,10 +4643,10 @@ static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData( UINT index, REFGUID guid, VARIANT *pVarVal) -{ +{ ICOM_THIS( ITypeInfoImpl, iface); TLBCustData *pCData=NULL; - TLBImplType * pRDesc; + TLBImplType * pRDesc; int i; for(i=0, pRDesc=This->impltypelist; i!=index && pRDesc; i++, pRDesc=pRDesc->next); @@ -4658,7 +4658,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData( if( IsEqualIID(guid, &pCData->guid)) break; } } - + TRACE("(%p) guid %s %s found!x)\n", This, debugstr_guid(guid), pCData? "" : "NOT"); if(pCData) @@ -4671,7 +4671,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData( } /* ITypeInfo2::GetDocumentation2 - * + * * Retrieves the documentation string, the complete Help file name and path, * the localization context to use, and the context ID for the library Help * topic in the Help file. @@ -4686,8 +4686,8 @@ static HRESULT WINAPI ITypeInfo2_fnGetDocumentation2( BSTR *pbstrHelpStringDll) { ICOM_THIS( ITypeInfoImpl, iface); - TLBFuncDesc * pFDesc; - TLBVarDesc * pVDesc; + TLBFuncDesc * pFDesc; + TLBVarDesc * pVDesc; TRACE("(%p) memid %ld lcid(0x%lx) HelpString(%p) " "HelpStringContext(%p) HelpStringDll(%p)\n", This, memid, lcid, pbstrHelpString, pdwHelpStringContext, @@ -4734,7 +4734,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetDocumentation2( /* ITypeInfo2::GetAllCustData * - * Gets all custom data items for the Type info. + * Gets all custom data items for the Type info. * */ static HRESULT WINAPI ITypeInfo2_fnGetAllCustData( @@ -4745,7 +4745,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllCustData( TLBCustData *pCData; int i; - TRACE("(%p) returning %d items\n", This, This->ctCustData); + TRACE("(%p) returning %d items\n", This, This->ctCustData); pCustData->prgCustData = TLB_Alloc(This->ctCustData * sizeof(CUSTDATAITEM)); if(pCustData->prgCustData ){ @@ -4773,9 +4773,9 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllFuncCustData( { ICOM_THIS( ITypeInfoImpl, iface); TLBCustData *pCData; - TLBFuncDesc * pFDesc; + TLBFuncDesc * pFDesc; int i; - TRACE("(%p) index %d\n", This, index); + TRACE("(%p) index %d\n", This, index); for(i=0, pFDesc=This->funclist; i!=index && pFDesc; i++, pFDesc=pFDesc->next) ; @@ -4809,14 +4809,14 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllParamCustData( ITypeInfo2 * iface, { ICOM_THIS( ITypeInfoImpl, iface); TLBCustData *pCData=NULL; - TLBFuncDesc * pFDesc; + TLBFuncDesc * pFDesc; int i; - TRACE("(%p) index %d\n", This, indexFunc); + TRACE("(%p) index %d\n", This, indexFunc); for(i=0, pFDesc=This->funclist; i!=indexFunc && pFDesc; i++, pFDesc=pFDesc->next) ; if(pFDesc && indexParam >=0 && indexParamfuncdesc.cParams){ - pCustData->prgCustData = + pCustData->prgCustData = TLB_Alloc(pFDesc->pParamDesc[indexParam].ctCustData * sizeof(CUSTDATAITEM)); if(pCustData->prgCustData ){ @@ -4846,9 +4846,9 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllVarCustData( ITypeInfo2 * iface, { ICOM_THIS( ITypeInfoImpl, iface); TLBCustData *pCData; - TLBVarDesc * pVDesc; + TLBVarDesc * pVDesc; int i; - TRACE("(%p) index %d\n", This, index); + TRACE("(%p) index %d\n", This, index); for(i=0, pVDesc=This->varlist; i!=index && pVDesc; i++, pVDesc=pVDesc->next) ; @@ -4884,9 +4884,9 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllImplTypeCustData( { ICOM_THIS( ITypeInfoImpl, iface); TLBCustData *pCData; - TLBImplType * pRDesc; + TLBImplType * pRDesc; int i; - TRACE("(%p) index %d\n", This, index); + TRACE("(%p) index %d\n", This, index); for(i=0, pRDesc=This->impltypelist; i!=index && pRDesc; i++, pRDesc=pRDesc->next) ; @@ -4910,7 +4910,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllImplTypeCustData( return TYPE_E_ELEMENTNOTFOUND; } -static ICOM_VTABLE(ITypeInfo2) tinfvt = +static ICOM_VTABLE(ITypeInfo2) tinfvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h index c5c2cc31eb8..d1032d5297e 100644 --- a/dlls/oleaut32/typelib.h +++ b/dlls/oleaut32/typelib.h @@ -49,7 +49,7 @@ /* * structure of the typelib type2 header * it is at the beginning of a type lib file - * + * */ typedef struct tagMSFT_Header { /*0x00*/INT magic1; /* 0x5446534D "MSFT" */ @@ -191,8 +191,8 @@ typedef struct { */ } MSFT_FuncRecord; -/* after this may follow an array with default value pointers if the - * appropriate bit in the FKCCIC field has been set: +/* after this may follow an array with default value pointers if the + * appropriate bit in the FKCCIC field has been set: * INT oDefautlValue[nrargs]; */ @@ -357,7 +357,7 @@ typedef struct { WORD res1a; /* 0xffff */ WORD name_offs; /* offset to name in name table */ WORD more_bytes; /* if this is non-zero we get this many - bytes before the next element, which seem + bytes before the next element, which seem to reference the docstring of the type ? */ WORD res20; /* 0xffff */ DWORD helpcontext; @@ -456,7 +456,7 @@ typedef struct { middle 6 bits */ WORD rettype; /* return type VT_?? or offset to ret type */ WORD vtblpos; /* position in vtbl? */ - WORD funcflags; /* present if magic == 0x6c */ + WORD funcflags; /* present if magic == 0x6c */ /* Param list starts, repeat next two as required */ #if 0 WORD name; /* offset to 2nd letter of name */ diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 7736ffe6277..baef33b2627 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -35,7 +35,7 @@ */ #include "config.h" - + #include #include #include @@ -535,7 +535,7 @@ static int SizeOfVariantData( VARIANT* parg ) } /****************************************************************************** * StringDupAtoBstr [INTERNAL] - * + * */ static BSTR StringDupAtoBstr( char* strIn ) { @@ -562,7 +562,7 @@ static double round( double d ) */ nSign = (d >= 0.0) ? 1 : -1; d = fabs( d ); - + /* Remove the decimals. */ integerValue = floor( d ); @@ -629,7 +629,7 @@ static void RemoveCharacterFromString( LPSTR str, LPSTR strOfCharToRemove ) pNewString = strdup( str ); str[0] = '\0'; strToken = strtok( pNewString, strOfCharToRemove ); - while( strToken != NULL ) { + while( strToken != NULL ) { strcat( str, strToken ); strToken = strtok( NULL, strOfCharToRemove ); } @@ -670,7 +670,7 @@ static BOOL IsValidRealString( LPSTR strRealString ) LPSTR strToken = NULL; int nTokens = 0; LPSTR pChar = NULL; - + /* Check if we have a valid argument */ if( strRealString == NULL ) @@ -683,9 +683,9 @@ static BOOL IsValidRealString( LPSTR strRealString ) /* Make sure we only have ONE token in the string. */ strToken = strtok( strRealString, " " ); - while( strToken != NULL ) { - nTokens++; - strToken = strtok( NULL, " " ); + while( strToken != NULL ) { + nTokens++; + strToken = strtok( NULL, " " ); } if( nTokens != 1 ) @@ -777,7 +777,7 @@ static BOOL IsValidRealString( LPSTR strRealString ) case '6': case '7': case '8': - case '9': + case '9': if( bFirstDigitsProcessed == FALSE ) { if( bDecimalPointProcessed || @@ -823,7 +823,7 @@ static BOOL IsValidRealString( LPSTR strRealString ) break; /* If DecimalPoint... */ - case '.': + case '.': if( bDecimalPointProcessed || bSecondDigitsProcessed || bExponentProcessed || @@ -893,14 +893,14 @@ static HRESULT Coerce( VARIANTARG* pd, LCID lcid, ULONG dwFlags, VARIANTARG* ps, unsigned short vtFrom = 0; vtFrom = V_VT(ps) & VT_TYPEMASK; - + /* Note: Since "long" and "int" values both have 4 bytes and are * both signed integers "int" will be treated as "long" in the * following code. * The same goes for their unsigned versions. */ - /* Trivial Case: If the coercion is from two types that are + /* Trivial Case: If the coercion is from two types that are * identical then we can blindly copy from one argument to another.*/ if ((vt==vtFrom)) { @@ -1243,7 +1243,7 @@ static HRESULT Coerce( VARIANTARG* pd, LCID lcid, ULONG dwFlags, VARIANTARG* ps, break; } break; - + case( VT_R4 ): switch( vtFrom ) { @@ -1606,7 +1606,7 @@ static HRESULT Coerce( VARIANTARG* pd, LCID lcid, ULONG dwFlags, VARIANTARG* ps, FIXME("Coercion from %d to %d\n", vtFrom, vt ); break; } - + return res; } @@ -1652,13 +1652,13 @@ static HRESULT WINAPI ValidateVariantType( VARTYPE vt ) { res = DISP_E_BADVARTYPE; } - + } else { res = ValidateVtRange( vt ); } - + return res; } @@ -1685,13 +1685,13 @@ static HRESULT WINAPI ValidateVt( VARTYPE vt ) { res = DISP_E_BADVARTYPE; } - + } else { res = ValidateVtRange( vt ); } - + return res; } @@ -1766,7 +1766,7 @@ HRESULT WINAPI VariantClear(VARIANTARG* pvarg) } } } - + /* * Empty all the fields and mark the type as empty. */ @@ -1796,7 +1796,7 @@ HRESULT WINAPI VariantCopy(VARIANTARG* pvargDest, VARIANTARG* pvargSrc) if( pvargDest != pvargSrc && res == S_OK ) { res = VariantClear( pvargDest ); - + if( res == S_OK ) { if( V_VT(pvargSrc) & VT_BYREF ) @@ -1850,9 +1850,9 @@ HRESULT WINAPI VariantCopy(VARIANTARG* pvargDest, VARIANTARG* pvargSrc) break; } } - + V_VT(pvargDest) = V_VT(pvargSrc); - } + } } } @@ -1876,7 +1876,7 @@ HRESULT WINAPI VariantCopyInd(VARIANT* pvargDest, VARIANTARG* pvargSrc) if( res != S_OK ) return res; - + if( V_VT(pvargSrc) & VT_BYREF ) { VARIANTARG varg; @@ -1927,7 +1927,7 @@ HRESULT WINAPI VariantCopyInd(VARIANT* pvargDest, VARIANTARG* pvargSrc) * this API dereferences the inner Variants to only one depth. * If the inner Variant itself contains an * other inner variant the E_INVALIDARG error is - * returned. + * returned. */ if( pvargSrc->n1.n2.wReserved1 & PROCESSING_INNER_VARIANT ) { @@ -1944,7 +1944,7 @@ HRESULT WINAPI VariantCopyInd(VARIANT* pvargDest, VARIANTARG* pvargSrc) * that will be passed to the VariantCopyInd function. */ (V_UNION(pvargSrc,pvarVal))->n1.n2.wReserved1 |= PROCESSING_INNER_VARIANT; - + /* Dereference the inner variant. */ res = VariantCopyInd( pvargDest, V_UNION(pvargSrc,pvarVal) ); @@ -2007,7 +2007,7 @@ HRESULT WINAPI VariantChangeTypeEx(VARIANTARG* pvargDest, VARIANTARG* pvargSrc, HRESULT res = S_OK; VARIANTARG varg; VariantInit( &varg ); - + TRACE("(%p, %p, %ld, %u, %u) vt=%d\n", pvargDest, pvargSrc, lcid, wFlags, vt, V_VT(pvargSrc)); /* validate our source argument. @@ -2052,7 +2052,7 @@ HRESULT WINAPI VariantChangeTypeEx(VARIANTARG* pvargDest, VARIANTARG* pvargSrc, */ VariantClear( &Variant ); } - + } else { @@ -2064,7 +2064,7 @@ HRESULT WINAPI VariantChangeTypeEx(VARIANTARG* pvargDest, VARIANTARG* pvargSrc, /* this should not fail. */ VariantClear( &varg ); - + /* set the type of the destination */ if ( res == S_OK ) @@ -2091,7 +2091,7 @@ HRESULT WINAPI VarUI1FromI2(short sIn, BYTE* pbOut) } *pbOut = (BYTE) sIn; - + return S_OK; } @@ -2110,7 +2110,7 @@ HRESULT WINAPI VarUI1FromI4(LONG lIn, BYTE* pbOut) } *pbOut = (BYTE) lIn; - + return S_OK; } @@ -2131,7 +2131,7 @@ HRESULT WINAPI VarUI1FromR4(FLOAT fltIn, BYTE* pbOut) } *pbOut = (BYTE) fltIn; - + return S_OK; } @@ -2260,7 +2260,7 @@ HRESULT WINAPI VarUI1FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, BYTE* pbO /* Convert the valid string to a floating point number. */ dValue = atof( pNewString ); - + /* We don't need the string anymore so free it. */ HeapFree( GetProcessHeap(), 0 , pNewString ); @@ -2284,9 +2284,9 @@ HRESULT WINAPI VarUI1FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, BYTE* pbO */ HRESULT WINAPI VarUI1FromCy(CY cyIn, BYTE* pbOut) { double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000); - + if (t > UI1_MAX || t < UI1_MIN) return DISP_E_OVERFLOW; - + *pbOut = (BYTE)t; return S_OK; } @@ -2299,7 +2299,7 @@ HRESULT WINAPI VarI2FromUI1(BYTE bIn, short* psOut) TRACE("( 0x%08x, %p ), stub\n", bIn, psOut ); *psOut = (short) bIn; - + return S_OK; } @@ -2318,7 +2318,7 @@ HRESULT WINAPI VarI2FromI4(LONG lIn, short* psOut) } *psOut = (short) lIn; - + return S_OK; } @@ -2466,7 +2466,7 @@ HRESULT WINAPI VarI2FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, short* psO /* Convert the valid string to a floating point number. */ dValue = atof( pNewString ); - + /* We don't need the string anymore so free it. */ HeapFree( GetProcessHeap(), 0, pNewString ); @@ -2490,9 +2490,9 @@ HRESULT WINAPI VarI2FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, short* psO */ HRESULT WINAPI VarI2FromCy(CY cyIn, short* psOut) { double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000); - + if (t > I2_MAX || t < I2_MIN) return DISP_E_OVERFLOW; - + *psOut = (SHORT)t; return S_OK; } @@ -2659,7 +2659,7 @@ HRESULT WINAPI VarI4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, LONG* plOu /* Convert the valid string to a floating point number. */ dValue = atof( pNewString ); - + /* We don't need the string anymore so free it. */ HeapFree( GetProcessHeap(), 0, pNewString ); @@ -2683,9 +2683,9 @@ HRESULT WINAPI VarI4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, LONG* plOu */ HRESULT WINAPI VarI4FromCy(CY cyIn, LONG* plOut) { double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000); - + if (t > I4_MAX || t < I4_MIN) return DISP_E_OVERFLOW; - + *plOut = (LONG)t; return S_OK; } @@ -2834,7 +2834,7 @@ HRESULT WINAPI VarR4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, FLOAT* pfl /* Convert the valid string to a floating point number. */ dValue = atof( pNewString ); - + /* We don't need the string anymore so free it. */ HeapFree( GetProcessHeap(), 0, pNewString ); @@ -2857,7 +2857,7 @@ HRESULT WINAPI VarR4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, FLOAT* pfl */ HRESULT WINAPI VarR4FromCy(CY cyIn, FLOAT* pfltOut) { *pfltOut = (FLOAT)((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000); - + return S_OK; } @@ -2991,7 +2991,7 @@ HRESULT WINAPI VarR8FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, double* pd /* Convert the valid string to a floating point number. */ dValue = atof( pNewString ); - + /* We don't need the string anymore so free it. */ HeapFree( GetProcessHeap(), 0, pNewString ); @@ -3007,7 +3007,7 @@ HRESULT WINAPI VarR8FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, double* pd */ HRESULT WINAPI VarR8FromCy(CY cyIn, double* pdblOut) { *pdblOut = (double)((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000); - + return S_OK; } @@ -3096,16 +3096,16 @@ HRESULT WINAPI VarDateFromR8(double dblIn, DATE* pdateOut) * of space and/or tab characters, which are ignored. * * The formats for the date part are has follows: - * mm/[dd/][yy]yy + * mm/[dd/][yy]yy * [dd/]mm/[yy]yy - * [yy]yy/mm/dd + * [yy]yy/mm/dd * January dd[,] [yy]yy * dd January [yy]yy * [yy]yy January dd * Whitespace can be inserted anywhere between these tokens. * * The formats for the date and time string are has follows. - * date[whitespace][time] + * date[whitespace][time] * [time][whitespace]date * * These are the only characters allowed in a string representing a date and time: @@ -3214,7 +3214,7 @@ HRESULT WINAPI VarBstrFromUI1(BYTE bVal, LCID lcid, ULONG dwFlags, BSTR* pbstrOu sprintf( pBuffer, "%d", bVal ); *pbstrOut = StringDupAtoBstr( pBuffer ); - + return S_OK; } @@ -3277,7 +3277,7 @@ HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut) return E_NOTIMPL; } - + /****************************************************************************** * VarBstrFromDate [OLEAUT32.114] * @@ -3504,7 +3504,7 @@ HRESULT WINAPI VarBoolFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, VARIANT_ } HeapFree( GetProcessHeap(), 0, pNewString ); - + return ret; } @@ -3551,7 +3551,7 @@ HRESULT WINAPI VarBoolFromUI4(ULONG ulIn, VARIANT_BOOL* pboolOut) HRESULT WINAPI VarBoolFromCy(CY cyIn, VARIANT_BOOL* pboolOut) { if (cyIn.s.Hi || cyIn.s.Lo) *pboolOut = -1; else *pboolOut = 0; - + return S_OK; } @@ -3684,7 +3684,7 @@ HRESULT WINAPI VarI1FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, CHAR* pcOu /* Convert the valid string to a floating point number. */ dValue = atof( pNewString ); - + /* We don't need the string anymore so free it. */ HeapFree( GetProcessHeap(), 0, pNewString ); @@ -3754,9 +3754,9 @@ HRESULT WINAPI VarI1FromUI4(ULONG ulIn, CHAR* pcOut) */ HRESULT WINAPI VarI1FromCy(CY cyIn, CHAR* pcOut) { double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000); - + if (t > CHAR_MAX || t < CHAR_MIN) return DISP_E_OVERFLOW; - + *pcOut = (CHAR)t; return S_OK; } @@ -3883,7 +3883,7 @@ HRESULT WINAPI VarUI2FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, USHORT* p /* Convert the valid string to a floating point number. */ dValue = atof( pNewString ); - + /* We don't need the string anymore so free it. */ HeapFree( GetProcessHeap(), 0, pNewString ); @@ -3964,7 +3964,7 @@ HRESULT WINAPI VarUI4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, ULONG* pu /* Convert the valid string to a floating point number. */ dValue = atof( pNewString ); - + /* We don't need the string anymore so free it. */ HeapFree( GetProcessHeap(), 0, pNewString ); @@ -3988,11 +3988,11 @@ HRESULT WINAPI VarUI4FromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, ULONG* pu */ HRESULT WINAPI VarUI2FromCy(CY cyIn, USHORT* pusOut) { double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000); - + if (t > UI2_MAX || t < UI2_MIN) return DISP_E_OVERFLOW; - + *pusOut = (USHORT)t; - + return S_OK; } @@ -4136,7 +4136,7 @@ HRESULT WINAPI VarUI4FromUI2(USHORT uiIn, ULONG* pulOut) */ HRESULT WINAPI VarUI4FromCy(CY cyIn, ULONG* pulOut) { double t = round((((double)cyIn.s.Hi * 4294967296.0) + (double)cyIn.s.Lo) / 10000); - + if (t > UI4_MAX || t < UI4_MIN) return DISP_E_OVERFLOW; *pulOut = (ULONG)t; @@ -4176,7 +4176,7 @@ HRESULT WINAPI VarCyFromI4(LONG lIn, CY* pcyOut) { pcyOut->s.Hi = (LONG)(t / (double)4294967296.0); pcyOut->s.Lo = (ULONG)fmod(t, (double)4294967296.0); if (lIn < 0) pcyOut->s.Hi--; - + return S_OK; } @@ -4189,7 +4189,7 @@ HRESULT WINAPI VarCyFromR4(FLOAT fltIn, CY* pcyOut) { pcyOut->s.Hi = (LONG)(t / (double)4294967296.0); pcyOut->s.Lo = (ULONG)fmod(t, (double)4294967296.0); if (fltIn < 0) pcyOut->s.Hi--; - + return S_OK; } @@ -4227,7 +4227,7 @@ HRESULT WINAPI VarCyFromStr(OLECHAR *strIn, LCID lcid, ULONG dwFlags, CY *pcyOut return E_NOTIMPL; } - + /********************************************************************** * VarCyFromBool [OLEAUT32.106] * Convert boolean to currency @@ -4236,7 +4236,7 @@ HRESULT WINAPI VarCyFromBool(VARIANT_BOOL boolIn, CY* pcyOut) { if (boolIn < 0) pcyOut->s.Hi = -1; else pcyOut->s.Hi = 0; pcyOut->s.Lo = (ULONG)boolIn * (ULONG)10000; - + return S_OK; } @@ -4248,7 +4248,7 @@ HRESULT WINAPI VarCyFromI1(signed char cIn, CY* pcyOut) { if (cIn < 0) pcyOut->s.Hi = -1; else pcyOut->s.Hi = 0; pcyOut->s.Lo = (ULONG)cIn * (ULONG)10000; - + return S_OK; } @@ -4259,7 +4259,7 @@ HRESULT WINAPI VarCyFromI1(signed char cIn, CY* pcyOut) { HRESULT WINAPI VarCyFromUI2(USHORT usIn, CY* pcyOut) { pcyOut->s.Hi = 0; pcyOut->s.Lo = (ULONG)usIn * (ULONG)10000; - + return S_OK; } @@ -4271,7 +4271,7 @@ HRESULT WINAPI VarCyFromUI4(ULONG ulIn, CY* pcyOut) { double t = (double)ulIn * (double)10000; pcyOut->s.Hi = (LONG)(t / (double)4294967296.0); pcyOut->s.Lo = (ULONG)fmod(t, (double)4294967296.0); - + return S_OK; } @@ -4287,11 +4287,11 @@ INT WINAPI DosDateTimeToVariantTime(USHORT wDosDate, USHORT wDosTime, struct tm t; TRACE("( 0x%x, 0x%x, %p ), stub\n", wDosDate, wDosTime, pvtime ); - + t.tm_sec = (wDosTime & 0x001f) * 2; t.tm_min = (wDosTime & 0x07e0) >> 5; t.tm_hour = (wDosTime & 0xf800) >> 11; - + t.tm_mday = (wDosDate & 0x001f); t.tm_mon = (wDosDate & 0x01e0) >> 5; t.tm_year = ((wDosDate & 0xfe00) >> 9) + 1980; @@ -4625,7 +4625,7 @@ HRESULT WINAPI VarDateFromUdate(UDATE *pudateout, /********************************************************************** * VarBstrCmp [OLEAUT32.440] * - * flags can be: + * flags can be: * NORM_IGNORECASE, NORM_IGNORENONSPACE, NORM_IGNORESYMBOLS * NORM_IGNORESTRINGWIDTH, NORM_IGNOREKANATYPE, NORM_IGNOREKASHIDA * diff --git a/dlls/olecli/olecli_main.c b/dlls/olecli/olecli_main.c index 04e7d6ae550..5d8c6118253 100644 --- a/dlls/olecli/olecli_main.c +++ b/dlls/olecli/olecli_main.c @@ -145,7 +145,7 @@ OLESTATUS WINAPI OleCreateLinkFromClip16( LPCSTR name, SEGPTR olecli, LHCLIENTDO /****************************************************************************** * OleCreateLinkFromClip [OLECLI32.11] */ -OLESTATUS WINAPI OleCreateLinkFromClip( +OLESTATUS WINAPI OleCreateLinkFromClip( LPCSTR name,LPOLECLIENT olecli,LHCLIENTDOC hclientdoc,LPCSTR xname, LPOLEOBJECT *lpoleob,OLEOPT_RENDER render,OLECLIPFORMAT clipformat ) { diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 94335482c5b..02e233f31e7 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -186,7 +186,7 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc) BOOL ret = TRUE; TRACE("(%p)\n", hglrc); - + ENTER_GL(); /* A game (Half Life not to name it) deletes twice the same context, * so make sure it is valid first */ @@ -202,7 +202,7 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc) ret = FALSE; } LEAVE_GL(); - + return ret; } @@ -234,7 +234,7 @@ HGLRC WINAPI wglGetCurrentContext(void) { LEAVE_GL(); TRACE(" returning %p (GL context %p)\n", ret, gl_ctx); - + return ret; } @@ -246,7 +246,7 @@ HDC WINAPI wglGetCurrentDC(void) { Wine_GLContext *ret; TRACE("()\n"); - + ENTER_GL(); gl_ctx = glXGetCurrentContext(); ret = get_context_from_GLXContext(gl_ctx); @@ -319,9 +319,9 @@ void* WINAPI wglGetProcAddress(LPCSTR lpszProc) { if ((local_func = glXGetProcAddressARB(ext_ret->glx_name)) == NULL) { char buf[256]; void *ret = NULL; - + /* Remove the 3 last letters (EXT, ARB, ...). - + I know that some extensions have more than 3 letters (MESA, NV, INTEL, ...), but this is only a stop-gap measure to fix buggy OpenGL drivers (moreover, it is only useful for old 1.0 apps @@ -330,19 +330,19 @@ void* WINAPI wglGetProcAddress(LPCSTR lpszProc) { strncpy(buf, ext_ret->glx_name, strlen(ext_ret->glx_name) - 3); buf[strlen(ext_ret->glx_name) - 3] = '\0'; TRACE(" extension not found in the Linux OpenGL library, checking against libGL bug with %s..\n", buf); - + ret = GetProcAddress(hm, buf); if (ret != NULL) { TRACE(" found function in main OpenGL library (%p) !\n", ret); } else { WARN("Did not find function %s (%s) in your OpenGL library !\n", lpszProc, ext_ret->glx_name); - } - + } + return ret; } else { TRACE(" returning function (%p)\n", ext_ret->func); *(ext_ret->func_ptr) = local_func; - + return ext_ret->func; } } @@ -356,7 +356,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, BOOL ret; TRACE("(%08x,%p)\n", hdc, hglrc); - + ENTER_GL(); if (hglrc == NULL) { ret = glXMakeCurrent(default_display, None, NULL); @@ -406,7 +406,7 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { Wine_GLContext *org = (Wine_GLContext *) hglrc1; Wine_GLContext *dest = (Wine_GLContext *) hglrc2; - + TRACE("(%p, %p)\n", org, dest); if (dest->ctx != NULL) { @@ -426,7 +426,7 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1, LEAVE_GL(); TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx); } - + return TRUE; } @@ -458,7 +458,7 @@ BOOL WINAPI wglUseFontBitmapsA(HDC hdc, LEAVE_GL(); return TRUE; } - + /*********************************************************************** * wglUseFontOutlinesA (OPENGL32.@) */ @@ -507,16 +507,16 @@ static BOOL process_attach(void) /* Try to get the visual from the Root Window. We can't use the standard (presumably double buffered) X11DRV visual with the Root Window, since we don't know if the Root - Window was created using the standard X11DRV visual, and glXMakeCurrent can't deal - with mismatched visuals. Note that the Root Window visual may not be double + Window was created using the standard X11DRV visual, and glXMakeCurrent can't deal + with mismatched visuals. Note that the Root Window visual may not be double buffered, so apps actually attempting to render this way may flicker */ if (XGetWindowAttributes( default_display, root, &win_attr )) { - rootVisual = win_attr.visual; + rootVisual = win_attr.visual; } else { - /* Get the default visual, since we can't seem to get the attributes from the + /* Get the default visual, since we can't seem to get the attributes from the Root Window. Let's hope that the Root Window Visual matches the DefaultVisual */ rootVisual = DefaultVisual( default_display, DefaultScreen(default_display) ); } diff --git a/dlls/opengl32/wgl.h b/dlls/opengl32/wgl.h index adff60d9ef0..8960e142d5f 100644 --- a/dlls/opengl32/wgl.h +++ b/dlls/opengl32/wgl.h @@ -25,45 +25,45 @@ typedef void *HGLRC; typedef struct { - WORD nSize; - WORD nVersion; - DWORD dwFlags; - BYTE iPixelType; - BYTE cColorBits; - BYTE cRedBits; - BYTE cRedShift; - BYTE cGreenBits; - BYTE cGreenShift; - BYTE cBlueBits; - BYTE cBlueShift; - BYTE cAlphaBits; - BYTE cAlphaShift; - BYTE cAccumBits; - BYTE cAccumRedBits; - BYTE cAccumGreenBits; - BYTE cAccumBlueBits; - BYTE cAccumAlphaBits; - BYTE cDepthBits; - BYTE cStencilBits; - BYTE cAuxBuffers; + WORD nSize; + WORD nVersion; + DWORD dwFlags; + BYTE iPixelType; + BYTE cColorBits; + BYTE cRedBits; + BYTE cRedShift; + BYTE cGreenBits; + BYTE cGreenShift; + BYTE cBlueBits; + BYTE cBlueShift; + BYTE cAlphaBits; + BYTE cAlphaShift; + BYTE cAccumBits; + BYTE cAccumRedBits; + BYTE cAccumGreenBits; + BYTE cAccumBlueBits; + BYTE cAccumAlphaBits; + BYTE cDepthBits; + BYTE cStencilBits; + BYTE cAuxBuffers; BYTE iLayerPlane; - BYTE bReserved; - COLORREF crTransparent; -} LAYERPLANEDESCRIPTOR; + BYTE bReserved; + COLORREF crTransparent; +} LAYERPLANEDESCRIPTOR; typedef LAYERPLANEDESCRIPTOR* LPLAYERPLANEDESCRIPTOR; typedef struct { - FLOAT x; - FLOAT y; -} POINTFLOAT; + FLOAT x; + FLOAT y; +} POINTFLOAT; typedef struct { - FLOAT gmfBlackBoxX; - FLOAT gmfBlackBoxY; - POINTFLOAT gmfptGlyphOrigin; - FLOAT gmfCellIncX; - FLOAT gmfCellIncY; -} GLYPHMETRICSFLOAT; + FLOAT gmfBlackBoxX; + FLOAT gmfBlackBoxY; + POINTFLOAT gmfptGlyphOrigin; + FLOAT gmfCellIncX; + FLOAT gmfCellIncY; +} GLYPHMETRICSFLOAT; typedef GLYPHMETRICSFLOAT *LPGLYPHMETRICSFLOAT; HGLRC WINAPI wglCreateContext(HDC hdc) ; diff --git a/dlls/psapi/psapi_main.c b/dlls/psapi/psapi_main.c index 211defde928..2896fa6329c 100644 --- a/dlls/psapi/psapi_main.c +++ b/dlls/psapi/psapi_main.c @@ -69,7 +69,7 @@ BOOL WINAPI EnumDeviceDrivers( *lpcbNeeded = 0; return TRUE; -} +} /*********************************************************************** diff --git a/dlls/rasapi32/rasapi.c b/dlls/rasapi32/rasapi.c index 79d3db9cca5..f2e13c67408 100644 --- a/dlls/rasapi32/rasapi.c +++ b/dlls/rasapi32/rasapi.c @@ -1,6 +1,6 @@ /* * RASAPI32 - * + * * Copyright 1998 Marcus Meissner * * This library is free software; you can redistribute it and/or @@ -32,7 +32,7 @@ DWORD WINAPI RasEnumConnectionsA( LPRASCONNA rca, LPDWORD lpcb, LPDWORD lpcConne FIXME("(%p,%p,%p),stub!\n",rca,lpcb,lpcConnections); FIXME("RAS support is not implemented ! Configure program to use LAN connection/winsock instead !\n"); *lpcConnections = 0; /* no RAS connections available */ - + return 0; } @@ -40,8 +40,8 @@ DWORD WINAPI RasEnumConnectionsA( LPRASCONNA rca, LPDWORD lpcb, LPDWORD lpcConne * RasEnumEntriesA [RASAPI32.546] */ DWORD WINAPI RasEnumEntriesA( LPCSTR Reserved, LPCSTR lpszPhoneBook, - LPRASENTRYNAMEA lpRasEntryName, - LPDWORD lpcb, LPDWORD lpcEntries) + LPRASENTRYNAMEA lpRasEntryName, + LPDWORD lpcb, LPDWORD lpcEntries) { FIXME("(%p,%s,%p,%p,%p),stub!\n",Reserved,debugstr_a(lpszPhoneBook), lpRasEntryName,lpcb,lpcEntries); @@ -54,7 +54,7 @@ DWORD WINAPI RasEnumEntriesA( LPCSTR Reserved, LPCSTR lpszPhoneBook, */ DWORD WINAPI RasGetEntryDialParamsA( LPCSTR lpszPhoneBook, LPRASDIALPARAMSA lpRasDialParams, - LPBOOL lpfPassword) + LPBOOL lpfPassword) { FIXME("(%s,%p,%p),stub!\n",debugstr_a(lpszPhoneBook), lpRasDialParams,lpfPassword); diff --git a/dlls/richedit/ansi_gen.h b/dlls/richedit/ansi_gen.h index 534948e1bcc..3d96752966e 100644 --- a/dlls/richedit/ansi_gen.h +++ b/dlls/richedit/ansi_gen.h @@ -12,7 +12,7 @@ in decimal or 0xyy as hex yy. Single or double quotes may be used to quote characters.*/ -int ansi_gen[] = +int ansi_gen[] = { rtfSC_formula ,0x06, rtfSC_nobrkhyphen ,0x1e, diff --git a/dlls/richedit/ansi_sym.h b/dlls/richedit/ansi_sym.h index 679f0176912..f4718483d0a 100644 --- a/dlls/richedit/ansi_sym.h +++ b/dlls/richedit/ansi_sym.h @@ -1,17 +1,17 @@ /* * RTF ANSI character set (\ansi) Symbol font map - * + * * Field 1 is the standard character name which the character value in * field 2 maps onto. (It doesn't mean "to produce the character in field 1, * use the value in field 2.) - * + * * The character value may be given either as a single character (which will be * converted to the ASCII value of the character), or in numeric format, either * in decimal or 0xyy as hex yy. Single or double quotes may be used to quote * characters. - * + * */ - + int ansi_sym[] = { rtfSC_formula ,0x06, diff --git a/dlls/richedit/charlist.c b/dlls/richedit/charlist.c index e6229129449..26d1e99e51d 100644 --- a/dlls/richedit/charlist.c +++ b/dlls/richedit/charlist.c @@ -1,9 +1,9 @@ /* - * + * * Character List - * + * * Copyright (c) 2000 by Jean-Claude Batista - * + * * 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 @@ -35,20 +35,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit); extern HANDLE RICHED32_hHeap; void CHARLIST_Enqueue( CHARLIST* pCharList, char myChar ) -{ +{ CHARLISTENTRY* pNewEntry = HeapAlloc(RICHED32_hHeap, 0,sizeof(CHARLISTENTRY)); pNewEntry->pNext = NULL; pNewEntry->myChar = myChar; TRACE("\n"); - + if(pCharList->pTail == NULL) { pCharList->pHead = pCharList->pTail = pNewEntry; } else { - CHARLISTENTRY* pCurrent = pCharList->pTail; + CHARLISTENTRY* pCurrent = pCharList->pTail; pCharList->pTail = pCurrent->pNext = pNewEntry; } @@ -56,13 +56,13 @@ void CHARLIST_Enqueue( CHARLIST* pCharList, char myChar ) } void CHARLIST_Push( CHARLIST* pCharList, char myChar) -{ +{ CHARLISTENTRY* pNewEntry = malloc(sizeof(CHARLISTENTRY)); - + TRACE("\n"); pNewEntry->myChar = myChar; - + if(pCharList->pHead == NULL) { pCharList->pHead = pCharList->pTail = pNewEntry; @@ -85,14 +85,14 @@ char CHARLIST_Dequeue(CHARLIST* pCharList) TRACE("\n"); - if(pCharList->nCount == 0) + if(pCharList->nCount == 0) return 0; - + pCharList->nCount--; myChar = pCharList->pHead->myChar; pCurrent = pCharList->pHead->pNext; HeapFree(RICHED32_hHeap, 0,pCharList->pHead); - + if(pCharList->nCount == 0) { pCharList->pHead = pCharList->pTail = NULL; @@ -102,7 +102,7 @@ char CHARLIST_Dequeue(CHARLIST* pCharList) pCharList->pHead = pCurrent; } - return myChar; + return myChar; } int CHARLIST_GetNbItems(CHARLIST* pCharList) @@ -116,7 +116,7 @@ void CHARLIST_FreeList(CHARLIST* pCharList){ TRACE("\n"); while(pCharList->nCount) - CHARLIST_Dequeue(pCharList); + CHARLIST_Dequeue(pCharList); } /* this function counts the number of occurrences of a caracter */ @@ -126,26 +126,26 @@ int CHARLIST_CountChar(CHARLIST* pCharList, char myChar) int nCount = 0; TRACE("\n"); - + for(pCurrent =pCharList->pHead ;pCurrent;pCurrent=pCurrent->pNext) if(pCurrent->myChar == myChar) nCount++; - + return nCount; } int CHARLIST_toBuffer(CHARLIST* pCharList, char* pBuffer, int nBufferSize) { - + TRACE("\n"); /* we add one to store a NULL caracter */ - if(nBufferSize < pCharList->nCount + 1) + if(nBufferSize < pCharList->nCount + 1) return pCharList->nCount; - + for(;pCharList->nCount;pBuffer++) *pBuffer = CHARLIST_Dequeue(pCharList); - + *pBuffer = '\0'; return 0; diff --git a/dlls/richedit/charlist.h b/dlls/richedit/charlist.h index 708920f0f84..8b81ddd261e 100644 --- a/dlls/richedit/charlist.h +++ b/dlls/richedit/charlist.h @@ -1,6 +1,6 @@ /* * Character List - * + * * Copyright (c) 2000 by Jean-Claude Batista * * This library is free software; you can redistribute it and/or diff --git a/dlls/richedit/reader.c b/dlls/richedit/reader.c index 992aba46be5..e2a64a39623 100644 --- a/dlls/richedit/reader.c +++ b/dlls/richedit/reader.c @@ -66,7 +66,7 @@ /* * include hard coded charsets */ - + #include "ansi_gen.h" #include "ansi_sym.h" #include "text_map.h" @@ -206,10 +206,10 @@ static int csTop = 0; /* * Get a char from the charlist. The charlist is used to store characters * from the editstream. - * + * */ -int +int _RTFGetChar() { char myChar; @@ -270,7 +270,7 @@ RTFStyleElt *eltList, *ep; RTFFree (inputName); RTFFree (outputName); inputName = outputName = (char *) NULL; - + /* initialize lookup table */ LookupInit (); @@ -846,7 +846,7 @@ int c; * the *next* input character. */ - + static int GetChar () { @@ -978,11 +978,11 @@ int csId; /* * Do auto-charset-file reading. - * will always use the ansi charset no mater what the value + * will always use the ansi charset no mater what the value * of the rtfTextBuf is. * * TODO: add support for other charset in the future. - * + * */ static void @@ -1009,7 +1009,7 @@ char buf[rtfBufSiz]; /* - * Convert a CaracterSetMap (caracter_name, caracter) into + * Convert a CaracterSetMap (caracter_name, caracter) into * this form : array[caracter_ident] = caracter; */ @@ -1027,7 +1027,7 @@ int csId; default: return (0); /* illegal charset id */ case rtfCSGeneral: - + haveGenCharSet = 1; stdCodeArray = genCharCode; for (i = 0; i < charSetSize; i++) @@ -1040,7 +1040,7 @@ int csId; stdCodeArray[ ansi_gen[i+1] ] = ansi_gen[i]; } break; - + case rtfCSSymbol: haveSymCharSet = 1; @@ -1053,7 +1053,7 @@ int csId; for ( i = 0 ; i< sizeof(ansi_sym)/(sizeof(int));i+=2) { stdCodeArray[ ansi_sym[i+1] ] = ansi_sym[i]; - } + } break; } @@ -1241,7 +1241,7 @@ char *fn = "ReadFontTbl"; fp->rtfFType = 0; fp->rtfFCodePage = 0; - while (rtfClass != rtfEOF + while (rtfClass != rtfEOF && !RTFCheckCM (rtfText, ';') && !RTFCheckCM (rtfGroup, rtfEndGroup)) { @@ -1302,12 +1302,12 @@ char *fn = "ReadFontTbl"; *bp++ = rtfMajor; (void) RTFGetToken (); } - + /* FIX: in some cases the isn't finished with a semi-column */ if(RTFCheckCM (rtfGroup, rtfEndGroup)) { RTFUngetToken (); - } + } *bp = '\0'; fp->rtfFName = RTFStrSave (buf); if (fp->rtfFName == (char *) NULL) @@ -2781,7 +2781,7 @@ int i; * * char *outMap[rtfSC_MaxChar]; * - * reinit should be non-zero if outMap should be initialized + * reinit should be non-zero if outMap should be initialized * zero otherwise. * */ diff --git a/dlls/richedit/richedit.c b/dlls/richedit/richedit.c index 7c51fcb7a56..9af1dee01fe 100644 --- a/dlls/richedit/richedit.c +++ b/dlls/richedit/richedit.c @@ -2,7 +2,7 @@ * RichEdit32 functions * * This module is a simple wrapper for the edit controls. - * At the point, it is good only for application who use the RICHEDIT + * At the point, it is good only for application who use the RICHEDIT * control to display RTF text. * * Copyright 2000 by Jean-Claude Batista @@ -21,7 +21,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + #include #include "windef.h" #include "winbase.h" @@ -68,7 +68,7 @@ HANDLE RICHED32_hHeap = (HANDLE)NULL; BOOL WINAPI RICHED32_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - TRACE("\n"); + TRACE("\n"); switch (fdwReason) { case DLL_PROCESS_ATTACH: @@ -91,7 +91,7 @@ RICHED32_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) /* Support routines for window procedure */ INT RICHEDIT_GetTextRange(HWND hwnd,TEXTRANGEA *tr); INT RICHEDIT_GetSelText(HWND hwnd,LPSTR lpstrBuffer); - + /* * @@ -104,7 +104,7 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, { int RTFToBuffer(char* pBuffer, int nBufferSize); LONG newstyle = 0; - LONG style = 0; + LONG style = 0; static HWND hwndEdit; static HWND hwndParent; @@ -114,14 +114,14 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, CHARRANGE *cr; TRACE("previous hwndEdit: 0x%x hwndParent 0x%x\n",hwndEdit,hwndParent); hwndEdit = GetWindow(hwnd,GW_CHILD); - TRACE("uMsg: 0x%x hwnd: 0x%x hwndEdit: 0x%x\n",uMsg,hwnd,hwndEdit); - + TRACE("uMsg: 0x%x hwnd: 0x%x hwndEdit: 0x%x\n",uMsg,hwnd,hwndEdit); + switch (uMsg) { - - case WM_CREATE : + + case WM_CREATE : DPRINTF_EDIT_MSG32("WM_CREATE"); - + /* remove SCROLLBARS from the current window style */ hwndParent = ((LPCREATESTRUCTA) lParam)->hwndParent; @@ -136,21 +136,21 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, style, 0, 0, 0, 0, hwnd, (HMENU) ID_EDIT, ((LPCREATESTRUCTA) lParam)->hInstance, NULL) ; - TRACE("hwndEdit: 0x%x hwnd: 0x%x\n",hwndEdit,hwnd); - - SetWindowLongA(hwnd,GWL_STYLE, newstyle); + TRACE("hwndEdit: 0x%x hwnd: 0x%x\n",hwndEdit,hwnd); + + SetWindowLongA(hwnd,GWL_STYLE, newstyle); return 0 ; - + case WM_SETFOCUS : - DPRINTF_EDIT_MSG32("WM_SETFOCUS"); + DPRINTF_EDIT_MSG32("WM_SETFOCUS"); SetFocus (hwndEdit) ; return 0 ; - case WM_SIZE : + case WM_SIZE : DPRINTF_EDIT_MSG32("WM_SIZE"); MoveWindow (hwndEdit, 0, 0, LOWORD (lParam), HIWORD (lParam), TRUE) ; return 0 ; - + case WM_COMMAND : DPRINTF_EDIT_MSG32("WM_COMMAND"); switch(HIWORD(wParam)) { @@ -160,28 +160,28 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case EN_SETFOCUS: case EN_UPDATE: case EN_VSCROLL: - return SendMessageA(hwndParent, WM_COMMAND, + return SendMessageA(hwndParent, WM_COMMAND, wParam, (LPARAM)(hwnd)); - + case EN_ERRSPACE: case EN_MAXTEXT: MessageBoxA (hwnd, "RichEdit control out of space.", "ERROR", MB_OK | MB_ICONSTOP) ; return 0 ; } - - case EM_STREAMIN: + + case EM_STREAMIN: DPRINTF_EDIT_MSG32("EM_STREAMIN"); - + /* setup the RTF parser */ RTFSetEditStream(( EDITSTREAM*)lParam); WriterInit(); RTFInit (); - BeginFile(); + BeginFile(); /* do the parsing */ RTFRead (); - + rtfBufferSize = RTFToBuffer(NULL, 0); rtfBuffer = HeapAlloc(RICHED32_hHeap, 0,rtfBufferSize*sizeof(char)); if(rtfBuffer) @@ -192,8 +192,8 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, } else WARN("Not enough memory for a allocating rtfBuffer\n"); - - return 0; + + return 0; /* Messages specific to Richedit controls */ @@ -598,7 +598,7 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case EM_UNDO: DPRINTF_EDIT_MSG32("EM_UNDO Passed to edit control"); return SendMessageA( hwndEdit, uMsg, wParam, lParam); - + case WM_STYLECHANGING: DPRINTF_EDIT_MSG32("WM_STYLECHANGING Passed to edit control"); return SendMessageA( hwndEdit, uMsg, wParam, lParam); @@ -627,7 +627,7 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, DPRINTF_EDIT_MSG32("WM_PASTE Passed to edit control"); return SendMessageA( hwndEdit, uMsg, wParam, lParam); - /* Messages passed to default handler. */ + /* Messages passed to default handler. */ case WM_NCPAINT: DPRINTF_EDIT_MSG32("WM_NCPAINT Passed to default"); return DefWindowProcA( hwnd,uMsg,wParam,lParam); @@ -643,7 +643,7 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, case WM_DESTROY: DPRINTF_EDIT_MSG32("WM_DESTROY Passed to default"); return DefWindowProcA( hwnd,uMsg,wParam,lParam); - case WM_CHILDACTIVATE: + case WM_CHILDACTIVATE: DPRINTF_EDIT_MSG32("WM_CHILDACTIVATE Passed to default"); return DefWindowProcA( hwnd,uMsg,wParam,lParam); @@ -723,7 +723,7 @@ RICHED32_DllGetVersion (DLLVERSIONINFO *pdvi) TRACE("\n"); if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) { - + return E_INVALIDARG; } @@ -738,7 +738,7 @@ RICHED32_DllGetVersion (DLLVERSIONINFO *pdvi) /*** * DESCRIPTION: * Registers the window class. - * + * * PARAMETER(S): * None * @@ -747,7 +747,7 @@ RICHED32_DllGetVersion (DLLVERSIONINFO *pdvi) */ VOID RICHED32_Register(void) { - WNDCLASSA wndClass; + WNDCLASSA wndClass; TRACE("\n"); @@ -766,7 +766,7 @@ VOID RICHED32_Register(void) /*** * DESCRIPTION: * Unregisters the window class. - * + * * PARAMETER(S): * None * @@ -794,13 +794,13 @@ INT RICHEDIT_GetTextRange(HWND hwnd,TEXTRANGEA *tr) if (text_size > tr->chrg.cpMin) { - range_size = (text_size> tr->chrg.cpMax) ? (tr->chrg.cpMax - tr->chrg.cpMin) : (text_size - tr->chrg.cpMin); + range_size = (text_size> tr->chrg.cpMax) ? (tr->chrg.cpMax - tr->chrg.cpMin) : (text_size - tr->chrg.cpMin); TRACE("EditText: %.30s ...\n",text+tr->chrg.cpMin); memcpy(tr->lpstrText,text+tr->chrg.cpMin,range_size); } else range_size = 0; HeapFree(GetProcessHeap(), 0, text); - + return range_size; } diff --git a/dlls/richedit/text-writer.c b/dlls/richedit/text-writer.c index 9a952186769..678aa253872 100644 --- a/dlls/richedit/text-writer.c +++ b/dlls/richedit/text-writer.c @@ -60,16 +60,16 @@ static CHARLIST charlist = {0, NULL, NULL}; int RTFToBuffer(char* pBuffer, int nBufferSize); int RTFToBuffer(char* pBuffer, int nBufferSize) { - - /* check if the buffer is big enough to hold all characters */ + + /* check if the buffer is big enough to hold all characters */ /* we require one more for the '\0' */ - - TRACE("\n"); + + TRACE("\n"); if(nBufferSize < charlist.nCount + 1) { return charlist.nCount + CHARLIST_CountChar(&charlist, '\n') + 1; } - + while(charlist.nCount) { *pBuffer = CHARLIST_Dequeue(&charlist); @@ -77,13 +77,13 @@ int RTFToBuffer(char* pBuffer, int nBufferSize) { *pBuffer = '\r'; pBuffer++; - *pBuffer = '\n'; + *pBuffer = '\n'; } pBuffer++; } *pBuffer = '\0'; - return 0; + return 0; } @@ -123,7 +123,7 @@ TextClass () { char buf[rtfBufSiz]; - TRACE("\n"); + TRACE("\n"); if (rtfMinor != rtfSC_nothing) PutStdChar (rtfMinor); @@ -255,13 +255,13 @@ void SpecialChar () void PutStdChar (int stdCode) { - + char *oStr = (char *) NULL; char buf[rtfBufSiz]; - + /* if (stdCode == rtfSC_nothing) RTFPanic ("Unknown character code, logic error\n"); -*/ +*/ TRACE("\n"); oStr = outMap[stdCode]; diff --git a/dlls/richedit/text_map.h b/dlls/richedit/text_map.h index 01f04447ff5..3c4379120c5 100644 --- a/dlls/richedit/text_map.h +++ b/dlls/richedit/text_map.h @@ -1,13 +1,13 @@ /* * Output sequence map for rtf2text - * + * * Field 1 is the standard character name. Field 2 is the output sequence * to produce for that character. - * + * * The output sequence is simply a string of characters. If it contains * whitespace, it may be quoted. If it contains quotes, it may be quoted * with a different quote character. - * + * * characters in ASCII range (32-127 */ diff --git a/dlls/rpcrt4/rpcrt4_main.c b/dlls/rpcrt4/rpcrt4_main.c index 8a9db8abee8..4f31acda49b 100644 --- a/dlls/rpcrt4/rpcrt4_main.c +++ b/dlls/rpcrt4/rpcrt4_main.c @@ -81,7 +81,7 @@ RPCRT4_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; case DLL_PROCESS_DETACH: - break; + break; } return TRUE; @@ -187,7 +187,7 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) /* make sure it's not blank */ if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5]) continue; - + goto valid_address; } /* if we didn't find a valid address, make a random one */ @@ -214,12 +214,12 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) #endif /* HAVE_NET_IF_H */ has_init = 1; } - + /* generate time element of GUID */ - + /* Assume that the gettimeofday() has microsecond granularity */ #define MAX_ADJUSTMENT 10 - + try_again: gettimeofday(&tv, 0); if ((last.tv_sec == 0) && (last.tv_usec == 0)) { @@ -240,19 +240,19 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) adjustment++; } else adjustment = 0; - + clock_reg = tv.tv_usec*10 + adjustment; clock_reg += ((unsigned long long) tv.tv_sec)*10000000; clock_reg += (((unsigned long long) 0x01B21DD2) << 32) + 0x13814000; - + clock_high = clock_reg >> 32; clock_low = clock_reg; temp_clock_seq = clock_seq | 0x8000; temp_clock_mid = (UINT16)clock_high; temp_clock_hi_and_version = (clock_high >> 16) | 0x1000; - + /* pack the information into the GUID structure */ - + ((unsigned char*)&Uuid->Data1)[3] = (unsigned char)clock_low; clock_low >>= 8; ((unsigned char*)&Uuid->Data1)[2] = (unsigned char)clock_low; @@ -260,28 +260,28 @@ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) ((unsigned char*)&Uuid->Data1)[1] = (unsigned char)clock_low; clock_low >>= 8; ((unsigned char*)&Uuid->Data1)[0] = (unsigned char)clock_low; - + ((unsigned char*)&Uuid->Data2)[1] = (unsigned char)temp_clock_mid; temp_clock_mid >>= 8; ((unsigned char*)&Uuid->Data2)[0] = (unsigned char)temp_clock_mid; - + ((unsigned char*)&Uuid->Data3)[1] = (unsigned char)temp_clock_hi_and_version; temp_clock_hi_and_version >>= 8; ((unsigned char*)&Uuid->Data3)[0] = (unsigned char)temp_clock_hi_and_version; - + ((unsigned char*)Uuid->Data4)[1] = (unsigned char)temp_clock_seq; temp_clock_seq >>= 8; ((unsigned char*)Uuid->Data4)[0] = (unsigned char)temp_clock_seq; - + ((unsigned char*)Uuid->Data4)[2] = a[0]; ((unsigned char*)Uuid->Data4)[3] = a[1]; ((unsigned char*)Uuid->Data4)[4] = a[2]; ((unsigned char*)Uuid->Data4)[5] = a[3]; ((unsigned char*)Uuid->Data4)[6] = a[4]; ((unsigned char*)Uuid->Data4)[7] = a[5]; - + TRACE("%s\n", debugstr_guid(Uuid)); - + return RPC_S_OK; } @@ -365,7 +365,7 @@ HRESULT WINAPI NdrDllRegisterProxy( HMODULE hDll, /* [in] */ const ProxyFileInfo **pProxyFileList, /* [in] */ const CLSID *pclsid /* [in] */ -) +) { FIXME("(%x,%p,%s), stub!\n",hDll,pProxyFileList,debugstr_guid(pclsid)); return S_OK; @@ -378,14 +378,14 @@ HRESULT WINAPI NdrDllRegisterProxy( RPC_STATUS WINAPI RpcServerUseProtseqEpA( LPSTR Protseq, UINT MaxCalls, LPSTR Endpoint, LPVOID SecurityDescriptor ) { RPC_POLICY policy; - + TRACE( "(%s,%u,%s,%p)\n", Protseq, MaxCalls, Endpoint, SecurityDescriptor ); - + /* This should provide the default behaviour */ policy.Length = sizeof( policy ); policy.EndpointFlags = 0; policy.NICFlags = 0; - + return RpcServerUseProtseqEpExA( Protseq, MaxCalls, Endpoint, SecurityDescriptor, &policy ); } @@ -395,14 +395,14 @@ RPC_STATUS WINAPI RpcServerUseProtseqEpA( LPSTR Protseq, UINT MaxCalls, LPSTR En RPC_STATUS WINAPI RpcServerUseProtseqEpW( LPWSTR Protseq, UINT MaxCalls, LPWSTR Endpoint, LPVOID SecurityDescriptor ) { RPC_POLICY policy; - + TRACE( "(%s,%u,%s,%p)\n", debugstr_w( Protseq ), MaxCalls, debugstr_w( Endpoint ), SecurityDescriptor ); - + /* This should provide the default behaviour */ policy.Length = sizeof( policy ); policy.EndpointFlags = 0; policy.NICFlags = 0; - + return RpcServerUseProtseqEpExW( Protseq, MaxCalls, Endpoint, SecurityDescriptor, &policy ); } @@ -414,8 +414,8 @@ RPC_STATUS WINAPI RpcServerUseProtseqEpExA( LPSTR Protseq, UINT MaxCalls, LPSTR { FIXME( "(%s,%u,%s,%p,{%u,%lu,%lu}): stub\n", Protseq, MaxCalls, Endpoint, SecurityDescriptor, lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags ); - - return RPC_S_PROTSEQ_NOT_SUPPORTED; /* We don't support anything at this point */ + + return RPC_S_PROTSEQ_NOT_SUPPORTED; /* We don't support anything at this point */ } /*********************************************************************** @@ -427,8 +427,8 @@ RPC_STATUS WINAPI RpcServerUseProtseqEpExW( LPWSTR Protseq, UINT MaxCalls, LPWST FIXME( "(%s,%u,%s,%p,{%u,%lu,%lu}): stub\n", debugstr_w( Protseq ), MaxCalls, debugstr_w( Endpoint ), SecurityDescriptor, lpPolicy->Length, lpPolicy->EndpointFlags, lpPolicy->NICFlags ); - - return RPC_S_PROTSEQ_NOT_SUPPORTED; /* We don't support anything at this point */ + + return RPC_S_PROTSEQ_NOT_SUPPORTED; /* We don't support anything at this point */ } /*********************************************************************** @@ -438,7 +438,7 @@ RPC_STATUS WINAPI RpcServerRegisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, { /* FIXME: Dump UUID using UuidToStringA */ TRACE( "(%p,%p,%p)\n", IfSpec, MgrTypeUuid, MgrEpv ); - + return RpcServerRegisterIf2( IfSpec, MgrTypeUuid, MgrEpv, 0, RPC_C_LISTEN_MAX_CALLS_DEFAULT, (UINT)-1, NULL ); } @@ -450,7 +450,7 @@ RPC_STATUS WINAPI RpcServerRegisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid { /* FIXME: Dump UUID using UuidToStringA */ TRACE( "(%p,%p,%p,%u,%u,%p)\n", IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, IfCallbackFn ); - + return RpcServerRegisterIf2( IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, (UINT)-1, IfCallbackFn ); } @@ -462,7 +462,7 @@ RPC_STATUS WINAPI RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, { /* FIXME: Dump UUID using UuidToStringA */ FIXME( "(%p,%p,%p,%u,%u,%u,%p): stub\n", IfSpec, MgrTypeUuid, MgrEpv, Flags, MaxCalls, MaxRpcSize, IfCallbackFn ); - + return RPC_S_UNKNOWN_IF; /* I guess this return code is as good as any failure */ } @@ -474,7 +474,7 @@ RPC_STATUS WINAPI RpcServerRegisterAuthInfoA( LPSTR ServerPrincName, ULONG Authn LPVOID Arg ) { FIXME( "(%s,%lu,%p,%p): stub\n", ServerPrincName, AuthnSvc, GetKeyFn, Arg ); - + return RPC_S_UNKNOWN_AUTHN_SERVICE; /* We don't know any authentication services */ } @@ -485,7 +485,7 @@ RPC_STATUS WINAPI RpcServerRegisterAuthInfoW( LPWSTR ServerPrincName, ULONG Auth LPVOID Arg ) { FIXME( "(%s,%lu,%p,%p): stub\n", debugstr_w( ServerPrincName ), AuthnSvc, GetKeyFn, Arg ); - + return RPC_S_UNKNOWN_AUTHN_SERVICE; /* We don't know any authentication services */ } @@ -495,7 +495,7 @@ RPC_STATUS WINAPI RpcServerRegisterAuthInfoW( LPWSTR ServerPrincName, ULONG Auth RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait ) { FIXME( "(%u,%u,%u): stub\n", MinimumCallThreads, MaxCalls, DontWait ); - + return RPC_S_NO_PROTSEQS_REGISTERED; /* Since we don't allow registration this seems reasonable */ } @@ -507,7 +507,7 @@ RPC_STATUS WINAPI RpcStringBindingComposeA( LPSTR ObjUuid, LPSTR Protseq, LPSTR { FIXME( "(%s,%s,%s,%s,%s,%p): stub\n", ObjUuid, Protseq, NetworkAddr, Endpoint, Options, StringBinding ); *StringBinding = NULL; - + return RPC_S_INVALID_STRING_UUID; /* Failure */ } @@ -520,7 +520,7 @@ RPC_STATUS WINAPI RpcStringBindingComposeW( LPWSTR ObjUuid, LPWSTR Protseq, LPWS FIXME( "(%s,%s,%s,%s,%s,%p): stub\n", debugstr_w( ObjUuid ), debugstr_w( Protseq ), debugstr_w( NetworkAddr ), debugstr_w( Endpoint ), debugstr_w( Options ), StringBinding ); *StringBinding = NULL; - + return RPC_S_INVALID_STRING_UUID; /* Failure */ } @@ -538,10 +538,10 @@ RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE* Binding) RPC_STATUS WINAPI RpcBindingFromStringBindingA( LPSTR StringBinding, RPC_BINDING_HANDLE* Binding ) { FIXME( "(%s,%p): stub\n", StringBinding, Binding ); - + return RPC_S_INVALID_STRING_BINDING; /* As good as any failure code */ } - + /*********************************************************************** * RpcBindingFromStringBindingW (RPCRT4.@) */ @@ -565,12 +565,12 @@ HRESULT WINAPI NdrDllCanUnloadNow(CStdPSFactoryBuffer *pPSFactoryBuffer) * NdrDllGetClassObject (RPCRT4.@) */ HRESULT WINAPI NdrDllGetClassObject( - REFCLSID rclsid, REFIID riid , LPVOID *ppv, + REFCLSID rclsid, REFIID riid , LPVOID *ppv, const ProxyFileInfo ** pProxyFileList, const CLSID * pclsid, CStdPSFactoryBuffer * pPSFactoryBuffer) { - if(ppv) + if(ppv) *ppv = NULL; return RPC_S_UNKNOWN_IF; } diff --git a/dlls/serialui/confdlg.c b/dlls/serialui/confdlg.c index dc226a1c6ff..3ff6caa3180 100644 --- a/dlls/serialui/confdlg.c +++ b/dlls/serialui/confdlg.c @@ -1,4 +1,4 @@ -/* +/* * This DLL contains the user interface for the serial driver. * a dialog box to configure the specified COMM port * an interface to the control panel (??) @@ -80,7 +80,7 @@ SERIALUI_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) * EnumPropPages (SERIALUI.2) * * Called by the device manager to add prop sheets in Control Panel ??? - * Pointed to in Win98 registry by + * Pointed to in Win98 registry by * \System\CurrentControlSet\Services\Class\ports\0000\EnumPropPages = * "serialui.dll,EnumPropPages" */ @@ -119,7 +119,7 @@ static PARAM2STRDATA SERIALUI_Baud2StrData[]={ }; static PARAM2STR SERIALUI_Baud2Str={ SERIALUI_TABLESIZE(SERIALUI_Baud2StrData),SERIALUI_Baud2StrData }; -static PARAM2STRDATA SERIALUI_Parity2StrData[]={ +static PARAM2STRDATA SERIALUI_Parity2StrData[]={ {NOPARITY,"None"}, {ODDPARITY,"Odd"}, {EVENPARITY,"Even"}, {MARKPARITY,"Mark"}, {SPACEPARITY,"Space"} }; @@ -288,10 +288,10 @@ static void SERIALUI_DialogInfoToDCB(HWND hDlg, SERIALUI_DialogInfo *info) SERIALUI_GetConfItems( hDlg, IDC_PARITY, &SERIALUI_Parity2Str, &dwParity); SERIALUI_GetConfItems( hDlg, IDC_DATA, &SERIALUI_Data2Str, &dwByteSize); SERIALUI_GetConfItems( hDlg, IDC_FLOW, &SERIALUI_Flow2Str, &dwFlowControl ); - + TRACE("baud=%ld stop=%ld parity=%ld data=%ld flow=%ld\n", dwBaudRate, dwStopBits, dwParity, dwByteSize, dwFlowControl); - + lpdcb->BaudRate = dwBaudRate; lpdcb->StopBits = dwStopBits; lpdcb->Parity = dwParity; @@ -375,7 +375,7 @@ BOOL WINAPI SERIALUI_ConfigDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA case ID_GETDEFAULT: { DWORD r,dwConfSize = sizeof (COMMCONFIG); - r = GetDefaultCommConfigA(info->lpszDevice, + r = GetDefaultCommConfigA(info->lpszDevice, info->lpCommConfig, &dwConfSize); if(!r) MessageBoxA(hWnd,"Failed","GetDefaultCommConfig",MB_OK); @@ -386,7 +386,7 @@ BOOL WINAPI SERIALUI_ConfigDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA { DWORD r; SERIALUI_DialogInfoToDCB(hWnd,info); - r = SetDefaultCommConfigA(info->lpszDevice, + r = SetDefaultCommConfigA(info->lpszDevice, info->lpCommConfig, sizeof (COMMCONFIG)); if(!r) MessageBoxA(hWnd,"Failed","GetDefaultCommConfig",MB_OK); @@ -406,8 +406,8 @@ BOOL WINAPI SERIALUI_ConfigDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA * Used by Win9x KERNEL to show a dialog for configuring a COMM port. */ BOOL WINAPI SERIALUI_CommConfigDialog( - LPCSTR lpszName, - HWND hWndParent, + LPCSTR lpszName, + HWND hWndParent, LPCOMMCONFIG lpCommConfig ) { SERIALUI_DialogInfo info; @@ -422,7 +422,7 @@ BOOL WINAPI SERIALUI_CommConfigDialog( return DialogBoxParamA(SERIALUI_hModule, MAKEINTRESOURCEA(IDD_SERIALUICONFIG), - hWndParent, + hWndParent, (DLGPROC) SERIALUI_ConfigDialogProc, (LPARAM)&info); } @@ -438,7 +438,7 @@ static LPCSTR lpszDCB = "DCB"; * the comm port name. */ BOOL WINAPI SERIALUI_SetDefaultCommConfig( - LPCSTR lpszDevice, + LPCSTR lpszDevice, LPCOMMCONFIG lpCommConfig, DWORD dwSize ) { @@ -482,7 +482,7 @@ BOOL WINAPI SERIALUI_SetDefaultCommConfig( * the comm port name. */ BOOL WINAPI SERIALUI_GetDefaultCommConfig( - LPCSTR lpszDevice, + LPCSTR lpszDevice, LPCOMMCONFIG lpCommConfig, LPDWORD lpdwSize ) { @@ -522,13 +522,13 @@ BOOL WINAPI SERIALUI_GetDefaultCommConfig( r = 1; if ((r==ERROR_SUCCESS) && (dwSize != sizeof(DCB))) r = 1; - + RegCloseKey(hKeyPort); } else { /* FIXME: default to a hardcoded commconfig */ - + lpCommConfig->dcb.DCBlength = sizeof(DCB); lpCommConfig->dcb.BaudRate = 9600; lpCommConfig->dcb.fBinary = TRUE; diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 800ea229f8e..a4aefea9a32 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -47,9 +47,9 @@ RETERR16 WINAPI DiGetClassDevs16(LPLPDEVICE_INFO16 lplpdi, BOOL WINAPI SetupDiGetDeviceInterfaceDetailA( HDEVINFO DeviceInfoSet, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, - PSP_DEVICE_INTERFACE_DETAIL_DATAA DeviceInterfaceDetailData, + PSP_DEVICE_INTERFACE_DETAIL_DATAA DeviceInterfaceDetailData, DWORD DeviceInterfaceDetailDataSize, - PDWORD RequiredSize, + PDWORD RequiredSize, PSP_DEVINFO_DATA DeviceInfoData ) { FIXME("\n"); @@ -59,9 +59,9 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA( BOOL WINAPI SetupDiGetDeviceInterfaceDetailW( HDEVINFO DeviceInfoSet, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, - PSP_DEVICE_INTERFACE_DETAIL_DATAW DeviceInterfaceDetailData, + PSP_DEVICE_INTERFACE_DETAIL_DATAW DeviceInterfaceDetailData, DWORD DeviceInterfaceDetailDataSize, - PDWORD RequiredSize, + PDWORD RequiredSize, PSP_DEVINFO_DATA DeviceInfoData ) { FIXME("\n"); @@ -70,7 +70,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW( BOOL WINAPI SetupDiEnumDeviceInterfaces( HDEVINFO DeviceInfoSet, - PSP_DEVINFO_DATA DeviceInfoData, + PSP_DEVINFO_DATA DeviceInfoData, CONST GUID * InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) @@ -120,7 +120,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyA( DWORD PropertyBufferSize, PDWORD RequiredSize) { - FIXME("%04lx %p %ld %p %p %ld %p\n", (DWORD)devinfo, DeviceInfoData, + FIXME("%04lx %p %ld %p %p %ld %p\n", (DWORD)devinfo, DeviceInfoData, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize); return FALSE; diff --git a/dlls/setupapi/infparse.c b/dlls/setupapi/infparse.c index e2032659a04..bef5153e3e2 100644 --- a/dlls/setupapi/infparse.c +++ b/dlls/setupapi/infparse.c @@ -208,7 +208,7 @@ BOOL IP_FindInf(HINF16 hInf, WORD *ret) } return FALSE; } - + LPCSTR IP_GetFileName(HINF16 hInf) { diff --git a/dlls/setupapi/setupx16.h b/dlls/setupapi/setupx16.h index e1946a43fc0..a301d196a77 100644 --- a/dlls/setupapi/setupx16.h +++ b/dlls/setupapi/setupx16.h @@ -82,7 +82,7 @@ typedef struct { VCPPROGRESS prgFileWrite; VCPPROGRESS prgByteWrite; -} VCPDISKINFO, *LPVCPDISKINFO; +} VCPDISKINFO, *LPVCPDISKINFO; typedef struct { LOGDISKID16 ldid; diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c index 7bd1e710a3c..fd4117b572b 100644 --- a/dlls/setupapi/stubs.c +++ b/dlls/setupapi/stubs.c @@ -39,7 +39,7 @@ BOOL WINAPI SetupIterateCabinetA(PCSTR CabinetFile, DWORD Reserved, * SetupIterateCabinetW (SETUPAPI.@) */ BOOL WINAPI SetupIterateCabinetW(PWSTR CabinetFile, DWORD Reserved, - PSP_FILE_CALLBACK_W MsgHandler, PVOID Context) + PSP_FILE_CALLBACK_W MsgHandler, PVOID Context) { FIXME("not implemented (setupapi.dll) \n"); return 0; diff --git a/dlls/setupapi/virtcopy.c b/dlls/setupapi/virtcopy.c index 4fbcc3e5ed7..597ae10f406 100644 --- a/dlls/setupapi/virtcopy.c +++ b/dlls/setupapi/virtcopy.c @@ -155,7 +155,7 @@ VHSTR WINAPI vsmStringFind16(LPCSTR lpszName) /*********************************************************************** * vsmGetStringName (SETUPX.205) - * + * * Pretty correct, I guess */ INT16 WINAPI vsmGetStringName16(VHSTR vhstr, LPSTR lpszBuffer, int cbBuffer) @@ -206,7 +206,7 @@ RETERR16 VCP_VirtnodeCreate(LPVCPFILESPEC vfsSrc, LPVCPFILESPEC vfsDst, WORD fl, while (vn_last < vn_num) { if (pvnlist[vn_last] == NULL) - break; + break; vn_last++; } heap = GetProcessHeap(); @@ -219,7 +219,7 @@ RETERR16 VCP_VirtnodeCreate(LPVCPFILESPEC vfsSrc, LPVCPFILESPEC vfsDst, WORD fl, pvnlist[vn_last] = HeapAlloc(heap, HEAP_ZERO_MEMORY, sizeof(VIRTNODE)); lpvn = pvnlist[vn_last]; vn_last++; - + lpvn->cbSize = sizeof(VIRTNODE); if (vfsSrc) @@ -292,7 +292,7 @@ RETERR16 WINAPI VcpOpen16(VIFPROC vifproc, LPARAM lparamMsgRef) /*********************************************************************** * VcpQueueCopy [SETUPX.13] - * + * * lpExpandVtbl seems to be deprecated. * fl are the CNFL_xxx and VNFL_xxx flags. * lParam are the VNLP_xxx flags. @@ -310,7 +310,7 @@ RETERR16 WINAPI VcpQueueCopy16( if (!VCP_opened) return ERR_VCP_NOTOPEN; - TRACE("srcdir: %s, srcfile: %s, dstdir: %s, dstfile: %s\n", + TRACE("srcdir: %s, srcfile: %s, dstdir: %s, dstfile: %s\n", lpszSrcDir, lpszSrcFileName, lpszDstDir, lpszDstFileName); TRACE("ldidSrc == %d, ldidDst == %d\n", ldidSrc, ldidDst); @@ -354,7 +354,7 @@ RETERR16 WINAPI VcpQueueDelete16( /*********************************************************************** * VcpQueueRename [SETUPX.204] - * + * */ RETERR16 WINAPI VcpQueueRename16( LPCSTR lpszSrcFileName, LPCSTR lpszDstFileName, @@ -478,7 +478,7 @@ RETERR16 VCP_CopyFiles(void) vcp_status.prgFileWrite.dwSoFar++; cbres = VCP_CALLBACK(&vcp_status, VCPM_VSTATWRITE, 0, 0, VCP_MsgRef); } - + cbres = VCP_CALLBACK(&vcp_status, VCPM_VSTATCOPYEND, 0, 0, VCP_MsgRef); return res; } @@ -511,7 +511,7 @@ RETERR16 WINAPI VcpClose16(WORD fl, LPCSTR lpszBackupDest) /* FIXME: needs to sort virtnodes in case VCPFL_INSPECIFIEDORDER * is not set. This is done by VCP_CALLBACK(VCPM_NODECOMPARE) */ - + TRACE("#1\n"); memset(&vcp_status, 0, sizeof(VCPSTATUS)); /* yes, vcp_status.cbSize is 0 ! */ @@ -524,7 +524,7 @@ RETERR16 WINAPI VcpClose16(WORD fl, LPCSTR lpszBackupDest) if (res != OK) return res; /* is this ok ? */ VCP_CopyFiles(); - + TRACE("#5\n"); cbres = VCP_CALLBACK(&vcp_status, VCPM_VSTATCLOSEEND, 0, 0, VCP_MsgRef); TRACE("#6\n"); @@ -637,7 +637,7 @@ void VCP_UI_RegisterProgressClass(void) wndClass.hCursor = LoadCursorA (0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)NULL; wndClass.lpszClassName = "setupx_progress"; - + RegisterClassA (&wndClass); } @@ -701,7 +701,7 @@ RETERR16 VCP_UI_CopyStart(void) if (RegSetValueExA(hKeyConflict, "BackupDirectory", 0, REG_SZ, (LPBYTE)buf, strlen(buf)+1)) return VCPN_FAIL; RegCloseKey(hKeyConflict); - + return VCPN_OK; } diff --git a/dlls/shdocvw/classinfo.c b/dlls/shdocvw/classinfo.c index 68b53b8b3c5..6aa2a7a3619 100644 --- a/dlls/shdocvw/classinfo.c +++ b/dlls/shdocvw/classinfo.c @@ -70,7 +70,7 @@ static HRESULT WINAPI WBPCI_GetClassInfo(LPPROVIDECLASSINFO iface, LPTYPEINFO *p * IProvideClassInfo virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IProvideClassInfo) WBPCI_Vtbl = +static ICOM_VTABLE(IProvideClassInfo) WBPCI_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBPCI_QueryInterface, @@ -155,7 +155,7 @@ static HRESULT WINAPI WBPCI2_GetGUID(LPPROVIDECLASSINFO2 iface, * IProvideClassInfo virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IProvideClassInfo2) WBPCI2_Vtbl = +static ICOM_VTABLE(IProvideClassInfo2) WBPCI2_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBPCI2_QueryInterface, diff --git a/dlls/shdocvw/events.c b/dlls/shdocvw/events.c index 965c50e797f..b85583e36f3 100644 --- a/dlls/shdocvw/events.c +++ b/dlls/shdocvw/events.c @@ -100,7 +100,7 @@ static HRESULT WINAPI WBCPC_FindConnectionPoint(LPCONNECTIONPOINTCONTAINER iface * IConnectionPointContainer virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IConnectionPointContainer) WBCPC_Vtbl = +static ICOM_VTABLE(IConnectionPointContainer) WBCPC_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBCPC_QueryInterface, @@ -195,7 +195,7 @@ static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface, * IConnectionPoint virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IConnectionPoint) WBCP_Vtbl = +static ICOM_VTABLE(IConnectionPoint) WBCP_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBCP_QueryInterface, diff --git a/dlls/shdocvw/factory.c b/dlls/shdocvw/factory.c index 233f6b94616..f29ec17a2bc 100644 --- a/dlls/shdocvw/factory.c +++ b/dlls/shdocvw/factory.c @@ -109,7 +109,7 @@ static HRESULT WINAPI WBCF_LockServer(LPCLASSFACTORY iface, BOOL dolock) return S_OK; } -static ICOM_VTABLE(IClassFactory) WBCF_Vtbl = +static ICOM_VTABLE(IClassFactory) WBCF_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBCF_QueryInterface, diff --git a/dlls/shdocvw/misc.c b/dlls/shdocvw/misc.c index 6f374173f64..e16a34c1bb9 100644 --- a/dlls/shdocvw/misc.c +++ b/dlls/shdocvw/misc.c @@ -80,7 +80,7 @@ static HRESULT WINAPI WBQA_GetContentExtent(LPQUICKACTIVATE iface, LPSIZEL pSize * IQuickActivate virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IQuickActivate) WBQA_Vtbl = +static ICOM_VTABLE(IQuickActivate) WBQA_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBQA_QueryInterface, diff --git a/dlls/shdocvw/oleobject.c b/dlls/shdocvw/oleobject.c index 482dd0b82e9..d7db11a995c 100644 --- a/dlls/shdocvw/oleobject.c +++ b/dlls/shdocvw/oleobject.c @@ -410,7 +410,7 @@ static HRESULT WINAPI WBOOBJ_SetColorScheme(LPOLEOBJECT iface, * IOleObject virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IOleObject) WBOOBJ_Vtbl = +static ICOM_VTABLE(IOleObject) WBOOBJ_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBOOBJ_QueryInterface, @@ -528,7 +528,7 @@ static HRESULT WINAPI WBOIPO_ReactivateAndUndo(LPOLEINPLACEOBJECT iface) * IOleInPlaceObject virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IOleInPlaceObject) WBOIPO_Vtbl = +static ICOM_VTABLE(IOleInPlaceObject) WBOIPO_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBOIPO_QueryInterface, @@ -603,7 +603,7 @@ static HRESULT WINAPI WBOC_FreezeEvents(LPOLECONTROL iface, BOOL bFreeze) * IOleControl virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IOleControl) WBOC_Vtbl = +static ICOM_VTABLE(IOleControl) WBOC_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBOC_QueryInterface, diff --git a/dlls/shdocvw/persist.c b/dlls/shdocvw/persist.c index 5c1879102f5..b0cabe501da 100644 --- a/dlls/shdocvw/persist.c +++ b/dlls/shdocvw/persist.c @@ -94,7 +94,7 @@ static HRESULT WINAPI WBPS_SaveCompleted(LPPERSISTSTORAGE iface, LPSTORAGE pStgN * IPersistStorage virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IPersistStorage) WBPS_Vtbl = +static ICOM_VTABLE(IPersistStorage) WBPS_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBPS_QueryInterface, @@ -183,7 +183,7 @@ static HRESULT WINAPI WBPSI_InitNew(LPPERSISTSTREAMINIT iface) * IPersistStreamInit virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IPersistStreamInit) WBPSI_Vtbl = +static ICOM_VTABLE(IPersistStreamInit) WBPSI_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WBPSI_QueryInterface, diff --git a/dlls/shdocvw/webbrowser.c b/dlls/shdocvw/webbrowser.c index 919c7489606..5d9dcf4e720 100644 --- a/dlls/shdocvw/webbrowser.c +++ b/dlls/shdocvw/webbrowser.c @@ -241,7 +241,7 @@ static HRESULT WINAPI WB_get_Busy(LPWEBBROWSER iface, VARIANT *pBool) * IWebBrowser virtual function table for IE Web Browser component */ -static ICOM_VTABLE(IWebBrowser) WB_Vtbl = +static ICOM_VTABLE(IWebBrowser) WB_Vtbl = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE WB_QueryInterface, diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index cd98e431609..d0636ff42e3 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -43,7 +43,7 @@ static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root) hwndTreeView = GetDlgItem (hwndParent, IDD_TREEVIEW); Shell_GetImageList(NULL, &hImageList); - + TRACE("dlg=%x tree=%x\n", hwndParent, hwndTreeView ); if (hImageList && hwndTreeView) @@ -71,7 +71,7 @@ static void InitializeTreeView(HWND hwndParent, LPCITEMIDLIST root) { TreeView_DeleteAllItems(hwndTreeView); FillTreeView(lpsf, NULL, TVI_ROOT); } - + if (SUCCEEDED(hr)) { IShellFolder_Release(lpsf); } @@ -192,32 +192,32 @@ Done: } static LRESULT MsgNotify(HWND hWnd, UINT CtlID, LPNMHDR lpnmh) -{ +{ NMTREEVIEWA *pnmtv = (NMTREEVIEWA *)lpnmh; LPTV_ITEMDATA lptvid; /* Long pointer to TreeView item data */ IShellFolder * lpsf2=0; - + TRACE("%x %x %p msg=%x\n", hWnd, CtlID, lpnmh, pnmtv->hdr.code); switch (pnmtv->hdr.idFrom) { case IDD_TREEVIEW: - switch (pnmtv->hdr.code) + switch (pnmtv->hdr.code) { case TVN_DELETEITEMA: case TVN_DELETEITEMW: { FIXME("TVN_DELETEITEMA/W\n"); lptvid=(LPTV_ITEMDATA)pnmtv->itemOld.lParam; IShellFolder_Release(lptvid->lpsfParent); - SHFree(lptvid->lpi); - SHFree(lptvid->lpifq); - SHFree(lptvid); + SHFree(lptvid->lpi); + SHFree(lptvid->lpifq); + SHFree(lptvid); } break; - + case TVN_ITEMEXPANDINGA: case TVN_ITEMEXPANDINGW: { FIXME("TVN_ITEMEXPANDINGA/W\n"); if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE)) break; - + lptvid=(LPTV_ITEMDATA)pnmtv->itemNew.lParam; if (SUCCEEDED(IShellFolder_BindToObject(lptvid->lpsfParent, lptvid->lpi,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2))) { FillTreeView( lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem ); @@ -282,7 +282,7 @@ static BOOL WINAPI BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, case WM_NOTIFY: MsgNotify( hWnd, (UINT)wParam, (LPNMHDR)lParam); break; - + case WM_COMMAND: switch (wParam) { case IDOK: @@ -332,11 +332,11 @@ static BOOL WINAPI BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, */ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi) { - TRACE("(%p{lpszTitle=%s,owner=%i})\n", + TRACE("(%p{lpszTitle=%s,owner=%i})\n", lpbi, debugstr_a(lpbi->lpszTitle), lpbi->hwndOwner); return (LPITEMIDLIST) DialogBoxParamA( shell32_hInstance, - "SHBRSFORFOLDER_MSGBOX", + "SHBRSFORFOLDER_MSGBOX", lpbi->hwndOwner, BrsFolderDlgProc, (INT)lpbi ); } diff --git a/dlls/shell32/changenotify.c b/dlls/shell32/changenotify.c index bd5809a70a1..f2d9c62903e 100644 --- a/dlls/shell32/changenotify.c +++ b/dlls/shell32/changenotify.c @@ -62,13 +62,13 @@ void FreeChangeNotifications() ptr = head.next; while(ptr != &tail) - { + { int i; item = ptr; ptr = ptr->next; TRACE("item=%p\n", item); - + /* free the item */ for (i=0; icidl;i++) SHFree(item->apidl[i].pidlPath); SHFree(item->apidl); @@ -85,7 +85,7 @@ void FreeChangeNotifications() static BOOL AddNode(LPNOTIFICATIONLIST item) { LPNOTIFICATIONLIST last; - + EnterCriticalSection(&SHELL32_ChangenotifyCS); /* get last entry */ @@ -114,13 +114,13 @@ static BOOL DeleteNode(LPNOTIFICATIONLIST item) ptr = head.next; while((ptr != &tail) && (ret == FALSE)) - { + { TRACE("ptr=%p\n", ptr); - + if (ptr == item) { int i; - + TRACE("item=%p prev=%p next=%p\n", item, item->prev, item->next); /* remove item from list */ @@ -135,10 +135,10 @@ static BOOL DeleteNode(LPNOTIFICATIONLIST item) } ptr = ptr->next; } - + LeaveCriticalSection(&SHELL32_ChangenotifyCS); return ret; - + } /************************************************************************* @@ -161,7 +161,7 @@ SHChangeNotifyRegister( TRACE("(0x%04x,0x%08lx,0x%08lx,0x%08lx,0x%08x,%p) item=%p\n", hwnd,dwFlags,wEventMask,uMsg,cItems,lpItems,item); - + item->next = NULL; item->prev = NULL; item->cidl = cItems; @@ -188,7 +188,7 @@ SHChangeNotifyDeregister( { TRACE("(0x%08x)\n",hNotify); - return DeleteNode((LPNOTIFICATIONLIST)hNotify);; + return DeleteNode((LPNOTIFICATIONLIST)hNotify); } /************************************************************************* @@ -211,7 +211,7 @@ void WINAPI SHChangeNotifyW (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVO { LPITEMIDLIST pidl1=(LPITEMIDLIST)dwItem1, pidl2=(LPITEMIDLIST)dwItem2; LPNOTIFICATIONLIST ptr; - + TRACE("(0x%08lx,0x%08x,%p,%p):stub.\n", wEventId,uFlags,dwItem1,dwItem2); /* convert paths in IDLists*/ @@ -221,15 +221,15 @@ void WINAPI SHChangeNotifyW (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVO if (dwItem1) SHILCreateFromPathA((LPCSTR)dwItem1, &pidl1, &dummy); if (dwItem2) SHILCreateFromPathA((LPCSTR)dwItem2, &pidl2, &dummy); } - + EnterCriticalSection(&SHELL32_ChangenotifyCS); - + /* loop through the list */ ptr = head.next; while(ptr != &tail) { TRACE("trying %p\n", ptr); - + if(wEventId & ptr->wEventMask) { TRACE("notifying\n"); @@ -237,7 +237,7 @@ void WINAPI SHChangeNotifyW (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVO } ptr = ptr->next; } - + LeaveCriticalSection(&SHELL32_ChangenotifyCS); if(uFlags & SHCNF_PATHA) @@ -254,7 +254,7 @@ void WINAPI SHChangeNotifyA (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVO { LPITEMIDLIST Pidls[2]; LPNOTIFICATIONLIST ptr; - + Pidls[0] = (LPITEMIDLIST)dwItem1; Pidls[1] = (LPITEMIDLIST)dwItem2; @@ -267,15 +267,15 @@ void WINAPI SHChangeNotifyA (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVO if (Pidls[0]) SHILCreateFromPathA((LPCSTR)dwItem1, &Pidls[0], &dummy); if (Pidls[1]) SHILCreateFromPathA((LPCSTR)dwItem2, &Pidls[1], &dummy); } - + EnterCriticalSection(&SHELL32_ChangenotifyCS); - + /* loop through the list */ ptr = head.next; while(ptr != &tail) { TRACE("trying %p\n", ptr); - + if(wEventId & ptr->wEventMask) { TRACE("notifying\n"); @@ -283,7 +283,7 @@ void WINAPI SHChangeNotifyA (LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVO } ptr = ptr->next; } - + LeaveCriticalSection(&SHELL32_ChangenotifyCS); /* if we allocated it, free it */ diff --git a/dlls/shell32/classes.c b/dlls/shell32/classes.c index 8438be744df..9f1af168c19 100644 --- a/dlls/shell32/classes.c +++ b/dlls/shell32/classes.c @@ -1,5 +1,5 @@ /* - * file type mapping + * file type mapping * (HKEY_CLASSES_ROOT - Stuff) * * Copyright 1998, 1999, 2000 Juergen Schmied @@ -50,7 +50,7 @@ BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL strcpy(szTemp, "."); lstrcpynA(szTemp+((bPrependDot)?1:0), szExtension, MAX_EXTENSION_LENGTH); - + if (RegOpenKeyExA(HKEY_CLASSES_ROOT,szTemp,0,0x02000000,&hkey)) { return FALSE; } @@ -58,7 +58,7 @@ BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL if (RegQueryValueA(hkey,NULL,szFileType,&len)) { RegCloseKey(hkey); return FALSE; - } + } RegCloseKey(hkey); @@ -72,7 +72,7 @@ BOOL HCR_GetExecuteCommand ( LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD char sTemp[MAX_PATH]; DWORD dwType; BOOL ret = FALSE; - + TRACE("%s %s\n",szClass, szVerb ); sprintf(sTemp, "%s\\shell\\%s\\command",szClass, szVerb); @@ -125,7 +125,7 @@ BOOL HCR_GetDefaultIcon (LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr) *dwNr=0; /* sometimes the icon number is missing */ ParseFieldA (szDest, 1, szDest, len); ret = TRUE; - } + } RegCloseKey(hkey); } TRACE("-- %s %li\n", szDest, *dwNr ); @@ -161,7 +161,7 @@ BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len) } if (!ret || !szDest[0]) - { + { if(IsEqualIID(riid, &CLSID_ShellDesktop)) { if (LoadStringA(shell32_hInstance, IDS_DESKTOP, szDest, buflen)) @@ -171,7 +171,7 @@ BOOL HCR_GetClassName (REFIID riid, LPSTR szDest, DWORD len) { if(LoadStringA(shell32_hInstance, IDS_MYCOMPUTER, szDest, buflen)) ret = TRUE; - } + } } TRACE("-- %s\n", szDest); @@ -201,7 +201,7 @@ BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest) if (!szDest) return FALSE; *szDest = SFGAO_FOLDER|SFGAO_FILESYSTEM; - + strcat (xriid, "\\ShellFolder"); if (RegOpenKeyExA(HKEY_CLASSES_ROOT,xriid,0,KEY_READ,&hkey)) @@ -224,7 +224,7 @@ BOOL HCR_GetFolderAttributes (REFIID riid, LPDWORD szDest) return TRUE; } -typedef struct +typedef struct { ICOM_VFIELD(IQueryAssociations); DWORD ref; } IQueryAssociationsImpl; @@ -262,7 +262,7 @@ static HRESULT WINAPI IQueryAssociations_fnQueryInterface( if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ { - *ppvObj = This; + *ppvObj = This; } else if(IsEqualIID(riid, &IID_IQueryAssociations)) /*IExtractIcon*/ { @@ -271,7 +271,7 @@ static HRESULT WINAPI IQueryAssociations_fnQueryInterface( if(*ppvObj) { - IQueryAssociations_AddRef((IQueryAssociations*) *ppvObj); + IQueryAssociations_AddRef((IQueryAssociations*) *ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } @@ -303,7 +303,7 @@ static ULONG WINAPI IQueryAssociations_fnRelease(IQueryAssociations * iface) shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying IExtractIcon(%p)\n",This); HeapFree(GetProcessHeap(),0,This); @@ -364,14 +364,14 @@ static HRESULT WINAPI IQueryAssociations_fnGetEnum( return E_NOTIMPL; } -static struct ICOM_VTABLE(IQueryAssociations) qavt = -{ +static struct ICOM_VTABLE(IQueryAssociations) qavt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IQueryAssociations_fnQueryInterface, IQueryAssociations_fnAddRef, IQueryAssociations_fnRelease, IQueryAssociations_fnInit, - IQueryAssociations_fnGetString, + IQueryAssociations_fnGetString, IQueryAssociations_fnGetKey, IQueryAssociations_fnGetData, IQueryAssociations_fnGetEnum diff --git a/dlls/shell32/clipboard.c b/dlls/shell32/clipboard.c index 0f93089a649..ad741789fe6 100644 --- a/dlls/shell32/clipboard.c +++ b/dlls/shell32/clipboard.c @@ -53,7 +53,7 @@ static HINSTANCE hShellOle32 = 0; /************************************************************************** * InitShellOle * - * + * */ void InitShellOle(void) { @@ -115,7 +115,7 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) HGLOBAL hGlobal; DROPFILES *pDropFiles; int offset; - + TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl); /* get the size needed */ @@ -124,7 +124,7 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) SHGetPathFromIDListA(pidlRoot, szRootPath); PathAddBackslashA(szRootPath); rootsize = strlen(szRootPath); - + for (i=0; ipFiles; strcpy(szFileName, szRootPath); - + for (i=0; icidl = cidl; @@ -223,7 +223,7 @@ HGLOBAL RenderFILENAME (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) int len, size = 0; char szTemp[MAX_PATH], *szFileName; HGLOBAL hGlobal; - + TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl); /* build name of first file */ @@ -245,7 +245,7 @@ HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags) { DWORD * pdwFlag; HGLOBAL hGlobal; - + TRACE("(0x%08lx)\n", dwFlags); hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD)); @@ -264,7 +264,7 @@ HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags) BOOL IsDataInClipboard (HWND hwnd) { BOOL ret = FALSE; - + if (OpenClipboard(hwnd)) { if (GetOpenClipboardWindow()) diff --git a/dlls/shell32/control.c b/dlls/shell32/control.c index 841c0de8c48..46eb8cb0c25 100644 --- a/dlls/shell32/control.c +++ b/dlls/shell32/control.c @@ -36,7 +36,7 @@ typedef struct CPlApplet { unsigned count; /* number of subprograms */ HMODULE hModule; /* module of loaded applet */ APPLET_PROC proc; /* entry point address */ - NEWCPLINFOA info[1]; /* array of count information. + NEWCPLINFOA info[1]; /* array of count information. * dwSize field is 0 if entry is invalid */ } CPlApplet; @@ -92,9 +92,9 @@ static CPlApplet* Control_LoadApplet(HWND hWnd, LPCSTR cmd, CPanel* panel) goto theError; } - applet = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet, + applet = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet, sizeof(*applet) + (applet->count - 1) * sizeof(NEWCPLINFOA)); - + for (i = 0; i < applet->count; i++) { applet->info[i].dwSize = sizeof(NEWCPLINFOA); /* proc is supposed to return a null value upon success for @@ -113,11 +113,11 @@ static CPlApplet* Control_LoadApplet(HWND hWnd, LPCSTR cmd, CPanel* panel) applet->info[i].dwFlags = 0; applet->info[i].dwHelpContext = 0; applet->info[i].lData = info.lData; - applet->info[i].hIcon = LoadIconA(applet->hModule, + applet->info[i].hIcon = LoadIconA(applet->hModule, MAKEINTRESOURCEA(info.idIcon)); - LoadStringA(applet->hModule, info.idName, + LoadStringA(applet->hModule, info.idName, applet->info[i].szName, sizeof(applet->info[i].szName)); - LoadStringA(applet->hModule, info.idInfo, + LoadStringA(applet->hModule, info.idInfo, applet->info[i].szInfo, sizeof(applet->info[i].szInfo)); applet->info[i].szHelpFile[0] = '\0'; } @@ -154,7 +154,7 @@ static BOOL Control_Localize(const CPanel* panel, unsigned cx, unsigned cy, unsigned i, x = (XSTEP-XICON)/2, y = 0; CPlApplet* applet; RECT rc; - + GetClientRect(panel->hWnd, &rc); for (applet = panel->first; applet; applet = applet = applet->next) { for (i = 0; i < applet->count; i++) { @@ -198,7 +198,7 @@ static LRESULT Control_WndProc_Paint(const CPanel* panel, WPARAM wParam) txtRect.right = x + XSTEP; txtRect.top = y + YICON; txtRect.bottom = y + YSTEP; - DrawTextA(hdc, applet->info[i].szName, -1, &txtRect, + DrawTextA(hdc, applet->info[i].szName, -1, &txtRect, DT_CENTER | DT_VCENTER); x += XSTEP; } @@ -212,7 +212,7 @@ static LRESULT Control_WndProc_LButton(CPanel* panel, LPARAM lParam, BOOL up) { unsigned i; CPlApplet* applet; - + if (Control_Localize(panel, LOWORD(lParam), HIWORD(lParam), &applet, &i)) { if (up) { if (panel->clkApplet == applet && panel->clkSP == i) { @@ -226,7 +226,7 @@ static LRESULT Control_WndProc_LButton(CPanel* panel, LPARAM lParam, BOOL up) return 0; } -static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, +static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lParam2) { CPanel* panel = (CPanel*)GetWindowLongA(hWnd, 0); @@ -271,10 +271,10 @@ static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst) if (!RegisterClassA(&wc)) return; - CreateWindowExA(0, wc.lpszClassName, "Wine Control Panel", - WS_OVERLAPPEDWINDOW | WS_VISIBLE, - CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, + CreateWindowExA(0, wc.lpszClassName, "Wine Control Panel", + WS_OVERLAPPEDWINDOW | WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, hWnd, (HMENU)0, hInst, panel); if (!panel->hWnd) return; while (GetMessageA(&msg, panel->hWnd, 0, 0)) { @@ -369,7 +369,7 @@ void WINAPI Control_RunDLL(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdSho { CPanel panel; - TRACE("(0x%08x, 0x%08lx, %s, 0x%08lx)\n", + TRACE("(0x%08x, 0x%08lx, %s, 0x%08lx)\n", hWnd, (DWORD)hInst, debugstr_a(cmd), nCmdShow); memset(&panel, 0, sizeof(panel)); diff --git a/dlls/shell32/dataobject.c b/dlls/shell32/dataobject.c index a8071d9b0ba..514e9117cb1 100644 --- a/dlls/shell32/dataobject.c +++ b/dlls/shell32/dataobject.c @@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); * IEnumFORMATETC implementation */ -typedef struct +typedef struct { /* IUnknown fields */ ICOM_VFIELD(IEnumFORMATETC); @@ -53,7 +53,7 @@ static HRESULT WINAPI IEnumFORMATETC_fnSkip(LPENUMFORMATETC iface, ULONG celt); static HRESULT WINAPI IEnumFORMATETC_fnReset(LPENUMFORMATETC iface); static HRESULT WINAPI IEnumFORMATETC_fnClone(LPENUMFORMATETC iface, LPENUMFORMATETC* ppenum); -static struct ICOM_VTABLE(IEnumFORMATETC) efvt = +static struct ICOM_VTABLE(IEnumFORMATETC) efvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IEnumFORMATETC_fnQueryInterface, @@ -69,7 +69,7 @@ LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[]) { IEnumFORMATETCImpl* ef; DWORD size=cfmt * sizeof(FORMATETC); - + ef=(IEnumFORMATETCImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumFORMATETCImpl)); if(ef) @@ -101,12 +101,12 @@ static HRESULT WINAPI IEnumFORMATETC_fnQueryInterface(LPENUMFORMATETC iface, REF if(IsEqualIID(riid, &IID_IUnknown)) { - *ppvObj = This; + *ppvObj = This; } else if(IsEqualIID(riid, &IID_IEnumFORMATETC)) { *ppvObj = (IEnumFORMATETC*)This; - } + } if(*ppvObj) { @@ -134,7 +134,7 @@ static ULONG WINAPI IEnumFORMATETC_fnRelease(LPENUMFORMATETC iface) shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying IEnumFORMATETC(%p)\n",This); if (This->pFmt) @@ -249,7 +249,7 @@ LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPITEMIDLIST pMyPidl, LPITE shell32_ObjCount++; } - + TRACE("(%p)->(apidl=%p cidl=%u)\n",dto, apidl, cidl); return (LPDATAOBJECT)dto; } @@ -266,16 +266,16 @@ static HRESULT WINAPI IDataObject_fnQueryInterface(LPDATAOBJECT iface, REFIID ri if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ { - *ppvObj = This; + *ppvObj = This; } else if(IsEqualIID(riid, &IID_IDataObject)) /*IDataObject*/ { *ppvObj = (IDataObject*)This; - } + } if(*ppvObj) { - IUnknown_AddRef((IUnknown*)*ppvObj); + IUnknown_AddRef((IUnknown*)*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } @@ -306,7 +306,7 @@ static ULONG WINAPI IDataObject_fnRelease(LPDATAOBJECT iface) shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying IDataObject(%p)\n",This); _ILFreeaPidl(This->apidl, This->cidl); @@ -324,7 +324,7 @@ static HRESULT WINAPI IDataObject_fnGetData(LPDATAOBJECT iface, LPFORMATETC pfor ICOM_THIS(IDataObjectImpl,iface); char szTemp[256]; - + szTemp[0]=0; GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256); TRACE("(%p)->(%p %p format=%s)\n", This, pformatetcIn, pmedium, szTemp); @@ -369,9 +369,9 @@ static HRESULT WINAPI IDataObject_fnQueryGetData(LPDATAOBJECT iface, LPFORMATETC { ICOM_THIS(IDataObjectImpl,iface); UINT i; - + TRACE("(%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat, pformatetc->tymed); - + if(!(DVASPECT_CONTENT & pformatetc->dwAspect)) return DV_E_DVASPECT; @@ -415,7 +415,7 @@ static HRESULT WINAPI IDataObject_fnEnumFormatEtc(LPDATAOBJECT iface, DWORD dwDi *ppenumFormatEtc = IEnumFORMATETC_Constructor(MAX_FORMATS, This->pFormatEtc); return (*ppenumFormatEtc) ? S_OK : E_FAIL; } - + return E_NOTIMPL; } @@ -438,7 +438,7 @@ static HRESULT WINAPI IDataObject_fnEnumDAdvise(LPDATAOBJECT iface, IEnumSTATDAT return E_NOTIMPL; } -static struct ICOM_VTABLE(IDataObject) dtovt = +static struct ICOM_VTABLE(IDataObject) dtovt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDataObject_fnQueryInterface, diff --git a/dlls/shell32/debughlp.c b/dlls/shell32/debughlp.c index bd76951a7aa..bdb33edd9f3 100644 --- a/dlls/shell32/debughlp.c +++ b/dlls/shell32/debughlp.c @@ -136,17 +136,17 @@ REFIID _dbg_ILGetGUIDPointer(LPCITEMIDLIST pidl) DWORD _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize) { - DWORD dwReturn=0; + DWORD dwReturn=0; LPSTR szSrc; GUID const * riid; char szTemp[MAX_PATH]; - + if (!pidl) return 0; if (szOut) *szOut = 0; - if (_dbg_ILIsDesktop(pidl)) + if (_dbg_ILIsDesktop(pidl)) { /* desktop */ if (szOut) strncpy(szOut, "Desktop", uOutSize); @@ -191,7 +191,7 @@ void pdump (LPCITEMIDLIST pidl) { MESSAGE ("-------- pidl=%p\n", pidl); if (pidltemp->mkid.cb) - { + { do { DWORD dwAttrib = 0; diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 11b225f54b6..0452e49c3d6 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -33,7 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); /************************************************************************* * PickIconDlg [SHELL32.62] - * + * */ BOOL WINAPI PickIconDlg( HWND hwndOwner, diff --git a/dlls/shell32/enumidlist.c b/dlls/shell32/enumidlist.c index 77b81170717..7d61cc04178 100644 --- a/dlls/shell32/enumidlist.c +++ b/dlls/shell32/enumidlist.c @@ -84,7 +84,7 @@ static BOOL AddToEnumList( /*add the new item to the end of the list */ This->mpLast->pNext = pNew; } - + /*update the last item pointer */ This->mpLast = pNew; TRACE("-- (%p)->(first=%p, last=%p)\n",This,This->mpFirst,This->mpLast); @@ -104,7 +104,7 @@ static BOOL CreateFolderEnumList( ICOM_THIS(IEnumIDListImpl,iface); LPITEMIDLIST pidl=NULL; - WIN32_FIND_DATAA stffile; + WIN32_FIND_DATAA stffile; HANDLE hFile; CHAR szPath[MAX_PATH]; @@ -118,7 +118,7 @@ static BOOL CreateFolderEnumList( /*enumerate the folders*/ if(dwFlags & SHCONTF_FOLDERS) - { + { TRACE("-- (%p)-> enumerate SHCONTF_FOLDERS of %s\n",This,debugstr_a(szPath)); hFile = FindFirstFileA(szPath,&stffile); if ( hFile != INVALID_HANDLE_VALUE ) @@ -159,7 +159,7 @@ static BOOL CreateFolderEnumList( } } while( FindNextFileA(hFile,&stffile)); FindClose (hFile); - } + } } return TRUE; } @@ -181,7 +181,7 @@ static BOOL CreateDesktopEnumList( /*enumerate the root folders */ if(dwFlags & SHCONTF_FOLDERS) - { + { /*create the pidl for This item */ pidl = _ILCreateMyComputer(); if(pidl) @@ -216,7 +216,7 @@ static BOOL CreateDesktopEnumList( /*enumerate the elements in %windir%\desktop */ SHGetSpecialFolderPathA(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE); CreateFolderEnumList( (IEnumIDList*)This, szPath, dwFlags); - + return TRUE; } @@ -293,7 +293,7 @@ static BOOL DeleteList( LPENUMLIST pDelete; TRACE("(%p)->()\n",This); - + while(This->mpFirst) { pDelete = This->mpFirst; This->mpFirst = pDelete->pNext; @@ -315,7 +315,7 @@ IEnumIDList * IEnumIDList_Constructor( DWORD dwKind) { IEnumIDListImpl* lpeidl; - BOOL ret = FALSE; + BOOL ret = FALSE; lpeidl = (IEnumIDListImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumIDListImpl)); @@ -374,7 +374,7 @@ static HRESULT WINAPI IEnumIDList_fnQueryInterface( *ppvObj = NULL; if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = This; + { *ppvObj = This; } else if(IsEqualIID(riid, &IID_IEnumIDList)) /*IEnumIDList*/ { *ppvObj = (IEnumIDList*)This; @@ -385,7 +385,7 @@ static HRESULT WINAPI IEnumIDList_fnQueryInterface( TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } - + TRACE("-- Interface: E_NOINTERFACE\n"); return E_NOINTERFACE; } @@ -415,7 +415,7 @@ static ULONG WINAPI IEnumIDList_fnRelease( shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying IEnumIDList(%p)\n",This); DeleteList((IEnumIDList*)This); HeapFree(GetProcessHeap(),0,This); @@ -423,7 +423,7 @@ static ULONG WINAPI IEnumIDList_fnRelease( } return This->ref; } - + /************************************************************************** * IEnumIDList_fnNext */ @@ -432,7 +432,7 @@ static HRESULT WINAPI IEnumIDList_fnNext( IEnumIDList * iface, ULONG celt, LPITEMIDLIST * rgelt, - ULONG *pceltFetched) + ULONG *pceltFetched) { ICOM_THIS(IEnumIDListImpl,iface); @@ -449,7 +449,7 @@ static HRESULT WINAPI IEnumIDList_fnNext( *pceltFetched = 0; *rgelt=0; - + if(celt > 1 && !pceltFetched) { return E_INVALIDARG; } @@ -519,7 +519,7 @@ static HRESULT WINAPI IEnumIDList_fnClone( /************************************************************************** * IEnumIDList_fnVTable */ -static ICOM_VTABLE (IEnumIDList) eidlvt = +static ICOM_VTABLE (IEnumIDList) eidlvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IEnumIDList_fnQueryInterface, diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c index 2a1352e036c..a63fce60501 100644 --- a/dlls/shell32/folders.c +++ b/dlls/shell32/folders.c @@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); * IExtractIconA implementation */ -typedef struct +typedef struct { ICOM_VFIELD(IExtractIconA); DWORD ref; ICOM_VTABLE(IPersistFile)* lpvtblPersistFile; @@ -84,7 +84,7 @@ static HRESULT WINAPI IExtractIconA_fnQueryInterface( IExtractIconA * iface, REF *ppvObj = NULL; if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = This; + { *ppvObj = This; } else if(IsEqualIID(riid, &IID_IPersistFile)) /*IExtractIcon*/ { *ppvObj = (IPersistFile*)&(This->lpvtblPersistFile); @@ -94,7 +94,7 @@ static HRESULT WINAPI IExtractIconA_fnQueryInterface( IExtractIconA * iface, REF } if(*ppvObj) - { IExtractIconA_AddRef((IExtractIconA*) *ppvObj); + { IExtractIconA_AddRef((IExtractIconA*) *ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } @@ -126,7 +126,7 @@ static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface) shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying IExtractIcon(%p)\n",This); SHFree(This->pidl); HeapFree(GetProcessHeap(),0,This); @@ -153,7 +153,7 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation( DWORD dwNr; GUID const * riid; LPITEMIDLIST pSimplePidl = ILFindLastID(This->pidl); - + TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags); if (pwFlags) @@ -167,7 +167,7 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation( /* my computer and other shell extensions */ else if ( (riid = _ILGetGUIDPointer(pSimplePidl)) ) - { + { char xriid[50]; sprintf( xriid, "CLSID\\{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", riid->Data1, riid->Data2, riid->Data3, @@ -254,8 +254,8 @@ static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszF return S_OK; } -static struct ICOM_VTABLE(IExtractIconA) eivt = -{ +static struct ICOM_VTABLE(IExtractIconA) eivt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IExtractIconA_fnQueryInterface, IExtractIconA_fnAddRef, diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index 2189798362b..751265e6a30 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -71,7 +71,7 @@ static INT CALLBACK SIC_CompareEntries( LPVOID p1, LPVOID p2, LPARAM lparam) if (strcasecmp(((LPSIC_ENTRY)p1)->sSourceFile,((LPSIC_ENTRY)p2)->sSourceFile)) return 1; - return 0; + return 0; } /***************************************************************************** * SIC_IconAppend [internal] @@ -92,7 +92,7 @@ static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIc strcpy( lpsice->sSourceFile, path ); lpsice->dwSourceIndex = dwSourceIndex; - + EnterCriticalSection(&SHELL32_SicCS); index = pDPA_InsertPtr(sic_hdpa, 0x7fff, lpsice); @@ -115,7 +115,7 @@ static INT SIC_IconAppend (LPCSTR sSourceFile, INT dwSourceIndex, HICON hSmallIc } LeaveCriticalSection(&SHELL32_SicCS); - return ret; + return ret; } /**************************************************************************** * SIC_LoadIcon [internal] @@ -127,15 +127,15 @@ static INT SIC_LoadIcon (LPCSTR sSourceFile, INT dwSourceIndex) { HICON hiconLarge=0; HICON hiconSmall=0; - PrivateExtractIconsA( sSourceFile, dwSourceIndex, 32, 32, &hiconLarge, 0, 1, 0 ); - PrivateExtractIconsA( sSourceFile, dwSourceIndex, 16, 16, &hiconSmall, 0, 1, 0 ); + PrivateExtractIconsA( sSourceFile, dwSourceIndex, 32, 32, &hiconLarge, 0, 1, 0 ); + PrivateExtractIconsA( sSourceFile, dwSourceIndex, 16, 16, &hiconSmall, 0, 1, 0 ); if ( !hiconLarge || !hiconSmall) { WARN("failure loading icon %i from %s (%x %x)\n", dwSourceIndex, sSourceFile, hiconLarge, hiconSmall); return -1; } - return SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge); + return SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge); } /***************************************************************************** * SIC_GetIconIndex [internal] @@ -151,12 +151,12 @@ static INT SIC_LoadIcon (LPCSTR sSourceFile, INT dwSourceIndex) INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex ) { SIC_ENTRY sice; INT ret, index = INVALID_INDEX; - + TRACE("%s %i\n", sSourceFile, dwSourceIndex); sice.sSourceFile = PathFindFileNameA(sSourceFile); sice.dwSourceIndex = dwSourceIndex; - + EnterCriticalSection(&SHELL32_SicCS); if (NULL != pDPA_GetPtr (sic_hdpa, 0)) @@ -199,13 +199,13 @@ static HICON WINE_UNUSED SIC_GetIcon (LPCSTR sSourceFile, INT dwSourceIndex, BOO if (bSmallIcon) return ImageList_GetIcon(ShellSmallIconList, index, ILD_NORMAL); return ImageList_GetIcon(ShellBigIconList, index, ILD_NORMAL); - + } /***************************************************************************** * SIC_Initialize [internal] * * NOTES - * hack to load the resources from the shell32.dll under a different dll name + * hack to load the resources from the shell32.dll under a different dll name * will be removed when the resource-compiler is ready */ BOOL SIC_Initialize(void) @@ -217,9 +217,9 @@ BOOL SIC_Initialize(void) if (sic_hdpa) /* already initialized?*/ return TRUE; - + sic_hdpa = pDPA_Create(16); - + if (!sic_hdpa) { return(FALSE); @@ -266,7 +266,7 @@ void SIC_Destroy(void) { for (i=0; i < pDPA_GetPtrCount(sic_hdpa); ++i) { - lpsice = pDPA_GetPtr(sic_hdpa, i); + lpsice = pDPA_GetPtr(sic_hdpa, i); SHFree(lpsice); } pDPA_Destroy(sic_hdpa); @@ -312,13 +312,13 @@ BOOL PidlToSicIndex ( BOOL bBigIcon, UINT uFlags, UINT * pIndex) -{ +{ IExtractIconA *ei; char szIconFile[MAX_PATH]; /* file containing the icon */ INT iSourceIndex; /* index or resID(negated) in this file */ BOOL ret = FALSE; UINT dwFlags = 0; - + TRACE("sf=%p pidl=%p %s\n", sh, pidl, bBigIcon?"Big":"Small"); if (SUCCEEDED (IShellFolder_GetUIObjectOf(sh, 0, 1, &pidl, &IID_IExtractIconA, 0, (void **)&ei))) @@ -342,7 +342,7 @@ BOOL PidlToSicIndex ( * SHMapPIDLToSystemImageListIndex [SHELL32.77] * * PARAMETERS - * sh [IN] pointer to an instance of IShellFolder + * sh [IN] pointer to an instance of IShellFolder * pidl [IN] * pIndex [OUT][OPTIONAL] SIC index for big icon * @@ -356,7 +356,7 @@ int WINAPI SHMapPIDLToSystemImageListIndex( TRACE("(SF=%p,pidl=%p,%p)\n",sh,pidl,pIndex); pdump(pidl); - + if (pIndex) PidlToSicIndex ( sh, pidl, 1, 0, pIndex); PidlToSicIndex ( sh, pidl, 0, 0, &Index); @@ -367,16 +367,16 @@ int WINAPI SHMapPIDLToSystemImageListIndex( * Shell_GetCachedImageIndex [SHELL32.72] * */ -INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateDoc) +INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateDoc) { WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_a(szPath), nIndex, bSimulateDoc); return SIC_GetIconIndex(szPath, nIndex); } -INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulateDoc) +INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, BOOL bSimulateDoc) { INT ret; LPSTR sTemp = HEAP_strdupWtoA (GetProcessHeap(),0,szPath); - + WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_w(szPath), nIndex, bSimulateDoc); ret = SIC_GetIconIndex(sTemp, nIndex); @@ -401,13 +401,13 @@ HICON WINAPI ExtractIconExAW ( LPCVOID lpszFile, INT nIconIndex, HICON * phiconL /************************************************************************* * ExtractIconExA [SHELL32.@] * RETURNS - * 0 no icon found + * 0 no icon found * 1 file is not valid * HICON handle of a icon (phiconLarge/Small == NULL) */ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons ) { HICON ret=0; - + TRACE("file=%s idx=%i %p %p num=%i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons ); if (nIconIndex==-1) /* Number of icons requested */ @@ -417,14 +417,14 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar { ret = PrivateExtractIconsA( lpszFile, nIconIndex, 32, 32, phiconLarge, 0, nIcons, 0 ); if ( nIcons==1) - { ret = phiconLarge[0]; + { ret = phiconLarge[0]; } } /* if no pointers given and one icon expected, return the handle directly*/ if (!phiconLarge && !phiconSmall && nIcons==1 ) phiconSmall = &ret; - + if (phiconSmall) { ret = PrivateExtractIconsA( lpszFile, nIconIndex, 16, 16, phiconSmall, 0, nIcons, 0 ); @@ -441,7 +441,7 @@ HICON WINAPI ExtractIconExA ( LPCSTR lpszFile, INT nIconIndex, HICON * phiconLar HICON WINAPI ExtractIconExW ( LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons ) { LPSTR sFile; DWORD ret; - + TRACE("file=%s idx=%i %p %p num=%i\n", debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons ); sFile = HEAP_strdupWtoA (GetProcessHeap(),0,lpszFile); diff --git a/dlls/shell32/memorystream.c b/dlls/shell32/memorystream.c index e3326febe21..5e86162c194 100644 --- a/dlls/shell32/memorystream.c +++ b/dlls/shell32/memorystream.c @@ -50,8 +50,8 @@ static HRESULT WINAPI IStream_fnUnlockRegion (IStream * iface, ULARGE_INTEGER li static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD grfStatFlag); static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm); -static ICOM_VTABLE(IStream) stvt = -{ +static ICOM_VTABLE(IStream) stvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IStream_fnQueryInterface, IStream_fnAddRef, @@ -67,10 +67,10 @@ static ICOM_VTABLE(IStream) stvt = IStream_fnUnlockRegion, IStream_fnStat, IStream_fnClone - + }; -typedef struct +typedef struct { ICOM_VTABLE(IStream) *lpvtst; DWORD ref; LPBYTE pImage; @@ -90,7 +90,7 @@ HRESULT CreateStreamOnFile (LPCSTR pszFilename, IStream ** ppstm) OFSTRUCT ofs; HFILE hFile = OpenFile( pszFilename, &ofs, OF_READ ); HRESULT ret = E_FAIL; - + fstr = (ISHFileStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHFileStream)); fstr->lpvtst=&stvt; fstr->ref = 1; @@ -112,7 +112,7 @@ HRESULT CreateStreamOnFile (LPCSTR pszFilename, IStream ** ppstm) ret = S_OK; goto end_1; - + end_3: CloseHandle(fstr->hMapping); end_2: HeapFree(GetProcessHeap(), 0, fstr); fstr = NULL; @@ -140,8 +140,8 @@ static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVO } if(*ppvObj) - { - IStream_AddRef((IStream*)*ppvObj); + { + IStream_AddRef((IStream*)*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } @@ -173,7 +173,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface) shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying SHFileStream (%p)\n",This); UnmapViewOfFile(This->pImage); @@ -190,9 +190,9 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG ICOM_THIS(ISHFileStream, iface); DWORD dwBytesToRead, dwBytesLeft; - + TRACE("(%p)->(%p,0x%08lx,%p)\n",This, pv, cb, pcbRead); - + if ( !pv ) return STG_E_INVALIDPOINTER; @@ -200,11 +200,11 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG if ( 0 >= dwBytesLeft ) /* end of buffer */ return S_FALSE; - + dwBytesToRead = ( cb > dwBytesLeft) ? dwBytesLeft : cb; memmove ( pv, (This->pImage) + (This->dwPos), dwBytesToRead); - + This->dwPos += dwBytesToRead; /* adjust pointer */ if (pcbRead) diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index c642a7a29b1..8ff062b3e8e 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -57,7 +57,7 @@ BOOL WINAPI ILGetDisplayName(LPCITEMIDLIST pidl,LPSTR path) * NOTES * observed: pidl=Desktop return=pidl */ -LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl) +LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl) { LPITEMIDLIST pidlLast = pidl; TRACE("(pidl=%p)\n",pidl); @@ -67,7 +67,7 @@ LPITEMIDLIST WINAPI ILFindLastID(LPITEMIDLIST pidl) pidlLast = pidl; pidl = ILGetNext(pidl); } - return pidlLast; + return pidlLast; } /************************************************************************* * ILRemoveLastID [SHELL32.17] @@ -97,7 +97,7 @@ LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl) if (!pidl) return NULL; - + len = ILGetSize(pidl); newpidl = (LPITEMIDLIST)SHAlloc(len); if (newpidl) @@ -117,13 +117,13 @@ LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl) LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl) { DWORD len; LPITEMIDLIST pidlNew = NULL; - + TRACE("pidl=%p \n",pidl); pdump(pidl); - + if (pidl) { - len = pidl->mkid.cb; + len = pidl->mkid.cb; pidlNew = (LPITEMIDLIST) SHAlloc (len+2); if (pidlNew) { @@ -148,7 +148,7 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl) { WORD wLen = 0; DWORD dwBytesRead; HRESULT ret = E_FAIL; - + TRACE_(shell)("%p %p\n", pStream , ppPidl); @@ -156,7 +156,7 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl) { SHFree(*ppPidl); *ppPidl = NULL; } - + IStream_AddRef (pStream); if (SUCCEEDED(IStream_Read(pStream, (LPVOID)&wLen, 2, &dwBytesRead))) @@ -169,13 +169,13 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl) *ppPidl = NULL; } } - + /* we are not yet fully compatible */ if (!pcheck(*ppPidl)) { SHFree(*ppPidl); *ppPidl = NULL; } - + IStream_Release (pStream); @@ -193,7 +193,7 @@ HRESULT WINAPI ILSaveToStream (IStream * pStream, LPCITEMIDLIST pPidl) LPITEMIDLIST pidl; WORD wLen = 0; HRESULT ret = E_FAIL; - + TRACE_(shell)("%p %p\n", pStream, pPidl); IStream_AddRef (pStream); @@ -211,7 +211,7 @@ HRESULT WINAPI ILSaveToStream (IStream * pStream, LPCITEMIDLIST pPidl) { ret = S_OK; } } - + IStream_Release (pStream); @@ -229,7 +229,7 @@ HRESULT WINAPI SHILCreateFromPathA (LPCSTR path, LPITEMIDLIST * ppidl, DWORD * a WCHAR lpszDisplayName[MAX_PATH]; DWORD pchEaten; HRESULT ret = E_FAIL; - + TRACE_(shell)("%s %p 0x%08lx\n",path,ppidl,attributes?*attributes:0); if (!MultiByteToWideChar( CP_ACP, 0, path, -1, lpszDisplayName, MAX_PATH )) @@ -246,7 +246,7 @@ HRESULT WINAPI SHILCreateFromPathW (LPCWSTR path, LPITEMIDLIST * ppidl, DWORD * { LPSHELLFOLDER sf; DWORD pchEaten; HRESULT ret = E_FAIL; - + TRACE_(shell)("%s %p 0x%08lx\n",debugstr_w(path),ppidl,attributes?*attributes:0); if (SUCCEEDED (SHGetDesktopFolder(&sf))) @@ -265,9 +265,9 @@ HRESULT WINAPI SHILCreateFromPathAW (LPCVOID path, LPITEMIDLIST * ppidl, DWORD * /************************************************************************* * SHCloneSpecialIDList [SHELL32.89] - * + * * PARAMETERS - * hwndOwner [in] + * hwndOwner [in] * nFolder [in] CSIDL_xxxxx ?? * * RETURNS @@ -295,7 +295,7 @@ LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl) if (!pidl) return NULL; - + len = ILGetSize(pidl); newpidl = (LPITEMIDLIST)pCOMCTL32_Alloc(len); if (newpidl) @@ -329,7 +329,7 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) pdump (pidl2); if ( (!pidl1) || (!pidl2) ) return FALSE; - + while (pidltemp1->mkid.cb && pidltemp2->mkid.cb) { _ILSimpleGetText(pidltemp1, szData1, MAX_PATH); @@ -340,7 +340,7 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) pidltemp1 = ILGetNext(pidltemp1); pidltemp2 = ILGetNext(pidltemp2); - } + } if (!pidltemp1->mkid.cb && !pidltemp2->mkid.cb) { @@ -363,7 +363,7 @@ BOOL WINAPI ILIsParent( LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL LPITEMIDLIST pParent = pidlParent; LPITEMIDLIST pChild = pidlChild; - + TRACE("%p %p %x\n", pidlParent, pidlChild, bImmediate); while (pParent->mkid.cb && pChild->mkid.cb) @@ -376,14 +376,14 @@ BOOL WINAPI ILIsParent( LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL pParent = ILGetNext(pParent); pChild = ILGetNext(pChild); - } - + } + if ( pParent->mkid.cb || ! pChild->mkid.cb) /* child shorter or has equal length to parent */ return FALSE; - + if ( ILGetNext(pChild)->mkid.cb && bImmediate) /* not immediate descent */ return FALSE; - + return TRUE; } @@ -434,7 +434,7 @@ LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1,LPCITEMIDLIST pidl2) pidltemp1 = ILGetNext(pidltemp1); pidltemp2 = ILGetNext(pidltemp2); - ret = pidltemp2; + ret = pidltemp2; } if (pidltemp1->mkid.cb) @@ -458,7 +458,7 @@ LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1,LPCITEMIDLIST pidl2) { DWORD len1,len2; LPITEMIDLIST pidlNew; - + TRACE("pidl=%p pidl=%p\n",pidl1,pidl2); if(!pidl1 && !pidl2) return NULL; @@ -539,7 +539,7 @@ DWORD WINAPI ILGetSize(LPITEMIDLIST pidl) DWORD len=0; if (pidl) - { while (si->cb) + { while (si->cb) { len += si->cb; si = (LPSHITEMID)(((LPBYTE)si)+si->cb); } @@ -591,7 +591,7 @@ LPITEMIDLIST WINAPI ILAppend(LPITEMIDLIST pidl,LPCITEMIDLIST item,BOOL bEnd) pdump (pidl); pdump (item); - + if (_ILIsDesktop(pidl)) { idlRet = ILClone(item); @@ -620,7 +620,7 @@ LPITEMIDLIST WINAPI ILAppend(LPITEMIDLIST pidl,LPCITEMIDLIST item,BOOL bEnd) * allocated by SHMalloc allocator * exported by ordinal */ -DWORD WINAPI ILFree(LPITEMIDLIST pidl) +DWORD WINAPI ILFree(LPITEMIDLIST pidl) { TRACE("(pidl=0x%08lx)\n",(DWORD)pidl); @@ -643,7 +643,7 @@ void WINAPI ILGlobalFree( LPCITEMIDLIST pidl) * ILCreateFromPath [SHELL32.157] * */ -LPITEMIDLIST WINAPI ILCreateFromPathA (LPCSTR path) +LPITEMIDLIST WINAPI ILCreateFromPathA (LPCSTR path) { LPITEMIDLIST pidlnew; DWORD attributes = 0; @@ -654,7 +654,7 @@ LPITEMIDLIST WINAPI ILCreateFromPathA (LPCSTR path) return pidlnew; return FALSE; } -LPITEMIDLIST WINAPI ILCreateFromPathW (LPCWSTR path) +LPITEMIDLIST WINAPI ILCreateFromPathW (LPCWSTR path) { LPITEMIDLIST pidlnew; DWORD attributes = 0; @@ -665,7 +665,7 @@ LPITEMIDLIST WINAPI ILCreateFromPathW (LPCWSTR path) return pidlnew; return FALSE; } -LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path) +LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path) { if ( SHELL_OsIsUnicode()) return ILCreateFromPathW (path); @@ -723,7 +723,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathAW (LPCVOID lpszPath) * * gets the folder locations from the registry and creates a pidl * creates missing reg keys and directories - * + * * PARAMS * hwndOwner [I] * nFolder [I] CSIDL_xxxxx @@ -813,7 +813,7 @@ HRESULT WINAPI SHGetFolderLocation( HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len) { TRACE_(shell)("sf=%p pidl=%p 0x%04x %p 0x%04x stub\n",psf,pidl,nFormat,dest,len); - + pdump(pidl); if (!psf || !dest ) return E_INVALIDARG; @@ -893,10 +893,10 @@ HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int n * SHGetPathFromIDListA [SHELL32.@][NT 4.0: SHELL32.220] * * PARAMETERS - * pidl, [IN] pidl + * pidl, [IN] pidl * pszPath [OUT] path * - * RETURNS + * RETURNS * path from a passed PIDL. * * NOTES @@ -919,7 +919,7 @@ BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath) if(_ILIsDesktop(pidl)) { - SHGetSpecialFolderPathA(0, pszPath, CSIDL_DESKTOPDIRECTORY, FALSE); + SHGetSpecialFolderPathA(0, pszPath, CSIDL_DESKTOPDIRECTORY, FALSE); } else if (_ILIsSpecialFolder(ILFindLastID(pidl))) { @@ -966,17 +966,17 @@ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCI IShellFolder * psf; LPITEMIDLIST pidlChild, pidlParent; HRESULT hr=E_FAIL; - + TRACE_(shell)("pidl=%p\n", pidl); pdump(pidl); - + *ppv = NULL; if (ppidlLast) *ppidlLast = NULL; if (_ILIsPidlSimple(pidl)) { /* we are on desktop level */ - if (ppidlLast) + if (ppidlLast) *ppidlLast = ILClone(pidl); hr = SHGetDesktopFolder((IShellFolder**)ppv); } @@ -1028,7 +1028,7 @@ BOOL WINAPI SHGetPathFromIDListAW(LPCITEMIDLIST pidl,LPVOID pszPath) * _ILCreateIExplore() * _ILCreateMyComputer() * _ILCreateDrive() - * _ILCreateFolder() + * _ILCreateFolder() * _ILCreateValue() */ LPITEMIDLIST _ILCreateDesktop() @@ -1081,7 +1081,7 @@ LPITEMIDLIST _ILCreateFolder( WIN32_FIND_DATAA * stffile ) char * pbuff = buff; ULONG len, len1; LPITEMIDLIST pidl; - + TRACE("(%s, %s)\n",stffile->cAlternateFileName, stffile->cFileName); /* prepare buffer with both names */ @@ -1101,7 +1101,7 @@ LPITEMIDLIST _ILCreateFolder( WIN32_FIND_DATAA * stffile ) } pidl = _ILCreate(PT_FOLDER, (LPVOID)buff, len + len1); - + /* set attributes */ if (pidl) { @@ -1121,7 +1121,7 @@ LPITEMIDLIST _ILCreateValue(WIN32_FIND_DATAA * stffile) char * pbuff = buff; ULONG len, len1; LPITEMIDLIST pidl; - + TRACE("(%s, %s)\n",stffile->cAlternateFileName, stffile->cFileName); /* prepare buffer with both names */ @@ -1141,7 +1141,7 @@ LPITEMIDLIST _ILCreateValue(WIN32_FIND_DATAA * stffile) } pidl = _ILCreate(PT_VALUE, (LPVOID)buff, len + len1); - + /* set attributes */ if (pidl) { @@ -1180,7 +1180,7 @@ LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT uInSize) LPPIDLDATA pData; UINT uSize = 0; LPSTR pszDest; - + TRACE("(0x%02x %p %i)\n",type,pIn,uInSize); switch (type) @@ -1196,11 +1196,11 @@ LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT uInSize) uSize = 2 + 23; break; case PT_FOLDER: - case PT_VALUE: + case PT_VALUE: uSize = 2 + 12 + uInSize; break; default: - FIXME("can't create type: 0x%08x\n",type); + FIXME("can't create type: 0x%08x\n",type); return NULL; } @@ -1231,7 +1231,7 @@ LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT uInSize) break; case PT_FOLDER: - case PT_VALUE: + case PT_VALUE: pData =_ILGetDataPointer(pidlOut); pData->type = type; pszDest = _ILGetTextPointer(pidlOut); @@ -1239,7 +1239,7 @@ LPITEMIDLIST _ILCreate(PIDLTYPE type, LPCVOID pIn, UINT uInSize) TRACE("- create Value: %s\n",debugstr_a(pszDest)); break; } - + pidlTemp = ILGetNext(pidlOut); if (pidlTemp) pidlTemp->mkid.cb = 0x00; @@ -1301,7 +1301,7 @@ BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl) { LPPIDLDATA lpPData = _ILGetDataPointer(pidl); TRACE("(%p)\n",pidl); - return (pidl && ( (lpPData && (PT_MYCOMP== lpPData->type || PT_SPECIAL== lpPData->type)) || + return (pidl && ( (lpPData && (PT_MYCOMP== lpPData->type || PT_SPECIAL== lpPData->type)) || (pidl && pidl->mkid.cb == 0x00) )); } @@ -1360,19 +1360,19 @@ BOOL _ILIsPidlSimple ( LPCITEMIDLIST pidl) */ DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize) { - DWORD dwReturn=0; + DWORD dwReturn=0; LPSTR szSrc; GUID const * riid; char szTemp[MAX_PATH]; - + TRACE("(%p %p %x)\n",pidl,szOut,uOutSize); - + if (!pidl) return 0; if (szOut) *szOut = 0; - if (_ILIsDesktop(pidl)) + if (_ILIsDesktop(pidl)) { /* desktop */ if (HCR_GetClassName(&CLSID_ShellDesktop, szTemp, MAX_PATH)) @@ -1532,7 +1532,7 @@ REFIID _ILGetGUIDPointer(LPCITEMIDLIST pidl) * True if Successful * * NOTES - * + * */ BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt) { @@ -1541,10 +1541,10 @@ BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt) if(! pdata) return FALSE; switch (pdata->type) - { + { case PT_FOLDER: DosDateTimeToFileTime(pdata->u.folder.uFileDate, pdata->u.folder.uFileTime, pFt); - break; + break; case PT_VALUE: DosDateTimeToFileTime(pdata->u.file.uFileDate, pdata->u.file.uFileTime, pFt); break; @@ -1555,12 +1555,12 @@ BOOL _ILGetFileDateTime(LPCITEMIDLIST pidl, FILETIME *pFt) } BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) -{ +{ FILETIME ft,lft; SYSTEMTIME time; if (! _ILGetFileDateTime( pidl, &ft )) return FALSE; - + FileTimeToLocalFileTime(&ft, &lft); FileTimeToSystemTime (&lft, &time); return GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&time, NULL, pOut, uOutSize); @@ -1581,13 +1581,13 @@ BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) * * NOTES * pOut can be null when no string is needed - * + * */ DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) { LPPIDLDATA pdata =_ILGetDataPointer(pidl); DWORD dwSize; - + if(! pdata) return 0; switch (pdata->type) @@ -1606,13 +1606,13 @@ BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) char szTemp[MAX_PATH]; const char * pPoint; LPITEMIDLIST pidlTemp=pidl; - + TRACE("pidl=%p\n",pidl); if (!pidl) return FALSE; - + pidlTemp = ILFindLastID(pidl); - + if (!_ILIsValue(pidlTemp)) return FALSE; if (!_ILSimpleGetText(pidlTemp, szTemp, MAX_PATH)) return FALSE; @@ -1641,7 +1641,7 @@ BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) * nothing * * NOTES - * This function copies as much as possible into the buffer. + * This function copies as much as possible into the buffer. */ void _ILGetFileType(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) { @@ -1683,7 +1683,7 @@ void _ILGetFileType(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) * * FIXME * return value 0 in case of error is a valid return value - * + * */ DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) { @@ -1702,7 +1702,7 @@ DWORD _ILGetFileAttributes(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize) wAttrib = pData->u.file.uFileAttribs; break; } - + if(uOutSize >= 6) { i=0; diff --git a/dlls/shell32/pidl.h b/dlls/shell32/pidl.h index 0d5f6c450f8..37c7280854f 100644 --- a/dlls/shell32/pidl.h +++ b/dlls/shell32/pidl.h @@ -22,7 +22,7 @@ * DO NOT use this definitions outside the shell32.dll ! * * The contents of a pidl should never used from a application - * directly. + * directly. * * Undocumented: * MS says: the abID of SHITEMID should be treated as binary data and not @@ -30,13 +30,13 @@ * Word95 interprets the contents of abID (Filesize/Date) so we have to go * for binary compatibility here. */ - + #ifndef __WINE_PIDL_H #define __WINE_PIDL_H #include "shlobj.h" -/* +/* * the pidl does cache fileattributes to speed up SHGetAttributes when * displaying a big number of files. * @@ -62,7 +62,7 @@ * workgroup 0x41 network (3) * computer 0x42 network (4) * whole network 0x47 network (5) -* MSITStore 0x61 htmlhlp (7) +* MSITStore 0x61 htmlhlp (7) * history/favorites 0xb1 file * share 0xc3 network (6) * @@ -72,7 +72,7 @@ * (2) IID_MyComputer = 20D04FE0L-3AEA-1069-A2D8-08002B30309D * (3) two strings "workgroup" "microsoft network" * (4) one string "\\sirius" -* (5) one string "whole network" +* (5) one string "whole network" * (6) one string "\\sirius\c" * (7) contains string "mk:@MSITStore:C:\path\file.chm::/path/filename.htm" * GUID 871C5380-42A0-1069-A2EA-08002B30309D @@ -111,16 +111,16 @@ typedef struct tagPIDLDATA DWORD dwUnknown; /*21*/ /* the drive seems to be 25 bytes every time */ } drive; - struct + struct { BYTE dummy; /*01 is 0x00 for files or dirs */ DWORD dwFileSize; /*02*/ WORD uFileDate; /*06*/ WORD uFileTime; /*08*/ WORD uFileAttribs; /*10*/ CHAR szNames[1]; /*12*/ - /* Here are comming two strings. The first is the long name. + /* Here are comming two strings. The first is the long name. The second the dos name when needed or just 0x00 */ - } file, folder, generic; + } file, folder, generic; struct { WORD dummy; /*01*/ CHAR szNames[1]; /*03*/ @@ -183,8 +183,8 @@ LPSTR _ILGetTextPointer (LPCITEMIDLIST); LPSTR _ILGetSTextPointer (LPCITEMIDLIST); REFIID _ILGetGUIDPointer (LPCITEMIDLIST pidl); -/* - * debug helper +/* + * debug helper */ void pdump (LPCITEMIDLIST pidl); BOOL pcheck (LPCITEMIDLIST pidl); diff --git a/dlls/shell32/shell.c b/dlls/shell32/shell.c index 463ea366686..0ac09037ba3 100644 --- a/dlls/shell32/shell.c +++ b/dlls/shell32/shell.c @@ -125,25 +125,25 @@ UINT16 WINAPI DragQueryFile16( { LPSTR lpDrop; UINT i = 0; - LPDROPFILESTRUCT16 lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop); - + LPDROPFILESTRUCT16 lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop); + TRACE("(%04x, %x, %p, %u)\n", hDrop,wFile,lpszFile,wLength); - + if(!lpDropFileStruct) goto end; - + lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->wSize; wFile = (wFile==0xffff) ? 0xffffffff : wFile; while (i++ < wFile) { while (*lpDrop++); /* skip filename */ - if (!*lpDrop) + if (!*lpDrop) { - i = (wFile == 0xFFFFFFFF) ? i : 0; + i = (wFile == 0xFFFFFFFF) ? i : 0; goto end; } } - + i = strlen(lpDrop); i++; if (!lpszFile ) goto end; /* needed buffer size */ @@ -169,14 +169,14 @@ void WINAPI DragFinish16(HDROP16 h) */ BOOL16 WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p) { - LPDROPFILESTRUCT16 lpDropFileStruct; + LPDROPFILESTRUCT16 lpDropFileStruct; BOOL16 bRet; TRACE("\n"); lpDropFileStruct = (LPDROPFILESTRUCT16) GlobalLock16(hDrop); - + memcpy(p,&lpDropFileStruct->ptMousePos,sizeof(POINT16)); bRet = lpDropFileStruct->fInNonClientArea; - + GlobalUnlock16(hDrop); return bRet; } @@ -220,7 +220,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance, OFSTRUCT ofs; HFILE hFile; - TRACE("(%04x,file %s,start %d,extract %d\n", + TRACE("(%04x,file %s,start %d,extract %d\n", hInstance, lpszExeFileName, nIconIndex, n); if( !n ) @@ -322,7 +322,7 @@ HICON16 WINAPI ExtractIconEx16( /************************************************************************* * ExtractAssociatedIcon [SHELL.36] - * + * * Return icon for given file (either from file itself or from associated * executable) and patch parameters if needed. */ @@ -345,13 +345,13 @@ HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst, LPSTR lpIconPath, LPWO if( uRet > 32 && tempPath[0] ) { strcpy(lpIconPath,tempPath); hIcon = ExtractIcon16(hInst, lpIconPath, *lpiIcon); - if( hIcon > 2 ) + if( hIcon > 2 ) return hIcon; } else hIcon = 0; } - if( hIcon == 1 ) + if( hIcon == 1 ) *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */ else *lpiIcon = 6; /* generic icon - found nothing */ @@ -364,7 +364,7 @@ HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16 hInst, LPSTR lpIconPath, LPWO /************************************************************************* * ExtractAssociatedIconA (SHELL32.@) - * + * * Return icon for given file (either from file itself or from associated * executable) and patch parameters if needed. */ @@ -375,7 +375,7 @@ HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lp /************************************************************************* * ExtractAssociatedIconExA (SHELL32.@) - * + * * Return icon for given file (either from file itself or from associated * executable) and patch parameters if needed. */ @@ -387,7 +387,7 @@ HICON WINAPI ExtractAssociatedIconExA(DWORD d1, DWORD d2, DWORD d3, DWORD d4) /************************************************************************* * ExtractAssociatedIconExW (SHELL32.@) - * + * * Return icon for given file (either from file itself or from associated * executable) and patch parameters if needed. */ @@ -407,9 +407,9 @@ LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry) TRACE("\n"); - l = strlen(entry); + l = strlen(entry); for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 ) - { if( strncasecmp(lpEnv, entry, l) ) + { if( strncasecmp(lpEnv, entry, l) ) continue; if( !*(lpEnv+l) ) return (lpEnv + l); /* empty entry */ @@ -425,11 +425,11 @@ SEGPTR WINAPI FindEnvironmentString16(LPSTR str) { SEGPTR spEnv; LPSTR lpEnv,lpString; TRACE("\n"); - + spEnv = GetDOSEnvironment16(); lpEnv = MapSL(spEnv); - lpString = (spEnv)?SHELL_FindString(lpEnv, str):NULL; + lpString = (spEnv)?SHELL_FindString(lpEnv, str):NULL; if( lpString ) /* offset should be small enough */ return spEnv + (lpString - lpEnv); @@ -463,7 +463,7 @@ DWORD WINAPI DoEnvironmentSubst16(LPSTR str,WORD length) if( *lpend == '%' && lpend - lpstr > 1 ) /* found key */ { LPSTR lpKey; - *lpend = '\0'; + *lpend = '\0'; lpKey = SHELL_FindString(lpEnv, lpstr+1); if( lpKey ) /* found key value */ { @@ -485,7 +485,7 @@ DWORD WINAPI DoEnvironmentSubst16(LPSTR str,WORD length) else break; /* back off and whine */ continue; - } + } *lpbstr++ = *lpstr++; } @@ -516,7 +516,7 @@ DWORD WINAPI DoEnvironmentSubst16(LPSTR str,WORD length) */ LRESULT WINAPI ShellHookProc16(INT16 code, WPARAM16 wParam, LPARAM lParam) { - TRACE("%i, %04x, %08x\n", code, wParam, + TRACE("%i, %04x, %08x\n", code, wParam, (unsigned)lParam ); if( SHELL_hHook && SHELL_hWnd ) { @@ -536,24 +536,24 @@ LRESULT WINAPI ShellHookProc16(INT16 code, WPARAM16 wParam, LPARAM lParam) * RegisterShellHook [SHELL.102] */ BOOL WINAPI RegisterShellHook16(HWND16 hWnd, UINT16 uAction) -{ +{ TRACE("%04x [%u]\n", hWnd, uAction ); switch( uAction ) - { + { case 2: /* register hWnd as a shell window */ if( !SHELL_hHook ) - { + { HMODULE16 hShell = GetModuleHandle16( "SHELL" ); HOOKPROC16 hookProc = (HOOKPROC16)GetProcAddress16( hShell, (LPCSTR)103 ); SHELL_hHook = SetWindowsHookEx16( WH_SHELL, hookProc, hShell, 0 ); if ( SHELL_hHook ) - { + { uMsgWndCreated = RegisterWindowMessageA( lpstrMsgWndCreated ); uMsgWndDestroyed = RegisterWindowMessageA( lpstrMsgWndDestroyed ); uMsgShellActivate = RegisterWindowMessageA( lpstrMsgShellActivate ); - } - else + } + else WARN("-- unable to install ShellHookProc()!\n"); } diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index b10acd1cd22..75adf2ef0df 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -49,19 +49,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); /************************************************************************* * CommandLineToArgvW [SHELL32.@] * - * We must interpret the quotes in the command line to rebuild the argv + * We must interpret the quotes in the command line to rebuild the argv * array correctly: * - arguments are separated by spaces or tabs * - quotes serve as optional argument delimiters * '"a b"' -> 'a b' * - escaped quotes must be converted back to '"' * '\"' -> '"' - * - an odd number of '\'s followed by '"' correspond to half that number + * - an odd number of '\'s followed by '"' correspond to half that number * of '\' followed by a '"' (extension of the above) * '\\\"' -> '\"' * '\\\\\"' -> '\\"' * - an even number of '\'s followed by a '"' correspond to half that number - * of '\', plus a regular quote serving as an argument delimiter (which + * of '\', plus a regular quote serving as an argument delimiter (which * means it does not appear in the result) * 'a\\"b c"' -> 'a\b c' * 'a\\\\"b c"' -> 'a\\b c' @@ -168,14 +168,14 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs) } else if (*s==0x0022) { /* '"' */ if ((bcount & 1)==0) { - /* Preceeded by an even number of '\', this is half that + /* Preceeded by an even number of '\', this is half that * number of '\', plus a quote which we erase. */ d-=bcount/2; in_quotes=!in_quotes; s++; } else { - /* Preceeded by an odd number of '\', this is half that + /* Preceeded by an odd number of '\', this is half that * number of '\' followed by a '"' */ d=d-bcount/2-1; @@ -217,12 +217,12 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, HRESULT hr = S_OK; BOOL IconNotYetLoaded=TRUE; - TRACE("(%s fattr=0x%lx sfi=%p(attr=0x%08lx) size=0x%x flags=0x%x)\n", + TRACE("(%s fattr=0x%lx sfi=%p(attr=0x%08lx) size=0x%x flags=0x%x)\n", (flags & SHGFI_PIDL)? "pidl" : path, dwFileAttributes, psfi, psfi->dwAttributes, sizeofpsfi, flags); if ((flags & SHGFI_USEFILEATTRIBUTES) && (flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL))) return FALSE; - + /* windows initializes this values regardless of the flags */ psfi->szDisplayName[0] = '\0'; psfi->szTypeName[0] = '\0'; @@ -255,14 +255,14 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, * Seek to the start of the file and read the header information. */ - SetFilePointer( hfile, 0, NULL, SEEK_SET ); + SetFilePointer( hfile, 0, NULL, SEEK_SET ); ReadFile( hfile, &mz_header, sizeof(mz_header), &len, NULL ); SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); ReadFile( hfile, magic, sizeof(magic), &len, NULL ); if ( *(DWORD*)magic == IMAGE_NT_SIGNATURE ) { - SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); + SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); ReadFile( hfile, &nt, sizeof(nt), &len, NULL ); CloseHandle( hfile ); if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) { @@ -275,7 +275,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, else if ( *(WORD*)magic == IMAGE_OS2_SIGNATURE ) { IMAGE_OS2_HEADER ne; - SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); + SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); ReadFile( hfile, &ne, sizeof(ne), &len, NULL ); CloseHandle( hfile ); if (ne.ne_exetyp == 2) return IMAGE_OS2_SIGNATURE @@ -286,8 +286,8 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, return 0; } - - /* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES in not specified + + /* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES in not specified the pidl functions fail on not existing file names */ if (flags & SHGFI_PIDL) { @@ -303,13 +303,13 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, hr = SHILCreateFromPathA ( path, &pidl, &dwAttributes); /* note: the attributes in ISF::ParseDisplayName are not implemented */ } - + /* get the parent shellfolder */ if (pidl) { hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent, &pidlLast); } - + /* get the attributes of the child */ if (SUCCEEDED(hr) && (flags & SHGFI_ATTRIBUTES)) { @@ -322,7 +322,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, /* get the displayname */ if (SUCCEEDED(hr) && (flags & SHGFI_DISPLAYNAME)) - { + { if (flags & SHGFI_USEFILEATTRIBUTES) { strcpy (psfi->szDisplayName, PathFindFileNameA(path)); @@ -378,7 +378,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, strcpy (psfi->szDisplayName, szLoaction); else ret = FALSE; - + IExtractIconA_Release(pei); } } @@ -416,17 +416,17 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, else /* default icon */ { psfi->iIcon = 0; - } + } } else { - if (!(PidlToSicIndex(psfParent, pidlLast, (flags & SHGFI_LARGEICON), + if (!(PidlToSicIndex(psfParent, pidlLast, (flags & SHGFI_LARGEICON), (flags & SHGFI_OPENICON)? GIL_OPENICON : 0, &(psfi->iIcon)))) { ret = FALSE; } } - if (ret) + if (ret) { ret = (DWORD) ((flags & SHGFI_LARGEICON) ? ShellBigIconList : ShellSmallIconList); } @@ -447,7 +447,7 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, if(pidlLast) SHFree(pidlLast); #ifdef MORE_DEBUG - TRACE ("icon=0x%08x index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx\n", + TRACE ("icon=0x%08x index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx\n", psfi->hIcon, psfi->iIcon, psfi->dwAttributes, psfi->szDisplayName, psfi->szTypeName, ret); #endif return ret; @@ -478,7 +478,7 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ret = SHGetFileInfoA(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags); HeapFree(GetProcessHeap(), 0, temppath); - + return ret; } @@ -512,13 +512,13 @@ HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon) hDupIcon = CreateIconIndirect(&IconInfo); /* clean up hbmMask and hbmColor */ - DeleteObject(IconInfo.hbmMask); - DeleteObject(IconInfo.hbmColor); + DeleteObject(IconInfo.hbmMask); + DeleteObject(IconInfo.hbmColor); } - + return hDupIcon; } - + /************************************************************************* * ExtractIconA [SHELL32.@] @@ -620,7 +620,7 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data) return TRUE; case ABM_SETAUTOHIDEBAR: SetWindowPos(data->hWnd,HWND_TOP,rec.left+1000,rec.top, - width,height,SWP_SHOWWINDOW); + width,height,SWP_SHOWWINDOW); return TRUE; case ABM_SETPOS: data->uEdge=(ABE_RIGHT | ABE_LEFT); @@ -648,7 +648,7 @@ DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, D /************************************************************************* * SHLoadInProc [SHELL32.@] - * Create an instance of specified object class from within + * Create an instance of specified object class from within * the shell process and release it immediately */ @@ -780,7 +780,7 @@ BOOL WINAPI AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, else { char* pch = Template + strlen(Template) - strlen(__appendix_str); *pch = '\0'; - SendMessageA( GetDlgItem(hWnd, IDC_LISTBOX), LB_ADDSTRING, + SendMessageA( GetDlgItem(hWnd, IDC_LISTBOX), LB_ADDSTRING, (WPARAM)-1, (LPARAM)Template ); } @@ -844,7 +844,7 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, LPVOID template; TRACE("\n"); - + if(!(hRes = FindResourceA(shell32_hInstance, "SHELL_ABOUT_MSGBOX", RT_DIALOGA))) return FALSE; if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes))) @@ -910,14 +910,14 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi) */ void (WINAPI *pDLLInitComctl)(LPVOID); -LPVOID (WINAPI *pCOMCTL32_Alloc) (INT); -BOOL (WINAPI *pCOMCTL32_Free) (LPVOID); +LPVOID (WINAPI *pCOMCTL32_Alloc) (INT); +BOOL (WINAPI *pCOMCTL32_Free) (LPVOID); -HDPA (WINAPI *pDPA_Create) (INT); -INT (WINAPI *pDPA_InsertPtr) (const HDPA, INT, LPVOID); -BOOL (WINAPI *pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM); -LPVOID (WINAPI *pDPA_GetPtr) (const HDPA, INT); -BOOL (WINAPI *pDPA_Destroy) (const HDPA); +HDPA (WINAPI *pDPA_Create) (INT); +INT (WINAPI *pDPA_InsertPtr) (const HDPA, INT, LPVOID); +BOOL (WINAPI *pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM); +LPVOID (WINAPI *pDPA_GetPtr) (const HDPA, INT); +BOOL (WINAPI *pDPA_Destroy) (const HDPA); INT (WINAPI *pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT); LPVOID (WINAPI *pDPA_DeletePtr) (const HDPA hdpa, INT i); HANDLE (WINAPI *pCreateMRUListA) (LPVOID lpcml); @@ -929,7 +929,7 @@ INT (WINAPI *pEnumMRUListA) (HANDLE hList, INT nItemPos, LPVOID lpBuffer, DW static HINSTANCE hComctl32; LONG shell32_ObjCount = 0; -HINSTANCE shell32_hInstance = 0; +HINSTANCE shell32_hInstance = 0; HIMAGELIST ShellSmallIconList = 0; HIMAGELIST ShellBigIconList = 0; @@ -949,7 +949,7 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) { case DLL_PROCESS_ATTACH: shell32_hInstance = hinstDLL; - hComctl32 = GetModuleHandleA("COMCTL32.DLL"); + hComctl32 = GetModuleHandleA("COMCTL32.DLL"); DisableThreadLibraryCalls(shell32_hInstance); if (!hComctl32) @@ -996,7 +996,7 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) case DLL_PROCESS_DETACH: shell32_hInstance = 0; - if (pdesktopfolder) + if (pdesktopfolder) { IShellFolder_Release(pdesktopfolder); pdesktopfolder = NULL; @@ -1004,7 +1004,7 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) SIC_Destroy(); FreeChangeNotifications(); - + /* this one is here to check if AddRef/Release is balanced */ if (shell32_ObjCount) { @@ -1019,7 +1019,7 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) * DllInstall [SHELL32.@] * * PARAMETERS - * + * * BOOL bInstall - TRUE for install, FALSE for uninstall * LPCWSTR pszCmdLine - command line (unused by shell32?) */ diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index ad859d2ef31..0e03fc8cc09 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -48,14 +48,14 @@ extern HDPA sic_hdpa; */ extern void (WINAPI *pDLLInitComctl)(LPVOID); -extern LPVOID (WINAPI *pCOMCTL32_Alloc) (INT); -extern BOOL (WINAPI *pCOMCTL32_Free) (LPVOID); +extern LPVOID (WINAPI *pCOMCTL32_Alloc) (INT); +extern BOOL (WINAPI *pCOMCTL32_Free) (LPVOID); -extern HDPA (WINAPI *pDPA_Create) (INT); -extern INT (WINAPI *pDPA_InsertPtr) (const HDPA, INT, LPVOID); -extern BOOL (WINAPI *pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM); -extern LPVOID (WINAPI *pDPA_GetPtr) (const HDPA, INT); -extern BOOL (WINAPI *pDPA_Destroy) (const HDPA); +extern HDPA (WINAPI *pDPA_Create) (INT); +extern INT (WINAPI *pDPA_InsertPtr) (const HDPA, INT, LPVOID); +extern BOOL (WINAPI *pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM); +extern LPVOID (WINAPI *pDPA_GetPtr) (const HDPA, INT); +extern BOOL (WINAPI *pDPA_Destroy) (const HDPA); extern INT (WINAPI *pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT); extern LPVOID (WINAPI *pDPA_DeletePtr) (const HDPA hdpa, INT i); extern HANDLE (WINAPI *pCreateMRUListA) (LPVOID lpcml); @@ -63,7 +63,7 @@ extern DWORD (WINAPI *pFreeMRUListA) (HANDLE hMRUList); extern INT (WINAPI *pAddMRUData) (HANDLE hList, LPCVOID lpData, DWORD cbData); extern INT (WINAPI *pFindMRUData) (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum); extern INT (WINAPI *pEnumMRUListA) (HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize); -#define pDPA_GetPtrCount(hdpa) (*(INT*)(hdpa)) +#define pDPA_GetPtrCount(hdpa) (*(INT*)(hdpa)) /* ole2 */ /* @@ -113,7 +113,7 @@ IShellFolder * ISF_Desktop_Constructor(void); LPENUMIDLIST IEnumIDList_Constructor(LPCSTR,DWORD,DWORD); LPEXTRACTICONA IExtractIconA_Constructor(LPITEMIDLIST); -HRESULT CreateStreamOnFile (LPCSTR pszFilename, IStream ** ppstm); +HRESULT CreateStreamOnFile (LPCSTR pszFilename, IStream ** ppstm); /* FIXME: rename the functions when the shell32.dll has it's own exports namespace */ HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv); @@ -154,7 +154,7 @@ HRESULT (WINAPI *pOleInitialize)(LPVOID reserved); void (WINAPI *pOleUninitialize)(void); HRESULT (WINAPI *pRegisterDragDrop)(HWND hwnd, IDropTarget* pDropTarget); HRESULT (WINAPI *pRevokeDragDrop)(HWND hwnd); -HRESULT (WINAPI *pDoDragDrop)(LPDATAOBJECT,LPDROPSOURCE,DWORD,DWORD*); +HRESULT (WINAPI *pDoDragDrop)(LPDATAOBJECT,LPDROPSOURCE,DWORD,DWORD*); void (WINAPI *pReleaseStgMedium)(STGMEDIUM* pmedium); HRESULT (WINAPI *pOleSetClipboard)(IDataObject* pDataObj); HRESULT (WINAPI *pOleGetClipboard)(IDataObject** ppDataObj); diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c index 1f5097dcbda..1689e4993c6 100644 --- a/dlls/shell32/shelllink.c +++ b/dlls/shell32/shelllink.c @@ -59,7 +59,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); #define MAXIMIZED 0x03 #define MINIMIZED 0x07 -typedef struct _LINK_HEADER +typedef struct _LINK_HEADER { DWORD MagicStr; /* 0x00 'L','\0','\0','\0' */ GUID MagicGuid; /* 0x04 is CLSID_ShellLink */ DWORD Flag1; /* 0x14 describes elements following */ @@ -142,10 +142,10 @@ typedef struct ICOM_VTABLE(IShellLinkW)* lpvtblw; ICOM_VTABLE(IPersistFile)* lpvtblPersistFile; ICOM_VTABLE(IPersistStream)* lpvtblPersistStream; - + /* internal stream of the IPersistFile interface */ IStream* lpFileStream; - + /* data structures according to the informations in the lnk */ LPSTR sPath; LPITEMIDLIST pPidl; @@ -241,11 +241,11 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile HRESULT hRet = E_FAIL; TRACE("(%p, %s)\n",This, sFile); - + if (This->lpFileStream) IStream_Release(This->lpFileStream); - + if SUCCEEDED(CreateStreamOnFile(sFile, &(This->lpFileStream))) { if SUCCEEDED (IPersistStream_Load(StreamThis, This->lpFileStream)) @@ -253,7 +253,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile return NOERROR; } } - + return hRet; } @@ -356,7 +356,7 @@ static BOOL SaveIconResAsXPM(const BITMAPINFO *pIcon, const char *szXPMFileName) static BOOL CALLBACK EnumResNameProc(HANDLE hModule, const char *lpszType, char *lpszName, LONG lParam) { ENUMRESSTRUCT *sEnumRes = (ENUMRESSTRUCT *) lParam; - + if (!sEnumRes->nIndex--) { *sEnumRes->pResInfo = FindResourceA(hModule, lpszName, RT_GROUP_ICONA); @@ -647,7 +647,7 @@ static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFile if (This->sWorkDir) work_dir = get_unix_file_name( This->sWorkDir ); /* extract the icon */ - if (!(icon_name = extract_icon( This->sIcoPath && strlen(This->sIcoPath) ? + if (!(icon_name = extract_icon( This->sIcoPath && strlen(This->sIcoPath) ? This->sIcoPath : This->sPath, This->iIcoNdx ))) { @@ -752,7 +752,7 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *p return NOERROR; } -static ICOM_VTABLE(IPersistFile) pfvt = +static ICOM_VTABLE(IPersistFile) pfvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IPersistFile_fnQueryInterface, @@ -805,7 +805,7 @@ static ULONG WINAPI IPersistStream_fnAddRef( TRACE("(%p)\n",This); return IShellLinkA_AddRef((IShellLinkA*)This); -} +} /************************************************************************ * IPersistStream_GetClassID @@ -851,7 +851,7 @@ static HRESULT WINAPI IPersistStream_fnLoad( ULONG dwBytesRead; DWORD ret = E_FAIL; char sTemp[MAX_PATH]; - + _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); TRACE("(%p)(%p)\n", This, pLoadStream); @@ -860,7 +860,7 @@ static HRESULT WINAPI IPersistStream_fnLoad( { return STG_E_INVALIDPOINTER; } - + IStream_AddRef (pLoadStream); if(lpLinkHeader) { @@ -874,7 +874,7 @@ static HRESULT WINAPI IPersistStream_fnLoad( if (SUCCEEDED(IStream_Read(pLoadStream, &(lpLinkHeader->Pidl), lpLinkHeader->PidlSize, &dwBytesRead))) { if (pcheck (&lpLinkHeader->Pidl)) - { + { This->pPidl = ILClone (&lpLinkHeader->Pidl); SHGetPathFromIDListA(&lpLinkHeader->Pidl, sTemp); @@ -892,7 +892,7 @@ static HRESULT WINAPI IPersistStream_fnLoad( GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&This->time3, NULL, sTemp, 256); TRACE("-- time1: %s\n", sTemp); pdump (This->pPidl); -#endif +#endif ret = S_OK; } } @@ -907,7 +907,7 @@ static HRESULT WINAPI IPersistStream_fnLoad( IStream_Release (pLoadStream); pdump(This->pPidl); - + HeapFree(GetProcessHeap(), 0, lpLinkHeader); return ret; @@ -922,7 +922,7 @@ static HRESULT WINAPI IPersistStream_fnSave( BOOL fClearDirty) { _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); - + TRACE("(%p) %p %x\n", This, pOutStream, fClearDirty); return E_NOTIMPL; @@ -936,7 +936,7 @@ static HRESULT WINAPI IPersistStream_fnGetSizeMax( ULARGE_INTEGER* pcbSize) { _ICOM_THIS_From_IPersistStream(IShellLinkImpl, iface); - + TRACE("(%p)\n", This); return E_NOTIMPL; @@ -958,7 +958,7 @@ static ICOM_VTABLE(IPersistStream) psvt = /************************************************************************** * IShellLink_Constructor */ -IShellLinkA * IShellLink_Constructor(BOOL bUnicode) +IShellLinkA * IShellLink_Constructor(BOOL bUnicode) { IShellLinkImpl * sl; sl = (IShellLinkImpl *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellLinkImpl)); @@ -967,7 +967,7 @@ IShellLinkA * IShellLink_Constructor(BOOL bUnicode) sl->lpvtblw = &slvtw; sl->lpvtblPersistFile = &pfvt; sl->lpvtblPersistStream = &psvt; - + TRACE("(%p)->()\n",sl); shell32_ObjCount++; return bUnicode ? (IShellLinkA *) &(sl->lpvtblw) : (IShellLinkA *)sl; @@ -979,7 +979,7 @@ IShellLinkA * IShellLink_Constructor(BOOL bUnicode) static HRESULT WINAPI IShellLinkA_fnQueryInterface( IShellLinkA * iface, REFIID riid, LPVOID *ppvObj) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(\n\tIID:\t%s)\n",This,debugstr_guid(riid)); *ppvObj = NULL; @@ -988,11 +988,11 @@ static HRESULT WINAPI IShellLinkA_fnQueryInterface( IShellLinkA * iface, REFIID IsEqualIID(riid, &IID_IShellLinkA)) { *ppvObj = This; - } + } else if(IsEqualIID(riid, &IID_IShellLinkW)) { *ppvObj = (IShellLinkW *)&(This->lpvtblw); - } + } else if(IsEqualIID(riid, &IID_IPersistFile)) { *ppvObj = (IPersistFile *)&(This->lpvtblPersistFile); @@ -1000,7 +1000,7 @@ static HRESULT WINAPI IShellLinkA_fnQueryInterface( IShellLinkA * iface, REFIID else if(IsEqualIID(riid, &IID_IPersistStream)) { *ppvObj = (IPersistStream *)&(This->lpvtblPersistStream); - } + } if(*ppvObj) { @@ -1010,14 +1010,14 @@ static HRESULT WINAPI IShellLinkA_fnQueryInterface( IShellLinkA * iface, REFIID } TRACE("-- Interface: E_NOINTERFACE\n"); return E_NOINTERFACE; -} +} /****************************************************************************** * IShellLinkA_AddRef */ static ULONG WINAPI IShellLinkA_fnAddRef(IShellLinkA * iface) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(count=%lu)\n",This,This->ref); shell32_ObjCount++; @@ -1029,22 +1029,22 @@ static ULONG WINAPI IShellLinkA_fnAddRef(IShellLinkA * iface) static ULONG WINAPI IShellLinkA_fnRelease(IShellLinkA * iface) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(count=%lu)\n",This,This->ref); shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE("-- destroying IShellLink(%p)\n",This); - + if (This->sIcoPath) HeapFree(GetProcessHeap(), 0, This->sIcoPath); - + if (This->sArgs) HeapFree(GetProcessHeap(), 0, This->sArgs); if (This->sWorkDir) HeapFree(GetProcessHeap(), 0, This->sWorkDir); - + if (This->sDescription) HeapFree(GetProcessHeap(), 0, This->sDescription); @@ -1056,7 +1056,7 @@ static ULONG WINAPI IShellLinkA_fnRelease(IShellLinkA * iface) if (This->lpFileStream) IStream_Release(This->lpFileStream); - + This->iIcoNdx = 0; HeapFree(GetProcessHeap(),0,This); @@ -1068,7 +1068,7 @@ static ULONG WINAPI IShellLinkA_fnRelease(IShellLinkA * iface) static HRESULT WINAPI IShellLinkA_fnGetPath(IShellLinkA * iface, LPSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)(%s)\n",This, pszFile, cchMaxPath, pfd, fFlags, debugstr_a(This->sPath)); if (This->sPath) @@ -1081,7 +1081,7 @@ static HRESULT WINAPI IShellLinkA_fnGetPath(IShellLinkA * iface, LPSTR pszFile,I static HRESULT WINAPI IShellLinkA_fnGetIDList(IShellLinkA * iface, LPITEMIDLIST * ppidl) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(ppidl=%p)\n",This, ppidl); *ppidl = ILClone(This->pPidl); @@ -1090,7 +1090,7 @@ static HRESULT WINAPI IShellLinkA_fnGetIDList(IShellLinkA * iface, LPITEMIDLIST static HRESULT WINAPI IShellLinkA_fnSetIDList(IShellLinkA * iface, LPCITEMIDLIST pidl) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(pidl=%p)\n",This, pidl); if (This->pPidl) @@ -1101,7 +1101,7 @@ static HRESULT WINAPI IShellLinkA_fnSetIDList(IShellLinkA * iface, LPCITEMIDLIST static HRESULT WINAPI IShellLinkA_fnGetDescription(IShellLinkA * iface, LPSTR pszName,INT cchMaxName) { ICOM_THIS(IShellLinkImpl, iface); - + FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName); lstrcpynA(pszName,"Description, FIXME",cchMaxName); return NOERROR; @@ -1109,7 +1109,7 @@ static HRESULT WINAPI IShellLinkA_fnGetDescription(IShellLinkA * iface, LPSTR ps static HRESULT WINAPI IShellLinkA_fnSetDescription(IShellLinkA * iface, LPCSTR pszName) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(pName=%s)\n", This, pszName); if (This->sDescription) @@ -1122,7 +1122,7 @@ static HRESULT WINAPI IShellLinkA_fnSetDescription(IShellLinkA * iface, LPCSTR p static HRESULT WINAPI IShellLinkA_fnGetWorkingDirectory(IShellLinkA * iface, LPSTR pszDir,INT cchMaxPath) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(%p len=%u)\n", This, pszDir, cchMaxPath); lstrcpynA( pszDir, This->sWorkDir ? This->sWorkDir : "", cchMaxPath ); @@ -1132,7 +1132,7 @@ static HRESULT WINAPI IShellLinkA_fnGetWorkingDirectory(IShellLinkA * iface, LPS static HRESULT WINAPI IShellLinkA_fnSetWorkingDirectory(IShellLinkA * iface, LPCSTR pszDir) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(dir=%s)\n",This, pszDir); if (This->sWorkDir) @@ -1145,7 +1145,7 @@ static HRESULT WINAPI IShellLinkA_fnSetWorkingDirectory(IShellLinkA * iface, LPC static HRESULT WINAPI IShellLinkA_fnGetArguments(IShellLinkA * iface, LPSTR pszArgs,INT cchMaxPath) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(%p len=%u)\n", This, pszArgs, cchMaxPath); lstrcpynA( pszArgs, This->sArgs ? This->sArgs : "", cchMaxPath ); @@ -1155,7 +1155,7 @@ static HRESULT WINAPI IShellLinkA_fnGetArguments(IShellLinkA * iface, LPSTR pszA static HRESULT WINAPI IShellLinkA_fnSetArguments(IShellLinkA * iface, LPCSTR pszArgs) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(args=%s)\n",This, pszArgs); if (This->sArgs) @@ -1168,7 +1168,7 @@ static HRESULT WINAPI IShellLinkA_fnSetArguments(IShellLinkA * iface, LPCSTR psz static HRESULT WINAPI IShellLinkA_fnGetHotkey(IShellLinkA * iface, WORD *pwHotkey) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(%p)(0x%08x)\n",This, pwHotkey, This->wHotKey); *pwHotkey = This->wHotKey; @@ -1178,9 +1178,9 @@ static HRESULT WINAPI IShellLinkA_fnGetHotkey(IShellLinkA * iface, WORD *pwHotke static HRESULT WINAPI IShellLinkA_fnSetHotkey(IShellLinkA * iface, WORD wHotkey) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(hotkey=%x)\n",This, wHotkey); - + This->wHotKey = wHotkey; return NOERROR; @@ -1188,7 +1188,7 @@ static HRESULT WINAPI IShellLinkA_fnSetHotkey(IShellLinkA * iface, WORD wHotkey) static HRESULT WINAPI IShellLinkA_fnGetShowCmd(IShellLinkA * iface, INT *piShowCmd) { ICOM_THIS(IShellLinkImpl, iface); - + FIXME("(%p)->(%p)\n",This, piShowCmd); *piShowCmd=0; return NOERROR; @@ -1196,14 +1196,14 @@ static HRESULT WINAPI IShellLinkA_fnGetShowCmd(IShellLinkA * iface, INT *piShowC static HRESULT WINAPI IShellLinkA_fnSetShowCmd(IShellLinkA * iface, INT iShowCmd) { ICOM_THIS(IShellLinkImpl, iface); - + FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd); return NOERROR; } static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR pszIconPath,INT cchIconPath,INT *piIcon) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon); lstrcpynA( pszIconPath, This->sIcoPath ? This->sIcoPath : "", cchIconPath ); @@ -1214,42 +1214,42 @@ static HRESULT WINAPI IShellLinkA_fnGetIconLocation(IShellLinkA * iface, LPSTR p static HRESULT WINAPI IShellLinkA_fnSetIconLocation(IShellLinkA * iface, LPCSTR pszIconPath,INT iIcon) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon); - + if (This->sIcoPath) HeapFree(GetProcessHeap(), 0, This->sIcoPath); if (!(This->sIcoPath = heap_strdup(pszIconPath))) - return E_OUTOFMEMORY; + return E_OUTOFMEMORY; This->iIcoNdx = iIcon; - + return NOERROR; } static HRESULT WINAPI IShellLinkA_fnSetRelativePath(IShellLinkA * iface, LPCSTR pszPathRel, DWORD dwReserved) { ICOM_THIS(IShellLinkImpl, iface); - + FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved); return NOERROR; } static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWORD fFlags) { ICOM_THIS(IShellLinkImpl, iface); - + FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags); return NOERROR; } static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile) { ICOM_THIS(IShellLinkImpl, iface); - + TRACE("(%p)->(path=%s)\n",This, pszFile); if (This->sPath) HeapFree(GetProcessHeap(), 0, This->sPath); if (!(This->sPath = heap_strdup(pszFile))) return E_OUTOFMEMORY; - + return NOERROR; } @@ -1257,8 +1257,8 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile) * IShellLink Implementation */ -static ICOM_VTABLE(IShellLinkA) slvt = -{ +static ICOM_VTABLE(IShellLinkA) slvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IShellLinkA_fnQueryInterface, IShellLinkA_fnAddRef, @@ -1291,7 +1291,7 @@ static HRESULT WINAPI IShellLinkW_fnQueryInterface( IShellLinkW * iface, REFIID riid, LPVOID *ppvObj) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + return IShellLinkA_QueryInterface((IShellLinkA*)This, riid, ppvObj); } @@ -1301,7 +1301,7 @@ static HRESULT WINAPI IShellLinkW_fnQueryInterface( static ULONG WINAPI IShellLinkW_fnAddRef(IShellLinkW * iface) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(count=%lu)\n",This,This->ref); return IShellLinkA_AddRef((IShellLinkA*)This); @@ -1313,7 +1313,7 @@ static ULONG WINAPI IShellLinkW_fnAddRef(IShellLinkW * iface) static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(count=%lu)\n",This,This->ref); return IShellLinkA_Release((IShellLinkA*)This); @@ -1322,7 +1322,7 @@ static ULONG WINAPI IShellLinkW_fnRelease(IShellLinkW * iface) static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile,INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(pfile=%p len=%u find_data=%p flags=%lu)\n",This, pszFile, cchMaxPath, pfd, fFlags); MultiByteToWideChar( CP_ACP, 0, "c:\\foo.bar", -1, pszFile, cchMaxPath ); return NOERROR; @@ -1331,7 +1331,7 @@ static HRESULT WINAPI IShellLinkW_fnGetPath(IShellLinkW * iface, LPWSTR pszFile, static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST * ppidl) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(ppidl=%p)\n",This, ppidl); *ppidl = _ILCreateDesktop(); return NOERROR; @@ -1340,7 +1340,7 @@ static HRESULT WINAPI IShellLinkW_fnGetIDList(IShellLinkW * iface, LPITEMIDLIST static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST pidl) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(pidl=%p)\n",This, pidl); return NOERROR; } @@ -1348,7 +1348,7 @@ static HRESULT WINAPI IShellLinkW_fnSetIDList(IShellLinkW * iface, LPCITEMIDLIST static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR pszName,INT cchMaxName) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(%p len=%u)\n",This, pszName, cchMaxName); MultiByteToWideChar( CP_ACP, 0, "Description, FIXME", -1, pszName, cchMaxName ); return NOERROR; @@ -1357,21 +1357,21 @@ static HRESULT WINAPI IShellLinkW_fnGetDescription(IShellLinkW * iface, LPWSTR p static HRESULT WINAPI IShellLinkW_fnSetDescription(IShellLinkW * iface, LPCWSTR pszName) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(desc=%s)\n",This, debugstr_w(pszName)); if (This->sDescription) HeapFree(GetProcessHeap(), 0, This->sDescription); if (!(This->sDescription = HEAP_strdupWtoA(GetProcessHeap(), 0, pszName))) return E_OUTOFMEMORY; - + return NOERROR; } static HRESULT WINAPI IShellLinkW_fnGetWorkingDirectory(IShellLinkW * iface, LPWSTR pszDir,INT cchMaxPath) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(%p len %u)\n", This, pszDir, cchMaxPath); MultiByteToWideChar( CP_ACP, 0, This->sWorkDir ? This->sWorkDir : "", -1, pszDir, cchMaxPath ); @@ -1382,7 +1382,7 @@ static HRESULT WINAPI IShellLinkW_fnGetWorkingDirectory(IShellLinkW * iface, LPW static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPCWSTR pszDir) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(dir=%s)\n",This, debugstr_w(pszDir)); if (This->sWorkDir) @@ -1396,7 +1396,7 @@ static HRESULT WINAPI IShellLinkW_fnSetWorkingDirectory(IShellLinkW * iface, LPC static HRESULT WINAPI IShellLinkW_fnGetArguments(IShellLinkW * iface, LPWSTR pszArgs,INT cchMaxPath) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(%p len=%u)\n", This, pszArgs, cchMaxPath); MultiByteToWideChar( CP_ACP, 0, This->sArgs ? This->sArgs : "", -1, pszArgs, cchMaxPath ); @@ -1407,21 +1407,21 @@ static HRESULT WINAPI IShellLinkW_fnGetArguments(IShellLinkW * iface, LPWSTR psz static HRESULT WINAPI IShellLinkW_fnSetArguments(IShellLinkW * iface, LPCWSTR pszArgs) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(args=%s)\n",This, debugstr_w(pszArgs)); - + if (This->sArgs) HeapFree(GetProcessHeap(), 0, This->sArgs); if (!(This->sArgs = HEAP_strdupWtoA(GetProcessHeap(), 0, pszArgs))) return E_OUTOFMEMORY; - + return NOERROR; } static HRESULT WINAPI IShellLinkW_fnGetHotkey(IShellLinkW * iface, WORD *pwHotkey) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(%p)\n",This, pwHotkey); *pwHotkey=0x0; return NOERROR; @@ -1430,7 +1430,7 @@ static HRESULT WINAPI IShellLinkW_fnGetHotkey(IShellLinkW * iface, WORD *pwHotke static HRESULT WINAPI IShellLinkW_fnSetHotkey(IShellLinkW * iface, WORD wHotkey) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(hotkey=%x)\n",This, wHotkey); return NOERROR; } @@ -1438,7 +1438,7 @@ static HRESULT WINAPI IShellLinkW_fnSetHotkey(IShellLinkW * iface, WORD wHotkey) static HRESULT WINAPI IShellLinkW_fnGetShowCmd(IShellLinkW * iface, INT *piShowCmd) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(%p)\n",This, piShowCmd); *piShowCmd=0; return NOERROR; @@ -1447,7 +1447,7 @@ static HRESULT WINAPI IShellLinkW_fnGetShowCmd(IShellLinkW * iface, INT *piShowC static HRESULT WINAPI IShellLinkW_fnSetShowCmd(IShellLinkW * iface, INT iShowCmd) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(showcmd=%x)\n",This, iShowCmd); return NOERROR; } @@ -1455,7 +1455,7 @@ static HRESULT WINAPI IShellLinkW_fnSetShowCmd(IShellLinkW * iface, INT iShowCmd static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR pszIconPath,INT cchIconPath,INT *piIcon) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(%p len=%u iicon=%p)\n", This, pszIconPath, cchIconPath, piIcon); MultiByteToWideChar( CP_ACP, 0, This->sIcoPath ? This->sIcoPath : "", -1, pszIconPath, cchIconPath ); @@ -1467,13 +1467,13 @@ static HRESULT WINAPI IShellLinkW_fnGetIconLocation(IShellLinkW * iface, LPWSTR static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR pszIconPath,INT iIcon) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon); if (This->sIcoPath) HeapFree(GetProcessHeap(), 0, This->sIcoPath); if (!(This->sIcoPath = HEAP_strdupWtoA(GetProcessHeap(), 0, pszIconPath))) - return E_OUTOFMEMORY; + return E_OUTOFMEMORY; This->iIcoNdx = iIcon; return NOERROR; @@ -1482,7 +1482,7 @@ static HRESULT WINAPI IShellLinkW_fnSetIconLocation(IShellLinkW * iface, LPCWSTR static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR pszPathRel, DWORD dwReserved) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved); return NOERROR; } @@ -1490,7 +1490,7 @@ static HRESULT WINAPI IShellLinkW_fnSetRelativePath(IShellLinkW * iface, LPCWSTR static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWORD fFlags) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + FIXME("(%p)->(hwnd=%x flags=%lx)\n",This, hwnd, fFlags); return NOERROR; } @@ -1498,14 +1498,14 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile) { _ICOM_THIS_From_IShellLinkW(IShellLinkImpl, iface); - + TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile)); - + if (This->sPath) HeapFree(GetProcessHeap(), 0, This->sPath); if (!(This->sPath = HEAP_strdupWtoA(GetProcessHeap(), 0, pszFile))) - return E_OUTOFMEMORY; - + return E_OUTOFMEMORY; + return NOERROR; } @@ -1513,8 +1513,8 @@ static HRESULT WINAPI IShellLinkW_fnSetPath(IShellLinkW * iface, LPCWSTR pszFile * IShellLinkW Implementation */ -static ICOM_VTABLE(IShellLinkW) slvtw = -{ +static ICOM_VTABLE(IShellLinkW) slvtw = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IShellLinkW_fnQueryInterface, IShellLinkW_fnAddRef, diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 383fd1b813f..5158053f7af 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -49,7 +49,7 @@ extern HRESULT IFSFolder_Constructor( /************************************************************************* * SHCoCreateInstance [SHELL32.102] - * + * * NOTES * exported by ordinal */ @@ -63,7 +63,7 @@ LRESULT WINAPI SHCoCreateInstance( DWORD hres; IID iid; CLSID * myclsid = (CLSID*)clsid; - + if (!clsid) { if (!aclsid) return REGDB_E_CLASSNOTREG; @@ -83,7 +83,7 @@ LRESULT WINAPI SHCoCreateInstance( CoInitialize(NULL); hres = CoCreateInstance(myclsid, unknownouter, CLSCTX_INPROC_SERVER, refiid, ppv); } - + if(hres!=S_OK) { ERR("failed (0x%08lx) to create \n\tCLSID:\t%s\n\tIID:\t%s\n", @@ -103,15 +103,15 @@ HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv LPCLASSFACTORY lpclf; TRACE("\n\tCLSID:\t%s,\n\tIID:\t%s\n",debugstr_guid(rclsid),debugstr_guid(iid)); - + *ppv = NULL; - if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)|| + if(IsEqualCLSID(rclsid, &CLSID_ShellDesktop)|| IsEqualCLSID(rclsid, &CLSID_ShellLink)) { lpclf = IClassFactory_Constructor( rclsid ); - if(lpclf) + if(lpclf) { hres = IClassFactory_QueryInterface(lpclf,iid, ppv); IClassFactory_Release(lpclf); @@ -143,7 +143,7 @@ DWORD WINAPI SHCLSIDFromStringA (LPCSTR clsid, CLSID *id) DWORD WINAPI SHCLSIDFromStringW (LPWSTR clsid, CLSID *id) { TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id); - return CLSIDFromString(clsid, id); + return CLSIDFromString(clsid, id); } DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id) { @@ -162,7 +162,7 @@ DWORD WINAPI SHCLSIDFromStringAW (LPVOID clsid, CLSID *id) * What we are currently doing is not very wrong, since we always use the same * heap (ProcessHeap). */ -DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) +DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) { TRACE("(%p)\n", lpmal); return CoGetMalloc(MEMCTX_TASK, lpmal); @@ -181,17 +181,17 @@ DWORD WINAPI SHGetDesktopFolder(IShellFolder **psf) *psf=NULL; - if (!pdesktopfolder) + if (!pdesktopfolder) { lpclf = IClassFactory_Constructor(&CLSID_ShellDesktop); - if(lpclf) + if(lpclf) { hres = IClassFactory_CreateInstance(lpclf,NULL,(REFIID)&IID_IShellFolder, (void*)&pdesktopfolder); IClassFactory_Release(lpclf); - } + } } - - if (pdesktopfolder) + + if (pdesktopfolder) { /* even if we create the folder, add a ref so the application can´t destroy the folder*/ IShellFolder_AddRef(pdesktopfolder); @@ -245,20 +245,20 @@ static HRESULT WINAPI IClassFactory_fnQueryInterface( *ppvObj = NULL; if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = This; + { *ppvObj = This; } else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/ { *ppvObj = (IClassFactory*)This; - } + } if(*ppvObj) - { IUnknown_AddRef((LPUNKNOWN)*ppvObj); + { IUnknown_AddRef((LPUNKNOWN)*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } TRACE("-- Interface: %s E_NOINTERFACE\n", debugstr_guid(riid)); return E_NOINTERFACE; -} +} /****************************************************************************** * IClassFactory_AddRef */ @@ -279,7 +279,7 @@ static ULONG WINAPI IClassFactory_fnRelease(LPCLASSFACTORY iface) TRACE("(%p)->(count=%lu)\n",This,This->ref); InterlockedDecrement(&shell32_ObjCount); - if (!InterlockedDecrement(&This->ref)) + if (!InterlockedDecrement(&This->ref)) { TRACE("-- destroying IClassFactory(%p)\n",This); HeapFree(GetProcessHeap(),0,This); @@ -300,7 +300,7 @@ static HRESULT WINAPI IClassFactory_fnCreateInstance( TRACE("%p->(%p,\n\tIID:\t%s,%p)\n",This,pUnknown,debugstr_guid(riid),ppObject); *ppObject = NULL; - + if(pUnknown) { return(CLASS_E_NOAGGREGATION); @@ -313,18 +313,18 @@ static HRESULT WINAPI IClassFactory_fnCreateInstance( else if (IsEqualCLSID(This->rclsid, &CLSID_ShellLink)) { pObj = (IUnknown *)IShellLink_Constructor(FALSE); - } + } else { ERR("unknown IID requested\n\tIID:\t%s\n",debugstr_guid(riid)); return(E_NOINTERFACE); } - + if (!pObj) { return(E_OUTOFMEMORY); } - + hres = IUnknown_QueryInterface(pObj,riid, ppObject); IUnknown_Release(pObj); @@ -342,7 +342,7 @@ static HRESULT WINAPI IClassFactory_fnLockServer(LPCLASSFACTORY iface, BOOL fLoc return E_NOTIMPL; } -static ICOM_VTABLE(IClassFactory) clfvt = +static ICOM_VTABLE(IClassFactory) clfvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IClassFactory_fnQueryInterface, @@ -410,20 +410,20 @@ static HRESULT WINAPI IDefClF_fnQueryInterface( *ppvObj = NULL; if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = This; + { *ppvObj = This; } else if(IsEqualIID(riid, &IID_IClassFactory)) /*IClassFactory*/ { *ppvObj = (IClassFactory*)This; - } + } if(*ppvObj) - { IUnknown_AddRef((LPUNKNOWN)*ppvObj); + { IUnknown_AddRef((LPUNKNOWN)*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } TRACE("-- Interface: %s E_NOINTERFACE\n", debugstr_guid(riid)); return E_NOINTERFACE; -} +} /****************************************************************************** * IDefClF_fnAddRef */ @@ -445,8 +445,8 @@ static ULONG WINAPI IDefClF_fnRelease(LPCLASSFACTORY iface) InterlockedDecrement(&shell32_ObjCount); - if (!InterlockedDecrement(&This->ref)) - { + if (!InterlockedDecrement(&This->ref)) + { if (This->pcRefDll) InterlockedDecrement(This->pcRefDll); TRACE("-- destroying IClassFactory(%p)\n",This); @@ -466,7 +466,7 @@ static HRESULT WINAPI IDefClF_fnCreateInstance( TRACE("%p->(%p,\n\tIID:\t%s,%p)\n",This,pUnkOuter,debugstr_guid(riid),ppvObject); *ppvObject = NULL; - + if(pUnkOuter) return(CLASS_E_NOAGGREGATION); @@ -490,7 +490,7 @@ static HRESULT WINAPI IDefClF_fnLockServer(LPCLASSFACTORY iface, BOOL fLock) return E_NOTIMPL; } -static ICOM_VTABLE(IClassFactory) dclfvt = +static ICOM_VTABLE(IClassFactory) dclfvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IDefClF_fnQueryInterface, @@ -504,8 +504,8 @@ static ICOM_VTABLE(IClassFactory) dclfvt = * SHCreateDefClassObject [SHELL32.70] */ HRESULT WINAPI SHCreateDefClassObject( - REFIID riid, - LPVOID* ppv, + REFIID riid, + LPVOID* ppv, LPFNCREATEINSTANCE lpfnCI, /* [in] create instance callback entry */ LPDWORD pcRefDll, /* [in/out] ref count of the dll */ REFIID riidInst) /* [in] optional interface to the instance */ @@ -532,7 +532,7 @@ HRESULT WINAPI SHCreateDefClassObject( void WINAPI DragAcceptFiles(HWND hWnd, BOOL b) { LONG exstyle; - + if( !IsWindow(hWnd) ) return; exstyle = GetWindowLongA(hWnd,GWL_EXSTYLE); if (b) @@ -565,7 +565,7 @@ BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p) *p = lpDropFileStruct->pt; bRet = lpDropFileStruct->fNC; - + GlobalUnlock(hDrop); return bRet; } @@ -583,9 +583,9 @@ UINT WINAPI DragQueryFileA( LPSTR lpDrop; UINT i = 0; DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop); - + TRACE("(%08x, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength); - + if(!lpDropFileStruct) goto end; lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles; @@ -593,13 +593,13 @@ UINT WINAPI DragQueryFileA( while (i++ < lFile) { while (*lpDrop++); /* skip filename */ - if (!*lpDrop) + if (!*lpDrop) { - i = (lFile == 0xFFFFFFFF) ? i : 0; + i = (lFile == 0xFFFFFFFF) ? i : 0; goto end; } } - + i = strlen(lpDrop); i++; if (!lpszFile ) goto end; /* needed buffer size */ @@ -622,9 +622,9 @@ UINT WINAPI DragQueryFileW( LPWSTR lpwDrop; UINT i = 0; DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop); - + TRACE("(%08x, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength); - + if(!lpDropFileStruct) goto end; lpwDrop = (LPWSTR) lpDropFileStruct + lpDropFileStruct->pFiles; @@ -633,13 +633,13 @@ UINT WINAPI DragQueryFileW( while (i++ < lFile) { while (*lpwDrop++); /* skip filename */ - if (!*lpwDrop) + if (!*lpwDrop) { - i = (lFile == 0xFFFFFFFF) ? i : 0; + i = (lFile == 0xFFFFFFFF) ? i : 0; goto end; } } - + i = strlenW(lpwDrop); i++; if ( !lpszwFile) goto end; /* needed buffer size */ diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index f2fda55c7fa..bdb84817de6 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -1,7 +1,7 @@ /* * The parameters of many functions changes between different OS versions * (NT uses Unicode strings, 95 uses ASCII strings) - * + * * Copyright 1997 Marcus Meissner * 1998 Jürgen Schmied * @@ -44,14 +44,14 @@ WINE_DECLARE_DEBUG_CHANNEL(pidl); * ParseFieldA [internal] * * copies a field from a ',' delimited string - * + * * first field is nField = 1 */ DWORD WINAPI ParseFieldA( LPCSTR src, DWORD nField, LPSTR dst, - DWORD len) + DWORD len) { WARN("(%s,0x%08lx,%p,%ld) semi-stub.\n",debugstr_a(src),nField,dst,len); @@ -67,10 +67,10 @@ DWORD WINAPI ParseFieldA( /* copy part till the next ',' to dst */ while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++); - + /* finalize the string */ *dst=0x0; - + return TRUE; } @@ -78,10 +78,10 @@ DWORD WINAPI ParseFieldA( * ParseFieldW [internal] * * copies a field from a ',' delimited string - * + * * first field is nField = 1 */ -DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) +DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) { FIXME("(%s,0x%08lx,%p,%ld) stub\n", debugstr_w(src), nField, dst, len); @@ -91,7 +91,7 @@ DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len) /************************************************************************* * ParseField [SHELL32.58] */ -DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len) +DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len) { if (SHELL_OsIsUnicode()) return ParseFieldW(src, nField, dst, len); @@ -100,7 +100,7 @@ DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len) /************************************************************************* * GetFileNameFromBrowse [SHELL32.63] - * + * */ BOOL WINAPI GetFileNameFromBrowse( HWND hwndOwner, @@ -141,7 +141,7 @@ BOOL WINAPI GetFileNameFromBrowse( ofn.lpstrDefExt = lpstrDefExt; ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST; ret = pGetOpenFileNameA(&ofn); - + FreeLibrary(hmodule); return ret; } @@ -156,7 +156,7 @@ VOID WINAPI SHGetSetSettings(DWORD x, DWORD y, DWORD z) /************************************************************************* * SHGetSettings [SHELL32.@] - * + * * NOTES * the registry path are for win98 (tested) * and possibly are the same in nt40 @@ -169,11 +169,11 @@ VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask) DWORD dwDataSize = sizeof (DWORD); TRACE("(%p 0x%08lx)\n",lpsfs,dwMask); - + if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) return; - + if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize)) lpsfs->fShowExtensions = ((dwData == 0) ? 0 : 1); @@ -215,7 +215,7 @@ VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask) * SHShellFolderView_Message [SHELL32.73] * * PARAMETERS - * hwndCabinet defines the explorer cabinet window that contains the + * hwndCabinet defines the explorer cabinet window that contains the * shellview you need to communicate with * uMsg identifying the SFVM enum to perform * lParam @@ -227,7 +227,7 @@ VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask) * that was clicked. */ int WINAPI SHShellFolderView_Message( - HWND hwndCabinet, + HWND hwndCabinet, DWORD dwMessage, DWORD dwParam) { @@ -241,7 +241,7 @@ int WINAPI SHShellFolderView_Message( * PARAMS * hwnd [I] window handle * y [I] flag ???? - * + * * NOTES * exported by ordinal */ @@ -292,7 +292,7 @@ int WINAPIV ShellMessageBoxW( else pszText = lpText; - FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args); va_end(args); @@ -334,7 +334,7 @@ int WINAPIV ShellMessageBoxA( else pszText = lpText; - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, pszText, 0, 0, (LPSTR)&pszTemp, 0, &args); va_end(args); @@ -352,7 +352,7 @@ int WINAPIV ShellMessageBoxA( * exported by ordinal */ #define MEM_DEBUG 0 -void WINAPI SHFree(LPVOID x) +void WINAPI SHFree(LPVOID x) { #if MEM_DEBUG WORD len = *(LPWORD)((LPBYTE)x-2); @@ -381,7 +381,7 @@ void WINAPI SHFree(LPVOID x) * void *task_alloc(DWORD len), uses SHMalloc allocator * exported by ordinal */ -LPVOID WINAPI SHAlloc(DWORD len) +LPVOID WINAPI SHAlloc(DWORD len) { LPBYTE ret; @@ -449,7 +449,7 @@ HRESULT WINAPI SHDoDragDrop( /************************************************************************* * ArrangeWindows [SHELL32.184] - * + * */ WORD WINAPI ArrangeWindows( HWND hwndParent, @@ -495,7 +495,7 @@ static INT SHADD_get_policy(LPSTR policy, LPDWORD type, LPVOID buffer, LPDWORD l HKEY Policy_basekey; INT ret; - /* Get the key for the policies location in the registry + /* Get the key for the policies location in the registry */ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", @@ -553,12 +553,12 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPSTR doc_name, LPSTR new { LPSTR ptr; INT wlen; - + /*FIXME: Document: * RecentDocs MRU data structure seems to be: * +0h document file name w/ terminating 0h * +nh short int w/ size of remaining - * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown + * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown * +n+4h 10 bytes zeros - unknown * +n+eh shortcut file name w/ terminating 0h * +n+e+nh 3 zero bytes - unknown @@ -582,7 +582,7 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPSTR doc_name, LPSTR new ptr += 3; *len = ptr - buffer; - /* Add the new entry into the MRU list + /* Add the new entry into the MRU list */ return pAddMRUData(mruhandle, (LPCVOID)buffer, *len); } @@ -599,7 +599,7 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPSTR doc_name, LPSTR new * * FIXME: ?? MSDN shows this as a VOID */ -DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) +DWORD WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv) { /* FIXME: !!! move CREATEMRULIST and flags to header file !!! */ @@ -644,7 +644,7 @@ typedef struct tagCREATEMRULIST * RecentDocs MRU data structure seems to be: * +0h document file name w/ terminating 0h * +nh short int w/ size of remaining - * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown + * +n+2h 02h 30h, or 01h 30h, or 00h 30h - unknown * +n+4h 10 bytes zeros - unknown * +n+eh shortcut file name w/ terminating 0h * +n+e+nh 3 zero bytes - unknown @@ -659,7 +659,7 @@ typedef struct tagCREATEMRULIST return 0; } if (ret == ERROR_SUCCESS) { - if (!( (type == REG_DWORD) || + if (!( (type == REG_DWORD) || ((type == REG_BINARY) && (datalen == 4)) )) { ERR("Error policy data for \"NoRecentDocsHistory\" not formated correctly, type=%ld, len=%ld\n", type, datalen); @@ -688,7 +688,7 @@ typedef struct tagCREATEMRULIST /* Get path to user's "Recent" directory */ if(SUCCEEDED(SHGetMalloc(&ppM))) { - if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT, + if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT, &pidl))) { SHGetPathFromIDListA(pidl, link_dir); IMalloc_Free(ppM, pidl); @@ -738,7 +738,7 @@ typedef struct tagCREATEMRULIST /* Have data to add, the jobs to be done: * 1. Add document to MRU list in registry "HKCU\Software\ * Microsoft\Windows\CurrentVersion\Explorer\RecentDocs". - * 2. Add shortcut to document in the user's Recent directory + * 2. Add shortcut to document in the user's Recent directory * (CSIDL_RECENT). * 3. Add shortcut to Start menu's Documents submenu. */ @@ -752,20 +752,20 @@ typedef struct tagCREATEMRULIST lstrcpyA(doc_name, (LPSTR) pv); } TRACE("full document name %s\n", doc_name); - PathStripPathA(doc_name);; + PathStripPathA(doc_name); TRACE("stripped document name %s\n", doc_name); /* *** JOB 1: Update registry for ...\Explorer\RecentDocs list *** */ - { /* on input needs: - * doc_name - pure file-spec, no path + { /* on input needs: + * doc_name - pure file-spec, no path * link_dir - path to the user's Recent directory * HCUbasekey - key of ...Windows\CurrentVersion\Explorer" node * creates: * new_lnk_name- pure file-spec, no path for new .lnk file * new_lnk_filepath - * - path and file name of new .lnk file + * - path and file name of new .lnk file */ CREATEMRULIST mymru; HANDLE mruhandle; @@ -793,10 +793,10 @@ typedef struct tagCREATEMRULIST len = lstrlenA(doc_name); pos = pFindMRUData(mruhandle, doc_name, len, 0); - /* Now get the MRU entry that will be replaced - * and delete the .lnk file for it + /* Now get the MRU entry that will be replaced + * and delete the .lnk file for it */ - if ((bufused = pEnumMRUListA(mruhandle, (pos == -1) ? 14 : pos, + if ((bufused = pEnumMRUListA(mruhandle, (pos == -1) ? 14 : pos, buffer, 2048)) != -1) { ptr = buffer; ptr += (lstrlenA(buffer) + 1); @@ -859,10 +859,10 @@ typedef struct tagCREATEMRULIST /* *** JOB 2: Create shortcut in user's "Recent" directory *** */ - { /* on input needs: + { /* on input needs: * doc_name - pure file-spec, no path * new_lnk_filepath - * - path and file name of new .lnk file + * - path and file name of new .lnk file * uFlags[in] - flags on call to SHAddToRecentDocs * pv[in] - document path/pidl on call to SHAddToRecentDocs */ @@ -881,7 +881,7 @@ typedef struct tagCREATEMRULIST (LPVOID )&psl); if(SUCCEEDED(hres)) { - hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile, + hres = IShellLinkA_QueryInterface(psl, &IID_IPersistFile, (LPVOID *)&pPf); if(FAILED(hres)) { /* bombed */ @@ -910,7 +910,7 @@ typedef struct tagCREATEMRULIST goto fail; } - MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1, + MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1, widelink, MAX_PATH); /* create the short cut */ hres = IPersistFile_Save(pPf, widelink, TRUE); @@ -924,7 +924,7 @@ typedef struct tagCREATEMRULIST hres = IPersistFile_SaveCompleted(pPf, widelink); IPersistFile_Release(pPf); IShellLinkA_Release(psl); - TRACE("shortcut %s has been created, result=%08lx\n", + TRACE("shortcut %s has been created, result=%08lx\n", new_lnk_filepath, hres); } else { @@ -952,13 +952,13 @@ HRESULT WINAPI SHCreateShellFolderViewEx( { IShellView * psf; HRESULT hRes; - - TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n", + + TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=0x%08lx\n", psvcbi->pshf, psvcbi->pidlFolder, psvcbi->lpfnCallback, psvcbi->uViewMode, psvcbi->dwUser); psf = IShellView_Constructor(psvcbi->pshf); - + if (!psf) return E_OUTOFMEMORY; @@ -1012,29 +1012,29 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei) int gap, len; STARTUPINFOA startup; PROCESS_INFORMATION info; - + WARN("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s incomplete\n", sei->fMask, sei->hwnd, debugstr_a(sei->lpVerb), debugstr_a(sei->lpFile), debugstr_a(sei->lpParameters), - debugstr_a(sei->lpDirectory), sei->nShow, + debugstr_a(sei->lpDirectory), sei->nShow, (sei->fMask & SEE_MASK_CLASSNAME) ? debugstr_a(sei->lpClass) : "not used"); ZeroMemory(szApplicationName,MAX_PATH); if (sei->lpFile) strcpy(szApplicationName, sei->lpFile); - + ZeroMemory(szCommandline,MAX_PATH); if (sei->lpParameters) strcpy(szCommandline, sei->lpParameters); - + if (sei->fMask & (SEE_MASK_CLASSKEY | SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY | SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT | - SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE | + SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE | SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR )) { FIXME("flags ignored: 0x%08lx\n", sei->fMask); } - + /* launch a document by fileclass like 'Wordpad.Document.1' */ if (sei->fMask & SEE_MASK_CLASSNAME) { @@ -1063,7 +1063,7 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei) pv = SHLockShared(hmem,0); sprintf(szPidl,":%p",pv ); SHUnlockShared(pv); - + gap = strlen(szPidl); len = strlen(pos)-2; memmove(pos+gap,pos+2,len); @@ -1084,7 +1084,7 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei) startup.cb = sizeof(STARTUPINFOA); if (! CreateProcessA(NULL, szApplicationName, - NULL, NULL, FALSE, 0, + NULL, NULL, FALSE, 0, NULL, sei->lpDirectory, &startup, &info)) { @@ -1098,7 +1098,7 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei) CHAR cmdline[1023]; DWORD size; - sprintf(key,"Software\\Classes\\%s",ext); + sprintf(key,"Software\\Classes\\%s",ext); size = 1023; if (!RegQueryValueA(HKEY_LOCAL_MACHINE,key,buffer,&size)) { @@ -1123,9 +1123,9 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei) } sei->hInstApp = 33; - + if(sei->fMask & SEE_MASK_NOCLOSEPROCESS) - sei->hProcess = info.hProcess; + sei->hProcess = info.hProcess; else CloseHandle( info.hProcess ); CloseHandle( info.hThread ); @@ -1142,7 +1142,7 @@ BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei) TRACE("%p\n", sei); memcpy(&seiA, sei, sizeof(SHELLEXECUTEINFOA)); - + if (sei->lpVerb) seiA.lpVerb = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpVerb); @@ -1159,7 +1159,7 @@ BOOL WINAPI ShellExecuteExW (LPSHELLEXECUTEINFOW sei) seiA.lpClass = HEAP_strdupWtoA( GetProcessHeap(), 0, sei->lpClass); else seiA.lpClass = NULL; - + ret = ShellExecuteExA(&seiA); if (seiA.lpVerb) HeapFree( GetProcessHeap(), 0, (LPSTR) seiA.lpVerb ); @@ -1282,19 +1282,19 @@ HRESULT WINAPI IsUserAdmin(void) HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID) { HGLOBAL hmem; LPVOID pmem; - + TRACE("ptr=%p size=0x%04lx procID=0x%04lx\n",psrc,size,procID); hmem = GlobalAlloc(GMEM_FIXED, size); if (!hmem) return 0; - + pmem = GlobalLock (hmem); if (! pmem) return 0; - + memcpy (pmem, psrc, size); - GlobalUnlock(hmem); + GlobalUnlock(hmem); return hmem; } /************************************************************************* @@ -1303,7 +1303,7 @@ HGLOBAL WINAPI SHAllocShared(LPVOID psrc, DWORD size, DWORD procID) * NOTES * parameter1 is return value from SHAllocShared * parameter2 is return value from GetCurrentProcessId - * the receiver of (WM_USER+2) tries to lock the HANDLE (?) + * the receiver of (WM_USER+2) tries to lock the HANDLE (?) * the return value seems to be a memory address */ LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID) @@ -1319,7 +1319,7 @@ LPVOID WINAPI SHLockShared(HANDLE hmem, DWORD procID) BOOL WINAPI SHUnlockShared(LPVOID pv) { TRACE("%p\n",pv); - return GlobalUnlock((HANDLE)pv); + return GlobalUnlock((HANDLE)pv); } /************************************************************************* * SHFreeShared [SHELL32.523] @@ -1393,7 +1393,7 @@ HRESULT WINAPI SHFlushClipboard(void) * */ BOOL WINAPI SHWaitForFileToOpen( - LPCITEMIDLIST pidl, + LPCITEMIDLIST pidl, DWORD dwFlags, DWORD dwTimeout) { @@ -1467,15 +1467,15 @@ HRESULT WINAPI DoEnvironmentSubstAW(LPVOID x, LPVOID y) /************************************************************************* * @ [SHELL32.243] - * + * * Win98+ by-ordinal routine. In Win98 this routine returns zero and * does nothing else. Possibly this does something in NT or SHELL32 5.0? * */ -BOOL WINAPI shell32_243(DWORD a, DWORD b) -{ - return FALSE; +BOOL WINAPI shell32_243(DWORD a, DWORD b) +{ + return FALSE; } /************************************************************************* diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index cb85a42eb37..ddb54f0d2bd 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -59,7 +59,7 @@ BOOL WINAPI PathAppendAW( LPVOID WINAPI PathCombineAW( LPVOID szDest, LPCVOID lpszDir, - LPCVOID lpszFile) + LPCVOID lpszFile) { if (SHELL_OsIsUnicode()) return PathCombineW( szDest, lpszDir, lpszFile ); @@ -103,7 +103,7 @@ LPVOID WINAPI PathFindFileNameAW(LPCVOID lpszPath) /************************************************************************* * PathFindExtension [SHELL32.31] */ -LPVOID WINAPI PathFindExtensionAW(LPCVOID lpszPath) +LPVOID WINAPI PathFindExtensionAW(LPCVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathFindExtensionW(lpszPath); @@ -140,7 +140,7 @@ static LPWSTR PathGetExtensionW(LPCWSTR lpszPath) /************************************************************************* * PathGetExtension [SHELL32.158] */ -LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath,DWORD void1, DWORD void2) +LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath,DWORD void1, DWORD void2) { if (SHELL_OsIsUnicode()) return PathGetExtensionW(lpszPath); @@ -150,7 +150,7 @@ LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath,DWORD void1, DWORD void2) /************************************************************************* * PathGetArgs [SHELL32.52] */ -LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath) +LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathGetArgsW(lpszPath); @@ -160,7 +160,7 @@ LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath) /************************************************************************* * PathGetDriveNumber [SHELL32.57] */ -int WINAPI PathGetDriveNumberAW(LPVOID lpszPath) +int WINAPI PathGetDriveNumberAW(LPVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathGetDriveNumberW(lpszPath); @@ -170,7 +170,7 @@ int WINAPI PathGetDriveNumberAW(LPVOID lpszPath) /************************************************************************* * PathRemoveFileSpec [SHELL32.35] */ -BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath) +BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathRemoveFileSpecW(lpszPath); @@ -180,7 +180,7 @@ BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath) /************************************************************************* * PathStripPath [SHELL32.38] */ -void WINAPI PathStripPathAW(LPVOID lpszPath) +void WINAPI PathStripPathAW(LPVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathStripPathW(lpszPath); @@ -190,7 +190,7 @@ void WINAPI PathStripPathAW(LPVOID lpszPath) /************************************************************************* * PathStripToRoot [SHELL32.50] */ -BOOL WINAPI PathStripToRootAW(LPVOID lpszPath) +BOOL WINAPI PathStripToRootAW(LPVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathStripToRootW(lpszPath); @@ -200,7 +200,7 @@ BOOL WINAPI PathStripToRootAW(LPVOID lpszPath) /************************************************************************* * PathRemoveArgs [SHELL32.251] */ -void WINAPI PathRemoveArgsAW(LPVOID lpszPath) +void WINAPI PathRemoveArgsAW(LPVOID lpszPath) { if (SHELL_OsIsUnicode()) PathRemoveArgsW(lpszPath); @@ -210,7 +210,7 @@ void WINAPI PathRemoveArgsAW(LPVOID lpszPath) /************************************************************************* * PathRemoveExtension [SHELL32.250] */ -void WINAPI PathRemoveExtensionAW(LPVOID lpszPath) +void WINAPI PathRemoveExtensionAW(LPVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathRemoveExtensionW(lpszPath); @@ -273,7 +273,7 @@ VOID WINAPI PathQuoteSpacesAW (LPVOID lpszPath) /************************************************************************* * PathUnquoteSpaces [SHELL32.56] */ -VOID WINAPI PathUnquoteSpacesAW(LPVOID str) +VOID WINAPI PathUnquoteSpacesAW(LPVOID str) { if(SHELL_OsIsUnicode()) PathUnquoteSpacesW(str); @@ -301,7 +301,7 @@ BOOL WINAPI PathIsUNCAW (LPCVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathIsUNCW( lpszPath ); - return PathIsUNCA( lpszPath ); + return PathIsUNCA( lpszPath ); } /************************************************************************* @@ -311,13 +311,13 @@ BOOL WINAPI PathIsRelativeAW (LPCVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathIsRelativeW( lpszPath ); - return PathIsRelativeA( lpszPath ); + return PathIsRelativeA( lpszPath ); } /************************************************************************* * PathIsRoot [SHELL32.29] */ -BOOL WINAPI PathIsRootAW(LPCVOID lpszPath) +BOOL WINAPI PathIsRootAW(LPCVOID lpszPath) { if (SHELL_OsIsUnicode()) return PathIsRootW(lpszPath); @@ -332,12 +332,12 @@ static BOOL PathIsExeA (LPCSTR lpszPath) LPCSTR lpszExtension = PathGetExtensionA(lpszPath); int i = 0; static char * lpszExtensions[6] = {"exe", "com", "pid", "cmd", "bat", NULL }; - + TRACE("path=%s\n",lpszPath); for(i=0; lpszExtensions[i]; i++) if (!strcasecmp(lpszExtension,lpszExtensions[i])) return TRUE; - + return FALSE; } @@ -351,12 +351,12 @@ static BOOL PathIsExeW (LPCWSTR lpszPath) static WCHAR lpszExtensions[6][4] = {{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','d','\0'}, {'c','m','d','\0'}, {'b','a','t','\0'}, {'\0'} }; - + TRACE("path=%s\n",debugstr_w(lpszPath)); for(i=0; lpszExtensions[i][0]; i++) if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE; - + return FALSE; } @@ -382,7 +382,7 @@ BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath) /************************************************************************* * PathFileExists [SHELL32.45] - */ + */ BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath) { if (SHELL_OsIsUnicode()) @@ -393,7 +393,7 @@ BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath) /************************************************************************* * PathMatchSpec [SHELL32.46] */ -BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask) +BOOL WINAPI PathMatchSpecAW(LPVOID name, LPVOID mask) { if (SHELL_OsIsUnicode()) return PathMatchSpecW( name, mask ); @@ -412,11 +412,11 @@ BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2) /************************************************************************* * IsLFNDrive [SHELL32.119] - * + * * NOTES * exported by ordinal Name */ -BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath) +BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath) { DWORD fnlen; @@ -433,7 +433,7 @@ BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath) */ BOOL WINAPI PathMakeUniqueNameA( LPSTR lpszBuffer, - DWORD dwBuffSize, + DWORD dwBuffSize, LPCSTR lpszShortName, LPCSTR lpszLongName, LPCSTR lpszPathName) @@ -449,7 +449,7 @@ BOOL WINAPI PathMakeUniqueNameA( */ BOOL WINAPI PathMakeUniqueNameW( LPWSTR lpszBuffer, - DWORD dwBuffSize, + DWORD dwBuffSize, LPCWSTR lpszShortName, LPCWSTR lpszLongName, LPCWSTR lpszPathName) @@ -465,7 +465,7 @@ BOOL WINAPI PathMakeUniqueNameW( */ BOOL WINAPI PathMakeUniqueNameAW( LPVOID lpszBuffer, - DWORD dwBuffSize, + DWORD dwBuffSize, LPCVOID lpszShortName, LPCVOID lpszLongName, LPCVOID lpszPathName) @@ -477,7 +477,7 @@ BOOL WINAPI PathMakeUniqueNameAW( /************************************************************************* * PathYetAnotherMakeUniqueName [SHELL32.75] - * + * * NOTES * exported by ordinal */ @@ -519,7 +519,7 @@ DWORD WINAPI PathCleanupSpecAW (LPCVOID x, LPVOID y) /************************************************************************* * PathQualifyA [SHELL32] */ -BOOL WINAPI PathQualifyA(LPCSTR pszPath) +BOOL WINAPI PathQualifyA(LPCSTR pszPath) { FIXME("%s\n",pszPath); return 0; @@ -528,7 +528,7 @@ BOOL WINAPI PathQualifyA(LPCSTR pszPath) /************************************************************************* * PathQualifyW [SHELL32] */ -BOOL WINAPI PathQualifyW(LPCWSTR pszPath) +BOOL WINAPI PathQualifyW(LPCWSTR pszPath) { FIXME("%s\n",debugstr_w(pszPath)); return 0; @@ -537,7 +537,7 @@ BOOL WINAPI PathQualifyW(LPCWSTR pszPath) /************************************************************************* * PathQualify [SHELL32.49] */ -BOOL WINAPI PathQualifyAW(LPCVOID pszPath) +BOOL WINAPI PathQualifyAW(LPCVOID pszPath) { if (SHELL_OsIsUnicode()) return PathQualifyW(pszPath); @@ -549,7 +549,7 @@ BOOL WINAPI PathQualifyAW(LPCVOID pszPath) */ BOOL WINAPI PathResolveA( LPSTR lpszPath, - LPCSTR *alpszPaths, + LPCSTR *alpszPaths, DWORD dwFlags) { FIXME("(%s,%p,0x%08lx),stub!\n", @@ -562,7 +562,7 @@ BOOL WINAPI PathResolveA( */ BOOL WINAPI PathResolveW( LPWSTR lpszPath, - LPCWSTR *alpszPaths, + LPCWSTR *alpszPaths, DWORD dwFlags) { FIXME("(%s,%p,0x%08lx),stub!\n", @@ -575,7 +575,7 @@ BOOL WINAPI PathResolveW( */ BOOL WINAPI PathResolveAW( LPVOID lpszPath, - LPCVOID *alpszPaths, + LPCVOID *alpszPaths, DWORD dwFlags) { if (SHELL_OsIsUnicode()) @@ -634,7 +634,7 @@ HRESULT WINAPI PathProcessCommandAW ( /************************************************************************* * PathSetDlgItemPath (SHELL32.48) */ -VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath) +VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath) { if (SHELL_OsIsUnicode()) return PathSetDlgItemPathW(hDlg, id, pszPath); return PathSetDlgItemPathA(hDlg, id, pszPath); @@ -643,10 +643,10 @@ VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int id, LPCVOID pszPath) /************************************************************************* * SHGetSpecialFolderPathA [SHELL32.@] - * + * * converts csidl to path */ - + static const char * const szSHFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"; static const char * const szSHUserFolders = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders"; static const char * const szSetup = "Software\\Microsoft\\Windows\\CurrentVersion\\Setup"; @@ -890,7 +890,7 @@ static const CSIDL_DATA CSIDL_Data[] = }, { /* CSIDL_PROGRAM_FILES_COMMON */ 4, HKLM, - "CommonFilesDir", + "CommonFilesDir", "Program Files\\Common Files" /* ? */ }, { /* CSIDL_PROGRAM_FILES_COMMONX86 */ @@ -929,7 +929,7 @@ static const CSIDL_DATA CSIDL_Data[] = NULL, }, { /* unassigned 33*/ - 0, 0, + 0, 0, NULL, NULL, }, @@ -1144,7 +1144,7 @@ BOOL WINAPI SHGetSpecialFolderPathW ( BOOL bCreate) { char szTemp[MAX_PATH]; - + if (SHGetSpecialFolderPathA(hwndOwner, szTemp, csidl, bCreate)) { if (!MultiByteToWideChar( CP_ACP, 0, szTemp, -1, szPath, MAX_PATH )) diff --git a/dlls/shell32/shellreg.c b/dlls/shell32/shellreg.c index fddd9bc7f57..4f22c760bc6 100644 --- a/dlls/shell32/shellreg.c +++ b/dlls/shell32/shellreg.c @@ -97,9 +97,9 @@ HRESULT WINAPI SHRegQueryValueW( /************************************************************************* * SHRegQueryValueExW [SHELL32.511] NT4.0 * - * FIXME + * FIXME * if the datatype REG_EXPAND_SZ then expand the string and change - * *pdwType to REG_SZ. + * *pdwType to REG_SZ. */ HRESULT WINAPI SHRegQueryValueExW ( HKEY hkey, diff --git a/dlls/shell32/shellstring.c b/dlls/shell32/shellstring.c index a1da15f0238..c1e622abea4 100644 --- a/dlls/shell32/shellstring.c +++ b/dlls/shell32/shellstring.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "winnls.h" #include "winerror.h" @@ -116,7 +116,7 @@ HRESULT WINAPI StrRetToStrNW (LPVOID dest1, DWORD len, LPSTRRET src, const ITEMI /************************************************************************* * StrRetToStrN [SHELL32.96] - * + * * converts a STRRET to a normal string * * NOTES @@ -164,12 +164,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) +BOOL WINAPI 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) +BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) { TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr); @@ -179,7 +179,7 @@ BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr) return 0; } -BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr) +BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr) { if (SHELL_OsIsUnicode()) return StrToOleStrNW (lpWide, nWide, lpStr, nStr); @@ -189,13 +189,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) +BOOL WINAPI 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) +BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) { TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle); @@ -205,7 +205,7 @@ BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle) return 0; } -BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn) +BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn) { if (SHELL_OsIsUnicode()) return OleStrToStrNW (lpOut, nOut, lpIn, nIn); diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 079649d9e9e..de153b0d190 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -44,10 +44,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(exec); /* this function is supposed to expand the escape sequences found in the registry * some diving reported that the following were used: - * + %1, %2... seem to report to parameter of index N in ShellExecute pmts + * + %1, %2... seem to report to parameter of index N in ShellExecute pmts + + %* seem to report to all parameter (or all remaining, ie after removing - * the already used %1 %2...) - * + %L seems to be %1 as long filename followed by the 8+3 variation + * the already used %1 %2...) + * + %L seems to be %1 as long filename followed by the 8+3 variation * + %l unknown * + %S unknown * + %I unknown @@ -63,19 +63,19 @@ static void argify(char* res, int len, const char* fmt, const char* lpFile) switch (*++fmt) { case '\0': - case '%': - *res++ = '%'; + case '%': + *res++ = '%'; break; - case '1': + case '1': if (SearchPathA(NULL, lpFile, ".exe", sizeof(xlpFile), xlpFile, NULL)) { - strcpy(res, xlpFile); - res += strlen(xlpFile); + strcpy(res, xlpFile); + res += strlen(xlpFile); } else { - strcpy(res, lpFile); - res += strlen(lpFile); + strcpy(res, lpFile); + res += strlen(lpFile); } break; default: FIXME("Unknown escape sequence %%%c\n", *fmt); @@ -92,7 +92,7 @@ static void argify(char* res, int len, const char* fmt, const char* lpFile) * SHELL_FindExecutable [Internal] * * Utility for code sharing between FindExecutable and ShellExecute - * in: + * in: * lpFile the name of a file * lpOperation the operation on it (open) * out: @@ -116,11 +116,11 @@ static HINSTANCE SHELL_FindExecutable(LPCSTR lpFile, LPCSTR lpOperation, char *tok; /* token pointer */ int i; /* random counter */ char xlpFile[256] = ""; /* result of SearchPath */ - + TRACE("%s\n", (lpFile != NULL) ? lpFile : "-"); - + lpResult[0] = '\0'; /* Start off with an empty return string */ - + /* trap NULL parameters on entry */ if ((lpFile == NULL) || (lpResult == NULL) || (lpOperation == NULL)) { @@ -128,30 +128,30 @@ static HINSTANCE SHELL_FindExecutable(LPCSTR lpFile, LPCSTR lpOperation, lpFile, lpOperation, lpResult); return 2; /* File not found. Close enough, I guess. */ } - + if (SearchPathA(NULL, lpFile, ".exe", sizeof(xlpFile), xlpFile, NULL)) { TRACE("SearchPathA returned non-zero\n"); lpFile = xlpFile; } - + /* First thing we need is the file's extension */ extension = strrchr(xlpFile, '.'); /* Assume last "." is the one; */ /* File->Run in progman uses */ /* .\FILE.EXE :( */ TRACE("xlpFile=%s,extension=%s\n", xlpFile, extension); - + if ((extension == NULL) || (extension == &xlpFile[strlen(xlpFile)])) { WARN("Returning 31 - No association\n"); return 31; /* no association */ } - + /* Make local copy & lowercase it for reg & 'programs=' lookup */ lstrcpynA(tmpext, extension, 5); CharLowerA(tmpext); TRACE("%s file\n", tmpext); - + /* Three places to check: */ /* 1. win.ini, [windows], programs (NB no leading '.') */ /* 2. Registry, HKEY_CLASS_ROOT\\shell\open\command */ @@ -159,7 +159,7 @@ static HINSTANCE SHELL_FindExecutable(LPCSTR lpFile, LPCSTR lpOperation, /* All I know of the order is that registry is checked before */ /* extensions; however, it'd make sense to check the programs */ /* section first, so that's what happens here. */ - + if (key) *key = '\0'; /* See if it's a program - if GetProfileString fails, we skip this @@ -169,7 +169,7 @@ static HINSTANCE SHELL_FindExecutable(LPCSTR lpFile, LPCSTR lpOperation, buffer, sizeof(buffer)) > 0) { for (i = 0;i %s\n", exec, lpFile, res); - - ret = (DdeClientTransaction(res, strlen(res) + 1, hConv, 0L, 0, + + ret = (DdeClientTransaction(res, strlen(res) + 1, hConv, 0L, 0, XTYP_EXECUTE, 10000, &tid) != DMLERR_NO_ERROR) ? 31 : 32; DdeDisconnect(hConv); error: @@ -370,13 +370,13 @@ static HINSTANCE execute_from_key(LPSTR key, LPCSTR lpFile, INT iShowCmd, BOOL i LPSTR tmp; char param[256] = ""; LONG paramlen = 256; - - /* Get the parameters needed by the application - from the associated ddeexec key */ + + /* Get the parameters needed by the application + from the associated ddeexec key */ tmp = strstr(key, "command"); assert(tmp); strcpy(tmp, "ddeexec"); - + if (RegQueryValueA(HKEY_CLASSES_ROOT, key, param, ¶mlen) == ERROR_SUCCESS) { TRACE("Got ddeexec %s => %s\n", key, param); @@ -396,48 +396,48 @@ static HINSTANCE execute_from_key(LPSTR key, LPCSTR lpFile, INT iShowCmd, BOOL i return retval; } -static HINSTANCE SHELL_Execute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, - LPCSTR lpParameters, LPCSTR lpDirectory, +static HINSTANCE SHELL_Execute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, + LPCSTR lpParameters, LPCSTR lpDirectory, INT iShowCmd, BOOL is32) { HINSTANCE retval = 31; char old_dir[1024]; char cmd[1024]; - + TRACE("(%04x,'%s','%s','%s','%s',%x)\n", hWnd, lpOperation ? lpOperation:"", lpFile ? lpFile:"", - lpParameters ? lpParameters : "", + lpParameters ? lpParameters : "", lpDirectory ? lpDirectory : "", iShowCmd); - + if (lpFile == NULL) return 0; /* should not happen */ if (lpOperation == NULL) /* default is open */ lpOperation = "open"; - + if (lpDirectory) { GetCurrentDirectoryA(sizeof(old_dir), old_dir); SetCurrentDirectoryA(lpDirectory); } - - /* First try to execute lpFile with lpParameters directly */ + + /* First try to execute lpFile with lpParameters directly */ strcpy(cmd, lpFile); - if (lpParameters) + if (lpParameters) { strcat(cmd, " "); strcat(cmd, lpParameters); } - + retval = (is32) ? WinExec(cmd, iShowCmd) : WinExec16(cmd, iShowCmd); - + /* Unable to execute lpFile directly Check if we can match an application to lpFile */ if (retval < 32) - { + { char lpstrProtocol[256]; cmd[0] = '\0'; retval = SHELL_FindExecutable(lpFile, lpOperation, cmd, lpstrProtocol); - + if (retval > 32) /* Found */ { TRACE("%s/%s => %s/%s\n", lpFile, lpOperation, cmd, lpstrProtocol); @@ -450,10 +450,10 @@ static HINSTANCE SHELL_Execute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, { LPSTR lpstrRes; INT iSize; - + lpstrRes = strchr(lpFile, ':'); iSize = lpstrRes - lpFile; - + TRACE("Got URL: %s\n", lpFile); /* Looking for ...protocol\shell\lpOperation\command */ strncpy(lpstrProtocol, lpFile, iSize); @@ -461,7 +461,7 @@ static HINSTANCE SHELL_Execute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, strcat(lpstrProtocol, "\\shell\\"); strcat(lpstrProtocol, lpOperation); strcat(lpstrProtocol, "\\command"); - + /* Remove File Protocol from lpFile */ /* In the case file://path/file */ if (!strncasecmp(lpFile, "file", iSize)) @@ -469,13 +469,13 @@ static HINSTANCE SHELL_Execute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, lpFile += iSize; while (*lpFile == ':') lpFile++; } - + retval = execute_from_key(lpstrProtocol, lpFile, iShowCmd, is32); - } + } /* Check if file specified is in the form www.??????.*** */ else if (!strncasecmp(lpFile, "www", 3)) { - /* if so, append lpFile http:// and call ShellExecute */ + /* if so, append lpFile http:// and call ShellExecute */ char lpstrTmpFile[256] = "http://" ; strcat(lpstrTmpFile, lpFile); retval = ShellExecuteA(hWnd, lpOperation, lpstrTmpFile, NULL, NULL, 0); @@ -490,11 +490,11 @@ static HINSTANCE SHELL_Execute(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, * FindExecutableA [SHELL32.@] */ HINSTANCE WINAPI FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult) -{ +{ HINSTANCE retval = 31; /* default - 'No association was found' */ char old_dir[1024]; - - TRACE("File %s, Dir %s\n", + + TRACE("File %s, Dir %s\n", (lpFile != NULL ? lpFile : "-"), (lpDirectory != NULL ? lpDirectory : "-")); lpResult[0] = '\0'; /* Start off with an empty return string */ @@ -511,9 +511,9 @@ HINSTANCE WINAPI FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResu GetCurrentDirectoryA(sizeof(old_dir), old_dir); SetCurrentDirectoryA(lpDirectory); } - + retval = SHELL_FindExecutable(lpFile, "open", lpResult, NULL); - + TRACE("returning %s\n", lpResult); if (lpDirectory) SetCurrentDirectoryA(old_dir); @@ -535,15 +535,15 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT16 iShowCmd ) -{ - return (HINSTANCE16)SHELL_Execute(hWnd, lpOperation, lpFile, +{ + return (HINSTANCE16)SHELL_Execute(hWnd, lpOperation, lpFile, lpParameters, lpDirectory, iShowCmd, FALSE ); } /************************************************************************* * ShellExecuteA [SHELL32.290] */ -HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile, +HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile, LPCSTR lpParameters,LPCSTR lpDirectory, INT iShowCmd) { TRACE("\n"); @@ -554,10 +554,10 @@ HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation,LPCSTR lpFile, /************************************************************************* * ShellExecuteW [SHELL32.294] * from shellapi.h - * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, - * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd); + * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, + * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd); */ -HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, +HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd) { FIXME(": stub\n"); diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index 1aa59ac9835..9712486f152 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -36,32 +36,32 @@ BOOL SHELL_WarnItemDelete (int nKindOfDialog, LPCSTR szDir) if(nKindOfDialog == ASK_DELETE_FILE) { - LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, + LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, sizeof(szText)); - LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, + LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, szCaption, sizeof(szCaption)); } else if(nKindOfDialog == ASK_DELETE_FOLDER) { - LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, + LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, sizeof(szText)); - LoadStringA(shell32_hInstance, IDS_DELETEFOLDER_CAPTION, + LoadStringA(shell32_hInstance, IDS_DELETEFOLDER_CAPTION, szCaption, sizeof(szCaption)); } else if(nKindOfDialog == ASK_DELETE_MULTIPLE_ITEM) { - LoadStringA(shell32_hInstance, IDS_DELETEMULTIPLE_TEXT, szText, + LoadStringA(shell32_hInstance, IDS_DELETEMULTIPLE_TEXT, szText, sizeof(szText)); - LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, + LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, szCaption, sizeof(szCaption)); } else { FIXME("Called without a valid nKindOfDialog specified!\n"); - LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, + LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, sizeof(szText)); - LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, + LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, szCaption, sizeof(szCaption)); - } + } FormatMessageA(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY, szText, 0, 0, szBuffer, sizeof(szBuffer), (va_list*)&szDir); @@ -85,10 +85,10 @@ BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI) strcpy(szTemp, pszDir); PathAddBackslashA(szTemp); strcat(szTemp, "*.*"); - + if (bShowUI && !SHELL_WarnItemDelete(ASK_DELETE_FOLDER, pszDir)) return FALSE; - + if(INVALID_HANDLE_VALUE != (hFind = FindFirstFileA(szTemp, &wfd))) { do @@ -98,7 +98,7 @@ BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI) strcpy(szTemp, pszDir); PathAddBackslashA(szTemp); strcat(szTemp, wfd.cFileName); - + if(FILE_ATTRIBUTE_DIRECTORY & wfd.dwFileAttributes) SHELL_DeleteDirectoryA(szTemp, FALSE); else @@ -121,7 +121,7 @@ BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI) { if (bShowUI && !SHELL_WarnItemDelete(ASK_DELETE_FILE, pszFile)) return FALSE; - + return DeleteFileA(pszFile); } @@ -144,7 +144,7 @@ DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) } /************************************************************************ - * Win32DeleteFile [SHELL32.164] + * Win32DeleteFile [SHELL32.164] * * Deletes a file. Also triggers a change notify if one exists. * @@ -152,7 +152,7 @@ DWORD WINAPI SHCreateDirectory(LPSECURITY_ATTRIBUTES sec,LPCSTR path) * Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be * ANSI. Is this Unicode on NT? * - */ + */ BOOL WINAPI Win32DeleteFile(LPSTR fName) { @@ -169,12 +169,12 @@ BOOL WINAPI Win32DeleteFile(LPSTR fName) * NOTES * exported by name */ -DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp) +DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp) { LPSTR pFrom = (LPSTR)lpFileOp->pFrom; LPSTR pTo = (LPSTR)lpFileOp->pTo; LPSTR pTempTo; - TRACE("flags (0x%04x) : %s%s%s%s%s%s%s%s%s%s%s%s \n", lpFileOp->fFlags, + TRACE("flags (0x%04x) : %s%s%s%s%s%s%s%s%s%s%s%s \n", lpFileOp->fFlags, lpFileOp->fFlags & FOF_MULTIDESTFILES ? "FOF_MULTIDESTFILES " : "", lpFileOp->fFlags & FOF_CONFIRMMOUSE ? "FOF_CONFIRMMOUSE " : "", lpFileOp->fFlags & FOF_SILENT ? "FOF_SILENT " : "", @@ -203,10 +203,10 @@ DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp) * multiple from filenames 1 0 1 0 1 0 1 0 * --------------- * copy files to dir 1 0 1 1 0 0 1 0 - * create dir 0 0 0 0 0 0 1 0 + * create dir 0 0 0 0 0 0 1 0 */ int multifrom = pFrom[strlen(pFrom) + 1] != '\0'; - int destisdir = PathIsDirectoryA( pTo ); + int destisdir = PathIsDirectoryA( pTo ); int copytodir = 0; TRACE("File Copy:\n"); if( destisdir ) { @@ -290,7 +290,7 @@ DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp) * NOTES * exported by name */ -DWORD WINAPI SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp) +DWORD WINAPI SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp) { FIXME("(%p):stub.\n", lpFileOp); return 1; diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index 62fde5e4469..a7086b9590d 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -3,7 +3,7 @@ * * Copyright 1997 Marcus Meissner * Copyright 1998, 1999 Juergen Schmied - * + * * IShellFolder2 and related interfaces * * This library is free software; you can redistribute it and/or @@ -67,7 +67,7 @@ typedef struct int pcsFlags; int fmt; int cxChar; - + } shvheader; /*************************************************************************** @@ -90,7 +90,7 @@ static LPCWSTR GetNextElementW(LPCWSTR pszNext,LPWSTR pszOut,DWORD dwOut) TRACE("(%s %p 0x%08lx)\n",debugstr_w(pszNext),pszOut,dwOut); *pszOut=0x0000; - + if(!pszNext || !*pszNext) return NULL; @@ -120,7 +120,7 @@ static HRESULT SHELL32_ParseNextElement( HRESULT hr = E_OUTOFMEMORY; LPITEMIDLIST pidlOut, pidlTemp = NULL; IShellFolder *psfChild; - + TRACE("(%p, %p, %s)\n",psf, pidlInOut ? *pidlInOut : NULL, debugstr_w(szNext)); @@ -134,7 +134,7 @@ static HRESULT SHELL32_ParseNextElement( pidlTemp = ILCombine(*pidlInOut, pidlOut); - if (pidlOut) + if (pidlOut) ILFree(pidlOut); } @@ -142,7 +142,7 @@ static HRESULT SHELL32_ParseNextElement( *pidlInOut = pidlTemp; TRACE("-- pidl=%p ret=0x%08lx\n", pidlInOut? *pidlInOut: NULL, hr); - return hr; + return hr; } /*********************************************************************** @@ -165,7 +165,7 @@ static HRESULT SHELL32_CoCreateInitSF ( TRACE("%p %p\n", pidlRoot, pidlChild); *ppvOut = NULL; - + /* we have to ask first for IPersistFolder, some special folders are expecting this */ hr = SHCoCreateInstance(NULL, clsid, NULL, &IID_IPersistFolder, (LPVOID*)&pPersistFolder); if (SUCCEEDED(hr)) @@ -196,12 +196,12 @@ static HRESULT SHELL32_GetDisplayNameOfChild( IShellFolder2 * psfChild; HRESULT hr = E_OUTOFMEMORY; STRRET strTemp; - + TRACE("(%p)->(pidl=%p 0x%08lx %p 0x%08lx)\n",psf,pidl,dwFlags,szOut, dwOutLen); pdump(pidl); - + if ((pidlFirst = ILCloneFirst(pidl))) - { + { hr = IShellFolder_BindToObject(psf, pidlFirst, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); if (SUCCEEDED(hr)) { @@ -243,7 +243,7 @@ static HRESULT SHELL32_GetItemAttributes( { GUID const * clsid; DWORD dwAttributes; - + TRACE("0x%08lx\n", *pdwAttributes); if (*pdwAttributes & (0xcff3fe88)) @@ -263,7 +263,7 @@ static HRESULT SHELL32_GetItemAttributes( else { *pdwAttributes &= 0xb0000154; - } + } } else if (_ILGetDataPointer(pidl)) { @@ -291,7 +291,7 @@ static HRESULT SHELL32_GetItemAttributes( * IShellFolder implementation */ -typedef struct +typedef struct { ICOM_VFIELD(IUnknown); DWORD ref; @@ -319,17 +319,17 @@ static struct ICOM_VTABLE(ISFHelper) shvt; static IShellFolder * ISF_MyComputer_Constructor(void); -#define _IShellFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblShellFolder))) -#define _ICOM_THIS_From_IShellFolder2(class, name) class* This = (class*)(((char*)name)-_IShellFolder2_Offset); - -#define _IPersistFolder_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblPersistFolder2))) -#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder_Offset); - -#define _IDropTarget_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblDropTarget))) -#define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset); +#define _IShellFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblShellFolder))) +#define _ICOM_THIS_From_IShellFolder2(class, name) class* This = (class*)(((char*)name)-_IShellFolder2_Offset); -#define _ISFHelper_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblSFHelper))) -#define _ICOM_THIS_From_ISFHelper(class, name) class* This = (class*)(((char*)name)-_ISFHelper_Offset); +#define _IPersistFolder_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblPersistFolder2))) +#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder_Offset); + +#define _IDropTarget_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblDropTarget))) +#define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset); + +#define _ISFHelper_Offset ((int)(&(((IGenericSFImpl*)0)->lpvtblSFHelper))) +#define _ICOM_THIS_From_ISFHelper(class, name) class* This = (class*)(((char*)name)-_ISFHelper_Offset); /* converts This to a interface pointer */ @@ -370,7 +370,7 @@ static HRESULT WINAPI IUnknown_fnQueryInterface( *ppvObj = NULL; - if(IsEqualIID(riid, &IID_IUnknown)) *ppvObj = _IUnknown_(This); + if(IsEqualIID(riid, &IID_IUnknown)) *ppvObj = _IUnknown_(This); else if(IsEqualIID(riid, &IID_IShellFolder)) *ppvObj = _IShellFolder_(This); else if(IsEqualIID(riid, &IID_IShellFolder2)) *ppvObj = _IShellFolder_(This); else if(IsEqualIID(riid, &IID_IPersist)) *ppvObj = _IPersist_(This); @@ -404,7 +404,7 @@ static ULONG WINAPI IUnknown_fnAddRef(IUnknown * iface) return ++(This->ref); } -static ULONG WINAPI IUnknown_fnRelease(IUnknown * iface) +static ULONG WINAPI IUnknown_fnRelease(IUnknown * iface) { ICOM_THIS(IGenericSFImpl, iface); @@ -412,7 +412,7 @@ static ULONG WINAPI IUnknown_fnRelease(IUnknown * iface) TRACE("(%p)->(count=%lu)\n",This,This->ref); shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE("-- destroying IShellFolder(%p)\n",This); @@ -429,8 +429,8 @@ static ULONG WINAPI IUnknown_fnRelease(IUnknown * iface) return This->ref; } -static ICOM_VTABLE(IUnknown) unkvt = -{ +static ICOM_VTABLE(IUnknown) unkvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IUnknown_fnQueryInterface, IUnknown_fnAddRef, @@ -482,7 +482,7 @@ HRESULT IFSFolder_Constructor( sf->lpvtblPersistFolder2=&psfvt; sf->lpvtblDropTarget=&dtvt; sf->lpvtblSFHelper=&shvt; - + sf->pclsid = (CLSID*)&CLSID_SFFile; sf->pUnkOuter = pUnkOuter ? pUnkOuter : _IUnknown_(sf); *ppv = _IUnknown_(sf); @@ -526,7 +526,7 @@ IShellFolder * IShellFolder_Constructor( TRACE("(%p)->(parent=%p, pidl=%p)\n",sf,This, pidl); pdump(pidl); - + if(pidl && iface) /* do we have a pidl? */ { int len; @@ -539,7 +539,7 @@ IShellFolder * IShellFolder_Constructor( { dwSize += strlen(This->sMyPath) ; TRACE("-- (%p)->(parent's path=%s)\n",sf, debugstr_a(This->sMyPath)); - } + } dwSize += _ILSimpleGetText(pidl,NULL,0); /* add the size of our name*/ sf->sMyPath = SHAlloc(dwSize + 2); /* '\0' and backslash */ @@ -603,7 +603,7 @@ static ULONG WINAPI IShellFolder_fnAddRef(IShellFolder2 * iface) /************************************************************************** * IShellFolder_fnRelease */ -static ULONG WINAPI IShellFolder_fnRelease(IShellFolder2 * iface) +static ULONG WINAPI IShellFolder_fnRelease(IShellFolder2 * iface) { _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) @@ -624,14 +624,14 @@ static ULONG WINAPI IShellFolder_fnRelease(IShellFolder2 * iface) * ULONG* pdwAttributes //[out] items attributes * * NOTES -* every folder tries to parse only its own (the leftmost) pidl and creates a +* every folder tries to parse only its own (the leftmost) pidl and creates a * subfolder to evaluate the remaining parts * now we can parse into namespaces implemented by shell extensions * * behaviour on win98: lpszDisplayName=NULL -> chrash * lpszDisplayName="" -> returns mycoputer-pidl * -* FIXME: +* FIXME: * pdwAttributes: not set * pchEaten: not set like in windows */ @@ -651,7 +651,7 @@ static HRESULT WINAPI IShellFolder_fnParseDisplayName( WCHAR szElement[MAX_PATH]; CHAR szTempA[MAX_PATH], szPath[MAX_PATH]; LPITEMIDLIST pidlTemp=NULL; - + TRACE("(%p)->(HWND=0x%08x,%p,%p=%s,%p,pidl=%p,%p)\n", This,hwndOwner,pbcReserved,lpszDisplayName, debugstr_w(lpszDisplayName),pchEaten,ppidl,pdwAttributes); @@ -659,9 +659,9 @@ static HRESULT WINAPI IShellFolder_fnParseDisplayName( if (!lpszDisplayName || !ppidl) return E_INVALIDARG; if (pchEaten) *pchEaten = 0; /* strange but like the original */ - + if (*lpszDisplayName) - { + { /* get the next element */ szNext = GetNextElementW(lpszDisplayName, szElement, MAX_PATH); @@ -706,7 +706,7 @@ static HRESULT WINAPI IShellFolder_fnParseDisplayName( TRACE("(%p)->(-- pidl=%p ret=0x%08lx)\n", This, ppidl? *ppidl:0, hr); - return hr; + return hr; } /************************************************************************** @@ -733,7 +733,7 @@ static HRESULT WINAPI IShellFolder_fnEnumObjects( if(!*ppEnumIDList) return E_OUTOFMEMORY; - return S_OK; + return S_OK; } /************************************************************************** @@ -753,7 +753,7 @@ static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder2 * iface, LPCITE IPersistFolder *pPersistFolder; LPITEMIDLIST absPidl; HRESULT hr; - + TRACE("(%p)->(pidl=%p,%p,\n\tIID:\t%s,%p)\n",This,pidl,pbcReserved,debugstr_guid(riid),ppvOut); if(!pidl || !ppvOut) return E_INVALIDARG; @@ -814,7 +814,7 @@ static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder2 * iface, LPCITE * PARAMETERS * LPCITEMIDLIST pidl, //[in ] complex pidl to store * LPBC pbc, //[in ] reserved -* REFIID riid, //[in ] Initial storage interface +* REFIID riid, //[in ] Initial storage interface * LPVOID* ppvObject //[out] Interface* returned */ static HRESULT WINAPI IShellFolder_fnBindToStorage( @@ -845,7 +845,7 @@ static HRESULT WINAPI IShellFolder_fnBindToStorage( * Special case - If one of the items is a Path and the other is a File, * always make the Path come before the File. * -* NOTES +* NOTES * use SCODE_CODE() on the return value to get the result */ @@ -870,7 +870,7 @@ static HRESULT WINAPI IShellFolder_fnCompareIDs( pdump (pidl1); pdump (pidl2); } - + if (!pidl1 && !pidl2) { hr = ResultFromShort(0); @@ -888,7 +888,7 @@ static HRESULT WINAPI IShellFolder_fnCompareIDs( LPPIDLDATA pd1, pd2; pd1 = _ILGetDataPointer(pidl1); pd2 = _ILGetDataPointer(pidl2); - + /* compate the types. sort order is the PT_* constant */ pt1 = ( pd1 ? pd1->type: PT_DESKTOP); pt2 = ( pd2 ? pd2->type: PT_DESKTOP); @@ -902,19 +902,19 @@ static HRESULT WINAPI IShellFolder_fnCompareIDs( _ILSimpleGetText(pidl1, szTemp1, MAX_PATH); _ILSimpleGetText(pidl2, szTemp2, MAX_PATH); nReturn = strcasecmp(szTemp1, szTemp2); - + if (nReturn == 0) /* first pidl different ? */ { pidl1 = ILGetNext(pidl1); - if (pidl1 && pidl1->mkid.cb) /* go deeper? */ + if (pidl1 && pidl1->mkid.cb) /* go deeper? */ { pidlTemp = ILCloneFirst(pidl1); pidl2 = ILGetNext(pidl2); - + hr = IShellFolder_BindToObject(iface, pidlTemp, NULL, &IID_IShellFolder, (LPVOID*)&psf); if (SUCCEEDED(hr)) - { + { nReturn = IShellFolder_CompareIDs(psf, 0, pidl1, pidl2); IShellFolder_Release(psf); hr = ResultFromShort(nReturn); @@ -936,7 +936,7 @@ static HRESULT WINAPI IShellFolder_fnCompareIDs( } } } - + TRACE("-- res=0x%08lx\n", hr); return hr; } @@ -956,7 +956,7 @@ static HRESULT WINAPI IShellFolder_fnCreateViewObject( HRESULT hr = E_INVALIDARG; TRACE("(%p)->(hwnd=0x%x,\n\tIID:\t%s,%p)\n",This,hwndOwner,debugstr_guid(riid),ppvOut); - + if(ppvOut) { *ppvOut = NULL; @@ -981,7 +981,7 @@ static HRESULT WINAPI IShellFolder_fnCreateViewObject( } } TRACE("-- (%p)->(interface=%p)\n",This, ppvOut); - return hr; + return hr; } /************************************************************************** @@ -989,8 +989,8 @@ static HRESULT WINAPI IShellFolder_fnCreateViewObject( * * PARAMETERS * UINT cidl, //[in ] num elements in pidl array -* LPCITEMIDLIST* apidl, //[in ] simple pidl array -* ULONG* rgfInOut) //[out] result array +* LPCITEMIDLIST* apidl, //[in ] simple pidl array +* ULONG* rgfInOut) //[out] result array * */ static HRESULT WINAPI IShellFolder_fnGetAttributesOf( @@ -1014,7 +1014,7 @@ static HRESULT WINAPI IShellFolder_fnGetAttributesOf( SHELL32_GetItemAttributes(_IShellFolder_(This), *apidl, rgfInOut); apidl++; cidl--; - } + } TRACE("-- result=0x%08lx\n",*rgfInOut); @@ -1028,7 +1028,7 @@ static HRESULT WINAPI IShellFolder_fnGetAttributesOf( * UINT cidl, //[in ] array size * LPCITEMIDLIST* apidl, //[in ] simple pidl array * REFIID riid, //[in ] Requested Interface -* UINT* prgfInOut, //[ ] reserved +* UINT* prgfInOut, //[ ] reserved * LPVOID* ppvObject) //[out] Resulting Interface * * NOTES @@ -1041,21 +1041,21 @@ static HRESULT WINAPI IShellFolder_fnGetAttributesOf( * a barely documented "Icon positions" structure to SetData when the drag starts, * and GetData's it if the drop is in another explorer window that needs the positions. */ -static HRESULT WINAPI IShellFolder_fnGetUIObjectOf( +static HRESULT WINAPI IShellFolder_fnGetUIObjectOf( IShellFolder2 * iface, HWND hwndOwner, UINT cidl, - LPCITEMIDLIST * apidl, - REFIID riid, + LPCITEMIDLIST * apidl, + REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) -{ +{ _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) LPITEMIDLIST pidl; - IUnknown* pObj = NULL; + IUnknown* pObj = NULL; HRESULT hr = E_INVALIDARG; - + TRACE("(%p)->(0x%04x,%u,apidl=%p,\n\tIID:%s,%p,%p)\n", This,hwndOwner,cidl,apidl,debugstr_guid(riid),prgfInOut,ppvOut); @@ -1079,13 +1079,13 @@ static HRESULT WINAPI IShellFolder_fnGetUIObjectOf( pObj = (LPUNKNOWN)IExtractIconA_Constructor( pidl ); SHFree(pidl); hr = S_OK; - } + } else if (IsEqualIID(riid, &IID_IDropTarget) && (cidl >= 1)) { hr = IShellFolder_QueryInterface(iface, &IID_IDropTarget, (LPVOID*)&pObj); } else - { + { hr = E_NOINTERFACE; } @@ -1124,12 +1124,12 @@ static HRESULT WINAPI IShellFolder_fnGetDisplayNameOf( CHAR szPath[MAX_PATH]= ""; int len = 0; BOOL bSimplePidl; - + TRACE("(%p)->(pidl=%p,0x%08lx,%p)\n",This,pidl,dwFlags,strRet); pdump(pidl); - + if(!pidl || !strRet) return E_INVALIDARG; - + bSimplePidl = _ILIsPidlSimple(pidl); /* take names of special folders only if its only this folder */ @@ -1172,7 +1172,7 @@ static HRESULT WINAPI IShellFolder_fnGetDisplayNameOf( if(doHide && szPath[0]!='.') PathRemoveExtensionA(szPath); } } - + if ( (dwFlags & SHGDN_FORPARSING) && !bSimplePidl) /* go deeper if needed */ { PathAddBackslashA(szPath); @@ -1202,10 +1202,10 @@ static HRESULT WINAPI IShellFolder_fnGetDisplayNameOf( */ static HRESULT WINAPI IShellFolder_fnSetNameOf( IShellFolder2 * iface, - HWND hwndOwner, + HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl*/ - LPCOLESTR lpName, - DWORD dwFlags, + LPCOLESTR lpName, + DWORD dwFlags, LPITEMIDLIST *pPidlOut) { _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) @@ -1224,7 +1224,7 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf( len = strlen (szSrc); _ILSimpleGetText(pidl, szSrc+len, MAX_PATH-len); } - else + else { SHGetPathFromIDListA(pidl, szSrc); } @@ -1252,7 +1252,7 @@ static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} static HRESULT WINAPI IShellFolder_fnEnumSearches( IShellFolder2 * iface, IEnumExtraSearch **ppenum) @@ -1260,7 +1260,7 @@ static HRESULT WINAPI IShellFolder_fnEnumSearches( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} static HRESULT WINAPI IShellFolder_fnGetDefaultColumn( IShellFolder2 * iface, DWORD dwRes, @@ -1275,14 +1275,14 @@ static HRESULT WINAPI IShellFolder_fnGetDefaultColumn( if (pDisplay) *pDisplay = 0; return S_OK; -} +} static HRESULT WINAPI IShellFolder_fnGetDefaultColumnState( IShellFolder2 * iface, UINT iColumn, DWORD *pcsFlags) { _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) - + TRACE("(%p)\n",This); if (!pcsFlags || iColumn >= GENERICSHELLVIEWCOLUMNS ) return E_INVALIDARG; @@ -1290,7 +1290,7 @@ static HRESULT WINAPI IShellFolder_fnGetDefaultColumnState( *pcsFlags = GenericSFHeader[iColumn].pcsFlags; return S_OK; -} +} static HRESULT WINAPI IShellFolder_fnGetDetailsEx( IShellFolder2 * iface, LPCITEMIDLIST pidl, @@ -1301,7 +1301,7 @@ static HRESULT WINAPI IShellFolder_fnGetDetailsEx( FIXME("(%p)\n",This); return E_NOTIMPL; -} +} static HRESULT WINAPI IShellFolder_fnGetDetailsOf( IShellFolder2 * iface, LPCITEMIDLIST pidl, @@ -1314,7 +1314,7 @@ static HRESULT WINAPI IShellFolder_fnGetDetailsOf( TRACE("(%p)->(%p %i %p)\n",This, pidl, iColumn, psd); if (!psd || iColumn >= GENERICSHELLVIEWCOLUMNS ) return E_INVALIDARG; - + if (!pidl) { /* the header titles */ @@ -1350,7 +1350,7 @@ static HRESULT WINAPI IShellFolder_fnGetDetailsOf( } return hr; -} +} static HRESULT WINAPI IShellFolder_fnMapNameToSCID( IShellFolder2 * iface, LPCWSTR pwszName, @@ -1359,10 +1359,10 @@ static HRESULT WINAPI IShellFolder_fnMapNameToSCID( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} -static ICOM_VTABLE(IShellFolder2) sfvt = -{ +static ICOM_VTABLE(IShellFolder2) sfvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IShellFolder_fnQueryInterface, IShellFolder_fnAddRef, @@ -1441,20 +1441,20 @@ static HRESULT WINAPI ISFHelper_fnGetUniqueName( HRESULT hr; char szText[MAX_PATH]; char * szNewFolder = "New Folder"; - + TRACE("(%p)(%s %u)\n", This, lpName, uLen); if (uLen < strlen(szNewFolder) + 4) return E_POINTER; - + strcpy(lpName, szNewFolder); - + hr = IShellFolder_fnEnumObjects(_IShellFolder2_(This), 0, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &penum); if (penum) { LPITEMIDLIST pidl; DWORD dwFetched; int i=1; - + next: IEnumIDList_Reset(penum); while(S_OK == IEnumIDList_Next(penum, 1, &pidl, &dwFetched) && dwFetched) { @@ -1462,7 +1462,7 @@ next: IEnumIDList_Reset(penum); if (0 == strcasecmp(szText, lpName)) { sprintf(lpName, "%s %d", szNewFolder, i++); - if (i > 99) + if (i > 99) { hr = E_FAIL; break; @@ -1475,7 +1475,7 @@ next: IEnumIDList_Reset(penum); } return hr; } - + /**************************************************************************** * ISFHelper_fnAddFolder * @@ -1492,7 +1492,7 @@ static HRESULT WINAPI ISFHelper_fnAddFolder( char lpstrNewDir[MAX_PATH]; DWORD bRes; HRESULT hres = E_FAIL; - + TRACE("(%p)(%s %p)\n", This, lpName, ppidlOut); strcpy(lpstrNewDir, This->sMyPath); @@ -1509,7 +1509,7 @@ static HRESULT WINAPI ISFHelper_fnAddFolder( pidl = ILCombine(This->absPidl, pidlitem); SHChangeNotifyA(SHCNE_MKDIR, SHCNF_IDLIST, pidl, NULL); - SHFree(pidl); + SHFree(pidl); if (ppidlOut) *ppidlOut = pidlitem; hres = S_OK; @@ -1546,11 +1546,11 @@ static HRESULT WINAPI ISFHelper_fnDeleteItems( BOOL bConfirm = TRUE; TRACE("(%p)(%u %p)\n", This, cidl, apidl); - + /* deleting multiple items so give a slightly different warning */ if(cidl != 1) { - char tmp[8]; + char tmp[8]; snprintf(tmp, sizeof(tmp), "%d", cidl); if(!SHELL_WarnItemDelete(ASK_DELETE_MULTIPLE_ITEM, tmp)) return E_FAIL; @@ -1574,7 +1574,7 @@ static HRESULT WINAPI ISFHelper_fnDeleteItems( } pidl = ILCombine(This->absPidl, apidl[i]); SHChangeNotifyA(SHCNE_RMDIR, SHCNF_IDLIST, pidl, NULL); - SHFree(pidl); + SHFree(pidl); } else if (_ILIsValue(apidl[i])) { @@ -1588,7 +1588,7 @@ static HRESULT WINAPI ISFHelper_fnDeleteItems( } pidl = ILCombine(This->absPidl, apidl[i]); SHChangeNotifyA(SHCNE_DELETE, SHCNF_IDLIST, pidl, NULL); - SHFree(pidl); + SHFree(pidl); } } @@ -1637,7 +1637,7 @@ static HRESULT WINAPI ISFHelper_fnCopyItems( return S_OK; } -static ICOM_VTABLE(ISFHelper) shvt = +static ICOM_VTABLE(ISFHelper) shvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISFHelper_fnQueryInterface, @@ -1703,16 +1703,16 @@ static HRESULT WINAPI ISF_Desktop_fnQueryInterface( if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ { - *ppvObj = _IUnknown_(This); + *ppvObj = _IUnknown_(This); } else if(IsEqualIID(riid, &IID_IShellFolder)) /*IShellFolder*/ { *ppvObj = _IShellFolder_(This); - } + } else if(IsEqualIID(riid, &IID_IShellFolder2)) /*IShellFolder2*/ { *ppvObj = _IShellFolder_(This); - } + } if(*ppvObj) { @@ -1745,14 +1745,14 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName( LPCWSTR szNext=NULL; LPITEMIDLIST pidlTemp=NULL; HRESULT hr=E_OUTOFMEMORY; - + TRACE("(%p)->(HWND=0x%08x,%p,%p=%s,%p,pidl=%p,%p)\n", This,hwndOwner,pbcReserved,lpszDisplayName, debugstr_w(lpszDisplayName),pchEaten,ppidl,pdwAttributes); *ppidl = 0; if (pchEaten) *pchEaten = 0; /* strange but like the original */ - + /* FIXME no real parsing implemented */ pidlTemp = _ILCreateMyComputer(); szNext = lpszDisplayName; @@ -1775,7 +1775,7 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName( TRACE("(%p)->(-- ret=0x%08lx)\n", This, hr); - return hr; + return hr; } /************************************************************************** @@ -1798,7 +1798,7 @@ static HRESULT WINAPI ISF_Desktop_fnEnumObjects( if(!*ppEnumIDList) return E_OUTOFMEMORY; - return S_OK; + return S_OK; } /************************************************************************** @@ -1823,7 +1823,7 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder2 * iface, LPCITEM { pShellFolder = ISF_MyComputer_Constructor(); } - else + else { /* shell extension */ if (!SUCCEEDED(SHELL32_CoCreateInitSF (This->absPidl, pidl, clsid, riid, (LPVOID*)&pShellFolder))) @@ -1831,7 +1831,7 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder2 * iface, LPCITEM return E_INVALIDARG; } } - } + } else { /* file system folder on the desktop */ @@ -1853,7 +1853,7 @@ static HRESULT WINAPI ISF_Desktop_fnBindToObject( IShellFolder2 * iface, LPCITEM ILFree(deskpidl); ILFree(firstpidl); } - + if (_ILIsPidlSimple(pidl)) /* no sub folders */ { *ppvOut = pShellFolder; @@ -1883,7 +1883,7 @@ static HRESULT WINAPI ISF_Desktop_fnCreateViewObject( IShellFolder2 * iface, HRESULT hr = E_INVALIDARG; TRACE("(%p)->(hwnd=0x%x,\n\tIID:\t%s,%p)\n",This,hwndOwner,debugstr_guid(riid),ppvOut); - + if(ppvOut) { *ppvOut = NULL; @@ -1909,7 +1909,7 @@ static HRESULT WINAPI ISF_Desktop_fnCreateViewObject( IShellFolder2 * iface, } } TRACE("-- (%p)->(interface=%p)\n",This, ppvOut); - return hr; + return hr; } /************************************************************************** @@ -1958,12 +1958,12 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) CHAR szPath[MAX_PATH]= ""; - + TRACE("(%p)->(pidl=%p,0x%08lx,%p)\n",This,pidl,dwFlags,strRet); pdump(pidl); - + if(!strRet) return E_INVALIDARG; - + if(!pidl) { HCR_GetClassName(&CLSID_ShellDesktop, szPath, MAX_PATH); @@ -1973,7 +1973,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf( _ILSimpleGetText(pidl, szPath, MAX_PATH); } else - { + { if (!SUCCEEDED(SHELL32_GetDisplayNameOfChild(iface, pidl, dwFlags, szPath, MAX_PATH))) return E_OUTOFMEMORY; } @@ -1992,7 +1992,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} static HRESULT WINAPI ISF_Desktop_fnEnumSearches( IShellFolder2 * iface, IEnumExtraSearch **ppenum) @@ -2000,7 +2000,7 @@ static HRESULT WINAPI ISF_Desktop_fnEnumSearches( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn( IShellFolder2 * iface, DWORD dwRes, @@ -2015,14 +2015,14 @@ static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumn( if (pDisplay) *pDisplay = 0; return S_OK; -} +} static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState( IShellFolder2 * iface, UINT iColumn, DWORD *pcsFlags) { _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) - + TRACE("(%p)\n",This); if (!pcsFlags || iColumn >= DESKTOPSHELLVIEWCOLUMNS ) return E_INVALIDARG; @@ -2030,7 +2030,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDefaultColumnState( *pcsFlags = DesktopSFHeader[iColumn].pcsFlags; return S_OK; -} +} static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx( IShellFolder2 * iface, LPCITEMIDLIST pidl, @@ -2041,7 +2041,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsEx( FIXME("(%p)\n",This); return E_NOTIMPL; -} +} static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf( IShellFolder2 * iface, LPCITEMIDLIST pidl, @@ -2049,12 +2049,12 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf( SHELLDETAILS *psd) { _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) - HRESULT hr = E_FAIL;; + HRESULT hr = E_FAIL; TRACE("(%p)->(%p %i %p)\n",This, pidl, iColumn, psd); if (!psd || iColumn >= DESKTOPSHELLVIEWCOLUMNS ) return E_INVALIDARG; - + if (!pidl) { psd->fmt = DesktopSFHeader[iColumn].fmt; @@ -2089,7 +2089,7 @@ static HRESULT WINAPI ISF_Desktop_fnGetDetailsOf( } return hr; -} +} static HRESULT WINAPI ISF_Desktop_fnMapNameToSCID( IShellFolder2 * iface, LPCWSTR pwszName, @@ -2098,10 +2098,10 @@ static HRESULT WINAPI ISF_Desktop_fnMapNameToSCID( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} -static ICOM_VTABLE(IShellFolder2) sfdvt = -{ +static ICOM_VTABLE(IShellFolder2) sfdvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISF_Desktop_fnQueryInterface, IShellFolder_fnAddRef, @@ -2185,7 +2185,7 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName( WCHAR szElement[MAX_PATH]; CHAR szTempA[MAX_PATH]; LPITEMIDLIST pidlTemp; - + TRACE("(%p)->(HWND=0x%08x,%p,%p=%s,%p,pidl=%p,%p)\n", This,hwndOwner,pbcReserved,lpszDisplayName, debugstr_w(lpszDisplayName),pchEaten,ppidl,pdwAttributes); @@ -2218,7 +2218,7 @@ static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName( TRACE("(%p)->(-- ret=0x%08lx)\n", This, hr); - return hr; + return hr; } /************************************************************************** @@ -2241,7 +2241,7 @@ static HRESULT WINAPI ISF_MyComputer_fnEnumObjects( if(!*ppEnumIDList) return E_OUTOFMEMORY; - return S_OK; + return S_OK; } /************************************************************************** @@ -2309,7 +2309,7 @@ static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject( IShellFolder2 * iface, HRESULT hr = E_INVALIDARG; TRACE("(%p)->(hwnd=0x%x,\n\tIID:\t%s,%p)\n",This,hwndOwner,debugstr_guid(riid),ppvOut); - + if(ppvOut) { *ppvOut = NULL; @@ -2335,7 +2335,7 @@ static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject( IShellFolder2 * iface, } } TRACE("-- (%p)->(interface=%p)\n",This, ppvOut); - return hr; + return hr; } /************************************************************************** @@ -2386,17 +2386,17 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf( char szPath[MAX_PATH], szDrive[18]; int len = 0; BOOL bSimplePidl; - + TRACE("(%p)->(pidl=%p,0x%08lx,%p)\n",This,pidl,dwFlags,strRet); pdump(pidl); - + if(!strRet) return E_INVALIDARG; - + szPath[0]=0x00; szDrive[0]=0x00; - - + + bSimplePidl = _ILIsPidlSimple(pidl); - + if (_ILIsSpecialFolder(pidl)) { /* take names of special folders only if its only this folder */ @@ -2427,9 +2427,9 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf( strcpy (szPath, szDrive); } } - + if (!bSimplePidl) /* go deeper if needed */ - { + { PathAddBackslashA(szPath); len = strlen(szPath); @@ -2451,7 +2451,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} static HRESULT WINAPI ISF_MyComputer_fnEnumSearches( IShellFolder2 * iface, IEnumExtraSearch **ppenum) @@ -2459,7 +2459,7 @@ static HRESULT WINAPI ISF_MyComputer_fnEnumSearches( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn( IShellFolder2 * iface, DWORD dwRes, @@ -2474,14 +2474,14 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn( if (pDisplay) *pDisplay = 0; return S_OK; -} +} static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState( IShellFolder2 * iface, UINT iColumn, DWORD *pcsFlags) { _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) - + TRACE("(%p)\n",This); if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS ) return E_INVALIDARG; @@ -2489,7 +2489,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState( *pcsFlags = MyComputerSFHeader[iColumn].pcsFlags; return S_OK; -} +} static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx( IShellFolder2 * iface, LPCITEMIDLIST pidl, @@ -2500,7 +2500,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx( FIXME("(%p)\n",This); return E_NOTIMPL; -} +} /* FIXME: drive size >4GB is rolling over */ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf( @@ -2515,7 +2515,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf( TRACE("(%p)->(%p %i %p)\n",This, pidl, iColumn, psd); if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS ) return E_INVALIDARG; - + if (!pidl) { psd->fmt = MyComputerSFHeader[iColumn].fmt; @@ -2560,7 +2560,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf( } return hr; -} +} static HRESULT WINAPI ISF_MyComputer_fnMapNameToSCID( IShellFolder2 * iface, LPCWSTR pwszName, @@ -2569,10 +2569,10 @@ static HRESULT WINAPI ISF_MyComputer_fnMapNameToSCID( _ICOM_THIS_From_IShellFolder2(IGenericSFImpl, iface) FIXME("(%p)\n",This); return E_NOTIMPL; -} +} -static ICOM_VTABLE(IShellFolder2) sfmcvt = -{ +static ICOM_VTABLE(IShellFolder2) sfmcvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IShellFolder_fnQueryInterface, IShellFolder_fnAddRef, @@ -2710,7 +2710,7 @@ static HRESULT WINAPI ISFPersistFolder2_fnGetCurFolder( LPITEMIDLIST * pidl) { _ICOM_THIS_From_IPersistFolder2(IGenericSFImpl, iface); - + TRACE("(%p)->(%p)\n",This, pidl); if (!pidl) return E_POINTER; @@ -2720,7 +2720,7 @@ static HRESULT WINAPI ISFPersistFolder2_fnGetCurFolder( return S_OK; } -static ICOM_VTABLE(IPersistFolder2) psfvt = +static ICOM_VTABLE(IPersistFolder2) psfvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISFPersistFolder2_QueryInterface, @@ -2742,13 +2742,13 @@ static BOOL ISFDropTarget_QueryDrop( DWORD dwEffect = *pdwEffect; _ICOM_THIS_From_IDropTarget(IGenericSFImpl,iface); - + *pdwEffect = DROPEFFECT_NONE; if (This->fAcceptFmt) { /* Does our interpretation of the keystate ... */ *pdwEffect = KeyStateToDropEffect(dwKeyState); - + /* ... matches the desired effect ? */ if (dwEffect & *pdwEffect) { @@ -2794,9 +2794,9 @@ static HRESULT WINAPI ISFDropTarget_DragEnter( DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) -{ +{ FORMATETC fmt; - + _ICOM_THIS_From_IDropTarget(IGenericSFImpl,iface); TRACE("(%p)->(DataObject=%p)\n",This,pDataObject); @@ -2819,7 +2819,7 @@ static HRESULT WINAPI ISFDropTarget_DragOver( _ICOM_THIS_From_IDropTarget(IGenericSFImpl,iface); TRACE("(%p)\n",This); - + if(!pdwEffect) return E_INVALIDARG; ISFDropTarget_QueryDrop(iface, dwKeyState, pdwEffect); @@ -2835,7 +2835,7 @@ static HRESULT WINAPI ISFDropTarget_DragLeave( TRACE("(%p)\n",This); This->fAcceptFmt = FALSE; - + return S_OK; } @@ -2853,7 +2853,7 @@ static HRESULT WINAPI ISFDropTarget_Drop( return E_NOTIMPL; } -static struct ICOM_VTABLE(IDropTarget) dtvt = +static struct ICOM_VTABLE(IDropTarget) dtvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISFDropTarget_QueryInterface, diff --git a/dlls/shell32/shlmenu.c b/dlls/shell32/shlmenu.c index 0cf70af676f..b81ac3b0272 100644 --- a/dlls/shell32/shlmenu.c +++ b/dlls/shell32/shlmenu.c @@ -84,7 +84,7 @@ LPFMINFO FM_GetMenuInfo(HMENU hmenu) ERR("menudata corrupt: %p %lu\n", menudata, MenuInfo.cbSize); return 0; } - + return menudata; } @@ -103,13 +103,13 @@ static LPFMINFO FM_SetMenuParameter( LPFMINFO menudata; TRACE("\n"); - + menudata = FM_GetMenuInfo(hmenu); - + if ( menudata->pidl) { SHFree(menudata->pidl); } - + menudata->uID = uID; menudata->pidl = ILClone(pidl); menudata->uFlags = uFlags; @@ -143,16 +143,16 @@ static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl) return FALSE; menudata = (LPFMINFO)MenuInfo.dwMenuData; - + if ((menudata == 0) || (MenuInfo.cbSize != sizeof(MENUINFO))) { ERR("menudata corrupt: %p %lu\n", menudata, MenuInfo.cbSize); return 0; } - + if (menudata->bInitialized) return 0; - + pidl = ((pAlternatePidl) ? pAlternatePidl : menudata->pidl); if (!pidl) return 0; @@ -164,7 +164,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl) menudata->bInitialized = FALSE; SetMenuInfo(hmenu, &MenuInfo); - + if (SUCCEEDED (SHGetDesktopFolder(&lpsf))) { if (SUCCEEDED(IShellFolder_BindToObject(lpsf, pidl,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2))) @@ -189,7 +189,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl) LPFMINFO lpFmMi; MENUINFO MenuInfo; HMENU hMenuPopup = CreatePopupMenu(); - + lpFmMi = (LPFMINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO)); lpFmMi->pidl = ILCombine(pidl, pidlTemp); @@ -240,7 +240,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl) * * NOTES * for non-root menus values are - * (ffffffff,00000000,00000000,00000000,00000000) + * (ffffffff,00000000,00000000,00000000,00000000) */ HMENU WINAPI FileMenu_Create ( COLORREF crBorderColor, @@ -283,7 +283,7 @@ void WINAPI FileMenu_Destroy (HMENU hmenu) TRACE("0x%08x\n", hmenu); FileMenu_DeleteAllItems (hmenu); - + menudata = FM_GetMenuInfo(hmenu); if ( menudata->pidl) @@ -316,9 +316,9 @@ static BOOL FileMenu_AppendItemA( TRACE("0x%08x %s 0x%08x 0x%08x 0x%08x 0x%08x\n", hMenu, (lpszText!=FM_SEPARATOR) ? lpText: NULL, uID, icon, hMenuPopup, nItemHeight); - + ZeroMemory (&mii, sizeof(MENUITEMINFOA)); - + mii.cbSize = sizeof(MENUITEMINFOA); if (lpText != FM_SEPARATOR) @@ -331,7 +331,7 @@ static BOOL FileMenu_AppendItemA( mii.fMask = MIIM_DATA; mii.dwItemData = (DWORD) myItem; } - + if ( hMenuPopup ) { /* sub menu */ mii.fMask |= MIIM_TYPE | MIIM_SUBMENU; @@ -409,7 +409,7 @@ int WINAPI FileMenu_InsertUsingPidl ( UINT uFlags, UINT uEnumFlags, LPFNFMCALLBACK lpfnCallback) -{ +{ TRACE("0x%08x 0x%08x %p 0x%08x 0x%08x %p\n", hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback); @@ -417,7 +417,7 @@ int WINAPI FileMenu_InsertUsingPidl ( bAbortInit = FALSE; - FM_SetMenuParameter(hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback); + FM_SetMenuParameter(hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback); return FM_InitMenuPopup(hmenu, NULL); } @@ -436,10 +436,10 @@ int WINAPI FileMenu_ReplaceUsingPidl( { TRACE("0x%08x 0x%08x %p 0x%08x %p\n", hmenu, uID, pidl, uEnumFlags, lpfnCallback); - + FileMenu_DeleteAllItems (hmenu); - FM_SetMenuParameter(hmenu, uID, pidl, 0, uEnumFlags, lpfnCallback); + FM_SetMenuParameter(hmenu, uID, pidl, 0, uEnumFlags, lpfnCallback); return FM_InitMenuPopup(hmenu, NULL); } @@ -449,7 +449,7 @@ int WINAPI FileMenu_ReplaceUsingPidl( */ void WINAPI FileMenu_Invalidate (HMENU hMenu) { - FIXME("0x%08x\n",hMenu); + FIXME("0x%08x\n",hMenu); } /************************************************************************* @@ -459,7 +459,7 @@ HMENU WINAPI FileMenu_FindSubMenuByPidl( HMENU hMenu, LPCITEMIDLIST pidl) { - FIXME("0x%08x %p\n",hMenu, pidl); + FIXME("0x%08x %p\n",hMenu, pidl); return 0; } @@ -474,15 +474,15 @@ int WINAPI FileMenu_AppendFilesForPidl( LPFMINFO menudata; menudata = FM_GetMenuInfo(hmenu); - + menudata->bInitialized = FALSE; - + FM_InitMenuPopup(hmenu, pidl); if (bAddSeperator) FileMenu_AppendItemA (hmenu, FM_SEPARATOR, 0, 0, 0, FM_DEFAULT_HEIGHT); - TRACE("0x%08x %p 0x%08x\n",hmenu, pidl,bAddSeperator); + TRACE("0x%08x %p 0x%08x\n",hmenu, pidl,bAddSeperator); return 0; } @@ -554,11 +554,11 @@ LRESULT WINAPI FileMenu_MeasureItem( HDC hdc = GetDC(hWnd); SIZE size; LPFMINFO menuinfo; - + TRACE("0x%08x %p %s\n", hWnd, lpmis, pMyItem->szItemText); - + GetTextExtentPoint32A(hdc, pMyItem->szItemText, pMyItem->cchItemText, &size); - + lpmis->itemWidth = size.cx + FM_LEFTBORDER + FM_ICON_SIZE + FM_SPACE1 + FM_SPACE2 + FM_RIGHTBORDER; lpmis->itemHeight = (size.cy > (FM_ICON_SIZE + FM_Y_SPACE)) ? size.cy : (FM_ICON_SIZE + FM_Y_SPACE); @@ -566,7 +566,7 @@ LRESULT WINAPI FileMenu_MeasureItem( menuinfo = FM_GetMenuInfo(pMyItem->hMenu); if (menuinfo->nBorderWidth) lpmis->itemWidth += menuinfo->nBorderWidth; - + TRACE("-- 0x%04x 0x%04x\n", lpmis->itemWidth, lpmis->itemHeight); ReleaseDC (hWnd, hdc); return 0; @@ -584,9 +584,9 @@ LRESULT WINAPI FileMenu_DrawItem( HIMAGELIST hImageList; RECT TextRect, BorderRect; LPFMINFO menuinfo; - + TRACE("0x%08x %p %s\n", hWnd, lpdis, pMyItem->szItemText); - + if (lpdis->itemState & ODS_SELECTED) { clrPrevText = SetTextColor(lpdis->hDC, GetSysColor (COLOR_HIGHLIGHTTEXT)); @@ -597,14 +597,14 @@ LRESULT WINAPI FileMenu_DrawItem( clrPrevText = SetTextColor(lpdis->hDC, GetSysColor (COLOR_MENUTEXT)); clrPrevBkgnd = SetBkColor(lpdis->hDC, GetSysColor (COLOR_MENU)); } - + CopyRect(&TextRect, &(lpdis->rcItem)); /* add the menubitmap */ menuinfo = FM_GetMenuInfo(pMyItem->hMenu); if (menuinfo->nBorderWidth) TextRect.left += menuinfo->nBorderWidth; - + BorderRect.right = menuinfo->nBorderWidth; /* FillRect(lpdis->hDC, &BorderRect, CreateSolidBrush( menuinfo->crBorderColor)); */ @@ -617,12 +617,12 @@ LRESULT WINAPI FileMenu_DrawItem( yt = yi; ExtTextOutA (lpdis->hDC, xt , yt, ETO_OPAQUE, &TextRect, pMyItem->szItemText, pMyItem->cchItemText, NULL); - + Shell_GetImageList(0, &hImageList); ImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL); TRACE("-- 0x%04x 0x%04x 0x%04x 0x%04x\n", TextRect.left, TextRect.top, TextRect.right, TextRect.bottom); - + SetTextColor(lpdis->hDC, clrPrevText); SetBkColor(lpdis->hDC, clrPrevBkgnd); @@ -633,7 +633,7 @@ LRESULT WINAPI FileMenu_DrawItem( * FileMenu_InitMenuPopup [SHELL32.109] * * NOTES - * The filemenu is a ownerdrawn menu. Call this function responding to + * The filemenu is a ownerdrawn menu. Call this function responding to * WM_INITPOPUPMENU * */ @@ -661,14 +661,14 @@ LRESULT WINAPI FileMenu_HandleMenuChar( * exported by name */ BOOL WINAPI FileMenu_DeleteAllItems (HMENU hmenu) -{ +{ MENUITEMINFOA mii; LPFMINFO menudata; int i; - + TRACE("0x%08x\n", hmenu); - + ZeroMemory ( &mii, sizeof(MENUITEMINFOA)); mii.cbSize = sizeof(MENUITEMINFOA); mii.fMask = MIIM_SUBMENU|MIIM_DATA; @@ -682,13 +682,13 @@ BOOL WINAPI FileMenu_DeleteAllItems (HMENU hmenu) if (mii.hSubMenu) FileMenu_Destroy(mii.hSubMenu); } - + while (DeleteMenu (hmenu, 0, MF_BYPOSITION)){}; menudata = FM_GetMenuInfo(hmenu); - + menudata->bInitialized = FALSE; - + return TRUE; } @@ -701,7 +701,7 @@ BOOL WINAPI FileMenu_DeleteItemByCmd (HMENU hMenu, UINT uID) MENUITEMINFOA mii; TRACE("0x%08x 0x%08x\n", hMenu, uID); - + ZeroMemory ( &mii, sizeof(MENUITEMINFOA)); mii.cbSize = sizeof(MENUITEMINFOA); mii.fMask = MIIM_SUBMENU; @@ -773,13 +773,13 @@ BOOL WINAPI FileMenu_EnableItemByCmd( /************************************************************************* * FileMenu_GetItemExtent [SHELL32.144] - * + * * NOTES * if the menu is too big, entries are getting cut away!! */ DWORD WINAPI FileMenu_GetItemExtent (HMENU hMenu, UINT uPos) { RECT rect; - + FIXME("0x%08x 0x%08x\n", hMenu, uPos); if (GetMenuItemRect(0, hMenu, uPos, &rect)) @@ -869,7 +869,7 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI } else { - bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert);; + bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert); } if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated) diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 8fdf99b74ce..bd9085d60bd 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -4,8 +4,8 @@ * Copyright 1998,1999 * * This is the view visualizing the data provied by the shellfolder. - * No direct access to data from pidls should be done from here. - * + * No direct access to data from pidls should be done from here. + * * 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 @@ -33,7 +33,7 @@ * FIXME: implement the drag and drop in the old (msg-based) way * * FIXME: when the ShellView_WndProc gets a WM_NCDESTROY should we do a - * Release() ??? + * Release() ??? */ #include @@ -62,7 +62,7 @@ typedef struct INT nLastHeaderID; }LISTVIEW_SORT_INFO, *LPLISTVIEW_SORT_INFO; -typedef struct +typedef struct { ICOM_VFIELD(IShellView); DWORD ref; ICOM_VTABLE(IOleCommandTarget)* lpvtblOleCommandTarget; @@ -89,20 +89,20 @@ typedef struct static struct ICOM_VTABLE(IShellView) svvt; static struct ICOM_VTABLE(IOleCommandTarget) ctvt; -#define _IOleCommandTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblOleCommandTarget))) -#define _ICOM_THIS_From_IOleCommandTarget(class, name) class* This = (class*)(((char*)name)-_IOleCommandTarget_Offset); +#define _IOleCommandTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblOleCommandTarget))) +#define _ICOM_THIS_From_IOleCommandTarget(class, name) class* This = (class*)(((char*)name)-_IOleCommandTarget_Offset); static struct ICOM_VTABLE(IDropTarget) dtvt; -#define _IDropTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropTarget))) -#define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset); +#define _IDropTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropTarget))) +#define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset); static struct ICOM_VTABLE(IDropSource) dsvt; -#define _IDropSource_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropSource))) -#define _ICOM_THIS_From_IDropSource(class, name) class* This = (class*)(((char*)name)-_IDropSource_Offset); +#define _IDropSource_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropSource))) +#define _ICOM_THIS_From_IDropSource(class, name) class* This = (class*)(((char*)name)-_IDropSource_Offset); static struct ICOM_VTABLE(IViewObject) vovt; -#define _IViewObject_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblViewObject))) -#define _ICOM_THIS_From_IViewObject(class, name) class* This = (class*)(((char*)name)-_IViewObject_Offset); +#define _IViewObject_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblViewObject))) +#define _ICOM_THIS_From_IViewObject(class, name) class* This = (class*)(((char*)name)-_IViewObject_Offset); /* ListView Header ID's */ #define LISTVIEW_COLUMN_NAME 0 @@ -125,7 +125,7 @@ static struct ICOM_VTABLE(IViewObject) vovt; #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp) #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp) -extern void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition, +extern void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPSTR dwTypeData, UINT fState); /* @@ -140,7 +140,7 @@ typedef struct BYTE bStyle; } MYTOOLINFO, *LPMYTOOLINFO; -MYTOOLINFO Tools[] = +MYTOOLINFO Tools[] = { { FCIDM_SHVIEW_BIGICON, 0, 0, IDS_VIEW_LARGE, TBSTATE_ENABLED, TBSTYLE_BUTTON }, { FCIDM_SHVIEW_SMALLICON, 0, 0, IDS_VIEW_SMALL, TBSTATE_ENABLED, TBSTYLE_BUTTON }, @@ -167,7 +167,7 @@ IShellView * IShellView_Constructor( IShellFolder * pFolder) sv->pSFParent = pFolder; if(pFolder) IShellFolder_AddRef(pFolder); IShellFolder_QueryInterface(sv->pSFParent, &IID_IShellFolder2, (LPVOID*)&sv->pSF2Parent); - + TRACE("(%p)->(%p)\n",sv, pFolder); shell32_ObjCount++; return (IShellView *) sv; @@ -184,7 +184,7 @@ static BOOL IsInCommDlg(IShellViewImpl * This) static HRESULT IncludeObject(IShellViewImpl * This, LPCITEMIDLIST pidl) { HRESULT ret = S_OK; - + if ( IsInCommDlg(This) ) { TRACE("ICommDlgBrowser::IncludeObject pidl=%p\n", pidl); @@ -197,7 +197,7 @@ static HRESULT IncludeObject(IShellViewImpl * This, LPCITEMIDLIST pidl) static HRESULT OnDefaultCommand(IShellViewImpl * This) { HRESULT ret = S_FALSE; - + if (IsInCommDlg(This)) { TRACE("ICommDlgBrowser::OnDefaultCommand\n"); @@ -222,7 +222,7 @@ static HRESULT OnStateChange(IShellViewImpl * This, UINT uFlags) /********************************************************** * set the toolbar of the filedialog buttons * - * - activates the buttons from the shellbrowser according to + * - activates the buttons from the shellbrowser according to * the view state */ static void CheckToolbar(IShellViewImpl * This) @@ -230,7 +230,7 @@ static void CheckToolbar(IShellViewImpl * This) LRESULT result; TRACE("\n"); - + if (IsInCommDlg(This)) { IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON, @@ -350,11 +350,11 @@ static BOOL ShellView_InitList(IShellViewImpl * This) return TRUE; } /********************************************************** -* ShellView_CompareItems() +* ShellView_CompareItems() * * NOTES * internal, CALLBACK for DSA_Sort -*/ +*/ static INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData) { int ret; @@ -362,7 +362,7 @@ static INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARA if(!lpData) return 0; - ret = (SHORT) SCODE_CODE(IShellFolder_CompareIDs((LPSHELLFOLDER)lpData, 0, (LPITEMIDLIST)lParam1, (LPITEMIDLIST)lParam2)); + ret = (SHORT) SCODE_CODE(IShellFolder_CompareIDs((LPSHELLFOLDER)lpData, 0, (LPITEMIDLIST)lParam1, (LPITEMIDLIST)lParam2)); TRACE("ret=%i\n",ret); return ret; } @@ -378,17 +378,17 @@ static INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARA * lpData [I] The column ID for the header Ctrl to process * * RETURNS - * A negative value if the first item should precede the second, - * a positive value if the first item should follow the second, + * A negative value if the first item should precede the second, + * a positive value if the first item should follow the second, * or zero if the two items are equivalent * * NOTES * FIXME: function does what ShellView_CompareItems is supposed to do. * unify it and figure out how to use the undocumented first parameter * of IShellFolder_CompareIDs to do the job this function does and - * move this code to IShellFolder. + * move this code to IShellFolder. * make LISTVIEW_SORT_INFO obsolete - * the way this function works is only usable if we had only + * the way this function works is only usable if we had only * filesystemfolders (25/10/99 jsch) */ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData) @@ -412,9 +412,9 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam nDiff = bIsFolder1 ? -1 : 1; } else - { + { /* Sort by Time: Folders or Files can be sorted */ - + if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_TIME) { _ILGetFileDateTime(pItemIdList1, &fd1); @@ -451,7 +451,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam } } /* If the Date, FileSize, FileType, Attrib was the same, sort by FileName */ - + if(nDiff == 0) { _ILSimpleGetText(pItemIdList1, strName1, MAX_PATH); @@ -470,7 +470,7 @@ static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam /********************************************************** * LV_FindItemByPidl() -*/ +*/ static int LV_FindItemByPidl( IShellViewImpl * This, LPCITEMIDLIST pidl) @@ -555,7 +555,7 @@ static BOOLEAN LV_RenameItem(IShellViewImpl * This, LPCITEMIDLIST pidlOld, LPCIT * - gets the objectlist from the shellfolder * - sorts the list * - fills the list into the view -*/ +*/ static HRESULT ShellView_FillList(IShellViewImpl * This) { @@ -568,7 +568,7 @@ static HRESULT ShellView_FillList(IShellViewImpl * This) TRACE("%p\n",This); - /* get the itemlist from the shfolder*/ + /* get the itemlist from the shfolder*/ hRes = IShellFolder_EnumObjects(This->pSFParent,This->hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList); if (hRes != S_OK) { @@ -577,7 +577,7 @@ static HRESULT ShellView_FillList(IShellViewImpl * This) return(hRes); } - /* create a pointer array */ + /* create a pointer array */ hdpa = pDPA_Create(16); if (!hdpa) { @@ -590,14 +590,14 @@ static HRESULT ShellView_FillList(IShellViewImpl * This) if (pDPA_InsertPtr(hdpa, 0x7fff, pidl) == -1) { SHFree(pidl); - } + } } /* sort the array */ pDPA_Sort(hdpa, ShellView_CompareItems, (LPARAM)This->pSFParent); /*turn the listview's redrawing off*/ - SendMessageA(This->hWndList, WM_SETREDRAW, FALSE, 0); + SendMessageA(This->hWndList, WM_SETREDRAW, FALSE, 0); for (i=0; i < DPA_GetPtrCount(hdpa); ++i) /* DPA_GetPtrCount is a macro*/ { @@ -614,19 +614,19 @@ static HRESULT ShellView_FillList(IShellViewImpl * This) IEnumIDList_Release(pEnumIDList); /* destroy the list*/ pDPA_Destroy(hdpa); - + return S_OK; } /********************************************************** * ShellView_OnCreate() -*/ +*/ static LRESULT ShellView_OnCreate(IShellViewImpl * This) { IDropTarget* pdt; NOTIFYREGISTER ntreg; IPersistFolder2 * ppf2 = NULL; - + TRACE("%p\n",This); if(ShellView_CreateList(This)) @@ -636,7 +636,7 @@ static LRESULT ShellView_OnCreate(IShellViewImpl * This) ShellView_FillList(This); } } - + if(GetShellOle()) { if (SUCCEEDED(IShellFolder_CreateViewObject(This->pSFParent, This->hWnd, &IID_IDropTarget, (LPVOID*)&pdt))) @@ -658,7 +658,7 @@ static LRESULT ShellView_OnCreate(IShellViewImpl * This) } This->hAccel = LoadAcceleratorsA(shell32_hInstance, "shv_accel"); - + return S_OK; } @@ -684,7 +684,7 @@ static HMENU ShellView_BuildFileMenu(IShellViewImpl * This) /*add the menu items*/ for(i = 0; i < nTools; i++) - { + { LoadStringA(shell32_hInstance, Tools[i].idMenuString, szText, MAX_PATH); ZeroMemory(&mii, sizeof(mii)); @@ -721,7 +721,7 @@ static void ShellView_MergeFileMenu(IShellViewImpl * This, HMENU hSubMenu) _InsertMenuItem(hSubMenu, 0, TRUE, IDM_MYFILEITEM, MFT_STRING, "dummy45", MFS_ENABLED); } - TRACE("--\n"); + TRACE("--\n"); } /********************************************************** @@ -739,7 +739,7 @@ static void ShellView_MergeViewMenu(IShellViewImpl * This, HMENU hSubMenu) ZeroMemory(&mii, sizeof(mii)); mii.cbSize = sizeof(mii); - mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA;; + mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA; mii.fType = MFT_STRING; mii.dwTypeData = "View"; mii.hSubMenu = LoadMenuA(shell32_hInstance, "MENU_001"); @@ -754,7 +754,7 @@ static void ShellView_MergeViewMenu(IShellViewImpl * This, HMENU hSubMenu) * * RETURNS * number of selected items -*/ +*/ static UINT ShellView_GetSelections(IShellViewImpl * This) { LVITEMA lvItem; @@ -769,7 +769,7 @@ static UINT ShellView_GetSelections(IShellViewImpl * This) This->apidl = (LPITEMIDLIST*)SHAlloc(This->cidl * sizeof(LPITEMIDLIST)); TRACE("selected=%i\n", This->cidl); - + if(This->apidl) { TRACE("-- Items selected =%u\n", This->cidl); @@ -804,13 +804,13 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL LPCONTEXTMENU pContextMenu = NULL; IContextMenu * pCM = NULL; CMINVOKECOMMANDINFO cmi; - + TRACE("(%p)->(0x%08x 0x%08x 0x%08x) stub\n",This, x, y, bDefault); /* look, what's selected and create a context menu object of it*/ if( ShellView_GetSelections(This) ) { - IShellFolder_GetUIObjectOf( This->pSFParent, This->hWndParent, This->cidl, This->apidl, + IShellFolder_GetUIObjectOf( This->pSFParent, This->hWndParent, This->cidl, This->apidl, (REFIID)&IID_IContextMenu, NULL, (LPVOID *)&pContextMenu); if(pContextMenu) @@ -842,7 +842,7 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL { TRACE("-- track popup\n"); uCommand = TrackPopupMenu( hMenu,TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL); - } + } if(uCommand > 0) { @@ -870,7 +870,7 @@ static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL } } else /* background context menu */ - { + { hMenu = CreatePopupMenu(); pCM = ISvBgCm_Constructor(This->pSFParent); @@ -915,7 +915,7 @@ static LRESULT ShellView_OnSize(IShellViewImpl * This, WORD wWidth, WORD wHeight * * NOTES * internal -*/ +*/ static void ShellView_OnDeactivate(IShellViewImpl * This) { TRACE("%p\n",This); @@ -936,13 +936,13 @@ static void ShellView_OnDeactivate(IShellViewImpl * This) /********************************************************** * ShellView_OnActivate() -*/ +*/ static LRESULT ShellView_OnActivate(IShellViewImpl * This, UINT uState) { OLEMENUGROUPWIDTHS omw = { {0, 0, 0, 0, 0, 0} }; MENUITEMINFOA mii; CHAR szText[MAX_PATH]; - TRACE("%p uState=%x\n",This,uState); + TRACE("%p uState=%x\n",This,uState); /*don't do anything if the state isn't really changing */ if(This->uState == uState) @@ -961,7 +961,7 @@ static LRESULT ShellView_OnActivate(IShellViewImpl * This, UINT uState) if(This->hMenu) { IShellBrowser_InsertMenusSB(This->pShellBrowser, This->hMenu, &omw); - TRACE("-- after fnInsertMenusSB\n"); + TRACE("-- after fnInsertMenusSB\n"); /*build the top level menu get the menu item's text*/ strcpy(szText,"dummy 31"); @@ -1003,12 +1003,12 @@ static LRESULT ShellView_OnActivate(IShellViewImpl * This, UINT uState) ShellView_MergeFileMenu(This, mii.hSubMenu); } } - TRACE("-- before fnSetMenuSB\n"); + TRACE("-- before fnSetMenuSB\n"); IShellBrowser_SetMenuSB(This->pShellBrowser, This->hMenu, 0, This->hWnd); } } This->uState = uState; - TRACE("--\n"); + TRACE("--\n"); return S_OK; } @@ -1021,7 +1021,7 @@ static LRESULT ShellView_OnSetFocus(IShellViewImpl * This) TRACE("%p\n",This); /* Tell the browser one of our windows has received the focus. This - should always be done before merging menus (OnActivate merges the + should always be done before merging menus (OnActivate merges the menus) if one of our windows has the focus.*/ IShellBrowser_OnViewWindowActive(This->pShellBrowser,(IShellView*) This); @@ -1038,7 +1038,7 @@ static LRESULT ShellView_OnSetFocus(IShellViewImpl * This) /********************************************************** * ShellView_OnKillFocus() -*/ +*/ static LRESULT ShellView_OnKillFocus(IShellViewImpl * This) { TRACE("(%p) stub\n",This); @@ -1055,7 +1055,7 @@ static LRESULT ShellView_OnKillFocus(IShellViewImpl * This) * * NOTES * the CmdID's are the ones from the context menu -*/ +*/ static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dwCmd, HWND hwndCmd) { TRACE("(%p)->(0x%08lx 0x%08lx 0x%08x) stub\n",This, dwCmdID, dwCmd, hwndCmd); @@ -1096,7 +1096,7 @@ static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dw This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID; ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo))); break; - + default: TRACE("-- COMMAND 0x%04lx unhandled\n", dwCmdID); } @@ -1106,7 +1106,7 @@ static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dw /********************************************************** * ShellView_OnNotify() */ - + static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpnmh) { LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)lpnmh; NMLVDISPINFOA *lpdi = (NMLVDISPINFOA *)lpnmh; @@ -1159,7 +1159,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn ListView_SortItems(lpnmlv->hdr.hwndFrom, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo))); break; - + case LVN_GETDISPINFOA: case LVN_GETDISPINFOW: TRACE("-- LVN_GETDISPINFO %p\n",This); @@ -1203,11 +1203,11 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn TRACE("-- LVN_BEGINDRAG\n"); if (ShellView_GetSelections(This)) - { + { IDataObject * pda; DWORD dwAttributes = SFGAO_CANLINK; DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE; - + if(GetShellOle()) { if (SUCCEEDED(IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, This->apidl, &IID_IDataObject,0,(LPVOID *)&pda))) @@ -1221,7 +1221,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn dwEffect |= DROPEFFECT_LINK; } } - + if (pds) { DWORD dwEffect; @@ -1262,12 +1262,12 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn lvItem.iItem = lpdi->item.iItem; lvItem.mask = LVIF_PARAM; ListView_GetItemA(This->hWndList, &lvItem); - + pidl = (LPITEMIDLIST)lpdi->item.lParam; if (!MultiByteToWideChar( CP_ACP, 0, lpdi->item.pszText, -1, wszNewName, MAX_PATH )) wszNewName[MAX_PATH-1] = 0; hr = IShellFolder_SetNameOf(This->pSFParent, 0, pidl, wszNewName, SHGDN_INFOLDER, &pidl); - + if(SUCCEEDED(hr) && pidl) { lvItem.mask = LVIF_PARAM; @@ -1279,7 +1279,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn return FALSE; } break; - + case LVN_KEYDOWN: { /* MSG msg; @@ -1289,7 +1289,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn msg.lParam = 0; msg.time = 0; msg.pt = 0;*/ - + LPNMLVKEYDOWN plvKeyDown = (LPNMLVKEYDOWN) lpnmh; /* initiate a rename of the selected file or directory */ @@ -1304,7 +1304,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn /* get selected item */ i = ListView_GetNextItem(This->hWndList, -1, LVNI_SELECTED); - + ListView_EnsureVisible(This->hWndList, i, 0); ListView_EditLabelA(This->hWndList, i); } @@ -1324,25 +1324,25 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn if(!(i = ListView_GetSelectedCount(This->hWndList))) break; - + /* allocate memory for the pidl array */ - pItems = HeapAlloc(GetProcessHeap(), 0, + pItems = HeapAlloc(GetProcessHeap(), 0, sizeof(LPITEMIDLIST) * i); - + /* retrieve all selected items */ i = 0; item_index = -1; while(ListView_GetSelectedCount(This->hWndList) > i) { /* get selected item */ - item_index = ListView_GetNextItem(This->hWndList, + item_index = ListView_GetNextItem(This->hWndList, item_index, LVNI_SELECTED); item.iItem = item_index; ListView_GetItemA(This->hWndList, &item); /* get item pidl */ pItems[i] = (LPITEMIDLIST)item.lParam; - + i++; } @@ -1359,7 +1359,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn default: TRACE("-- %p WM_COMMAND %x unhandled\n", This, lpnmh->code); - break;; + break; } return 0; } @@ -1373,7 +1373,7 @@ static LRESULT ShellView_OnChange(IShellViewImpl * This, LPITEMIDLIST * Pidls, L TRACE("(%p)(%p,%p,0x%08lx)\n", This, Pidls[0], Pidls[1], wEventId); switch(wEventId) - { + { case SHCNE_MKDIR: case SHCNE_CREATE: LV_AddItem(This, Pidls[0]); @@ -1417,9 +1417,9 @@ static LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wPara case WM_CREATE: return ShellView_OnCreate(pThis); case WM_ACTIVATE: return ShellView_OnActivate(pThis, SVUIA_ACTIVATE_FOCUS); case WM_NOTIFY: return ShellView_OnNotify(pThis,(UINT)wParam, (LPNMHDR)lParam); - case WM_COMMAND: return ShellView_OnCommand(pThis, - GET_WM_COMMAND_ID(wParam, lParam), - GET_WM_COMMAND_CMD(wParam, lParam), + case WM_COMMAND: return ShellView_OnCommand(pThis, + GET_WM_COMMAND_ID(wParam, lParam), + GET_WM_COMMAND_CMD(wParam, lParam), GET_WM_COMMAND_HWND(wParam, lParam)); case SHV_CHANGE_NOTIFY: return ShellView_OnChange(pThis, (LPITEMIDLIST*)wParam, (LONG)lParam); @@ -1460,7 +1460,7 @@ static HRESULT WINAPI IShellView_fnQueryInterface(IShellView * iface,REFIID riid if(IsEqualIID(riid, &IID_IUnknown)) { - *ppvObj = This; + *ppvObj = This; } else if(IsEqualIID(riid, &IID_IShellView)) { @@ -1516,7 +1516,7 @@ static ULONG WINAPI IShellView_fnRelease(IShellView * iface) shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying IShellView(%p)\n",This); @@ -1574,7 +1574,7 @@ static HRESULT WINAPI IShellView_fnTranslateAccelerator(IShellView * iface,LPMSG FIXME("(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",This,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam); #endif - + if ((lpmsg->message>=WM_KEYFIRST) && (lpmsg->message>=WM_KEYLAST)) { TRACE("-- key=0x04%x\n",lpmsg->wParam) ; @@ -1628,7 +1628,7 @@ static HRESULT WINAPI IShellView_fnUIActivate(IShellView * iface,UINT uState) /* IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETTEXTA, 0, (LPARAM)szName, &lResult); -*/ +*/ } return S_OK; @@ -1659,7 +1659,7 @@ static HRESULT WINAPI IShellView_fnCreateViewWindow( WNDCLASSA wc; *phWnd = 0; - + TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n",This, lpPrevView,lpfs, psb, prcView, phWnd); TRACE("-- vmode=%x flags=%x left=%i top=%i right=%i bottom=%i\n",lpfs->ViewMode, lpfs->fFlags ,prcView->left,prcView->top, prcView->right, prcView->bottom); @@ -1673,7 +1673,7 @@ static HRESULT WINAPI IShellView_fnCreateViewWindow( /* try to get the ICommDlgBrowserInterface, adds a reference !!! */ This->pCommDlgBrowser=NULL; - if ( SUCCEEDED (IShellBrowser_QueryInterface( This->pShellBrowser, + if ( SUCCEEDED (IShellBrowser_QueryInterface( This->pShellBrowser, (REFIID)&IID_ICommDlgBrowser, (LPVOID*) &This->pCommDlgBrowser))) { TRACE("-- CommDlgBrowser\n"); @@ -1712,7 +1712,7 @@ static HRESULT WINAPI IShellView_fnCreateViewWindow( (LPVOID)This); CheckToolbar(This); - + if(!*phWnd) return E_FAIL; return S_OK; @@ -1742,7 +1742,7 @@ static HRESULT WINAPI IShellView_fnGetCurrentInfo(IShellView * iface, LPFOLDERSE { ICOM_THIS(IShellViewImpl, iface); - TRACE("(%p)->(%p) vmode=%x flags=%x\n",This, lpfs, + TRACE("(%p)->(%p) vmode=%x flags=%x\n",This, lpfs, This->FolderSettings.ViewMode, This->FolderSettings.fFlags); if (!lpfs) return E_INVALIDARG; @@ -1776,15 +1776,15 @@ static HRESULT WINAPI IShellView_fnSelectItem( { ICOM_THIS(IShellViewImpl, iface); int i; - + TRACE("(%p)->(pidl=%p, 0x%08x) stub\n",This, pidl, uFlags); - + i = LV_FindItemByPidl(This, pidl); if (i != -1) { LVITEMA lvItem; - + if(uFlags & SVSI_ENSUREVISIBLE) ListView_EnsureVisible(This->hWndList, i, 0); @@ -1853,9 +1853,9 @@ static HRESULT WINAPI IShellView_fnEditItem( { ICOM_THIS(IShellViewImpl, iface); int i; - + TRACE("(%p)->(pidl=%p)\n",This, pidl); - + i = LV_FindItemByPidl(This, pidl); if (i != -1) { @@ -1865,8 +1865,8 @@ static HRESULT WINAPI IShellView_fnEditItem( return S_OK; } -static struct ICOM_VTABLE(IShellView) svvt = -{ +static struct ICOM_VTABLE(IShellView) svvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IShellView_fnQueryInterface, IShellView_fnAddRef, @@ -1929,7 +1929,7 @@ static ULONG WINAPI ISVOleCmdTarget_Release( static HRESULT WINAPI ISVOleCmdTarget_QueryStatus( IOleCommandTarget *iface, const GUID* pguidCmdGroup, - ULONG cCmds, + ULONG cCmds, OLECMD * prgCmds, OLECMDTEXT* pCmdText) { @@ -1960,7 +1960,7 @@ static HRESULT WINAPI ISVOleCmdTarget_Exec( return E_NOTIMPL; } -static ICOM_VTABLE(IOleCommandTarget) ctvt = +static ICOM_VTABLE(IOleCommandTarget) ctvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISVOleCmdTarget_QueryInterface, @@ -2010,7 +2010,7 @@ static HRESULT WINAPI ISVDropTarget_DragEnter( DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) -{ +{ _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface); @@ -2056,7 +2056,7 @@ static HRESULT WINAPI ISVDropTarget_Drop( return E_NOTIMPL; } -static struct ICOM_VTABLE(IDropTarget) dtvt = +static struct ICOM_VTABLE(IDropTarget) dtvt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISVDropTarget_QueryInterface, @@ -2179,10 +2179,10 @@ static HRESULT WINAPI ISVViewObject_Draw( HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, - LPCRECTL lprcWBounds, + LPCRECTL lprcWBounds, IVO_ContCallback pfnContinue, DWORD dwContinue) -{ +{ _ICOM_THIS_From_IViewObject(IShellViewImpl, iface); @@ -2198,7 +2198,7 @@ static HRESULT WINAPI ISVViewObject_GetColorSet( DVTARGETDEVICE* ptd, HDC hicTargetDevice, LOGPALETTE** ppColorSet) -{ +{ _ICOM_THIS_From_IViewObject(IShellViewImpl, iface); @@ -2212,7 +2212,7 @@ static HRESULT WINAPI ISVViewObject_Freeze( LONG lindex, void* pvAspect, DWORD* pdwFreeze) -{ +{ _ICOM_THIS_From_IViewObject(IShellViewImpl, iface); @@ -2223,7 +2223,7 @@ static HRESULT WINAPI ISVViewObject_Freeze( static HRESULT WINAPI ISVViewObject_Unfreeze( IViewObject *iface, DWORD dwFreeze) -{ +{ _ICOM_THIS_From_IViewObject(IShellViewImpl, iface); @@ -2236,7 +2236,7 @@ static HRESULT WINAPI ISVViewObject_SetAdvise( DWORD aspects, DWORD advf, IAdviseSink* pAdvSink) -{ +{ _ICOM_THIS_From_IViewObject(IShellViewImpl, iface); @@ -2249,7 +2249,7 @@ static HRESULT WINAPI ISVViewObject_GetAdvise( DWORD* pAspects, DWORD* pAdvf, IAdviseSink** ppAdvSink) -{ +{ _ICOM_THIS_From_IViewObject(IShellViewImpl, iface); @@ -2259,7 +2259,7 @@ static HRESULT WINAPI ISVViewObject_GetAdvise( } -static struct ICOM_VTABLE(IViewObject) vovt = +static struct ICOM_VTABLE(IViewObject) vovt = { ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISVViewObject_QueryInterface, diff --git a/dlls/shell32/shpolicy.c b/dlls/shell32/shpolicy.c index f21e3d16700..dc58d886921 100644 --- a/dlls/shell32/shpolicy.c +++ b/dlls/shell32/shpolicy.c @@ -23,9 +23,9 @@ * Editor which came with the Win95 Migration Guide, although * there doesn't appear to be an updated Win98 version that * would handle the many new policies introduced since then. - * You could easily write one with the information in + * You could easily write one with the information in * this file... - * + * * Up to date as of SHELL32 v4.72 (Win98, Win95 with MSIE 5) */ @@ -127,7 +127,7 @@ static char strNoRun[] = {"NoRun"}; /* policy data array */ -POLICYDATA sh32_policy_table[] = +POLICYDATA sh32_policy_table[] = { { 0x1, @@ -476,14 +476,14 @@ POLICYDATA sh32_policy_table[] = /************************************************************************* * SHRestricted [SHELL32.100] * - * walks through policy table, queries key, value, returns + * walks through policy table, queries key, value, returns * queried (DWORD) value, and caches it between called to SHInitRestricted * to prevent unnecessary registry access. * * NOTES * exported by ordinal * - * REFERENCES: + * REFERENCES: * MS System Policy Editor * 98Lite 2.0 (which uses many of these policy keys) http://www.98lite.net/ * "The Windows 95 Registry", by John Woram, 1996 MIS: Press @@ -581,7 +581,7 @@ BOOL WINAPI SHInitRestricted(LPSTR inpRegKey, LPSTR parm2) /* doesn't match, fail */ return 0; } - } + } /* check passed, init all policy cache entries with SHELL_NO_POLICY */ for (i = 0; i < SHELL_MAX_POLICIES; i++) diff --git a/dlls/shell32/shv_bg_cmenu.c b/dlls/shell32/shv_bg_cmenu.c index 5cfedba0231..9cd9e7315a6 100644 --- a/dlls/shell32/shv_bg_cmenu.c +++ b/dlls/shell32/shv_bg_cmenu.c @@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); /************************************************************************** * IContextMenu Implementation */ -typedef struct +typedef struct { ICOM_VFIELD(IContextMenu); IShellFolder* pSFParent; @@ -78,20 +78,20 @@ static HRESULT WINAPI ISVBgCm_fnQueryInterface(IContextMenu *iface, REFIID riid, if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ { - *ppvObj = This; + *ppvObj = This; } else if(IsEqualIID(riid, &IID_IContextMenu)) /*IContextMenu*/ { *ppvObj = This; - } + } else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ { FIXME("-- LPSHELLEXTINIT pointer requested\n"); } if(*ppvObj) - { - IUnknown_AddRef((IUnknown*)*ppvObj); + { + IUnknown_AddRef((IUnknown*)*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } @@ -121,7 +121,7 @@ static ULONG WINAPI ISVBgCm_fnRelease(IContextMenu *iface) TRACE("(%p)->()\n",This); - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying IContextMenu(%p)\n",This); @@ -151,7 +151,7 @@ static HRESULT WINAPI ISVBgCm_fnQueryContextMenu( { HMENU hMyMenu; UINT idMax; - + ICOM_THIS(BgCmImpl, iface); TRACE("(%p)->(hmenu=%x indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",This, hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags); @@ -175,14 +175,14 @@ static void DoNewFolder( ICOM_THIS(BgCmImpl, iface); ISFHelper * psfhlp; char szName[MAX_PATH]; - + IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlp); if (psfhlp) { LPITEMIDLIST pidl; ISFHelper_GetUniqueName(psfhlp, szName, MAX_PATH); ISFHelper_AddFolder(psfhlp, 0, szName, &pidl); - + if(psv) { /* if we are in a shellview do labeledit */ @@ -191,7 +191,7 @@ static void DoNewFolder( |SVSI_FOCUSED|SVSI_SELECT)); } SHFree(pidl); - + ISFHelper_Release(psfhlp); } } @@ -205,7 +205,7 @@ static BOOL DoPaste( ICOM_THIS(BgCmImpl, iface); BOOL bSuccess = FALSE; IDataObject * pda; - + TRACE("\n"); if(SUCCEEDED(pOleGetClipboard(&pda))) @@ -227,9 +227,9 @@ static BOOL DoPaste( LPCIDA lpcida = GlobalLock(medium.u.hGlobal); TRACE("cida=%p\n", lpcida); - + apidl = _ILCopyCidaToaPidl(&pidl, lpcida); - + /* bind to the source shellfolder */ SHGetDesktopFolder(&psfDesktop); if(psfDesktop) @@ -237,19 +237,19 @@ static BOOL DoPaste( IShellFolder_BindToObject(psfDesktop, pidl, NULL, &IID_IShellFolder, (LPVOID*)&psfFrom); IShellFolder_Release(psfDesktop); } - + if (psfFrom) { /* get source and destination shellfolder */ ISFHelper *psfhlpdst, *psfhlpsrc; IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlpdst); IShellFolder_QueryInterface(psfFrom, &IID_ISFHelper, (LPVOID*)&psfhlpsrc); - + /* do the copy/move */ if (psfhlpdst && psfhlpsrc) { ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, apidl); - /* FIXME handle move + /* FIXME handle move ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl); */ } @@ -257,10 +257,10 @@ static BOOL DoPaste( if(psfhlpsrc) ISFHelper_Release(psfhlpsrc); IShellFolder_Release(psfFrom); } - + _ILFreeaPidl(apidl, lpcida->cidl); SHFree(pidl); - + /* release the medium*/ pReleaseStgMedium(&medium); } @@ -271,7 +271,7 @@ static BOOL DoPaste( OpenClipboard(NULL); hMem = GetClipboardData(CF_HDROP); - + if(hMem) { char * pDropFiles = (char *)GlobalLock(hMem); @@ -305,7 +305,7 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCommand( LPSHELLVIEW lpSV; HWND hWndSV; - TRACE("(%p)->(invcom=%p verb=%p wnd=%x)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); + TRACE("(%p)->(invcom=%p verb=%p wnd=%x)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); /* get the active IShellView */ if((lpSB = (LPSHELLBROWSER)SendMessageA(lpcmi->hwnd, CWM_GETISHELLBROWSER,0,0))) @@ -333,7 +333,7 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCommand( else if (! strcmp(lpcmi->lpVerb,CMDSTR_VIEWDETAILSA)) { if(hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(FCIDM_SHVIEW_REPORTVIEW,0),0 ); - } + } else { FIXME("please report: unknown verb %s\n",lpcmi->lpVerb); @@ -355,7 +355,7 @@ static HRESULT WINAPI ISVBgCm_fnInvokeCommand( break; } } - + IShellView_Release(lpSV); /* QueryActiveShellView does AddRef*/ } return NOERROR; @@ -372,12 +372,12 @@ static HRESULT WINAPI ISVBgCm_fnGetCommandString( LPUINT lpReserved, LPSTR lpszName, UINT uMaxNameLen) -{ +{ ICOM_THIS(BgCmImpl, iface); TRACE("(%p)->(idcom=%x flags=%x %p name=%p len=%x)\n",This, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen); - /* test the existence of the menu items, the file dialog enables + /* test the existence of the menu items, the file dialog enables the buttons according to this */ if (uFlags == GCS_VALIDATEA) { @@ -386,7 +386,7 @@ static HRESULT WINAPI ISVBgCm_fnGetCommandString( if (!strcmp((LPSTR)idCommand, CMDSTR_VIEWLISTA) || !strcmp((LPSTR)idCommand, CMDSTR_VIEWDETAILSA) || !strcmp((LPSTR)idCommand, CMDSTR_NEWFOLDERA)) - { + { return NOERROR; } } @@ -414,10 +414,10 @@ static HRESULT WINAPI ISVBgCm_fnHandleMenuMsg( /************************************************************************** * IContextMenu VTable -* +* */ -static struct ICOM_VTABLE(IContextMenu) cmvt = -{ +static struct ICOM_VTABLE(IContextMenu) cmvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISVBgCm_fnQueryInterface, ISVBgCm_fnAddRef, diff --git a/dlls/shell32/shv_item_cmenu.c b/dlls/shell32/shv_item_cmenu.c index 3036dea7be6..63eddd4877a 100644 --- a/dlls/shell32/shv_item_cmenu.c +++ b/dlls/shell32/shv_item_cmenu.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); /************************************************************************** * IContextMenu Implementation */ -typedef struct +typedef struct { ICOM_VFIELD(IContextMenu); DWORD ref; IShellFolder* pSFParent; @@ -115,20 +115,20 @@ static HRESULT WINAPI ISvItemCm_fnQueryInterface(IContextMenu *iface, REFIID rii if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ { - *ppvObj = This; + *ppvObj = This; } else if(IsEqualIID(riid, &IID_IContextMenu)) /*IContextMenu*/ { *ppvObj = This; - } + } else if(IsEqualIID(riid, &IID_IShellExtInit)) /*IShellExtInit*/ { FIXME("-- LPSHELLEXTINIT pointer requested\n"); } if(*ppvObj) - { - IUnknown_AddRef((IUnknown*)*ppvObj); + { + IUnknown_AddRef((IUnknown*)*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } @@ -160,7 +160,7 @@ static ULONG WINAPI ISvItemCm_fnRelease(IContextMenu *iface) shell32_ObjCount--; - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying IContextMenu(%p)\n",This); @@ -169,7 +169,7 @@ static ULONG WINAPI ISvItemCm_fnRelease(IContextMenu *iface) if(This->pidl) SHFree(This->pidl); - + /*make sure the pidl is freed*/ _ILFreeaPidl(This->apidl, This->cidl); @@ -181,7 +181,7 @@ static ULONG WINAPI ISvItemCm_fnRelease(IContextMenu *iface) /************************************************************************** * ICM_InsertItem() -*/ +*/ void WINAPI _InsertMenuItem ( HMENU hmenu, UINT indexMenu, @@ -276,7 +276,7 @@ static void DoOpenExplore( LPITEMIDLIST pidlFQ; SHELLEXECUTEINFOA sei; - /* Find the first item in the list that is not a value. These commands + /* Find the first item in the list that is not a value. These commands should never be invoked if there isn't at least one folder item in the list.*/ for(i = 0; icidl; i++) @@ -316,14 +316,14 @@ static void DoRename( LPSHELLBROWSER lpSB; LPSHELLVIEW lpSV; - TRACE("(%p)->(wnd=%x)\n",This, hwnd); + TRACE("(%p)->(wnd=%x)\n",This, hwnd); /* get the active IShellView */ if ((lpSB = (LPSHELLBROWSER)SendMessageA(hwnd, CWM_GETISHELLBROWSER,0,0))) { if(SUCCEEDED(IShellBrowser_QueryActiveShellView(lpSB, &lpSV))) { - TRACE("(sv=%p)\n",lpSV); + TRACE("(sv=%p)\n",lpSV); IShellView_SelectItem(lpSV, This->apidl[0], SVSI_DESELECTOTHERS|SVSI_EDIT|SVSI_ENSUREVISIBLE|SVSI_FOCUSED|SVSI_SELECT); IShellView_Release(lpSV); @@ -340,7 +340,7 @@ static void DoDelete(IContextMenu *iface) { ICOM_THIS(ItemCmImpl, iface); ISFHelper * psfhlp; - + IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper, (LPVOID*)&psfhlp); if (psfhlp) { @@ -364,7 +364,7 @@ static BOOL DoCopyOrCut( LPSHELLBROWSER lpSB; LPSHELLVIEW lpSV; LPDATAOBJECT lpDo; - + TRACE("(%p)->(wnd=0x%04x,bCut=0x%08x)\n",This, hwnd, bCut); if(GetShellOle()) @@ -392,7 +392,7 @@ static BOOL DoCopyOrCut( BOOL bSuccess = FALSE; TRACE("(%p)\n", iface); - + if(OpenClipboard(NULL)) { if(EmptyClipboard()) @@ -408,7 +408,7 @@ static BOOL DoCopyOrCut( HGLOBAL hMem; hMem = RenderHDROP(pidl, This->apidl, This->cidl); - + if(SetClipboardData(CF_HDROP, hMem)) { bSuccess = TRUE; @@ -417,7 +417,7 @@ static BOOL DoCopyOrCut( } IPersistFolder2_Release(ppf2); } - + } CloseClipboard(); } @@ -433,7 +433,7 @@ static HRESULT WINAPI ISvItemCm_fnInvokeCommand( { ICOM_THIS(ItemCmImpl, iface); - TRACE("(%p)->(invcom=%p verb=%p wnd=%x)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); + TRACE("(%p)->(invcom=%p verb=%p wnd=%x)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); if(LOWORD(lpcmi->lpVerb) > FCIDM_SHVIEWLAST) return E_INVALIDARG; @@ -447,10 +447,10 @@ static HRESULT WINAPI ISvItemCm_fnInvokeCommand( break; case FCIDM_SHVIEW_RENAME: DoRename(iface, lpcmi->hwnd); - break; + break; case FCIDM_SHVIEW_DELETE: DoDelete(iface); - break; + break; case FCIDM_SHVIEW_COPY: DoCopyOrCut(iface, lpcmi->hwnd, FALSE); break; @@ -471,7 +471,7 @@ static HRESULT WINAPI ISvItemCm_fnGetCommandString( LPUINT lpReserved, LPSTR lpszName, UINT uMaxNameLen) -{ +{ ICOM_THIS(ItemCmImpl, iface); HRESULT hr = E_INVALIDARG; @@ -494,7 +494,7 @@ static HRESULT WINAPI ISvItemCm_fnGetCommandString( } break; - /* NT 4.0 with IE 3.0x or no IE will always call This with GCS_VERBW. In This + /* NT 4.0 with IE 3.0x or no IE will always call This with GCS_VERBW. In This case, you need to do the lstrcpyW to the pointer passed.*/ case GCS_VERBW: switch(idCommand) @@ -532,8 +532,8 @@ static HRESULT WINAPI ISvItemCm_fnHandleMenuMsg( return E_NOTIMPL; } -static struct ICOM_VTABLE(IContextMenu) cmvt = -{ +static struct ICOM_VTABLE(IContextMenu) cmvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE ISvItemCm_fnQueryInterface, ISvItemCm_fnAddRef, diff --git a/dlls/shell32/systray.c b/dlls/shell32/systray.c index a5872016ea4..84ea9254bda 100644 --- a/dlls/shell32/systray.c +++ b/dlls/shell32/systray.c @@ -222,7 +222,7 @@ BOOL SYSTRAY_ItemInit(SystrayItem *ptrayItem) static void SYSTRAY_ItemTerm(SystrayItem *ptrayItem) { if(ptrayItem->notifyIcon.hIcon) - DestroyIcon(ptrayItem->notifyIcon.hIcon); + DestroyIcon(ptrayItem->notifyIcon.hIcon); if(ptrayItem->hWndToolTip) DestroyWindow(ptrayItem->hWndToolTip); if(ptrayItem->hWnd) diff --git a/dlls/shell32/undocshell.h b/dlls/shell32/undocshell.h index 93fa746db48..38ccc1ede9f 100644 --- a/dlls/shell32/undocshell.h +++ b/dlls/shell32/undocshell.h @@ -180,7 +180,7 @@ BOOL WINAPI PickIconDlg( LPDWORD lpdwIconIndex); /* RunFileDlg flags */ -#define RFF_NOBROWSE 0x01 +#define RFF_NOBROWSE 0x01 #define RFF_NODEFAULT 0x02 #define RFF_CALCDIRECTORY 0x04 #define RFF_NOLABEL 0x08 @@ -191,7 +191,7 @@ typedef struct { NMHDR hdr; LPCSTR lpFile; - LPCSTR lpDirectory; + LPCSTR lpDirectory; int nShow; } NM_RUNFILEDLG, * LPNM_RUNFILEDLG; @@ -213,7 +213,7 @@ void WINAPI ExitWindowsDialog(HWND hwndOwner); int WINAPI RestartDialog( HWND hwndOwner, LPCSTR lpstrReason, - UINT uFlags); + UINT uFlags); BOOL WINAPI GetFileNameFromBrowse( HWND hwndOwner, @@ -231,7 +231,7 @@ BOOL WINAPI SHFindFiles( BOOL WINAPI SHFindComputer( LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch); - + /* SHObjectProperties flags */ #define OPF_PRINTERNAME 0x01 #define OPF_PATHNAME 0x02 @@ -310,11 +310,11 @@ BOOL WINAPI SHUnlockShared(LPVOID pv); #define CWM_GETPATH (WM_USER + 12) /* CWM_TESTPATH types */ -#define CWTP_ISEQUAL 0 -#define CWTP_ISCHILD 1 +#define CWTP_ISEQUAL 0 +#define CWTP_ISCHILD 1 /* CWM_TESTPATH structure */ -typedef struct +typedef struct { DWORD dwType; ITEMIDLIST idl; @@ -509,7 +509,7 @@ BOOL WINAPI DAD_DragMove(POINT pt); #define DAD_SCROLL_RIGHT 8 /* DAD_AutoScroll sample structure */ -typedef struct +typedef struct { DWORD dwCount; DWORD dwLastTime; @@ -553,15 +553,15 @@ BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2); LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile); -LPVOID WINAPI PathAddBackslashAW(LPVOID path); +LPVOID WINAPI PathAddBackslashAW(LPVOID path); LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive); -LPVOID WINAPI PathFindExtensionAW(LPCVOID path); +LPVOID WINAPI PathFindExtensionAW(LPCVOID path); -LPVOID WINAPI PathFindFileNameAW(LPCVOID path); +LPVOID WINAPI PathFindFileNameAW(LPCVOID path); -LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath, DWORD void1, DWORD void2); +LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath, DWORD void1, DWORD void2); LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath); @@ -571,7 +571,7 @@ LPVOID WINAPI PathGetShortPathAW(LPVOID lpszPath); void WINAPI PathRemoveBlanksAW(LPVOID lpszPath); -VOID WINAPI PathQuoteSpacesAW(LPVOID path); +VOID WINAPI PathQuoteSpacesAW(LPVOID path); void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath); @@ -590,10 +590,10 @@ BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath); BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec); BOOL WINAPI PathMakeUniqueNameAW( - LPVOID lpszBuffer, + LPVOID lpszBuffer, DWORD dwBuffSize, LPCVOID lpszShortName, - LPCVOID lpszLongName, + LPCVOID lpszLongName, LPCVOID lpszPathName); BOOL WINAPI PathYetAnotherMakeUniqueNameA( @@ -610,10 +610,10 @@ BOOL WINAPI PathYetAnotherMakeUniqueNameA( DWORD WINAPI PathCleanupSpecAW(LPCVOID lpszPath, LPVOID lpszFile); -BOOL WINAPI PathQualifyA(LPCSTR path); -BOOL WINAPI PathQualifyW(LPCWSTR path); +BOOL WINAPI PathQualifyA(LPCSTR path); +BOOL WINAPI PathQualifyW(LPCWSTR path); #define PathQualify WINELIB_NAME_AW(PathQualify) -BOOL WINAPI PathQualifyAW(LPCVOID path); +BOOL WINAPI PathQualifyAW(LPCVOID path); /* PathResolve flags */ @@ -664,7 +664,7 @@ typedef HRESULT (CALLBACK *LPFNSFVCALLBACK)( LPARAM lParam); /* SHCreateShellFolderViewEx structure */ -typedef struct +typedef struct { DWORD dwSize; LPSHELLFOLDER pshf; @@ -719,7 +719,7 @@ HRESULT WINAPI SHCreateShellFolderViewEx( #define SFVCB_ISCHILDOBJECT 0x0026 /* Generic structure used by several messages */ -typedef struct +typedef struct { DWORD dwReserved; DWORD dwReserved2; @@ -729,7 +729,7 @@ typedef struct typedef const SFVCBINFO * LPCSFVCBINFO; /* SFVCB_ADDTOMENU structure */ -typedef struct +typedef struct { HMENU hMenu; UINT indexMenu; @@ -738,22 +738,22 @@ typedef struct } SFVMENUINFO, * LPSFVMENUINFO; /* SFVCB_GETTOOLBARINFO structure */ -typedef struct +typedef struct { UINT nButtons; UINT uFlags; } SFVTOOLBARINFO, * LPSFVTOOLBARINFO; /* SFVTOOLBARINFO flags */ -typedef enum +typedef enum { SFVTI_ADDTOEND = 0, SFVTI_ADDTOFRONT = 1, SFVTI_OVERWRITE = 2 -} SFVTIF; +} SFVTIF; /* SFVCB_SELECTIONCHANGED structure */ -typedef struct +typedef struct { UINT uOldState; UINT uNewState; @@ -763,7 +763,7 @@ typedef struct typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE; /* SFVCB_COPYHOOKCALLBACK structure */ -typedef struct +typedef struct { HWND hwnd; UINT wFunc; @@ -776,7 +776,7 @@ typedef struct typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO; /* SFVCB_GETDETAILSOF structure */ -typedef struct +typedef struct { LPCITEMIDLIST pidl; int fmt; @@ -785,9 +785,9 @@ typedef struct } SFVCOLUMNINFO, * LPSFVCOLUMNINFO; int WINAPI SHShellFolderView_Message( - HWND hwndCabinet, + HWND hwndCabinet, DWORD dwMessage, - DWORD dwParam); + DWORD dwParam); /* SHShellFolderView_Message messages */ #define SFVM_REARRANGE 0x0001 @@ -824,7 +824,7 @@ int WINAPI SHShellFolderView_Message( #define SHWFF_WAIT 0x04 BOOL WINAPI SHWaitForFileToOpen( - LPCITEMIDLIST pidl, + LPCITEMIDLIST pidl, DWORD dwFlags, DWORD dwTimeout); @@ -852,14 +852,14 @@ typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)( LPVOID *ppvObject); HRESULT WINAPI SHCreateDefClassObject( - REFIID riidFactory, + REFIID riidFactory, LPVOID *ppvFactory, LPFNCDCOCALLBACK lpfnCallback, - LPDWORD lpdwUsage, + LPDWORD lpdwUsage, REFIID riidObject); HRESULT WINAPI SHCoCreateInstance( - LPCSTR lpszClsid, + LPCSTR lpszClsid, REFCLSID rClsid, LPUNKNOWN pUnkOuter, REFIID riid, @@ -873,7 +873,7 @@ void WINAPI SHFreeUnusedLibraries(); HRESULT WINAPI SHCreateLinks( HWND hWnd, - LPCSTR lpszDir, + LPCSTR lpszDir, LPDATAOBJECT lpDataObject, UINT uFlags, LPITEMIDLIST *lppidlLinks); @@ -885,14 +885,14 @@ HRESULT WINAPI SHCreateLinks( BOOL WINAPI SHGetNewLinkInfoA( LPCSTR pszLinkTo, - LPCSTR pszDir, + LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, UINT uFlags); BOOL WINAPI SHGetNewLinkInfoW( LPCWSTR pszLinkTo, - LPCWSTR pszDir, + LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags); diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index c107aae084c..22dc1187c2c 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -160,7 +160,7 @@ DWORD WINAPI SHLWAPI_1 (LPCSTR x, UNKNOWN_SHLWAPI_1 *y) const SHL_2_inet_scheme *inet_pro; if (y->size != 0x18) return E_INVALIDARG; - /* FIXME: leading white space generates error of 0x80041001 which + /* FIXME: leading white space generates error of 0x80041001 which * is undefined */ if (*x <= ' ') return 0x80041001; @@ -628,7 +628,7 @@ HRESULT WINAPI SHLWAPI_13 ( * * Function: * Retrieves IE "AcceptLanguage" value from registry. ASCII mode. - * + * */ HRESULT WINAPI SHLWAPI_14 ( LPSTR langbuf, @@ -640,12 +640,12 @@ HRESULT WINAPI SHLWAPI_14 ( LCID mylcid; mystrlen = (*buflen > 6) ? *buflen : 6; - mystr = (CHAR*)HeapAlloc(GetProcessHeap(), + mystr = (CHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mystrlen); - RegOpenKeyA(HKEY_CURRENT_USER, - "Software\\Microsoft\\Internet Explorer\\International", + RegOpenKeyA(HKEY_CURRENT_USER, + "Software\\Microsoft\\Internet Explorer\\International", &mykey); - if (RegQueryValueExA(mykey, "AcceptLanguage", + if (RegQueryValueExA(mykey, "AcceptLanguage", 0, &mytype, mystr, &mystrlen)) { /* Did not find value */ mylcid = GetUserDefaultLCID(); @@ -664,12 +664,12 @@ HRESULT WINAPI SHLWAPI_14 ( /* handle returned string */ FIXME("missing code\n"); } - if (mystrlen > *buflen) + if (mystrlen > *buflen) lstrcpynA(langbuf, mystr, *buflen); else { lstrcpyA(langbuf, mystr); *buflen = lstrlenA(langbuf); - } + } RegCloseKey(mykey); HeapFree(GetProcessHeap(), 0, mystr); TRACE("language is %s\n", debugstr_a(langbuf)); @@ -681,7 +681,7 @@ HRESULT WINAPI SHLWAPI_14 ( * * Function: * Retrieves IE "AcceptLanguage" value from registry. UNICODE mode. - * + * */ HRESULT WINAPI SHLWAPI_15 ( LPWSTR langbuf, @@ -693,12 +693,12 @@ HRESULT WINAPI SHLWAPI_15 ( LCID mylcid; mystrlen = (*buflen > 6) ? *buflen : 6; - mystr = (CHAR*)HeapAlloc(GetProcessHeap(), + mystr = (CHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mystrlen); - RegOpenKeyA(HKEY_CURRENT_USER, - "Software\\Microsoft\\Internet Explorer\\International", + RegOpenKeyA(HKEY_CURRENT_USER, + "Software\\Microsoft\\Internet Explorer\\International", &mykey); - if (RegQueryValueExA(mykey, "AcceptLanguage", + if (RegQueryValueExA(mykey, "AcceptLanguage", 0, &mytype, mystr, &mystrlen)) { /* Did not find value */ mylcid = GetUserDefaultLCID(); @@ -970,7 +970,7 @@ BOOL WINAPI SHLWAPI_35(LPVOID p1, DWORD dw2, LPVOID p3) */ BOOL WINAPI SHLWAPI_36(HMENU h1, UINT ui2, UINT h3, LPCWSTR p4) { - TRACE("(0x%08x, 0x%08x, 0x%08x, %s): stub\n", + TRACE("(0x%08x, 0x%08x, 0x%08x, %s): stub\n", h1, ui2, h3, debugstr_w(p4)); return AppendMenuW(h1, ui2, h3, p4); } @@ -1173,13 +1173,13 @@ DWORD WINAPI SHLWAPI_172 ( /************************************************************************* * @ [SHLWAPI.174] * - * Seems to do call either IObjectWithSite::SetSite or + * Seems to do call either IObjectWithSite::SetSite or * IPersistMoniker::GetClassID. But since we do not implement either * of those classes in our headers, we will fake it out. */ DWORD WINAPI SHLWAPI_174( IUnknown *p1, /* [in] OLE object */ - LPVOID *p2) /* [out] ptr to result of either GetClassID + LPVOID *p2) /* [out] ptr to result of either GetClassID or SetSite call. */ { DWORD ret, aa; @@ -1189,7 +1189,7 @@ DWORD WINAPI SHLWAPI_174( /* see if SetSite interface exists for IObjectWithSite object */ ret = IUnknown_QueryInterface((IUnknown *)p1, (REFIID)id1, (LPVOID *)&p1); TRACE("first IU_QI ret=%08lx, p1=%p\n", ret, p1); - if (ret) { + if (ret) { /* see if GetClassId interface exists for IPersistMoniker object */ ret = IUnknown_QueryInterface((IUnknown *)p1, (REFIID)id2, (LPVOID *)&aa); @@ -1198,14 +1198,14 @@ DWORD WINAPI SHLWAPI_174( /* fake a GetClassId call */ ret = IOleWindow_GetWindow((IOleWindow *)aa, (HWND*)p2); - TRACE("second IU_QI doing 0x0c ret=%08lx, *p2=%08lx\n", ret, + TRACE("second IU_QI doing 0x0c ret=%08lx, *p2=%08lx\n", ret, *(LPDWORD)p2); IUnknown_Release((IUnknown *)aa); } else { /* fake a SetSite call */ ret = IOleWindow_GetWindow((IOleWindow *)p1, (HWND*)p2); - TRACE("first IU_QI doing 0x0c ret=%08lx, *p2=%08lx\n", ret, + TRACE("first IU_QI doing 0x0c ret=%08lx, *p2=%08lx\n", ret, *(LPDWORD)p2); IUnknown_Release((IUnknown *)p1); } @@ -1244,11 +1244,11 @@ DWORD WINAPI SHLWAPI_176 ( *z = 0; if (!unk) return E_FAIL; ret = IUnknown_QueryInterface(unk, &IID_IServiceProvider, &aa); - TRACE("did IU_QI retval=%08lx, aa=%p\n", ret, aa); + TRACE("did IU_QI retval=%08lx, aa=%p\n", ret, aa); if (ret) return ret; - ret = IServiceProvider_QueryService((IServiceProvider *)aa, sid, riid, + ret = IServiceProvider_QueryService((IServiceProvider *)aa, sid, riid, (void **)z); - TRACE("did ISP_QS retval=%08lx, *z=%p\n", ret, (LPVOID)*z); + TRACE("did ISP_QS retval=%08lx, *z=%p\n", ret, (LPVOID)*z); IUnknown_Release((IUnknown*)aa); return ret; } @@ -1385,7 +1385,7 @@ DWORD WINAPI SHLWAPI_215 ( len_a = lstrlenA(lpStrSrc); ret = MultiByteToWideChar(0, 0, lpStrSrc, len_a, lpwStrDest, len); - TRACE("%s %s %d, ret=%d\n", + TRACE("%s %s %d, ret=%d\n", debugstr_a(lpStrSrc), debugstr_w(lpwStrDest), len, ret); return ret; } @@ -1523,7 +1523,7 @@ HRESULT WINAPI SHLWAPI_219 ( if (z) { xmove = x; while (xmove->refid) { - TRACE("trying (indx %ld) %s\n", xmove->indx, + TRACE("trying (indx %ld) %s\n", xmove->indx, debugstr_guid(xmove->refid)); if (IsEqualIID(riid, xmove->refid)) { a_vtbl = (IUnknown*)(xmove->indx + (LPBYTE)w); @@ -1688,8 +1688,8 @@ DWORD WINAPI SHLWAPI_266 ( * @ [SHLWAPI.267] */ HRESULT WINAPI SHLWAPI_267 ( - LPVOID w, - LPVOID x, + LPVOID w, + LPVOID x, LPVOID y, /* [???] NOTE: same as 3rd parameter of SHLWAPI_219 */ LPVOID z) /* [???] NOTE: same as 4th parameter of SHLWAPI_219 */ { @@ -1947,7 +1947,7 @@ BOOL WINAPI SHLWAPI_351 ( */ WORD WINAPI SHLWAPI_352 ( LPVOID w, /* [in] buffer from _351 */ - LPWSTR x, /* [in] value to retrieve - + LPWSTR x, /* [in] value to retrieve - converted and passed to VerQueryValueA as #2 */ LPVOID y, /* [out] ver buffer - passed to VerQueryValueA as #3 */ UINT* z) /* [in] ver length - passed to VerQueryValueA as #4 */ @@ -1959,10 +1959,10 @@ WORD WINAPI SHLWAPI_352 ( /************************************************************************** * @ [SHLWAPI.356] * - * mbc - this function is undocumented, The parameters are correct and - * the calls to InitializeSecurityDescriptor and - * SetSecurityDescriptorDacl are correct, but apparently some - * apps call this function with all zero parameters. + * mbc - this function is undocumented, The parameters are correct and + * the calls to InitializeSecurityDescriptor and + * SetSecurityDescriptorDacl are correct, but apparently some + * apps call this function with all zero parameters. */ DWORD WINAPI SHLWAPI_356(PACL pDacl, PSECURITY_DESCRIPTOR pSD, LPCSTR *str) @@ -2042,7 +2042,7 @@ LANGID WINAPI SHLWAPI_376 () /************************************************************************* * @ [SHLWAPI.377] * - * FIXME: Native appears to do DPA_Create and a DPA_InsertPtr for + * FIXME: Native appears to do DPA_Create and a DPA_InsertPtr for * each call here. * FIXME: Native shows calls to: * SHRegGetUSValue for "Software\Microsoft\Internet Explorer\International" @@ -2378,7 +2378,7 @@ DWORD WINAPI SHLWAPI_437 (DWORD functionToCall) * NOTES * Input HLS values are constrained to the range (0..240). */ -VOID WINAPI ColorRGBToHLS(COLORREF drRGB, LPWORD pwHue, +VOID WINAPI ColorRGBToHLS(COLORREF drRGB, LPWORD pwHue, LPWORD wLuminance, LPWORD pwSaturation) { FIXME("stub\n"); diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c index 7a9a8fe4a92..1eb2b874a88 100644 --- a/dlls/shlwapi/path.c +++ b/dlls/shlwapi/path.c @@ -1615,9 +1615,9 @@ static BOOL PathMatchSingleMaskA(LPCSTR name, LPCSTR mask) */ static BOOL PathMatchSingleMaskW(LPCWSTR name, LPCWSTR mask) { - while (*name && *mask && *mask!=';') + while (*name && *mask && *mask!=';') { - if (*mask=='*') + if (*mask=='*') { do { @@ -1629,7 +1629,7 @@ static BOOL PathMatchSingleMaskW(LPCWSTR name, LPCWSTR mask) name = CharNextW(name); mask = CharNextW(mask); } - if (!*name) + if (!*name) { while (*mask=='*') mask++; if (!*mask || *mask==';') return 1; diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 3a027be9402..ffb13d0279b 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -92,12 +92,12 @@ LONG WINAPI SHRegOpenUSKeyA( LONG ret2, ret1 = ~ERROR_SUCCESS; LPInternal_HUSKEY ihky; - TRACE("(%s, 0x%lx, 0x%lx, %p, %s)\n", debugstr_a(Path), - (LONG)AccessType, (LONG)hRelativeUSKey, phNewUSKey, + TRACE("(%s, 0x%lx, 0x%lx, %p, %s)\n", debugstr_a(Path), + (LONG)AccessType, (LONG)hRelativeUSKey, phNewUSKey, (fIgnoreHKCU) ? "Ignoring HKCU" : "Process HKCU then HKLM"); /* now create the internal version of HUSKEY */ - ihky = (LPInternal_HUSKEY)HeapAlloc(GetProcessHeap(), 0 , + ihky = (LPInternal_HUSKEY)HeapAlloc(GetProcessHeap(), 0 , sizeof(Internal_HUSKEY)); MultiByteToWideChar(0, 0, Path, -1, ihky->key_string, sizeof(ihky->key_string)-1); @@ -114,13 +114,13 @@ LONG WINAPI SHRegOpenUSKeyA( ihky->HKCUkey = 0; ihky->HKLMkey = 0; if (!fIgnoreHKCU) { - ret1 = RegOpenKeyExA(openHKCUkey, Path, + ret1 = RegOpenKeyExA(openHKCUkey, Path, 0, AccessType, &ihky->HKCUkey); /* if successful, then save real starting point */ if (ret1 != ERROR_SUCCESS) ihky->HKCUkey = 0; } - ret2 = RegOpenKeyExA(openHKLMkey, Path, + ret2 = RegOpenKeyExA(openHKLMkey, Path, 0, AccessType, &ihky->HKLMkey); if (ret2 != ERROR_SUCCESS) ihky->HKLMkey = 0; @@ -159,12 +159,12 @@ LONG WINAPI SHRegOpenUSKeyW( LONG ret2, ret1 = ~ERROR_SUCCESS; LPInternal_HUSKEY ihky; - TRACE("(%s, 0x%lx, 0x%lx, %p, %s)\n", debugstr_w(Path), - (LONG)AccessType, (LONG)hRelativeUSKey, phNewUSKey, + TRACE("(%s, 0x%lx, 0x%lx, %p, %s)\n", debugstr_w(Path), + (LONG)AccessType, (LONG)hRelativeUSKey, phNewUSKey, (fIgnoreHKCU) ? "Ignoring HKCU" : "Process HKCU then HKLM"); /* now create the internal version of HUSKEY */ - ihky = (LPInternal_HUSKEY)HeapAlloc(GetProcessHeap(), 0 , + ihky = (LPInternal_HUSKEY)HeapAlloc(GetProcessHeap(), 0 , sizeof(Internal_HUSKEY)); lstrcpynW(ihky->key_string, Path, sizeof(ihky->key_string)); @@ -180,13 +180,13 @@ LONG WINAPI SHRegOpenUSKeyW( ihky->HKCUkey = 0; ihky->HKLMkey = 0; if (!fIgnoreHKCU) { - ret1 = RegOpenKeyExW(openHKCUkey, Path, + ret1 = RegOpenKeyExW(openHKCUkey, Path, 0, AccessType, &ihky->HKCUkey); /* if successful, then save real starting point */ if (ret1 != ERROR_SUCCESS) ihky->HKCUkey = 0; } - ret2 = RegOpenKeyExW(openHKLMkey, Path, + ret2 = RegOpenKeyExW(openHKLMkey, Path, 0, AccessType, &ihky->HKLMkey); if (ret2 != ERROR_SUCCESS) ihky->HKLMkey = 0; @@ -411,7 +411,7 @@ BOOL WINAPI SHRegGetBoolUSValueA( (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM"); datalen = sizeof(data)-1; - if (!(retvalue = SHRegGetUSValueA( pszSubKey, pszValue, &type, + if (!(retvalue = SHRegGetUSValueA( pszSubKey, pszValue, &type, data, &datalen, fIgnoreHKCU, 0, 0))) { /* process returned data via type into bool */ @@ -470,7 +470,7 @@ BOOL WINAPI SHRegGetBoolUSValueW( (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM"); datalen = (sizeof(data)-1) * sizeof(WCHAR); - if (!(retvalue = SHRegGetUSValueW( pszSubKey, pszValue, &type, + if (!(retvalue = SHRegGetUSValueW( pszSubKey, pszValue, &type, data, &datalen, fIgnoreHKCU, 0, 0))) { /* process returned data via type into bool */ @@ -532,11 +532,11 @@ LONG WINAPI SHRegQueryInfoUSKeyA( pcSubKeys, pcchMaxSubKeyLen, 0, pcValues, pcchMaxValueNameLen, 0, 0, 0); if ((ret == ERROR_SUCCESS) || - (enumRegFlags == SHREGENUM_HKCU)) + (enumRegFlags == SHREGENUM_HKCU)) return ret; } if (((enumRegFlags == SHREGENUM_HKLM) || - (enumRegFlags == SHREGENUM_DEFAULT)) && + (enumRegFlags == SHREGENUM_DEFAULT)) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) { return RegQueryInfoKeyA(dokey, 0, 0, 0, pcSubKeys, pcchMaxSubKeyLen, 0, @@ -565,17 +565,17 @@ LONG WINAPI SHRegQueryInfoUSKeyW( /* if user wants HKCU, and it exists, then try it */ if (((enumRegFlags == SHREGENUM_HKCU) || - (enumRegFlags == SHREGENUM_DEFAULT)) && + (enumRegFlags == SHREGENUM_DEFAULT)) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) { ret = RegQueryInfoKeyW(dokey, 0, 0, 0, pcSubKeys, pcchMaxSubKeyLen, 0, pcValues, pcchMaxValueNameLen, 0, 0, 0); if ((ret == ERROR_SUCCESS) || - (enumRegFlags == SHREGENUM_HKCU)) + (enumRegFlags == SHREGENUM_HKCU)) return ret; } if (((enumRegFlags == SHREGENUM_HKLM) || - (enumRegFlags == SHREGENUM_DEFAULT)) && + (enumRegFlags == SHREGENUM_DEFAULT)) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) { return RegQueryInfoKeyW(dokey, 0, 0, 0, pcSubKeys, pcchMaxSubKeyLen, 0, @@ -601,14 +601,14 @@ LONG WINAPI SHRegEnumUSKeyA( *pcchValueNameLen, enumRegFlags); if (((enumRegFlags == SHREGENUM_HKCU) || - (enumRegFlags == SHREGENUM_DEFAULT)) && + (enumRegFlags == SHREGENUM_DEFAULT)) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) { - return RegEnumKeyExA(dokey, dwIndex, pszName, pcchValueNameLen, + return RegEnumKeyExA(dokey, dwIndex, pszName, pcchValueNameLen, 0, 0, 0, 0); } if (((enumRegFlags == SHREGENUM_HKLM) || - (enumRegFlags == SHREGENUM_DEFAULT)) && + (enumRegFlags == SHREGENUM_DEFAULT)) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) { return RegEnumKeyExA(dokey, dwIndex, pszName, pcchValueNameLen, 0, 0, 0, 0); @@ -634,7 +634,7 @@ LONG WINAPI SHRegEnumUSKeyW( *pcchValueNameLen, enumRegFlags); if (((enumRegFlags == SHREGENUM_HKCU) || - (enumRegFlags == SHREGENUM_DEFAULT)) && + (enumRegFlags == SHREGENUM_DEFAULT)) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) { return RegEnumKeyExW(dokey, dwIndex, pszName, pcchValueNameLen, 0, 0, 0, 0); @@ -661,17 +661,17 @@ LONG WINAPI SHRegWriteUSValueA(HUSKEY hUSKey, LPCSTR pszValue, DWORD dwType, TRACE("(0x%lx,%s,%ld,%p,%ld,%ld)\n", (LONG)hUSKey, debugstr_a(pszValue), dwType, pvData, cbData, dwFlags); - if ((dwFlags & SHREGSET_FORCE_HKCU) && + if ((dwFlags & SHREGSET_FORCE_HKCU) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) { RegSetValueExA(dokey, pszValue, 0, dwType, pvData, cbData); } - if ((dwFlags & SHREGSET_FORCE_HKLM) && + if ((dwFlags & SHREGSET_FORCE_HKLM) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) { RegSetValueExA(dokey, pszValue, 0, dwType, pvData, cbData); } - if (dwFlags & (SHREGSET_FORCE_HKCU | SHREGSET_FORCE_HKLM)) + if (dwFlags & (SHREGSET_FORCE_HKCU | SHREGSET_FORCE_HKLM)) return ERROR_SUCCESS; FIXME("SHREGSET_HKCU or SHREGSET_HKLM not supported\n"); @@ -689,17 +689,17 @@ LONG WINAPI SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType, TRACE("(0x%lx,%s,%ld,%p,%ld,%ld)\n", (LONG)hUSKey, debugstr_w(pszValue), dwType, pvData, cbData, dwFlags); - if ((dwFlags & SHREGSET_FORCE_HKCU) && + if ((dwFlags & SHREGSET_FORCE_HKCU) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKCU))) { RegSetValueExW(dokey, pszValue, 0, dwType, pvData, cbData); } - if ((dwFlags & SHREGSET_FORCE_HKLM) && + if ((dwFlags & SHREGSET_FORCE_HKLM) && (dokey = REG_GetHKEYFromHUSKEY(hUSKey,REG_HKLM))) { RegSetValueExW(dokey, pszValue, 0, dwType, pvData, cbData); } - if (dwFlags & (SHREGSET_FORCE_HKCU | SHREGSET_FORCE_HKLM)) + if (dwFlags & (SHREGSET_FORCE_HKCU | SHREGSET_FORCE_HKLM)) return ERROR_SUCCESS; FIXME("SHREGSET_HKCU or SHREGSET_HKLM not supported\n"); @@ -832,7 +832,7 @@ DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, /* lpszSubKey can be 0. In this case the value is taken from the * current key. */ - if(lpszSubKey) + if(lpszSubKey) dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey); if (! dwRet) @@ -858,7 +858,7 @@ DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, TRACE("(hkey=0x%08x,%s,%s,%p,%p,%p)\n", hKey, debugstr_w(lpszSubKey), debugstr_w(lpszValue), pwType, pvData, pcbData); - if(lpszSubKey) + if(lpszSubKey) dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey); if (! dwRet) @@ -1086,7 +1086,7 @@ DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue, * to allocate our own */ if ((!pvData) || (dwRet == ERROR_MORE_DATA) ) - { + { char cNull = '\0'; nBytesToAlloc = (!pvData || (dwRet == ERROR_MORE_DATA)) ? dwUnExpDataLen : *pcbData; @@ -1102,7 +1102,7 @@ DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue, szData = (LPSTR) LocalAlloc(GMEM_ZEROINIT, nBytesToAlloc + 1); lstrcpyA(szData, pvData); dwExpDataLen = ExpandEnvironmentStringsA(szData, pvData, *pcbData / sizeof(CHAR)); - if (dwExpDataLen > *pcbData) dwRet = ERROR_MORE_DATA; + if (dwExpDataLen > *pcbData) dwRet = ERROR_MORE_DATA; dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen); LocalFree((HLOCAL) szData); } @@ -1145,7 +1145,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, * to allocate our own */ if ((!pvData) || (dwRet == ERROR_MORE_DATA) ) - { + { WCHAR cNull = '\0'; nBytesToAlloc = (!pvData || (dwRet == ERROR_MORE_DATA)) ? dwUnExpDataLen : *pcbData; @@ -1161,7 +1161,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, szData = (LPWSTR) LocalAlloc(GMEM_ZEROINIT, nBytesToAlloc + 1); lstrcpyW(szData, pvData); dwExpDataLen = ExpandEnvironmentStringsW(szData, pvData, *pcbData/sizeof(WCHAR) ); - if (dwExpDataLen > *pcbData) dwRet = ERROR_MORE_DATA; + if (dwExpDataLen > *pcbData) dwRet = ERROR_MORE_DATA; dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen); LocalFree((HLOCAL) szData); } diff --git a/dlls/shlwapi/regstream.c b/dlls/shlwapi/regstream.c index 31ed73708de..1b74e431b18 100644 --- a/dlls/shlwapi/regstream.c +++ b/dlls/shlwapi/regstream.c @@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -typedef struct +typedef struct { ICOM_VFIELD(IStream); DWORD ref; HKEY hKey; @@ -47,7 +47,7 @@ static IStream *IStream_ConstructorA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValu { ISHRegStream* rstr; DWORD dwType; - + rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream)); ICOM_VTBL(rstr)=&rstvt; @@ -56,7 +56,7 @@ static IStream *IStream_ConstructorA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValu if (!(RegOpenKeyExA (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey)))) { if (!(RegQueryValueExA(rstr->hKey, pszValue,0,0,0,&(rstr->dwLength)))) - { + { /* read the binary data into the buffer */ if((rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength))) { @@ -84,7 +84,7 @@ static IStream *IStream_ConstructorW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszVa { ISHRegStream* rstr; DWORD dwType; - + rstr = (ISHRegStream*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ISHRegStream)); ICOM_VTBL(rstr)=&rstvt; @@ -93,7 +93,7 @@ static IStream *IStream_ConstructorW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszVa if (!(RegOpenKeyExW (hKey, pszSubKey, 0, KEY_READ, &(rstr->hKey)))) { if (!(RegQueryValueExW(rstr->hKey, pszValue,0,0,0,&(rstr->dwLength)))) - { + { /* read the binary data into the buffer */ if((rstr->pbBuffer = HeapAlloc(GetProcessHeap(),0,rstr->dwLength))) { @@ -126,15 +126,15 @@ static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVO *ppvObj = NULL; if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { *ppvObj = This; + { *ppvObj = This; } else if(IsEqualIID(riid, &IID_IStream)) /*IStream*/ { *ppvObj = This; - } + } if(*ppvObj) - { - IStream_AddRef((IStream*)*ppvObj); + { + IStream_AddRef((IStream*)*ppvObj); TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); return S_OK; } @@ -163,7 +163,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface) TRACE("(%p)->()\n",This); - if (!--(This->ref)) + if (!--(This->ref)) { TRACE(" destroying SHReg IStream (%p)\n",This); if (This->pbBuffer) @@ -183,21 +183,21 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG ICOM_THIS(ISHRegStream, iface); DWORD dwBytesToRead, dwBytesLeft; - + TRACE("(%p)->(%p,0x%08lx,%p)\n",This, pv, cb, pcbRead); - + if ( !pv ) return STG_E_INVALIDPOINTER; - + dwBytesLeft = This->dwLength - This->dwPos; if ( 0 >= dwBytesLeft ) /* end of buffer */ return S_FALSE; - + dwBytesToRead = ( cb > dwBytesLeft) ? dwBytesLeft : cb; memmove ( pv, (This->pbBuffer) + (This->dwPos), dwBytesToRead); - + This->dwPos += dwBytesToRead; /* adjust pointer */ if (pcbRead) @@ -286,8 +286,8 @@ static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm) return E_NOTIMPL; } -static struct ICOM_VTABLE(IStream) rstvt = -{ +static struct ICOM_VTABLE(IStream) rstvt = +{ ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE IStream_fnQueryInterface, IStream_fnAddRef, @@ -303,7 +303,7 @@ static struct ICOM_VTABLE(IStream) rstvt = IStream_fnUnlockRegion, IStream_fnStat, IStream_fnClone - + }; /************************************************************************* diff --git a/dlls/shlwapi/shlwapi_main.c b/dlls/shlwapi/shlwapi_main.c index 600dfa97ce6..fdc4aa2768c 100644 --- a/dlls/shlwapi/shlwapi_main.c +++ b/dlls/shlwapi/shlwapi_main.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -HINSTANCE shlwapi_hInstance = 0; +HINSTANCE shlwapi_hInstance = 0; HMODULE SHLWAPI_hshell32 = 0; HMODULE SHLWAPI_hwinmm = 0; HMODULE SHLWAPI_hcomdlg32 = 0; diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index c80225d94ed..7d8759f0029 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c @@ -19,7 +19,7 @@ */ #include -#include +#include #include #include @@ -268,7 +268,7 @@ LPSTR WINAPI StrDupA (LPCSTR lpSrc) { int len = strlen(lpSrc); LPSTR lpDest = (LPSTR) LocalAlloc(LMEM_FIXED, len+1); - + TRACE("%s\n", lpSrc); if (lpDest) strcpy(lpDest, lpSrc); @@ -282,7 +282,7 @@ LPWSTR WINAPI StrDupW (LPCWSTR lpSrc) { int len = strlenW(lpSrc); LPWSTR lpDest = (LPWSTR) LocalAlloc(LMEM_FIXED, sizeof(WCHAR) * (len+1)); - + TRACE("%s\n", debugstr_w(lpSrc)); if (lpDest) strcpyW(lpDest, lpSrc); @@ -308,9 +308,9 @@ int WINAPI StrCSpnA (LPCSTR lpStr, LPCSTR lpSet) pos = j; } } - } + } TRACE("-- %u\n", pos); - return pos; + return pos; } /************************************************************************* @@ -332,9 +332,9 @@ int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet) pos = j; } } - } + } TRACE("-- %u\n", pos); - return pos; + return pos; } /************************************************************************** @@ -355,7 +355,7 @@ LPSTR WINAPI StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch ) if (*lpStart != LOBYTE(wMatch)) continue; if (dbcs && lpStart[1] != HIBYTE(wMatch)) continue; lpGotIt = lpStart; - } + } return (LPSTR)lpGotIt; } @@ -403,7 +403,7 @@ LPSTR WINAPI StrRChrIA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch ) } else { if (toupper(*lpStart) == toupper(wMatch)) lpGotIt = lpStart; } - } + } return (LPSTR)lpGotIt; } @@ -465,7 +465,7 @@ LPWSTR WINAPI StrCatBuffW(LPWSTR front, LPCWSTR back, INT size) /************************************************************************* * StrRetToBufA [SHLWAPI.@] - * + * * converts a STRRET to a normal string * * NOTES @@ -510,7 +510,7 @@ HRESULT WINAPI StrRetToBufA (LPSTRRET src, const ITEMIDLIST *pidl, LPSTR dest, D /************************************************************************* * StrRetToBufW [SHLWAPI.@] - * + * * converts a STRRET to a normal string * * NOTES @@ -577,7 +577,7 @@ LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf ) { sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L); } lstrcpynA (pszBuf, buf, cchBuf); - return pszBuf; + return pszBuf; } /************************************************************************* diff --git a/dlls/shlwapi/tests/shreg.c b/dlls/shlwapi/tests/shreg.c index 70ae1eca453..6ce7d41dcea 100644 --- a/dlls/shlwapi/tests/shreg.c +++ b/dlls/shlwapi/tests/shreg.c @@ -1,4 +1,4 @@ -/* Unit test suite for SHReg* functions +/* Unit test suite for SHReg* functions * * Copyright 2002 Juergen Schmied * @@ -145,7 +145,7 @@ static void test_SHQUeryValueEx(void) /* * string grows during expanding - */ + */ strcpy(buf, sEmptyBuffer); dwSize = 6; dwType = -1; diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index dacbf1e9d81..0bf68f4d5f1 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -198,7 +198,7 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized, debugstr_a(pszUrl), pszCanonicalized, pcchCanonicalized, dwFlags); - base = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, + base = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR)); canonical = base + INTERNET_MAX_URL_LENGTH; @@ -217,7 +217,7 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized, HeapFree(GetProcessHeap(), 0, base); return E_POINTER; } - WideCharToMultiByte(0, 0, canonical, len+1, pszCanonicalized, + WideCharToMultiByte(0, 0, canonical, len+1, pszCanonicalized, *pcchCanonicalized, 0, 0); *pcchCanonicalized = len2; HeapFree(GetProcessHeap(), 0, base); @@ -228,7 +228,7 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized, * UrlCanonicalizeW [SHLWAPI.@] * * - * MSDN is wrong (at 10/30/01 - go figure). This should support the + * MSDN is wrong (at 10/30/01 - go figure). This should support the * following flags: GLA * URL_DONT_ESCAPE_EXTRA_INFO 0x02000000 * URL_ESCAPE_SPACES_ONLY 0x04000000 @@ -238,7 +238,7 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized, * URL_DONT_SIMPLIFY 0x08000000 * URL_ESCAPE_SEGMENT_ONLY 0x00002000 */ -HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, +HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, LPDWORD pcchCanonicalized, DWORD dwFlags) { HRESULT hr = S_OK; @@ -364,7 +364,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, if(dwFlags & URL_UNESCAPE) UrlUnescapeW(lpszUrlCpy, NULL, NULL, URL_UNESCAPE_INPLACE); - if((EscapeFlags = dwFlags & (URL_ESCAPE_UNSAFE | + if((EscapeFlags = dwFlags & (URL_ESCAPE_UNSAFE | URL_ESCAPE_SPACES_ONLY | URL_ESCAPE_PERCENT | URL_DONT_ESCAPE_EXTRA_INFO | @@ -384,7 +384,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, } HeapFree(GetProcessHeap(), 0, lpszUrlCpy); - + if (hr == S_OK) TRACE("result %s\n", debugstr_w(pszCanonicalized)); @@ -407,7 +407,7 @@ HRESULT WINAPI UrlCombineA(LPCSTR pszBase, LPCSTR pszRelative, debugstr_a(pszBase),debugstr_a(pszRelative), *pcchCombined,dwFlags); - base = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, + base = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (3*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR)); relative = base + INTERNET_MAX_URL_LENGTH; combined = relative + INTERNET_MAX_URL_LENGTH; @@ -508,7 +508,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, * .ap2 points to location (starting with '//') * .sizep2 length of location (above) and rest less the last * leaf (if any) - * sizeloc length of location (above) up to but not including + * sizeloc length of location (above) up to but not including * the last '/' */ @@ -548,7 +548,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, } /* handle cases where pszRelative has scheme */ - if ((base.sizep1 == relative.sizep1) && + if ((base.sizep1 == relative.sizep1) && (strncmpW(base.ap1, relative.ap1, base.sizep1) == 0)) { /* since the schemes are the same */ @@ -590,7 +590,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, *pcchCombined = len; ret = E_POINTER; break; - } + } strcatW(preliminary, mrelative); break; @@ -603,7 +603,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, *pcchCombined = len; ret = E_POINTER; break; - } + } strcpyW(preliminary, mrelative); if (!(dwFlags & URL_PLUGGABLE_PROTOCOL) && URL_JustLocation(relative.ap2)) @@ -619,7 +619,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, *pcchCombined = len; ret = E_POINTER; break; - } + } strncpyW(preliminary, base.ap1, base.sizep1 + 1); work = preliminary + base.sizep1 + 1; strcpyW(work, relative.ap2); @@ -638,7 +638,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, *pcchCombined = len; ret = E_POINTER; break; - } + } strncpyW(preliminary, base.ap1, base.sizep1+1+sizeloc); work = preliminary + base.sizep1 + 1 + sizeloc; if (dwFlags & URL_PLUGGABLE_PROTOCOL) @@ -647,7 +647,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, break; case 5: /* - * Return the pszBase without its document (if any) and + * Return the pszBase without its document (if any) and * append pszRelative after its scheme. */ len = base.sizep1 + 1 + base.sizep2 + relative.sizep2; @@ -655,7 +655,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, *pcchCombined = len; ret = E_POINTER; break; - } + } strncpyW(preliminary, base.ap1, base.sizep1+1+base.sizep2); work = preliminary + base.sizep1+1+base.sizep2 - 1; if (*work++ != L'/') @@ -670,7 +670,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, if (ret == S_OK) { /* - * Now that the combining is done, process the escape options if + * Now that the combining is done, process the escape options if * necessary, otherwise just copy the string. */ myflags = dwFlags & (URL_ESCAPE_PERCENT | @@ -787,7 +787,7 @@ HRESULT WINAPI UrlEscapeA( } *pcchEscaped = needed; return ret; -} +} /************************************************************************* * UrlEscapeW [SHLWAPI.@] @@ -884,7 +884,7 @@ HRESULT WINAPI UrlEscapeW( * UrlUnescapeA [SHLWAPI.@] * * Converts escape sequences back to ordinary characters. - * + * * If URL_ESCAPE_INPLACE is set in dwFlags then pszUnescaped and * pcchUnescaped are ignored and the converted string is returned in * pszUrl, otherwise the string is returned in pszUnescaped. @@ -949,7 +949,7 @@ HRESULT WINAPI UrlUnescapeA( *pcchUnescaped = needed; if (ret == S_OK) { - TRACE("result %s\n", (dwFlags & URL_UNESCAPE_INPLACE) ? + TRACE("result %s\n", (dwFlags & URL_UNESCAPE_INPLACE) ? debugstr_a(pszUrl) : debugstr_a(pszUnescaped)); } @@ -1013,7 +1013,7 @@ HRESULT WINAPI UrlUnescapeW( *pcchUnescaped = needed; if (ret == S_OK) { - TRACE("result %s\n", (dwFlags & URL_UNESCAPE_INPLACE) ? + TRACE("result %s\n", (dwFlags & URL_UNESCAPE_INPLACE) ? debugstr_w(pszUrl) : debugstr_w(pszUnescaped)); } @@ -1024,15 +1024,15 @@ HRESULT WINAPI UrlUnescapeW( * UrlGetLocationA [SHLWAPI.@] * * Bugs/Features: - * MSDN (as of 2001-11-01) says that: - * "The location is the segment of the URL starting with a ? - * or # character." + * MSDN (as of 2001-11-01) says that: + * "The location is the segment of the URL starting with a ? + * or # character." * Neither V4 nor V5 of shlwapi.dll implement the '?' and always return * a NULL. * MSDN further states that: - * "If a file URL has a query string, ther returned string + * "If a file URL has a query string, ther returned string * the query string." - * In all test cases if the scheme starts with "fi" then a NULL is + * In all test cases if the scheme starts with "fi" then a NULL is * returned. V5 gives the following results: * NULL file://aa/b/cd#hohoh * #hohoh http://aa/b/cd#hohoh @@ -1186,7 +1186,7 @@ HRESULT WINAPI UrlApplySchemeA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWOR TRACE("(in %s, out size %ld, flags %08lx) using W version\n", debugstr_a(pszIn), *pcchOut, dwFlags); - in = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, + in = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR)); out = in + INTERNET_MAX_URL_LENGTH; @@ -1300,7 +1300,7 @@ HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DW debugstr_w(pszIn), *pcchOut, dwFlags); if (dwFlags & URL_APPLY_GUESSFILE) { - FIXME("(%s %p %p(%ld) 0x%08lx): stub URL_APPLY_GUESSFILE not implemented\n", + FIXME("(%s %p %p(%ld) 0x%08lx): stub URL_APPLY_GUESSFILE not implemented\n", debugstr_w(pszIn), pszOut, pcchOut, *pcchOut, dwFlags); strcpyW(pszOut, pszIn); *pcchOut = strlenW(pszOut); @@ -1313,7 +1313,7 @@ HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DW if (res1) { /* no scheme in input, need to see if we need to guess */ if (dwFlags & URL_APPLY_GUESSSCHEME) { - if ((ret = URL_GuessScheme(pszIn, pszOut, pcchOut)) != -1) + if ((ret = URL_GuessScheme(pszIn, pszOut, pcchOut)) != -1) return ret; } } @@ -1332,7 +1332,7 @@ HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DW } } - /* If we are here, then either invalid scheme, + /* If we are here, then either invalid scheme, * or no scheme and can't/failed guess. */ if ( ( ((res1 == 0) && (dwFlags & URL_APPLY_FORCEAPPLY)) || @@ -1502,7 +1502,7 @@ LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type) start++; (*size)++; } else if (*start == L'%') { - if (isxdigitW(*(start+1)) && + if (isxdigitW(*(start+1)) && isxdigitW(*(start+2))) { start += 3; *size += 3; @@ -1614,13 +1614,13 @@ LONG URL_ParseUrl(LPCWSTR pszUrl, WINE_PARSE_URL *pl) /************************************************************************* * UrlGetPartA [SHLWAPI.@] */ -HRESULT WINAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, +HRESULT WINAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, DWORD dwPart, DWORD dwFlags) { LPWSTR in, out; DWORD ret, len, len2; - in = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, + in = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR)); out = in + INTERNET_MAX_URL_LENGTH; @@ -1649,7 +1649,7 @@ HRESULT WINAPI UrlGetPartA(LPCSTR pszIn, LPSTR pszOut, LPDWORD pcchOut, /************************************************************************* * UrlGetPartW [SHLWAPI.@] */ -HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, +HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD dwPart, DWORD dwFlags) { WINE_PARSE_URL pl; diff --git a/dlls/snmpapi/main.c b/dlls/snmpapi/main.c index 63be398d87e..035436b6daa 100644 --- a/dlls/snmpapi/main.c +++ b/dlls/snmpapi/main.c @@ -35,7 +35,7 @@ BOOL WINAPI SNMPAPI_DllMain( LPVOID lpvReserved) { TRACE("(%08x,%08lx,%p)\n", hInstDLL, fdwReason, lpvReserved); - + switch(fdwReason) { case DLL_PROCESS_ATTACH: break; @@ -46,6 +46,6 @@ BOOL WINAPI SNMPAPI_DllMain( case DLL_THREAD_DETACH: break; } - + return TRUE; } diff --git a/dlls/tapi32/assisted.c b/dlls/tapi32/assisted.c index dbd92fc9274..098ccfaf16b 100644 --- a/dlls/tapi32/assisted.c +++ b/dlls/tapi32/assisted.c @@ -31,11 +31,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(tapi); DWORD WINAPI tapiGetLocationInfo(LPSTR lpszCountryCode, LPSTR lpszCityCode) { char temp[30]; - + FIXME("(%s, %s): file sections ???\n", lpszCountryCode, lpszCityCode); if (!(GetPrivateProfileStringA("Locations", "CurrentLocation", "", temp, 30, "telephon.ini"))) return TAPIERR_REQUESTFAILED; - if (!(GetPrivateProfileStringA("Locations", "FIXME_ENTRY", "", lpszCityCode, 8, "telephon.ini"))) + if (!(GetPrivateProfileStringA("Locations", "FIXME_ENTRY", "", lpszCityCode, 8, "telephon.ini"))) return TAPIERR_REQUESTFAILED; return 0; } diff --git a/dlls/tapi32/line.c b/dlls/tapi32/line.c index 5345c2ea61c..e21ac09ddfe 100644 --- a/dlls/tapi32/line.c +++ b/dlls/tapi32/line.c @@ -44,7 +44,7 @@ DWORD WINAPI lineAddProvider(LPCSTR lpszProviderName, HWND hwndOwner, LPDWORD lp { FIXME("(%s, %04x, %p): stub.\n", lpszProviderName, hwndOwner, lpdwPermanentProviderID); return 1; -} +} /*********************************************************************** * lineAddToConference (TAPI32.@) @@ -62,7 +62,7 @@ DWORD WINAPI lineAnswer(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize) { FIXME("(%04x, %s, %ld): stub.\n", hCall, lpsUserUserInfo, dwSize); return 1; -} +} /*********************************************************************** * lineBlindTransfer (TAPI32.@) @@ -71,7 +71,7 @@ DWORD WINAPI lineBlindTransfer(HCALL hCall, LPCSTR lpszDestAddress, DWORD dwCoun { FIXME("(%04x, %s, %08lx): stub.\n", hCall, lpszDestAddress, dwCountryCode); return 1; -} +} /*********************************************************************** * lineClose (TAPI32.@) @@ -80,7 +80,7 @@ DWORD WINAPI lineClose(HLINE hLine) { FIXME("(%04x): stub.\n", hLine); return 0; -} +} /*********************************************************************** * lineCompleteCall (TAPI32.@) @@ -89,7 +89,7 @@ DWORD WINAPI lineCompleteCall(HCALL hCall, LPDWORD lpdwCompletionID, DWORD dwCom { FIXME("(%04x, %p, %08lx, %08lx): stub.\n", hCall, lpdwCompletionID, dwCompletionMode, dwMessageID); return 1; -} +} /*********************************************************************** * lineCompleteTransfer (TAPI32.@) @@ -107,7 +107,7 @@ DWORD WINAPI lineConfigDialog(DWORD dwDeviceID, HWND hwndOwner, LPCSTR lpszDevic { FIXME("(%08lx, %04x, %s): stub.\n", dwDeviceID, hwndOwner, lpszDeviceClass); return 0; -} +} /*********************************************************************** * lineConfigDialogEdit (TAPI32.@) @@ -116,7 +116,7 @@ DWORD WINAPI lineConfigDialogEdit(DWORD dwDeviceID, HWND hwndOwner, LPCSTR lpszD { FIXME("stub.\n"); return 0; -} +} /*********************************************************************** * lineConfigProvider (TAPI32.@) @@ -143,7 +143,7 @@ DWORD WINAPI lineDevSpecific(HLINE hLine, DWORD dwAddressId, HCALL hCall, LPVOID { FIXME("(%04x, %08lx, %04x, %p, %ld): stub.\n", hLine, dwAddressId, hCall, lpParams, dwSize); return 1; -} +} /*********************************************************************** * lineDevSpecificFeature (TAPI32.@) @@ -165,7 +165,7 @@ DWORD WINAPI lineDial(HCALL hCall, LPCSTR lpszDestAddress, DWORD dwCountryCode) /*********************************************************************** * lineDrop (TAPI32.@) - */ + */ DWORD WINAPI lineDrop(HCALL hCall, LPCSTR lpsUserUserInfo, DWORD dwSize) { FIXME("(%04x, %s, %08lx): stub.\n", hCall, lpsUserUserInfo, dwSize); @@ -183,7 +183,7 @@ DWORD WINAPI lineForward(HLINE hLine, DWORD bAllAddress, DWORD dwAdressID, LPLIN /*********************************************************************** * lineGatherDigits (TAPI32.@) - */ + */ DWORD WINAPI lineGatherDigits(HCALL hCall, DWORD dwDigitModes, LPSTR lpsDigits, DWORD dwNumDigits, LPCSTR lpszTerminationDigits, DWORD dwFirstDigitTimeout, DWORD dwInterDigitTimeout) { FIXME("stub.\n"); @@ -206,7 +206,7 @@ DWORD WINAPI lineGenerateTone(HCALL hCall, DWORD dwToneMode, DWORD dwDuration, D { FIXME("(%04x, %08lx, %ld, %ld, %p): stub.\n", hCall, dwToneMode, dwDuration, dwNumTones, lpTones); return 0; -} +} /*********************************************************************** * lineGetAddressCaps (TAPI32.@) @@ -242,7 +242,7 @@ DWORD WINAPI lineGetAppPriority(LPCSTR lpszAppFilename, DWORD dwMediaMode, LPLIN { FIXME("(%s, %08lx, %p, %08lx, %p, %p): stub.\n", lpszAppFilename, dwMediaMode, lpExtensionID, dwRequestMode, lpExtensionName, lpdwPriority); return 0; -} +} /*********************************************************************** * lineGetCallInfo (TAPI32.@) @@ -269,16 +269,16 @@ DWORD WINAPI lineGetConfRelatedCalls(HCALL hCall, LPLINECALLLIST lpCallList) { FIXME("(%04x, %p): stub.\n", hCall, lpCallList); return 0; -} +} typedef struct tagTAPI_CountryInfo { DWORD dwCountryID; DWORD dwCountryCode; LPSTR lpCountryName; - LPSTR lpSameAreaRule; - LPSTR lpLongDistanceRule; - LPSTR lpInternationalRule; + LPSTR lpSameAreaRule; + LPSTR lpLongDistanceRule; + LPSTR lpInternationalRule; } TAPI_CountryInfo; /* FIXME: this should be stored in an ini file... perhaps TAPI.INI */ @@ -306,7 +306,7 @@ DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRY return LINEERR_INVALPOINTER; } - TRACE("(%08lx, %08lx, %p(%ld)): stub.\n", + TRACE("(%08lx, %08lx, %p(%ld)): stub.\n", dwCountryID, dwAPIVersion, lpLineCountryList, lpLineCountryList->dwTotalSize); @@ -408,7 +408,7 @@ DWORD WINAPI lineGetDevCaps(HLINEAPP hLineApp, DWORD dwDeviceID, DWORD dwAPIVers { FIXME("(%04x, %08lx, %08lx, %08lx, %p): stub.\n", hLineApp, dwDeviceID, dwAPIVersion, dwExtVersion, lpLineDevCaps); return 0; -} +} /*********************************************************************** * lineGetDevConfig (TAPI32.@) @@ -435,7 +435,7 @@ DWORD WINAPI lineGetIcon(DWORD dwDeviceID, LPCSTR lpszDeviceClass, HICON *lphIco { FIXME("(%08lx, %s, %p): stub.\n", dwDeviceID, lpszDeviceClass, lphIcon); return 0; -} +} /*********************************************************************** * lineGetLineDevStatus (TAPI32.@) @@ -444,7 +444,7 @@ DWORD WINAPI lineGetLineDevStatus(HLINE hLine, LPLINEDEVSTATUS lpLineDevStatus) { FIXME("(%04x, %p): stub.\n", hLine, lpLineDevStatus); return 0; -} +} /*********************************************************************** * lineGetNewCalls (TAPI32.@) @@ -471,7 +471,7 @@ DWORD WINAPI lineGetProviderList(DWORD dwAPIVersion, LPLINEPROVIDERLIST lpProvid { FIXME("(%08lx, %p): stub.\n", dwAPIVersion, lpProviderList); return 0; -} +} /*********************************************************************** * lineGetRequest (TAPI32.@) @@ -480,7 +480,7 @@ DWORD WINAPI lineGetRequest(HLINEAPP hLineApp, DWORD dwRequestMode, LPVOID lpReq { FIXME("%04x, %08lx, %p): stub.\n", hLineApp, dwRequestMode, lpRequestBuffer); return 0; -} +} /*********************************************************************** * lineGetStatusMessages (TAPI32.@) @@ -489,7 +489,7 @@ DWORD WINAPI lineGetStatusMessages(HLINE hLine, LPDWORD lpdwLineStatus, LPDWORD { FIXME("(%04x, %p, %p): stub.\n", hLine, lpdwLineStatus, lpdwAddressStates); return 0; -} +} /*********************************************************************** * lineGetTranslateCaps (TAPI32.@) @@ -507,7 +507,7 @@ DWORD WINAPI lineHandoff(HCALL hCall, LPCSTR lpszFileName, DWORD dwMediaMode) { FIXME("(%04x, %s, %08lx): stub.\n", hCall, lpszFileName, dwMediaMode); return 0; -} +} /*********************************************************************** * lineHold (TAPI32.@) @@ -516,7 +516,7 @@ DWORD WINAPI lineHold(HCALL hCall) { FIXME("(%04x): stub.\n", hCall); return 1; -} +} /*********************************************************************** * lineInitialize (TAPI32.@) @@ -558,7 +558,7 @@ DWORD WINAPI lineMonitorMedia(HCALL hCall, DWORD dwMediaModes) { FIXME("(%04x, %08lx): stub.\n", hCall, dwMediaModes); return 0; -} +} /*********************************************************************** * lineMonitorTones (TAPI32.@) @@ -567,7 +567,7 @@ DWORD WINAPI lineMonitorTones(HCALL hCall, LPLINEMONITORTONE lpToneList, DWORD d { FIXME("(%04x, %p, %08lx): stub.\n", hCall, lpToneList, dwNumEntries); return 0; -} +} /*********************************************************************** * lineNegotiateAPIVersion (TAPI32.@) @@ -581,7 +581,7 @@ DWORD WINAPI lineNegotiateAPIVersion( LPLINEEXTENSIONID lpExtensionID ) { - FIXME("(%04x, %ld, %ld, %ld, %p, %p): stub.\n", hLineApp, dwDeviceID, + FIXME("(%04x, %ld, %ld, %ld, %p, %p): stub.\n", hLineApp, dwDeviceID, dwAPILowVersion, dwAPIHighVersion, lpdwAPIVersion, lpExtensionID); *lpdwAPIVersion = dwAPIHighVersion; return 0; @@ -612,7 +612,7 @@ DWORD WINAPI linePark(HCALL hCall, DWORD dwParkMode, LPCSTR lpszDirAddress, LPVA { FIXME("(%04x, %08lx, %s, %p): stub.\n", hCall, dwParkMode, lpszDirAddress, lpNonDirAddress); return 1; -} +} /*********************************************************************** * linePickup (TAPI32.@) @@ -621,7 +621,7 @@ DWORD WINAPI linePickup(HLINE hLine, DWORD dwAddressID, LPHCALL lphCall, LPCSTR { FIXME("(%04x, %08lx, %p, %s, %s): stub.\n", hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID); return 1; -} +} /*********************************************************************** * linePrepareAddToConference (TAPI32.@) @@ -630,7 +630,7 @@ DWORD WINAPI linePrepareAddToConference(HCALL hConfCall, LPHCALL lphConsultCall, { FIXME("(%04x, %p, %p): stub.\n", hConfCall, lphConsultCall, lpCallParams); return 1; -} +} /*********************************************************************** * lineRedirect (TAPI32.@) @@ -660,7 +660,7 @@ DWORD WINAPI lineReleaseUserUserInfo(HCALL hCall) { FIXME("(%04x): stub.\n", hCall); return 1; -} +} /*********************************************************************** * lineRemoveFromConference (TAPI32.@) @@ -678,7 +678,7 @@ DWORD WINAPI lineRemoveProvider(DWORD dwPermanentProviderID, HWND hwndOwner) { FIXME("(%08lx, %04x): stub.\n", dwPermanentProviderID, hwndOwner); return 1; -} +} /*********************************************************************** * lineSecureCall (TAPI32.@) @@ -732,8 +732,8 @@ DWORD WINAPI lineSetCallPrivilege(HCALL hCall, DWORD dwCallPrivilege) { FIXME("(%04x, %08lx): stub.\n", hCall, dwCallPrivilege); return 0; -} - +} + /*********************************************************************** * lineSetCurrentLocation (TAPI32.@) */ @@ -764,7 +764,7 @@ LPLINEMEDIACONTROLDIGIT const lpDigitList, DWORD dwDigitNumEntries, LPLINEMEDIACONTROLMEDIA const lpMediaList, DWORD dwMediaNumEntries, -LPLINEMEDIACONTROLTONE const lpToneList, +LPLINEMEDIACONTROLTONE const lpToneList, DWORD dwToneNumEntries, LPLINEMEDIACONTROLCALLSTATE const lpCallStateList, DWORD dwCallStateNumEntries) @@ -780,7 +780,7 @@ DWORD WINAPI lineSetMediaMode(HCALL hCall, DWORD dwMediaModes) { FIXME("(%04x, %08lx): stub.\n", hCall, dwMediaModes); return 0; -} +} /*********************************************************************** * lineSetNumRings (TAPI32.@) @@ -789,8 +789,8 @@ DWORD WINAPI lineSetNumRings(HLINE hLine, DWORD dwAddressID, DWORD dwNumRings) { FIXME("(%04x, %08lx, %08lx): stub.\n", hLine, dwAddressID, dwNumRings); return 0; -} - +} + /*********************************************************************** * lineSetStatusMessages (TAPI32.@) */ @@ -798,8 +798,8 @@ DWORD WINAPI lineSetStatusMessages(HLINE hLine, DWORD dwLineStates, DWORD dwAddr { FIXME("(%04x, %08lx, %08lx): stub.\n", hLine, dwLineStates, dwAddressStates); return 0; -} - +} + /*********************************************************************** * lineSetTerminal (TAPI32.@) */ @@ -807,7 +807,7 @@ DWORD WINAPI lineSetTerminal(HLINE hLine, DWORD dwAddressID, HCALL hCall, DWORD { FIXME("(%04x, %08lx, %04x, %08lx, %08lx, %08lx, %08lx): stub.\n", hLine, dwAddressID, hCall, dwSelect, dwTerminalModes, dwTerminalID, bEnable); return 1; -} +} /*********************************************************************** * lineSetTollList (TAPI32.@) @@ -816,8 +816,8 @@ DWORD WINAPI lineSetTollList(HLINEAPP hLineApp, DWORD dwDeviceID, LPCSTR lpszAdd { FIXME("(%04x, %08lx, %s, %08lx): stub.\n", hLineApp, dwDeviceID, lpszAddressIn, dwTollListOption); return 0; -} - +} + /*********************************************************************** * lineSetupConference (TAPI32.@) */ @@ -834,7 +834,7 @@ DWORD WINAPI lineSetupTransfer(HCALL hCall, LPHCALL lphConsultCall, LPLINECALLPA { FIXME("(%04x, %p, %p): stub.\n", hCall, lphConsultCall, lpCallParams); return 1; -} +} /*********************************************************************** * lineShutdown (TAPI32.@) diff --git a/dlls/tapi32/phone.c b/dlls/tapi32/phone.c index 110dc497198..7b490526754 100644 --- a/dlls/tapi32/phone.c +++ b/dlls/tapi32/phone.c @@ -97,8 +97,8 @@ DWORD WINAPI phoneGetGain(HPHONE hPhone, DWORD dwHookSwitchDev, LPDWORD lpdwGain { FIXME("(%04x, %08lx, %p): stub.\n", hPhone, dwHookSwitchDev, lpdwGain); return 0; -} - +} + /*********************************************************************** * phoneGetHookSwitch (TAPI32.@) */ diff --git a/dlls/ttydrv/dc.c b/dlls/ttydrv/dc.c index f4d2c25cfe6..95f9efdd230 100644 --- a/dlls/ttydrv/dc.c +++ b/dlls/ttydrv/dc.c @@ -45,11 +45,11 @@ BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device, TTYDRV_PDEVICE *physDev; TRACE("(%p, %s, %s, %s, %p)\n", - dc, debugstr_a(driver), debugstr_a(device), + dc, debugstr_a(driver), debugstr_a(device), debugstr_a(output), initData); dc->physDev = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(TTYDRV_PDEVICE)); + sizeof(TTYDRV_PDEVICE)); if(!dc->physDev) { ERR("Can't allocate physDev\n"); return FALSE; diff --git a/dlls/ttydrv/graphics.c b/dlls/ttydrv/graphics.c index 25a205f2c1e..afe08d494d6 100644 --- a/dlls/ttydrv/graphics.c +++ b/dlls/ttydrv/graphics.c @@ -99,14 +99,14 @@ BOOL TTYDRV_DC_LineTo(TTYDRV_PDEVICE *physDev, INT x, INT y) if(row1 > row2) { INT tmp = row1; row1 = row2; - row2 = tmp; - } + row2 = tmp; + } if(col1 > col2) { INT tmp = col1; col1 = col2; - col2 = tmp; - } + col2 = tmp; + } wmove(physDev->window, row1, col1); if(col1 == col2) { @@ -179,7 +179,7 @@ BOOL TTYDRV_DC_PolyPolygon(TTYDRV_PDEVICE *physDev, const POINT* pt, const INT* BOOL TTYDRV_DC_PolyPolyline(TTYDRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines) { FIXME("(%x, %p, %p, %lu): stub\n", physDev->hdc, pt, counts, polylines); - + return TRUE; } @@ -205,13 +205,13 @@ BOOL TTYDRV_DC_Rectangle(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, if(row1 > row2) { INT tmp = row1; row1 = row2; - row2 = tmp; - } + row2 = tmp; + } if(col1 > col2) { INT tmp = col1; col1 = col2; - col2 = tmp; - } + col2 = tmp; + } wmove(physDev->window, row1, col1); whline(physDev->window, ACS_HLINE, col2-col1); @@ -246,9 +246,9 @@ BOOL TTYDRV_DC_Rectangle(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, BOOL TTYDRV_DC_RoundRect(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height) { - FIXME("(%x, %d, %d, %d, %d, %d, %d): stub\n", + FIXME("(%x, %d, %d, %d, %d, %d, %d): stub\n", physDev->hdc, left, top, right, bottom, ell_width, ell_height); - + return TRUE; } @@ -344,7 +344,7 @@ BOOL TTYDRV_DC_ExtTextOut(TTYDRV_PDEVICE *physDev, INT x, INT y, UINT flags, x = XLPTODP(dc, x); y = YLPTODP(dc, y); - + row = (dc->DCOrgY + y) / physDev->cellHeight; col = (dc->DCOrgX + x) / physDev->cellWidth; len = WideCharToMultiByte( CP_ACP, 0, str, count, NULL, 0, NULL, NULL ); @@ -411,7 +411,7 @@ BOOL TTYDRV_DC_GetTextMetrics(TTYDRV_PDEVICE *physDev, LPTEXTMETRICW lptm) lptm->tmDescent = 0; lptm->tmInternalLeading = 0; lptm->tmExternalLeading = 0; - lptm->tmAveCharWidth = physDev->cellWidth; + lptm->tmAveCharWidth = physDev->cellWidth; lptm->tmMaxCharWidth = physDev->cellWidth; lptm->tmWeight = FW_MEDIUM; lptm->tmOverhang = 0; diff --git a/dlls/ttydrv/palette.c b/dlls/ttydrv/palette.c index 7a25ad2b62a..ae20ab26a51 100644 --- a/dlls/ttydrv/palette.c +++ b/dlls/ttydrv/palette.c @@ -36,7 +36,7 @@ extern PALETTEENTRY *COLOR_sysPal; static int palette_size = 256; /* FIXME */ -extern const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS]; +extern const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS]; /*********************************************************************** * TTYDRV_PALETTE_Initialize @@ -68,15 +68,15 @@ BOOL TTYDRV_PALETTE_Initialize(void) if((src->peRed + src->peGreen + src->peBlue) <= 0xB0) { dst->peRed = 0; - dst->peGreen = 0; + dst->peGreen = 0; dst->peBlue = 0; dst->peFlags = PC_SYS_USED; } else { - dst->peRed = 255; - dst->peGreen= 255; + dst->peRed = 255; + dst->peGreen= 255; dst->peBlue = 255; dst->peFlags = PC_SYS_USED; - } + } } return TRUE; diff --git a/dlls/ttydrv/ttydrv.h b/dlls/ttydrv/ttydrv.h index 19dc93df4c1..cc817a02318 100644 --- a/dlls/ttydrv/ttydrv.h +++ b/dlls/ttydrv/ttydrv.h @@ -21,9 +21,9 @@ #ifndef __WINE_TTYDRV_H #define __WINE_TTYDRV_H -#ifndef __WINE_CONFIG_H -# error You must include config.h to use this header -#endif +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif #undef ERR #ifdef HAVE_NCURSES_H diff --git a/dlls/ttydrv/user.c b/dlls/ttydrv/user.c index 9a488abf600..ff1c58759f0 100644 --- a/dlls/ttydrv/user.c +++ b/dlls/ttydrv/user.c @@ -48,7 +48,7 @@ UINT16 TTYDRV_MapVirtualKey(UINT16 wCode, UINT16 wMapType) * GetKeyNameText (TTYDRV.@) */ INT16 TTYDRV_GetKeyNameText( LONG lParam, LPSTR lpBuffer, INT16 nSize ) -{ +{ if(lpBuffer && nSize) { *lpBuffer = 0; diff --git a/dlls/ttydrv/wnd.c b/dlls/ttydrv/wnd.c index ac65fe7eed4..7915d30d546 100644 --- a/dlls/ttydrv/wnd.c +++ b/dlls/ttydrv/wnd.c @@ -95,7 +95,7 @@ BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) { TRACE("CBT-hook returned !0\n"); return FALSE; - } + } } if (unicode) @@ -254,7 +254,7 @@ static HRGN DCE_GetVisRgn( HWND hwnd, WORD flags, HWND hwndChild, WORD cflags ) if( hrgnClip ) { - /* Compute obscured region for the visible rectangle by + /* Compute obscured region for the visible rectangle by * clipping children, siblings, and ancestors. Note that * DCE_GetVisRect() returns a rectangle either in client * or in window coordinates (for DCX_WINDOW request). */ @@ -263,7 +263,7 @@ static HRGN DCE_GetVisRgn( HWND hwnd, WORD flags, HWND hwndChild, WORD cflags ) { if( flags & DCX_WINDOW ) { - /* adjust offsets since child window rectangles are + /* adjust offsets since child window rectangles are * in client coordinates */ xoffset = wndPtr->rectClient.left - wndPtr->rectWindow.left; @@ -284,7 +284,7 @@ static HRGN DCE_GetVisRgn( HWND hwnd, WORD flags, HWND hwndChild, WORD cflags ) { if( flags & DCX_WINDOW ) { - /* adjust offsets since child window rectangles are + /* adjust offsets since child window rectangles are * in client coordinates */ xoffset = wndPtr->rectClient.left - wndPtr->rectWindow.left; @@ -301,7 +301,7 @@ static HRGN DCE_GetVisRgn( HWND hwnd, WORD flags, HWND hwndChild, WORD cflags ) &rect, xoffset, yoffset ); } - /* sibling window rectangles are in client + /* sibling window rectangles are in client * coordinates of the parent window */ if (flags & DCX_WINDOW) @@ -674,7 +674,7 @@ BOOL TTYDRV_SetWindowPos( WINDOWPOS *winpos ) /*********************************************************************** * WINPOS_MinMaximize (internal) * - *Lifted from x11 driver + *Lifted from x11 driver */ static UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ) { @@ -703,7 +703,7 @@ static UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ) * ShowWindow (TTYDRV.@) * *Lifted from x11 driver - *Sets the specified windows' show state. + *Sets the specified windows' show state. */ BOOL TTYDRV_ShowWindow( HWND hwnd, INT cmd ) { @@ -722,7 +722,7 @@ BOOL TTYDRV_ShowWindow( HWND hwnd, INT cmd ) switch(cmd) { case SW_HIDE: - if (!wasVisible) goto END;; + if (!wasVisible) goto END; swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER; break; diff --git a/dlls/twain/capability.c b/dlls/twain/capability.c index 6ac58455021..28311e71dc3 100644 --- a/dlls/twain/capability.c +++ b/dlls/twain/capability.c @@ -140,7 +140,7 @@ TW_UINT16 TWAIN_SaneCapability (activeDS *pSource, pTW_CAPABILITY pCapability, twCC = TWCC_CAPUNSUPPORTED; break; case CAP_XFERCOUNT: - /* This is a required capability that every source need to + /* This is a required capability that every source need to support but we havev't implemented yet. */ twCC = TWCC_SUCCESS; break; @@ -148,7 +148,7 @@ TW_UINT16 TWAIN_SaneCapability (activeDS *pSource, pTW_CAPABILITY pCapability, case ICAP_IMAGEFILEFORMAT: case ICAP_TILES: twCC = TWCC_CAPUNSUPPORTED; - break; + break; case ICAP_XFERMECH: twCC = TWAIN_ICAPXferMech (pSource, pCapability, action); break; @@ -161,7 +161,7 @@ TW_UINT16 TWAIN_SaneCapability (activeDS *pSource, pTW_CAPABILITY pCapability, break; default: twCC = TWRC_FAILURE; - + } return twCC; @@ -170,7 +170,7 @@ TW_UINT16 TWAIN_SaneCapability (activeDS *pSource, pTW_CAPABILITY pCapability, TW_BOOL TWAIN_OneValueSet (pTW_CAPABILITY pCapability, TW_UINT32 value) { pCapability->hContainer = (TW_HANDLE)GlobalAlloc (0, sizeof(TW_ONEVALUE)); - + if (pCapability->hContainer) { pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); @@ -196,11 +196,11 @@ TW_BOOL TWAIN_OneValueGet (pTW_CAPABILITY pCapability, TW_UINT32 *pValue) else return FALSE; } - + /* ICAP_XFERMECH */ TW_UINT16 TWAIN_ICAPXferMech (activeDS *pSource, pTW_CAPABILITY pCapability, TW_UINT16 action) -{ +{ TRACE("ICAP_XFERMECH\n"); switch (action) diff --git a/dlls/twain/ds_ctrl.c b/dlls/twain/ds_ctrl.c index 806e71ba563..4dd351541e4 100644 --- a/dlls/twain/ds_ctrl.c +++ b/dlls/twain/ds_ctrl.c @@ -31,9 +31,9 @@ TW_UINT16 TWAIN_CapabilityGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, TW_UINT16 twRC = TWRC_SUCCESS, twCC = TWCC_SUCCESS; pTW_CAPABILITY pCapability = (pTW_CAPABILITY) pData; activeDS *pSource = TWAIN_LookupSource (pDest); - + TRACE("DG_CONTROL/DAT_CAPABILITY/MSG_GET\n"); - + if (!pDest) { twRC = TWRC_FAILURE; @@ -48,7 +48,7 @@ TW_UINT16 TWAIN_CapabilityGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, { twCC = TWAIN_SaneCapability (pSource, pCapability, MSG_GET); twRC = (twCC == TWCC_SUCCESS)?TWRC_SUCCESS:TWRC_FAILURE; - pSource->twCC = twCC; + pSource->twCC = twCC; } return twRC; @@ -79,7 +79,7 @@ TW_UINT16 TWAIN_CapabilityGetCurrent (pTW_IDENTITY pOrigin, twCC = TWAIN_SaneCapability (pSource, pCapability, MSG_GETCURRENT); twRC = (twCC == TWCC_SUCCESS)?TWRC_SUCCESS:TWRC_FAILURE; pSource->twCC = twCC; - } + } return twRC; } @@ -154,7 +154,7 @@ TW_UINT16 TWAIN_CapabilityReset (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, } /* DG_CONTROL/DAT_CAPABILITY/MSG_SET */ -TW_UINT16 TWAIN_CapabilitySet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, +TW_UINT16 TWAIN_CapabilitySet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, TW_MEMREF pData) { TW_UINT16 twRC = TWRC_SUCCESS, twCC = TWCC_SUCCESS; @@ -175,7 +175,7 @@ TW_UINT16 TWAIN_CapabilitySet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, } else { - twCC = TWAIN_SaneCapability (pSource, pCapability, MSG_SET); + twCC = TWAIN_SaneCapability (pSource, pCapability, MSG_SET); twRC = (twCC == TWCC_SUCCESS)?TWRC_SUCCESS:TWRC_FAILURE; pSource->twCC = twCC; } @@ -566,7 +566,7 @@ TW_UINT16 TWAIN_GetDSStatus (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, /* Reset the condition code */ pSource->twCC = TWCC_SUCCESS; } - + return twRC; } @@ -606,9 +606,9 @@ TW_UINT16 TWAIN_EnableDSUserInterface (pTW_IDENTITY pOrigin, TW_UINT16 twRC = TWRC_SUCCESS; pTW_USERINTERFACE pUserInterface = (pTW_USERINTERFACE) pData; activeDS *pSource = TWAIN_LookupSource (pDest); - + TRACE ("DG_CONTROL/DAT_USERINTERFACE/MSG_ENABLEDS\n"); - + if (!pSource) { twRC = TWRC_FAILURE; @@ -623,7 +623,7 @@ TW_UINT16 TWAIN_EnableDSUserInterface (pTW_IDENTITY pOrigin, { if (pUserInterface->ShowUI) { - pSource->currentState = 5; /* Transitions to state 5 */ + pSource->currentState = 5; /* Transitions to state 5 */ /* FIXME: we should replace xscanimage with our own device UI */ system ("xscanimage"); pSource->currentState = 6; @@ -632,10 +632,10 @@ TW_UINT16 TWAIN_EnableDSUserInterface (pTW_IDENTITY pOrigin, else { /* no UI will be displayed, so source is ready to transfer data */ - pSource->pendingEvent.TWMessage = MSG_XFERREADY; + pSource->pendingEvent.TWMessage = MSG_XFERREADY; pSource->currentState = 6; /* Transitions to state 6 directly */ } - + pSource->hwndOwner = pUserInterface->hParent; twRC = TWRC_SUCCESS; pSource->twCC = TWCC_SUCCESS; @@ -669,7 +669,7 @@ TW_UINT16 TWAIN_EnableDSUIOnly (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, system ("xscanimage"); pSource->currentState = 5; twRC = TWRC_SUCCESS; - pSource->twCC = TWCC_SUCCESS; + pSource->twCC = TWCC_SUCCESS; } return twRC; diff --git a/dlls/twain/ds_image.c b/dlls/twain/ds_image.c index 077921e4566..29b6f00cd41 100644 --- a/dlls/twain/ds_image.c +++ b/dlls/twain/ds_image.c @@ -120,7 +120,7 @@ TW_UINT16 TWAIN_ImageInfoGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, pImageInfo->Planar = TRUE; pImageInfo->PixelType = TWPT_RGB; pImageInfo->Compression = TWCP_NONE; - } + } else if (pSource->sane_param.depth == 8) { /* FIXME: fill the image info structure for 8-bit image */ @@ -193,7 +193,7 @@ TW_UINT16 TWAIN_ImageNativeXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, BITMAPINFO bmpInfo; VOID *pBits; HDC dc; - + TRACE("DG_IMAGE/DAT_IMAGENATIVEXFER/MSG_GET\n"); if (!pSource) @@ -217,7 +217,7 @@ TW_UINT16 TWAIN_ImageNativeXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, pSource->twCC = TWCC_OPERATIONERROR; return TWRC_FAILURE; } - + status = sane_get_parameters (pSource->deviceHandle, &pSource->sane_param); if (status != SANE_STATUS_GOOD) { @@ -247,7 +247,7 @@ TW_UINT16 TWAIN_ImageNativeXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, bmpInfo.bmiColors[0].rgbBlue = 128; bmpInfo.bmiColors[0].rgbGreen = 128; bmpInfo.bmiColors[0].rgbRed = 128; - hDIB = CreateDIBSection ((dc = GetDC(pSource->hwndOwner)), &bmpInfo, + hDIB = CreateDIBSection ((dc = GetDC(pSource->hwndOwner)), &bmpInfo, DIB_RGB_COLORS, &pBits, 0, 0); if (!hDIB) { @@ -255,10 +255,10 @@ TW_UINT16 TWAIN_ImageNativeXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, pSource->twCC = TWCC_LOWMEMORY; return TWRC_FAILURE; } - + do { - status = sane_read (pSource->deviceHandle, buffer, + status = sane_read (pSource->deviceHandle, buffer, sizeof (buffer), &buff_len); if (status == SANE_STATUS_GOOD) { @@ -273,11 +273,11 @@ TW_UINT16 TWAIN_ImageNativeXferGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, return TWRC_FAILURE; } } while (status == SANE_STATUS_GOOD); - - sane_cancel (pSource->deviceHandle); + + sane_cancel (pSource->deviceHandle); ReleaseDC (pSource->hwndOwner, dc); *pHandle = hDIB; - twRC = TWRC_XFERDONE; + twRC = TWRC_XFERDONE; pSource->twCC = TWCC_SUCCESS; pSource->currentState = 7; } diff --git a/dlls/twain/dsm_ctrl.c b/dlls/twain/dsm_ctrl.c index 8ca51720580..e9607e7d9f8 100644 --- a/dlls/twain/dsm_ctrl.c +++ b/dlls/twain/dsm_ctrl.c @@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(twain); /* DG_CONTROL/DAT_IDENTITY/MSG_CLOSEDS */ -TW_UINT16 TWAIN_CloseDS (pTW_IDENTITY pOrigin, TW_MEMREF pData) +TW_UINT16 TWAIN_CloseDS (pTW_IDENTITY pOrigin, TW_MEMREF pData) { #ifndef HAVE_SANE DSM_twCC = TWCC_NODS; @@ -73,7 +73,7 @@ TW_UINT16 TWAIN_CloseDS (pTW_IDENTITY pOrigin, TW_MEMREF pData) twRC = TWRC_FAILURE; DSM_twCC = TWCC_NODS; } - + return twRC; #endif } @@ -118,7 +118,7 @@ TW_UINT16 TWAIN_IdentityGetDefault (pTW_IDENTITY pOrigin, TW_MEMREF pData) twRC = TWRC_FAILURE; DSM_twCC = TWCC_NODS; } - + return twRC; #endif } @@ -133,7 +133,7 @@ TW_UINT16 TWAIN_IdentityGetFirst (pTW_IDENTITY pOrigin, TW_MEMREF pData) TW_UINT16 twRC = TWRC_SUCCESS; pTW_IDENTITY pSourceIdentity;/* = (pTW_IDENTITY) pData;*/ SANE_Status status; - + TRACE ("DG_CONTROL/DAT_IDENTITY/MSG_GETFIRST\n"); status = sane_get_devices (&device_list, SANE_FALSE); @@ -159,11 +159,11 @@ TW_UINT16 TWAIN_IdentityGetFirst (pTW_IDENTITY pOrigin, TW_MEMREF pData) } else { - WARN("sane_get_devices() failed: %s\n", sane_strstatus (status)); + WARN("sane_get_devices() failed: %s\n", sane_strstatus (status)); twRC = TWRC_FAILURE; DSM_twCC = TWCC_NODS; } - + return twRC; #endif } @@ -191,7 +191,7 @@ TW_UINT16 TWAIN_IdentityGetNext (pTW_IDENTITY pOrigin, TW_MEMREF pData) DSM_currentDevice ++; twRC = TWRC_SUCCESS; - DSM_twCC = TWCC_SUCCESS; + DSM_twCC = TWCC_SUCCESS; } else { @@ -279,7 +279,7 @@ TW_UINT16 TWAIN_OpenDS (pTW_IDENTITY pOrigin, TW_MEMREF pData) twRC = TWRC_FAILURE; DSM_twCC = TWCC_NODS; } - + return twRC; #endif } @@ -361,9 +361,9 @@ TW_UINT16 TWAIN_OpenDSM (pTW_IDENTITY pOrigin, TW_MEMREF pData) DSM_initialized = TRUE; status = sane_init (&version_code, NULL); device_list = NULL; - DSM_currentDevice = 0; + DSM_currentDevice = 0; DSM_sourceId = 0; - } + } DSM_parentHWND = *(HWND*)pData; DSM_currentState = 3; /* transition to state 3 */ DSM_twCC = TWCC_SUCCESS; diff --git a/dlls/twain/twain.h b/dlls/twain/twain.h index 1a76452c16f..d636a619544 100644 --- a/dlls/twain/twain.h +++ b/dlls/twain/twain.h @@ -3,42 +3,42 @@ Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak, Hewlett-Packard and Logitech Corporations. All rights reserved. - Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix, + Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix, Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and Ricoh Corporation. All rights reserved. - - Copyright © 1998 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Eastman Kodak Company, - Fujitsu Computer Products of America, Genoa Technology, - Hewlett-Packard Company, Intel Corporation, Kofax Image Products, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. + + Copyright © 1998 TWAIN Working Group: Adobe Systems Incorporated, + Canon Information Systems, Eastman Kodak Company, + Fujitsu Computer Products of America, Genoa Technology, + Hewlett-Packard Company, Intel Corporation, Kofax Image Products, + JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. All rights reserved. TWAIN.h - This is the definitive include file for applications and data sources written to the TWAIN specification. It defines constants, data structures, messages etc. for the public interface to TWAIN. - + Revision History: version 1.0, March 6, 1992. TWAIN 1.0. version 1.1, January 1993. Tech Notes 1.1 version 1.5, June 1993. Specification Update 1.5 - Change DC to TW + Change DC to TW Change filename from DC.H to TWAIN.H version 1.5, July 1993. Remove spaces from country identifiers - - version 1.7, July 1997 Added Capabilities and data structure for + + version 1.7, July 1997 Added Capabilities and data structure for document imaging and digital cameras. KHL. version 1.7, July 1997 Inserted Borland compatibile structure packing directives provided by Mentor. JMH - version 1.7, Aug 1997 Expanded file tabs to spaces. - NOTE: future authors should be sure to have - their editors set to automatically expand tabs + version 1.7, Aug 1997 Expanded file tabs to spaces. + NOTE: future authors should be sure to have + their editors set to automatically expand tabs to spaces (original tab setting was 4 spaces). version 1.7, Sept 1997 Added job control values Added return codes - version 1.7, Sept 1997 changed definition of pRGBRESPONSE to + version 1.7, Sept 1997 changed definition of pRGBRESPONSE to pTW_RGBRESPONSE version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values TWBCOR_ types JMH @@ -118,12 +118,12 @@ typedef char TW_STR255[256], FAR *pTW_STR255; /* Numeric types. */ typedef char TW_INT8, FAR *pTW_INT8; -typedef short TW_INT16, FAR *pTW_INT16; +typedef short TW_INT16, FAR *pTW_INT16; typedef long TW_INT32, FAR *pTW_INT32; typedef unsigned char TW_UINT8, FAR *pTW_UINT8; typedef unsigned short TW_UINT16, FAR *pTW_UINT16; typedef unsigned long TW_UINT32, FAR *pTW_UINT32; -typedef unsigned short TW_BOOL, FAR *pTW_BOOL; +typedef unsigned short TW_BOOL, FAR *pTW_BOOL; /* Fixed point structure type. */ typedef struct { @@ -413,9 +413,9 @@ typedef struct /* ----------------------------------------------------------------------- *\ - Version 1.7: Added Following data structure for Document Imaging + Version 1.7: Added Following data structure for Document Imaging July 1997 Enhancement. - KHL TW_CUSTOMDSDATA -- For Saving and Restoring Source's + KHL TW_CUSTOMDSDATA -- For Saving and Restoring Source's state. TW_INFO -- Each attribute for extended image information. @@ -787,7 +787,7 @@ typedef struct { #define TWJC_JSIS 2 #define TWJC_JSXC 3 #define TWJC_JSXS 4 - + /* Added 1.7 */ /* TWEI_BARCODEROTATION values (BCOR_ means barcode rotation) */ #define TWBCOR_ROT0 0 @@ -820,7 +820,7 @@ typedef struct { #define TWCB_NOCLEAR 2 /* CAP_DEVICEEVENT values (DE_ means device event) */ -#define TWDE_CUSTOMEVENTS 0x8000 +#define TWDE_CUSTOMEVENTS 0x8000 #define TWDE_CHECKAUTOMATICCAPTURE 0 #define TWDE_CHECKBATTERY 1 #define TWDE_CHECKDEVICEONLINE 2 @@ -1187,7 +1187,7 @@ typedef struct { #define TWLG_USA 13 /* U.S. English */ /* Added for 1.8 */ #define TWLG_USERLOCALE -1 -#define TWLG_AFRIKAANS 14 +#define TWLG_AFRIKAANS 14 #define TWLG_ALBANIA 15 #define TWLG_ARABIC 16 #define TWLG_ARABIC_ALGERIA 17 @@ -1431,7 +1431,7 @@ typedef struct { #define MSG_CHANGEDIRECTORY 0x0801 #define MSG_CREATEDIRECTORY 0x0802 #define MSG_DELETE 0x0803 -#define MSG_FORMATMEDIA 0x0804 +#define MSG_FORMATMEDIA 0x0804 #define MSG_GETCLOSE 0x0805 #define MSG_GETFIRSTFILE 0x0806 #define MSG_GETINFO 0x0807 @@ -1510,7 +1510,7 @@ typedef struct { #define CAP_BATTERYMINUTES 0x1032 /* Added 1.8 */ #define CAP_BATTERYPERCENTAGE 0x1033 /* Added 1.8 */ #define CAP_POWERDOWNTIME 0x1034 /* Added 1.8 */ - + /* image data sources MAY support these caps */ #define ICAP_AUTOBRIGHT 0x1100 #define ICAP_BRIGHTNESS 0x1101 @@ -1589,8 +1589,8 @@ typedef struct { /* ----------------------------------------------------------------------- *\ Version 1.7: Following is Extended Image Info Attributes. - July 1997 - KHL + July 1997 + KHL \* ----------------------------------------------------------------------- */ @@ -1708,7 +1708,7 @@ typedef struct { /* bit patterns: for query the operation that are supported by the data source on a capability */ /* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */ /* Added 1.6 */ -#define TWQC_GET 0x0001 +#define TWQC_GET 0x0001 #define TWQC_SET 0x0002 #define TWQC_GETDEFAULT 0x0004 #define TWQC_GETCURRENT 0x0008 @@ -1730,21 +1730,21 @@ typedef struct { * This could identify an application or a data source. * If this is NULL, the message goes to the Source Manager. * - * DG The Data Group. + * DG The Data Group. * Example: DG_IMAGE. * * DAT The Data Attribute Type. * Example: DAT_IMAGEMEMXFER. - * + * * MSG The message. Messages are interpreted by the destination module - * with respect to the Data Group and the Data Attribute Type. + * with respect to the Data Group and the Data Attribute Type. * Example: MSG_GET. * - * pData A pointer to the data structure or variable identified + * pData A pointer to the data structure or variable identified * by the Data Attribute Type. * Example: (TW_MEMREF)&ImageMemXfer * where ImageMemXfer is a TW_IMAGEMEMXFER structure. - * + * * Returns: * ReturnCode * Example: TWRC_SUCCESS. @@ -1793,21 +1793,21 @@ typedef TW_UINT16 (*DSMENTRYPROC)(pTW_IDENTITY, pTW_IDENTITY, * pOrigin Identifies the source module of the message. This could * identify an application or the Data Source Manager. * - * DG The Data Group. + * DG The Data Group. * Example: DG_IMAGE. - * + * * DAT The Data Attribute Type. * Example: DAT_IMAGEMEMXFER. - * + * * MSG The message. Messages are interpreted by the data source * with respect to the Data Group and the Data Attribute Type. * Example: MSG_GET. * - * pData A pointer to the data structure or variable identified + * pData A pointer to the data structure or variable identified * by the Data Attribute Type. * Example: (TW_MEMREF)&ImageMemXfer * where ImageMemXfer is a TW_IMAGEMEMXFER structure. - * + * * Returns: * ReturnCode * Example: TWRC_SUCCESS. @@ -1824,28 +1824,28 @@ extern "C" { #ifdef _MSWIN_ #ifdef _WIN32 __declspec(dllexport) TW_UINT16 FAR PASCAL DS_Entry (pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, + TW_UINT32 DG, + TW_UINT16 DAT, + TW_UINT16 MSG, TW_MEMREF pData); #else /* _WIN32 */ TW_UINT16 FAR PASCAL DS_Entry (pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, + TW_UINT32 DG, + TW_UINT16 DAT, + TW_UINT16 MSG, TW_MEMREF pData); #endif /* _WIN32 */ - + typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC) (pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, + TW_UINT32 DG, + TW_UINT16 DAT, + TW_UINT16 MSG, TW_MEMREF pData); #else /* _MSWIN_ */ -/*FAR PASCAL TW_UINT16 DS_Entry( pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, +/*FAR PASCAL TW_UINT16 DS_Entry( pTW_IDENTITY pOrigin, + TW_UINT32 DG, + TW_UINT16 DAT, + TW_UINT16 MSG, TW_MEMREF pData);*/ typedef TW_UINT16 (*DSENTRYPROC)(pTW_IDENTITY, diff --git a/dlls/twain/twain32_main.c b/dlls/twain/twain32_main.c index 451c03ae287..f38f314fbb5 100644 --- a/dlls/twain/twain32_main.c +++ b/dlls/twain/twain32_main.c @@ -1,6 +1,6 @@ /* * TWAIN32 functions - * + * * Copyright 2000 Shi Quan He * * This library is free software; you can redistribute it and/or @@ -113,7 +113,7 @@ TW_UINT16 TWAIN_SourceManagerHandler ( twRC = TWRC_FAILURE; DSM_twCC = TWCC_BADPROTOCOL; WARN("unrecognized operation triplet\n"); - } + } break; case DAT_STATUS: @@ -527,7 +527,7 @@ TW_UINT16 TWAIN_ImageGroupHandler ( break; case MSG_SET: twRC = TWAIN_Palette8Set (pOrigin, pDest, pData); - break; + break; default: twRC = TWRC_FAILURE; DSM_twCC = TWCC_BADPROTOCOL; @@ -591,7 +591,7 @@ TW_UINT16 TWAIN_AudioGroupHandler ( twRC = TWRC_FAILURE; break; } - + return twRC; } @@ -607,7 +607,7 @@ DSM_Entry (pTW_IDENTITY pOrigin, TW_UINT16 twRC = TWRC_SUCCESS; /* Return Code */ TRACE("(DG=%ld DAT=%d MSG=%d)\n", DG, DAT, MSG); - + switch (DG) { case DG_CONTROL: @@ -627,7 +627,7 @@ DSM_Entry (pTW_IDENTITY pOrigin, return twRC; } -/* A helper function that looks up a destination identity in the active +/* A helper function that looks up a destination identity in the active source list */ activeDS *TWAIN_LookupSource (pTW_IDENTITY pDest) { diff --git a/dlls/twain/twain_i.h b/dlls/twain/twain_i.h index 266a970adb3..01b775e1768 100644 --- a/dlls/twain/twain_i.h +++ b/dlls/twain/twain_i.h @@ -31,7 +31,7 @@ typedef struct tagActiveDS struct tagActiveDS *next; /* next active DS */ TW_IDENTITY identity; /* identity */ TW_UINT16 currentState; /* current state */ - TW_EVENT pendingEvent; /* pending event to be sent to + TW_EVENT pendingEvent; /* pending event to be sent to application */ TW_UINT16 twCC; /* condition code */ HWND hwndOwner; /* window handle of the app */ @@ -42,7 +42,7 @@ typedef struct tagActiveDS #endif /* Capabiblities */ TW_UINT16 capXferMech; /* ICAP_XFERMECH */ -} activeDS; +} activeDS; TW_UINT16 DSM_initialized; /* whether Source Manager is initialized */ TW_UINT16 DSM_currentState; /* current state of Source Manager */ @@ -176,7 +176,7 @@ TW_UINT16 TWAIN_XferGroupGet TW_UINT16 TWAIN_XferGroupSet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, TW_MEMREF pData); -/* Implementation of operation triplets +/* Implementation of operation triplets * From Application to Source (Image Information) */ TW_UINT16 TWAIN_CIEColorGet (pTW_IDENTITY pOrigin, pTW_IDENTITY pDest, TW_MEMREF pData); diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index 3eb20fcce02..b31a76f589b 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -54,7 +54,7 @@ HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options, * * RETURNS * S_OK success - * E_OUTOFMEMORY out of memory + * E_OUTOFMEMORY out of memory * MK_E_SYNTAX not a valid url * */ @@ -76,7 +76,7 @@ HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker ** * RETURNS * S_OK success * E_INVALIDARG invalid argument(s) - * E_OUTOFMEMORY out of memory + * E_OUTOFMEMORY out of memory * */ HRESULT WINAPI RegisterBindStatusCallback( @@ -100,7 +100,7 @@ HRESULT WINAPI RegisterBindStatusCallback( else IBindStatusCallback_Release(prev); } - + return IBindCtx_RegisterObjectParam(pbc, BSCBHolder, (IUnknown *)pbsc); } diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c index b58a2296b3f..18dc0568865 100644 --- a/dlls/urlmon/urlmon_main.c +++ b/dlls/urlmon/urlmon_main.c @@ -31,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(win32); */ HRESULT WINAPI URLMON_DllInstall(BOOL bInstall, LPCWSTR cmdline) { - FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE", + FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE", debugstr_w(cmdline)); return S_OK; @@ -53,7 +53,7 @@ HRESULT WINAPI URLMON_DllCanUnloadNow(void) HRESULT WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { - FIXME("(%p, %p, %p): stub\n", debugstr_guid(rclsid), + FIXME("(%p, %p, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); return CLASS_E_CLASSNOTAVAILABLE; @@ -96,7 +96,7 @@ HRESULT WINAPI URLMON_DllUnregisterServer(void) long nosee) { FIXME("(%#lx, %p, %#lx, %#lx): stub\n", lost, splat, time, nosee); - + return S_OK; } diff --git a/dlls/user/cache.c b/dlls/user/cache.c index ecaf6288bcf..774c816bc83 100644 --- a/dlls/user/cache.c +++ b/dlls/user/cache.c @@ -1,7 +1,7 @@ /* - * Wine internally cached objects to speedup some things and prevent - * infinite duplication of trivial code and data. - * + * Wine internally cached objects to speedup some things and prevent + * infinite duplication of trivial code and data. + * * Copyright 1997 Bertho A. Stultiens * * This library is free software; you can redistribute it and/or @@ -24,7 +24,7 @@ #include "user.h" static const WORD wPattern55AA[] = -{ +{ 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa }; diff --git a/dlls/user/comm16.c b/dlls/user/comm16.c index e306aee439c..c789c3a6837 100644 --- a/dlls/user/comm16.c +++ b/dlls/user/comm16.c @@ -47,7 +47,7 @@ * A program that wants to monitor the modem status line (RLSD/DCD) may * poll the modem status register in the commMask structure. I update the bit * in GetCommError, waiting for an implementation of communication events. - * + * */ #include "config.h" @@ -150,7 +150,7 @@ void COMM_Init(void) RegCloseKey(hkey); } - if (!strcmp(temp, "*") || *temp == '\0') + if (!strcmp(temp, "*") || *temp == '\0') COM[x].devicename = NULL; else { btemp = strchr(temp,','); @@ -160,7 +160,7 @@ void COMM_Init(void) } else { COM[x].baudrate = -1; } - if ((COM[x].devicename = malloc(strlen(temp)+1)) == NULL) + if ((COM[x].devicename = malloc(strlen(temp)+1)) == NULL) WARN("Can't malloc for device info!\n"); else { COM[x].handle = 0; @@ -187,7 +187,7 @@ void COMM_Init(void) if (!strcmp(temp, "*") || *temp == '\0') LPT[x].devicename = NULL; else { - if ((LPT[x].devicename = malloc(strlen(temp)+1)) == NULL) + if ((LPT[x].devicename = malloc(strlen(temp)+1)) == NULL) WARN("Can't malloc for device info!\n"); else { LPT[x].handle = 0; @@ -219,23 +219,23 @@ static struct DosDeviceStruct *GetDeviceStruct(int index) static int GetCommPort_ov(LPOVERLAPPED ov, int write) { int x; - + for (x=0; xobuf_tail <= ptr->obuf_head) ? + bleft = ((ptr->obuf_tail <= ptr->obuf_head) ? ptr->obuf_head : ptr->obuf_size) - ptr->obuf_tail; /* check for notification */ @@ -410,7 +410,7 @@ static void comm_waitread(struct DosDeviceStruct *ptr) COMSTAT stat; /* FIXME: get timeouts working properly so we can read bleft bytes */ - bleft = ((ptr->ibuf_tail > ptr->ibuf_head) ? + bleft = ((ptr->ibuf_tail > ptr->ibuf_head) ? (ptr->ibuf_tail-1) : ptr->ibuf_size) - ptr->ibuf_head; /* find out how many bytes are left in the buffer */ @@ -434,7 +434,7 @@ static void comm_waitwrite(struct DosDeviceStruct *ptr) { int bleft; - bleft = ((ptr->obuf_tail <= ptr->obuf_head) ? + bleft = ((ptr->obuf_tail <= ptr->obuf_head) ? ptr->obuf_head : ptr->obuf_size) - ptr->obuf_tail; WriteFileEx(ptr->handle, ptr->outbuf + ptr->obuf_tail, @@ -462,7 +462,7 @@ INT16 COMM16_DCBtoDCB16(LPDCB lpdcb, LPDCB16 lpdcb16) lpdcb16->StopBits = lpdcb->StopBits; lpdcb16->RlsTimeout = 50; - lpdcb16->CtsTimeout = 50; + lpdcb16->CtsTimeout = 50; lpdcb16->DsrTimeout = 50; lpdcb16->fNull = 0; lpdcb16->fChEvt = 0; @@ -478,8 +478,8 @@ INT16 COMM16_DCBtoDCB16(LPDCB lpdcb, LPDCB16 lpdcb16) lpdcb16->fOutX = lpdcb->fOutX; /* - lpdcb16->XonChar = - lpdcb16->XoffChar = + lpdcb16->XonChar = + lpdcb16->XoffChar = */ lpdcb16->XonLim = 10; lpdcb16->XoffLim = 10; @@ -491,8 +491,8 @@ INT16 COMM16_DCBtoDCB16(LPDCB lpdcb, LPDCB16 lpdcb16) /************************************************************************** * BuildCommDCB (USER.213) * - * According to the ECMA-234 (368.3) the function will return FALSE on - * success, otherwise it will return -1. + * According to the ECMA-234 (368.3) the function will return FALSE on + * success, otherwise it will return -1. */ INT16 WINAPI BuildCommDCB16(LPCSTR device, LPDCB16 lpdcb) { @@ -516,7 +516,7 @@ INT16 WINAPI BuildCommDCB16(LPCSTR device, LPDCB16 lpdcb) FIXME("invalid COM port %d?\n",port); return -1; } - + memset(lpdcb, 0, sizeof(DCB16)); /* initialize */ lpdcb->Id = port; @@ -550,7 +550,7 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue) ERR("BUG ! COM0 or LPT0 don't exist !\n"); if (!strncasecmp(device,"COM",3)) { - + TRACE("%s = %s\n", device, COM[port].devicename); if (!ValidCOMPort(port)) @@ -560,7 +560,7 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue) return IE_OPEN; handle = CreateFileA(device, GENERIC_READ|GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_FLAG_OVERLAPPED|FILE_FLAG_NO_BUFFERING, 0 ); if (handle == INVALID_HANDLE_VALUE) { ERR("Couldn't open %s ! (%s)\n", COM[port].devicename, strerror(errno)); @@ -615,10 +615,10 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue) return port; } - } - else + } + else if (!strncasecmp(device,"LPT",3)) { - + if (!ValidLPTPort(port)) return IE_BADID; @@ -645,7 +645,7 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue) INT16 WINAPI CloseComm16(INT16 cid) { struct DosDeviceStruct *ptr; - + TRACE("cid=%d\n", cid); if ((ptr = GetDeviceStruct(cid)) == NULL) { FIXME("no cid=%d found!\n", cid); @@ -723,19 +723,19 @@ LONG WINAPI EscapeCommFunction16(UINT16 cid,UINT16 nFunction) switch(nFunction) { case GETMAXCOM: - TRACE("GETMAXCOM\n"); + TRACE("GETMAXCOM\n"); for (max = MAX_PORTS;!COM[max].devicename;max--) ; return max; case GETMAXLPT: - TRACE("GETMAXLPT\n"); + TRACE("GETMAXLPT\n"); for (max = MAX_PORTS;!LPT[max].devicename;max--) ; return FLAG_LPT + max; case GETBASEIRQ: - TRACE("GETBASEIRQ\n"); + TRACE("GETBASEIRQ\n"); /* FIXME: use tables */ /* just fake something for now */ if (cid & FLAG_LPT) { @@ -771,7 +771,7 @@ LONG WINAPI EscapeCommFunction16(UINT16 cid,UINT16 nFunction) case CLRBREAK: case SETBREAK: default: - WARN("(cid=%d,nFunction=%d): Unknown function\n", + WARN("(cid=%d,nFunction=%d): Unknown function\n", cid, nFunction); } return -1; @@ -800,19 +800,19 @@ INT16 WINAPI FlushComm16(INT16 cid,INT16 fnQueue) ptr->ibuf_head = ptr->ibuf_tail; break; default: - WARN("(cid=%d,fnQueue=%d):Unknown queue\n", + WARN("(cid=%d,fnQueue=%d):Unknown queue\n", cid, fnQueue); return -1; } if (!PurgeComm(ptr->handle,queue)) { ptr->commerror = WinError(); - return -1; + return -1; } else { ptr->commerror = 0; return 0; } -} +} /******************************************************************** * GetCommError (USER.203) @@ -843,7 +843,7 @@ INT16 WINAPI GetCommError16(INT16 cid,LPCOMSTAT16 lpStat) lpStat->cbInQue = comm_inbuf(ptr); TRACE("cid %d, error %d, stat %d in %d out %d, stol %x\n", - cid, ptr->commerror, lpStat->status, lpStat->cbInQue, + cid, ptr->commerror, lpStat->status, lpStat->cbInQue, lpStat->cbOutQue, *stol); } else @@ -955,7 +955,7 @@ INT16 WINAPI SetCommState16(LPDCB16 lpdcb) else dcb.BaudRate = lpdcb->BaudRate; } - + dcb.ByteSize=lpdcb->ByteSize; dcb.StopBits=lpdcb->StopBits; @@ -967,16 +967,16 @@ INT16 WINAPI SetCommState16(LPDCB16 lpdcb) if (lpdcb->fDtrflow || lpdcb->fRtsflow) dcb.fRtsControl = TRUE; - if (lpdcb->fDtrDisable) + if (lpdcb->fDtrDisable) dcb.fDtrControl = TRUE; ptr->evtchar = lpdcb->EvtChar; dcb.fInX = lpdcb->fInX; dcb.fOutX = lpdcb->fOutX; - + if (!SetCommState(ptr->handle,&dcb)) { - ptr->commerror = WinError(); + ptr->commerror = WinError(); return -1; } else { ptr->commerror = 0; @@ -998,7 +998,7 @@ INT16 WINAPI GetCommState16(INT16 cid, LPDCB16 lpdcb) return -1; } if (!GetCommState(ptr->handle,&dcb)) { - ptr->commerror = WinError(); + ptr->commerror = WinError(); return -1; } @@ -1028,7 +1028,7 @@ INT16 WINAPI TransmitCommChar16(INT16 cid,CHAR chTransmit) if (ptr->suspended) { ptr->commerror = IE_HARDWARE; return -1; - } + } if (ptr->xmit >= 0) { /* character already queued */ @@ -1071,7 +1071,7 @@ INT16 WINAPI UngetCommChar16(INT16 cid,CHAR chUnget) if (ptr->suspended) { ptr->commerror = IE_HARDWARE; return -1; - } + } if (ptr->unget>=0) { /* character already queued */ @@ -1104,7 +1104,7 @@ INT16 WINAPI ReadComm16(INT16 cid,LPSTR lpvBuf,INT16 cbRead) if (ptr->suspended) { ptr->commerror = IE_HARDWARE; return -1; - } + } if(0==comm_inbuf(ptr)) WaitForMultipleObjectsEx(0,NULL,FALSE,1,TRUE); @@ -1147,7 +1147,7 @@ INT16 WINAPI WriteComm16(INT16 cid, LPSTR lpvBuf, INT16 cbWrite) int status, length; struct DosDeviceStruct *ptr; - TRACE("cid %d, ptr %p, length %d\n", + TRACE("cid %d, ptr %p, length %d\n", cid, lpvBuf, cbWrite); if ((ptr = GetDeviceStruct(cid)) == NULL) { FIXME("no handle for cid = %0x!\n",cid); @@ -1157,8 +1157,8 @@ INT16 WINAPI WriteComm16(INT16 cid, LPSTR lpvBuf, INT16 cbWrite) if (ptr->suspended) { ptr->commerror = IE_HARDWARE; return -1; - } - + } + TRACE("%s\n", debugstr_an( lpvBuf, cbWrite )); length = 0; @@ -1187,7 +1187,7 @@ INT16 WINAPI WriteComm16(INT16 cid, LPSTR lpvBuf, INT16 cbWrite) comm_waitwrite(ptr); } - ptr->commerror = 0; + ptr->commerror = 0; return length; } diff --git a/dlls/user/dde/client.c b/dlls/user/dde/client.c index 077b2b9387d..26db1721708 100644 --- a/dlls/user/dde/client.c +++ b/dlls/user/dde/client.c @@ -100,7 +100,7 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, WDML_INSTANCE* pInstance; WDML_CONV* pConv = NULL; ATOM aSrv = 0, aTpc = 0; - + TRACE("(0x%lx,0x%x,0x%x,%p)\n", idInst, hszService, hszTopic, pCC); EnterCriticalSection(&WDML_CritSect); @@ -110,7 +110,7 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, { goto theEnd; } - + /* make sure this conv is never created */ pConv = WDML_FindConv(pInstance, WDML_CLIENT_SIDE, hszService, hszTopic); if (pConv != NULL) @@ -118,10 +118,10 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, ERR("This Conv already exists: (0x%lx)\n", (DWORD)pConv); goto theEnd; } - + /* we need to establish a conversation with server, so create a window for it */ - + if (pInstance->unicode) { WNDCLASSEXW wndclass; @@ -138,9 +138,9 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, wndclass.lpszMenuName = NULL; wndclass.lpszClassName = WDML_szClientConvClassW; wndclass.hIconSm = 0; - + RegisterClassExW(&wndclass); - + hwndClient = CreateWindowW(WDML_szClientConvClassW, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0); } else @@ -159,14 +159,14 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, wndclass.lpszMenuName = NULL; wndclass.lpszClassName = WDML_szClientConvClassA; wndclass.hIconSm = 0; - + RegisterClassExA(&wndclass); - + hwndClient = CreateWindowA(WDML_szClientConvClassA, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0); } SetWindowLongA(hwndClient, GWL_WDML_INSTANCE, (DWORD)pInstance); - + if (hszService) { aSrv = WDML_MakeAtomFromHsz(hszService); @@ -182,7 +182,7 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, /* note: sent messages shall not use packing */ SendMessageA(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndClient, MAKELPARAM(aSrv, aTpc)); - + EnterCriticalSection(&WDML_CritSect); pInstance = WDML_GetInstance(idInst); @@ -190,7 +190,7 @@ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, { goto theEnd; } - + /* At this point, Client WM_DDE_ACK should have saved hwndServer for this instance id and hwndClient if server responds. So get HCONV and return it. And add it to conv list */ @@ -242,7 +242,7 @@ HCONV WINAPI DdeReconnect(HCONV hConv) /* to reestablist a connection, we have to make sure that: * 1/ pConv is the converstation attached to the client window (it wouldn't be - * if a call to DdeReconnect would have already been done...) + * if a call to DdeReconnect would have already been done...) * FIXME: is this really an error ??? * 2/ the pConv conversation had really been deconnected */ @@ -262,9 +262,9 @@ HCONV WINAPI DdeReconnect(HCONV hConv) LeaveCriticalSection(&WDML_CritSect); /* note: sent messages shall not use packing */ - ret = SendMessageA(hwndServer, WM_DDE_INITIATE, (WPARAM)hwndClient, + ret = SendMessageA(hwndServer, WM_DDE_INITIATE, (WPARAM)hwndClient, MAKELPARAM(aSrv, aTpc)); - + EnterCriticalSection(&WDML_CritSect); pConv = WDML_GetConv(hConv, FALSE); @@ -284,7 +284,7 @@ HCONV WINAPI DdeReconnect(HCONV hConv) if (pLink->hConv == hConv) { /* try to reestablish the links... */ - DdeClientTransaction(NULL, 0, (HCONV)pNewConv, pLink->hszItem, pLink->uFmt, + DdeClientTransaction(NULL, 0, (HCONV)pNewConv, pLink->hszItem, pLink->uFmt, pLink->transactionType, 1000, NULL); } } @@ -320,7 +320,7 @@ static WDML_XACT* WDML_ClientQueueAdvise(WDML_CONV* pConv, UINT wType, UINT wFmt atom = WDML_MakeAtomFromHsz(hszItem); if (!atom) return NULL; - + pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_ADVISE, wFmt, hszItem); if (!pXAct) { @@ -370,22 +370,22 @@ static WDML_QUEUE_STATE WDML_HandleAdviseReply(WDML_CONV* pConv, MSG* msg, WDML_ FreeDDElParam(WM_DDE_ACK, msg->lParam); WDML_ExtractAck(uiLo, &ddeAck); - + if (ddeAck.fAck) { WDML_LINK* pLink; - + /* billx: first to see if the link is already created. */ - pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, + pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, pXAct->hszItem, TRUE, pXAct->wFmt); - if (pLink != NULL) - { + if (pLink != NULL) + { /* we found a link, and only need to modify it in case it changes */ pLink->transactionType = pXAct->wType; } else { - WDML_AddLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, + WDML_AddLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, pXAct->wType, pXAct->hszItem, pXAct->wFmt); } pXAct->hDdeData = (HDDEDATA)1; @@ -409,7 +409,7 @@ static WDML_XACT* WDML_ClientQueueUnadvise(WDML_CONV* pConv, UINT wFmt, HSZ hszI { WDML_XACT* pXAct; ATOM atom; - + TRACE("XTYP_ADVSTOP transaction\n"); atom = WDML_MakeAtomFromHsz(hszItem); @@ -423,12 +423,12 @@ static WDML_XACT* WDML_ClientQueueUnadvise(WDML_CONV* pConv, UINT wFmt, HSZ hszI } /* end advise loop: post WM_DDE_UNADVISE to server to terminate link - * on the specified item. + * on the specified item. */ pXAct->lParam = PackDDElParam(WM_DDE_UNADVISE, wFmt, atom); return pXAct; } - + /****************************************************************** * WDML_HandleUnadviseReply * @@ -455,9 +455,9 @@ static WDML_QUEUE_STATE WDML_HandleUnadviseReply(WDML_CONV* pConv, MSG* msg, WDM GlobalDeleteAtom(uiHi); WDML_ExtractAck(uiLo, &ddeAck); - + TRACE("WM_DDE_ACK received while waiting for a timeout\n"); - + if (!ddeAck.fAck) { TRACE("Returning FALSE on XTYP_ADVSTOP - fAck was FALSE\n"); @@ -466,7 +466,7 @@ static WDML_QUEUE_STATE WDML_HandleUnadviseReply(WDML_CONV* pConv, MSG* msg, WDM else { /* billx: remove the link */ - WDML_RemoveLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, + WDML_RemoveLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, pXAct->hszItem, pXAct->wFmt); pXAct->hDdeData = (HDDEDATA)1; } @@ -559,7 +559,7 @@ static WDML_QUEUE_STATE WDML_HandleRequestReply(WDML_CONV* pConv, MSG* msg, WDML } return WDML_QS_HANDLED; -} +} /****************************************************************** * WDML_BuildExecuteCommand @@ -597,7 +597,7 @@ static HGLOBAL WDML_BuildExecuteCommand(WDML_CONV* pConv, LPCVOID pData, DWORD c if (hMem) { LPBYTE pDst; - + pDst = GlobalLock(hMem); if (pDst) { @@ -638,7 +638,7 @@ static WDML_XACT* WDML_ClientQueueExecute(WDML_CONV* pConv, LPCVOID pData, DWORD WDML_XACT* pXAct; TRACE("XTYP_EXECUTE transaction\n"); - + pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_EXECUTE, 0, 0); if (!pXAct) return NULL; @@ -646,7 +646,7 @@ static WDML_XACT* WDML_ClientQueueExecute(WDML_CONV* pConv, LPCVOID pData, DWORD if (cbData == (DWORD)-1) { HDDEDATA hDdeData = (HDDEDATA)pData; - + pData = DdeAccessData(hDdeData, &cbData); if (pData) { @@ -698,17 +698,17 @@ static WDML_QUEUE_STATE WDML_HandleExecuteReply(WDML_CONV* pConv, MSG* msg, WDML * * */ -static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPCVOID pData, DWORD cbData, +static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPCVOID pData, DWORD cbData, UINT wFmt, HSZ hszItem) { WDML_XACT* pXAct; ATOM atom; TRACE("XTYP_POKE transaction\n"); - + atom = WDML_MakeAtomFromHsz(hszItem); if (!atom) return NULL; - + pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_POKE, wFmt, hszItem); if (!pXAct) { @@ -726,7 +726,7 @@ static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPCVOID pData, DWORD cb pXAct->hMem = GlobalAlloc(GHND | GMEM_DDESHARE, sizeof(DDEPOKE) + cbData); ddePoke = GlobalLock(pXAct->hMem); - if (ddePoke) + if (ddePoke) { memcpy(ddePoke->Value, pData, cbData); ddePoke->fRelease = FALSE; /* FIXME: app owned ? */ @@ -811,7 +811,7 @@ static WDML_QUEUE_STATE WDML_HandleTerminateReply(WDML_CONV* pConv, MSG* msg, WD } if (!pConv->instance->CBFflags & CBF_SKIP_DISCONNECTS) { - WDML_InvokeCallback(pConv->instance, XTYP_DISCONNECT, 0, (HCONV)pConv, + WDML_InvokeCallback(pConv->instance, XTYP_DISCONNECT, 0, (HCONV)pConv, 0, 0, 0, 0, (pConv->wStatus & ST_ISSELF) ? 1 : 0); } WDML_RemoveConv(pConv, WDML_CLIENT_SIDE); @@ -834,25 +834,25 @@ static WDML_QUEUE_STATE WDML_HandleIncomingData(WDML_CONV* pConv, MSG* msg, HDDE TRACE("WM_DDE_DATA message received in the Client Proc!\n"); /* wParam -- sending window handle */ /* lParam -- hDdeData & item HSZ */ - + UnpackDDElParam(WM_DDE_DATA, msg->lParam, &uiLo, &uiHi); hsz = WDML_MakeHszFromAtom(pConv->instance, uiHi); hDdeDataIn = WDML_Global2DataHandle((HGLOBAL)uiLo, &wdh); - /* billx: + /* billx: * For hot link, data should be passed to its callback with * XTYP_ADVDATA and callback should return the proper status. */ - pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, hsz, + pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_CLIENT_SIDE, hsz, uiLo ? TRUE : FALSE, wdh.cfFormat); - if (!pLink) + if (!pLink) { WDML_DecHSZ(pConv->instance, hsz); DdeFreeDataHandle(hDdeDataIn); return WDML_QS_PASS; } - + if (hDdeDataIn != 0 && wdh.fAckReq) { WDML_PostAck(pConv, WDML_CLIENT_SIDE, 0, FALSE, TRUE, uiHi, msg->lParam, WM_DDE_DATA); @@ -863,11 +863,11 @@ static WDML_QUEUE_STATE WDML_HandleIncomingData(WDML_CONV* pConv, MSG* msg, HDDE { GlobalDeleteAtom(uiHi); } - - hDdeDataOut = WDML_InvokeCallback(pConv->instance, XTYP_ADVDATA, pLink->uFmt, pLink->hConv, + + hDdeDataOut = WDML_InvokeCallback(pConv->instance, XTYP_ADVDATA, pLink->uFmt, pLink->hConv, pConv->hszTopic, pLink->hszItem, hDdeDataIn, 0, 0); - if (hDdeDataOut != (HDDEDATA)DDE_FACK || wdh.fRelease) + if (hDdeDataOut != (HDDEDATA)DDE_FACK || wdh.fRelease) { if (uiLo) { @@ -876,11 +876,11 @@ static WDML_QUEUE_STATE WDML_HandleIncomingData(WDML_CONV* pConv, MSG* msg, HDDE } DdeFreeDataHandle(hDdeDataIn); - + WDML_DecHSZ(pConv->instance, hsz); if (msg->lParam) FreeDDElParam(WM_DDE_DATA, msg->lParam); - + return WDML_QS_HANDLED; } @@ -893,11 +893,11 @@ static WDML_QUEUE_STATE WDML_HandleIncomingTerminate(WDML_CONV* pConv, MSG* msg, { if (pConv->hwndServer != WIN_GetFullHandle(msg->wParam)) return WDML_QS_PASS; - + pConv->wStatus |= ST_TERMINATED; if (!pConv->instance->CBFflags & CBF_SKIP_DISCONNECTS) { - WDML_InvokeCallback(pConv->instance, XTYP_DISCONNECT, 0, (HCONV)pConv, + WDML_InvokeCallback(pConv->instance, XTYP_DISCONNECT, 0, (HCONV)pConv, 0, 0, 0, 0, (pConv->wStatus & ST_ISSELF) ? 1 : 0); } if (pConv->wStatus & ST_CONNECTED) @@ -920,7 +920,7 @@ static WDML_QUEUE_STATE WDML_HandleReply(WDML_CONV* pConv, MSG* msg, HDDEDATA* h WDML_XACT* pXAct = pConv->transactions; WDML_QUEUE_STATE qs; - if (pConv->transactions) + if (pConv->transactions) { /* first check message against a pending transaction, if any */ switch (pXAct->ddeMsg) @@ -954,7 +954,7 @@ static WDML_QUEUE_STATE WDML_HandleReply(WDML_CONV* pConv, MSG* msg, HDDEDATA* h } /* now check the results */ - switch (qs) + switch (qs) { case WDML_QS_ERROR: case WDML_QS_SWALLOWED: @@ -971,7 +971,7 @@ static WDML_QUEUE_STATE WDML_HandleReply(WDML_CONV* pConv, MSG* msg, HDDEDATA* h (HCONV)pConv, pConv->hszTopic, pXAct->hszItem, pXAct->hDdeData, MAKELONG(0, pXAct->xActID), 0 /* FIXME */); qs = WDML_QS_PASS; - } + } else { *hdd = pXAct->hDdeData; @@ -1014,20 +1014,20 @@ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, WDML /* FIXME: time 32 bit wrap around */ dwTimeout += GetCurrentTime(); - + while ((dwTime = GetCurrentTime()) < dwTimeout) { /* we cannot be in the crit sect all the time because when client and server run in a * single process they need to share the access to the internal data */ - if (MsgWaitForMultipleObjects(0, NULL, FALSE, + if (MsgWaitForMultipleObjects(0, NULL, FALSE, dwTimeout - dwTime, QS_POSTMESSAGE) == WAIT_OBJECT_0) { BOOL ret = FALSE; MSG msg; WDML_CONV* pConv; HDDEDATA hdd; - + EnterCriticalSection(&WDML_CritSect); pConv = WDML_GetConv(hConv, FALSE); @@ -1041,7 +1041,7 @@ static HDDEDATA WDML_SyncWaitTransactionReply(HCONV hConv, DWORD dwTimeout, WDML { /* check that either pXAct has been processed or no more xActions are pending */ ret = (pConv->transactions == pXAct); - ret = WDML_HandleReply(pConv, &msg, &hdd) == WDML_QS_HANDLED && + ret = WDML_HandleReply(pConv, &msg, &hdd) == WDML_QS_HANDLED && (pConv->transactions == NULL || ret); if (ret) break; } @@ -1089,16 +1089,16 @@ HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HS WDML_CONV* pConv; WDML_XACT* pXAct; HDDEDATA hDdeData = 0; - + TRACE("(%p,%ld,0x%lx,0x%x,%d,%d,%ld,%p)\n", pData, cbData, (DWORD)hConv, hszItem, wFmt, wType, dwTimeout, pdwResult); - + if (hConv == 0) { ERR("Invalid conversation handle\n"); return 0; } - + EnterCriticalSection(&WDML_CritSect); pConv = WDML_GetConv(hConv, TRUE); @@ -1165,7 +1165,7 @@ HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HS if (!PostMessageA(pConv->hwndServer, pXAct->ddeMsg, (WPARAM)pConv->hwndClient, pXAct->lParam)) { - TRACE("Failed posting message %d to 0x%04x (error=0x%lx)\n", + TRACE("Failed posting message %d to 0x%04x (error=0x%lx)\n", pXAct->ddeMsg, pConv->hwndServer, GetLastError()); pConv->wStatus &= ~ST_CONNECTED; WDML_UnQueueTransaction(pConv, pXAct); @@ -1174,7 +1174,7 @@ HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HS } pXAct->dwTimeout = dwTimeout; /* FIXME: should set the app bits on *pdwResult */ - + if (dwTimeout == TIMEOUT_ASYNC) { if (pdwResult) @@ -1226,7 +1226,7 @@ BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction { for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) { - if (pXAct->dwTimeout == TIMEOUT_ASYNC && + if (pXAct->dwTimeout == TIMEOUT_ASYNC && (idTransaction == 0 || pXAct->xActID == idTransaction)) { WDML_UnQueueTransaction(pConv, pXAct); @@ -1301,9 +1301,9 @@ static LRESULT CALLBACK WDML_ClientProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPA pConv->wConvst = XST_INIT1; /* check if server is handled by DDEML */ - if ((GetClassNameA((HWND)wParam, buf, sizeof(buf)) && + if ((GetClassNameA((HWND)wParam, buf, sizeof(buf)) && strcmp(buf, WDML_szServerConvClassA) == 0) || - (GetClassNameW((HWND)wParam, (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR)) && + (GetClassNameW((HWND)wParam, (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR)) && lstrcmpW((LPWSTR)buf, WDML_szServerConvClassW) == 0)) { pConv->wStatus |= ST_ISLOCAL; @@ -1324,7 +1324,7 @@ static LRESULT CALLBACK WDML_ClientProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPA pConv = WDML_GetConvFromWnd(hwnd); - if (pConv) + if (pConv) { MSG msg; HDDEDATA hdd; @@ -1340,8 +1340,8 @@ static LRESULT CALLBACK WDML_ClientProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPA LeaveCriticalSection(&WDML_CritSect); return 0; } - - return (IsWindowUnicode(hwnd)) ? + + return (IsWindowUnicode(hwnd)) ? DefWindowProcA(hwnd, iMsg, wParam, lParam) : DefWindowProcW(hwnd, iMsg, wParam, lParam); } @@ -1356,13 +1356,13 @@ BOOL WINAPI DdeDisconnect(HCONV hConv) BOOL ret = FALSE; TRACE("(%ld)\n", (DWORD)hConv); - + if (hConv == 0) { ERR("DdeDisconnect(): hConv = 0\n"); return FALSE; } - + EnterCriticalSection(&WDML_CritSect); pConv = WDML_GetConv(hConv, TRUE); if (pConv != NULL) @@ -1404,7 +1404,7 @@ BOOL WINAPI DdeImpersonateClient(HCONV hConv) { WDML_CONV* pConv; BOOL ret = FALSE; - + EnterCriticalSection(&WDML_CritSect); pConv = WDML_GetConv(hConv, TRUE); if (pConv) diff --git a/dlls/user/dde/dde_private.h b/dlls/user/dde/dde_private.h index c09d62977e8..bad30368f12 100644 --- a/dlls/user/dde/dde_private.h +++ b/dlls/user/dde/dde_private.h @@ -38,7 +38,7 @@ /* The internal structures (prefixed by WDML) are used as follows: * + a WDML_INSTANCE is created for each instance creation (DdeInitialize) * - a popup window (InstanceClass) is created for each instance. - * - this window is used to receive all the DDEML events (server registration, + * - this window is used to receive all the DDEML events (server registration, * conversation confirmation...). See the WM_WDML_???? messages for details * + when registring a server (DdeNameService) a WDML_SERVER is created * - a popup window (ServerNameClass) is created @@ -53,7 +53,7 @@ * - all the exchanges then take place between those two windows * - windows for the conversation exist in two forms (Ansi & Unicode). This * is only needed when a partner in a conv is not handled by DDEML. The - * type (A/W) of the window is used to handle the ansi <=> unicode + * type (A/W) of the window is used to handle the ansi <=> unicode * transformations * - two handles are created for a conversation (on each side). Each handle * is linked to a structure. To help differentiate those handles, the @@ -61,7 +61,7 @@ * + a (warm or link) is represented by two WDML_LINK structures: * - one on client side, the other one on server side * - therefore, two lists of links are kept for each instance - * + * * To help getting back to data, WDML windows store information: * - offset 0: the DDE instance * - offset 4: the current conversation (for ClientConv and ServerConv only) @@ -69,12 +69,12 @@ * All the implementation (client & server) makes the assumption that the other side * is not always a DDEML partner. However, if it's the case, supplementary services * are available (most notably the REGISTER/UNREGISTER and CONNECT_CONFIRM messages - * to the callback function). To be correct in every situation, all the basic + * to the callback function). To be correct in every situation, all the basic * exchanges are made using the 'pure' DDE protocol. A (future !) enhancement would * be to provide a new protocol in the case were both partners are handled by DDEML. * * The StringHandles are in fact stored as local atoms. So an HSZ and a (local) atom - * can be used interchangably. However, in order to keep track of the allocated HSZ, + * can be used interchangably. However, in order to keep track of the allocated HSZ, * and to free them upon instance termination, all HSZ are stored in a link list. * When the HSZ need to be passed thru DDE messages, we need to convert them back and * forth to global atoms. @@ -123,7 +123,7 @@ typedef struct tagWDML_XACT { LPARAM lParam; /* useful for reusing */ } WDML_XACT; -typedef struct tagWDML_CONV +typedef struct tagWDML_CONV { struct tagWDML_CONV* next; /* to link all the conversations */ struct tagWDML_INSTANCE* instance; @@ -161,7 +161,7 @@ typedef struct tagWDML_INSTANCE PFNCALLBACK callback; DWORD CBFflags; DWORD monitorFlags; - DWORD lastError; + DWORD lastError; HWND hwndEvent; WDML_SERVER* servers; /* list of registered servers */ WDML_CONV* convs[2]; /* active conversations for this instance (client and server) */ @@ -187,31 +187,31 @@ typedef enum { } WDML_QUEUE_STATE; extern HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInst, UINT uType, UINT uFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hdata, + HSZ hsz1, HSZ hsz2, HDDEDATA hdata, DWORD dwData1, DWORD dwData2); extern HDDEDATA WDML_InvokeCallback16(PFNCALLBACK pfn, UINT uType, UINT uFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hdata, + HSZ hsz1, HSZ hsz2, HDDEDATA hdata, DWORD dwData1, DWORD dwData2); extern WDML_SERVER* WDML_AddServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic); extern void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic); extern WDML_SERVER* WDML_FindServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic); -/* called both in DdeClientTransaction and server side. */ +/* called both in DdeClientTransaction and server side. */ extern UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes, BOOL bUnicode, BOOL b16); -extern WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side, +extern WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic, HWND hwndClient, HWND hwndServer); extern void WDML_RemoveConv(WDML_CONV* pConv, WDML_SIDE side); extern WDML_CONV* WDML_GetConv(HCONV hConv, BOOL checkConnected); extern WDML_CONV* WDML_GetConvFromWnd(HWND hWnd); -extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, - HSZ hszService, HSZ hszTopic); -extern BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode, +extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, + HSZ hszService, HSZ hszTopic); +extern BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode, BOOL fBusy, BOOL fAck, UINT pmt, LPARAM lParam, UINT oldMsg); -extern void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, +extern void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, UINT wType, HSZ hszItem, UINT wFmt); -extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, +extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, HSZ hszItem, BOOL use_fmt, UINT uFmt); -extern void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, +extern void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, HSZ hszItem, UINT wFmt); extern void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side); /* string internals */ @@ -226,14 +226,14 @@ extern void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct); extern BOOL WDML_UnQueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct); extern void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFreePmt); extern WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid); -extern HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, +extern HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, BOOL fDeferUpd, BOOL dAckReq); extern HDDEDATA WDML_Global2DataHandle(HGLOBAL hMem, WINE_DDEHEAD* da); extern BOOL WDML_IsAppOwned(HDDEDATA hDdeData); extern WDML_INSTANCE* WDML_GetInstance(DWORD InstId); extern WDML_INSTANCE* WDML_GetInstanceFromWnd(HWND hWnd); /* broadcasting to DDE windows */ -extern void WDML_BroadcastDDEWindows(const char* clsName, UINT uMsg, +extern void WDML_BroadcastDDEWindows(const char* clsName, UINT uMsg, WPARAM wParam, LPARAM lParam); extern void WDML_NotifyThreadExit(DWORD tid); @@ -252,7 +252,7 @@ extern const WCHAR WDML_szClientConvClassW[]; /* class of window for client sid #define WM_WDML_UNREGISTER (WM_USER + 0x201) #define WM_WDML_CONNECT_CONFIRM (WM_USER + 0x202) -/* parameters for messages: +/* parameters for messages: * wParam lParam * Register atom for service name atom for service spec * Unregister atom for service name atom for service spec diff --git a/dlls/user/dde/ddeml16.c b/dlls/user/dde/ddeml16.c index 35caee4b59f..a6d5ff4e92f 100644 --- a/dlls/user/dde/ddeml16.c +++ b/dlls/user/dde/ddeml16.c @@ -97,8 +97,8 @@ extern LONG CALLBACK WDML_CallTo16_long_llllllll(FARPROC16,LONG,LONG,LONG,LONG,L * * */ -HDDEDATA WDML_InvokeCallback16(PFNCALLBACK pfn, UINT uType, UINT uFmt, - HCONV hConv, HSZ hsz1, HSZ hsz2, +HDDEDATA WDML_InvokeCallback16(PFNCALLBACK pfn, UINT uType, UINT uFmt, + HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hdata, DWORD dwData1, DWORD dwData2) { DWORD d1; @@ -116,7 +116,7 @@ HDDEDATA WDML_InvokeCallback16(PFNCALLBACK pfn, UINT uType, UINT uFmt, d1 = dwData1; break; } - ret = WDML_CallTo16_long_llllllll((FARPROC16)pfn, uType, uFmt, hConv, + ret = WDML_CallTo16_long_llllllll((FARPROC16)pfn, uType, uFmt, hConv, hsz1, hsz2, hdata, d1, dwData2); switch (uType) { @@ -134,7 +134,7 @@ HDDEDATA WDML_InvokeCallback16(PFNCALLBACK pfn, UINT uType, UINT uFmt, UINT16 WINAPI DdeInitialize16(LPDWORD pidInst, PFNCALLBACK16 pfnCallback, DWORD afCmd, DWORD ulRes) { - return WDML_Initialize(pidInst, (PFNCALLBACK)pfnCallback, afCmd, ulRes, + return WDML_Initialize(pidInst, (PFNCALLBACK)pfnCallback, afCmd, ulRes, FALSE, TRUE); } @@ -155,7 +155,7 @@ HCONVLIST WINAPI DdeConnectList16(DWORD idInst, HSZ hszService, HSZ hszTopic, { CONVCONTEXT cc; CONVCONTEXT* pCC = NULL; - + if (pCC16) map1632_conv_context(pCC = &cc, pCC16); return DdeConnectList(idInst, hszService, hszTopic, hConvList, pCC); @@ -181,7 +181,7 @@ BOOL16 WINAPI DdeDisconnectList16(HCONVLIST hConvList) /***************************************************************** * DdeQueryString (DDEML.23) */ -DWORD WINAPI DdeQueryString16(DWORD idInst, HSZ hsz, LPSTR lpsz, DWORD cchMax, +DWORD WINAPI DdeQueryString16(DWORD idInst, HSZ hsz, LPSTR lpsz, DWORD cchMax, INT16 codepage) { return DdeQueryStringA(idInst, hsz, lpsz, cchMax, codepage); @@ -190,12 +190,12 @@ DWORD WINAPI DdeQueryString16(DWORD idInst, HSZ hsz, LPSTR lpsz, DWORD cchMax, /***************************************************************** * DdeConnect (DDEML.7) */ -HCONV WINAPI DdeConnect16(DWORD idInst, HSZ hszService, HSZ hszTopic, +HCONV WINAPI DdeConnect16(DWORD idInst, HSZ hszService, HSZ hszTopic, LPCONVCONTEXT16 pCC16) { CONVCONTEXT cc; CONVCONTEXT* pCC = NULL; - + if (pCC16) map1632_conv_context(pCC = &cc, pCC16); return DdeConnect(idInst, hszService, hszTopic, pCC); @@ -220,8 +220,8 @@ BOOL16 WINAPI DdeSetUserHandle16(HCONV hConv, DWORD id, DWORD hUser) /***************************************************************** * DdeCreateDataHandle (DDEML.14) */ -HDDEDATA WINAPI DdeCreateDataHandle16(DWORD idInst, LPBYTE pSrc, DWORD cb, - DWORD cbOff, HSZ hszItem, UINT16 wFmt, +HDDEDATA WINAPI DdeCreateDataHandle16(DWORD idInst, LPBYTE pSrc, DWORD cb, + DWORD cbOff, HSZ hszItem, UINT16 wFmt, UINT16 afCmd) { return DdeCreateDataHandle(idInst, pSrc, cb, cbOff, hszItem, wFmt, afCmd); @@ -235,8 +235,8 @@ HSZ WINAPI DdeCreateStringHandle16(DWORD idInst, LPCSTR str, INT16 codepage) if (codepage) { return DdeCreateStringHandleA(idInst, str, codepage); - } - else + } + else { TRACE("Default codepage supplied\n"); return DdeCreateStringHandleA(idInst, str, CP_WINANSI); @@ -270,8 +270,8 @@ BOOL16 WINAPI DdeKeepStringHandle16(DWORD idInst, HSZ hsz) /***************************************************************** * DdeClientTransaction (DDEML.11) */ -HDDEDATA WINAPI DdeClientTransaction16(LPVOID pData, DWORD cbData, HCONV hConv, - HSZ hszItem, UINT16 wFmt, UINT16 wType, +HDDEDATA WINAPI DdeClientTransaction16(LPVOID pData, DWORD cbData, HCONV hConv, + HSZ hszItem, UINT16 wFmt, UINT16 wType, DWORD dwTimeout, LPDWORD pdwResult) { return DdeClientTransaction((LPBYTE)pData, cbData, hConv, hszItem, @@ -366,7 +366,7 @@ INT16 WINAPI DdeCmpStringHandles16(HSZ hsz1, HSZ hsz2) * DdeQueryConvInfo (DDEML.9) * */ -UINT16 WINAPI DdeQueryConvInfo16(HCONV hConv, DWORD idTransaction, +UINT16 WINAPI DdeQueryConvInfo16(HCONV hConv, DWORD idTransaction, LPCONVINFO16 lpConvInfo) { CONVINFO ci32; diff --git a/dlls/user/dde/misc.c b/dlls/user/dde/misc.c index fc2e84d2181..57915999c8a 100644 --- a/dlls/user/dde/misc.c +++ b/dlls/user/dde/misc.c @@ -310,8 +310,8 @@ static LRESULT CALLBACK WDML_EventProc(HWND hwndEvent, UINT uMsg, WPARAM wParam, { pConv->wStatus |= ST_ISLOCAL; - WDML_InvokeCallback(pInstance, XTYP_CONNECT_CONFIRM, 0, (HCONV)pConv, - pConv->hszTopic, pConv->hszService, 0, 0, + WDML_InvokeCallback(pInstance, XTYP_CONNECT_CONFIRM, 0, (HCONV)pConv, + pConv->hszTopic, pConv->hszService, 0, 0, (pConv->wStatus & ST_ISSELF) ? 1 : 0); } } @@ -335,7 +335,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, UINT ret; WNDCLASSEXA wndclass; - TRACE("(%p,%p,0x%lx,%ld)\n", + TRACE("(%p,%p,0x%lx,%ld)\n", pidInst, pfnCallback, afCmd, ulRes); if (ulRes) @@ -344,7 +344,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, /* trap this and no more until we know more */ return DMLERR_NO_ERROR; } - + /* grab enough heap for one control struct - not really necessary for re-initialise * but allows us to use same validation routines */ pInstance = (WDML_INSTANCE*)HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_INSTANCE)); @@ -356,9 +356,9 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, } pInstance->next = NULL; pInstance->monitor = (afCmd | APPCLASS_MONITOR); - + /* messy bit, spec implies that 'Client Only' can be set in 2 different ways, catch 1 here */ - + pInstance->clientOnly = afCmd & APPCMD_CLIENTONLY; pInstance->instanceID = *pidInst; /* May need to add calling proc Id */ pInstance->threadID = GetCurrentThreadId(); @@ -374,79 +374,79 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, pInstance->links[1] = NULL; /* isolate CBF flags in one go, expect this will go the way of all attempts to be clever !! */ - + pInstance->CBFflags = afCmd^((afCmd&MF_MASK)|((afCmd&APPCMD_MASK)|(afCmd&APPCLASS_MASK))); - + if (!pInstance->clientOnly) { /* Check for other way of setting Client-only !! */ - pInstance->clientOnly = + pInstance->clientOnly = (pInstance->CBFflags & CBF_FAIL_ALLSVRXACTIONS) == CBF_FAIL_ALLSVRXACTIONS; } - + TRACE("instance created - checking validity \n"); - - if (*pidInst == 0) + + if (*pidInst == 0) { /* Initialisation of new Instance Identifier */ TRACE("new instance, callback %p flags %lX\n",pfnCallback,afCmd); EnterCriticalSection(&WDML_CritSect); - - if (WDML_InstanceList == NULL) + + if (WDML_InstanceList == NULL) { /* can't be another instance in this case, assign to the base pointer */ WDML_InstanceList = pInstance; - + /* since first must force filter of XTYP_CONNECT and XTYP_WILDCONNECT for - * present + * present * ------------------------------- NOTE NOTE NOTE -------------------------- - * + * * the manual is not clear if this condition - * applies to the first call to DdeInitialize from an application, or the + * applies to the first call to DdeInitialize from an application, or the * first call for a given callback !!! */ - + pInstance->CBFflags = pInstance->CBFflags|APPCMD_FILTERINITS; TRACE("First application instance detected OK\n"); /* allocate new instance ID */ WDML_IncrementInstanceId(pInstance); - } - else + } + else { /* really need to chain the new one in to the latest here, but after checking conditions * such as trying to start a conversation from an application trying to monitor */ reference_inst = WDML_InstanceList; TRACE("Subsequent application instance - starting checks\n"); - while (reference_inst->next != NULL) + while (reference_inst->next != NULL) { /* * This set of tests will work if application uses same instance Id * at application level once allocated - which is what manual implies - * should happen. If someone tries to be + * should happen. If someone tries to be * clever (lazy ?) it will fail to pick up that later calls are for * the same application - should we trust them ? */ - if (pInstance->instanceID == reference_inst->instanceID) + if (pInstance->instanceID == reference_inst->instanceID) { /* Check 1 - must be same Client-only state */ - + if (pInstance->clientOnly != reference_inst->clientOnly) { ret = DMLERR_DLL_USAGE; goto theError; } - + /* Check 2 - cannot use 'Monitor' with any non-monitor modes */ - - if (pInstance->monitor != reference_inst->monitor) + + if (pInstance->monitor != reference_inst->monitor) { ret = DMLERR_INVALIDPARAMETER; goto theError; } - + /* Check 3 - must supply different callback address */ - + if (pInstance->callback == reference_inst->callback) { ret = DMLERR_DLL_USAGE; @@ -456,7 +456,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, reference_inst = reference_inst->next; } /* All cleared, add to chain */ - + TRACE("Application Instance checks finished\n"); WDML_IncrementInstanceId(pInstance); reference_inst->next = pInstance; @@ -478,25 +478,25 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, wndclass.lpszMenuName = NULL; wndclass.lpszClassName = WDML_szEventClass; wndclass.hIconSm = 0; - + RegisterClassExA(&wndclass); - + pInstance->hwndEvent = CreateWindowA(WDML_szEventClass, NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0); - + SetWindowLongA(pInstance->hwndEvent, GWL_WDML_INSTANCE, (DWORD)pInstance); TRACE("New application instance processing finished OK\n"); - } - else + } + else { /* Reinitialisation situation --- FIX */ TRACE("reinitialisation of (%p,%p,0x%lx,%ld): stub\n", pidInst, pfnCallback, afCmd, ulRes); - + EnterCriticalSection(&WDML_CritSect); - - if (WDML_InstanceList == NULL) + + if (WDML_InstanceList == NULL) { ret = DMLERR_DLL_USAGE; goto theError; @@ -514,13 +514,13 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, if (*pidInst == reference_inst->instanceID && pfnCallback == reference_inst->callback) { /* Check 1 - cannot change client-only mode if set via APPCMD_CLIENTONLY */ - + if (reference_inst->clientOnly) { - if ((reference_inst->CBFflags & CBF_FAIL_ALLSVRXACTIONS) != CBF_FAIL_ALLSVRXACTIONS) + if ((reference_inst->CBFflags & CBF_FAIL_ALLSVRXACTIONS) != CBF_FAIL_ALLSVRXACTIONS) { /* i.e. Was set to Client-only and through APPCMD_CLIENTONLY */ - + if (!(afCmd & APPCMD_CLIENTONLY)) { ret = DMLERR_DLL_USAGE; @@ -529,15 +529,15 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, } } /* Check 2 - cannot change monitor modes */ - - if (pInstance->monitor != reference_inst->monitor) + + if (pInstance->monitor != reference_inst->monitor) { ret = DMLERR_DLL_USAGE; goto theError; } - + /* Check 3 - trying to set Client-only via APPCMD when not set so previously */ - + if ((afCmd&APPCMD_CLIENTONLY) && !reference_inst->clientOnly) { ret = DMLERR_DLL_USAGE; @@ -549,21 +549,21 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, } if (reference_inst->next == NULL) { - /* Crazy situation - trying to re-initialize something that has not beeen initialized !! - * + /* Crazy situation - trying to re-initialize something that has not beeen initialized !! + * * Manual does not say what we do, cannot return DMLERR_NOT_INITIALIZED so what ? */ ret = DMLERR_INVALIDPARAMETER; goto theError; } /* All checked - change relevant flags */ - + reference_inst->CBFflags = pInstance->CBFflags; reference_inst->clientOnly = pInstance->clientOnly; reference_inst->monitorFlags = pInstance->monitorFlags; LeaveCriticalSection(&WDML_CritSect); } - + return DMLERR_NO_ERROR; theError: HeapFree(GetProcessHeap(), 0, pInstance); @@ -621,7 +621,7 @@ BOOL WINAPI DdeUninitialize(DWORD idInst) EnterCriticalSection(&WDML_CritSect); - /* First check instance + /* First check instance */ pInstance = WDML_GetInstance(idInst); if (pInstance == NULL) @@ -646,16 +646,16 @@ BOOL WINAPI DdeUninitialize(DWORD idInst) /* then unregister all known service names */ DdeNameService(idInst, 0, 0, DNS_UNREGISTER); - + /* Free the nodes that were not freed by this instance * and remove the nodes from the list of HSZ nodes. */ WDML_FreeAllHSZ(pInstance); DestroyWindow(pInstance->hwndEvent); - + /* OK now delete the instance handle itself */ - + if (WDML_InstanceList == pInstance) { /* special case - the first/only entry */ @@ -665,7 +665,7 @@ BOOL WINAPI DdeUninitialize(DWORD idInst) { /* general case, remove entry */ WDML_INSTANCE* inst; - + for (inst = WDML_InstanceList; inst->next != pInstance; inst = inst->next); inst->next = pInstance->next; } @@ -705,7 +705,7 @@ void WDML_NotifyThreadDetach(void) * */ HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInstance, UINT uType, UINT uFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hdata, + HSZ hsz1, HSZ hsz2, HDDEDATA hdata, DWORD dwData1, DWORD dwData2) { HDDEDATA ret; @@ -713,11 +713,11 @@ HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInstance, UINT uType, UINT uFmt, H if (pInstance == NULL) return (HDDEDATA)0; TRACE("invoking CB%d[%08lx] (%u %u %08lx 0x%x 0x%x %u %lu %lu)\n", - pInstance->win16 ? 16 : 32, (DWORD)pInstance->callback, uType, uFmt, + pInstance->win16 ? 16 : 32, (DWORD)pInstance->callback, uType, uFmt, (DWORD)hConv, hsz1, hsz2, hdata, dwData1, dwData2); if (pInstance->win16) { - ret = WDML_InvokeCallback16(pInstance->callback, uType, uFmt, hConv, + ret = WDML_InvokeCallback16(pInstance->callback, uType, uFmt, hConv, hsz1, hsz2, hdata, dwData1, dwData2); } else @@ -738,7 +738,7 @@ HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInstance, UINT uType, UINT uFmt, H WDML_INSTANCE* WDML_GetInstance(DWORD instId) { WDML_INSTANCE* pInstance; - + for (pInstance = WDML_InstanceList; pInstance != NULL; pInstance = pInstance->next) { if (pInstance->instanceID == instId) @@ -778,15 +778,15 @@ UINT WINAPI DdeGetLastError(DWORD idInst) { DWORD error_code; WDML_INSTANCE* pInstance; - + FIXME("(%ld): error reporting is weakly implemented\n", idInst); - + EnterCriticalSection(&WDML_CritSect); - + /* First check instance */ pInstance = WDML_GetInstance(idInst); - if (pInstance == NULL) + if (pInstance == NULL) { error_code = DMLERR_DLL_NOT_INITIALIZED; } @@ -795,7 +795,7 @@ UINT WINAPI DdeGetLastError(DWORD idInst) error_code = pInstance->lastError; pInstance->lastError = 0; } - + LeaveCriticalSection(&WDML_CritSect); return error_code; } @@ -916,7 +916,7 @@ BOOL WDML_DecHSZ(WDML_INSTANCE* pInstance, HSZ hsz) } } WARN("HSZ 0x%x not found\n", hsz); - + return FALSE; } @@ -968,7 +968,7 @@ static void WDML_InsertHSZNode(WDML_INSTANCE* pInstance, HSZ hsz) * * */ -static int WDML_QueryString(WDML_INSTANCE* pInstance, HSZ hsz, LPVOID ptr, DWORD cchMax, +static int WDML_QueryString(WDML_INSTANCE* pInstance, HSZ hsz, LPVOID ptr, DWORD cchMax, int codepage) { WCHAR pString[MAX_BUFFER_LEN]; @@ -1003,12 +1003,12 @@ DWORD WINAPI DdeQueryStringA(DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, INT { DWORD ret = 0; WDML_INSTANCE* pInstance; - + TRACE("(%ld, 0x%x, %p, %ld, %d)\n", idInst, hsz, psz, cchMax, iCodePage); - + EnterCriticalSection(&WDML_CritSect); - - /* First check instance + + /* First check instance */ pInstance = WDML_GetInstance(idInst); if (pInstance != NULL) @@ -1017,8 +1017,8 @@ DWORD WINAPI DdeQueryStringA(DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, INT ret = WDML_QueryString(pInstance, hsz, psz, cchMax, iCodePage); } LeaveCriticalSection(&WDML_CritSect); - - TRACE("returning %s\n", debugstr_a(psz)); + + TRACE("returning %s\n", debugstr_a(psz)); return ret; } @@ -1032,10 +1032,10 @@ DWORD WINAPI DdeQueryStringW(DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, IN WDML_INSTANCE* pInstance; TRACE("(%ld, 0x%x, %p, %ld, %d)\n", idInst, hsz, psz, cchMax, iCodePage); - + EnterCriticalSection(&WDML_CritSect); - - /* First check instance + + /* First check instance */ pInstance = WDML_GetInstance(idInst); if (pInstance != NULL) @@ -1045,7 +1045,7 @@ DWORD WINAPI DdeQueryStringW(DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, IN } LeaveCriticalSection(&WDML_CritSect); - TRACE("returning %s\n", debugstr_w(psz)); + TRACE("returning %s\n", debugstr_w(psz)); return ret; } @@ -1087,20 +1087,20 @@ HSZ WINAPI DdeCreateStringHandleA(DWORD idInst, LPCSTR psz, INT codepage) { HSZ hsz = 0; WDML_INSTANCE* pInstance; - + TRACE("(%ld,%p,%d)\n", idInst, psz, codepage); - + EnterCriticalSection(&WDML_CritSect); - + pInstance = WDML_GetInstance(idInst); if (pInstance) { if (codepage == 0) codepage = CP_WINANSI; hsz = WDML_CreateString(pInstance, psz, codepage); - } + } LeaveCriticalSection(&WDML_CritSect); - return hsz; + return hsz; } @@ -1119,17 +1119,17 @@ HSZ WINAPI DdeCreateStringHandleW(DWORD idInst, LPCWSTR psz, INT codepage) { WDML_INSTANCE* pInstance; HSZ hsz = 0; - + TRACE("(%ld,%p,%d)\n", idInst, psz, codepage); - + EnterCriticalSection(&WDML_CritSect); - + pInstance = WDML_GetInstance(idInst); if (pInstance) { if (codepage == 0) codepage = CP_WINUNICODE; hsz = WDML_CreateString(pInstance, psz, codepage); - } + } LeaveCriticalSection(&WDML_CritSect); return hsz; @@ -1146,10 +1146,10 @@ BOOL WINAPI DdeFreeStringHandle(DWORD idInst, HSZ hsz) BOOL ret = FALSE; TRACE("(%ld,0x%x): \n", idInst, hsz); - + EnterCriticalSection(&WDML_CritSect); - - /* First check instance + + /* First check instance */ pInstance = WDML_GetInstance(idInst); if (pInstance) @@ -1172,9 +1172,9 @@ BOOL WINAPI DdeKeepStringHandle(DWORD idInst, HSZ hsz) BOOL ret = FALSE; TRACE("(%ld,0x%x): \n", idInst, hsz); - + EnterCriticalSection(&WDML_CritSect); - + /* First check instance */ pInstance = WDML_GetInstance(idInst); @@ -1202,12 +1202,12 @@ INT WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) WCHAR psz2[MAX_BUFFER_LEN]; int ret = 0; int ret1, ret2; - + ret1 = GetAtomNameW((ATOM)hsz1, psz1, MAX_BUFFER_LEN); ret2 = GetAtomNameW((ATOM)hsz2, psz2, MAX_BUFFER_LEN); TRACE("(%x<%s> %x<%s>);\n", hsz1, debugstr_w(psz1), hsz2, debugstr_w(psz2)); - + /* Make sure we found both strings. */ if (ret1 == 0 && ret2 == 0) { @@ -1228,7 +1228,7 @@ INT WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) { /* Compare the two strings we got (case insensitive). */ ret = lstrcmpiW(psz1, psz2); - /* Since strcmp returns any number smaller than + /* Since strcmp returns any number smaller than * 0 when the first string is found to be less than * the second one we must make sure we are returning * the proper values. @@ -1242,7 +1242,7 @@ INT WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) ret = 1; } } - + return ret; } @@ -1255,20 +1255,20 @@ INT WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) /***************************************************************** * DdeCreateDataHandle (USER32.@) */ -HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD cbOff, +HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD cbOff, HSZ hszItem, UINT wFmt, UINT afCmd) { /* For now, we ignore idInst, hszItem. * The purpose of these arguments still need to be investigated. */ - + HGLOBAL hMem; LPBYTE pByte; DDE_DATAHANDLE_HEAD* pDdh; - + TRACE("(%ld,%p,%ld,%ld,0x%lx,%d,%d)\n", idInst, pSrc, cb, cbOff, (DWORD)hszItem, wFmt, afCmd); - + if (afCmd != 0 && afCmd != HDATA_APPOWNED) return 0; @@ -1277,8 +1277,8 @@ HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD c { ERR("GlobalAlloc failed\n"); return 0; - } - + } + pDdh = (DDE_DATAHANDLE_HEAD*)GlobalLock(hMem); if (!pDdh) { @@ -1295,7 +1295,7 @@ HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD c memcpy(pByte, pSrc + cbOff, cb); } GlobalUnlock(hMem); - + return (HDDEDATA)hMem; } @@ -1306,22 +1306,22 @@ HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD c HDDEDATA WINAPI DdeAddData(HDDEDATA hData, LPBYTE pSrc, DWORD cb, DWORD cbOff) { DWORD old_sz, new_sz; - LPBYTE pDst; - + LPBYTE pDst; + pDst = DdeAccessData(hData, &old_sz); if (!pDst) return 0; - + new_sz = cb + cbOff; if (new_sz > old_sz) { DdeUnaccessData(hData); - hData = GlobalReAlloc((HGLOBAL)hData, new_sz + sizeof(DDE_DATAHANDLE_HEAD), + hData = GlobalReAlloc((HGLOBAL)hData, new_sz + sizeof(DDE_DATAHANDLE_HEAD), GMEM_MOVEABLE | GMEM_DDESHARE); pDst = DdeAccessData(hData, &old_sz); } - + if (!pDst) return 0; - + memcpy(pDst + cbOff, pSrc, cb); DdeUnaccessData(hData); return hData; @@ -1344,12 +1344,12 @@ DWORD WINAPI DdeGetData(HDDEDATA hData, LPBYTE pDst, DWORD cbMax, DWORD cbOff) { DWORD dwSize, dwRet; LPBYTE pByte; - + TRACE("(%08lx,%p,%ld,%ld)\n",(DWORD)hData, pDst, cbMax, cbOff); - + pByte = DdeAccessData(hData, &dwSize); - - if (pByte) + + if (pByte) { if (!pDst) { @@ -1387,16 +1387,16 @@ LPBYTE WINAPI DdeAccessData(HDDEDATA hData, LPDWORD pcbDataSize) { HGLOBAL hMem = (HGLOBAL)hData; DDE_DATAHANDLE_HEAD* pDdh; - + TRACE("(%08lx,%p)\n", (DWORD)hData, pcbDataSize); - + pDdh = (DDE_DATAHANDLE_HEAD*)GlobalLock(hMem); if (pDdh == NULL) { ERR("Failed on GlobalLock(%04x)\n", hMem); return 0; } - + if (pcbDataSize != NULL) { *pcbDataSize = GlobalSize(hMem) - sizeof(DDE_DATAHANDLE_HEAD); @@ -1411,11 +1411,11 @@ LPBYTE WINAPI DdeAccessData(HDDEDATA hData, LPDWORD pcbDataSize) BOOL WINAPI DdeUnaccessData(HDDEDATA hData) { HGLOBAL hMem = (HGLOBAL)hData; - + TRACE("(0x%lx)\n", (DWORD)hData); - + GlobalUnlock(hMem); - + return TRUE; } @@ -1423,7 +1423,7 @@ BOOL WINAPI DdeUnaccessData(HDDEDATA hData) * DdeFreeDataHandle (USER32.@) */ BOOL WINAPI DdeFreeDataHandle(HDDEDATA hData) -{ +{ return GlobalFree((HGLOBAL)hData) == 0; } @@ -1451,9 +1451,9 @@ BOOL WDML_IsAppOwned(HDDEDATA hData) * Global <=> Data handle management * * ================================================================ */ - + /* Note: we use a DDEDATA, but layout of DDEDATA, DDEADVISE and DDEPOKE structures is similar: - * offset size + * offset size * (bytes) (bits) comment * 0 16 bit fields for options (release, ackreq, response...) * 2 16 clipboard format @@ -1475,7 +1475,7 @@ HDDEDATA WDML_Global2DataHandle(HGLOBAL hMem, WINE_DDEHEAD* p) switch (pDd->cfFormat) { default: - FIXME("Unsupported format (%d) for data... assuming raw information\n", + FIXME("Unsupported format (%d) for data... assuming raw information\n", pDd->cfFormat); /* fall thru */ case 0: @@ -1491,11 +1491,11 @@ HDDEDATA WDML_Global2DataHandle(HGLOBAL hMem, WINE_DDEHEAD* p) { HBITMAP hbmp; - if ((hbmp = CreateBitmap(bmp->bmWidth, bmp->bmHeight, + if ((hbmp = CreateBitmap(bmp->bmWidth, bmp->bmHeight, bmp->bmPlanes, bmp->bmBitsPixel, pDd->Value + sizeof(BITMAP)))) { - ret = DdeCreateDataHandle(0, (LPBYTE)&hbmp, sizeof(hbmp), + ret = DdeCreateDataHandle(0, (LPBYTE)&hbmp, sizeof(hbmp), 0, 0, CF_BITMAP, 0); } else ERR("Can't create bmp\n"); @@ -1512,25 +1512,25 @@ HDDEDATA WDML_Global2DataHandle(HGLOBAL hMem, WINE_DDEHEAD* p) } return ret; } - + /****************************************************************** * WDML_DataHandle2Global * * */ -HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, +HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, BOOL fDeferUpd, BOOL fAckReq) { DDE_DATAHANDLE_HEAD* pDdh; DWORD dwSize; HGLOBAL hMem = 0; - + dwSize = GlobalSize((HGLOBAL)hDdeData) - sizeof(DDE_DATAHANDLE_HEAD); pDdh = (DDE_DATAHANDLE_HEAD*)GlobalLock((HGLOBAL)hDdeData); if (dwSize && pDdh) { WINE_DDEHEAD* wdh = NULL; - + switch (pDdh->cfFormat) { default: @@ -1539,7 +1539,7 @@ HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, case 0: case CF_TEXT: hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, sizeof(WINE_DDEHEAD) + dwSize); - if (hMem && (wdh = GlobalLock(hMem))) + if (hMem && (wdh = GlobalLock(hMem))) { memcpy(wdh + 1, pDdh + 1, dwSize); } @@ -1554,9 +1554,9 @@ HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, if (GetObjectA(hbmp, sizeof(bmp), &bmp)) { count = bmp.bmWidthBytes * bmp.bmHeight; - hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, + hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, sizeof(WINE_DDEHEAD) + sizeof(bmp) + count); - if (hMem && (wdh = GlobalLock(hMem))) + if (hMem && (wdh = GlobalLock(hMem))) { memcpy(wdh + 1, &bmp, sizeof(bmp)); GetBitmapBits(hbmp, count, ((char*)(wdh + 1)) + sizeof(bmp)); @@ -1576,7 +1576,7 @@ HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, } GlobalUnlock((HGLOBAL)hDdeData); } - + return hMem; } @@ -1596,10 +1596,10 @@ WDML_SERVER* WDML_AddServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTop WDML_SERVER* pServer; char buf1[256]; char buf2[256]; - + pServer = (WDML_SERVER*)HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_SERVER)); if (pServer == NULL) return NULL; - + WDML_IncHSZ(pInstance, pServer->hszService = hszService); DdeQueryStringA(pInstance->instanceID, hszService, buf1, sizeof(buf1), CP_WINANSI); @@ -1610,7 +1610,7 @@ WDML_SERVER* WDML_AddServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTop pServer->atomServiceSpec = WDML_MakeAtomFromHsz(pServer->hszServiceSpec); pServer->filterOn = TRUE; - + pServer->next = pInstance->servers; pInstance->servers = pServer; return pServer; @@ -1629,12 +1629,12 @@ void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic) WDML_CONV* pConvNext; pServer = pInstance->servers; - + while (pServer != NULL) { if (DdeCmpStringHandles(pServer->hszService, hszService) == 0) { - WDML_BroadcastDDEWindows(WDML_szEventClass, WM_WDML_UNREGISTER, + WDML_BroadcastDDEWindows(WDML_szEventClass, WM_WDML_UNREGISTER, pServer->atomService, pServer->atomServiceSpec); /* terminate all conversations for given topic */ for (pConv = pInstance->convs[WDML_SERVER_SIDE]; pConv != NULL; pConv = pConvNext) @@ -1655,7 +1655,7 @@ void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic) { pPrev->next = pServer->next; } - + DestroyWindow(pServer->hwndServer); WDML_DecHSZ(pInstance, pServer->hszServiceSpec); WDML_DecHSZ(pInstance, pServer->hszService); @@ -1666,7 +1666,7 @@ void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic) HeapFree(GetProcessHeap(), 0, pServer); break; } - + pPrev = pServer; pServer = pServer->next; } @@ -1682,7 +1682,7 @@ void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic) WDML_SERVER* WDML_FindServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic) { WDML_SERVER* pServer; - + for (pServer = pInstance->servers; pServer != NULL; pServer = pServer->next) { if (hszService == pServer->hszService) @@ -1709,7 +1709,7 @@ WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic, HWND hwndClient, HWND hwndServer) { WDML_CONV* pConv; - + /* no converstation yet, add it */ pConv = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_CONV)); if (!pConv) return NULL; @@ -1732,7 +1732,7 @@ WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side, pConv->next = pInstance->convs[side]; pInstance->convs[side] = pConv; - + return pConv; } @@ -1741,11 +1741,11 @@ WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side, * * */ -WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, +WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic) { WDML_CONV* pCurrent = NULL; - + for (pCurrent = pInstance->convs[side]; pCurrent != NULL; pCurrent = pCurrent->next) { if (DdeCmpStringHandles(pCurrent->hszService, hszService) == 0 && @@ -1753,7 +1753,7 @@ WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, { return pCurrent; } - + } return NULL; } @@ -1810,7 +1810,7 @@ void WDML_RemoveConv(WDML_CONV* pRef, WDML_SIDE side) { pPrev->next = pCurrent->next; } - + HeapFree(GetProcessHeap(), 0, pCurrent); break; } @@ -1823,14 +1823,14 @@ void WDML_RemoveConv(WDML_CONV* pRef, WDML_SIDE side) BOOL WINAPI DdeEnableCallback(DWORD idInst, HCONV hConv, UINT wCmd) { FIXME("(%ld, 0x%x, %d) stub\n", idInst, hConv, wCmd); - + return 0; } /****************************************************************** * WDML_GetConv * - * + * */ WDML_CONV* WDML_GetConv(HCONV hConv, BOOL checkConnected) { @@ -1867,7 +1867,7 @@ WDML_CONV* WDML_GetConvFromWnd(HWND hWnd) * * */ -BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode, +BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode, BOOL fBusy, BOOL fAck, UINT pmt, LPARAM lParam, UINT oldMsg) { DDEACK ddeAck; @@ -1890,7 +1890,7 @@ BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode, ddeAck.fAck = fAck; TRACE("Posting a %s ack\n", ddeAck.fAck ? "positive" : "negative"); - + lParam = (lParam) ? ReuseDDElParam(lParam, oldMsg, WM_DDE_ACK, *(WORD*)&ddeAck, pmt) : PackDDElParam(WM_DDE_ACK, *(WORD*)&ddeAck, pmt); if (!PostMessageA(to, WM_DDE_ACK, (WPARAM)from, lParam)) @@ -1918,7 +1918,7 @@ BOOL WINAPI DdeSetUserHandle(HCONV hConv, DWORD id, DWORD hUser) ret = FALSE; goto theError; } - if (id == QID_SYNC) + if (id == QID_SYNC) { pConv->hUser = hUser; } @@ -2069,11 +2069,11 @@ UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD id, LPCONVINFO lpConvInfo) * * */ -void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, +void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, UINT wType, HSZ hszItem, UINT wFmt) { WDML_LINK* pLink; - + pLink = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_LINK)); if (pLink == NULL) { @@ -2094,14 +2094,14 @@ void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, * * */ -void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, +void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, HSZ hszItem, UINT uFmt) { WDML_LINK* pPrev = NULL; WDML_LINK* pCurrent = NULL; - + pCurrent = pInstance->links[side]; - + while (pCurrent != NULL) { if (pCurrent->hConv == hConv && @@ -2116,19 +2116,19 @@ void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, { pPrev->next = pCurrent->next; } - + WDML_DecHSZ(pInstance, pCurrent->hszItem); HeapFree(GetProcessHeap(), 0, pCurrent); break; } - + pPrev = pCurrent; pCurrent = pCurrent->next; } } /* this function is called to remove all links related to the conv. - It should be called from both client and server when terminating + It should be called from both client and server when terminating the conversation. */ /****************************************************************** @@ -2141,9 +2141,9 @@ void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE s WDML_LINK* pPrev = NULL; WDML_LINK* pCurrent = NULL; WDML_LINK* pNext = NULL; - + pCurrent = pInstance->links[side]; - + while (pCurrent != NULL) { if (pCurrent->hConv == (HCONV)pConv) @@ -2158,13 +2158,13 @@ void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE s pPrev->next = pCurrent->next; pNext = pCurrent->next; } - + WDML_DecHSZ(pInstance, pCurrent->hszItem); - + HeapFree(GetProcessHeap(), 0, pCurrent); pCurrent = NULL; } - + if (pCurrent) { pPrev = pCurrent; @@ -2182,24 +2182,24 @@ void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE s * * */ -WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, +WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, HSZ hszItem, BOOL use_fmt, UINT uFmt) { WDML_LINK* pCurrent = NULL; - + for (pCurrent = pInstance->links[side]; pCurrent != NULL; pCurrent = pCurrent->next) { /* we don't need to check for transaction type as it can be altered */ - + if (pCurrent->hConv == hConv && DdeCmpStringHandles(pCurrent->hszItem, hszItem) == 0 && (!use_fmt || pCurrent->uFmt == uFmt)) { break; } - + } - + return pCurrent; } @@ -2221,7 +2221,7 @@ WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, static WORD tid = 1; /* FIXME: wrap around */ pXAct = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_XACT)); - if (!pXAct) + if (!pXAct) { pInstance->lastError = DMLERR_MEMORY_ERROR; return NULL; @@ -2250,7 +2250,7 @@ WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) { WDML_XACT** pt; - + /* advance to last in queue */ for (pt = &pConv->transactions; *pt != NULL; pt = &(*pt)->next); *pt = pXAct; @@ -2301,7 +2301,7 @@ void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFre WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid) { WDML_XACT* pXAct; - + tid = HIWORD(tid); for (pXAct = pConv->transactions; pXAct; pXAct = pXAct->next) { diff --git a/dlls/user/dde/server.c b/dlls/user/dde/server.c index 4ce6cc187df..f4e8fc2ed49 100644 --- a/dlls/user/dde/server.c +++ b/dlls/user/dde/server.c @@ -68,16 +68,16 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) UINT count; TRACE("(%ld,0x%x,0x%x)\n", idInst, hszTopic, hszItem); - + EnterCriticalSection(&WDML_CritSect); pInstance = WDML_GetInstance(idInst); - + if (pInstance == NULL || pInstance->links == NULL) { goto theError; } - + atom = WDML_MakeAtomFromHsz(hszItem); if (!atom) goto theError; @@ -102,7 +102,7 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) { hDdeData = WDML_InvokeCallback(pInstance, XTYP_ADVREQ, pLink->uFmt, pLink->hConv, hszTopic, hszItem, 0, count--, 0); - + if (hDdeData == (HDDEDATA)CBR_BLOCK) { /* MS doc is not consistent here */ @@ -119,18 +119,18 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) else { TRACE("with data\n"); - + hItemData = WDML_DataHandle2Global(hDdeData, FALSE, FALSE, FALSE, FALSE); } - + pConv = WDML_GetConv(pLink->hConv, TRUE); - + if (pConv == NULL) { if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData); goto theError; } - + if (!PostMessageA(pConv->hwndClient, WM_DDE_DATA, (WPARAM)pConv->hwndServer, PackDDElParam(WM_DDE_DATA, (UINT)hItemData, atom))) { @@ -139,7 +139,7 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData); GlobalFree(hItemData); goto theError; - } + } if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData); } } @@ -173,13 +173,13 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) HDDEDATA hDdeData; HWND hwndServer; WNDCLASSEXA wndclass; - + hDdeData = (HDDEDATA)NULL; - + TRACE("(%ld,0x%x,0x%x,%d)\n", idInst, hsz1, hsz2, afCmd); - + EnterCriticalSection(&WDML_CritSect); - + /* First check instance */ pInstance = WDML_GetInstance(idInst); @@ -189,7 +189,7 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) /* Nothing has been initialised - exit now ! can return TRUE since effect is the same */ goto theError; } - + if (hsz2 != 0L) { /* Illegal, reserved parameter @@ -207,7 +207,7 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) pInstance->lastError = DMLERR_INVALIDPARAMETER; goto theError; } - + switch (afCmd) { case DNS_REGISTER: @@ -217,17 +217,17 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) ERR("Trying to register already registered service!\n"); pInstance->lastError = DMLERR_DLL_USAGE; goto theError; - } + } TRACE("Adding service name\n"); - + WDML_IncHSZ(pInstance, hsz1); - + pServer = WDML_AddServer(pInstance, hsz1, 0); - - WDML_BroadcastDDEWindows(WDML_szEventClass, WM_WDML_REGISTER, + + WDML_BroadcastDDEWindows(WDML_szEventClass, WM_WDML_REGISTER, pServer->atomService, pServer->atomServiceSpec); - + wndclass.cbSize = sizeof(wndclass); wndclass.style = 0; wndclass.lpfnWndProc = WDML_ServerNameProc; @@ -240,9 +240,9 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) wndclass.lpszMenuName = NULL; wndclass.lpszClassName = szServerNameClassA; wndclass.hIconSm = 0; - + RegisterClassExA(&wndclass); - + LeaveCriticalSection(&WDML_CritSect); hwndServer = CreateWindowA(szServerNameClassA, NULL, WS_POPUP, 0, 0, 0, 0, @@ -252,7 +252,7 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) SetWindowLongA(hwndServer, GWL_WDML_INSTANCE, (DWORD)pInstance); SetWindowLongA(hwndServer, GWL_WDML_SERVER, (DWORD)pServer); TRACE("Created nameServer=%04x for instance=%08lx\n", hwndServer, idInst); - + pServer->hwndServer = hwndServer; break; @@ -260,7 +260,7 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) if (hsz1 == 0L) { /* General unregister situation - * terminate all server side pending conversations + * terminate all server side pending conversations */ while (pInstance->servers) WDML_RemoveServer(pInstance, pInstance->servers->hszService, 0); @@ -283,8 +283,8 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) */ pInstance->lastError = DMLERR_DLL_USAGE; goto theError; - } - else + } + else { pServer->filterOn = (afCmd == DNS_FILTERON); } @@ -303,12 +303,12 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd) * * */ -static WDML_CONV* WDML_CreateServerConv(WDML_INSTANCE* pInstance, HWND hwndClient, +static WDML_CONV* WDML_CreateServerConv(WDML_INSTANCE* pInstance, HWND hwndClient, HWND hwndServerName, HSZ hszApp, HSZ hszTopic) { HWND hwndServerConv; WDML_CONV* pConv; - + if (pInstance->unicode) { WNDCLASSEXW wndclass; @@ -327,7 +327,7 @@ static WDML_CONV* WDML_CreateServerConv(WDML_INSTANCE* pInstance, HWND hwndClien wndclass.hIconSm = 0; RegisterClassExW(&wndclass); - + hwndServerConv = CreateWindowW(WDML_szServerConvClassW, 0, WS_CHILD, 0, 0, 0, 0, hwndServerName, 0, 0, 0); @@ -350,16 +350,16 @@ static WDML_CONV* WDML_CreateServerConv(WDML_INSTANCE* pInstance, HWND hwndClien wndclass.hIconSm = 0; RegisterClassExA(&wndclass); - + hwndServerConv = CreateWindowA(WDML_szServerConvClassA, 0, WS_CHILD, 0, 0, 0, 0, hwndServerName, 0, 0, 0); } - TRACE("Created convServer=%04x (nameServer=%04x) for instance=%08lx\n", + TRACE("Created convServer=%04x (nameServer=%04x) for instance=%08lx\n", hwndServerConv, hwndServerName, pInstance->instanceID); - - pConv = WDML_AddConv(pInstance, WDML_SERVER_SIDE, hszApp, hszTopic, + + pConv = WDML_AddConv(pInstance, WDML_SERVER_SIDE, hszApp, hszTopic, hwndClient, hwndServerConv); if (pConv) { @@ -370,7 +370,7 @@ static WDML_CONV* WDML_CreateServerConv(WDML_INSTANCE* pInstance, HWND hwndClien /* note: sent messages shall not use packing */ SendMessageA(hwndClient, WM_DDE_ACK, (WPARAM)hwndServerConv, MAKELPARAM(WDML_MakeAtomFromHsz(hszApp), WDML_MakeAtomFromHsz(hszTopic))); - /* we assume we're connected since we've sent an answer... + /* we assume we're connected since we've sent an answer... * I'm not sure what we can do... it doesn't look like the return value * of SendMessage is used... sigh... */ @@ -395,28 +395,28 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w HDDEDATA hDdeData = 0; WDML_INSTANCE* pInstance; UINT uiLo, uiHi; - + switch (iMsg) { case WM_DDE_INITIATE: - + /* wParam -- sending window handle LOWORD(lParam) -- application atom HIWORD(lParam) -- topic atom */ - + TRACE("WM_DDE_INITIATE message received!\n"); hwndClient = (HWND)wParam; - + pInstance = WDML_GetInstanceFromWnd(hwndServer); TRACE("idInst=%ld, threadID=0x%lx\n", pInstance->instanceID, GetCurrentThreadId()); if (!pInstance) return 0; /* don't free DDEParams, since this is a broadcast */ - UnpackDDElParam(WM_DDE_INITIATE, lParam, &uiLo, &uiHi); - + UnpackDDElParam(WM_DDE_INITIATE, lParam, &uiLo, &uiHi); + hszApp = WDML_MakeHszFromAtom(pInstance, uiLo); hszTop = WDML_MakeHszFromAtom(pInstance, uiHi); - + if (!(pInstance->CBFflags & CBF_FAIL_CONNECTIONS)) { BOOL self = FALSE; @@ -433,9 +433,9 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w /* FIXME: so far, we don't grab distant convcontext, so only check if remote is * handled under DDEML, and if so build a default context */ - if ((GetClassNameA(hwndClient, buf, sizeof(buf)) && + if ((GetClassNameA(hwndClient, buf, sizeof(buf)) && strcmp(buf, WDML_szClientConvClassA) == 0) || - (GetClassNameW(hwndClient, (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR)) && + (GetClassNameW(hwndClient, (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR)) && lstrcmpW((LPWSTR)buf, WDML_szClientConvClassW) == 0)) { pcc = &cc; @@ -447,10 +447,10 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w { TRACE("Don't do self connection as requested\n"); } - else if (hszApp && hszTop) + else if (hszApp && hszTop) { WDML_SERVER* pServer = (WDML_SERVER*)GetWindowLongA(hwndServer, GWL_WDML_SERVER); - + /* check filters for name service */ if (!pServer->filterOn || DdeCmpStringHandles(pServer->hszService, hszApp) == 0) { @@ -459,7 +459,7 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w 0, 0, hszTop, hszApp, 0, (DWORD)pcc, self); if ((UINT)hDdeData) { - pConv = WDML_CreateServerConv(pInstance, hwndClient, hwndServer, + pConv = WDML_CreateServerConv(pInstance, hwndClient, hwndServer, hszApp, hszTop); if (pConv && pcc) pConv->wStatus |= ST_ISLOCAL; } @@ -479,27 +479,27 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w else if ((UINT)hDdeData != 0) { HSZPAIR* hszp; - + hszp = (HSZPAIR*)DdeAccessData(hDdeData, NULL); if (hszp) { int i; for (i = 0; hszp[i].hszSvc && hszp[i].hszTopic; i++) { - pConv = WDML_CreateServerConv(pInstance, hwndClient, hwndServer, + pConv = WDML_CreateServerConv(pInstance, hwndClient, hwndServer, hszp[i].hszSvc, hszp[i].hszTopic); if (pConv && pcc) pConv->wStatus |= ST_ISLOCAL; - } + } DdeUnaccessData(hDdeData); } if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData); } } } - + return 0; - - + + case WM_DDE_REQUEST: FIXME("WM_DDE_REQUEST message received!\n"); return 0; @@ -520,7 +520,7 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w return 0; } - + return DefWindowProcA(hwndServer, iMsg, wParam, lParam); } @@ -536,7 +536,7 @@ static WDML_XACT* WDML_ServerQueueRequest(WDML_CONV* pConv, LPARAM lParam) UnpackDDElParam(WM_DDE_REQUEST, lParam, &uiLo, &uiHi); - pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_REQUEST, + pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_REQUEST, uiLo, WDML_MakeHszFromAtom(pConv->instance, uiHi)); if (pXAct) pXAct->atom = uiHi; return pXAct; @@ -554,15 +554,15 @@ static WDML_QUEUE_STATE WDML_ServerHandleRequest(WDML_CONV* pConv, WDML_XACT* pX if (!(pConv->instance->CBFflags & CBF_FAIL_REQUESTS)) { - - hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_REQUEST, pXAct->wFmt, (HCONV)pConv, + + hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_REQUEST, pXAct->wFmt, (HCONV)pConv, pConv->hszTopic, pXAct->hszItem, 0, 0, 0); } switch ((DWORD)hDdeData) { case 0: - WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, FALSE, FALSE, pXAct->atom, + WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, FALSE, FALSE, pXAct->atom, pXAct->lParam, WM_DDE_REQUEST); break; case CBR_BLOCK: @@ -572,7 +572,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleRequest(WDML_CONV* pConv, WDML_XACT* pX { HGLOBAL hMem = WDML_DataHandle2Global(hDdeData, FALSE, FALSE, FALSE, FALSE); if (!PostMessageA(pConv->hwndClient, WM_DDE_DATA, (WPARAM)pConv->hwndServer, - ReuseDDElParam(pXAct->lParam, WM_DDE_REQUEST, WM_DDE_DATA, + ReuseDDElParam(pXAct->lParam, WM_DDE_REQUEST, WM_DDE_DATA, (UINT)hMem, (UINT)pXAct->atom))) { DdeFreeDataHandle(hDdeData); @@ -595,13 +595,13 @@ static WDML_XACT* WDML_ServerQueueAdvise(WDML_CONV* pConv, LPARAM lParam) UINT uiLo, uiHi; WDML_XACT* pXAct; - /* XTYP_ADVSTART transaction: + /* XTYP_ADVSTART transaction: establish link and save link info to InstanceInfoTable */ - + if (!UnpackDDElParam(WM_DDE_ADVISE, lParam, &uiLo, &uiHi)) return NULL; - - pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_ADVISE, + + pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_ADVISE, 0, WDML_MakeHszFromAtom(pConv->instance, uiHi)); if (pXAct) { @@ -625,13 +625,13 @@ static WDML_QUEUE_STATE WDML_ServerHandleAdvise(WDML_CONV* pConv, WDML_XACT* pXA BOOL fAck; pDdeAdvise = (DDEADVISE*)GlobalLock(pXAct->hMem); - uType = XTYP_ADVSTART | + uType = XTYP_ADVSTART | (pDdeAdvise->fDeferUpd ? XTYPF_NODATA : 0) | (pDdeAdvise->fAckReq ? XTYPF_ACKREQ : 0); - + if (!(pConv->instance->CBFflags & CBF_FAIL_ADVISES)) { - hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_ADVSTART, pDdeAdvise->cfFormat, + hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_ADVSTART, pDdeAdvise->cfFormat, (HCONV)pConv, pConv->hszTopic, pXAct->hszItem, 0, 0, 0); } else @@ -642,9 +642,9 @@ static WDML_QUEUE_STATE WDML_ServerHandleAdvise(WDML_CONV* pConv, WDML_XACT* pXA if ((UINT)hDdeData) { fAck = TRUE; - + /* billx: first to see if the link is already created. */ - pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE, + pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE, pXAct->hszItem, TRUE, pDdeAdvise->cfFormat); if (pLink != NULL) @@ -655,7 +655,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleAdvise(WDML_CONV* pConv, WDML_XACT* pXA else { TRACE("Adding Link with hConv=0x%lx\n", (DWORD)pConv); - WDML_AddLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE, + WDML_AddLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE, uType, pXAct->hszItem, pDdeAdvise->cfFormat); } } @@ -664,7 +664,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleAdvise(WDML_CONV* pConv, WDML_XACT* pXA TRACE("No data returned from the Callback\n"); fAck = FALSE; } - + GlobalUnlock(pXAct->hMem); if (fAck) { @@ -690,8 +690,8 @@ static WDML_XACT* WDML_ServerQueueUnadvise(WDML_CONV* pConv, LPARAM lParam) WDML_XACT* pXAct; UnpackDDElParam(WM_DDE_UNADVISE, lParam, &uiLo, &uiHi); - - pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_UNADVISE, + + pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_UNADVISE, uiLo, WDML_MakeHszFromAtom(pConv->instance, uiHi)); if (pXAct) pXAct->atom = uiHi; return pXAct; @@ -712,7 +712,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleUnadvise(WDML_CONV* pConv, WDML_XACT* p return WDML_QS_ERROR; } - pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE, + pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE, pXAct->hszItem, TRUE, pXAct->wFmt); if (pLink == NULL) { @@ -723,17 +723,17 @@ static WDML_QUEUE_STATE WDML_ServerHandleUnadvise(WDML_CONV* pConv, WDML_XACT* p if (!(pConv->instance->CBFflags & CBF_FAIL_ADVISES)) { - WDML_InvokeCallback(pConv->instance, XTYP_ADVSTOP, pXAct->wFmt, (HCONV)pConv, + WDML_InvokeCallback(pConv->instance, XTYP_ADVSTOP, pXAct->wFmt, (HCONV)pConv, pConv->hszTopic, pXAct->hszItem, 0, 0, 0); } - - WDML_RemoveLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE, + + WDML_RemoveLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE, pXAct->hszItem, pXAct->wFmt); - + /* send back ack */ - WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, FALSE, TRUE, pXAct->atom, + WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, FALSE, TRUE, pXAct->atom, pXAct->lParam, WM_DDE_UNADVISE); - + WDML_DecHSZ(pConv->instance, pXAct->hszItem); return WDML_QS_HANDLED; @@ -753,7 +753,7 @@ static WDML_XACT* WDML_ServerQueueExecute(WDML_CONV* pConv, LPARAM lParam) { pXAct->hMem = (HGLOBAL)lParam; } - return pXAct; + return pXAct; } /****************************************************************** @@ -769,33 +769,33 @@ static WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pX if (!(pConv->instance->CBFflags & CBF_FAIL_EXECUTES)) { LPVOID ptr = GlobalLock(pXAct->hMem); - + if (ptr) { hDdeData = DdeCreateDataHandle(0, ptr, GlobalSize(pXAct->hMem), 0, 0, CF_TEXT, 0); GlobalUnlock(pXAct->hMem); - } - hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_EXECUTE, 0, (HCONV)pConv, + } + hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_EXECUTE, 0, (HCONV)pConv, pConv->hszTopic, 0, hDdeData, 0L, 0L); } - + switch ((UINT)hDdeData) { - case DDE_FACK: - fAck = TRUE; + case DDE_FACK: + fAck = TRUE; break; - case DDE_FBUSY: - fBusy = TRUE; + case DDE_FBUSY: + fBusy = TRUE; break; - default: + default: WARN("Bad result code\n"); /* fall through */ - case DDE_FNOTPROCESSED: + case DDE_FNOTPROCESSED: break; - } + } WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, pXAct->hMem, 0, 0); - + return WDML_QS_HANDLED; } @@ -811,7 +811,7 @@ static WDML_XACT* WDML_ServerQueuePoke(WDML_CONV* pConv, LPARAM lParam) UnpackDDElParam(WM_DDE_POKE, lParam, &uiLo, &uiHi); - pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_POKE, + pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_POKE, 0, WDML_MakeHszFromAtom(pConv->instance, uiHi)); if (pXAct) { @@ -840,20 +840,20 @@ static WDML_QUEUE_STATE WDML_ServerHandlePoke(WDML_CONV* pConv, WDML_XACT* pXAct if (!(pConv->instance->CBFflags & CBF_FAIL_POKES)) { - hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, pDdePoke->Value, - GlobalSize(pXAct->hMem) - sizeof(DDEPOKE) + 1, + hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, pDdePoke->Value, + GlobalSize(pXAct->hMem) - sizeof(DDEPOKE) + 1, 0, 0, pDdePoke->cfFormat, 0); - if (hDdeData) + if (hDdeData) { HDDEDATA hDdeDataOut; - - hDdeDataOut = WDML_InvokeCallback(pConv->instance, XTYP_POKE, pDdePoke->cfFormat, - (HCONV)pConv, pConv->hszTopic, pXAct->hszItem, + + hDdeDataOut = WDML_InvokeCallback(pConv->instance, XTYP_POKE, pDdePoke->cfFormat, + (HCONV)pConv, pConv->hszTopic, pXAct->hszItem, hDdeData, 0, 0); - switch ((UINT)hDdeDataOut) + switch ((UINT)hDdeDataOut) { case DDE_FACK: - fAck = TRUE; + fAck = TRUE; break; case DDE_FBUSY: fBusy = TRUE; @@ -861,14 +861,14 @@ static WDML_QUEUE_STATE WDML_ServerHandlePoke(WDML_CONV* pConv, WDML_XACT* pXAct default: FIXME("Unsupported returned value %08lx\n", (DWORD)hDdeDataOut); /* fal through */ - case DDE_FNOTPROCESSED: + case DDE_FNOTPROCESSED: break; } DdeFreeDataHandle(hDdeData); } } GlobalUnlock(pXAct->hMem); - + if (!fAck) { GlobalFree(pXAct->hMem); @@ -905,12 +905,12 @@ static WDML_QUEUE_STATE WDML_ServerHandleTerminate(WDML_CONV* pConv, WDML_XACT* */ if (!(pConv->instance->CBFflags & CBF_SKIP_DISCONNECTS)) { - WDML_InvokeCallback(pConv->instance, XTYP_DISCONNECT, 0, (HCONV)pConv, 0, 0, + WDML_InvokeCallback(pConv->instance, XTYP_DISCONNECT, 0, (HCONV)pConv, 0, 0, 0, 0, (pConv->wStatus & ST_ISSELF) ? 1 : 0); } PostMessageA(pConv->hwndClient, WM_DDE_TERMINATE, (WPARAM)pConv->hwndServer, 0); WDML_RemoveConv(pConv, WDML_SERVER_SIDE); - + return WDML_QS_HANDLED; } @@ -931,23 +931,23 @@ static WDML_QUEUE_STATE WDML_ServerHandle(WDML_CONV* pConv, WDML_XACT* pXAct) case WM_DDE_REQUEST: qs = WDML_ServerHandleRequest(pConv, pXAct); break; - + case WM_DDE_ADVISE: qs = WDML_ServerHandleAdvise(pConv, pXAct); break; - + case WM_DDE_UNADVISE: qs = WDML_ServerHandleUnadvise(pConv, pXAct); break; - + case WM_DDE_EXECUTE: qs = WDML_ServerHandleExecute(pConv, pXAct); break; - + case WM_DDE_POKE: qs = WDML_ServerHandlePoke(pConv, pXAct); break; - + case WM_DDE_TERMINATE: qs = WDML_ServerHandleTerminate(pConv, pXAct); break; @@ -993,7 +993,7 @@ static LRESULT CALLBACK WDML_ServerConvProc(HWND hwndServer, UINT iMsg, WPARAM w pInstance = WDML_GetInstanceFromWnd(hwndServer); pConv = WDML_GetConvFromWnd(hwndServer); - if (!pConv) + if (!pConv) { ERR("Got a message (%u) on a not known conversation, dropping request\n", iMsg); goto theError; @@ -1014,27 +1014,27 @@ static LRESULT CALLBACK WDML_ServerConvProc(HWND hwndServer, UINT iMsg, WPARAM w case WM_DDE_INITIATE: FIXME("WM_DDE_INITIATE message received!\n"); break; - + case WM_DDE_REQUEST: pXAct = WDML_ServerQueueRequest(pConv, lParam); break; - + case WM_DDE_ADVISE: pXAct = WDML_ServerQueueAdvise(pConv, lParam); break; - + case WM_DDE_UNADVISE: pXAct = WDML_ServerQueueUnadvise(pConv, lParam); break; - + case WM_DDE_EXECUTE: pXAct = WDML_ServerQueueExecute(pConv, lParam); break; - + case WM_DDE_POKE: pXAct = WDML_ServerQueuePoke(pConv, lParam); break; - + case WM_DDE_TERMINATE: pXAct = WDML_ServerQueueTerminate(pConv, lParam); break; @@ -1046,8 +1046,8 @@ static LRESULT CALLBACK WDML_ServerConvProc(HWND hwndServer, UINT iMsg, WPARAM w default: FIXME("Unsupported message %d\n", iMsg); } - - if (pXAct) + + if (pXAct) { pXAct->lParam = lParam; if (WDML_ServerHandle(pConv, pXAct) == WDML_QS_BLOCK) diff --git a/dlls/user/display.c b/dlls/user/display.c index 98b8c01a459..871885c4fe5 100644 --- a/dlls/user/display.c +++ b/dlls/user/display.c @@ -36,7 +36,7 @@ typedef struct tagCURSORINFO /*********************************************************************** * Inquire (DISPLAY.101) */ -WORD WINAPI DISPLAY_Inquire(LPCURSORINFO lpCursorInfo) +WORD WINAPI DISPLAY_Inquire(LPCURSORINFO lpCursorInfo) { lpCursorInfo->wXMickeys = 1; lpCursorInfo->wYMickeys = 1; diff --git a/dlls/user/exticon.c b/dlls/user/exticon.c index c703190b75c..8200c0d85af 100644 --- a/dlls/user/exticon.c +++ b/dlls/user/exticon.c @@ -3,7 +3,7 @@ * * taken and slightly changed from shell * this should replace the icon extraction code in shell32 and shell16 once - * it needs a serious test for compliance with the native API + * it needs a serious test for compliance with the native API * * Copyright 2000 Juergen Schmied * @@ -66,14 +66,14 @@ typedef struct #if 0 static void dumpIcoDirEnty ( LPicoICONDIRENTRY entry ) -{ +{ TRACE("width = 0x%08x height = 0x%08x\n", entry->bWidth, entry->bHeight); TRACE("colors = 0x%08x planes = 0x%08x\n", entry->bColorCount, entry->wPlanes); - TRACE("bitcount = 0x%08x bytesinres = 0x%08lx offset = 0x%08lx\n", + TRACE("bitcount = 0x%08x bytesinres = 0x%08lx offset = 0x%08lx\n", entry->wBitCount, entry->dwBytesInRes, entry->dwImageOffset); } static void dumpIcoDir ( LPicoICONDIR entry ) -{ +{ TRACE("type = 0x%08x count = 0x%08x\n", entry->idType, entry->idCount); } #endif @@ -125,12 +125,12 @@ static DWORD USER32_GetResourceTable(LPBYTE peimage,DWORD pesize,LPBYTE *retptr) { IMAGE_DOS_HEADER * mz_header; - TRACE("%p %p\n", peimage, retptr); + TRACE("%p %p\n", peimage, retptr); *retptr = NULL; mz_header = (IMAGE_DOS_HEADER*) peimage; - + if (mz_header->e_magic != IMAGE_DOS_SIGNATURE) { if (mz_header->e_cblp == 1) /* .ICO file ? */ @@ -152,7 +152,7 @@ static DWORD USER32_GetResourceTable(LPBYTE peimage,DWORD pesize,LPBYTE *retptr) IMAGE_OS2_HEADER * ne_header; ne_header = (IMAGE_OS2_HEADER*)(peimage + mz_header->e_lfanew); - + if (ne_header->ne_magic != IMAGE_OS2_SIGNATURE) return 0; @@ -196,14 +196,14 @@ static BYTE * ICO_LoadIcon( LPBYTE peimage, LPicoICONDIRENTRY lpiIDE, ULONG *uSi #define HEADER_SIZE (sizeof(CURSORICONDIR) - sizeof (CURSORICONDIRENTRY)) #define HEADER_SIZE_FILE (sizeof(icoICONDIR) - sizeof (icoICONDIRENTRY)) -static BYTE * ICO_GetIconDirectory( LPBYTE peimage, LPicoICONDIR* lplpiID, ULONG *uSize ) +static BYTE * ICO_GetIconDirectory( LPBYTE peimage, LPicoICONDIR* lplpiID, ULONG *uSize ) { CURSORICONDIR * lpcid; /* icon resource in resource-dir format */ CURSORICONDIR * lpID; /* icon resource in resource format */ int i; - TRACE("%p %p\n", peimage, lplpiID); - + TRACE("%p %p\n", peimage, lplpiID); + lpcid = (CURSORICONDIR*)peimage; if( lpcid->idReserved || (lpcid->idType != 1) || (!lpcid->idCount) ) @@ -257,7 +257,7 @@ static HRESULT ICO_ExtractIconExW( HANDLE fmapping; ULONG uSize; DWORD fsizeh,fsizel; - + TRACE("(file %s,start %d,extract %d\n", debugstr_w(lpszExeFileName), nIconIndex, nIcons); hFile = CreateFileW( lpszExeFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); @@ -273,7 +273,7 @@ static HRESULT ICO_ExtractIconExW( return hRet; } - if ( !(peimage = MapViewOfFile(fmapping,FILE_MAP_READ,0,0,0))) + if ( !(peimage = MapViewOfFile(fmapping,FILE_MAP_READ,0,0,0))) { WARN("MapViewOfFile error %ld\n", GetLastError() ); CloseHandle( fmapping ); @@ -312,7 +312,7 @@ static HRESULT ICO_ExtractIconExW( pIconDir = ((NE_NAMEINFO*)(pTInfo + 1)); TRACE("\tfound directory - %i icon families\n", iconDirCount); } - if( pTInfo->type_id == NE_RSCTYPE_ICON ) + if( pTInfo->type_id == NE_RSCTYPE_ICON ) { iconCount = pTInfo->count; pIconStorage = ((NE_NAMEINFO*)(pTInfo + 1)); @@ -330,10 +330,10 @@ static HRESULT ICO_ExtractIconExW( else if( nIconIndex < iconDirCount ) { UINT16 i, icon; - if( nIcons > iconDirCount - nIconIndex ) + if( nIcons > iconDirCount - nIconIndex ) nIcons = iconDirCount - nIconIndex; - for( i = nIconIndex; i < nIconIndex + nIcons; i++ ) + for( i = nIconIndex; i < nIconIndex + nIcons; i++ ) { /* .ICO files have only one icon directory */ if( lpiID == NULL ) /* *.ico */ @@ -359,7 +359,7 @@ static HRESULT ICO_ExtractIconExW( hRet = S_OK; } } - } + } /* end ico file */ /* exe/dll */ @@ -373,14 +373,14 @@ static HRESULT ICO_ExtractIconExW( const IMAGE_RESOURCE_DATA_ENTRY *idataent,*igdataent; const IMAGE_RESOURCE_DIRECTORY_ENTRY *xresent; int i,j; - + dheader = (PIMAGE_DOS_HEADER)peimage; pe_header = (PIMAGE_NT_HEADERS)(peimage+dheader->e_lfanew); /* it is a pe header, USER32_GetResourceTable checked that */ pe_sections = (PIMAGE_SECTION_HEADER)(((char*)pe_header)+sizeof(*pe_header)); /* probably makes problems with short PE headers...*/ rootresdir = NULL; /* search for the root resource directory */ - for (i=0;iFileHeader.NumberOfSections;i++) + for (i=0;iFileHeader.NumberOfSections;i++) { if (pe_sections[i].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA) continue; @@ -393,21 +393,21 @@ static HRESULT ICO_ExtractIconExW( goto end; } /* FIXME: doesn't work when the resources are not in a separate section */ - if (pe_sections[i].VirtualAddress == pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress) + if (pe_sections[i].VirtualAddress == pe_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress) { rootresdir = (PIMAGE_RESOURCE_DIRECTORY)(peimage+pe_sections[i].PointerToRawData); break; } } - if (!rootresdir) + if (!rootresdir) { WARN("haven't found section for resource directory.\n"); goto end; /* failure */ } /* search for the group icon directory */ - if (!(icongroupresdir = find_entry_by_id(rootresdir, LOWORD(RT_GROUP_ICONW), rootresdir))) + if (!(icongroupresdir = find_entry_by_id(rootresdir, LOWORD(RT_GROUP_ICONW), rootresdir))) { WARN("No Icongroupresourcedirectory!\n"); goto end; /* failure */ @@ -429,14 +429,14 @@ static HRESULT ICO_ExtractIconExW( PIMAGE_RESOURCE_DIRECTORY_ENTRY xprdeTmp = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)(icongroupresdir+1); while(nu1.s2.Id == iId) { nIconIndex = n; break; } n++; - xprdeTmp++; + xprdeTmp++; } if (nIconIndex < 0) { @@ -447,7 +447,7 @@ static HRESULT ICO_ExtractIconExW( else { /* check nIconIndex to be in range */ - if (nIconIndex >= iconDirCount) + if (nIconIndex >= iconDirCount) { WARN("nIconIndex %d is larger than iconDirCount %d\n",nIconIndex,iconDirCount); goto end; /* failure */ @@ -461,7 +461,7 @@ static HRESULT ICO_ExtractIconExW( /* starting from specified index */ xresent = (PIMAGE_RESOURCE_DIRECTORY_ENTRY)(icongroupresdir+1) + nIconIndex; - for (i=0; i < nIcons; i++,xresent++) + for (i=0; i < nIcons; i++,xresent++) { const IMAGE_RESOURCE_DIRECTORY *resdir; @@ -475,7 +475,7 @@ static HRESULT ICO_ExtractIconExW( /* lookup address in mapped image for virtual address */ igdata = NULL; - for (j=0;jFileHeader.NumberOfSections;j++) + for (j=0;jFileHeader.NumberOfSections;j++) { if (igdataent->OffsetToData < pe_sections[j].VirtualAddress) continue; @@ -489,7 +489,7 @@ static HRESULT ICO_ExtractIconExW( igdata = peimage+(igdataent->OffsetToData-pe_sections[j].VirtualAddress+pe_sections[j].PointerToRawData); } - if (!igdata) + if (!igdata) { FIXME("no matching real address for icongroup!\n"); goto end; /* failure */ @@ -503,7 +503,7 @@ static HRESULT ICO_ExtractIconExW( goto end; /* failure */ } - for (i=0; iFileHeader.NumberOfSections;j++) + for (j=0;jFileHeader.NumberOfSections;j++) { if (idataent->OffsetToData < pe_sections[j].VirtualAddress) continue; @@ -520,7 +520,7 @@ static HRESULT ICO_ExtractIconExW( continue; idata = peimage+(idataent->OffsetToData-pe_sections[j].VirtualAddress+pe_sections[j].PointerToRawData); } - if (!idata) + if (!idata) { WARN("no matching real address found for icondata!\n"); RetPtr[i]=0; @@ -539,7 +539,7 @@ end: UnmapViewOfFile(peimage); /* success */ * PrivateExtractIconsW [USER32.@] * * NOTES - * nIndex = 1: a small and a large icon are extracted. + * nIndex = 1: a small and a large icon are extracted. * the higher word of sizeXY contains the size of the small icon, the lower * word the size of the big icon. phicon points to HICON[2]. * @@ -548,7 +548,7 @@ end: UnmapViewOfFile(peimage); /* success */ * nIcons = 0: the number of icons */ -HRESULT WINAPI PrivateExtractIconsW ( +HRESULT WINAPI PrivateExtractIconsW ( LPCWSTR lpwstrFile, int nIndex, DWORD sizeX, @@ -576,7 +576,7 @@ HRESULT WINAPI PrivateExtractIconsW ( * PrivateExtractIconsA [USER32.@] */ -HRESULT WINAPI PrivateExtractIconsA ( +HRESULT WINAPI PrivateExtractIconsA ( LPCSTR lpstrFile, INT nIndex, DWORD sizeX, @@ -616,7 +616,7 @@ HRESULT WINAPI PrivateExtractIconExW ( TRACE("%s 0x%08lx %p %p 0x%08x\n", debugstr_w(lpwstrFile),nIndex,phIconLarge, phIconSmall, nIcons); - + if (nIndex == 1 && phIconSmall && phIconLarge) { HICON hIcon[2]; @@ -624,7 +624,7 @@ HRESULT WINAPI PrivateExtractIconExW ( cyicon = GetSystemMetrics(SM_CYICON); cxsmicon = GetSystemMetrics(SM_CXSMICON); cysmicon = GetSystemMetrics(SM_CYSMICON); - + ret = PrivateExtractIconsW ( lpwstrFile, nIndex, cxicon | (cxsmicon<<16), cyicon | (cysmicon<<16), (HICON*) &hIcon, 0, 2, 0 ); *phIconLarge = hIcon[0]; diff --git a/dlls/user/lstr.c b/dlls/user/lstr.c index 5d45dba034c..a7f0515b6c6 100644 --- a/dlls/user/lstr.c +++ b/dlls/user/lstr.c @@ -612,7 +612,7 @@ DWORD WINAPI FormatMessage16( &&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) || (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0; - if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK) + if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK) FIXME("line wrapping (%lu) not supported.\n", width); from = NULL; if (dwFlags & FORMAT_MESSAGE_FROM_STRING) @@ -702,9 +702,9 @@ DWORD WINAPI FormatMessage16( int ret; int sz; LPSTR b = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sz = 100); - + argliststart=args+insertnr-1; - + /* CMF - This makes a BIG assumption about va_list */ while ((ret = vsnprintf(b, sz, fmtstr, (va_list) argliststart) < 0) || (ret >= sz)) { sz = (ret == -1 ? sz + 100 : ret + 1); @@ -712,7 +712,7 @@ DWORD WINAPI FormatMessage16( } for (x=b; *x; x++) ADD_TO_T(*x); } else { - /* NULL args - copy formatstr + /* NULL args - copy formatstr * (probably wrong) */ while ((lastfmsg != WM_DDE_DATA) return FALSE; - + lp = uiHi; if (uiLo) { @@ -1237,7 +1237,7 @@ static BOOL post_dde_message( DWORD dest_tid, struct packed_message *data, const req->lparam = lp; req->time = GetCurrentTime(); req->timeout = -1; - for (i = 0; i < data->count; i++) + for (i = 0; i < data->count; i++) wine_server_add_data( req, data->data[i], data->size[i] ); if ((res = wine_server_call( req ))) { @@ -1246,8 +1246,8 @@ static BOOL post_dde_message( DWORD dest_tid, struct packed_message *data, const SetLastError( ERROR_INVALID_THREAD_ID ); else SetLastError( RtlNtStatusToDosError(res) ); - } - else + } + else FreeDDElParam(info->msg, info->lparam); } SERVER_END_REQ; @@ -1319,7 +1319,7 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM memcpy( ptr, *buffer, size ); GlobalUnlock( hMem ); TRACE( "exec: pairing c=%08lx s=%08lx\n", *lparam, (DWORD)hMem ); - if (!dde_add_pair( *lparam, hMem )) + if (!dde_add_pair( *lparam, hMem )) { GlobalFree( hMem ); return FALSE; @@ -1494,7 +1494,7 @@ BOOL MSG_peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, int flags ) &info.msg.lParam, &buffer, size )) { ERR( "invalid packed dde-message %x (%s) hwnd %x wp %x lp %lx size %d\n", - info.msg.message, SPY_GetMsgName(info.msg.message, info.msg.hwnd), + info.msg.message, SPY_GetMsgName(info.msg.message, info.msg.hwnd), info.msg.hwnd, info.msg.wParam, info.msg.lParam, size ); /* ignore it */ continue; diff --git a/dlls/user/misc.c b/dlls/user/misc.c index 84d8f41b573..f9e15f7a4f6 100644 --- a/dlls/user/misc.c +++ b/dlls/user/misc.c @@ -161,7 +161,7 @@ BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout ) * * Not supported on Win9x - returns NULL and calls SetLastError. */ -HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags, +HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags, BOOL fInherit, DWORD dwDesiredAccess ) { FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags, @@ -175,7 +175,7 @@ HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags, /****************************************************************************** * SetUserObjectInformationA (USER32.@) */ -BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex, +BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex, LPVOID pvInfo, DWORD nLength ) { FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength); @@ -209,7 +209,7 @@ HRESULT WINAPI DeregisterShellHookWindow ( DWORD u ) { FIXME("0x%08lx stub\n",u); return 0; - + } diff --git a/dlls/user/mouse.c b/dlls/user/mouse.c index ff820614996..7d5b3c5e509 100644 --- a/dlls/user/mouse.c +++ b/dlls/user/mouse.c @@ -1,8 +1,8 @@ /* * MOUSE driver - * + * * Copyright 1998 Ulrich Weigand - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either diff --git a/dlls/user/network.c b/dlls/user/network.c index 11c8502203d..adf55a63772 100644 --- a/dlls/user/network.c +++ b/dlls/user/network.c @@ -31,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wnet); /* - * Remote printing + * Remote printing */ /************************************************************************** @@ -112,7 +112,7 @@ WORD WINAPI WNetSetJobCopies16( LPSTR szQueue, WORD wJobId, WORD nCopies ) */ WORD WINAPI WNetWatchQueue16( HWND16 hWnd, LPSTR szLocal, LPSTR szUser, WORD nQueue ) { - FIXME( "(%04x, %s, %s, %d): stub\n", + FIXME( "(%04x, %s, %s, %d): stub\n", hWnd, debugstr_a(szLocal), debugstr_a(szUser), nQueue ); return WN16_NET_ERROR; } @@ -129,10 +129,10 @@ WORD WINAPI WNetUnwatchQueue16( LPSTR szQueue ) /************************************************************************** * WNetLockQueueData [USER.510] */ -WORD WINAPI WNetLockQueueData16( LPSTR szQueue, LPSTR szUser, +WORD WINAPI WNetLockQueueData16( LPSTR szQueue, LPSTR szUser, LPQUEUESTRUCT16 *lplpQueueStruct ) { - FIXME( "(%s, %s, %p): stub\n", + FIXME( "(%s, %s, %p): stub\n", debugstr_a(szQueue), debugstr_a(szUser), lplpQueueStruct ); return WN16_NET_ERROR; } @@ -153,14 +153,14 @@ WORD WINAPI WNetUnlockQueueData16( LPSTR szQueue ) /******************************************************************** * WNetAddConnection [USER.517] Directs a local device to net - * + * * Redirects a local device (either a disk drive or printer port) * to a shared device on a remote server. */ WORD WINAPI WNetAddConnection16( LPSTR lpNetPath, LPSTR lpPassWord, LPSTR lpLocalName ) -{ - FIXME( "(%s, %p, %s): stub\n", +{ + FIXME( "(%s, %p, %s): stub\n", debugstr_a(lpNetPath), lpPassWord, debugstr_a(lpLocalName) ); return WN16_NET_ERROR; } @@ -177,7 +177,7 @@ WORD WINAPI WNetCancelConnection16( LPSTR lpName, BOOL16 bForce ) /******************************************************************** * WNetGetConnection [USER.512] reverse-resolves a local device */ -WORD WINAPI WNetGetConnection16( LPSTR lpLocalName, +WORD WINAPI WNetGetConnection16( LPSTR lpLocalName, LPSTR lpRemoteName, UINT16 *cbRemoteName ) { char label[32]; @@ -224,13 +224,13 @@ WORD WINAPI WNetRestoreConnection16( HWND16 hwndOwner, LPSTR lpszDevice ) */ WORD WINAPI WNetGetCaps16( WORD capability ) { - switch (capability) + switch (capability) { case WNNC16_SPEC_VERSION: return 0x30a; /* WfW 3.11 (and apparently other 3.1x) */ case WNNC16_NET_TYPE: - /* hi byte = network type, + /* hi byte = network type, lo byte = network vendor (Netware = 0x03) [15 types] */ return WNNC16_NET_MultiNet | WNNC16_SUBNET_WinWorkgroups; @@ -278,7 +278,7 @@ WORD WINAPI WNetGetCaps16( WORD capability ) return WNNC16_ERR_GetError | WNNC16_ERR_GetErrorText; case WNNC16_PRINTMGREXT: - /* returns the Print Manager version in major and + /* returns the Print Manager version in major and minor format if Print Manager functions are available */ return 0x30e; /* printman version of WfW 3.11 */ @@ -409,7 +409,7 @@ WORD WINAPI WNetGetDirectoryType16( LPSTR lpName, LPINT16 lpType ) *lpType = (type == DRIVE_REMOTE)? WNDT_NETWORK : WNDT_NORMAL; - TRACE( "%s is %s\n", debugstr_a(lpName), + TRACE( "%s is %s\n", debugstr_a(lpName), (*lpType == WNDT_NETWORK)? "WNDT_NETWORK" : "WNDT_NORMAL" ); return WN16_SUCCESS; } diff --git a/dlls/user/resource.c b/dlls/user/resource.c index 183d9c02927..37998e55ed0 100644 --- a/dlls/user/resource.c +++ b/dlls/user/resource.c @@ -64,7 +64,7 @@ HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, LPCSTR lpTableName) * 00: BYTE type type of accelerator * 01: BYTE pad (to WORD boundary) * 02: WORD event - * 04: WORD IDval + * 04: WORD IDval * 06: WORD pad (to DWORD boundary) */ HACCEL WINAPI LoadAcceleratorsW(HINSTANCE instance,LPCWSTR lpTableName) @@ -237,14 +237,14 @@ HACCEL WINAPI CreateAcceleratorTableA(LPACCEL lpaccel, INT cEntries) /********************************************************************* * CreateAcceleratorTableW (USER32.@) * - * + * */ HACCEL WINAPI CreateAcceleratorTableW(LPACCEL lpaccel, INT cEntries) { HACCEL hAccel; LPACCEL16 accel; int i; - char ckey; + char ckey; /* Do parameter checking just in case someone's trying to be funny. */ @@ -277,8 +277,8 @@ HACCEL WINAPI CreateAcceleratorTableW(LPACCEL lpaccel, INT cEntries) if(!MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, &ckey, 1, &accel[i].key, 1)) WARN_(accel)("Error converting ASCII accelerator table to Unicode"); } - else - accel[i].key = lpaccel[i].key; + else + accel[i].key = lpaccel[i].key; accel[i].cmd = lpaccel[i].cmd; } @@ -303,9 +303,9 @@ HACCEL WINAPI CreateAcceleratorTableW(LPACCEL lpaccel, INT cEntries) */ BOOL WINAPI DestroyAcceleratorTable( HACCEL handle ) { - return !GlobalFree16(handle); + return !GlobalFree16(handle); } - + /********************************************************************** * LoadString (USER.176) */ @@ -325,14 +325,14 @@ INT16 WINAPI LoadString16( HINSTANCE16 instance, UINT16 resource_id, if (!hrsrc) return 0; hmem = LoadResource16( instance, hrsrc ); if (!hmem) return 0; - + p = LockResource16(hmem); string_num = resource_id & 0x000f; for (i = 0; i < string_num; i++) p += *p + 1; - + TRACE("strlen = %d\n", (int)*p ); - + if (buffer == NULL) return *p; i = min(buflen - 1, *p); if (i > 0) { @@ -368,21 +368,21 @@ INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id, TRACE("instance = %04x, id = %04x, buffer = %08x, length = %d\n", instance, (int)resource_id, (int) buffer, buflen); - /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out + /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out * 20 - 31. */ hrsrc = FindResourceW( instance, (LPCWSTR)(((resource_id>>4)&0xffff)+1), RT_STRINGW ); if (!hrsrc) return 0; hmem = LoadResource( instance, hrsrc ); if (!hmem) return 0; - + p = LockResource(hmem); string_num = resource_id & 0x000f; for (i = 0; i < string_num; i++) p += *p + 1; - + TRACE("strlen = %d\n", (int)*p ); - + if (buffer == NULL) return *p; i = min(buflen - 1, *p); if (i > 0) { @@ -416,7 +416,7 @@ INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id, if(buffer == NULL) /* asked size of string */ return LoadStringW(instance, resource_id, NULL, 0); - + wbuf = HeapAlloc(GetProcessHeap(), 0, buflen * sizeof(WCHAR)); if(!wbuf) return 0; diff --git a/dlls/user/tests/sysparams.c b/dlls/user/tests/sysparams.c index 0cbb33f629c..34d17afed17 100644 --- a/dlls/user/tests/sysparams.c +++ b/dlls/user/tests/sysparams.c @@ -360,7 +360,7 @@ static void test_SPI_SETBORDER( void ) /* 6 */ eq( frame, GetSystemMetrics( SM_CYSIZEFRAME ), "SM_CYSIZEFRAME", "%d" ) /* These tests hang when XFree86 4.0 for Windows is running (tested on - * WinNT, SP2, Cygwin/XFree 4.1.0. Skip the test when XFree86 is + * WinNT, SP2, Cygwin/XFree 4.1.0. Skip the test when XFree86 is * running. */ if (!FindWindowA( NULL, "Cygwin/XFree86" )) @@ -620,8 +620,8 @@ static void test_SPI_SETICONTITLEWRAP( void ) /* 26 */ BOOL b; BOOL curr_val; - /* These tests hang when XFree86 4.0 for Windows is running (tested on - * WinNT, SP2, Cygwin/XFree 4.1.0. Skip the test when XFree86 is + /* These tests hang when XFree86 4.0 for Windows is running (tested on + * WinNT, SP2, Cygwin/XFree 4.1.0. Skip the test when XFree86 is * running. */ if (!FindWindowA( NULL, "Cygwin/XFree86" )) @@ -835,7 +835,7 @@ static void test_SPI_SETMOUSEBUTTONSWAP( void ) /* 33 */ static void test_SPI_SETFASTTASKSWITCH( void ) /* 36 */ { - /* Temporarily commented out. + /* Temporarily commented out. BOOL old_b; BOOL b; BOOL res; @@ -857,7 +857,7 @@ static void test_SPI_SETFASTTASKSWITCH( void ) /* 36 */ ok( !res, "Must not set" ); SystemParametersInfoA( SPI_GETFASTTASKSWITCH, 0, &b, 0 ); - + ok( b, "retrieved value is the same as set" ); SystemParametersInfoA( SPI_SETFASTTASKSWITCH, old_b, 0, diff --git a/dlls/user/text.c b/dlls/user/text.c index 0bae1810ccd..886c37403b9 100644 --- a/dlls/user/text.c +++ b/dlls/user/text.c @@ -4,7 +4,7 @@ * Copyright 1993, 1994 Alexandre Julliard * Copyright 2002 Bill Medland * - * Contains + * Contains * 1. DrawText functions * 2. GrayString functions * 3. TabbedText functions @@ -60,13 +60,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(text); * a. If the buffered text to be displayed includes the ampersands then * we will need special measurement and draw functions that will ignore * the ampersands (e.g. by copying to a buffer without the prefix and - * then using the normal forms). This may involve less space but may + * then using the normal forms). This may involve less space but may * require more processing. e.g. since a line containing tabs may * contain several underlined characters either we need to carry around * a list of prefix locations or we may need to locate them several * times. * b. If we actually directly modify the "original text" as we go then we - * will need some special "caching" to handle the fact that when we + * will need some special "caching" to handle the fact that when we * ellipsify the text the ellipsis may modify the next line of text, * which we have not yet processed. (e.g. ellipsification of a W at the * end of a line will overwrite the W, the \n and the first character of @@ -117,7 +117,7 @@ typedef struct tag_ellipsis_data * width [in] The maximum width permitted (in logical coordinates) * size [out] The dimensions of the text * modstr [out] The modified form of the string, to be returned to the - * calling program. It is assumed that the caller has + * calling program. It is assumed that the caller has * made sufficient space available so we don't need to * know the size of the space. This pointer may be NULL if * the modified string is not required. @@ -180,7 +180,7 @@ static void TEXT_Ellipsify (HDC hdc, WCHAR *str, unsigned int max_len, * width [in] The maximum width permitted (in logical coordinates) * size [out] The dimensions of the text * modstr [out] The modified form of the string, to be returned to the - * calling program. It is assumed that the caller has + * calling program. It is assumed that the caller has * made sufficient space available so we don't need to * know the size of the space. This pointer may be NULL if * the modified string is not required. @@ -251,7 +251,7 @@ static void TEXT_PathEllipsify (HDC hdc, WCHAR *str, unsigned int max_len, memmove (lastSlash-1, lastSlash, len_trailing * sizeof(WCHAR)); lastSlash--; len_under++; - + assert (*len_str); (*len_str)--; } @@ -298,7 +298,7 @@ static void TEXT_PathEllipsify (HDC hdc, WCHAR *str, unsigned int max_len, * known to fit; chars_fit+1 is known not to fit. * chars_used [out] The number of characters of str that have been "used" and * do not need to be included in later text. For example this will - * include any spaces that have been discarded from the start of + * include any spaces that have been discarded from the start of * the next line. * size [out] The size of the returned text in logical coordinates * @@ -306,7 +306,7 @@ static void TEXT_PathEllipsify (HDC hdc, WCHAR *str, unsigned int max_len, * increasing with number of characters (i.e. no weird kernings) * * Algorithm - * + * * Work back from the last character that did fit to either a space or the last * character of a word, whichever is met first. * If there was one or the first character didn't fit then @@ -464,7 +464,7 @@ static void TEXT_SkipChars (int *new_count, const WCHAR **new_str, *new_str = start_str; *new_count = start_count; } - + /********************************************************************* * TEXT_Reprefix * @@ -518,7 +518,7 @@ static int TEXT_Reprefix (const WCHAR *str, unsigned int ns, } /********************************************************************* - * Returns true if and only if the remainder of the line is a single + * Returns true if and only if the remainder of the line is a single * newline representation or nothing */ @@ -536,7 +536,7 @@ static int remainder_is_none_or_newline (int num_chars, const WCHAR *str) /********************************************************************* * Return next line of text from a string. - * + * * hdc - handle to DC. * str - string to parse into lines. * count - length of str. @@ -550,13 +550,13 @@ static int remainder_is_none_or_newline (int num_chars, const WCHAR *str) * the return string is built. * tabwidth - The width of a tab in logical coordinates * pprefix_offset - Here is where we return the offset within dest of the first - * prefixed (underlined) character. -1 is returned if there + * prefixed (underlined) character. -1 is returned if there * are none. Note that there may be more; the calling code * will need to use TEXT_Reprefix to find any later ones. * pellip - Here is where we return the information about any ellipsification * that was carried out. Note that if tabs are being expanded then * this data will correspond to the last text segment actually - * returned in dest; by definition there would not have been any + * returned in dest; by definition there would not have been any * ellipsification in earlier text segments of the line. * * Returns pointer to next char in str after end of the line @@ -678,7 +678,7 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count, /* NB we may end up ellipsifying a word-broken or path_ellipsified * string */ if ((!line_fits && (format & DT_WORD_ELLIPSIS)) || - ((format & DT_END_ELLIPSIS) && + ((format & DT_END_ELLIPSIS) && ((last_line && *count) || (remainder_is_none_or_newline (*count, &str[i]) && !line_fits)))) { @@ -750,7 +750,7 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count, } /* else it was a Tab and we go around again */ } - + retsize->cx = plen; *len = j; if (*count) @@ -803,7 +803,7 @@ static void TEXT_DrawUnderscore (HDC hdc, int x, int y, const WCHAR *str, int of * is not quite complete, especially with regard to \0. We will assume that * the returned string could have a length of up to i_count+3 and also have * a trailing \0 (which would be 4 more than a not-null-terminated string but - * 3 more than a null-terminated string). If this is not so then increase + * 3 more than a null-terminated string). If this is not so then increase * the allowance in DrawTextExA. */ #define MAX_STATIC_BUFFER 1024 @@ -907,12 +907,12 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count, const WCHAR *p; p = str; while (p < str+len && *p != TAB) p++; len_seg = p - str; - if (len_seg != len && !GetTextExtentPointW(hdc, str, len_seg, &size)) + if (len_seg != len && !GetTextExtentPointW(hdc, str, len_seg, &size)) return 0; } else len_seg = len; - + if (!ExtTextOutW( hdc, xseg, y, ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) | ((flags & DT_RTLREADING) ? ETO_RTLREADING : 0), @@ -926,7 +926,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count, if (len) { assert ((flags & DT_EXPANDTABS) && *str == TAB); - len--; str++; + len--; str++; xseg += ((size.cx/tabwidth)+1)*tabwidth; if (prefix_offset != -1) { @@ -973,7 +973,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count, /*********************************************************************** * DrawTextExA (USER32.@) * - * If DT_MODIFYSTRING is specified then there must be room for up to + * If DT_MODIFYSTRING is specified then there must be room for up to * 4 extra characters. We take great care about just how much modified * string we return. */ @@ -1104,7 +1104,7 @@ static BOOL CALLBACK gray_string_callback( HDC hdc, LPARAM param, INT len ) * rethink the strategy once the migration to NT handles is complete. * We are going to get a lot of code-duplication once this migration is * completed... - * + * */ static BOOL TEXT_GrayString(HDC hdc, HBRUSH hb, GRAYSTRINGPROC fn, LPARAM lp, INT len, INT x, INT y, INT cx, INT cy, BOOL unicode, BOOL _32bit) @@ -1363,7 +1363,7 @@ LONG WINAPI TabbedTextOutW( HDC hdc, INT x, INT y, LPCWSTR str, INT count, acount = WideCharToMultiByte(codepage,0,str,count,NULL,0,NULL,NULL); p = HeapAlloc( GetProcessHeap(), 0, acount ); - if(p == NULL) return 0; /* FIXME: is this the correct return on failure */ + if(p == NULL) return 0; /* FIXME: is this the correct return on failure */ acount = WideCharToMultiByte(codepage,0,str,count,p,acount,NULL,NULL); ret = TabbedTextOutA( hdc, x, y, p, acount, cTabStops, lpTabPos, nTabOrg ); HeapFree( GetProcessHeap(), 0, p ); diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c index 7e2e01e9419..311bbe039a5 100644 --- a/dlls/user/wnd16.c +++ b/dlls/user/wnd16.c @@ -557,7 +557,7 @@ INT16 WINAPI GetDlgItemText16( HWND16 hwnd, INT16 id, SEGPTR str, UINT16 len ) */ void WINAPI SetDlgItemInt16( HWND16 hwnd, INT16 id, UINT16 value, BOOL16 fSigned ) { - SetDlgItemInt( WIN_Handle32(hwnd), (UINT)(UINT16)id, + SetDlgItemInt( WIN_Handle32(hwnd), (UINT)(UINT16)id, (UINT)(fSigned ? (INT16) value : (UINT16) value), fSigned ); } diff --git a/dlls/version/info.c b/dlls/version/info.c index 338d5e6f8ab..a681fc98c2d 100644 --- a/dlls/version/info.c +++ b/dlls/version/info.c @@ -1,6 +1,6 @@ -/* +/* * Implementation of VERSION.DLL - Version Info access - * + * * Copyright 1996,1997 Marcus Meissner * Copyright 1997 David Cuthbert * Copyright 1999 Ulrich Weigand @@ -209,7 +209,7 @@ typedef struct /*********************************************************************** * ConvertVersionInfo32To16 [internal] */ -void ConvertVersionInfo32To16( VS_VERSION_INFO_STRUCT32 *info32, +void ConvertVersionInfo32To16( VS_VERSION_INFO_STRUCT32 *info32, VS_VERSION_INFO_STRUCT16 *info16 ) { /* Copy data onto local stack to prevent overwrites */ @@ -242,8 +242,8 @@ void ConvertVersionInfo32To16( VS_VERSION_INFO_STRUCT32 *info32, WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)lpValue, -1, VersionInfo16_Value( info16 ), info16->wValueLength, NULL, NULL ); - TRACE("Copied value from %p to %p: %s\n", lpValue, - VersionInfo16_Value( info16 ), + TRACE("Copied value from %p to %p: %s\n", lpValue, + VersionInfo16_Value( info16 ), debugstr_a(VersionInfo16_Value( info16 )) ); } else @@ -251,7 +251,7 @@ void ConvertVersionInfo32To16( VS_VERSION_INFO_STRUCT32 *info32, info16->wValueLength = wValueLength; memmove( VersionInfo16_Value( info16 ), lpValue, wValueLength ); - TRACE("Copied value from %p to %p: %d bytes\n", lpValue, + TRACE("Copied value from %p to %p: %d bytes\n", lpValue, VersionInfo16_Value( info16 ), wValueLength ); } @@ -270,7 +270,7 @@ void ConvertVersionInfo32To16( VS_VERSION_INFO_STRUCT32 *info32, /* Fixup length */ info16->wLength = (DWORD)child16 - (DWORD)info16; - TRACE("Finished, length is %d (%p - %p)\n", + TRACE("Finished, length is %d (%p - %p)\n", info16->wLength, info16, child16 ); } @@ -461,7 +461,7 @@ DWORD WINAPI GetFileVersionInfoSizeA( LPCSTR filename, LPDWORD handle ) if (!ret) return 0; if ( handle ) *handle = offset; - + if ( VersionInfoIs16( buf ) ) vffi = (VS_FIXEDFILEINFO *)VersionInfo16_Value( (VS_VERSION_INFO_STRUCT16 *)buf ); else @@ -525,11 +525,11 @@ BOOL WINAPI GetFileVersionInfoA( LPCSTR filename, DWORD handle, return FALSE; DO_CONVERT: if ( datasize >= sizeof(VS_VERSION_INFO_STRUCT16) - && datasize >= ((VS_VERSION_INFO_STRUCT16 *)data)->wLength + && datasize >= ((VS_VERSION_INFO_STRUCT16 *)data)->wLength && !VersionInfoIs16( data ) ) { /* convert resource from PE format to NE format */ - ConvertVersionInfo32To16( (VS_VERSION_INFO_STRUCT32 *)data, + ConvertVersionInfo32To16( (VS_VERSION_INFO_STRUCT32 *)data, (VS_VERSION_INFO_STRUCT16 *)data ); } @@ -562,7 +562,7 @@ BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle, retv = FALSE; else if ( datasize >= sizeof(VS_VERSION_INFO_STRUCT16) - && datasize >= ((VS_VERSION_INFO_STRUCT16 *)data)->wLength + && datasize >= ((VS_VERSION_INFO_STRUCT16 *)data)->wLength && VersionInfoIs16( data ) ) { ERR("Cannot access NE resource in %s\n", debugstr_a(fn) ); @@ -577,7 +577,7 @@ END: /*********************************************************************** * VersionInfo16_FindChild [internal] */ -static VS_VERSION_INFO_STRUCT16 *VersionInfo16_FindChild( VS_VERSION_INFO_STRUCT16 *info, +static VS_VERSION_INFO_STRUCT16 *VersionInfo16_FindChild( VS_VERSION_INFO_STRUCT16 *info, LPCSTR szKey, UINT cbKey ) { VS_VERSION_INFO_STRUCT16 *child = VersionInfo16_Children( info ); @@ -597,7 +597,7 @@ static VS_VERSION_INFO_STRUCT16 *VersionInfo16_FindChild( VS_VERSION_INFO_STRUCT /*********************************************************************** * VersionInfo32_FindChild [internal] */ -static VS_VERSION_INFO_STRUCT32 *VersionInfo32_FindChild( VS_VERSION_INFO_STRUCT32 *info, +static VS_VERSION_INFO_STRUCT32 *VersionInfo32_FindChild( VS_VERSION_INFO_STRUCT32 *info, LPCWSTR szKey, UINT cbKey ) { VS_VERSION_INFO_STRUCT32 *child = VersionInfo32_Children( info ); diff --git a/dlls/version/install.c b/dlls/version/install.c index eccf681e36d..7cc8232c832 100644 --- a/dlls/version/install.c +++ b/dlls/version/install.c @@ -1,6 +1,6 @@ -/* +/* * Implementation of VERSION.DLL - File Installer routines - * + * * Copyright 1996,1997 Marcus Meissner * Copyright 1997 David Cuthbert * @@ -325,7 +325,7 @@ _fetch_versioninfo(LPSTR fn,VS_FIXEDFILEINFO **vffi) { if(buf == NULL) { WARN("Memory exausted while fetching version info!\n"); return NULL; - } + } } else { *vffi = (VS_FIXEDFILEINFO*)(buf+0x14); if ((*vffi)->dwSignature == 0x004f0049) /* hack to detect unicode */ @@ -392,7 +392,7 @@ DWORD WINAPI VerInstallFileA( tmplast = strlen(pdest)+1; attr = GetFileAttributesA(tmpfn); /* if it exists, it has been copied by the call before. - * we jump over the copy part... + * we jump over the copy part... */ } } @@ -466,7 +466,7 @@ DWORD WINAPI VerInstallFileA( if (VerQueryValueA(buf1,"\\VarFileInfo\\Translation",(LPVOID*)&tbuf1,&len1) && VerQueryValueA(buf2,"\\VarFileInfo\\Translation",(LPVOID*)&tbuf2,&len2) ) { - /* irgendwas mit tbuf1 und tbuf2 machen + /* irgendwas mit tbuf1 und tbuf2 machen * generiert DIFFLANG|MISMATCH */ } @@ -493,8 +493,8 @@ DWORD WINAPI VerInstallFileA( LZClose(hfsrc); return xret; } - if ((!(flags & VIFF_DONTDELETEOLD)) && - curdir && + if ((!(flags & VIFF_DONTDELETEOLD)) && + curdir && *curdir && lstrcmpiA(curdir,pdest) ) { diff --git a/dlls/version/resource.c b/dlls/version/resource.c index 7b4c3ab905d..af332da816d 100644 --- a/dlls/version/resource.c +++ b/dlls/version/resource.c @@ -1,6 +1,6 @@ -/* +/* * Implementation of VERSION.DLL - Resource Access routines - * + * * Copyright 1996,1997 Marcus Meissner * Copyright 1997 David Cuthbert * Copyright 1999 Ulrich Weigand @@ -177,18 +177,18 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, DWORD resTabSize; int count; - /* Read in NE header */ + /* Read in NE header */ nehdoffset = LZSeek( lzfd, 0, SEEK_CUR ); if ( sizeof(nehd) != LZRead( lzfd, &nehd, sizeof(nehd) ) ) return 0; - resTabSize = nehd.ne_restab - nehd.ne_rsrctab; + resTabSize = nehd.ne_restab - nehd.ne_rsrctab; if ( !resTabSize ) { TRACE("No resources in NE dll\n" ); return FALSE; } - /* Read in resource table */ + /* Read in resource table */ resTab = HeapAlloc( GetProcessHeap(), 0, resTabSize ); if ( !resTab ) return FALSE; @@ -292,8 +292,8 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, } /* Read in section table */ - nSections = pehd.FileHeader.NumberOfSections; - sections = HeapAlloc( GetProcessHeap(), 0, + nSections = pehd.FileHeader.NumberOfSections; + sections = HeapAlloc( GetProcessHeap(), 0, nSections * sizeof(IMAGE_SECTION_HEADER) ); if ( !sections ) return FALSE; @@ -324,9 +324,9 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, } /* Read in resource section */ - resSectionSize = sections[i].SizeOfRawData; + resSectionSize = sections[i].SizeOfRawData; resSection = HeapAlloc( GetProcessHeap(), 0, resSectionSize ); - if ( !resSection ) + if ( !resSection ) { HeapFree( GetProcessHeap(), 0, sections ); return FALSE; @@ -397,7 +397,7 @@ DWORD WINAPI GetFileResourceSize16( LPCSTR lpszFileName, LPCSTR lpszResType, DWORD reslen; TRACE("(%s,type=0x%lx,id=0x%lx,off=%p)\n", - debugstr_a(lpszFileName), (LONG)lpszResType, (LONG)lpszResId, + debugstr_a(lpszFileName), (LONG)lpszResType, (LONG)lpszResId, lpszResId ); lzfd = LZOpenFileA( lpszFileName, &ofs, OF_READ ); @@ -406,12 +406,12 @@ DWORD WINAPI GetFileResourceSize16( LPCSTR lpszFileName, LPCSTR lpszResType, switch ( read_xx_header( lzfd ) ) { case IMAGE_OS2_SIGNATURE: - retv = find_ne_resource( lzfd, lpszResType, lpszResId, + retv = find_ne_resource( lzfd, lpszResType, lpszResId, &reslen, lpdwFileOffset ); break; case IMAGE_NT_SIGNATURE: - retv = find_pe_resource( lzfd, lpszResType, lpszResId, + retv = find_pe_resource( lzfd, lpszResType, lpszResId, &reslen, lpdwFileOffset ); break; } @@ -434,7 +434,7 @@ DWORD WINAPI GetFileResource16( LPCSTR lpszFileName, LPCSTR lpszResType, DWORD reslen = dwResLen; TRACE("(%s,type=0x%lx,id=0x%lx,off=%ld,len=%ld,data=%p)\n", - debugstr_a(lpszFileName), (LONG)lpszResType, (LONG)lpszResId, + debugstr_a(lpszFileName), (LONG)lpszResType, (LONG)lpszResId, dwFileOffset, dwResLen, lpvData ); lzfd = LZOpenFileA( lpszFileName, &ofs, OF_READ ); @@ -442,20 +442,20 @@ DWORD WINAPI GetFileResource16( LPCSTR lpszFileName, LPCSTR lpszResType, if ( !dwFileOffset ) { - switch ( read_xx_header( lzfd ) ) + switch ( read_xx_header( lzfd ) ) { case IMAGE_OS2_SIGNATURE: - retv = find_ne_resource( lzfd, lpszResType, lpszResId, + retv = find_ne_resource( lzfd, lpszResType, lpszResId, &reslen, &dwFileOffset ); break; case IMAGE_NT_SIGNATURE: - retv = find_pe_resource( lzfd, lpszResType, lpszResId, + retv = find_pe_resource( lzfd, lpszResType, lpszResId, &reslen, &dwFileOffset ); break; } - if ( !retv ) + if ( !retv ) { LZClose( lzfd ); return 0; diff --git a/dlls/version/ver16.c b/dlls/version/ver16.c index f06447d48fc..9243d920bfd 100644 --- a/dlls/version/ver16.c +++ b/dlls/version/ver16.c @@ -41,7 +41,7 @@ DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle ) DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle, DWORD cbBuf, LPVOID lpvData ) { - TRACE("(%s, %08lx, %ld, %p)\n", + TRACE("(%s, %08lx, %ld, %p)\n", debugstr_a(lpszFileName), handle, cbBuf, lpvData ); return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData ); @@ -50,7 +50,7 @@ DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle, /************************************************************************* * VerFindFile [VER.8] */ -DWORD WINAPI VerFindFile16( UINT16 flags, LPCSTR lpszFilename, +DWORD WINAPI VerFindFile16( UINT16 flags, LPCSTR lpszFilename, LPCSTR lpszWinDir, LPCSTR lpszAppDir, LPSTR lpszCurDir, UINT16 *lpuCurDirLen, LPSTR lpszDestDir, UINT16 *lpuDestDirLen ) @@ -67,14 +67,14 @@ DWORD WINAPI VerFindFile16( UINT16 flags, LPCSTR lpszFilename, /************************************************************************* * VerInstallFile [VER.9] */ -DWORD WINAPI VerInstallFile16( UINT16 flags, - LPCSTR lpszSrcFilename, LPCSTR lpszDestFilename, +DWORD WINAPI VerInstallFile16( UINT16 flags, + LPCSTR lpszSrcFilename, LPCSTR lpszDestFilename, LPCSTR lpszSrcDir, LPCSTR lpszDestDir, LPCSTR lpszCurDir, LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen ) { UINT filelen; - DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename, - lpszSrcDir, lpszDestDir, lpszCurDir, + DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename, + lpszSrcDir, lpszDestDir, lpszCurDir, lpszTmpFile, &filelen); *lpwTmpFileLen = (UINT16)filelen; @@ -92,7 +92,7 @@ DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang ) /************************************************************************* * VerQueryValue [VER.11] */ -DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPCSTR lpszSubBlock, +DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPCSTR lpszSubBlock, SEGPTR *lpspBuffer, UINT16 *lpcb ) { LPVOID lpvBlock = MapSL( spvBlock ); @@ -100,7 +100,7 @@ DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPCSTR lpszSubBlock, UINT buflen; DWORD retv; - TRACE("(%p, %s, %p, %p)\n", + TRACE("(%p, %s, %p, %p)\n", lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb ); retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen ); diff --git a/dlls/win32s/w32skernel.c b/dlls/win32s/w32skernel.c index 5b203eb6a22..db2ba1fa55b 100644 --- a/dlls/win32s/w32skernel.c +++ b/dlls/win32s/w32skernel.c @@ -38,7 +38,7 @@ LPSTR WINAPI GetWin32sDirectory(void) strcat(sysdir, "\\WIN32S"); text = HeapAlloc(GetProcessHeap(), 0, strlen(sysdir)+1); strcpy(text, sysdir); - return text; + return text; } /*********************************************************************** diff --git a/dlls/winaspi/aspi.c b/dlls/winaspi/aspi.c index fa8acda7709..5889d2c23f0 100644 --- a/dlls/winaspi/aspi.c +++ b/dlls/winaspi/aspi.c @@ -41,7 +41,7 @@ HKEY_DYN_DATA #include #include -#ifdef HAVE_SYS_IOCTL_H +#ifdef HAVE_SYS_IOCTL_H #include #endif #include @@ -321,7 +321,7 @@ SCSI_LinuxSetTimeout( int fd, int timeout ) WARN("Could not set timeout ! (%s)\n", strerror(errno)); } return retval; - + } /* This function takes care of the write/read to the linux sg device. @@ -354,7 +354,7 @@ SCSI_LinuxDeviceIo( int fd, *lpcbBytesReturned = 0; return FALSE; } - + TRACE("Reading reply from Linux sg device\n"); *lpcbBytesReturned = read( fd, lpOutBuffer, cbOutBuffer ); if( *lpcbBytesReturned != cbOutBuffer ) @@ -504,7 +504,7 @@ SCSI_MapHCtoController() RegCloseKey(hkeyScsi); return; } - + for( i=0; cbIdStr = sizeof(idstr), (error=RegEnumValueA( hkeyScsi, i, idstr, &cbIdStr, NULL, &type, NULL, NULL )) == ERROR_SUCCESS; i++ ) { if(idstr[0] == '\0') continue; /* skip the default value */ @@ -598,7 +598,7 @@ SCSI_GetProcinfo() /* Check whether user has generic scsi devices at all */ if (!(SCSI_Linux_CheckDevices())) return; - + procfile = fopen( procname, "r" ); if( !procfile ) { diff --git a/dlls/winaspi/winaspi16.c b/dlls/winaspi/winaspi16.c index d4733d9b535..740f69a8e68 100644 --- a/dlls/winaspi/winaspi16.c +++ b/dlls/winaspi/winaspi16.c @@ -379,7 +379,7 @@ ASPI_ExecScsiCmd(DWORD ptrPRB, UINT16 mode) { SEGPTR spPRB = MapLS(lpPRB); - ASPI_CallTo16_long_l(lpPRB->SRB_PostProc, spPRB); + ASPI_CallTo16_long_l(lpPRB->SRB_PostProc, spPRB); UnMapLS(spPRB); break; } @@ -393,7 +393,7 @@ ASPI_ExecScsiCmd(DWORD ptrPRB, UINT16 mode) free(sg_hd); ASPI_DebugPrintResult(lpPRB, mode); return SS_COMP; - + error_exit: if (error_code == EBUSY) { lpPRB->SRB_Status = SS_ASPI_IS_BUSY; @@ -498,7 +498,7 @@ WORD WINAPI SendASPICommand16(SEGPTR segptr_srb) #ifdef linux return ASPI_SendASPICommand(segptr_srb, ASPI_WIN16); #else - return 0; + return 0; #endif } diff --git a/dlls/winaspi/winescsi.h b/dlls/winaspi/winescsi.h index 6d7efbbd77e..3a2eee28e8e 100644 --- a/dlls/winaspi/winescsi.h +++ b/dlls/winaspi/winescsi.h @@ -39,14 +39,14 @@ struct sg_header int reply_len; /* [i] max length of expected reply (inc. sg_header) */ int pack_id; /* [io] id number of packet (use ints >= 0) */ int result; /* [o] 0==ok, else (+ve) Unix errno (best ignored) */ - unsigned int twelve_byte:1; + unsigned int twelve_byte:1; /* [i] Force 12 byte command length for group 6 & 7 commands */ unsigned int target_status:5; /* [o] scsi status from target */ unsigned int host_status:8; /* [o] host status (see "DID" codes) */ unsigned int driver_status:8; /* [o] driver status+suggestion */ unsigned int other_flags:10; /* unused */ unsigned char sense_buffer[SG_MAX_SENSE]; /* [o] Output in 3 cases: - when target_status is CHECK_CONDITION or + when target_status is CHECK_CONDITION or when target_status is COMMAND_TERMINATED or when (driver_status & DRIVER_SENSE) is true. */ }; /* This structure is 36 bytes long on i386 */ diff --git a/dlls/winedos/devices.c b/dlls/winedos/devices.c index e6e4200d656..35e786d6fd2 100644 --- a/dlls/winedos/devices.c +++ b/dlls/winedos/devices.c @@ -114,7 +114,7 @@ static void WINAPI con_strategy(CONTEXT86*ctx); static void WINAPI con_interrupt(CONTEXT86*ctx); /* devices */ -typedef struct +typedef struct { char name[8]; WORD attr; @@ -122,7 +122,7 @@ typedef struct RMCBPROC interrupt; } WINEDEV; -static WINEDEV devs[] = +static WINEDEV devs[] = { { "NUL ", ATTR_CHAR|ATTR_NUL|ATTR_DEVICE, diff --git a/dlls/winedos/dosaspi.c b/dlls/winedos/dosaspi.c index 20a48396e1c..fdd9c7e6b7e 100644 --- a/dlls/winedos/dosaspi.c +++ b/dlls/winedos/dosaspi.c @@ -73,7 +73,7 @@ DOSASPI_PostProc( SRB_ExecSCSICmd *lpPRB ) * Offset of SRB Pointer <- SP+4 * Segment of return address <- SP+2 * Offset of return address <- SP+0 - */ + */ /* FIXME: I am about 99% sure what is here is correct, * but this code has never been tested (and probably * won't be either until someone finds a DOS program @@ -99,7 +99,7 @@ DOSASPI_PostProc( SRB_ExecSCSICmd *lpPRB ) } /* if ((SRB_Flags&SRB_POSTING) && SRB_PostProc) */ } -static +static DWORD ASPI_SendASPIDOSCommand(DWORD ptrSRB) { PSRB_ExecSCSICmd lpPRB; diff --git a/dlls/winedos/dosvm.c b/dlls/winedos/dosvm.c index 227d95499a4..1504faddb0a 100644 --- a/dlls/winedos/dosvm.c +++ b/dlls/winedos/dosvm.c @@ -211,7 +211,7 @@ void WINAPI DOSVM_QueueEvent( INT irq, INT priority, DOSRELAY relay, LPVOID data } else { TRACE("new event queued (time=%ld)\n", GetTickCount()); } - + /* Wake up DOSVM_Wait so that it can serve pending events. */ SetEvent(event_notifier); @@ -655,7 +655,7 @@ static const INTPROC real_mode_handlers[] = /* 30 */ 0, DOSVM_Int31Handler, 0, DOSVM_Int33Handler, 0, 0, 0, 0, /* 38 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 40 */ 0, 0, 0, 0, 0, 0, 0, 0, - /* 48 */ 0, 0, 0, 0, 0, 0, 0, 0, + /* 48 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 50 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 58 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 60 */ 0, 0, 0, 0, 0, 0, 0, DOSVM_Int67Handler diff --git a/dlls/winedos/int10.c b/dlls/winedos/int10.c index f773d67aaef..1d8793ab7d6 100644 --- a/dlls/winedos/int10.c +++ b/dlls/winedos/int10.c @@ -30,7 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); -static void scroll_window(int direction, char lines, char row1, +static void scroll_window(int direction, char lines, char row1, char col1, char row2, char col2, char attribute); #define SCROLL_UP 1 @@ -53,13 +53,13 @@ static void BIOS_SetCursorPos(BIOSDATA*data,unsigned page,unsigned X,unsigned Y) * DOSVM_Int10Handler (WPROCS.116) * * Handler for int 10h (video). - * + * * NOTE: * Most INT 10 functions for text-mode, CGA, EGA, and VGA cards * are present in this list. (SVGA and XGA are not) That is not * to say that all these functions should be supported, but if * anyone is brain-damaged enough to want to emulate one of these - * beasts then this should get you started. + * beasts then this should get you started. * * NOTE: * Several common graphical extensions used by Microsoft hook @@ -68,18 +68,18 @@ static void BIOS_SetCursorPos(BIOSDATA*data,unsigned page,unsigned X,unsigned Y) * * MSHERC.COM - More functionality for Hercules cards. * EGA.SYS (also MOUSE.COM) - More for EGA cards. - * + * * Yes, MS also added this support into their mouse driver. Don't * ask me, I don't work for them. * - * Joseph Pranevich - 9/98 + * Joseph Pranevich - 9/98 * * Jess Haas 2/99 - * Added support for Vesa. It is not complete but is a start. + * Added support for Vesa. It is not complete but is a start. * NOTE: Im not sure if i did all this right or if eny of it works. - * Currently i dont have a program that uses Vesa that actually gets far + * Currently i dont have a program that uses Vesa that actually gets far * enough without crashing to do vesa stuff. - * + * * Added additional vga graphic support - 3/99 */ @@ -97,7 +97,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) AL_reg(context) = 0x4f; AH_reg(context) = 0x00; /* 0x00 = successful 0x01 = failed */ break; - + case 0x01: /* GET SuperVGA MODE INFORMATION */ FIXME("VESA GET SuperVGA Mode Information - Not supported\n"); AL_reg(context) = 0x4f; @@ -112,7 +112,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) BX_reg(context)); VGA_SetAlphaMode(40, 25); data->VideoColumns = 40; - break; + break; case 0x02: case 0x03: case 0x07: @@ -127,7 +127,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) break; case 0x0E: TRACE("Setting VESA 640x200 16-color mode\n"); - VGA_SetMode(640,200,4); + VGA_SetMode(640,200,4); break; case 0x10: TRACE("Setting VESA 640x350 16-color mode\n"); @@ -242,7 +242,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) data->VideoMode = BX_reg(context); AL_reg(context) = 0x4f; AH_reg(context) = 0x00; - break; + break; case 0x03: /* VESA SuperVGA BIOS - GET CURRENT VIDEO MODE */ AL_reg(context) = 0x4f; AH_reg(context) = 0x00; /* should probly check if a vesa mode has ben set */ @@ -250,31 +250,31 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) break; case 0x04: /* VESA SuperVGA BIOS - SAVE/RESTORE SuperVGA VIDEO STATE */ ERR("VESA SAVE/RESTORE Video State - Not Implemented\n"); - /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ + /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ /* maybe we should do this instead ? */ /* AH_reg(context = 0x01; not implemented so just fail */ break; case 0x05: /* VESA SuperVGA BIOS - CPU VIDEO MEMORY CONTROL */ ERR("VESA CPU VIDEO MEMORY CONTROL\n"); - /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ + /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ /* maybe we should do this instead ? */ /* AH_reg(context = 0x001; not implemented so just fail */ break; case 0x06: /* VESA GET/SET LOGICAL SCAN LINE LENGTH */ ERR("VESA GET/SET LOGICAL SCAN LINE LENGTH - Not Implemented\n"); - /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ + /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ /* maybe we should do this instead ? */ /* AH_reg(context = 0x001; not implemented so just fail */ break; case 0x07: /* GET/SET DISPLAY START */ ERR("VESA GET/SET DISPLAY START - Not Implemented\n"); - /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ + /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ /* maybe we should do this instead ? */ /* AH_reg(context = 0x001; not implemented so just fail */ break; case 0x08: /* GET/SET DAC PALETTE CONTROL */ ERR("VESA GET/SET DAC PALETTE CONTROL- Not Implemented\n"); - /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ + /* AL_reg(context) = 0x4f; = supported so not set since not implemented */ /* maybe we should do this instead ? */ /* AH_reg(context = 0x001; not implemented so just fail */ break; @@ -286,13 +286,13 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) /* is there?....................(A.C.) */ TRACE("Just report the video not hercules compatible\n"); DX_reg(context) = 0xffff; - break; + break; case 0xff: /* Turn VESA ON/OFF */ /* i dont know what to do */ break; default: FIXME("VESA Function (0x%x) - Not Supported\n", AH_reg(context)); - break; + break; } } else { @@ -302,21 +302,21 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) case 0x00: /* SET VIDEO MODE */ /* Text Modes: */ /* (mode) (text rows/cols) - 0x00 - 40x25 + 0x00 - 40x25 0x01 - 40x25 0x02 - 80x25 - 0x03 - 80x25 or 80x43 or 80x50 (assume 80x25) + 0x03 - 80x25 or 80x43 or 80x50 (assume 80x25) 0x07 - 80x25 */ /* Bit 7 of AH = 0 -> Clean the video memory 1 -> Don't clean it - */ + */ if (!(AL_reg(context)&0x80)) { - /* FIXME: Do something which cleans the video memory */ + /* FIXME: Do something which cleans the video memory */ } - /* FIXME: Should we keep the bit 7 in the Bios Data memory? */ + /* FIXME: Should we keep the bit 7 in the Bios Data memory? */ AL_reg(context) &= ~0x80; switch (AL_reg(context)) { @@ -327,7 +327,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) AL_reg(context)); VGA_SetAlphaMode(40, 25); data->VideoColumns = 40; - break; + break; case 0x02: case 0x03: case 0x07: @@ -343,7 +343,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) break; case 0x0E: TRACE("Setting VGA 640x200 16-color mode\n"); - VGA_SetMode(640,200,4); + VGA_SetMode(640,200,4); break; case 0x10: TRACE("Setting VGA 640x350 16-color mode\n"); @@ -358,7 +358,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) VGA_SetMode(320,200,8); break; default: - FIXME("Set Video Mode (0x%x) - Not Supported\n", + FIXME("Set Video Mode (0x%x) - Not Supported\n", AL_reg(context)); } data->VideoMode = AL_reg(context); @@ -367,7 +367,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) case 0x01: /* SET CURSOR SHAPE */ FIXME("Set Cursor Shape - Not Supported\n"); break; - + case 0x02: /* SET CURSOR POSITION */ /* BH = Page Number */ /* Not supported */ /* DH = Row */ /* 0 is left */ @@ -381,7 +381,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) else { VGA_SetCursorPos(DL_reg(context), DH_reg(context)); - TRACE("Set Cursor Position: %d %d\n", DH_reg(context), + TRACE("Set Cursor Position: %d %d\n", DH_reg(context), DL_reg(context)); } break; @@ -414,8 +414,8 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) /* BH = Attribute */ /* CH,CL = row, col upper-left */ /* DH,DL = row, col lower-right */ - scroll_window(SCROLL_UP, AL_reg(context), CH_reg(context), - CL_reg(context), DH_reg(context), DL_reg(context), + scroll_window(SCROLL_UP, AL_reg(context), CH_reg(context), + CL_reg(context), DH_reg(context), DL_reg(context), BH_reg(context)); TRACE("Scroll Up Window %d\n", AL_reg(context)); break; @@ -425,8 +425,8 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) /* BH = Attribute */ /* CH,CL = row, col upper-left */ /* DH,DL = row, col lower-right */ - scroll_window(SCROLL_DOWN, AL_reg(context), CH_reg(context), - CL_reg(context), DH_reg(context), DL_reg(context), + scroll_window(SCROLL_DOWN, AL_reg(context), CH_reg(context), + CL_reg(context), DH_reg(context), DL_reg(context), BH_reg(context)); TRACE("Scroll Down Window %d\n", AL_reg(context)); break; @@ -449,7 +449,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) break; case 0x09: /* WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION */ - case 0x0a: /* WRITE CHARACTER ONLY AT CURSOR POSITION */ + case 0x0a: /* WRITE CHARACTER ONLY AT CURSOR POSITION */ /* AL = Character to display. */ /* BH = Page Number */ /* We can't write to non-0 pages, yet. */ /* BL = Attribute / Color */ @@ -474,26 +474,26 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) } break; - case 0x0b: + case 0x0b: switch BH_reg(context) { case 0x00: /* SET BACKGROUND/BORDER COLOR */ /* In text modes, this sets only the border... */ /* According to the interrupt list and one of my books. */ - /* Funny though that Beyond Zork seems to indicate that it + /* Funny though that Beyond Zork seems to indicate that it also sets up the default background attributes for clears and scrolls... */ /* Bear in mind here that we do not want to change, apparantly, the foreground or attribute of the background with this call, so we should check first to see what the foreground already is... FIXME */ - FIXME("Set Background/Border Color: %d\n", + FIXME("Set Background/Border Color: %d\n", BL_reg(context)); break; case 0x01: /* SET PALETTE */ FIXME("Set Palette - Not Supported\n"); break; default: - FIXME("INT 10 AH = 0x0b BH = 0x%x - Unknown\n", + FIXME("INT 10 AH = 0x0b BH = 0x%x - Unknown\n", BH_reg(context)); break; } @@ -503,12 +503,12 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) /* Not in graphics mode, can ignore w/o error */ FIXME("Write Graphics Pixel - Not Supported\n"); break; - + case 0x0d: /* READ GRAPHICS PIXEL */ /* Not in graphics mode, can ignore w/o error */ FIXME("Read Graphics Pixel - Not Supported\n"); break; - + case 0x0e: /* TELETYPE OUTPUT */ TRACE("Teletype Output\n"); DOSVM_PutChar(AL_reg(context)); @@ -522,7 +522,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) BH_reg(context) = 0; /* Display page 0 */ break; - case 0x10: + case 0x10: switch AL_reg(context) { case 0x00: /* SET SINGLE PALETTE REGISTER - A.C. */ TRACE("Set Single Palette Register - Reg 0x0%x Value 0x0%x\n", @@ -532,7 +532,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) break; case 0x01: /* SET BORDER (OVERSCAN) */ /* Text terminals have no overscan */ - /* I'm setting it anyway. - A.C. */ + /* I'm setting it anyway. - A.C. */ TRACE("Set Border (Overscan) - Ignored but set.\n"); VGA_SetColor16(16,(int)BH_reg(context)); break; @@ -613,7 +613,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) FIXME("Perform Gray-scale summing - Not Supported\n"); break; default: - FIXME("INT 10 AH = 0x10 AL = 0x%x - Unknown\n", + FIXME("INT 10 AH = 0x10 AL = 0x%x - Unknown\n", AL_reg(context)); break; } @@ -634,7 +634,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) case 0x02: /* LOAD ROM 8x8 DOUBLE-DOT PATTERNS */ case 0x12: FIXME( - "Load ROM 8x8 Double Dot Patterns - Not Supported\n"); + "Load ROM 8x8 Double Dot Patterns - Not Supported\n"); break; case 0x03: /* SET BLOCK SPECIFIER */ FIXME("Set Block Specifier - Not Supported\n"); @@ -663,12 +663,12 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) FIXME("Get Font Information - Not Supported\n"); break; default: - FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n", + FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n", AL_reg(context)); break; } break; - + case 0x12: /* ALTERNATE FUNCTION SELECT */ switch BL_reg(context) { case 0x10: /* GET EGA INFO */ @@ -706,7 +706,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) FIXME("Video Address Control - Not Supported\n"); break; default: - FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n", + FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n", AL_reg(context)); break; } @@ -716,8 +716,8 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) /* This one does not imply that string be at cursor. */ FIXME("Write String - Not Supported\n"); break; - - case 0x1a: + + case 0x1a: switch AL_reg(context) { case 0x00: /* GET DISPLAY COMBINATION CODE */ TRACE("Get Display Combination Code\n"); @@ -729,7 +729,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) FIXME("Set Display Combination Code - Not Supported\n"); break; default: - FIXME("INT 10 AH = 0x1a AL = 0x%x - Unknown\n", + FIXME("INT 10 AH = 0x1a AL = 0x%x - Unknown\n", AL_reg(context)); break; } @@ -755,7 +755,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) /* is there?....................(A.C.) */ TRACE("Just report the video not hercules compatible\n"); DX_reg(context) = 0xffff; - break; + break; default: FIXME("Unknown - 0x%x\n", AH_reg(context)); INT_BARF( context, 0x10 ); @@ -763,7 +763,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) } } -static void scroll_window(int direction, char lines, char row1, +static void scroll_window(int direction, char lines, char row1, char col1, char row2, char col2, char attribute) { if (!lines) /* Actually, clear the window */ @@ -779,7 +779,7 @@ static void scroll_window(int direction, char lines, char row1, VGA_ScrollDownText(row1, col1, row2, col2, lines, attribute); } } - + /********************************************************************** * DOSVM_PutChar diff --git a/dlls/winedos/int16.c b/dlls/winedos/int16.c index f4538bfb53a..795ff25f3ec 100644 --- a/dlls/winedos/int16.c +++ b/dlls/winedos/int16.c @@ -42,7 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); * Handler for int 16h (keyboard) * * NOTE: - * + * * KEYB.COM (DOS >3.2) adds functions to this interrupt, they are * not currently listed here. */ diff --git a/dlls/winedos/int21.c b/dlls/winedos/int21.c index ae76337a4c8..7f21dca995a 100644 --- a/dlls/winedos/int21.c +++ b/dlls/winedos/int21.c @@ -83,12 +83,12 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) /* FIXME: buffers are not flushed */ /* - * If AL is not one of 0x01, 0x06, 0x07, 0x08, or 0x0a, + * If AL is not one of 0x01, 0x06, 0x07, 0x08, or 0x0a, * the buffer is flushed but no input is attempted. */ if(al != 0x01 && al != 0x06 && al != 0x07 && al != 0x08 && al != 0x0a) return; - + AH_reg(context) = al; } diff --git a/dlls/winedos/int33.c b/dlls/winedos/int33.c index eba98c213bb..1286f52bf8c 100644 --- a/dlls/winedos/int33.c +++ b/dlls/winedos/int33.c @@ -208,7 +208,7 @@ void WINAPI DOSVM_Int33Message(UINT message,WPARAM wParam,LPARAM lParam) if (!VGA_GetMode(&Height,&Width,NULL)) { /* may need to do some coordinate scaling */ - if (Width) + if (Width) SX = 640/Width; if (!SX) SX=1; } @@ -270,7 +270,7 @@ void WINAPI DOSVM_Int33Console(MOUSE_EVENT_RECORD *record) mask |= 0x20; else if(!newMiddleButton && oldMiddleButton) mask |= 0x40; - + VGA_GetAlphaMode(&Width, &Height); QueueMouseRelay(640 / Width * record->dwMousePosition.X, diff --git a/dlls/winedos/int67.c b/dlls/winedos/int67.c index 0f80d61fc11..2693eb918d4 100644 --- a/dlls/winedos/int67.c +++ b/dlls/winedos/int67.c @@ -36,12 +36,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); */ #define EMS_PAGE_ADDRESS(base,page) (((char*)base) + EMS_PAGE_SIZE * page) -/* +/* * Maximum number of pages that can be allocated using EMS. */ #define EMS_MAX_PAGES 1024 -/* +/* * Maximum number of EMS handles (allocated blocks). */ #define EMS_MAX_HANDLES 256 @@ -78,24 +78,24 @@ struct { } *EMS_record = 0; /********************************************************************** - * EMS_init + * EMS_init * * Allocates and initialized page frame and EMS global import record. */ static void EMS_init(void) { /* - * FIXME: Should dynamically allocate upper memory block for EMS frame. + * FIXME: Should dynamically allocate upper memory block for EMS frame. */ ULONG base = 0xd0000; if(EMS_record) return; - EMS_record = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, + EMS_record = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, sizeof(*EMS_record)); - + EMS_record->frame_address = DOSMEM_MapDosToLinear(base); EMS_record->frame_selector = base >> 4; } @@ -124,8 +124,8 @@ static void EMS_alloc( CONTEXT86 *context ) EMS_record->handle[hindex].address = buffer; EMS_record->handle[hindex].pages = pages; EMS_record->used_pages += pages; - - DX_reg(context) = hindex; /* handle to allocated memory*/ + + DX_reg(context) = hindex; /* handle to allocated memory*/ AH_reg(context) = 0; /* status: ok */ } } @@ -157,7 +157,7 @@ static void EMS_access_name( CONTEXT86 *context ) memcpy(EMS_record->handle[hindex].name, ptr, 8); AH_reg(context) = 0; break; - + default: INT_BARF(context,0x67); break; @@ -259,7 +259,7 @@ void WINAPI DOSVM_Int67Handler( CONTEXT86 *context ) case 0x42: /* EMS - GET NUMBER OF PAGES */ EMS_init(); /* unallocated 16k pages */ - BX_reg(context) = EMS_MAX_PAGES - EMS_record->used_pages; + BX_reg(context) = EMS_MAX_PAGES - EMS_record->used_pages; /* total number of 16k pages */ DX_reg(context) = EMS_MAX_PAGES; /* status: ok */ diff --git a/dlls/winedos/ioports.c b/dlls/winedos/ioports.c index 81fd2332818..3e94b14226e 100644 --- a/dlls/winedos/ioports.c +++ b/dlls/winedos/ioports.c @@ -59,7 +59,7 @@ BOOL WINAPI DOSVM_inport( int port, int size, DWORD *res ) case 0xC6: case 0xC8: case 0xCA: - case 0xCC: + case 0xCC: case 0xCE: case 0x87: case 0x83: @@ -98,7 +98,7 @@ BOOL WINAPI DOSVM_outport( int port, int size, DWORD value ) case 0x20: DOSVM_PIC_ioport_out( port, (BYTE)value ); break; - case 0x226: + case 0x226: case 0x22c: SB_ioport_out( port, (BYTE)value ); break; @@ -120,7 +120,7 @@ BOOL WINAPI DOSVM_outport( int port, int size, DWORD value ) case 0xC6: case 0xC8: case 0xCA: - case 0xCC: + case 0xCC: case 0xCE: case 0x87: case 0x83: diff --git a/dlls/winedos/module.c b/dlls/winedos/module.c index dcf2dfa76d2..d2b8a58c818 100644 --- a/dlls/winedos/module.c +++ b/dlls/winedos/module.c @@ -122,7 +122,7 @@ static void MZ_FillPSP( LPVOID lpPSP, LPBYTE cmdline, int length ) /* command.com does not skip over multiple spaces */ if(length > 126) { - ERR("Command line truncated! (length %d > maximum length 126)\n", + ERR("Command line truncated! (length %d > maximum length 126)\n", length); length = 126; } @@ -224,7 +224,7 @@ static BOOL MZ_DoLoadImage( HANDLE hFile, LPCSTR filename, OverlayBlock *oblk ) SetFilePointer(hFile,0,NULL,FILE_BEGIN); if ( !ReadFile(hFile,&mz_header,sizeof(mz_header),&len,NULL) - || len != sizeof(mz_header) + || len != sizeof(mz_header) || mz_header.e_magic != IMAGE_DOS_SIGNATURE) { char *p = strrchr( filename, '.' ); if (!p || strcasecmp( p, ".com" )) /* check for .COM extension */ @@ -478,7 +478,7 @@ static void MZ_Launch(void) pTask->flags |= TDBF_WINOLDAP; _LeaveWin16Lock(); - + ResumeThread(dosvm_thread); rv = DOSVM_Loop(dosvm_thread); diff --git a/dlls/winedos/soundblaster.c b/dlls/winedos/soundblaster.c index 833351b99d8..72e8fa6d9f3 100644 --- a/dlls/winedos/soundblaster.c +++ b/dlls/winedos/soundblaster.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(sblaster); /* Board Configuration */ -/* FIXME: Should be in a config file */ +/* FIXME: Should be in a config file */ #define SB_IRQ 5 #define SB_IRQ_PRI 11 #define SB_DMA 1 @@ -39,15 +39,15 @@ static int SampleRate; static int SamplesCount; static BYTE DSP_Command[256]; /* Store param numbers in bytes for each command */ static BYTE DSP_InBuffer[10]; /* Store DSP command bytes parameters from host */ -static int InSize; /* Nb of bytes in InBuffer */ +static int InSize; /* Nb of bytes in InBuffer */ static BYTE DSP_OutBuffer[10]; /* Store DSP information bytes to host */ -static int OutSize; /* Nb of bytes in InBuffer */ +static int OutSize; /* Nb of bytes in InBuffer */ static int command; /* Current command */ static int end_sound_loop = 0; static int dma_enable = 0; /* The maximum size of a dma transfer can be 65536 */ -#define DMATRFSIZE 1024 +#define DMATRFSIZE 1024 /* DMA can perform 8 or 16-bit transfer */ static BYTE dma_buffer[DMATRFSIZE*2]; @@ -79,7 +79,7 @@ static DWORD CALLBACK SB_Poll( void *dummy ) DWORD dwbyteswritten2 = 0; int size; - /* FIXME: this loop must be improved */ + /* FIXME: this loop must be improved */ while(!end_sound_loop) { Sleep(10); @@ -212,11 +212,11 @@ void SB_Reset() /* Put a garbage value in the output buffer */ OutSize = 1; if (SB_Init()) - /* All right, let's put the magic value for autodetection */ + /* All right, let's put the magic value for autodetection */ DSP_OutBuffer[0] = 0xaa; else /* Something is wrong, put 0 to failed audetection */ - DSP_OutBuffer[0] = 0x00; + DSP_OutBuffer[0] = 0x00; } /* Find a standard sampling rate for DirectSound */ @@ -254,7 +254,7 @@ void SB_ioport_out( WORD port, BYTE val ) /* Fill the input buffer the command parameters if any */ DSP_InBuffer[InSize++]=val; else { - /* Process command */ + /* Process command */ switch(command) { case 0x10: /* SB */ @@ -304,7 +304,7 @@ void SB_ioport_out( WORD port, BYTE val ) case 0xE1: /* SB */ FIXME("DSP Version - Not Implemented\n"); break; - case 0xF2: /* SB */ + case 0xF2: /* SB */ TRACE("IRQ Request (8-bit)\n"); DOSVM_QueueEvent(SB_IRQ,SB_IRQ_PRI,NULL,NULL); break; @@ -322,7 +322,7 @@ void SB_ioport_out( WORD port, BYTE val ) case 0xB: FIXME("Generic DAC/ADC 8-bit not supported\n"); SampleMode = 0; - break; + break; case 0xC: FIXME("Generic DAC/ADC 16-bit not supported\n"); SampleMode = 1; @@ -361,7 +361,7 @@ BYTE SB_ioport_in( WORD port ) if (OutSize) res = DSP_OutBuffer[--OutSize]; else - /* return the last byte */ + /* return the last byte */ res = DSP_OutBuffer[0]; break; /* DSP - Write Buffer Status */ diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c index fc1dfad8b8d..b58d9ecc4b9 100644 --- a/dlls/winedos/vga.c +++ b/dlls/winedos/vga.c @@ -1,6 +1,6 @@ /* * VGA hardware emulation - * + * * Copyright 1998 Ove Kåven (with some help from Marcus Meissner) * * This library is free software; you can redistribute it and/or @@ -102,8 +102,8 @@ static PALETTEENTRY vga_def_palette[256]={ {0,0,0} /* FIXME: a series of continuous rainbow hues should follow */ }; -/* - * This palette is the dos default, converted from 18 bit color to 24. +/* + * This palette is the dos default, converted from 18 bit color to 24. * It contains only 64 entries of colors--all others are zeros. * --Robert 'Admiral' Coeyman */ @@ -386,12 +386,12 @@ char VGA_GetColor16(int reg) } /* set all 17 [char wide] colors at once in 16 color mode. */ -void VGA_Set16Palette(char *Table) +void VGA_Set16Palette(char *Table) { PALETTEENTRY *pal; int c; - if (!lpddraw) return; /* return if we're in text only mode */ + if (!lpddraw) return; /* return if we're in text only mode */ bcopy((void *)&vga_16_palette,(void *)Table,17); /* copy the entries into the table */ for (c=0; c<17; c++) { /* 17 entries */ @@ -402,10 +402,10 @@ void VGA_Set16Palette(char *Table) } /* Get all 17 [ char wide ] colors at once in 16 color mode. */ -void VGA_Get16Palette(char *Table) +void VGA_Get16Palette(char *Table) { - if (!lpddraw) return; /* return if we're in text only mode */ + if (!lpddraw) return; /* return if we're in text only mode */ bcopy((void *)Table,(void *)&vga_16_palette,17); /* copy the entries into the table */ } @@ -507,7 +507,7 @@ void VGA_WriteChars(unsigned X,unsigned Y,unsigned ch,int attr,int count) siz.Y = 1; off.X = 0; off.Y = 0; - dest.Top=Y; + dest.Top=Y; dest.Bottom=Y; VGA_GetAlphaMode(&XR, &YR); @@ -517,7 +517,7 @@ void VGA_WriteChars(unsigned X,unsigned Y,unsigned ch,int attr,int count) dest.Right = X + count; *dat++ = ch; - if (attr>=0) + if (attr>=0) *dat = attr; else info.Attributes = *dat; @@ -548,7 +548,7 @@ void VGA_PutChar(BYTE ascii) VGA_GetAlphaMode(&width, &height); VGA_GetCursorPos(&x, &y); - + switch(ascii) { case '\b': VGA_PutCharAt(' ', x, y); @@ -563,7 +563,7 @@ void VGA_PutChar(BYTE ascii) y++; x = 0; break; - + case '\a': break; @@ -598,7 +598,7 @@ void VGA_SetTextAttribute(BYTE attr) SetConsoleTextAttribute(VGA_AlphaConsole(), attr); } -void VGA_ClearText(unsigned row1, unsigned col1, +void VGA_ClearText(unsigned row1, unsigned col1, unsigned row2, unsigned col2, BYTE attr) { @@ -608,7 +608,7 @@ void VGA_ClearText(unsigned row1, unsigned col1, HANDLE con = VGA_AlphaConsole(); VGA_GetAlphaMode(&width, &height); - EnterCriticalSection(&vga_lock); + EnterCriticalSection(&vga_lock); for(y=row1; y<=row2; y++) { off.X = col1; @@ -626,14 +626,14 @@ void VGA_ClearText(unsigned row1, unsigned col1, LeaveCriticalSection(&vga_lock); } -void VGA_ScrollUpText(unsigned row1, unsigned col1, +void VGA_ScrollUpText(unsigned row1, unsigned col1, unsigned row2, unsigned col2, unsigned lines, BYTE attr) { FIXME("not implemented\n"); } -void VGA_ScrollDownText(unsigned row1, unsigned col1, +void VGA_ScrollDownText(unsigned row1, unsigned col1, unsigned row2, unsigned col2, unsigned lines, BYTE attr) { diff --git a/dlls/winedos/vga.h b/dlls/winedos/vga.h index 55262ee4422..5750b25ccec 100644 --- a/dlls/winedos/vga.h +++ b/dlls/winedos/vga.h @@ -1,6 +1,6 @@ /* * VGA emulation - * + * * Copyright 1998 Ove KÅven * * This library is free software; you can redistribute it and/or @@ -45,13 +45,13 @@ void VGA_GetCursorPos(unsigned*X,unsigned*Y); void VGA_WriteChars(unsigned X,unsigned Y,unsigned ch,int attr,int count); void VGA_PutChar(BYTE ascii); void VGA_SetTextAttribute(BYTE attr); -void VGA_ClearText(unsigned row1, unsigned col1, +void VGA_ClearText(unsigned row1, unsigned col1, unsigned row2, unsigned col2, BYTE attr); -void VGA_ScrollUpText(unsigned row1, unsigned col1, +void VGA_ScrollUpText(unsigned row1, unsigned col1, unsigned row2, unsigned col2, unsigned lines, BYTE attr); -void VGA_ScrollDownText(unsigned row1, unsigned col1, +void VGA_ScrollDownText(unsigned row1, unsigned col1, unsigned row2, unsigned col2, unsigned lines, BYTE attr); void VGA_GetCharacterAtCursor(BYTE *ascii, BYTE *attr); diff --git a/dlls/wineps/afm.c b/dlls/wineps/afm.c index 39c8daca5f3..7b73158a370 100644 --- a/dlls/wineps/afm.c +++ b/dlls/wineps/afm.c @@ -97,7 +97,7 @@ BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm, BOOL *p_added) sizeof(*newafmle)); if (newafmle == NULL) return FALSE; - + newafmle->afm = afm; while(family) { @@ -106,7 +106,7 @@ BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm, BOOL *p_added) insert = &(family->next); family = family->next; } - + if(!family) { family = HeapAlloc(PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(*family)); @@ -137,7 +137,7 @@ BOOL PSDRV_AddAFMtoList(FONTFAMILY **head, const AFM *afm, BOOL *p_added) tmpafmle = tmpafmle->next; } } - + tmpafmle = family->afmlist; while(tmpafmle->next) tmpafmle = tmpafmle->next; @@ -164,15 +164,15 @@ static void PSDRV_DumpFontList(void) for(afmle = family->afmlist; afmle; afmle = afmle->next) { INT i; - + TRACE("\tFontName '%s' (%i glyphs) - '%s' encoding:\n", afmle->afm->FontName, afmle->afm->NumofMetrics, afmle->afm->EncodingScheme); - + /* Uncomment to regenerate font data; see afm2c.c */ - + /* PSDRV_AFM2C(afmle->afm); */ - + for (i = 0; i < afmle->afm->NumofMetrics; ++i) { TRACE("\t\tU+%.4lX; C %i; N '%s'\n", afmle->afm->Metrics[i].UV, @@ -197,12 +197,12 @@ inline static SHORT MeanCharWidth(const AFM *afm) { float w = 0.0; int i; - + for (i = 0; i < afm->NumofMetrics; ++i) w += afm->Metrics[i].WX; - + w /= afm->NumofMetrics; - + return (SHORT)(w + 0.5); } @@ -216,25 +216,25 @@ static const struct { LONG UV; int weight; } UVweight[27] = { 0x0075, 31 }, { 0x0076, 10 }, { 0x0077, 18 }, { 0x0078, 3 }, { 0x0079, 18 }, { 0x007a, 2 }, { 0x0020, 166 } }; - + SHORT PSDRV_CalcAvgCharWidth(const AFM *afm) { float w = 0.0; int i; - + for (i = 0; i < 27; ++i) { const AFMMETRICS *afmm; - + afmm = PSDRV_UVMetrics(UVweight[i].UV, afm); if (afmm->UV != UVweight[i].UV) /* UVMetrics returns first glyph */ return MeanCharWidth(afm); /* in font if UV is missing */ - + w += afmm->WX * (float)(UVweight[i].weight); } - + w /= 1000.0; - + return (SHORT)(w + 0.5); } @@ -243,24 +243,24 @@ SHORT PSDRV_CalcAvgCharWidth(const AFM *afm) * AddBuiltinAFMs * */ - + static BOOL AddBuiltinAFMs() { const AFM *const *afm = PSDRV_BuiltinAFMs; - + while (*afm != NULL) { BOOL added; - + if (PSDRV_AddAFMtoList(&PSDRV_AFMFontList, *afm, &added) == FALSE) return FALSE; - + if (added == FALSE) TRACE("Ignoring built-in font %s\n", (*afm)->FontName); - + ++afm; } - + return TRUE; } @@ -276,12 +276,12 @@ static BOOL AddBuiltinAFMs() * If this function fails, PSDRV_Init will destroy PSDRV_Heap, so don't worry * about freeing all the memory that's been allocated. */ - + BOOL PSDRV_GetFontMetrics(void) { if (PSDRV_GlyphListInit() != 0) return FALSE; - + if (PSDRV_GetType1Metrics() == FALSE) return FALSE; @@ -292,10 +292,10 @@ BOOL PSDRV_GetFontMetrics(void) if (AddBuiltinAFMs() == FALSE) return FALSE; - + PSDRV_IndexGlyphList(); /* Enable fast searching of glyph names */ - + PSDRV_DumpFontList(); - + return TRUE; } diff --git a/dlls/wineps/afm2c.c b/dlls/wineps/afm2c.c index aa9494a8efa..10de740d8cf 100644 --- a/dlls/wineps/afm2c.c +++ b/dlls/wineps/afm2c.c @@ -57,14 +57,14 @@ inline static void cursorto(FILE *of, int np, int cp) { int ntp = np & 0xfffffff8; int ctp = cp & 0xfffffff8; - + while (ctp < ntp) { fputc('\t', of); ctp += 8; cp = ctp; } - + while (cp < np) { fputc(' ', of); @@ -75,7 +75,7 @@ inline static void cursorto(FILE *of, int np, int cp) static void writeHeader(FILE *of, const AFM *afm, const char *buffer) { int i; - + fputc('/', of); for (i = 1; i < 80; ++i) fputc('*', of); @@ -98,18 +98,18 @@ static void writeHeader(FILE *of, const AFM *afm, const char *buffer) static void writeMetrics(FILE *of, const AFM *afm, const char *buffer) { int i; - + fputs("\n\n/*\n * Glyph metrics\n */\n\n", of); - - fprintf(of, "static const AFMMETRICS metrics[%i] = \n{\n", + + fprintf(of, "static const AFMMETRICS metrics[%i] =\n{\n", afm->NumofMetrics); - + for (i = 0; i < afm->NumofMetrics - 1; ++i) { fprintf(of, " { %3i, 0x%.4lx, %4g, GN_%s },\n", afm->Metrics[i].C, afm->Metrics[i].UV, afm->Metrics[i].WX, afm->Metrics[i].N->sz); } - + fprintf(of, " { %3i, 0x%.4lx, %4g, GN_%s }\n};\n", afm->Metrics[i].C, afm->Metrics[i].UV, afm->Metrics[i].WX, afm->Metrics[i].N->sz); } @@ -188,30 +188,30 @@ void PSDRV_AFM2C(const AFM *afm) char buffer[256]; FILE *of; int i; - + strncpy(buffer, afm->FontName, sizeof(buffer) - 3); buffer[sizeof(buffer) - 3] = '\0'; - + for (i = 0; i < strlen(buffer); ++i) if (buffer[i] == '-') buffer[i] = '_'; - + buffer[i] = '.'; buffer[i + 1] = 'c'; buffer[i + 2] = '\0'; MESSAGE("writing '%s'\n", buffer); - + of = fopen(buffer, "w"); if (of == NULL) { ERR("error opening '%s' for writing\n", buffer); return; } - + buffer[i] = '\0'; - + writeHeader(of, afm, buffer); writeMetrics(of, afm, buffer); writeAFM(of, afm, buffer); - + fclose(of); } diff --git a/dlls/wineps/brush.c b/dlls/wineps/brush.c index bcddc2773b1..d5e522cc29a 100644 --- a/dlls/wineps/brush.c +++ b/dlls/wineps/brush.c @@ -183,7 +183,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) if(logbrush.lbHatch == HS_FDIAGONAL) break; /* else fallthrough for HS_DIAGCROSS */ - + case HS_BDIAGONAL: PSDRV_WriteGSave(physDev); PSDRV_Clip(physDev, EO); @@ -222,7 +222,7 @@ BOOL PSDRV_Brush(PSDRV_PDEVICE *physDev, BOOL EO) FIXME("Trying to set a pattern brush on a level 1 printer\n"); ret = FALSE; } - HeapFree(PSDRV_Heap, 0, bits); + HeapFree(PSDRV_Heap, 0, bits); } break; diff --git a/dlls/wineps/clipping.c b/dlls/wineps/clipping.c index bbb95abb2d3..85f78d75f0e 100644 --- a/dlls/wineps/clipping.c +++ b/dlls/wineps/clipping.c @@ -1,7 +1,7 @@ /* * PostScript clipping functions * - * Copyright 1999 Luc Tourangau + * Copyright 1999 Luc Tourangau * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -62,9 +62,9 @@ VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN hrgn ) { RECT *pRect = (RECT *)rgndata->Buffer; - PSDRV_WriteRectClip(physDev, pRect->left, pRect->top, - pRect->right - pRect->left, - pRect->bottom - pRect->top); + PSDRV_WriteRectClip(physDev, pRect->left, pRect->top, + pRect->right - pRect->left, + pRect->bottom - pRect->top); } else { @@ -79,15 +79,15 @@ VOID PSDRV_SetDeviceClipping( PSDRV_PDEVICE *physDev, HRGN hrgn ) pRect->left); PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 1, pRect->top); - PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 2, + PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 2, pRect->right - pRect->left); - PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 3, + PSDRV_WriteArrayPut(physDev, szArrayName, i * 4 + 3, pRect->bottom - pRect->top); } PSDRV_WriteRectClip2(physDev, szArrayName); } - + HeapFree( GetProcessHeap(), 0, rgndata ); return; } diff --git a/dlls/wineps/color.c b/dlls/wineps/color.c index fa3b6004295..e93bac2e408 100644 --- a/dlls/wineps/color.c +++ b/dlls/wineps/color.c @@ -27,7 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); * PSDRV_CmpColor * * Return TRUE if col1 == col2 - */ + */ BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2) { if(col1->type != col2->type) @@ -55,7 +55,7 @@ BOOL PSDRV_CmpColor(PSCOLOR *col1, PSCOLOR *col2) * PSDRV_CopyColor * * Copies col2 into col1. Return FALSE on error. - */ + */ BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2) { diff --git a/dlls/wineps/data/AvantGarde_Book.c b/dlls/wineps/data/AvantGarde_Book.c index 19f8d80f6aa..803f496367d 100644 --- a/dlls/wineps/data/AvantGarde_Book.c +++ b/dlls/wineps/data/AvantGarde_Book.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 277, GN_space }, { 33, 0x0021, 295, GN_exclam }, diff --git a/dlls/wineps/data/AvantGarde_BookOblique.c b/dlls/wineps/data/AvantGarde_BookOblique.c index 484ff3c0451..805163d330d 100644 --- a/dlls/wineps/data/AvantGarde_BookOblique.c +++ b/dlls/wineps/data/AvantGarde_BookOblique.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 277, GN_space }, { 33, 0x0021, 295, GN_exclam }, diff --git a/dlls/wineps/data/AvantGarde_Demi.c b/dlls/wineps/data/AvantGarde_Demi.c index c44a5662933..9580f92efd7 100644 --- a/dlls/wineps/data/AvantGarde_Demi.c +++ b/dlls/wineps/data/AvantGarde_Demi.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 280, GN_space }, { 33, 0x0021, 280, GN_exclam }, diff --git a/dlls/wineps/data/AvantGarde_DemiOblique.c b/dlls/wineps/data/AvantGarde_DemiOblique.c index 1b11a4a8f5f..085e6df2ef1 100644 --- a/dlls/wineps/data/AvantGarde_DemiOblique.c +++ b/dlls/wineps/data/AvantGarde_DemiOblique.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 280, GN_space }, { 33, 0x0021, 280, GN_exclam }, diff --git a/dlls/wineps/data/Bookman_Demi.c b/dlls/wineps/data/Bookman_Demi.c index 02a815d2c3a..0859e48811f 100644 --- a/dlls/wineps/data/Bookman_Demi.c +++ b/dlls/wineps/data/Bookman_Demi.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 340, GN_space }, { 33, 0x0021, 360, GN_exclam }, diff --git a/dlls/wineps/data/Bookman_DemiItalic.c b/dlls/wineps/data/Bookman_DemiItalic.c index 4cd89706516..ffa8bb7bef0 100644 --- a/dlls/wineps/data/Bookman_DemiItalic.c +++ b/dlls/wineps/data/Bookman_DemiItalic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 340, GN_space }, { 33, 0x0021, 320, GN_exclam }, diff --git a/dlls/wineps/data/Bookman_Light.c b/dlls/wineps/data/Bookman_Light.c index d4001104b81..36a73c434a1 100644 --- a/dlls/wineps/data/Bookman_Light.c +++ b/dlls/wineps/data/Bookman_Light.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 320, GN_space }, { 33, 0x0021, 300, GN_exclam }, diff --git a/dlls/wineps/data/Bookman_LightItalic.c b/dlls/wineps/data/Bookman_LightItalic.c index f986d0033cb..e315b0a5896 100644 --- a/dlls/wineps/data/Bookman_LightItalic.c +++ b/dlls/wineps/data/Bookman_LightItalic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 300, GN_space }, { 33, 0x0021, 320, GN_exclam }, diff --git a/dlls/wineps/data/Courier.c b/dlls/wineps/data/Courier.c index 3181784dbc4..4c898766fa7 100644 --- a/dlls/wineps/data/Courier.c +++ b/dlls/wineps/data/Courier.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[243] = +static const AFMMETRICS metrics[243] = { { 32, 0x0020, 600, GN_space }, { 33, 0x0021, 600, GN_exclam }, diff --git a/dlls/wineps/data/Courier_Bold.c b/dlls/wineps/data/Courier_Bold.c index 9d2a08728ca..4bb6543d547 100644 --- a/dlls/wineps/data/Courier_Bold.c +++ b/dlls/wineps/data/Courier_Bold.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[243] = +static const AFMMETRICS metrics[243] = { { 32, 0x0020, 600, GN_space }, { 33, 0x0021, 600, GN_exclam }, diff --git a/dlls/wineps/data/Courier_BoldOblique.c b/dlls/wineps/data/Courier_BoldOblique.c index b9f65df47c5..8657a2b9d53 100644 --- a/dlls/wineps/data/Courier_BoldOblique.c +++ b/dlls/wineps/data/Courier_BoldOblique.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[243] = +static const AFMMETRICS metrics[243] = { { 32, 0x0020, 600, GN_space }, { 33, 0x0021, 600, GN_exclam }, diff --git a/dlls/wineps/data/Courier_Oblique.c b/dlls/wineps/data/Courier_Oblique.c index 4bbdc66a991..cd4324d763d 100644 --- a/dlls/wineps/data/Courier_Oblique.c +++ b/dlls/wineps/data/Courier_Oblique.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[243] = +static const AFMMETRICS metrics[243] = { { 32, 0x0020, 600, GN_space }, { 33, 0x0021, 600, GN_exclam }, diff --git a/dlls/wineps/data/Helvetica.c b/dlls/wineps/data/Helvetica.c index 090c565a8b4..0ead75b5e8c 100644 --- a/dlls/wineps/data/Helvetica.c +++ b/dlls/wineps/data/Helvetica.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 278, GN_space }, { 33, 0x0021, 278, GN_exclam }, diff --git a/dlls/wineps/data/Helvetica_Bold.c b/dlls/wineps/data/Helvetica_Bold.c index 3dd4b483ee6..e9cf1a37554 100644 --- a/dlls/wineps/data/Helvetica_Bold.c +++ b/dlls/wineps/data/Helvetica_Bold.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 278, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/Helvetica_BoldOblique.c b/dlls/wineps/data/Helvetica_BoldOblique.c index efa80d7b739..e807a9a2b42 100644 --- a/dlls/wineps/data/Helvetica_BoldOblique.c +++ b/dlls/wineps/data/Helvetica_BoldOblique.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 278, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/Helvetica_Narrow.c b/dlls/wineps/data/Helvetica_Narrow.c index ca93121faaf..64f2e88effc 100644 --- a/dlls/wineps/data/Helvetica_Narrow.c +++ b/dlls/wineps/data/Helvetica_Narrow.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 228, GN_space }, { 33, 0x0021, 228, GN_exclam }, diff --git a/dlls/wineps/data/Helvetica_Narrow_Bold.c b/dlls/wineps/data/Helvetica_Narrow_Bold.c index a827e862389..8f6a6e3b38c 100644 --- a/dlls/wineps/data/Helvetica_Narrow_Bold.c +++ b/dlls/wineps/data/Helvetica_Narrow_Bold.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 228, GN_space }, { 33, 0x0021, 273, GN_exclam }, diff --git a/dlls/wineps/data/Helvetica_Narrow_BoldOblique.c b/dlls/wineps/data/Helvetica_Narrow_BoldOblique.c index 0cd25d83e19..0ad9edc2cb7 100644 --- a/dlls/wineps/data/Helvetica_Narrow_BoldOblique.c +++ b/dlls/wineps/data/Helvetica_Narrow_BoldOblique.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 228, GN_space }, { 33, 0x0021, 273, GN_exclam }, diff --git a/dlls/wineps/data/Helvetica_Narrow_Oblique.c b/dlls/wineps/data/Helvetica_Narrow_Oblique.c index 231eabd4749..b12768781ea 100644 --- a/dlls/wineps/data/Helvetica_Narrow_Oblique.c +++ b/dlls/wineps/data/Helvetica_Narrow_Oblique.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 228, GN_space }, { 33, 0x0021, 228, GN_exclam }, diff --git a/dlls/wineps/data/Helvetica_Oblique.c b/dlls/wineps/data/Helvetica_Oblique.c index 7701568ed7f..b6eba3a2f75 100644 --- a/dlls/wineps/data/Helvetica_Oblique.c +++ b/dlls/wineps/data/Helvetica_Oblique.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 278, GN_space }, { 33, 0x0021, 278, GN_exclam }, diff --git a/dlls/wineps/data/NewCenturySchlbk_Bold.c b/dlls/wineps/data/NewCenturySchlbk_Bold.c index 7488d2af8a0..b88fc289eba 100644 --- a/dlls/wineps/data/NewCenturySchlbk_Bold.c +++ b/dlls/wineps/data/NewCenturySchlbk_Bold.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 287, GN_space }, { 33, 0x0021, 296, GN_exclam }, diff --git a/dlls/wineps/data/NewCenturySchlbk_BoldItalic.c b/dlls/wineps/data/NewCenturySchlbk_BoldItalic.c index 31ffed20813..f0c6967f64b 100644 --- a/dlls/wineps/data/NewCenturySchlbk_BoldItalic.c +++ b/dlls/wineps/data/NewCenturySchlbk_BoldItalic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 287, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/NewCenturySchlbk_Italic.c b/dlls/wineps/data/NewCenturySchlbk_Italic.c index 9d5b49a7d27..776af09488b 100644 --- a/dlls/wineps/data/NewCenturySchlbk_Italic.c +++ b/dlls/wineps/data/NewCenturySchlbk_Italic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 278, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/NewCenturySchlbk_Roman.c b/dlls/wineps/data/NewCenturySchlbk_Roman.c index 412f8fcb71b..30e6268b86a 100644 --- a/dlls/wineps/data/NewCenturySchlbk_Roman.c +++ b/dlls/wineps/data/NewCenturySchlbk_Roman.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 278, GN_space }, { 33, 0x0021, 296, GN_exclam }, diff --git a/dlls/wineps/data/Palatino_Bold.c b/dlls/wineps/data/Palatino_Bold.c index 64d5173d35a..8a973eee115 100644 --- a/dlls/wineps/data/Palatino_Bold.c +++ b/dlls/wineps/data/Palatino_Bold.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 250, GN_space }, { 33, 0x0021, 278, GN_exclam }, diff --git a/dlls/wineps/data/Palatino_BoldItalic.c b/dlls/wineps/data/Palatino_BoldItalic.c index c8184a025e1..e5f3fdb5287 100644 --- a/dlls/wineps/data/Palatino_BoldItalic.c +++ b/dlls/wineps/data/Palatino_BoldItalic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 250, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/Palatino_Italic.c b/dlls/wineps/data/Palatino_Italic.c index 9aed15414f8..762cc550283 100644 --- a/dlls/wineps/data/Palatino_Italic.c +++ b/dlls/wineps/data/Palatino_Italic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 250, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/Palatino_Roman.c b/dlls/wineps/data/Palatino_Roman.c index 2565ad09925..598f5e22bc1 100644 --- a/dlls/wineps/data/Palatino_Roman.c +++ b/dlls/wineps/data/Palatino_Roman.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 250, GN_space }, { 33, 0x0021, 278, GN_exclam }, diff --git a/dlls/wineps/data/Symbol.c b/dlls/wineps/data/Symbol.c index f81ecf3875c..9458a62bf0f 100644 --- a/dlls/wineps/data/Symbol.c +++ b/dlls/wineps/data/Symbol.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[188] = +static const AFMMETRICS metrics[188] = { { 32, 0xf020, 250, GN_space }, { 33, 0xf021, 333, GN_exclam }, diff --git a/dlls/wineps/data/Times_Bold.c b/dlls/wineps/data/Times_Bold.c index 92a202cc106..56036fdc163 100644 --- a/dlls/wineps/data/Times_Bold.c +++ b/dlls/wineps/data/Times_Bold.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 250, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/Times_BoldItalic.c b/dlls/wineps/data/Times_BoldItalic.c index 05c607acccc..a127b4331ea 100644 --- a/dlls/wineps/data/Times_BoldItalic.c +++ b/dlls/wineps/data/Times_BoldItalic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 250, GN_space }, { 33, 0x0021, 389, GN_exclam }, diff --git a/dlls/wineps/data/Times_Italic.c b/dlls/wineps/data/Times_Italic.c index f3293337954..5e192846585 100644 --- a/dlls/wineps/data/Times_Italic.c +++ b/dlls/wineps/data/Times_Italic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 250, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/Times_Roman.c b/dlls/wineps/data/Times_Roman.c index f1e43cb2aeb..6f8eb4a2651 100644 --- a/dlls/wineps/data/Times_Roman.c +++ b/dlls/wineps/data/Times_Roman.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 250, GN_space }, { 33, 0x0021, 333, GN_exclam }, diff --git a/dlls/wineps/data/ZapfChancery_MediumItalic.c b/dlls/wineps/data/ZapfChancery_MediumItalic.c index 25704f31415..1353cf7ce91 100644 --- a/dlls/wineps/data/ZapfChancery_MediumItalic.c +++ b/dlls/wineps/data/ZapfChancery_MediumItalic.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[228] = +static const AFMMETRICS metrics[228] = { { 32, 0x0020, 220, GN_space }, { 33, 0x0021, 280, GN_exclam }, diff --git a/dlls/wineps/data/ZapfDingbats.c b/dlls/wineps/data/ZapfDingbats.c index ad27bf32f5d..2c7ce49cfdf 100644 --- a/dlls/wineps/data/ZapfDingbats.c +++ b/dlls/wineps/data/ZapfDingbats.c @@ -17,7 +17,7 @@ * Glyph metrics */ -static const AFMMETRICS metrics[188] = +static const AFMMETRICS metrics[188] = { { 32, 0xf020, 278, GN_space }, { 33, 0xf021, 974, GN_a1 }, diff --git a/dlls/wineps/data/agl.c b/dlls/wineps/data/agl.c index 76e8271f69f..c7c2d381d9b 100644 --- a/dlls/wineps/data/agl.c +++ b/dlls/wineps/data/agl.c @@ -1353,7 +1353,7 @@ GLYPHNAME PSDRV_AGLGlyphNames[1258] = const INT PSDRV_AGLbyNameSize = 1039; -const UNICODEGLYPH PSDRV_AGLbyName[1039] = +const UNICODEGLYPH PSDRV_AGLbyName[1039] = { { 0x0041, GN_A }, { 0x00c6, GN_AE }, { 0x01fc, GN_AEacute }, { 0xf7e6, GN_AEsmall }, @@ -1884,7 +1884,7 @@ const UNICODEGLYPH PSDRV_AGLbyName[1039] = const INT PSDRV_AGLbyUVSize = 1051; -const UNICODEGLYPH PSDRV_AGLbyUV[1051] = +const UNICODEGLYPH PSDRV_AGLbyUV[1051] = { { 0x0020, GN_space }, { 0x0021, GN_exclam }, { 0x0022, GN_quotedbl }, { 0x0023, GN_numbersign }, diff --git a/dlls/wineps/driver.c b/dlls/wineps/driver.c index 9738e062ec7..4d7a717b355 100644 --- a/dlls/wineps/driver.c +++ b/dlls/wineps/driver.c @@ -1,7 +1,7 @@ /* * Exported functions from the PostScript driver. * - * [Ext]DeviceMode, DeviceCapabilities, AdvancedSetupDialog. + * [Ext]DeviceMode, DeviceCapabilities, AdvancedSetupDialog. * * Will need ExtTextOut for winword6 (urgh!) * @@ -65,7 +65,7 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2, } if(page) { dm1->dmPublic.u1.s1.dmPaperSize = dm2->dmPublic.u1.s1.dmPaperSize; - dm1->dmPublic.u1.s1.dmPaperWidth = page->PaperDimension->x * + dm1->dmPublic.u1.s1.dmPaperWidth = page->PaperDimension->x * 254.0 / 72.0; dm1->dmPublic.u1.s1.dmPaperLength = page->PaperDimension->y * 254.0 / 72.0; @@ -80,8 +80,8 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2, } } else if((dm2->dmPublic.dmFields & DM_PAPERLENGTH) && (dm2->dmPublic.dmFields & DM_PAPERWIDTH)) { - dm1->dmPublic.u1.s1.dmPaperLength = dm2->dmPublic.u1.s1.dmPaperLength; - dm1->dmPublic.u1.s1.dmPaperWidth = dm2->dmPublic.u1.s1.dmPaperWidth; + dm1->dmPublic.u1.s1.dmPaperLength = dm2->dmPublic.u1.s1.dmPaperLength; + dm1->dmPublic.u1.s1.dmPaperWidth = dm2->dmPublic.u1.s1.dmPaperWidth; TRACE("Changing PaperLength|Width to %dx%d\n", dm2->dmPublic.u1.s1.dmPaperLength, dm2->dmPublic.u1.s1.dmPaperWidth); @@ -108,7 +108,7 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2, if(dm2->dmPublic.dmFields & DM_DEFAULTSOURCE) { INPUTSLOT *slot; - + for(slot = pi->ppd->InputSlots; slot; slot = slot->next) { if(slot->WinBin == dm2->dmPublic.dmDefaultSource) break; @@ -191,7 +191,7 @@ BOOL WINAPI PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { PSDRV_DLGINFO *di; - int i, Cursel = 0; + int i, Cursel = 0; PAGESIZE *ps; @@ -201,7 +201,7 @@ BOOL WINAPI PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SetWindowLongA(hwnd, DWL_USER, (LONG)di); for(ps = di->pi->ppd->PageSizes, i = 0; ps; ps = ps->next, i++) { - SendDlgItemMessageA(hwnd, IDD_PAPERS, LB_INSERTSTRING, i, + SendDlgItemMessageA(hwnd, IDD_PAPERS, LB_INSERTSTRING, i, (LPARAM)ps->FullName); if(di->pi->Devmode->dmPublic.u1.s1.dmPaperSize == ps->WinPage) Cursel = i; @@ -254,7 +254,7 @@ BOOL WINAPI PSDRV_PaperDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM } break; } - + default: return FALSE; } @@ -306,7 +306,7 @@ fwMode); "InitCommonControls"); pCreatePropertySheetPage = (void*)GetProcAddress(hinstComctl32, "CreatePropertySheetPageW"); - pPropertySheet = (void*)GetProcAddress(hinstComctl32, "PropertySheetW"); + pPropertySheet = (void*)GetProcAddress(hinstComctl32, "PropertySheetW"); memset(&psp,0,sizeof(psp)); dlgdm = HeapAlloc( PSDRV_Heap, 0, sizeof(*dlgdm) ); memcpy(dlgdm, pi->Devmode, sizeof(*dlgdm)); @@ -327,9 +327,9 @@ fwMode); psh.nPages = 1; psh.hwndParent = hwnd; psh.u3.phpage = hpsp; - + pPropertySheet(&psh); - + } if(fwMode & DM_UPDATE) FIXME("Mode DM_UPDATE. Just do the same as DM_COPY\n"); @@ -444,7 +444,7 @@ DWORD WINAPI PSDRV_DeviceCapabilities16(LPCSTR lpszDevice, LPCSTR lpszPort, INPUTSLOT *slot; char *cp = lpszOutput; int i = 0; - + /* Add an entry corresponding to DMBIN_AUTO, see DC_BINS */ i++; if(lpszOutput != NULL) { @@ -513,7 +513,7 @@ DWORD WINAPI PSDRV_DeviceCapabilities16(LPCSTR lpszDevice, LPCSTR lpszPort, if(lpszOutput == NULL) return -1; - + i = 0; for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++) { if(ps->PaperDimension->x > ptMax.x) @@ -534,7 +534,7 @@ DWORD WINAPI PSDRV_DeviceCapabilities16(LPCSTR lpszDevice, LPCSTR lpszPort, if(lpszOutput == NULL) return -1; - + i = 0; for(ps = pi->ppd->PageSizes; ps; ps = ps->next, i++) { if(ps->PaperDimension->x > ptMax.x) @@ -581,7 +581,7 @@ DWORD PSDRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice, void WINAPI PSDRV_DeviceMode16(HWND16 hwnd, HANDLE16 hDriver, LPSTR lpszDevice, LPSTR lpszPort) { - PSDRV_ExtDeviceMode16( hwnd, hDriver, NULL, lpszDevice, lpszPort, NULL, + PSDRV_ExtDeviceMode16( hwnd, hDriver, NULL, lpszDevice, lpszPort, NULL, NULL, DM_PROMPT ); return; } @@ -601,9 +601,9 @@ INT PSDRV_ExtDeviceModePropSheet(HWND hwnd, LPSTR lpszDevice, LPSTR lpszPort, psp->dwSize = sizeof(psp); psp->hInstance = 0x1234; - + ps->nPages = 1; - + } #endif diff --git a/dlls/wineps/escape.c b/dlls/wineps/escape.c index a6ba9906da3..01ce614b255 100644 --- a/dlls/wineps/escape.c +++ b/dlls/wineps/escape.c @@ -139,7 +139,7 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i return 0; } - case SETCHARSET: + case SETCHARSET: /* Undocumented escape used by winword6. Switches between ANSI and a special charset. If *lpInData == 1 we require that @@ -151,7 +151,7 @@ INT PSDRV_ExtEscape( PSDRV_PDEVICE *physDev, INT nEscape, INT cbInput, LPCVOID i 0x96 is endash 0x97 is emdash 0xa0 is non break space - yeah right. - + If *lpInData == 0 we get ANSI. Since there's nothing else there, let's just make these the default anyway and see what happens... @@ -234,7 +234,7 @@ INT PSDRV_StartPage( PSDRV_PDEVICE *physDev ) return 1; } - + /************************************************************************ * PSDRV_EndPage */ diff --git a/dlls/wineps/font.c b/dlls/wineps/font.c index 2240c81dac1..91e5efe8e2e 100644 --- a/dlls/wineps/font.c +++ b/dlls/wineps/font.c @@ -59,9 +59,9 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font, USHORT usUnitsPerEm, usWinAscent, usWinDescent; SHORT sAscender, sDescender, sLineGap, sTypoAscender; SHORT sTypoDescender, sTypoLineGap, sAvgCharWidth; - + TRACE("'%s' %li\n", afm->FontName, lfHeight); - + if (lfHeight < 0) /* match em height */ { font->scale = - ((float)lfHeight / (float)(wm->usUnitsPerEm)); @@ -71,10 +71,10 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font, font->scale = (float)lfHeight / (float)(wm->usWinAscent + wm->usWinDescent); } - + font->size = (INT)round(font->scale * (float)wm->usUnitsPerEm); font->set = FALSE; - + usUnitsPerEm = (USHORT)round((float)(wm->usUnitsPerEm) * font->scale); sAscender = (SHORT)round((float)(wm->sAscender) * font->scale); sDescender = (SHORT)round((float)(wm->sDescender) * font->scale); @@ -85,22 +85,22 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font, usWinAscent = (USHORT)round((float)(wm->usWinAscent) * font->scale); usWinDescent = (USHORT)round((float)(wm->usWinDescent) * font->scale); sAvgCharWidth = (SHORT)round((float)(wm->sAvgCharWidth) * font->scale); - + tm->tmAscent = (LONG)usWinAscent; tm->tmDescent = (LONG)usWinDescent; tm->tmHeight = tm->tmAscent + tm->tmDescent; - + tm->tmInternalLeading = tm->tmHeight - (LONG)usUnitsPerEm; if (tm->tmInternalLeading < 0) tm->tmInternalLeading = 0; - + tm->tmExternalLeading = (LONG)(sAscender - sDescender + sLineGap) - tm->tmHeight; if (tm->tmExternalLeading < 0) tm->tmExternalLeading = 0; - + tm->tmAveCharWidth = (LONG)sAvgCharWidth; - + tm->tmWeight = afm->Weight; tm->tmItalic = (afm->ItalicAngle != 0.0); tm->tmUnderlined = 0; @@ -109,28 +109,28 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font, tm->tmLastChar = (WCHAR)(afm->Metrics[afm->NumofMetrics - 1].UV); tm->tmDefaultChar = 0x001f; /* Win2K does this - FIXME? */ tm->tmBreakChar = tm->tmFirstChar; /* should be 'space' */ - + tm->tmPitchAndFamily = TMPF_DEVICE | TMPF_VECTOR; if (!afm->IsFixedPitch) tm->tmPitchAndFamily |= TMPF_FIXED_PITCH; /* yes, it's backwards */ if (wm->usUnitsPerEm != 1000) tm->tmPitchAndFamily |= TMPF_TRUETYPE; - + tm->tmCharSet = ANSI_CHARSET; /* FIXME */ tm->tmOverhang = 0; - + /* * This is kludgy. font->scale is used in several places in the driver * to adjust PostScript-style metrics. Since these metrics have been * "normalized" to an em-square size of 1000, font->scale needs to be * similarly adjusted.. */ - + font->scale *= (float)wm->usUnitsPerEm / 1000.0; - + tm->tmMaxCharWidth = (LONG)round( (afm->FontBBox.urx - afm->FontBBox.llx) * font->scale); - + TRACE("Selected PS font '%s' size %d weight %ld.\n", afm->FontName, font->size, tm->tmWeight ); TRACE("H = %ld As = %ld Des = %ld IL = %ld EL = %ld\n", tm->tmHeight, @@ -161,7 +161,7 @@ HFONT PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont ) bd = TRUE; WideCharToMultiByte(CP_ACP, 0, lf.lfFaceName, -1, FaceName, sizeof(FaceName), NULL, NULL); - + if(FaceName[0] == '\0') { switch(lf.lfPitchAndFamily & 0xf0) { case FF_DONTCARE: @@ -246,28 +246,28 @@ HFONT PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont ) TRACE("Got family '%s'\n", family->FamilyName); for(afmle = family->afmlist; afmle; afmle = afmle->next) { - if( (bd == (afmle->afm->Weight == FW_BOLD)) && + if( (bd == (afmle->afm->Weight == FW_BOLD)) && (it == (afmle->afm->ItalicAngle != 0.0)) ) break; } if(!afmle) afmle = family->afmlist; /* not ideal */ - + TRACE("Got font '%s'\n", afmle->afm->FontName); - + physDev->font.afm = afmle->afm; /* stock fonts ignore the mapping mode */ if (!is_stock_font( hfont )) lf.lfHeight = INTERNAL_YWSTODS(physDev->dc, lf.lfHeight); ScaleFont(physDev->font.afm, lf.lfHeight, &(physDev->font), &(physDev->font.tm)); - + physDev->font.escapement = lf.lfEscapement; - + /* Does anyone know if these are supposed to be reversed like this? */ - + physDev->font.tm.tmDigitizedAspectX = physDev->logPixelsY; physDev->font.tm.tmDigitizedAspectY = physDev->logPixelsX; - + return TRUE; /* We'll use a device font for now */ } @@ -290,23 +290,23 @@ static int MetricsByUV(const void *a, const void *b) { return (int)(((const AFMMETRICS *)a)->UV - ((const AFMMETRICS *)b)->UV); } - + const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm) { AFMMETRICS key; const AFMMETRICS *needle; - + /* * Ugly work-around for symbol fonts. Wine is sending characters which * belong in the Unicode private use range (U+F020 - U+F0FF) as ASCII * characters (U+0020 - U+00FF). */ - + if ((afm->Metrics->UV & 0xff00) == 0xf000 && UV < 0x100) UV |= 0xf000; - + key.UV = UV; - + needle = bsearch(&key, afm->Metrics, afm->NumofMetrics, sizeof(AFMMETRICS), MetricsByUV); @@ -315,7 +315,7 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm) WARN("No glyph for U+%.4lX in %s\n", UV, afm->FontName); needle = afm->Metrics; } - + return needle; } @@ -327,20 +327,20 @@ BOOL PSDRV_GetTextExtentPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count, LP DC *dc = physDev->dc; int i; float width = 0.0; - + TRACE("%s %i\n", debugstr_wn(str, count), count); - + for (i = 0; i < count && str[i] != '\0'; ++i) width += PSDRV_UVMetrics(str[i], physDev->font.afm)->WX; - + width *= physDev->font.scale; - + size->cx = GDI_ROUND((FLOAT)width * dc->xformVport2World.eM11); size->cy = GDI_ROUND((FLOAT)physDev->font.tm.tmHeight * dc->xformVport2World.eM22); - + TRACE("cx=%li cy=%li\n", size->cx, size->cy); - + return TRUE; } @@ -350,15 +350,15 @@ BOOL PSDRV_GetTextExtentPoint(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count, LP BOOL PSDRV_GetCharWidth(PSDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, LPINT buffer) { UINT i; - + TRACE("U+%.4X U+%.4X\n", firstChar, lastChar); - + if (lastChar > 0xffff || firstChar > lastChar) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - + for (i = firstChar; i <= lastChar; ++i) { *buffer = GDI_ROUND(PSDRV_UVMetrics(i, physDev->font.afm)->WX @@ -366,10 +366,10 @@ BOOL PSDRV_GetCharWidth(PSDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, L TRACE("U+%.4X: %i\n", i, *buffer); ++buffer; } - + return TRUE; } - + /*********************************************************************** * PSDRV_SetFont */ @@ -395,23 +395,23 @@ static UINT PSDRV_GetFontMetric( PSDRV_PDEVICE *physDev, const AFM *afm, TEXTMETRICW *tm = (TEXTMETRICW *)&(ntmx->ntmTm); LOGFONTW *lf = &(elfx->elfLogFont); PSFONT font; - + memset(ntmx, 0, sizeof(*ntmx)); memset(elfx, 0, sizeof(*elfx)); - + ScaleFont(afm, -(LONG)(afm->WinMetrics.usUnitsPerEm), &font, tm); - + lf->lfHeight = tm->tmHeight; lf->lfWidth = tm->tmAveCharWidth; lf->lfWeight = tm->tmWeight; lf->lfItalic = tm->tmItalic; lf->lfCharSet = tm->tmCharSet; - + lf->lfPitchAndFamily = (afm->IsFixedPitch) ? FIXED_PITCH : VARIABLE_PITCH; - + MultiByteToWideChar(CP_ACP, 0, afm->FamilyName, -1, lf->lfFaceName, LF_FACESIZE); - + return DEVICE_FONTTYPE; } @@ -433,7 +433,7 @@ BOOL PSDRV_EnumDeviceFonts( PSDRV_PDEVICE *physDev, LPLOGFONTW plf, FaceName, sizeof(FaceName), NULL, NULL); TRACE("lfFaceName = '%s'\n", FaceName); for(family = physDev->pi->Fonts; family; family = family->next) { - if(!strncmp(FaceName, family->FamilyName, + if(!strncmp(FaceName, family->FamilyName, strlen(family->FamilyName))) break; } diff --git a/dlls/wineps/glyphlist.c b/dlls/wineps/glyphlist.c index 2d1fbfaf6f8..e2ca136653b 100644 --- a/dlls/wineps/glyphlist.c +++ b/dlls/wineps/glyphlist.c @@ -85,7 +85,7 @@ inline static INT GlyphListInsert(LPCSTR szName, INT index) g = HeapAlloc(PSDRV_Heap, 0, sizeof(GLYPHNAME) + strlen(szName) + 1); if (g == NULL) { - ERR("Failed to allocate %i bytes of memory\n", + ERR("Failed to allocate %i bytes of memory\n", sizeof(GLYPHNAME) + strlen(szName) + 1); return -1; } @@ -194,7 +194,7 @@ const GLYPHNAME *PSDRV_GlyphName(LPCSTR szName) VOID PSDRV_IndexGlyphList() { INT i; - + if (glyphNamesIndexed == TRUE) return; @@ -205,6 +205,6 @@ VOID PSDRV_IndexGlyphList() glyphList[i]->index = i; TRACE(" glyphList[%i] -> '%s'\n", i, glyphList[i]->sz); } - + glyphNamesIndexed = TRUE; } diff --git a/dlls/wineps/init.c b/dlls/wineps/init.c index 20f39a2b03d..a2d608360d1 100644 --- a/dlls/wineps/init.c +++ b/dlls/wineps/init.c @@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); -static PSDRV_DEVMODEA DefaultDevmode = +static PSDRV_DEVMODEA DefaultDevmode = { { /* dmPublic */ /* dmDeviceName */ "Wine PostScript Driver", @@ -45,8 +45,8 @@ static PSDRV_DEVMODEA DefaultDevmode = /* dmDriverVersion */ 0x001, /* dmSize */ sizeof(DEVMODEA), /* dmDriverExtra */ 0, -/* dmFields */ DM_ORIENTATION | DM_PAPERSIZE | DM_SCALE | - DM_COPIES | DM_DEFAULTSOURCE | DM_COLOR | +/* dmFields */ DM_ORIENTATION | DM_PAPERSIZE | DM_SCALE | + DM_COPIES | DM_DEFAULTSOURCE | DM_COLOR | DM_DUPLEX | DM_YRESOLUTION | DM_TTOPTION, { /* u1 */ { /* s1 */ @@ -85,7 +85,7 @@ static PSDRV_DEVMODEA DefaultDevmode = /* dummy */ 0 }, { /* dmDrvPrivate */ - /* numInstalledOptions */ 0 + /* numInstalledOptions */ 0 } }; @@ -106,7 +106,7 @@ static LOGFONTA DefaultLogFont = { BOOL WINAPI PSDRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { TRACE("(0x%4x, 0x%08lx, %p)\n", hinst, reason, reserved); - + switch(reason) { case DLL_PROCESS_ATTACH: @@ -133,7 +133,7 @@ BOOL WINAPI PSDRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved ) HeapDestroy( PSDRV_Heap ); break; } - + return TRUE; } @@ -142,7 +142,7 @@ static void PSDRV_UpdateDevCaps( PSDRV_PDEVICE *physDev ) { PAGESIZE *page; INT width = 0, height = 0; - + if(physDev->Devmode->dmPublic.dmFields & DM_PAPERSIZE) { for(page = physDev->pi->ppd->PageSizes; page; page = page->next) { if(page->WinPage == physDev->Devmode->dmPublic.u1.s1.dmPaperSize) @@ -244,7 +244,7 @@ BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, device = physDev->Devmode->dmPublic.dmDeviceName; } pi = PSDRV_FindPrinterInfo(device); - + TRACE("(%s %s %s %p)\n", driver, device, output, initData); if(!pi) return FALSE; @@ -269,7 +269,7 @@ BOOL PSDRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, HeapFree( PSDRV_Heap, 0, physDev ); return FALSE; } - + memcpy( physDev->Devmode, pi->Devmode, sizeof(PSDRV_DEVMODEA) ); physDev->logPixelsX = physDev->pi->ppd->DefaultResolution; @@ -430,7 +430,7 @@ INT PSDRV_GetDeviceCaps( PSDRV_PDEVICE *physDev, INT cap ) /********************************************************************** * PSDRV_FindPrinterInfo */ -PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name) +PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name) { static PRINTERINFO *PSDRV_PrinterList; DWORD type = REG_BINARY, needed, res, dwPaperSize; @@ -444,11 +444,11 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name) HKEY hkey; TRACE("'%s'\n", name); - + /* * If this loop completes, last will point to the 'next' element of the * final PRINTERINFO in the list - */ + */ for( ; pi; last = &pi->next, pi = pi->next) if(!strcmp(pi->FriendlyName, name)) return pi; @@ -461,14 +461,14 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name) strcpy( pi->FriendlyName, name ); /* Use Get|SetPrinterDataExA instead? */ - + res = DrvGetPrinterData16((LPSTR)name, (LPSTR)INT_PD_DEFAULT_DEVMODE, &type, NULL, 0, &needed ); if(res == ERROR_INVALID_PRINTER_NAME || needed != sizeof(DefaultDevmode)) { pi->Devmode = HeapAlloc( PSDRV_Heap, 0, sizeof(DefaultDevmode) ); if (pi->Devmode == NULL) - goto cleanup; + goto cleanup; memcpy(pi->Devmode, &DefaultDevmode, sizeof(DefaultDevmode) ); strcpy(pi->Devmode->dmPublic.dmDeviceName,name); DrvSetPrinterData16((LPSTR)name, (LPSTR)INT_PD_DEFAULT_DEVMODE, diff --git a/dlls/wineps/mkagl.c b/dlls/wineps/mkagl.c index a6328f7fb42..085d2a7fae7 100644 --- a/dlls/wineps/mkagl.c +++ b/dlls/wineps/mkagl.c @@ -27,7 +27,7 @@ /* * The array of glyph information */ - + typedef struct { int UV; @@ -44,7 +44,7 @@ static int num_glyphs = 0; /* * Functions to search and sort the array */ - + static int cmp_by_UV(const void *a, const void *b) { return ((const GLYPHINFO *)a)->UV - ((const GLYPHINFO *)b)->UV; @@ -68,9 +68,9 @@ inline static void sort_by_name() inline static GLYPHINFO *search_by_name(const char *name) { GLYPHINFO gi; - + gi.name = name; - + return (GLYPHINFO *)bsearch(&gi, glyphs, num_glyphs, sizeof(GLYPHINFO), cmp_by_name); } @@ -79,19 +79,19 @@ inline static GLYPHINFO *search_by_name(const char *name) /* * Use the 'optimal' combination of tabs and spaces to position the cursor */ - + inline static void fcpto(FILE *f, int newpos, int curpos) { int newtpos = newpos & ~7; int curtpos = curpos & ~7; - + while (curtpos < newtpos) { fputc('\t', f); curtpos += 8; curpos = curtpos; } - + while (curpos < newpos) { fputc(' ', f); @@ -108,7 +108,7 @@ inline static void cpto(int newpos, int curpos) /* * Make main() look "purty" */ - + inline static void double_space(FILE *f) { fputc('\n', f); @@ -123,43 +123,43 @@ inline static void triple_space(FILE *f) /* * Read the Adobe Glyph List from 'glyphlist.txt' */ - + static void read_agl() { FILE *f = fopen("glyphlist.txt", "r"); char linebuf[256], namebuf[128], commbuf[128]; - + if (f == NULL) { fprintf(stderr, "Error opening glyphlist.txt\n"); exit(__LINE__); } - + while (fgets(linebuf, sizeof(linebuf), f) != NULL) { unsigned int UV; - + if (linebuf[0] == '#') continue; - + sscanf(linebuf, "%X;%[^;];%[^\n]", &UV, namebuf, commbuf); - + glyphs[num_glyphs].UV = (int)UV; glyphs[num_glyphs].name = strdup(namebuf); glyphs[num_glyphs].comment = strdup(commbuf); - + if (glyphs[num_glyphs].name == NULL || glyphs[num_glyphs].comment == NULL) { fprintf(stderr, "Memory allocation failure\n"); exit(__LINE__); } - + ++num_glyphs; } - + fclose(f); - + if (num_glyphs != 1051) { fprintf(stderr, "Read %i glyphs\n", num_glyphs); @@ -171,43 +171,43 @@ static void read_agl() /* * Read glyph names from all AFM files in current directory */ - + static void read_afms(FILE *f_c, FILE *f_h) { DIR *d = opendir("."); struct dirent *de; - + fputs( "/*\n" " * Built-in font metrics\n" " */\n" "\n" "const AFM *const PSDRV_BuiltinAFMs[] =\n" "{\n", f_c); - - + + if (d == NULL) { fprintf(stderr, "Error opening current directory\n"); exit(__LINE__); } - + while ((de = readdir(d)) != NULL) { FILE *f; char *cp, linebuf[256], font_family[128]; int i, num_metrics; - + cp = strrchr(de->d_name, '.'); /* Does it end in */ if (cp == NULL || strcasecmp(cp, ".afm") != 0) /* .afm or .AFM? */ continue; - + f = fopen(de->d_name, "r"); if (f == NULL) { fprintf(stderr, "Error opening %s\n", de->d_name); exit(__LINE__); } - + while (1) { if (fgets(linebuf, sizeof(linebuf), f) == NULL) @@ -215,20 +215,20 @@ static void read_afms(FILE *f_c, FILE *f_h) fprintf(stderr, "FontName not found in %s\n", de->d_name); exit(__LINE__); } - + if (strncmp(linebuf, "FontName ", 9) == 0) break; } - + sscanf(linebuf, "FontName %[^\r\n]", font_family); - + for (i = 0; font_family[i] != '\0'; ++i) if (font_family[i] == '-') font_family[i] = '_'; - + fprintf(f_h, "extern const AFM PSDRV_%s;\n", font_family); fprintf(f_c, " &PSDRV_%s,\n", font_family); - + while (1) { if (fgets(linebuf, sizeof(linebuf), f) == NULL) @@ -236,13 +236,13 @@ static void read_afms(FILE *f_c, FILE *f_h) fprintf(stderr, "FamilyName not found in %s\n", de->d_name); exit(__LINE__); } - + if (strncmp(linebuf, "FamilyName ", 11) == 0) break; } - + sscanf(linebuf, "FamilyName %[^\r\n]", font_family); - + while (1) { if (fgets(linebuf, sizeof(linebuf), f) == NULL) @@ -251,24 +251,24 @@ static void read_afms(FILE *f_c, FILE *f_h) de->d_name); exit(__LINE__); } - + if (strncmp(linebuf, "StartCharMetrics ", 17) == 0) break; } - + sscanf(linebuf, "StartCharMetrics %i", &num_metrics); - + for (i = 0; i < num_metrics; ++i) { char namebuf[128]; - + if (fgets(linebuf, sizeof(linebuf), f) == NULL) { fprintf(stderr, "Unexpected EOF after %i glyphs in %s\n", i, de->d_name); exit(__LINE__); } - + cp = strchr(linebuf, 'N'); if (cp == NULL || strlen(cp) < 3) { @@ -276,34 +276,34 @@ static void read_afms(FILE *f_c, FILE *f_h) de->d_name); exit(__LINE__); } - + sscanf(cp, "N %s", namebuf); if (search_by_name(namebuf) != NULL) continue; - + sprintf(linebuf, "FONT FAMILY;%s", font_family); - + glyphs[num_glyphs].UV = -1; glyphs[num_glyphs].name = strdup(namebuf); glyphs[num_glyphs].comment = strdup(linebuf); - + if (glyphs[num_glyphs].name == NULL || glyphs[num_glyphs].comment == NULL) { fprintf(stderr, "Memory allocation failure\n"); exit(__LINE__); } - + ++num_glyphs; - + sort_by_name(); } - + fclose(f); } - + closedir(d); - + fputs(" NULL\n};\n", f_c); } @@ -311,7 +311,7 @@ static void read_afms(FILE *f_c, FILE *f_h) /* * Write opening comments, etc. */ - + static void write_header(FILE *f) { int i; @@ -347,33 +347,33 @@ static void write_header(FILE *f) /* * Write the array of glyph names (also populates indexes) */ - + static void write_glyph_names(FILE *f_c, FILE *f_h) { int i, num_names = 0, index = 0; - + for (i = 0; i < num_glyphs; ++i) if (i == 0 || strcmp(glyphs[i - 1].name, glyphs[i].name) != 0) ++num_names; - + fputs( "/*\n" " * Every glyph name in the AGL and the 35 core PostScript fonts\n" " */\n" "\n", f_c); - + fprintf(f_c, "const INT PSDRV_AGLGlyphNamesSize = %i;\n\n", num_names); - + fprintf(f_c, "GLYPHNAME PSDRV_AGLGlyphNames[%i] =\n{\n", num_names); - + for (i = 0; i < num_glyphs - 1; ++i) { int cp = 0; - + if (i == 0 || strcmp(glyphs[i - 1].name, glyphs[i].name) != 0) { fcpto(f_h, 32, fprintf(f_h, "#define GN_%s", glyphs[i].name)); fprintf(f_h, "(PSDRV_AGLGlyphNames + %i)\n", index); - + cp = fprintf(f_c, " { %4i, \"%s\" },", index, glyphs[i].name); glyphs[i].index = index; ++index; @@ -382,15 +382,15 @@ static void write_glyph_names(FILE *f_c, FILE *f_h) { glyphs[i].index = glyphs[i - 1].index; } - + fcpto(f_c, 40, cp); - + fprintf(f_c, "/* %s */\n", glyphs[i].comment); } - + fcpto(f_h, 32, fprintf(f_h, "#define GN_%s", glyphs[i].name)); fprintf(f_h, "(PSDRV_AGLGlyphNames + %i)\n", index); - + glyphs[i].index = index; fcpto(f_c, 40, fprintf(f_c, " { %4i, \"%s\" }", index, glyphs[i].name)); fprintf(f_c, "/* %s */\n};\n", glyphs[i].comment); @@ -404,57 +404,57 @@ static void write_glyph_names(FILE *f_c, FILE *f_h) static void write_encoding_by_name(FILE *f) { int i, size = 0, even = 1; - + for (i = 0; i < num_glyphs; ++i) if (glyphs[i].UV != -1 && (i == 0 || strcmp(glyphs[i - 1].name, glyphs[i].name) != 0)) ++size; /* should be 1039 */ - + fputs( "/*\n" " * The AGL encoding vector, sorted by glyph name - " "duplicates omitted\n" " */\n" "\n", f); - + fprintf(f, "const INT PSDRV_AGLbyNameSize = %i;\n\n", size); - fprintf(f, "const UNICODEGLYPH PSDRV_AGLbyName[%i] = \n{\n", size); - + fprintf(f, "const UNICODEGLYPH PSDRV_AGLbyName[%i] =\n{\n", size); + for (i = 0; i < num_glyphs - 1; ++i) { int cp; - + if (glyphs[i].UV == -1) continue; - + if (i != 0 && strcmp(glyphs[i - 1].name, glyphs[i].name) == 0) continue; - + cp = fprintf(f, " { 0x%.4x, GN_%s },", glyphs[i].UV, glyphs[i].name); - + even = !even; if (even) fputc('\n', f); else fcpto(f, 40, cp); } - + fprintf(f, " { 0x%.4x, GN_%s }\n};\n", glyphs[i].UV, glyphs[i].name); } /* * Write the AGL encoding vector, sorted by Unicode value */ - + static void write_encoding_by_UV(FILE *f) { int i, size = 0, even = 1; - + for (i = 0; i < num_glyphs; ++i) if (glyphs[i].UV != -1) ++size; /* better be 1051! */ - + sort_by_UV(); - + fputs( "/*\n" " * The AGL encoding vector, sorted by Unicode value - " "duplicates included\n" @@ -462,36 +462,36 @@ static void write_encoding_by_UV(FILE *f) "\n", f); fprintf(f, "const INT PSDRV_AGLbyUVSize = %i;\n\n", size); - fprintf(f, "const UNICODEGLYPH PSDRV_AGLbyUV[%i] = \n{\n", size); - + fprintf(f, "const UNICODEGLYPH PSDRV_AGLbyUV[%i] =\n{\n", size); + for (i = 0; i < num_glyphs - 1; ++i) { int cp; - + if (glyphs[i].UV == -1) continue; - + cp = fprintf(f, " { 0x%.4x, GN_%s },", glyphs[i].UV, glyphs[i].name); - + even = !even; if (even) fputc('\n', f); else fcpto(f, 40, cp); } - + fprintf(f, " { 0x%.4x, GN_%s }\n};\n", glyphs[i].UV, glyphs[i].name); } - + /* * Do it! */ - + int main(int argc, char *argv[]) { FILE *f_c, *f_h; - + if (argc < 3) { fprintf(stderr, "Usage: %s
\n", argv[0]); @@ -504,14 +504,14 @@ int main(int argc, char *argv[]) fprintf(stderr, "Error opening %s for writing\n", argv[1]); exit(__LINE__); } - + f_h = fopen(argv[2], "w"); if (f_h == NULL) { fprintf(stderr, "Error opening %s for writing\n", argv[2]); exit(__LINE__); } - + write_header(f_c); triple_space(f_c); read_agl(); @@ -522,6 +522,6 @@ int main(int argc, char *argv[]) write_encoding_by_name(f_c); triple_space(f_c); write_encoding_by_UV(f_c); - + return 0; } diff --git a/dlls/wineps/pen.c b/dlls/wineps/pen.c index b22006d64ff..b1f73ada6ee 100644 --- a/dlls/wineps/pen.c +++ b/dlls/wineps/pen.c @@ -47,7 +47,7 @@ HPEN PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen ) PSDRV_CreateColor(physDev, &physDev->pen.color, logpen.lopnColor); physDev->pen.style = logpen.lopnStyle & PS_STYLE_MASK; - + switch(physDev->pen.style) { case PS_DASH: physDev->pen.dash = PEN_dash; @@ -71,12 +71,12 @@ HPEN PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen ) default: physDev->pen.dash = NULL; - } + } if ((physDev->pen.width > 1) && (physDev->pen.dash != NULL)) { physDev->pen.style = PS_SOLID; physDev->pen.dash = NULL; - } + } physDev->pen.set = FALSE; return hpen; @@ -92,11 +92,11 @@ BOOL PSDRV_SetPen(PSDRV_PDEVICE *physDev) { if (physDev->pen.style != PS_NULL) { PSDRV_WriteSetColor(physDev, &physDev->pen.color); - + if(!physDev->pen.set) { PSDRV_WriteSetPen(physDev); physDev->pen.set = TRUE; - } + } } return TRUE; diff --git a/dlls/wineps/ppd.c b/dlls/wineps/ppd.c index d0088cdecb7..995d103f330 100644 --- a/dlls/wineps/ppd.c +++ b/dlls/wineps/ppd.c @@ -266,7 +266,7 @@ static BOOL PSDRV_PPDGetInvocationValue(FILE *fp, char *pos, PPDTuple *tuple) do { end = strchr(start, '"'); if(end) { - buf = HeapReAlloc( PSDRV_Heap, 0, buf, + buf = HeapReAlloc( PSDRV_Heap, 0, buf, len + (end - start) + 1 ); memcpy(buf + len, start, end - start); *(buf + len + (end - start)) = '\0'; @@ -457,7 +457,7 @@ static BOOL PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple) PAGESIZE *PSDRV_PPDGetPageSizeInfo(PPD *ppd, char *name) { PAGESIZE *page = ppd->PageSizes, *lastpage; - + if(!page) { page = ppd->PageSizes = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(*page) ); @@ -573,7 +573,7 @@ PPD *PSDRV_ParsePPD(char *fname) fclose(fp); return NULL; } - + while( PSDRV_PPDGetNextTuple(fp, &tuple)) { if(!strcmp("*NickName", tuple.key)) { @@ -646,7 +646,7 @@ PPD *PSDRV_ParsePPD(char *fname) page->Name = tuple.option; tuple.option = NULL; - + for(i = 0; PageTrans[i].PSName; i++) { if(!strcmp(PageTrans[i].PSName, page->Name)) { /* case ? */ page->WinPage = PageTrans[i].WinPage; @@ -678,7 +678,7 @@ PPD *PSDRV_ParsePPD(char *fname) else if(!strcmp("*ImageableArea", tuple.key)) { PAGESIZE *page; page = PSDRV_PPDGetPageSizeInfo(ppd, tuple.option); - + if(!page->Name) { page->Name = tuple.option; tuple.option = NULL; @@ -701,7 +701,7 @@ PPD *PSDRV_ParsePPD(char *fname) else if(!strcmp("*PaperDimension", tuple.key)) { PAGESIZE *page; page = PSDRV_PPDGetPageSizeInfo(ppd, tuple.option); - + if(!page->Name) { page->Name = tuple.option; tuple.option = NULL; @@ -727,28 +727,28 @@ PPD *PSDRV_ParsePPD(char *fname) /* anything else, namely 'any', leaves value at 0 */ - TRACE("LandscapeOrientation = %d\n", + TRACE("LandscapeOrientation = %d\n", ppd->LandscapeOrientation); } - + else if(!strcmp("*UIConstraints", tuple.key)) { char *start; CONSTRAINT *con, **insert = &ppd->Constraints; while(*insert) insert = &((*insert)->next); - + con = *insert = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(*con) ); start = tuple.value; - + con->Feature1 = PSDRV_PPDGetWord(start, &start); con->Value1 = PSDRV_PPDGetWord(start, &start); con->Feature2 = PSDRV_PPDGetWord(start, &start); con->Value2 = PSDRV_PPDGetWord(start, &start); } - + else if (!strcmp("*InputSlot", tuple.key)) { @@ -763,7 +763,7 @@ PPD *PSDRV_ParsePPD(char *fname) UserBinType++); tuple.option = tuple.opttrans = tuple.value = NULL; - } + } /* * Windows treats "manual feed" as another paper source. Most PPD @@ -782,8 +782,8 @@ PPD *PSDRV_ParsePPD(char *fname) if(tuple.option) HeapFree(PSDRV_Heap, 0, tuple.option); if(tuple.value) HeapFree(PSDRV_Heap, 0, tuple.value); if(tuple.opttrans) HeapFree(PSDRV_Heap, 0, tuple.opttrans); - if(tuple.valtrans) HeapFree(PSDRV_Heap, 0, tuple.valtrans); - + if(tuple.valtrans) HeapFree(PSDRV_Heap, 0, tuple.valtrans); + } @@ -797,16 +797,16 @@ PPD *PSDRV_ParsePPD(char *fname) for(fn = ppd->InstalledFonts; fn; fn = fn->next) TRACE("'%s'\n", fn->Name); - + for(page = ppd->PageSizes; page; page = page->next) { TRACE("'%s' aka '%s' (%d) invoked by '%s'\n", page->Name, page->FullName, page->WinPage, page->InvocationString); if(page->ImageableArea) - TRACE("Area = %.2f,%.2f - %.2f, %.2f\n", + TRACE("Area = %.2f,%.2f - %.2f, %.2f\n", page->ImageableArea->llx, page->ImageableArea->lly, page->ImageableArea->urx, page->ImageableArea->ury); if(page->PaperDimension) - TRACE("Dimension = %.2f x %.2f\n", + TRACE("Dimension = %.2f x %.2f\n", page->PaperDimension->x, page->PaperDimension->y); } @@ -825,7 +825,7 @@ PPD *PSDRV_ParsePPD(char *fname) for(slot = ppd->InputSlots; slot; slot = slot->next) TRACE("INPUTSLOTS '%s' Name '%s' (%d) Invocation '%s'\n", - slot->Name, slot->FullName, slot->WinBin, + slot->Name, slot->FullName, slot->WinBin, slot->InvocationString); } diff --git a/dlls/wineps/ps.c b/dlls/wineps/ps.c index d82faf5f2a1..f8d46c8a699 100644 --- a/dlls/wineps/ps.c +++ b/dlls/wineps/ps.c @@ -36,7 +36,7 @@ static char psheader[] = /* title llx lly urx ury orientation */ "%%%%Orientation: %s\n" "%%%%EndComments\n"; -static char psbeginprolog[] = +static char psbeginprolog[] = "%%BeginProlog\n"; static char psendprolog[] = @@ -93,7 +93,7 @@ static char psmoveto[] = /* x, y */ static char pslineto[] = /* x, y */ "%d %d lineto\n"; -static char psstroke[] = +static char psstroke[] = "stroke\n"; static char psrectangle[] = /* x, y, width, height, -width */ @@ -167,10 +167,10 @@ static char pseoclip[] = "eoclip\n"; static char psrectclip[] = -"%d %d %d %d rectclip\n"; +"%d %d %d %d rectclip\n"; static char psrectclip2[] = -"%s rectclip\n"; +"%s rectclip\n"; static char pshatch[] = "hatch\n"; @@ -178,13 +178,13 @@ static char pshatch[] = static char psrotate[] = /* ang */ "%.1f rotate\n"; -static char psarrayget[] = +static char psarrayget[] = "%s %d get\n"; -static char psarrayput[] = +static char psarrayput[] = "%s %d %ld put\n"; -static char psarraydef[] = +static char psarraydef[] = "/%s %d array def\n"; @@ -212,7 +212,7 @@ INT PSDRV_WriteFeature(HANDLE16 hJob, char *feature, char *value, WriteSpool16( hJob, invocation, strlen(invocation) ); WriteSpool16( hJob, psendfeature, strlen(psendfeature) ); - + HeapFree( PSDRV_Heap, 0, buf ); return 1; } @@ -234,7 +234,7 @@ INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title ) WARN("HeapAlloc failed\n"); return 0; } - + /* BBox co-ords are in default user co-ord system so urx < ury even in landscape mode */ llx = physDev->ImageableArea.left * 72.0 / physDev->logPixelsX; @@ -250,9 +250,9 @@ INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title ) /* FIXME should do something better with BBox */ - sprintf(buf, psheader, title, llx, lly, urx, ury, orient); + sprintf(buf, psheader, title, llx, lly, urx, ury, orient); - if( WriteSpool16( physDev->job.hJob, buf, strlen(buf) ) != + if( WriteSpool16( physDev->job.hJob, buf, strlen(buf) ) != strlen(buf) ) { WARN("WriteSpool error\n"); HeapFree( PSDRV_Heap, 0, buf ); @@ -305,7 +305,7 @@ INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev ) sprintf(buf, psfooter, physDev->job.PageNo); - if( WriteSpool16( physDev->job.hJob, buf, strlen(buf) ) != + if( WriteSpool16( physDev->job.hJob, buf, strlen(buf) ) != strlen(buf) ) { WARN("WriteSpool error\n"); HeapFree( PSDRV_Heap, 0, buf ); @@ -319,7 +319,7 @@ INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev ) INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev ) { - if( WriteSpool16( physDev->job.hJob, psendpage, sizeof(psendpage)-1 ) != + if( WriteSpool16( physDev->job.hJob, psendpage, sizeof(psendpage)-1 ) != sizeof(psendpage)-1 ) { WARN("WriteSpool error\n"); return 0; @@ -364,7 +364,7 @@ INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev ) physDev->logPixelsX, physDev->logPixelsY, xtrans, ytrans, rotation); - if( WriteSpool16( physDev->job.hJob, buf, strlen(buf) ) != + if( WriteSpool16( physDev->job.hJob, buf, strlen(buf) ) != strlen(buf) ) { WARN("WriteSpool error\n"); HeapFree( PSDRV_Heap, 0, buf ); @@ -399,7 +399,7 @@ BOOL PSDRV_WriteStroke(PSDRV_PDEVICE *physDev) -BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, +BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height) { char buf[100]; @@ -439,15 +439,15 @@ BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev) WARN("HeapAlloc failed\n"); return FALSE; } - - sprintf(buf, pssetfont, physDev->font.afm->FontName, + + sprintf(buf, pssetfont, physDev->font.afm->FontName, physDev->font.size, -physDev->font.size, -physDev->font.escapement); PSDRV_WriteSpool(physDev, buf, strlen(buf)); HeapFree(PSDRV_Heap, 0, buf); return TRUE; -} +} BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color) { @@ -460,10 +460,10 @@ BOOL PSDRV_WriteSetColor(PSDRV_PDEVICE *physDev, PSCOLOR *color) color->value.rgb.b); return PSDRV_WriteSpool(physDev, buf, strlen(buf)); - case PSCOLOR_GRAY: + case PSCOLOR_GRAY: sprintf(buf, pssetgray, color->value.gray.i); return PSDRV_WriteSpool(physDev, buf, strlen(buf)); - + default: ERR("Unkonwn colour type %d\n", color->type); break; @@ -491,24 +491,24 @@ BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count) { char buf[128]; int i; - + for (i = 0; i < count; ++i) { LPCSTR name; int l; - + name = PSDRV_UVMetrics(str[i], physDev->font.afm)->N->sz; l = snprintf(buf, sizeof(buf), psglyphshow, name); - + if (l < sizeof(psglyphshow) - 2 || l > sizeof(buf) - 1) { WARN("Unusable glyph name '%s' - ignoring\n", name); continue; } - + PSDRV_WriteSpool(physDev, buf, l); } - + return TRUE; } @@ -581,7 +581,7 @@ BOOL PSDRV_WriteIndexColorSpaceEnd(PSDRV_PDEVICE *physDev) { char buf[] = ">\n] setcolorspace\n"; return PSDRV_WriteSpool(physDev, buf, sizeof(buf) - 1); -} +} BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number) { @@ -590,7 +590,7 @@ BOOL PSDRV_WriteRGB(PSDRV_PDEVICE *physDev, COLORREF *map, int number) ptr = buf; for(i = 0; i < number; i++) { - sprintf(ptr, "%02x%02x%02x%c", (int)GetRValue(map[i]), + sprintf(ptr, "%02x%02x%02x%c", (int)GetRValue(map[i]), (int)GetGValue(map[i]), (int)GetBValue(map[i]), ((i & 0x7) == 0x7) || (i == number - 1) ? '\n' : ' '); ptr += 7; @@ -659,9 +659,9 @@ BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, int number) char *buf = HeapAlloc(PSDRV_Heap, 0, number * 3 + 1); char *ptr; int i; - + ptr = buf; - + for(i = 0; i < number; i++) { sprintf(ptr, "%02x%c", bytes[i], ((i & 0xf) == 0xf) || (i == number - 1) ? '\n' : ' '); @@ -678,9 +678,9 @@ BOOL PSDRV_WriteDIBits16(PSDRV_PDEVICE *physDev, const WORD *words, int number) char *buf = HeapAlloc(PSDRV_Heap, 0, number * 7 + 1); char *ptr; int i; - + ptr = buf; - + for(i = 0; i < number; i++) { int r, g, b; @@ -707,9 +707,9 @@ BOOL PSDRV_WriteDIBits24(PSDRV_PDEVICE *physDev, const BYTE *bits, int number) char *buf = HeapAlloc(PSDRV_Heap, 0, number * 7 + 1); char *ptr; int i; - + ptr = buf; - + for(i = 0; i < number; i++) { sprintf(ptr, "%02x%02x%02x%c", bits[i * 3 + 2], bits[i * 3 + 1], bits[i * 3], @@ -727,9 +727,9 @@ BOOL PSDRV_WriteDIBits32(PSDRV_PDEVICE *physDev, const BYTE *bits, int number) char *buf = HeapAlloc(PSDRV_Heap, 0, number * 7 + 1); char *ptr; int i; - + ptr = buf; - + for(i = 0; i < number; i++) { sprintf(ptr, "%02x%02x%02x%c", bits[i * 4 + 2], bits[i * 4 + 1], bits[i * 4], diff --git a/dlls/wineps/psdrv.h b/dlls/wineps/psdrv.h index baadff40cea..efa4fe923a0 100644 --- a/dlls/wineps/psdrv.h +++ b/dlls/wineps/psdrv.h @@ -47,7 +47,7 @@ typedef struct _tagAFMLIGS { } AFMLIGS; typedef struct { - int C; /* character */ + int C; /* character */ LONG UV; float WX; const GLYPHNAME *N; /* name */ @@ -299,7 +299,7 @@ typedef struct { /* * Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts */ - + extern const INT PSDRV_AGLGlyphNamesSize; extern GLYPHNAME PSDRV_AGLGlyphNames[]; @@ -307,7 +307,7 @@ extern GLYPHNAME PSDRV_AGLGlyphNames[]; /* * The AGL encoding vector */ - + extern const INT PSDRV_AGLbyNameSize; /* sorted by name - */ extern const UNICODEGLYPH PSDRV_AGLbyName[]; /* duplicates omitted */ @@ -351,9 +351,9 @@ extern INT PSDRV_WriteEndPage( PSDRV_PDEVICE *physDev ); extern BOOL PSDRV_WriteMoveTo(PSDRV_PDEVICE *physDev, INT x, INT y); extern BOOL PSDRV_WriteLineTo(PSDRV_PDEVICE *physDev, INT x, INT y); extern BOOL PSDRV_WriteStroke(PSDRV_PDEVICE *physDev); -extern BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, +extern BOOL PSDRV_WriteRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height); -extern BOOL PSDRV_WriteRRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, +extern BOOL PSDRV_WriteRRectangle(PSDRV_PDEVICE *physDev, INT x, INT y, INT width, INT height); extern BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev); extern BOOL PSDRV_WriteGlyphShow(PSDRV_PDEVICE *physDev, LPCWSTR str, INT count); diff --git a/dlls/wineps/text.c b/dlls/wineps/text.c index ea820f0f884..2af7e6884d3 100644 --- a/dlls/wineps/text.c +++ b/dlls/wineps/text.c @@ -52,7 +52,7 @@ BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, rect = *lprect; LPtoDP( physDev->hdc, (POINT *)&rect, 2 ); PSDRV_WriteGSave(physDev); - PSDRV_WriteRectangle(physDev, rect.left, rect.top, rect.right - rect.left, + PSDRV_WriteRectangle(physDev, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); if (flags & ETO_OPAQUE) @@ -70,12 +70,12 @@ BOOL PSDRV_ExtTextOut( PSDRV_PDEVICE *physDev, INT x, INT y, UINT flags, PSDRV_WriteClip(physDev); } - bResult = PSDRV_Text(physDev, x, y, str, count, !(bClipped && bOpaque), lpDx); + bResult = PSDRV_Text(physDev, x, y, str, count, !(bClipped && bOpaque), lpDx); PSDRV_WriteGRestore(physDev); } else { - bResult = PSDRV_Text(physDev, x, y, str, count, TRUE, lpDx); + bResult = PSDRV_Text(physDev, x, y, str, count, TRUE, lpDx); } return bResult; @@ -157,13 +157,13 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, LPCWSTR str, UINT c memcpy(strbuf, str, count * sizeof(WCHAR)); *(strbuf + count) = '\0'; - + if ((GetBkMode( physDev->hdc ) != TRANSPARENT) && bDrawBackground) { PSDRV_WriteGSave(physDev); PSDRV_WriteNewPath(physDev); - PSDRV_WriteRectangle(physDev, x, y - physDev->font.tm.tmAscent, sz.cx, - physDev->font.tm.tmAscent + + PSDRV_WriteRectangle(physDev, x, y - physDev->font.tm.tmAscent, sz.cx, + physDev->font.tm.tmAscent + physDev->font.tm.tmDescent); PSDRV_WriteSetColor(physDev, &physDev->bkColor); PSDRV_WriteFill(physDev); @@ -171,7 +171,7 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, LPCWSTR str, UINT c } PSDRV_WriteMoveTo(physDev, x, y); - + if(!lpDx) PSDRV_WriteGlyphShow(physDev, strbuf, lstrlenW(strbuf)); else { @@ -221,8 +221,8 @@ static BOOL PSDRV_Text(PSDRV_PDEVICE *physDev, INT x, INT y, LPCWSTR str, UINT c PSDRV_WriteMoveTo(physDev, x, y); /* move to the start */ /* temporarily rotate the coord system */ - PSDRV_WriteRotate(physDev, -escapement/10); - + PSDRV_WriteRotate(physDev, -escapement/10); + /* draw the underline relative to the starting point */ PSDRV_WriteRRectangle(physDev, 0, (INT)pos, size.cx, (INT)thick); } diff --git a/dlls/wineps/truetype.c b/dlls/wineps/truetype.c index 75259524ce5..9448e8853ca 100644 --- a/dlls/wineps/truetype.c +++ b/dlls/wineps/truetype.c @@ -97,7 +97,7 @@ MAKE_FUNCPTR(FT_Load_Glyph) MAKE_FUNCPTR(FT_New_Face) MAKE_FUNCPTR(FT_Set_Charmap) #undef MAKE_FUNCPTR - + /******************************************************************************* * FindCharMap * @@ -126,46 +126,46 @@ static BOOL FindCharMap(FT_Face face, FT_CharMap *p_charmap, LPSTR *p_sz) FT_Int i; FT_Error error; FT_CharMap charmap = NULL; - + for (i = 0; i < face->num_charmaps; ++i) { if (face->charmaps[i]->platform_id != TT_PLATFORM_MICROSOFT) continue; - + if (face->charmaps[i]->encoding_id == TT_MS_ID_UNICODE_CS) { charmap = face->charmaps[i]; break; } - + if (charmap == NULL) charmap = face->charmaps[i]; } - + *p_charmap = charmap; - + if (charmap == NULL) { WARN("No Windows character map found\n"); return TRUE; } - + error = pFT_Set_Charmap(face, charmap); if (error != FT_Err_Ok) { ERR("%s returned %i\n", "FT_Set_Charmap", error); return FALSE; } - + *p_sz = HeapAlloc(PSDRV_Heap, 0, sizeof("WindowsUnknown65535")); if (*p_sz == NULL) return FALSE; - + if (charmap->encoding_id < 7) strcpy(*p_sz, encoding_names[charmap->encoding_id]); else sprintf(*p_sz, "%s%u", "WindowsUnknown", charmap->encoding_id); - + return TRUE; } @@ -187,13 +187,13 @@ static BOOL MSTTStrToSz(const FT_SfntName *name, LPSTR *p_sz) INT len; BYTE *wsz; LPSTR sz; - + len = name->string_len / 2; /* # of 16-bit chars */ - + *p_sz = sz = HeapAlloc(PSDRV_Heap, 0, len + 1); if (sz == NULL) return FALSE; - + wsz = (BYTE *)name->string; for (i = 0; i < len; ++i, ++sz) @@ -208,12 +208,12 @@ static BOOL MSTTStrToSz(const FT_SfntName *name, LPSTR *p_sz) *p_sz = NULL; return TRUE; } - + *sz = (CHAR)wc; } - + *sz = '\0'; - + return TRUE; } @@ -234,9 +234,9 @@ static BOOL FindMSTTString(FT_Face face, FT_CharMap charmap, FT_UShort name_id, FT_UInt num_strings, string_index; FT_SfntName name; FT_Error error; - + num_strings = pFT_Get_Sfnt_Name_Count(face); - + for (string_index = 0; string_index < num_strings; ++string_index) { error = pFT_Get_Sfnt_Name(face, string_index, &name); @@ -245,25 +245,25 @@ static BOOL FindMSTTString(FT_Face face, FT_CharMap charmap, FT_UShort name_id, ERR("%s returned %i\n", "FT_Get_Sfnt_Name", error); return FALSE; } - + /* FIXME - Handle other languages? */ - + if (name.platform_id != TT_PLATFORM_MICROSOFT || name.language_id != TT_MS_LANGID_ENGLISH_UNITED_STATES) continue; - + if (name.platform_id != charmap->platform_id || name.encoding_id != charmap->encoding_id) continue; - + if (name.name_id != name_id) continue; - + return MSTTStrToSz(&name, p_sz); } - + *p_sz = NULL; /* didn't find it */ - + return TRUE; } @@ -295,12 +295,12 @@ static BOOL StartAFM(FT_Face face, AFM **p_afm) TT_HoriHeader *hhea; USHORT em_size; AFM *afm; - + head = pFT_Get_Sfnt_Table(face, ft_sfnt_head); post = pFT_Get_Sfnt_Table(face, ft_sfnt_post); os2 = pFT_Get_Sfnt_Table(face, ft_sfnt_os2); hhea = pFT_Get_Sfnt_Table(face, ft_sfnt_hhea); - + if (head == NULL || post == NULL || os2 == NULL || hhea == NULL || os2->version == 0xffff) /* old Macintosh font */ { @@ -308,11 +308,11 @@ static BOOL StartAFM(FT_Face face, AFM **p_afm) *p_afm = NULL; return TRUE; } - + *p_afm = afm = HeapAlloc(PSDRV_Heap, 0, sizeof(*afm)); if (afm == NULL) return FALSE; - + afm->WinMetrics.usUnitsPerEm = em_size = head->Units_Per_EM; afm->WinMetrics.sAscender = hhea->Ascender; afm->WinMetrics.sDescender = hhea->Descender; @@ -323,7 +323,7 @@ static BOOL StartAFM(FT_Face face, AFM **p_afm) afm->WinMetrics.usWinAscent = os2->usWinAscent; afm->WinMetrics.usWinDescent = os2->usWinDescent; afm->WinMetrics.sAvgCharWidth = os2->xAvgCharWidth; - + afm->Weight = os2->usWeightClass; afm->ItalicAngle = ((float)(post->italicAngle)) / 65536.0; afm->IsFixedPitch = (post-> isFixedPitch == 0) ? FALSE : TRUE; @@ -334,10 +334,10 @@ static BOOL StartAFM(FT_Face face, AFM **p_afm) afm->FontBBox.lly = PSUnits(head->yMin, em_size); afm->FontBBox.urx = PSUnits(head->xMax, em_size); afm->FontBBox.ury = PSUnits(head->yMax, em_size); - + afm->Ascender = PSUnits(os2->sTypoAscender, em_size); afm->Descender = PSUnits(os2->sTypoDescender, em_size); - + return TRUE; } @@ -353,58 +353,58 @@ static BOOL ReadCharMetrics(FT_Face face, AFM *afm, AFMMETRICS **p_metrics) FT_ULong charcode, index; AFMMETRICS *metrics; USHORT em_size = afm->WinMetrics.usUnitsPerEm; - + for (charcode = 0, index = 0; charcode < 65536; ++charcode) if (pFT_Get_Char_Index(face, charcode) != 0) ++index; /* count # of glyphs */ - + afm->NumofMetrics = index; - + *p_metrics = metrics = HeapAlloc(PSDRV_Heap, 0, index * sizeof(*metrics)); if (metrics == NULL) return FALSE; - + for (charcode = 0, index = 0; charcode < 65536; ++charcode) { FT_UInt glyph_index = pFT_Get_Char_Index(face, charcode); FT_Error error; CHAR buffer[128]; /* for glyph names */ - + if (glyph_index == 0) continue; - + error = pFT_Load_Glyph(face, glyph_index, GLYPH_LOAD_FLAGS); if (error != FT_Err_Ok) { ERR("%s returned %i\n", "FT_Load_Glyph", error); goto cleanup; } - + error = pFT_Get_Glyph_Name(face, glyph_index, buffer, sizeof(buffer)); if (error != FT_Err_Ok) { ERR("%s returned %i\n", "FT_Get_Glyph_Name", error); goto cleanup; } - + metrics[index].N = PSDRV_GlyphName(buffer); if (metrics[index].N == NULL) goto cleanup; - + metrics[index].C = metrics[index].UV = charcode; metrics[index].WX = PSUnits(face->glyph->metrics.horiAdvance, em_size); - + ++index; } - + if (afm->WinMetrics.sAvgCharWidth == 0) afm->WinMetrics.sAvgCharWidth = PSDRV_CalcAvgCharWidth(afm); - + return TRUE; - + cleanup: HeapFree(PSDRV_Heap, 0, metrics); - + return FALSE; } @@ -423,44 +423,44 @@ static BOOL BuildTrueTypeAFM(FT_Face face) LPSTR font_name, full_name, family_name, encoding_scheme; FT_CharMap charmap; BOOL retval, added; - + retval = StartAFM(face, &afm); if (retval == FALSE || afm == NULL) return retval; - + retval = FindCharMap(face, &charmap, &encoding_scheme); if (retval == FALSE || charmap == NULL) goto cleanup_afm; - + retval = FindMSTTString(face, charmap, TT_NAME_ID_PS_NAME, &font_name); if (retval == FALSE || font_name == NULL) goto cleanup_encoding_scheme; - + retval = FindMSTTString(face, charmap, TT_NAME_ID_FULL_NAME, &full_name); if (retval == FALSE || full_name == NULL) goto cleanup_font_name; - + retval = FindMSTTString(face, charmap, TT_NAME_ID_FONT_FAMILY, &family_name); if (retval == FALSE || family_name == NULL) goto cleanup_full_name; - + retval = ReadCharMetrics(face, afm, &metrics); if (retval == FALSE || metrics == NULL) goto cleanup_family_name; - + afm->EncodingScheme = encoding_scheme; afm->FontName = font_name; afm->FullName = full_name; afm->FamilyName = family_name; afm->Metrics = metrics; - + retval = PSDRV_AddAFMtoList(&PSDRV_AFMFontList, afm, &added); if (retval == FALSE || added == FALSE) goto cleanup_family_name; - + return TRUE; - + /* clean up after fatal or non-fatal errors */ - + cleanup_family_name: HeapFree(PSDRV_Heap, 0, family_name); cleanup_full_name: @@ -471,10 +471,10 @@ static BOOL BuildTrueTypeAFM(FT_Face face) HeapFree(PSDRV_Heap, 0, encoding_scheme); cleanup_afm: HeapFree(PSDRV_Heap, 0, afm); - + return retval; } - + /******************************************************************************* * ReadTrueTypeFile * @@ -486,16 +486,16 @@ static BOOL ReadTrueTypeFile(FT_Library library, LPCSTR filename) { FT_Error error; FT_Face face; - + TRACE("%s\n", filename); - + error = pFT_New_Face(library, filename, 0, &face); if (error != FT_Err_Ok) { WARN("FreeType error %i opening %s\n", error, filename); return TRUE; } - + if ((face->face_flags & REQUIRED_FACE_FLAGS) == REQUIRED_FACE_FLAGS) { if (BuildTrueTypeAFM(face) == FALSE) @@ -508,14 +508,14 @@ static BOOL ReadTrueTypeFile(FT_Library library, LPCSTR filename) { WARN("Required information missing from %s\n", filename); } - + error = pFT_Done_Face(face); if (error != FT_Err_Ok) { ERR("%s returned %i\n", "FT_Done_Face", error); return FALSE; } - + return TRUE; } @@ -530,41 +530,41 @@ static BOOL ReadTrueTypeDir(FT_Library library, LPCSTR dirname) struct dirent *dent; DIR *dir; CHAR filename[256]; - + dir = opendir(dirname); if (dir == NULL) { WARN("'%s' opening %s\n", strerror(errno), dirname); - return TRUE;; + return TRUE; } - + while ((dent = readdir(dir)) != NULL) { CHAR *file_extension = strrchr(dent->d_name, '.'); int fn_len; - + if (file_extension == NULL || strcasecmp(file_extension, ".ttf") != 0) continue; - + fn_len = snprintf(filename, 256, "%s/%s", dirname, dent->d_name); if (fn_len < 0 || fn_len > sizeof(filename) - 1) { WARN("Path '%s/%s' is too long\n", dirname, dent->d_name); continue; } - + if (ReadTrueTypeFile(library, filename) == FALSE) { closedir(dir); return FALSE; } } - + closedir(dir); - + return TRUE; } - + /******************************************************************************* * PSDRV_GetTrueTypeMetrics * @@ -626,25 +626,25 @@ BOOL PSDRV_GetTrueTypeMetrics(void) name_len = sizeof(name_buf); value_len = sizeof(value_buf); - + while (RegEnumValueA(hkey, i++, name_buf, &name_len, NULL, &type, value_buf, &value_len) == ERROR_SUCCESS) { value_buf[sizeof(value_buf) - 1] = '\0'; - + if (ReadTrueTypeDir(library, value_buf) == FALSE) { RegCloseKey(hkey); pFT_Done_FreeType(library); return FALSE; } - + /* initialize lengths for new iteration */ - + name_len = sizeof(name_buf); value_len = sizeof(value_buf); } - + RegCloseKey(hkey); pFT_Done_FreeType(library); wine_dlclose(ft_handle, NULL, 0); diff --git a/dlls/wineps/type1afm.c b/dlls/wineps/type1afm.c index 0b06f57d746..615da566cce 100644 --- a/dlls/wineps/type1afm.c +++ b/dlls/wineps/type1afm.c @@ -24,7 +24,7 @@ * descriptions for how they indicate non-fatal errors. * */ - + #include "config.h" #include @@ -71,7 +71,7 @@ static BOOL ReadLine(FILE *file, CHAR buffer[], INT bufsize, INT *p_result) { CHAR *cp; INT i; - + if (fgets(buffer, bufsize, file) == NULL) { if (feof(file) == 0) /* EOF or error? */ @@ -79,22 +79,22 @@ static BOOL ReadLine(FILE *file, CHAR buffer[], INT bufsize, INT *p_result) ERR("%s\n", strerror(errno)); return FALSE; } - + *p_result = EOF; return TRUE; } - + cp = strchr(buffer, '\n'); if (cp == NULL) { i = strlen(buffer); - + if (i == bufsize - 1) /* max possible; was line truncated? */ { do i = fgetc(file); /* find the newline or EOF */ while (i != '\n' && i != EOF); - + if (i == EOF) { if (feof(file) == 0) /* EOF or error? */ @@ -102,10 +102,10 @@ static BOOL ReadLine(FILE *file, CHAR buffer[], INT bufsize, INT *p_result) ERR("%s\n", strerror(errno)); return FALSE; } - + WARN("No newline at EOF\n"); } - + *p_result = INT_MIN; return TRUE; } @@ -116,12 +116,12 @@ static BOOL ReadLine(FILE *file, CHAR buffer[], INT bufsize, INT *p_result) *p_result = EOF; return TRUE; } - + WARN("No newline at EOF\n"); cp = buffer + i; /* points to \0 where \n should have been */ } } - + do { *cp = '\0'; /* trim trailing whitespace */ @@ -130,7 +130,7 @@ static BOOL ReadLine(FILE *file, CHAR buffer[], INT bufsize, INT *p_result) --cp; } while (isspace(*cp)); - + *p_result = strlen(buffer); return TRUE; } @@ -150,19 +150,19 @@ static BOOL FindLine(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key) { INT len = strlen(key); LONG start = ftell(file); - + do { INT result; BOOL ok; - + ok = ReadLine(file, buffer, bufsize, &result); if (ok == FALSE) return FALSE; - + if (result > 0 && strncmp(buffer, key, len) == 0) return TRUE; - + if (result == EOF) { rewind(file); @@ -173,7 +173,7 @@ static BOOL FindLine(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key) } } while (ftell(file) != start); - + WARN("Couldn't find line '%s...' in AFM file\n", key); buffer[0] = '\0'; return TRUE; @@ -191,7 +191,7 @@ inline static BOOL DoubleToFloat(float *p_f, double d) { if (d > (double)FLT_MAX || d < -(double)FLT_MAX) return FALSE; - + *p_f = (float)d; return TRUE; } @@ -224,26 +224,26 @@ static BOOL ReadFloat(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key, if (FindLine(file, buffer, bufsize, key) == FALSE) return FALSE; - + if (buffer[0] == '\0') /* line not found */ { *p_found = FALSE; *p_ret = 0.0; return TRUE; } - + cp = buffer + strlen(key); /* first char after key */ errno = 0; d = strtod(cp, &end_ptr); - + if (end_ptr == cp || errno != 0 || DoubleToFloat(p_ret, d) == FALSE) { - WARN("Error parsing line '%s'\n", buffer); + WARN("Error parsing line '%s'\n", buffer); *p_found = FALSE; *p_ret = 0.0; return TRUE; } - + *p_found = TRUE; return TRUE; } @@ -266,9 +266,9 @@ static BOOL ReadInt(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key, *p_ret = 0; return retval; } - + f = Round(f); - + if (f > (FLOAT)INT_MAX || f < (FLOAT)INT_MIN) { WARN("Error parsing line '%s'\n", buffer); @@ -276,7 +276,7 @@ static BOOL ReadInt(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key, *p_found = FALSE; return TRUE; } - + *p_ret = (INT)f; return TRUE; } @@ -295,27 +295,27 @@ static BOOL ReadString(FILE *file, CHAR buffer[], INT bufsize, LPCSTR key, if (FindLine(file, buffer, bufsize, key) == FALSE) return FALSE; - + if (buffer[0] == '\0') { *p_str = NULL; return TRUE; } - + cp = buffer + strlen(key); /* first char after key */ if (*cp == '\0') { *p_str = NULL; return TRUE; } - + while (isspace(*cp)) /* find first non-whitespace char */ ++cp; - + *p_str = HeapAlloc(PSDRV_Heap, 0, strlen(cp) + 1); if (*p_str == NULL) return FALSE; - + strcpy(*p_str, cp); return TRUE; } @@ -334,15 +334,15 @@ static BOOL ReadBBox(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, if (FindLine(file, buffer, bufsize, "FontBBox") == FALSE) return FALSE; - + if (buffer[0] == '\0') { *p_found = FALSE; return TRUE; } - + errno = 0; - + cp = buffer + sizeof("FontBBox"); d = strtod(cp, &end_ptr); if (end_ptr == cp || errno != 0 || @@ -354,22 +354,22 @@ static BOOL ReadBBox(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, if (end_ptr == cp || errno != 0 || DoubleToFloat(&(afm->FontBBox.lly), d) == FALSE) goto parse_error; - + cp = end_ptr; d = strtod(cp, &end_ptr); if (end_ptr == cp || errno != 0 || DoubleToFloat(&(afm->FontBBox.urx), d) == FALSE) goto parse_error; - + cp = end_ptr; d = strtod(cp, &end_ptr); if (end_ptr == cp || errno != 0 || DoubleToFloat(&(afm->FontBBox.ury), d) == FALSE) goto parse_error; - + *p_found = TRUE; return TRUE; - + parse_error: WARN("Error parsing line '%s'\n", buffer); *p_found = FALSE; @@ -400,14 +400,14 @@ static const struct { LPCSTR keyword; INT weight; } afm_weights[] = { "SUPER" , FW_BOLD }, { NULL, 0 } }; - + static BOOL ReadWeight(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, BOOL *p_found) { LPSTR sz; CHAR *cp; INT i; - + if (ReadString(file, buffer, bufsize, "Weight", &sz) == FALSE) return FALSE; @@ -416,10 +416,10 @@ static BOOL ReadWeight(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, *p_found = FALSE; return TRUE; } - + for (cp = sz; *cp != '\0'; ++cp) *cp = toupper(*cp); - + for (i = 0; afm_weights[i].keyword != NULL; ++i) { if (strstr(sz, afm_weights[i].keyword) != NULL) @@ -430,9 +430,9 @@ static BOOL ReadWeight(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, return TRUE; } } - + WARN("Unknown weight '%s'; treating as Roman\n", sz); - + afm->Weight = FW_NORMAL; *p_found = TRUE; HeapFree(PSDRV_Heap, 0, sz); @@ -447,10 +447,10 @@ static BOOL ReadFixedPitch(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, BOOL *p_found) { LPSTR sz; - + if (ReadString(file, buffer, bufsize, "IsFixedPitch", &sz) == FALSE) return FALSE; - + if (sz == NULL) { *p_found = FALSE; @@ -464,7 +464,7 @@ static BOOL ReadFixedPitch(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, HeapFree(PSDRV_Heap, 0, sz); return TRUE; } - + if (strcasecmp(sz, "true") == 0) { afm->IsFixedPitch = TRUE; @@ -472,9 +472,9 @@ static BOOL ReadFixedPitch(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, HeapFree(PSDRV_Heap, 0, sz); return TRUE; } - + WARN("Can't parse line '%s'\n", buffer); - + *p_found = FALSE; HeapFree(PSDRV_Heap, 0, sz); return TRUE; @@ -496,61 +496,61 @@ static BOOL ReadFontMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM **p_afm) *p_afm = afm = HeapAlloc(PSDRV_Heap, 0, sizeof(*afm)); if (afm == NULL) return FALSE; - + retval = ReadWeight(file, buffer, bufsize, afm, &found); if (retval == FALSE || found == FALSE) goto cleanup_afm; - + retval = ReadFloat(file, buffer, bufsize, "ItalicAngle", &(afm->ItalicAngle), &found); if (retval == FALSE || found == FALSE) goto cleanup_afm; - + retval = ReadFixedPitch(file, buffer, bufsize, afm, &found); if (retval == FALSE || found == FALSE) goto cleanup_afm; - + retval = ReadBBox(file, buffer, bufsize, afm, &found); if (retval == FALSE || found == FALSE) goto cleanup_afm; - + retval = ReadFloat(file, buffer, bufsize, "UnderlinePosition", &(afm->UnderlinePosition), &found); if (retval == FALSE || found == FALSE) goto cleanup_afm; - + retval = ReadFloat(file, buffer, bufsize, "UnderlineThickness", &(afm->UnderlineThickness), &found); if (retval == FALSE || found == FALSE) goto cleanup_afm; - + retval = ReadFloat(file, buffer, bufsize, "Ascender", /* optional */ &(afm->Ascender), &found); if (retval == FALSE) goto cleanup_afm; - + retval = ReadFloat(file, buffer, bufsize, "Descender", /* optional */ &(afm->Descender), &found); if (retval == FALSE) goto cleanup_afm; - + afm->WinMetrics.usUnitsPerEm = 1000; afm->WinMetrics.sTypoAscender = (SHORT)Round(afm->Ascender); afm->WinMetrics.sTypoDescender = (SHORT)Round(afm->Descender); - + if (afm->WinMetrics.sTypoAscender == 0) afm->WinMetrics.sTypoAscender = (SHORT)Round(afm->FontBBox.ury); - + if (afm->WinMetrics.sTypoDescender == 0) afm->WinMetrics.sTypoDescender = (SHORT)Round(afm->FontBBox.lly); - + afm->WinMetrics.sTypoLineGap = 1200 - (afm->WinMetrics.sTypoAscender - afm->WinMetrics.sTypoDescender); if (afm->WinMetrics.sTypoLineGap < 0) afm->WinMetrics.sTypoLineGap = 0; - + return TRUE; - + cleanup_afm: /* handle fatal or non-fatal errors */ HeapFree(PSDRV_Heap, 0, afm); *p_afm = NULL; @@ -572,13 +572,13 @@ static BOOL ParseC(LPSTR sz, OLD_AFMMETRICS *metrics) CHAR *cp, *end_ptr; cp = sz + 1; - + if (*cp == 'H') { base = 16; ++cp; } - + errno = 0; l = strtol(cp, &end_ptr, base); if (end_ptr == cp || errno != 0 || l > INT_MAX || l < INT_MIN) @@ -586,7 +586,7 @@ static BOOL ParseC(LPSTR sz, OLD_AFMMETRICS *metrics) WARN("Error parsing character code '%s'\n", sz); return TRUE; } - + metrics->C = (INT)l; return TRUE; } @@ -606,39 +606,39 @@ static BOOL ParseW(LPSTR sz, OLD_AFMMETRICS *metrics) double d; cp = sz + 1; - + if (*cp == '0') ++cp; - + if (*cp == 'X') { vector = FALSE; ++cp; } - + if (!isspace(*cp)) goto parse_error; - + errno = 0; d = strtod(cp, &end_ptr); if (end_ptr == cp || errno != 0 || DoubleToFloat(&(metrics->WX), d) == FALSE) goto parse_error; - + if (vector == FALSE) return TRUE; - + /* Make sure that Y component of vector is zero */ - + d = strtod(cp, &end_ptr); /* errno == 0 */ if (end_ptr == cp || errno != 0 || d != 0.0) { metrics->WX = FLT_MAX; goto parse_error; } - + return TRUE; - + parse_error: WARN("Error parsing character width '%s'\n", sz); return TRUE; @@ -657,21 +657,21 @@ static BOOL ParseB(LPSTR sz, OLD_AFMMETRICS *metrics) { CHAR *cp, *end_ptr; double d; - + errno = 0; - + cp = sz + 1; d = strtod(cp, &end_ptr); if (end_ptr == cp || errno != 0 || DoubleToFloat(&(metrics->B.llx), d) == FALSE) goto parse_error; - + cp = end_ptr; d = strtod(cp, &end_ptr); if (end_ptr == cp || errno != 0 || DoubleToFloat(&(metrics->B.lly), d) == FALSE) goto parse_error; - + cp = end_ptr; d = strtod(cp, &end_ptr); if (end_ptr == cp || errno != 0 || @@ -685,7 +685,7 @@ static BOOL ParseB(LPSTR sz, OLD_AFMMETRICS *metrics) goto parse_error; return TRUE; - + parse_error: WARN("Error parsing glyph bounding box '%s'\n", sz); return TRUE; @@ -702,30 +702,30 @@ static BOOL ParseB(LPSTR sz, OLD_AFMMETRICS *metrics) static BOOL ParseN(LPSTR sz, OLD_AFMMETRICS *metrics) { CHAR save, *cp, *end_ptr; - + cp = sz + 1; - + while (isspace(*cp)) ++cp; - + end_ptr = cp; - + while (*end_ptr != '\0' && !isspace(*end_ptr)) ++end_ptr; - + if (end_ptr == cp) { WARN("Error parsing glyph name '%s'\n", sz); return TRUE; } - + save = *end_ptr; *end_ptr = '\0'; - + metrics->N = PSDRV_GlyphName(cp); if (metrics->N == NULL) return FALSE; - + *end_ptr = save; return TRUE; } @@ -746,47 +746,47 @@ static const OLD_AFMMETRICS badmetrics = { FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX }, /* B */ NULL /* L */ }; - + static BOOL ParseCharMetrics(LPSTR buffer, INT len, OLD_AFMMETRICS *metrics) { CHAR *cp = buffer; *metrics = badmetrics; - + while (*cp != '\0') { while (isspace(*cp)) ++cp; - + switch(*cp) { case 'C': if (ParseC(cp, metrics) == FALSE) return FALSE; break; - + case 'W': if (ParseW(cp, metrics) == FALSE) return FALSE; break; - + case 'N': if (ParseN(cp, metrics) == FALSE) return FALSE; break; - + case 'B': if (ParseB(cp, metrics) == FALSE) return FALSE; break; } - + cp = strchr(cp, ';'); if (cp == NULL) { WARN("No terminating semicolon\n"); break; } - + ++cp; } - + if (metrics->C == INT_MAX || metrics->WX == FLT_MAX || metrics->N == NULL || metrics->B.ury == FLT_MAX) { @@ -814,17 +814,17 @@ static int cmpUV(const void *a, const void *b) { return (int)(*((const LONG *)a) - *((const LONG *)b)); } - + inline static BOOL IsWinANSI(LONG uv) { if ((0x0020 <= uv && uv <= 0x007e) || (0x00a0 <= uv && uv <= 0x00ff) || (0x2018 <= uv && uv <= 0x201a) || (0x201c <= uv && uv <= 0x201e) || (0x2020 <= uv && uv <= 0x2022)) return TRUE; - + if (bsearch(&uv, ansiChars, 21, sizeof(INT), cmpUV) != NULL) return TRUE; - + return FALSE; } @@ -846,11 +846,11 @@ static int UnicodeGlyphByNameIndex(const void *a, const void *b) return ((const UNICODEGLYPH *)a)->name->index - ((const UNICODEGLYPH *)b)->name->index; } - + static VOID Unicodify(AFM *afm, OLD_AFMMETRICS *metrics) { INT i; - + if (strcmp(afm->EncodingScheme, "FontSpecific") == 0) { for (i = 0; i < afm->NumofMetrics; ++i) @@ -865,18 +865,18 @@ static VOID Unicodify(AFM *afm, OLD_AFMMETRICS *metrics) metrics[i].UV = -1L; } } - + afm->WinMetrics.sAscender = (SHORT)Round(afm->FontBBox.ury); afm->WinMetrics.sDescender = (SHORT)Round(afm->FontBBox.lly); } else /* non-FontSpecific encoding */ { UNICODEGLYPH ug, *p_ug; - + PSDRV_IndexGlyphList(); /* for fast searching of glyph names */ - + afm->WinMetrics.sAscender = afm->WinMetrics.sDescender = 0; - + for (i = 0; i < afm->NumofMetrics; ++i) { ug.name = metrics[i].N; @@ -890,12 +890,12 @@ static VOID Unicodify(AFM *afm, OLD_AFMMETRICS *metrics) else { metrics[i].UV = p_ug->UV; - + if (IsWinANSI(p_ug->UV)) { SHORT ury = (SHORT)Round(metrics[i].B.ury); SHORT lly = (SHORT)Round(metrics[i].B.lly); - + if (ury > afm->WinMetrics.sAscender) afm->WinMetrics.sAscender = ury; if (lly < afm->WinMetrics.sDescender) @@ -903,18 +903,18 @@ static VOID Unicodify(AFM *afm, OLD_AFMMETRICS *metrics) } } } - + if (afm->WinMetrics.sAscender == 0) afm->WinMetrics.sAscender = (SHORT)Round(afm->FontBBox.ury); if (afm->WinMetrics.sDescender == 0) afm->WinMetrics.sDescender = (SHORT)Round(afm->FontBBox.lly); } - + afm->WinMetrics.sLineGap = 1150 - (afm->WinMetrics.sAscender - afm->WinMetrics.sDescender); if (afm->WinMetrics.sLineGap < 0) afm->WinMetrics.sLineGap = 0; - + afm->WinMetrics.usWinAscent = (afm->WinMetrics.sAscender > 0) ? afm->WinMetrics.sAscender : 0; afm->WinMetrics.usWinDescent = (afm->WinMetrics.sDescender < 0) ? @@ -930,8 +930,8 @@ static VOID Unicodify(AFM *afm, OLD_AFMMETRICS *metrics) static int OldAFMMetricsByUV(const void *a, const void *b) { return ((const OLD_AFMMETRICS *)a)->UV - ((const OLD_AFMMETRICS *)b)->UV; -} - +} + static BOOL ReadCharMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, AFMMETRICS **p_metrics) { @@ -939,7 +939,7 @@ static BOOL ReadCharMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, OLD_AFMMETRICS *old_metrics, *encoded_metrics; AFMMETRICS *metrics; INT i, len; - + retval = ReadInt(file, buffer, bufsize, "StartCharMetrics", &(afm->NumofMetrics), &found); if (retval == FALSE || found == FALSE) @@ -947,55 +947,55 @@ static BOOL ReadCharMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, *p_metrics = NULL; return retval; } - + old_metrics = HeapAlloc(PSDRV_Heap, 0, afm->NumofMetrics * sizeof(*old_metrics)); if (old_metrics == NULL) return FALSE; - + for (i = 0; i < afm->NumofMetrics; ++i) { retval = ReadLine(file, buffer, bufsize, &len); if (retval == FALSE) goto cleanup_old_metrics; - + if(len > 0) { retval = ParseCharMetrics(buffer, len, old_metrics + i); if (retval == FALSE || old_metrics[i].C == INT_MAX) goto cleanup_old_metrics; - + continue; } - + switch (len) { case 0: --i; continue; - + case INT_MIN: WARN("Ignoring long line '%32s...'\n", buffer); goto cleanup_old_metrics; /* retval == TRUE */ - + case EOF: WARN("Unexpected EOF\n"); goto cleanup_old_metrics; /* retval == TRUE */ } } - + Unicodify(afm, old_metrics); /* wait until glyph names have been read */ - + qsort(old_metrics, afm->NumofMetrics, sizeof(*old_metrics), OldAFMMetricsByUV); - + for (i = 0; old_metrics[i].UV == -1; ++i); /* count unencoded glyphs */ - + afm->NumofMetrics -= i; encoded_metrics = old_metrics + i; - + afm->Metrics = *p_metrics = metrics = HeapAlloc(PSDRV_Heap, 0, afm->NumofMetrics * sizeof(*metrics)); if (afm->Metrics == NULL) goto cleanup_old_metrics; /* retval == TRUE */ - + for (i = 0; i < afm->NumofMetrics; ++i, ++metrics, ++encoded_metrics) { metrics->C = encoded_metrics->C; @@ -1003,13 +1003,13 @@ static BOOL ReadCharMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, metrics->WX = encoded_metrics->WX; metrics->N = encoded_metrics->N; } - + HeapFree(PSDRV_Heap, 0, old_metrics); - + afm->WinMetrics.sAvgCharWidth = PSDRV_CalcAvgCharWidth(afm); - + return TRUE; - + cleanup_old_metrics: /* handle fatal or non-fatal errors */ HeapFree(PSDRV_Heap, 0, old_metrics); *p_metrics = NULL; @@ -1020,7 +1020,7 @@ static BOOL ReadCharMetrics(FILE *file, CHAR buffer[], INT bufsize, AFM *afm, * BuildAFM * * Builds the AFM for a PostScript font and adds it to the driver font list. - * Returns FALSE only on an unexpected error (memory allocation or I/O error). + * Returns FALSE only on an unexpected error (memory allocation or I/O error). * */ static BOOL BuildAFM(FILE *file) @@ -1030,46 +1030,46 @@ static BOOL BuildAFM(FILE *file) AFMMETRICS *metrics; LPSTR font_name, full_name, family_name, encoding_scheme; BOOL retval, added; - + retval = ReadFontMetrics(file, buffer, sizeof(buffer), &afm); if (retval == FALSE || afm == NULL) return retval; - + retval = ReadString(file, buffer, sizeof(buffer), "FontName", &font_name); if (retval == FALSE || font_name == NULL) goto cleanup_afm; - + retval = ReadString(file, buffer, sizeof(buffer), "FullName", &full_name); if (retval == FALSE || full_name == NULL) goto cleanup_font_name; - + retval = ReadString(file, buffer, sizeof(buffer), "FamilyName", &family_name); if (retval == FALSE || family_name == NULL) goto cleanup_full_name; - + retval = ReadString(file, buffer, sizeof(buffer), "EncodingScheme", &encoding_scheme); if (retval == FALSE || encoding_scheme == NULL) goto cleanup_family_name; - + afm->FontName = font_name; afm->FullName = full_name; afm->FamilyName = family_name; afm->EncodingScheme = encoding_scheme; - + retval = ReadCharMetrics(file, buffer, sizeof(buffer), afm, &metrics); if (retval == FALSE || metrics == FALSE) goto cleanup_encoding_scheme; - + retval = PSDRV_AddAFMtoList(&PSDRV_AFMFontList, afm, &added); if (retval == FALSE || added == FALSE) goto cleanup_encoding_scheme; - + return TRUE; - + /* clean up after fatal or non-fatal errors */ - + cleanup_encoding_scheme: HeapFree(PSDRV_Heap, 0, encoding_scheme); cleanup_family_name: @@ -1080,7 +1080,7 @@ static BOOL BuildAFM(FILE *file) HeapFree(PSDRV_Heap, 0, font_name); cleanup_afm: HeapFree(PSDRV_Heap, 0, afm); - + return retval; } @@ -1097,16 +1097,16 @@ static BOOL ReadAFMFile(LPCSTR filename) BOOL retval; TRACE("%s\n", filename); - + f = fopen(filename, "r"); if (f == NULL) { WARN("%s: %s\n", filename, strerror(errno)); return TRUE; } - + retval = BuildAFM(f); - + fclose(f); return retval; } @@ -1122,36 +1122,36 @@ static BOOL ReadAFMDir(LPCSTR dirname) struct dirent *dent; DIR *dir; CHAR filename[256]; - + dir = opendir(dirname); if (dir == NULL) { WARN("%s: %s\n", dirname, strerror(errno)); return TRUE; } - + while ((dent = readdir(dir)) != NULL) { CHAR *file_extension = strchr(dent->d_name, '.'); int fn_len; - + if (file_extension == NULL || strcasecmp(file_extension, ".afm") != 0) continue; - + fn_len = snprintf(filename, 256, "%s/%s", dirname, dent->d_name); if (fn_len < 0 || fn_len > sizeof(filename) - 1) { WARN("Path '%s/%s' is too long\n", dirname, dent->d_name); continue; } - + if (ReadAFMFile(filename) == FALSE) { closedir(dir); return FALSE; } } - + closedir(dir); return TRUE; } @@ -1173,32 +1173,32 @@ BOOL PSDRV_GetType1Metrics(void) INT i = 0; HKEY hkey; DWORD type, name_len, value_len; - + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\afmdirs", 0, KEY_READ, &hkey) != ERROR_SUCCESS) return TRUE; - + name_len = sizeof(name_buf); value_len = sizeof(value_buf); - + while (RegEnumValueA(hkey, i++, name_buf, &name_len, NULL, &type, value_buf, &value_len) == ERROR_SUCCESS) { value_buf[sizeof(value_buf) - 1] = '\0'; - + if (ReadAFMDir(value_buf) == FALSE) { RegCloseKey(hkey); return FALSE; } - + /* initialize lengths for new iteration */ - + name_len = sizeof(name_buf); value_len = sizeof(value_buf); } - + RegCloseKey(hkey); return TRUE; } diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index 195de9f7618..623a901f8d7 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -55,28 +55,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet); typedef enum { /* FTP commands with arguments. */ - FTP_CMD_ACCT, - FTP_CMD_CWD, - FTP_CMD_DELE, - FTP_CMD_MKD, - FTP_CMD_PASS, - FTP_CMD_PORT, - FTP_CMD_RETR, - FTP_CMD_RMD, - FTP_CMD_RNFR, - FTP_CMD_RNTO, - FTP_CMD_STOR, - FTP_CMD_TYPE, - FTP_CMD_USER, + FTP_CMD_ACCT, + FTP_CMD_CWD, + FTP_CMD_DELE, + FTP_CMD_MKD, + FTP_CMD_PASS, + FTP_CMD_PORT, + FTP_CMD_RETR, + FTP_CMD_RMD, + FTP_CMD_RNFR, + FTP_CMD_RNTO, + FTP_CMD_STOR, + FTP_CMD_TYPE, + FTP_CMD_USER, /* FTP commands without arguments. */ FTP_CMD_ABOR, FTP_CMD_LIST, FTP_CMD_NLST, FTP_CMD_PASV, - FTP_CMD_PWD, + FTP_CMD_PWD, FTP_CMD_QUIT, -} FTP_COMMAND; +} FTP_COMMAND; static const CHAR *szFtpCommands[] = { "ACCT", @@ -121,7 +121,7 @@ BOOL FTP_DoPassive(LPWININETFTPSESSIONA lpwfs); BOOL FTP_SendPortOrPasv(LPWININETFTPSESSIONA lpwfs); BOOL FTP_ParsePermission(LPCSTR lpszPermission, LPFILEPROPERTIESA lpfp); BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIESA *lpafp, LPDWORD dwfp); -HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONA lpwfs, INT nSocket, +HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwContext); DWORD FTP_SetResponseError(DWORD dwResponse); @@ -170,7 +170,7 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, } else { - return FTP_FtpPutFileA(hConnect, lpszLocalFile, + return FTP_FtpPutFileA(hConnect, lpszLocalFile, lpszNewRemoteFile, dwFlags, dwContext); } } @@ -205,7 +205,7 @@ BOOL WINAPI FTP_FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, INTERNET_SetLastError(0); /* Open file to be uploaded */ - if (INVALID_HANDLE_VALUE == + if (INVALID_HANDLE_VALUE == (hFile = CreateFileA(lpszLocalFile, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0))) { INTERNET_SetLastError(ERROR_FILE_NOT_FOUND); @@ -221,7 +221,7 @@ BOOL WINAPI FTP_FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, INT nDataSocket; /* Get data socket to server */ - if (FTP_GetDataSocket(lpwfs, &nDataSocket)) + if (FTP_GetDataSocket(lpwfs, &nDataSocket)) { FTP_SendData(lpwfs, nDataSocket, hFile); close(nDataSocket); @@ -244,7 +244,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hConnect, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -294,7 +294,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) } else { - return FTP_FtpSetCurrentDirectoryA(hConnect, lpszDirectory); + return FTP_FtpSetCurrentDirectoryA(hConnect, lpszDirectory); } } @@ -347,7 +347,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR; hIC->lpfnStatusCB(hConnect, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -383,7 +383,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) { WORKREQUEST workRequest; - workRequest.asyncall = FTPCREATEDIRECTORYA; + workRequest.asyncall = FTPCREATEDIRECTORYA; workRequest.HFTPSESSION = (DWORD)hConnect; workRequest.LPSZDIRECTORY = (DWORD)FTP_strdup(lpszDirectory); @@ -391,7 +391,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) } else { - return FTP_FtpCreateDirectoryA(hConnect, lpszDirectory); + return FTP_FtpCreateDirectoryA(hConnect, lpszDirectory); } } @@ -441,7 +441,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hConnect, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -491,8 +491,8 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect, } else { - return FTP_FtpFindFirstFileA(hConnect, lpszSearchFile, lpFindFileData, - dwFlags, dwContext); + return FTP_FtpFindFirstFileA(hConnect, lpszSearchFile, lpFindFileData, + dwFlags, dwContext); } } @@ -536,7 +536,7 @@ HINTERNET WINAPI FTP_FtpFindFirstFileA(HINTERNET hConnect, goto lend; hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; - if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_LIST, lpszSearchFile, + if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_LIST, lpszSearchFile, hIC->lpfnStatusCB, hConnect, lpwfs->hdr.dwContext)) goto lend; @@ -601,7 +601,7 @@ lend: * FALSE on failure * */ -BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory, +BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory) { LPWININETFTPSESSIONA lpwfs = (LPWININETFTPSESSIONA) hFtpSession; @@ -630,7 +630,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire else { return FTP_FtpGetCurrentDirectoryA(hFtpSession, lpszCurrentDirectory, - lpdwCurrentDirectory); + lpdwCurrentDirectory); } } @@ -645,7 +645,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire * FALSE on failure * */ -BOOL WINAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory, +BOOL WINAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory) { INT nResCode; @@ -671,7 +671,7 @@ BOOL WINAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrent hIC->lpfnStatusCB, hFtpSession, lpwfs->hdr.dwContext)) goto lend; - nResCode = FTP_ReceiveResponse(lpwfs->sndSocket, INTERNET_GetResponseBuffer(), + nResCode = FTP_ReceiveResponse(lpwfs->sndSocket, INTERNET_GetResponseBuffer(), MAX_REPLY_LEN, hIC->lpfnStatusCB, hFtpSession, lpwfs->hdr.dwContext); if (nResCode) { @@ -692,7 +692,7 @@ BOOL WINAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrent } len = lastpos - firstpos - 1; - strncpy(lpszCurrentDirectory, &lpszResponseBuffer[firstpos+1], + strncpy(lpszCurrentDirectory, &lpszResponseBuffer[firstpos+1], len < *lpdwCurrentDirectory ? len : *lpdwCurrentDirectory); *lpdwCurrentDirectory = len; bSuccess = TRUE; @@ -705,7 +705,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR; hIC->lpfnStatusCB(hFtpSession, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -802,8 +802,8 @@ HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, bSuccess = FTP_SendStore(lpwfs, lpszFileName, dwFlags); } - /* Get data socket to server */ - if (bSuccess && FTP_GetDataSocket(lpwfs, &nDataSocket)) + /* Get data socket to server */ + if (bSuccess && FTP_GetDataSocket(lpwfs, &nDataSocket)) { hFile = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETFILE)); hFile->hdr.htype = WH_HFILE; @@ -820,7 +820,7 @@ HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + if (hFile) { iar.dwResult = (DWORD)hFile; @@ -828,7 +828,7 @@ HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, hIC->lpfnStatusCB(hFtpSession, lpwfs->hdr.dwContext, INTERNET_STATUS_HANDLE_CREATED, &iar, sizeof(INTERNET_ASYNC_RESULT)); } - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hFtpSession, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -917,7 +917,7 @@ BOOL WINAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR l INTERNET_SetLastError(0); /* Ensure we can write to lpszNewfile by opening it */ - hFile = CreateFileA(lpszNewFile, GENERIC_WRITE, 0, 0, fFailIfExists ? + hFile = CreateFileA(lpszNewFile, GENERIC_WRITE, 0, 0, fFailIfExists ? CREATE_NEW : CREATE_ALWAYS, dwLocalFlagsAttribute, 0); if (INVALID_HANDLE_VALUE == hFile) goto lend; @@ -929,8 +929,8 @@ BOOL WINAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR l { INT nDataSocket; - /* Get data socket to server */ - if (FTP_GetDataSocket(lpwfs, &nDataSocket)) + /* Get data socket to server */ + if (FTP_GetDataSocket(lpwfs, &nDataSocket)) { INT nResCode; @@ -960,7 +960,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hInternet, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -1054,7 +1054,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hFtpSession, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -1149,7 +1149,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hFtpSession, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -1229,14 +1229,14 @@ BOOL FTP_FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest) if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_RNFR, lpszSrc, 0, 0, 0)) goto lend; - nResCode = FTP_ReceiveResponse(lpwfs->sndSocket, + nResCode = FTP_ReceiveResponse(lpwfs->sndSocket, INTERNET_GetResponseBuffer(), MAX_REPLY_LEN, 0, 0, 0); if (nResCode == 350) { if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_RNTO, lpszDest, 0, 0, 0)) goto lend; - nResCode = FTP_ReceiveResponse(lpwfs->sndSocket, + nResCode = FTP_ReceiveResponse(lpwfs->sndSocket, INTERNET_GetResponseBuffer(), MAX_REPLY_LEN, 0, 0, 0); } @@ -1250,7 +1250,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hFtpSession, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -1272,7 +1272,7 @@ lend: * */ -HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, +HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, INTERNET_PORT nServerPort, LPCSTR lpszUserName, LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext) { @@ -1283,8 +1283,8 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, BOOL bSuccess = FALSE; LPWININETFTPSESSIONA lpwfs = NULL; - TRACE("0x%08lx Server(%s) Port(%d) User(%s) Paswd(%s)\n", - (ULONG) hInternet, lpszServerName, + TRACE("0x%08lx Server(%s) Port(%d) User(%s) Paswd(%s)\n", + (ULONG) hInternet, lpszServerName, nServerPort, lpszUserName, lpszPassword); if (((LPWININETHANDLEHEADER)hInternet)->htype != WH_HINIT) @@ -1333,7 +1333,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, } else { - TRACE("Connected to server\n"); + TRACE("Connected to server\n"); if (hIC->lpfnStatusCB) hIC->lpfnStatusCB(hInternet, dwContext, INTERNET_STATUS_CONNECTED_TO_SERVER, &socketAddr, sizeof(struct sockaddr_in)); @@ -1395,7 +1395,7 @@ lerror: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)lpwfs; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hInternet, dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -1482,7 +1482,7 @@ BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCSTR lpszParam, INTERNET_SetLastError(ERROR_OUTOFMEMORY); return FALSE; } - sprintf(buf, "%s%s%s%s", szFtpCommands[ftpCmd], bParamHasLen ? " " : "", + sprintf(buf, "%s%s%s%s", szFtpCommands[ftpCmd], bParamHasLen ? " " : "", bParamHasLen ? lpszParam : "", szCRLF); TRACE("Sending (%s) len(%ld)\n", buf, len); @@ -1495,7 +1495,7 @@ BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCSTR lpszParam, HeapFree(GetProcessHeap(), 0, (LPVOID)buf); if (lpfnStatusCB) - lpfnStatusCB(hHandle, dwContext, INTERNET_STATUS_REQUEST_SENT, + lpfnStatusCB(hHandle, dwContext, INTERNET_STATUS_REQUEST_SENT, &nBytesSent, sizeof(DWORD)); TRACE("Sent %ld bytes\n", nBytesSent); @@ -1555,14 +1555,14 @@ INT FTP_ReceiveResponse(INT nSocket, LPSTR lpszResponse, DWORD dwResponse, } } } - + if (nRecv >= 3) { lpszResponse[nRecv] = '\0'; rc = atoi(lpszResponse); if (lpfnStatusCB) - lpfnStatusCB(hHandle, dwContext, INTERNET_STATUS_RESPONSE_RECEIVED, + lpfnStatusCB(hHandle, dwContext, INTERNET_STATUS_RESPONSE_RECEIVED, &nRecv, sizeof(DWORD)); } @@ -1590,7 +1590,7 @@ BOOL FTP_SendPassword(LPWININETFTPSESSIONA lpwfs) TRACE("\n"); if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_PASS, lpwfs->lpszPassword, 0, 0, 0)) goto lend; - + nResCode = FTP_ReceiveResponse(lpwfs->sndSocket, INTERNET_GetResponseBuffer(), MAX_REPLY_LEN, 0, 0, 0); if (nResCode) @@ -1616,7 +1616,7 @@ lend: /*********************************************************************** * FTP_SendAccount (internal) * - * + * * * RETURNS * TRUE on success @@ -1944,7 +1944,7 @@ BOOL FTP_SendPortOrPasv(LPWININETFTPSESSIONA lpwfs) * Either accepts an incoming data socket connection from the server * or just returns the already opened socket after a PASV command * in case of passive FTP. - * + * * * RETURNS * TRUE on success @@ -2017,7 +2017,7 @@ BOOL FTP_SendData(LPWININETFTPSESSIONA lpwfs, INT nDataSocket, HANDLE hFile) break; } - nLen = DATA_PACKET_SIZE < nBytesToSend ? + nLen = DATA_PACKET_SIZE < nBytesToSend ? DATA_PACKET_SIZE : nBytesToSend; nRC = send(nDataSocket, lpszBuffer, nLen, 0); @@ -2033,7 +2033,7 @@ BOOL FTP_SendData(LPWININETFTPSESSIONA lpwfs, INT nDataSocket, HANDLE hFile) if( nSeconds / 60 > 0 ) { TRACE( "%ld bytes of %ld bytes (%ld%%) in %ld min %ld sec estimated remainig time %ld sec\n", - nTotalSent, fi.nFileSizeLow, nTotalSent*100/fi.nFileSizeLow, nSeconds / 60, + nTotalSent, fi.nFileSizeLow, nTotalSent*100/fi.nFileSizeLow, nSeconds / 60, nSeconds % 60, (fi.nFileSizeLow - nTotalSent) * nSeconds / nTotalSent ); } else @@ -2155,11 +2155,11 @@ BOOL FTP_RetrieveFileData(LPWININETFTPSESSIONA lpwfs, INT nDataSocket, DWORD nBy /* other side closed socket. */ if (nRC == 0) goto recv_end; - WriteFile(hFile, lpszBuffer, nRC, &nBytesWritten, NULL); + WriteFile(hFile, lpszBuffer, nRC, &nBytesWritten, NULL); nBytesReceived += nRC; } - TRACE("%ld bytes of %ld (%ld%%)\r", nBytesReceived, nBytes, + TRACE("%ld bytes of %ld (%ld%%)\r", nBytesReceived, nBytes, nBytesReceived * 100 / nBytes); } @@ -2214,7 +2214,7 @@ BOOL FTP_CloseSessionHandle(LPWININETFTPSESSIONA lpwfs) */ BOOL FTP_CloseFindNextHandle(LPWININETFINDNEXTA lpwfn) { - INT i; + INT i; TRACE("\n"); @@ -2241,7 +2241,7 @@ BOOL FTP_CloseFindNextHandle(LPWININETFINDNEXTA lpwfn) * NULL on failure * */ -HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONA lpwfs, INT nSocket, +HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwContext) { DWORD dwSize = 0; @@ -2259,12 +2259,12 @@ HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONA lpwfs, INT nSocket, { lpwfn->hdr.htype = WH_HFINDNEXT; lpwfn->hdr.lpwhparent = (LPWININETHANDLEHEADER)lpwfs; - lpwfn->hdr.dwContext = dwContext; + lpwfn->hdr.dwContext = dwContext; lpwfn->index = 1; /* Next index is 1 since we return index 0 */ lpwfn->size = dwSize; lpwfn->lpafp = lpafp; } - } + } TRACE("Matched %ld files\n", dwSize); return (HINTERNET)lpwfn; @@ -2290,7 +2290,7 @@ BOOL FTP_ConvertFileProp(LPFILEPROPERTIESA lpafp, LPWIN32_FIND_DATAA lpFindFileD if (lpafp) { DWORD access = mktime(&lpafp->tmLastModified); - + /* Not all fields are filled in */ lpFindFileData->ftLastAccessTime.dwHighDateTime = HIWORD(access); lpFindFileData->ftLastAccessTime.dwLowDateTime = LOWORD(access); @@ -2372,7 +2372,7 @@ BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIE LPFILEPROPERTIESA tmpafp; sizeFilePropArray *= 2; - tmpafp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *lpafp, + tmpafp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *lpafp, sizeof(FILEPROPERTIESA)*sizeFilePropArray); if (NULL == tmpafp) { @@ -2474,7 +2474,7 @@ BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIE { LPFILEPROPERTIESA tmpafp; - tmpafp = HeapReAlloc(GetProcessHeap(), 0, *lpafp, + tmpafp = HeapReAlloc(GetProcessHeap(), 0, *lpafp, sizeof(FILEPROPERTIESA)*indexFilePropArray); if (NULL == tmpafp) *lpafp = tmpafp; @@ -2488,7 +2488,7 @@ BOOL FTP_ParseDirectory(LPWININETFTPSESSIONA lpwfs, INT nSocket, LPFILEPROPERTIE bSuccess = FALSE; } -lend: +lend: return bSuccess; } @@ -2612,7 +2612,7 @@ DWORD FTP_SetResponseError(DWORD dwResponse) dwCode = ERROR_INTERNET_INTERNAL_ERROR; break; } - + INTERNET_SetLastError(dwCode); return dwCode; } diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 7bf3ff2a2c6..aba39515b97 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -1,4 +1,4 @@ -/* +/* * Wininet - Http Implementation * * Copyright 1999 Corel Corporation @@ -66,9 +66,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet); BOOL HTTP_OpenConnection(LPWININETHTTPREQA lpwhr); -int HTTP_WriteDataToStream(LPWININETHTTPREQA lpwhr, +int HTTP_WriteDataToStream(LPWININETHTTPREQA lpwhr, void *Buffer, int BytesToWrite); -int HTTP_ReadDataFromStream(LPWININETHTTPREQA lpwhr, +int HTTP_ReadDataFromStream(LPWININETHTTPREQA lpwhr, void *Buffer, int BytesToRead); BOOL HTTP_GetResponseHeaders(LPWININETHTTPREQA lpwhr); BOOL HTTP_ProcessHeader(LPWININETHTTPREQA lpwhr, LPCSTR field, LPCSTR value, DWORD dwModifier); @@ -95,7 +95,7 @@ inline static LPSTR HTTP_strdup( LPCSTR str ) * FALSE on failure * */ -BOOL WINAPI HttpAddRequestHeadersA(HINTERNET hHttpRequest, +BOOL WINAPI HttpAddRequestHeadersA(HINTERNET hHttpRequest, LPCSTR lpszHeader, DWORD dwHeaderLength, DWORD dwModifier) { LPSTR lpszStart; @@ -154,7 +154,7 @@ BOOL WINAPI HttpAddRequestHeadersA(HINTERNET hHttpRequest, */ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion, - LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes, + LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes, DWORD dwFlags, DWORD dwContext) { LPWININETHTTPSESSIONA lpwhs = (LPWININETHTTPSESSIONA) hHttpSession; @@ -188,7 +188,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, } else { - return HTTP_HttpOpenRequestA(hHttpSession, lpszVerb, lpszObjectName, + return HTTP_HttpOpenRequestA(hHttpSession, lpszVerb, lpszObjectName, lpszVersion, lpszReferrer, lpszAcceptTypes, dwFlags, dwContext); } } @@ -206,7 +206,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, */ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion, - LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes, + LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes, DWORD dwFlags, DWORD dwContext) { LPWININETHTTPSESSIONA lpwhs = (LPWININETHTTPSESSIONA) hHttpSession; @@ -290,7 +290,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)lpwhr; iar.dwError = lpwhr ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hHttpSession, dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -314,10 +314,10 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex) { - LPHTTPHEADERA lphttpHdr = NULL; + LPHTTPHEADERA lphttpHdr = NULL; BOOL bSuccess = FALSE; LPWININETHTTPREQA lpwhr = (LPWININETHTTPREQA) hHttpRequest; - + TRACE("(0x%08lx)--> %ld\n", dwInfoLevel, dwInfoLevel); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) @@ -352,7 +352,7 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, if ((~lpwhr->pCustHeaders[i].wFlags & HDR_ISREQUEST) && lpwhr->pCustHeaders[i].lpszField && lpwhr->pCustHeaders[i].lpszValue) { - size += strlen(lpwhr->pCustHeaders[i].lpszField) + + size += strlen(lpwhr->pCustHeaders[i].lpszField) + strlen(lpwhr->pCustHeaders[i].lpszValue) + delim + 2; } } @@ -360,10 +360,10 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, /* Calculate the length of stadard request headers */ for (i = 0; i <= HTTP_QUERY_MAX; i++) { - if ((~lpwhr->StdHeaders[i].wFlags & HDR_ISREQUEST) && lpwhr->StdHeaders[i].lpszField && + if ((~lpwhr->StdHeaders[i].wFlags & HDR_ISREQUEST) && lpwhr->StdHeaders[i].lpszField && lpwhr->StdHeaders[i].lpszValue) { - size += strlen(lpwhr->StdHeaders[i].lpszField) + + size += strlen(lpwhr->StdHeaders[i].lpszField) + strlen(lpwhr->StdHeaders[i].lpszValue) + delim + 2; } } @@ -396,7 +396,7 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, lpwhr->pCustHeaders[i].lpszField && lpwhr->pCustHeaders[i].lpszValue) { - cnt += sprintf(lpBuffer + cnt, "%s: %s%s", + cnt += sprintf(lpBuffer + cnt, "%s: %s%s", lpwhr->pCustHeaders[i].lpszField, lpwhr->pCustHeaders[i].lpszValue, index == HTTP_QUERY_RAW_HEADERS_CRLF ? "\r\n" : "\0"); } @@ -409,7 +409,7 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, goto lend; } else if (index >= 0 && index <= HTTP_QUERY_MAX && lpwhr->StdHeaders[index].lpszValue) - { + { lphttpHdr = &lpwhr->StdHeaders[index]; } else @@ -417,10 +417,10 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, } /* Ensure header satisifies requested attributes */ - if ((dwInfoLevel & HTTP_QUERY_FLAG_REQUEST_HEADERS) && + if ((dwInfoLevel & HTTP_QUERY_FLAG_REQUEST_HEADERS) && (~lphttpHdr->wFlags & HDR_ISREQUEST)) goto lend; - + /* coalesce value to reuqested type */ if (dwInfoLevel & HTTP_QUERY_FLAG_NUMBER) { @@ -432,7 +432,7 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, time_t tmpTime; struct tm tmpTM; SYSTEMTIME *STHook; - + tmpTime = ConvertTimeString(lphttpHdr->lpszValue); tmpTM = *gmtime(&tmpTime); @@ -476,7 +476,7 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel, strncpy(lpBuffer, lphttpHdr->lpszValue, len); *lpdwBufferLength = len; - bSuccess = TRUE; + bSuccess = TRUE; } lend: @@ -513,7 +513,7 @@ BOOL WINAPI HttpSendRequestExA(HINTERNET hRequest, */ BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional ,DWORD dwOptionalLength) -{ +{ LPWININETHTTPREQA lpwhr = (LPWININETHTTPREQA) hHttpRequest; LPWININETHTTPSESSIONA lpwhs = NULL; LPWININETAPPINFOA hIC = NULL; @@ -555,7 +555,7 @@ BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, } else { - return HTTP_HttpSendRequestA(hHttpRequest, lpszHeaders, + return HTTP_HttpSendRequestA(hHttpRequest, lpszHeaders, dwHeaderLength, lpOptional, dwOptionalLength); } } @@ -630,7 +630,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, } /* Calculate length of request string */ - requestStringLen = + requestStringLen = strlen(lpwhr->lpszVerb) + strlen(lpwhr->lpszPath) + (lpwhr->lpszHostName ? (strlen(HTTPHOSTHEADER) + strlen(lpwhr->lpszHostName)) : 0) + @@ -640,7 +640,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, /* Add length of passed headers */ if (lpszHeaders) { - headerLength = -1 == dwHeaderLength ? strlen(lpszHeaders) : dwHeaderLength; + headerLength = -1 == dwHeaderLength ? strlen(lpszHeaders) : dwHeaderLength; requestStringLen += headerLength + 2; /* \r\n */ } @@ -649,7 +649,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, { if (lpwhr->pCustHeaders[i].wFlags & HDR_ISREQUEST) { - requestStringLen += strlen(lpwhr->pCustHeaders[i].lpszField) + + requestStringLen += strlen(lpwhr->pCustHeaders[i].lpszField) + strlen(lpwhr->pCustHeaders[i].lpszValue) + 4; /*: \r\n */ } } @@ -659,7 +659,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, { if (lpwhr->StdHeaders[i].wFlags & HDR_ISREQUEST) { - requestStringLen += strlen(lpwhr->StdHeaders[i].lpszField) + + requestStringLen += strlen(lpwhr->StdHeaders[i].lpszField) + strlen(lpwhr->StdHeaders[i].lpszValue) + 4; /*: \r\n */ } } @@ -684,7 +684,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, { if (lpwhr->StdHeaders[i].wFlags & HDR_ISREQUEST) { - cnt += sprintf(requestString + cnt, "\r\n%s: %s", + cnt += sprintf(requestString + cnt, "\r\n%s: %s", lpwhr->StdHeaders[i].lpszField, lpwhr->StdHeaders[i].lpszValue); } } @@ -694,7 +694,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, { if (lpwhr->pCustHeaders[i].wFlags & HDR_ISREQUEST) { - cnt += sprintf(requestString + cnt, "\r\n%s: %s", + cnt += sprintf(requestString + cnt, "\r\n%s: %s", lpwhr->pCustHeaders[i].lpszField, lpwhr->pCustHeaders[i].lpszValue); } } @@ -735,7 +735,7 @@ lend: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)bSuccess; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hHttpRequest, lpwhr->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -757,7 +757,7 @@ lend: * NULL on failure * */ -HINTERNET HTTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, +HINTERNET HTTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, INTERNET_PORT nServerPort, LPCSTR lpszUserName, LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext) { @@ -829,7 +829,7 @@ lerror: if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) { INTERNET_ASYNC_RESULT iar; - + iar.dwResult = (DWORD)lpwhs; iar.dwError = bSuccess ? ERROR_SUCCESS : INTERNET_GetLastError(); hIC->lpfnStatusCB(hInternet, dwContext, INTERNET_STATUS_REQUEST_COMPLETE, @@ -913,7 +913,7 @@ BOOL HTTP_GetResponseHeaders(LPWININETHTTPREQA lpwhr) if (lpwhr->nSocketFD == -1) goto lend; - /* + /* * We should first receive 'HTTP/1.x nnn' where nnn is the status code. */ if (!INTERNET_GetNextLine(lpwhr->nSocketFD, buffer, &buflen)) @@ -921,7 +921,7 @@ BOOL HTTP_GetResponseHeaders(LPWININETHTTPREQA lpwhr) if (strncmp(buffer, "HTTP", 4) != 0) goto lend; - + buffer[12]='\0'; HTTP_ProcessHeader(lpwhr, "Status", buffer+9, (HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE)); @@ -971,7 +971,7 @@ INT stripSpaces(LPCSTR lpszSrc, LPSTR lpszStart, INT *len) while (*lpszSrc == ' ' && *lpszSrc != '\0') lpszSrc++; - + lpsztmp = lpszSrc; while(*lpsztmp != '\0') { @@ -1126,12 +1126,12 @@ BOOL HTTP_ProcessHeader(LPWININETHTTPREQA lpwhr, LPCSTR field, LPCSTR value, DWO return index >= 0; } } - + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) lphttpHdr->wFlags |= HDR_ISREQUEST; else lphttpHdr->wFlags &= ~HDR_ISREQUEST; - + if (!lphttpHdr->lpszValue && (dwModifier & (HTTP_ADDHDR_FLAG_ADD|HTTP_ADDHDR_FLAG_ADD_IF_NEW))) { INT slen; @@ -1156,9 +1156,9 @@ BOOL HTTP_ProcessHeader(LPWININETHTTPREQA lpwhr, LPCSTR field, LPCSTR value, DWO INTERNET_SetLastError(ERROR_OUTOFMEMORY); } } - else if (lphttpHdr->lpszValue) + else if (lphttpHdr->lpszValue) { - if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) + if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) { LPSTR lpsztmp; INT len; @@ -1211,7 +1211,7 @@ BOOL HTTP_ProcessHeader(LPWININETHTTPREQA lpwhr, LPCSTR field, LPCSTR value, DWO lpsztmp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lphttpHdr->lpszValue, len+1); if (lpsztmp) { - /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ + /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ if (ch > 0) { lphttpHdr->lpszValue[origlen] = ch; diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 364634999a8..5f8f1c89214 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -111,7 +111,7 @@ WININET_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) case DLL_THREAD_ATTACH: { LPWITHREADERROR lpwite = HeapAlloc(GetProcessHeap(), 0, sizeof(WITHREADERROR)); - if (NULL == lpwite) + if (NULL == lpwite) return FALSE; TlsSetValue(g_dwTlsErrIndex, (LPVOID)lpwite); @@ -157,7 +157,7 @@ WININET_LibMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) * NULL on failure * */ -HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, +HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags) { @@ -236,7 +236,7 @@ BOOL WINAPI InternetGetLastResponseInfoA(LPDWORD lpdwError, * * RETURNS * TRUE if connected - * if lpdwStatus is not null, return the status (off line, + * if lpdwStatus is not null, return the status (off line, * modem, lan...) in it. * FALSE if not connected */ @@ -388,7 +388,7 @@ lend: hIC = GET_HWININET_FROM_LPWININETFINDNEXT(lpwh); if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) - { + { INTERNET_ASYNC_RESULT iar; iar.dwResult = (DWORD)bSuccess; @@ -453,7 +453,7 @@ BOOL WINAPI InternetCloseHandle(HINTERNET hInternet) case WH_HINIT: INTERNET_CloseHandle((LPWININETAPPINFOA) lpwh); retval = TRUE; - break; + break; case WH_HHTTPSESSION: HTTP_CloseHTTPSessionHandle((LPWININETHTTPSESSIONA) lpwh); @@ -472,7 +472,7 @@ BOOL WINAPI InternetCloseHandle(HINTERNET hInternet) case WH_HFINDNEXT: retval = FTP_CloseFindNextHandle((LPWININETFINDNEXTA) lpwh); break; - + default: break; } @@ -527,7 +527,7 @@ BOOL SetUrlComponentValue(LPSTR* lppszComponent, LPDWORD dwComponentLen, LPCSTR * FALSE on failure * */ -BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, +BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, LPURL_COMPONENTSA lpUrlComponents) { /* @@ -567,7 +567,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, lpszParam = strpbrk(lpszap, ";?"); if (lpszParam != NULL) { - if (!SetUrlComponentValue(&lpUrlComponents->lpszExtraInfo, + if (!SetUrlComponentValue(&lpUrlComponents->lpszExtraInfo, &lpUrlComponents->dwExtraInfoLength, lpszParam+1, strlen(lpszParam+1))) { return FALSE; @@ -580,7 +580,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, /* Get scheme first. */ lpUrlComponents->nScheme = GetInternetScheme(lpszUrl, lpszcp - lpszUrl); - if (!SetUrlComponentValue(&lpUrlComponents->lpszScheme, + if (!SetUrlComponentValue(&lpUrlComponents->lpszScheme, &lpUrlComponents->dwSchemeLength, lpszUrl, lpszcp - lpszUrl)) return FALSE; @@ -618,14 +618,14 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, /* [[<:password>]@][:] */ /* First find the user and password if they exist */ - + lpszHost = strchr(lpszcp, '@'); if (lpszHost == NULL || lpszHost > lpszNetLoc) { /* username and password not specified. */ - SetUrlComponentValue(&lpUrlComponents->lpszUserName, + SetUrlComponentValue(&lpUrlComponents->lpszUserName, &lpUrlComponents->dwUserNameLength, NULL, 0); - SetUrlComponentValue(&lpUrlComponents->lpszPassword, + SetUrlComponentValue(&lpUrlComponents->lpszPassword, &lpUrlComponents->dwPasswordLength, NULL, 0); } else /* Parse out username and password */ @@ -639,16 +639,16 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, lpszPasswd = lpszcp; lpszcp++; - } - - SetUrlComponentValue(&lpUrlComponents->lpszUserName, + } + + SetUrlComponentValue(&lpUrlComponents->lpszUserName, &lpUrlComponents->dwUserNameLength, lpszUser, lpszPasswd - lpszUser); if (lpszPasswd != lpszHost) lpszPasswd++; - SetUrlComponentValue(&lpUrlComponents->lpszPassword, - &lpUrlComponents->dwPasswordLength, - lpszPasswd == lpszHost ? NULL : lpszPasswd, + SetUrlComponentValue(&lpUrlComponents->lpszPassword, + &lpUrlComponents->dwPasswordLength, + lpszPasswd == lpszHost ? NULL : lpszPasswd, lpszHost - lpszPasswd); lpszcp++; /* Advance to beginning of host */ @@ -667,7 +667,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, lpszcp++; } - SetUrlComponentValue(&lpUrlComponents->lpszHostName, + SetUrlComponentValue(&lpUrlComponents->lpszHostName, &lpUrlComponents->dwHostNameLength, lpszHost, lpszPort - lpszHost); if (lpszPort != lpszNetLoc) @@ -701,7 +701,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, len = strlen(lpszcp); } - if (!SetUrlComponentValue(&lpUrlComponents->lpszUrlPath, + if (!SetUrlComponentValue(&lpUrlComponents->lpszUrlPath, &lpUrlComponents->dwUrlPathLength, lpszcp, len)) return FALSE; } @@ -721,7 +721,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, * GetUrlCacheEntryInfoA (WININET.@) * */ -BOOL WINAPI GetUrlCacheEntryInfoA(LPCSTR lpszUrl, +BOOL WINAPI GetUrlCacheEntryInfoA(LPCSTR lpszUrl, LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntry, LPDWORD lpCacheEntrySize) { @@ -790,7 +790,7 @@ BOOL WINAPI InternetCanonicalizeUrlA(LPCSTR lpszUrl, LPSTR lpszBuffer, * InternetSetStatusCallback (WININET.@) * * Sets up a callback function which is called as progress is made - * during an operation. + * during an operation. * * RETURNS * Previous callback or NULL on success @@ -805,7 +805,7 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallback( TRACE("0x%08lx\n", (ULONG)hInternet); if (lpwai->hdr.htype != WH_HINIT) - return INTERNET_INVALID_STATUS_CALLBACK; + return INTERNET_INVALID_STATUS_CALLBACK; retVal = lpwai->lpfnStatusCB; lpwai->lpfnStatusCB = lpfnIntCB; @@ -817,7 +817,7 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallback( /*********************************************************************** * InternetWriteFile (WININET.@) * - * Write data to an open internet file + * Write data to an open internet file * * RETURNS * TRUE on success @@ -838,7 +838,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer , switch (lpwh->htype) { case WH_HHTTPREQ: - nSocket = ((LPWININETHTTPREQA)hFile)->nSocketFD; + nSocket = ((LPWININETHTTPREQA)hFile)->nSocketFD; break; case WH_HFILE: @@ -865,14 +865,14 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer , /*********************************************************************** * InternetReadFile (WININET.@) * - * Read data from an open internet file + * Read data from an open internet file * * RETURNS * TRUE on success * FALSE on failure * */ -BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, +BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD dwNumOfBytesRead) { BOOL retval = FALSE; @@ -886,7 +886,7 @@ BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, switch (lpwh->htype) { case WH_HHTTPREQ: - nSocket = ((LPWININETHTTPREQA)hFile)->nSocketFD; + nSocket = ((LPWININETHTTPREQA)hFile)->nSocketFD; break; case WH_HFILE: @@ -920,7 +920,7 @@ BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, * FALSE on failure * */ -BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, +BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength) { LPWININETHANDLEHEADER lpwhh; @@ -1032,7 +1032,7 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption, * FALSE on failure * */ -BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, +BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, LPSTR lpCookieData, LPDWORD lpdwSize) { FIXME("(%s,%s,%p), stub!\n",debugstr_a(lpszUrl),debugstr_a(lpszCookieName), @@ -1097,7 +1097,7 @@ INTERNET_SCHEME GetInternetScheme(LPCSTR lpszScheme, INT nMaxCmp) * * RETURNS * - * TRUE on success and FALSE on failure. if a failures then + * TRUE on success and FALSE on failure. if a failures then * ERROR_NOT_CONNECTED is places into GetLastError * */ @@ -1114,14 +1114,14 @@ BOOL WINAPI InternetCheckConnectionA( LPCSTR lpszUrl, DWORD dwFlags, DWORD dwRes char host[1024]; int status = -1; - /* + /* * Crack or set the Address */ if (lpszUrl == NULL) { - /* + /* * According to the doc we are supost to use the ip for the next - * server in the WnInet internal server database. I have + * server in the WnInet internal server database. I have * no idea what that is or how to get it. * * So someone needs to implement this. @@ -1136,10 +1136,10 @@ BOOL WINAPI InternetCheckConnectionA( LPCSTR lpszUrl, DWORD dwFlags, DWORD dwRes ZeroMemory(&componets,sizeof(URL_COMPONENTSA)); componets.lpszHostName = (LPSTR)&host; componets.dwHostNameLength = 1024; - + if (!InternetCrackUrlA(lpszUrl,0,0,&componets)) goto End; - + TRACE("host name : %s\n",componets.lpszHostName); } @@ -1155,13 +1155,13 @@ BOOL WINAPI InternetCheckConnectionA( LPCSTR lpszUrl, DWORD dwFlags, DWORD dwRes status = system(command); TRACE("Ping returned a code of %i \n",status); - - /* Ping return code of 0 indicates success */ + + /* Ping return code of 0 indicates success */ if (status == 0) rc = TRUE; End: - + if (rc == FALSE) SetLastError(ERROR_NOT_CONNECTED); @@ -1172,7 +1172,7 @@ End: * InternetOpenUrlA (WININET.@) * * Opens an URL - * + * * RETURNS * handle of connection or NULL on failure */ @@ -1441,8 +1441,8 @@ BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest) { InterlockedIncrement(&dwNumIdleThreads); - if (InterlockedIncrement(&dwNumThreads) > MAX_WORKER_THREADS || - !(hThread = CreateThread(NULL, 0, + if (InterlockedIncrement(&dwNumThreads) > MAX_WORKER_THREADS || + !(hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)INTERNET_WorkerThreadFunc, NULL, 0, &dwTID))) { InterlockedDecrement(&dwNumThreads); @@ -1487,27 +1487,27 @@ VOID INTERNET_ExecuteWork() break; case FTPSETCURRENTDIRECTORYA: - FTP_FtpSetCurrentDirectoryA((HINTERNET)workRequest.HFTPSESSION, + FTP_FtpSetCurrentDirectoryA((HINTERNET)workRequest.HFTPSESSION, (LPCSTR)workRequest.LPSZDIRECTORY); HeapFree(GetProcessHeap(), 0, (LPVOID)workRequest.LPSZDIRECTORY); break; case FTPCREATEDIRECTORYA: - FTP_FtpCreateDirectoryA((HINTERNET)workRequest.HFTPSESSION, + FTP_FtpCreateDirectoryA((HINTERNET)workRequest.HFTPSESSION, (LPCSTR)workRequest.LPSZDIRECTORY); HeapFree(GetProcessHeap(), 0, (LPVOID)workRequest.LPSZDIRECTORY); break; case FTPFINDFIRSTFILEA: - FTP_FtpFindFirstFileA((HINTERNET)workRequest.HFTPSESSION, - (LPCSTR)workRequest.LPSZSEARCHFILE, - (LPWIN32_FIND_DATAA)workRequest.LPFINDFILEDATA, workRequest.DWFLAGS, + FTP_FtpFindFirstFileA((HINTERNET)workRequest.HFTPSESSION, + (LPCSTR)workRequest.LPSZSEARCHFILE, + (LPWIN32_FIND_DATAA)workRequest.LPFINDFILEDATA, workRequest.DWFLAGS, workRequest.DWCONTEXT); HeapFree(GetProcessHeap(), 0, (LPVOID)workRequest.LPSZSEARCHFILE); break; case FTPGETCURRENTDIRECTORYA: - FTP_FtpGetCurrentDirectoryA((HINTERNET)workRequest.HFTPSESSION, + FTP_FtpGetCurrentDirectoryA((HINTERNET)workRequest.HFTPSESSION, (LPSTR)workRequest.LPSZDIRECTORY, (LPDWORD)workRequest.LPDWDIRECTORY); break; @@ -1558,21 +1558,21 @@ VOID INTERNET_ExecuteWork() break; case HTTPSENDREQUESTA: - HTTP_HttpSendRequestA((HINTERNET)workRequest.HFTPSESSION, + HTTP_HttpSendRequestA((HINTERNET)workRequest.HFTPSESSION, (LPCSTR)workRequest.LPSZHEADER, - workRequest.DWHEADERLENGTH, - (LPVOID)workRequest.LPOPTIONAL, + workRequest.DWHEADERLENGTH, + (LPVOID)workRequest.LPOPTIONAL, workRequest.DWOPTIONALLENGTH); HeapFree(GetProcessHeap(), 0, (LPVOID)workRequest.LPSZHEADER); break; case HTTPOPENREQUESTA: - HTTP_HttpOpenRequestA((HINTERNET)workRequest.HFTPSESSION, + HTTP_HttpOpenRequestA((HINTERNET)workRequest.HFTPSESSION, (LPCSTR)workRequest.LPSZVERB, - (LPCSTR)workRequest.LPSZOBJECTNAME, - (LPCSTR)workRequest.LPSZVERSION, - (LPCSTR)workRequest.LPSZREFERRER, - (LPCSTR*)workRequest.LPSZACCEPTTYPES, + (LPCSTR)workRequest.LPSZOBJECTNAME, + (LPCSTR)workRequest.LPSZVERSION, + (LPCSTR)workRequest.LPSZREFERRER, + (LPCSTR*)workRequest.LPSZACCEPTTYPES, workRequest.DWFLAGS, workRequest.DWCONTEXT); HeapFree(GetProcessHeap(), 0, (LPVOID)workRequest.LPSZVERB); diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index d45d8bb18f2..6ecf1bd8474 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -209,11 +209,11 @@ typedef struct WORKREQ time_t ConvertTimeString(LPCSTR asctime); -HINTERNET FTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, +HINTERNET FTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, INTERNET_PORT nServerPort, LPCSTR lpszUserName, LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext); -HINTERNET HTTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, +HINTERNET HTTP_Connect(HINTERNET hInterent, LPCSTR lpszServerName, INTERNET_PORT nServerPort, LPCSTR lpszUserName, LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext); @@ -236,13 +236,13 @@ BOOLAPI FTP_FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory); BOOLAPI FTP_FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory); INTERNETAPI HINTERNET WINAPI FTP_FtpFindFirstFileA(HINTERNET hConnect, LPCSTR lpszSearchFile, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwFlags, DWORD dwContext); -BOOLAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory, +BOOLAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDirectory, LPDWORD lpdwCurrentDirectory); BOOL FTP_ConvertFileProp(LPFILEPROPERTIESA lpafp, LPWIN32_FIND_DATAA lpFindFileData); BOOL FTP_FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest); BOOL FTP_FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory); BOOL FTP_FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName); -HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, LPCSTR lpszFileName, +HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, LPCSTR lpszFileName, DWORD fdwAccess, DWORD dwFlags, DWORD dwContext); BOOLAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszNewFile, BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags, @@ -252,7 +252,7 @@ BOOLAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional ,DWORD dwOptionalLength); INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, LPCSTR lpszVerb, LPCSTR lpszObjectName, LPCSTR lpszVersion, - LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes, + LPCSTR lpszReferrer , LPCSTR *lpszAcceptTypes, DWORD dwFlags, DWORD dwContext); void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONA lpwhs); void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr); diff --git a/dlls/wininet/utility.c b/dlls/wininet/utility.c index 03081048329..1cff5606df9 100644 --- a/dlls/wininet/utility.c +++ b/dlls/wininet/utility.c @@ -1,4 +1,4 @@ -/* +/* * Wininet - Utility functions * * Copyright 1999 Corel Corporation @@ -52,11 +52,11 @@ time_t ConvertTimeString(LPCSTR asctime) /* Assert that the string is the expected length */ if (tmpChar[TIME_STRING_LEN] != '\0') - { + { tmpChar[TIME_STRING_LEN] = '\0'; FIXME("\n"); } - + /* Convert a time such as 'Mon, 15 Nov 1999 16:09:35 GMT' into a SYSTEMTIME structure * We assume the time is in this format * and divide it into easy to swallow chunks @@ -74,7 +74,7 @@ time_t ConvertTimeString(LPCSTR asctime) t.tm_hour = atoi(tmpChar+17); t.tm_min = atoi(tmpChar+20); t.tm_sec = atoi(tmpChar+23); - + /* and month */ tmpChar2 = tmpChar + 8; switch(tmpChar2[2]) diff --git a/dlls/wininet/wininet_main.c b/dlls/wininet/wininet_main.c index 2873a633f49..4a46427ca75 100644 --- a/dlls/wininet/wininet_main.c +++ b/dlls/wininet/wininet_main.c @@ -30,7 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet); */ HRESULT WINAPI WININET_DllInstall(BOOL bInstall, LPCWSTR cmdline) { - FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE", + FIXME("(%s, %s): stub\n", bInstall?"TRUE":"FALSE", debugstr_w(cmdline)); return S_OK; diff --git a/dlls/winmm/driver.c b/dlls/winmm/driver.c index ca3b03da8ff..fd54e41b728 100644 --- a/dlls/winmm/driver.c +++ b/dlls/winmm/driver.c @@ -45,9 +45,9 @@ static unsigned DRIVER_GetNumberOfModuleRefs(HMODULE hModule, WINE_DRIVER** foun unsigned count = 0; if (found) *found = NULL; - for (lpDrv = lpDrvItemList; lpDrv; lpDrv = lpDrv->lpNextItem) + for (lpDrv = lpDrvItemList; lpDrv; lpDrv = lpDrv->lpNextItem) { - if (!(lpDrv->dwFlags & WINE_GDF_16BIT) && lpDrv->d.d32.hModule == hModule) + if (!(lpDrv->dwFlags & WINE_GDF_16BIT) && lpDrv->d.d32.hModule == hModule) { if (found && !*found) *found = lpDrv; count++; @@ -58,11 +58,11 @@ static unsigned DRIVER_GetNumberOfModuleRefs(HMODULE hModule, WINE_DRIVER** foun /************************************************************************** * DRIVER_FindFromHDrvr [internal] - * + * * From a hDrvr being 32 bits, returns the WINE internal structure. */ LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr) -{ +{ LPWINE_DRIVER d = (LPWINE_DRIVER)hDrvr; if (hDrvr && HeapValidate(GetProcessHeap(), 0, d) && d->dwMagic == WINE_DI_MAGIC) { @@ -83,7 +83,7 @@ LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr) static int DRIVER_MapMsg32To16(WORD wMsg, DWORD* lParam1, DWORD* lParam2) { int ret = -1; - + switch (wMsg) { case DRV_LOAD: case DRV_ENABLE: @@ -92,7 +92,7 @@ static int DRIVER_MapMsg32To16(WORD wMsg, DWORD* lParam1, DWORD* lParam2) case DRV_QUERYCONFIGURE: case DRV_REMOVE: case DRV_EXITSESSION: - case DRV_EXITAPPLICATION: + case DRV_EXITAPPLICATION: case DRV_POWER: case DRV_CLOSE: /* should be 0/0 */ case DRV_OPEN: /* pass through */ @@ -102,18 +102,18 @@ static int DRIVER_MapMsg32To16(WORD wMsg, DWORD* lParam1, DWORD* lParam2) break; case DRV_CONFIGURE: case DRV_INSTALL: - /* lParam1 is a handle to a window (conf) or to a driver (inst) or not used, - * lParam2 is a pointer to DRVCONFIGINFO + /* lParam1 is a handle to a window (conf) or to a driver (inst) or not used, + * lParam2 is a pointer to DRVCONFIGINFO */ if (*lParam2) { LPDRVCONFIGINFO16 dci16 = HeapAlloc( GetProcessHeap(), 0, sizeof(*dci16) ); LPDRVCONFIGINFO dci32 = (LPDRVCONFIGINFO)(*lParam2); - + if (dci16) { LPSTR str1; - + dci16->dwDCISize = sizeof(DRVCONFIGINFO16); - + if ((str1 = HEAP_strdupWtoA(GetProcessHeap(), 0, dci32->lpszDCISectionName)) != NULL) { dci16->lpszDCISectionName = MapLS( str1 ); @@ -155,7 +155,7 @@ static int DRIVER_MapMsg32To16(WORD wMsg, DWORD* lParam1, DWORD* lParam2) static int DRIVER_UnMapMsg32To16(WORD wMsg, DWORD lParam1, DWORD lParam2) { int ret = -1; - + switch (wMsg) { case DRV_LOAD: case DRV_ENABLE: @@ -170,7 +170,7 @@ static int DRIVER_UnMapMsg32To16(WORD wMsg, DWORD lParam1, DWORD lParam2) case DRV_CLOSE: /* lParam1 and lParam2 are not used */ break; - case DRV_CONFIGURE: + case DRV_CONFIGURE: case DRV_INSTALL: /* lParam1 is a handle to a window (or not used), lParam2 is a pointer to DRVCONFIGINFO, lParam2 */ if (lParam2) { @@ -196,13 +196,13 @@ static int DRIVER_UnMapMsg32To16(WORD wMsg, DWORD lParam1, DWORD lParam2) /************************************************************************** * DRIVER_SendMessage [internal] */ -static LRESULT inline DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT msg, +static LRESULT inline DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT msg, LPARAM lParam1, LPARAM lParam2) { if (lpDrv->dwFlags & WINE_GDF_16BIT) { LRESULT ret; int map = 0; - TRACE("Before sdm16 call hDrv=%04x wMsg=%04x p1=%08lx p2=%08lx\n", + TRACE("Before sdm16 call hDrv=%04x wMsg=%04x p1=%08lx p2=%08lx\n", lpDrv->d.d16.hDriver16, msg, lParam1, lParam2); if ((map = DRIVER_MapMsg32To16(msg, &lParam1, &lParam2)) >= 0) { @@ -214,7 +214,7 @@ static LRESULT inline DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT msg, } return ret; } - TRACE("Before func32 call proc=%p driverID=%08lx hDrv=%08x wMsg=%04x p1=%08lx p2=%08lx\n", + TRACE("Before func32 call proc=%p driverID=%08lx hDrv=%08x wMsg=%04x p1=%08lx p2=%08lx\n", lpDrv->d.d32.lpDrvProc, lpDrv->d.d32.dwDriverID, (HDRVR)lpDrv, msg, lParam1, lParam2); return lpDrv->d.d32.lpDrvProc(lpDrv->d.d32.dwDriverID, (HDRVR)lpDrv, msg, lParam1, lParam2); } @@ -228,16 +228,16 @@ LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT msg, LPARAM lParam1, { LPWINE_DRIVER lpDrv; LRESULT retval = 0; - + TRACE("(%04x, %04X, %08lX, %08lX)\n", hDriver, msg, lParam1, lParam2); - + if ((lpDrv = DRIVER_FindFromHDrvr(hDriver)) != NULL) { retval = DRIVER_SendMessage(lpDrv, msg, lParam1, lParam2); } else { WARN("Bad driver handle %u\n", hDriver); } TRACE("retval = %ld\n", retval); - + return retval; } @@ -256,7 +256,7 @@ static BOOL DRIVER_RemoveFromList(LPWINE_DRIVER lpDrv) DRIVER_SendMessage(lpDrv, DRV_FREE, 0L, 0L); } } - + if (lpDrv->lpPrevItem) lpDrv->lpPrevItem->lpNextItem = lpDrv->lpNextItem; else @@ -299,7 +299,7 @@ static BOOL DRIVER_AddToList(LPWINE_DRIVER lpNewDrv, LPARAM lParam1, LPARAM lPar LPWINE_DRIVER lpDrv = lpDrvItemList; /* find end of list */ while (lpDrv->lpNextItem != NULL) lpDrv = lpDrv->lpNextItem; - + lpDrv->lpNextItem = lpNewDrv; lpNewDrv->lpPrevItem = lpDrv; } @@ -340,7 +340,7 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2) LPCSTR cause = 0; TRACE("(%s, %08lX);\n", debugstr_a(fn), lParam2); - + if ((ptr = strchr(fn, ' ')) != NULL) { *ptr++ = '\0'; while (*ptr == ' ') ptr++; @@ -360,7 +360,7 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2) lpDrv->d.d32.dwDriverID = 0; /* Win32 installable drivers must support a two phase opening scheme: - * + first open with NULL as lParam2 (session instance), + * + first open with NULL as lParam2 (session instance), * + then do a second open with the real non null lParam2) */ if (DRIVER_GetNumberOfModuleRefs(lpDrv->d.d32.hModule, NULL) == 0 && lParam2) @@ -369,20 +369,20 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2) if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, 0L)) { - cause = "load0 failed"; + cause = "load0 failed"; goto exit; } ret = DRIVER_TryOpenDriver32(fn, lParam2); - if (!ret) + if (!ret) { CloseDriver((HDRVR)lpDrv, 0L, 0L); - cause = "load1 failed"; + cause = "load1 failed"; goto exit; } return ret; } - if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, lParam2)) + if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, lParam2)) {cause = "load failed"; goto exit;} TRACE("=> %p\n", lpDrv); @@ -405,7 +405,7 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR fn, LPCSTR sn, LPARAM lParam2 LPCSTR cause = 0; TRACE("(%s, %08lX);\n", debugstr_a(sn), lParam2); - + lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER)); if (lpDrv == NULL) {cause = "OOM"; goto exit;} @@ -435,14 +435,14 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR fn, LPCSTR sn, LPARAM lParam2 * (0,1,DRV_ENABLE,0 ,0) * (0,1,DRV_OPEN ,buf[256],0) */ -HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2) +HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lParam2) { LPWINE_DRIVER lpDrv = NULL; char libName[128]; LPCSTR lsn = lpSectionName; TRACE("(%s, %s, 0x%08lx);\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName), lParam2); - + if (lsn == NULL) { lstrcpynA(libName, lpDriverName, sizeof(libName)); @@ -470,7 +470,7 @@ HDRVR WINAPI OpenDriverW(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lPa LPSTR dn = HEAP_strdupWtoA(GetProcessHeap(), 0, lpDriverName); LPSTR sn = HEAP_strdupWtoA(GetProcessHeap(), 0, lpSectionName); HDRVR ret = OpenDriverA(dn, sn, lParam); - + if (dn) HeapFree(GetProcessHeap(), 0, dn); if (sn) HeapFree(GetProcessHeap(), 0, sn); return ret; @@ -485,8 +485,8 @@ LRESULT WINAPI CloseDriver(HDRVR hDrvr, LPARAM lParam1, LPARAM lParam2) LPWINE_DRIVER lpDrv; TRACE("(%04x, %08lX, %08lX);\n", hDrvr, lParam1, lParam2); - - if ((lpDrv = DRIVER_FindFromHDrvr(hDrvr)) != NULL) + + if ((lpDrv = DRIVER_FindFromHDrvr(hDrvr)) != NULL) { if (lpDrv->dwFlags & WINE_GDF_16BIT) CloseDriver16(lpDrv->d.d16.hDriver16, lParam1, lParam2); @@ -553,9 +553,9 @@ HMODULE WINAPI GetDriverModuleHandle(HDRVR hDrvr) { LPWINE_DRIVER lpDrv; HMODULE hModule = 0; - + TRACE("(%04x);\n", hDrvr); - + if ((lpDrv = DRIVER_FindFromHDrvr(hDrvr)) != NULL) { if (!(lpDrv->dwFlags & WINE_GDF_16BIT)) hModule = lpDrv->d.d32.hModule; @@ -600,7 +600,7 @@ HANDLE16 WINAPI DrvGetModuleHandle16(HDRVR16 hDrv) /************************************************************************** * DrvDefDriverProc [MMSYSTEM.1104] */ -LRESULT WINAPI DrvDefDriverProc16(DWORD dwDriverID, HDRVR16 hDrv, WORD wMsg, +LRESULT WINAPI DrvDefDriverProc16(DWORD dwDriverID, HDRVR16 hDrv, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { return DefDriverProc16(dwDriverID, hDrv, wMsg, dwParam1, dwParam2); @@ -630,7 +630,7 @@ LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hDrv, /************************************************************************** * DriverProc [MMSYSTEM.6] */ -LRESULT WINAPI DriverProc16(DWORD dwDevID, HDRVR16 hDrv, WORD wMsg, +LRESULT WINAPI DriverProc16(DWORD dwDevID, HDRVR16 hDrv, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { TRACE("dwDevID=%08lx hDrv=%04x wMsg=%04x dwParam1=%08lx dwParam2=%08lx\n", diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c index 40d572cd237..41159adc05a 100644 --- a/dlls/winmm/joystick.c +++ b/dlls/winmm/joystick.c @@ -28,7 +28,7 @@ #include #include #include -#ifdef HAVE_SYS_IOCTL_H +#ifdef HAVE_SYS_IOCTL_H #include #endif @@ -83,17 +83,17 @@ static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT wTimer, DWORD dwTime) JOYINFO ji; LONG pos; unsigned buttonChange; - + for (i = 0; i < MAXJOYSTICK; i++) { joy = &JOY_Sticks[i]; - - if (joy->hCapture != hWnd) continue; - + + if (joy->hCapture != hWnd) continue; + joyGetPos(i, &ji); pos = MAKELONG(ji.wXpos, ji.wYpos); - + if (!joy->bChanged || - abs(joy->ji.wXpos - ji.wXpos) > joy->threshold || + abs(joy->ji.wXpos - ji.wXpos) > joy->threshold || abs(joy->ji.wYpos - ji.wYpos) > joy->threshold) { SendMessageA(joy->hCapture, MM_JOY1MOVE + i, ji.wButtons, pos); joy->ji.wXpos = ji.wXpos; @@ -106,10 +106,10 @@ static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT wTimer, DWORD dwTime) } if ((buttonChange = joy->ji.wButtons ^ ji.wButtons) != 0) { if (ji.wButtons & buttonChange) - SendMessageA(joy->hCapture, MM_JOY1BUTTONDOWN + i, + SendMessageA(joy->hCapture, MM_JOY1BUTTONDOWN + i, (buttonChange << 8) | (ji.wButtons & buttonChange), pos); if (joy->ji.wButtons & buttonChange) - SendMessageA(joy->hCapture, MM_JOY1BUTTONUP + i, + SendMessageA(joy->hCapture, MM_JOY1BUTTONUP + i, (buttonChange << 8) | (joy->ji.wButtons & buttonChange), pos); joy->ji.wButtons = ji.wButtons; } @@ -152,7 +152,7 @@ MMRESULT WINAPI joyGetDevCapsA(UINT wID, LPJOYCAPSA lpCaps, UINT wSize) lpCaps->wPeriodMax = JOY_PERIOD_MAX; /* FIXME (same as MS Joystick Driver) */ return SendDriverMessage(JOY_Sticks[wID].hDriver, JDD_GETDEVCAPS, (DWORD)lpCaps, wSize); -} +} /************************************************************************** * joyGetDevCapsW [WINMM.@] @@ -161,7 +161,7 @@ MMRESULT WINAPI joyGetDevCapsW(UINT wID, LPJOYCAPSW lpCaps, UINT wSize) { JOYCAPSA jca; MMRESULT ret = joyGetDevCapsA(wID, &jca, sizeof(jca)); - + if (ret != JOYERR_NOERROR) return ret; lpCaps->wMid = jca.wMid; lpCaps->wPid = jca.wPid; @@ -176,7 +176,7 @@ MMRESULT WINAPI joyGetDevCapsW(UINT wID, LPJOYCAPSW lpCaps, UINT wSize) lpCaps->wNumButtons = jca.wNumButtons; lpCaps->wPeriodMin = jca.wPeriodMin; lpCaps->wPeriodMax = jca.wPeriodMax; - + if (wSize >= sizeof(JOYCAPSW)) { /* Win95 extensions ? */ lpCaps->wRmin = jca.wRmin; lpCaps->wRmax = jca.wRmax; @@ -193,7 +193,7 @@ MMRESULT WINAPI joyGetDevCapsW(UINT wID, LPJOYCAPSW lpCaps, UINT wSize) MultiByteToWideChar( CP_ACP, 0, jca.szOEMVxD, -1, lpCaps->szOEMVxD, sizeof(lpCaps->szOEMVxD)/sizeof(WCHAR) ); } - + return ret; } @@ -204,7 +204,7 @@ MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) { JOYCAPSA jca; MMRESULT ret = joyGetDevCapsA(wID, &jca, sizeof(jca)); - + if (ret != JOYERR_NOERROR) return ret; lpCaps->wMid = jca.wMid; lpCaps->wPid = jca.wPid; @@ -218,7 +218,7 @@ MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) lpCaps->wNumButtons = jca.wNumButtons; lpCaps->wPeriodMin = jca.wPeriodMin; lpCaps->wPeriodMax = jca.wPeriodMax; - + if (wSize >= sizeof(JOYCAPS16)) { /* Win95 extensions ? */ lpCaps->wRmin = jca.wRmin; lpCaps->wRmax = jca.wRmax; @@ -233,7 +233,7 @@ MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) strcpy(lpCaps->szRegKey, jca.szRegKey); strcpy(lpCaps->szOEMVxD, jca.szOEMVxD); } - + return ret; } @@ -243,10 +243,10 @@ MMRESULT16 WINAPI joyGetDevCaps16(UINT16 wID, LPJOYCAPS16 lpCaps, UINT16 wSize) MMRESULT WINAPI joyGetPosEx(UINT wID, LPJOYINFOEX lpInfo) { TRACE("(%d, %p);\n", wID, lpInfo); - + if (wID >= MAXJOYSTICK) return JOYERR_PARMS; if (!JOY_LoadDriver(wID)) return MMSYSERR_NODRIVER; - + lpInfo->dwXpos = 0; lpInfo->dwYpos = 0; lpInfo->dwZpos = 0; @@ -276,10 +276,10 @@ MMRESULT16 WINAPI joyGetPosEx16(UINT16 wID, LPJOYINFOEX lpInfo) MMRESULT WINAPI joyGetPos(UINT wID, LPJOYINFO lpInfo) { TRACE("(%d, %p);\n", wID, lpInfo); - + if (wID >= MAXJOYSTICK) return JOYERR_PARMS; if (!JOY_LoadDriver(wID)) return MMSYSERR_NODRIVER; - + lpInfo->wXpos = 0; lpInfo->wYpos = 0; lpInfo->wZpos = 0; @@ -295,9 +295,9 @@ MMRESULT16 WINAPI joyGetPos16(UINT16 wID, LPJOYINFO16 lpInfo) { JOYINFO ji; MMRESULT ret; - + TRACE("(%d, %p);\n", wID, lpInfo); - + if ((ret = joyGetPos(wID, &ji)) == JOYERR_NOERROR) { lpInfo->wXpos = ji.wXpos; lpInfo->wYpos = ji.wYpos; @@ -313,9 +313,9 @@ MMRESULT16 WINAPI joyGetPos16(UINT16 wID, LPJOYINFO16 lpInfo) MMRESULT WINAPI joyGetThreshold(UINT wID, LPUINT lpThreshold) { TRACE("(%04X, %p);\n", wID, lpThreshold); - + if (wID >= MAXJOYSTICK) return JOYERR_PARMS; - + *lpThreshold = JOY_Sticks[wID].threshold; return JOYERR_NOERROR; } @@ -326,9 +326,9 @@ MMRESULT WINAPI joyGetThreshold(UINT wID, LPUINT lpThreshold) MMRESULT16 WINAPI joyGetThreshold16(UINT16 wID, LPUINT16 lpThreshold) { TRACE("(%04X, %p);\n", wID, lpThreshold); - + if (wID >= MAXJOYSTICK) return JOYERR_PARMS; - + *lpThreshold = JOY_Sticks[wID].threshold; return JOYERR_NOERROR; } @@ -381,7 +381,7 @@ MMRESULT WINAPI joySetCapture(HWND hWnd, UINT wID, UINT wPeriod, BOOL bChanged) JOY_Sticks[wID].hCapture = hWnd; JOY_Sticks[wID].bChanged = bChanged; - + return JOYERR_NOERROR; } @@ -390,7 +390,7 @@ MMRESULT WINAPI joySetCapture(HWND hWnd, UINT wID, UINT wPeriod, BOOL bChanged) */ MMRESULT16 WINAPI joySetCapture16(HWND16 hWnd, UINT16 wID, UINT16 wPeriod, BOOL16 bChanged) { - return joySetCapture16(hWnd, wID, wPeriod, bChanged); + return joySetCapture16(hWnd, wID, wPeriod, bChanged); } /************************************************************************** @@ -399,7 +399,7 @@ MMRESULT16 WINAPI joySetCapture16(HWND16 hWnd, UINT16 wID, UINT16 wPeriod, BOOL1 MMRESULT WINAPI joySetThreshold(UINT wID, UINT wThreshold) { TRACE("(%04X, %d);\n", wID, wThreshold); - + if (wID >= MAXJOYSTICK) return MMSYSERR_INVALPARAM; JOY_Sticks[wID].threshold = wThreshold; diff --git a/dlls/winmm/joystick/joystick.c b/dlls/winmm/joystick/joystick.c index cd93a5fbf53..fef5b78961f 100644 --- a/dlls/winmm/joystick/joystick.c +++ b/dlls/winmm/joystick/joystick.c @@ -44,7 +44,7 @@ #include #include #include -#ifdef HAVE_SYS_IOCTL_H +#ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_LINUX_JOYSTICK_H @@ -76,7 +76,7 @@ typedef struct tagWINE_JSTCK { static WINE_JSTCK JSTCK_Data[MAXJOYSTICK]; /************************************************************************** - * JSTCK_drvGet [internal] + * JSTCK_drvGet [internal] */ static WINE_JSTCK* JSTCK_drvGet(DWORD dwDevID) { @@ -92,7 +92,7 @@ static WINE_JSTCK* JSTCK_drvGet(DWORD dwDevID) } /************************************************************************** - * JSTCK_drvOpen [internal] + * JSTCK_drvOpen [internal] */ static DWORD JSTCK_drvOpen(LPSTR str, DWORD dwIntf) { @@ -105,7 +105,7 @@ static DWORD JSTCK_drvOpen(LPSTR str, DWORD dwIntf) } /************************************************************************** - * JSTCK_drvClose [internal] + * JSTCK_drvClose [internal] */ static DWORD JSTCK_drvClose(DWORD dwDevID) { @@ -159,7 +159,7 @@ static LONG JSTCK_GetDevCaps(DWORD dwDevID, LPJOYCAPSA lpCaps, DWORD dwSize) return MMSYSERR_NODRIVER; #ifdef HAVE_LINUX_22_JOYSTICK_API - + if ((dev = JSTCK_OpenDevice(jstck)) < 0) return JOYERR_PARMS; ioctl(dev, JSIOCGAXES, &nrOfAxes); ioctl(dev, JSIOCGBUTTONS, &nrOfButtons); @@ -249,7 +249,7 @@ static LONG JSTCK_GetPosEx(DWORD dwDevID, LPJOYINFOEX lpInfo) struct js_status js; int dev_stat; #endif - + if ((jstck = JSTCK_drvGet(dwDevID)) == NULL) return MMSYSERR_NODRIVER; @@ -265,7 +265,7 @@ static LONG JSTCK_GetPosEx(DWORD dwDevID, LPJOYINFOEX lpInfo) if (lpInfo->dwFlags & JOY_RETURNX) lpInfo->dwXpos = ev.value + 32767; break; - case 1: + case 1: if (lpInfo->dwFlags & JOY_RETURNY) lpInfo->dwYpos = ev.value + 32767; break; @@ -273,24 +273,24 @@ static LONG JSTCK_GetPosEx(DWORD dwDevID, LPJOYINFOEX lpInfo) if (lpInfo->dwFlags & JOY_RETURNZ) lpInfo->dwZpos = ev.value + 32767; break; - case 3: + case 3: if (lpInfo->dwFlags & JOY_RETURNR) lpInfo->dwRpos = ev.value + 32767; - case 4: + case 4: if (lpInfo->dwFlags & JOY_RETURNU) lpInfo->dwUpos = ev.value + 32767; - case 5: + case 5: if (lpInfo->dwFlags & JOY_RETURNV) lpInfo->dwVpos = ev.value + 32767; break; - default: + default: FIXME("Unknown joystick event '%d'\n", ev.number); } } else if (ev.type == (JS_EVENT_BUTTON | JS_EVENT_INIT)) { if (lpInfo->dwFlags & JOY_RETURNBUTTONS) { if (ev.value) { lpInfo->dwButtons |= (1 << ev.number); - /* FIXME: what to do for this field when + /* FIXME: what to do for this field when * multiple buttons are depressed ? */ lpInfo->dwButtonNumber = ev.number + 1; @@ -321,7 +321,7 @@ static LONG JSTCK_GetPosEx(DWORD dwDevID, LPJOYINFOEX lpInfo) close(dev); - TRACE("x: %ld, y: %ld, z: %ld, r: %ld, u: %ld, v: %ld, buttons: 0x%04x, flags: 0x%04x\n", + TRACE("x: %ld, y: %ld, z: %ld, r: %ld, u: %ld, v: %ld, buttons: 0x%04x, flags: 0x%04x\n", lpInfo->dwXpos, lpInfo->dwYpos, lpInfo->dwZpos, lpInfo->dwRpos, lpInfo->dwUpos, lpInfo->dwVpos, (unsigned int)lpInfo->dwButtons, @@ -356,12 +356,12 @@ static LONG JSTCK_GetPos(DWORD dwDevID, LPJOYINFO lpInfo) /************************************************************************** * DriverProc (JOYSTICK.@) */ -LONG CALLBACK JSTCK_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK JSTCK_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */ /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */ - + switch(wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; @@ -377,7 +377,7 @@ LONG CALLBACK JSTCK_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case JDD_GETNUMDEVS: return 1; case JDD_GETDEVCAPS: return JSTCK_GetDevCaps(dwDevID, (LPJOYCAPSA)dwParam1, dwParam2); case JDD_GETPOS: return JSTCK_GetPos(dwDevID, (LPJOYINFO)dwParam1); - case JDD_SETCALIBRATION: + case JDD_SETCALIBRATION: case JDD_CONFIGCHANGED: return JOYERR_NOCANDO; case JDD_GETPOSEX: return JSTCK_GetPosEx(dwDevID, (LPJOYINFOEX)dwParam1); default: @@ -390,19 +390,19 @@ LONG CALLBACK JSTCK_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, /************************************************************************** * DriverProc (JOYSTICK.@) */ -LONG CALLBACK JSTCK_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK JSTCK_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */ /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */ - + switch(wMsg) { - case DRV_LOAD: - case DRV_FREE: - case DRV_OPEN: - case DRV_CLOSE: - case DRV_ENABLE: - case DRV_DISABLE: + case DRV_LOAD: + case DRV_FREE: + case DRV_OPEN: + case DRV_CLOSE: + case DRV_ENABLE: + case DRV_DISABLE: case DRV_QUERYCONFIGURE: return 0; case DRV_CONFIGURE: MessageBoxA(0, "JoyStick MultiMedia Driver !", "JoyStick Driver", MB_OK); return 1; case DRV_INSTALL: return DRVCNF_RESTART; diff --git a/dlls/winmm/lolvldrv.c b/dlls/winmm/lolvldrv.c index f551a6ca31e..8a91d4a5649 100644 --- a/dlls/winmm/lolvldrv.c +++ b/dlls/winmm/lolvldrv.c @@ -67,7 +67,7 @@ typedef MMDRV_MapType (*MMDRV_MAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpPa /* each known type of driver has an instance of this structure */ typedef struct tagWINE_LLTYPE { - /* those attributes depend on the specification of the type */ + /* those attributes depend on the specification of the type */ LPSTR typestr; /* name (for debugging) */ BOOL bSupportMapper; /* if type is allowed to support mapper */ MMDRV_MAPFUNC Map16To32A; /* those are function pointers to handle */ @@ -158,10 +158,10 @@ static BOOL MMDRV_GetDescription32(const char* fname, char* buf, int buflen) if (!(dw = pGetFileVersionInfoSizeA(ofs.szPathName, &h))) E(("Can't get FVIS\n")); if (!(ptr = HeapAlloc(GetProcessHeap(), 0, dw))) E(("OOM\n")); if (!pGetFileVersionInfoA(ofs.szPathName, h, dw, ptr)) E(("Can't get FVI\n")); - + #define A(_x) if (pVerQueryValueA(ptr, "\\StringFileInfo\\040904B0\\" #_x, &val, &u)) \ TRACE(#_x " => %s\n", (LPSTR)val); else TRACE(#_x " @\n") - + A(CompanyName); A(FileDescription); A(FileVersion); @@ -173,13 +173,13 @@ static BOOL MMDRV_GetDescription32(const char* fname, char* buf, int buflen) A(Comments); A(LegalTrademarks); A(PrivateBuild); - A(SpecialBuild); + A(SpecialBuild); #undef A if (!pVerQueryValueA(ptr, "\\StringFileInfo\\040904B0\\ProductName", &val, &u)) E(("Can't get product name\n")); lstrcpynA(buf, val, buflen); -#undef E +#undef E ret = TRUE; theEnd: HeapFree(GetProcessHeap(), 0, ptr); @@ -198,10 +198,10 @@ static void MMDRV_Callback(LPWINE_MLD mld, HDRVR hDev, UINT uMsg, DWORD dwParam1 if (!mld->bFrom32 && (mld->dwFlags & DCB_TYPEMASK) == DCB_FUNCTION) { /* 16 bit func, call it */ TRACE("Function (16 bit) !\n"); - MMDRV_CallTo16_word_wwlll((FARPROC16)mld->dwCallback, hDev, uMsg, + MMDRV_CallTo16_word_wwlll((FARPROC16)mld->dwCallback, hDev, uMsg, mld->dwClientInstance, dwParam1, dwParam2); } else { - DriverCallback(mld->dwCallback, mld->dwFlags, hDev, uMsg, + DriverCallback(mld->dwCallback, mld->dwFlags, hDev, uMsg, mld->dwClientInstance, dwParam1, dwParam2); } } @@ -282,7 +282,7 @@ static MMDRV_MapType MMDRV_Mixer_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWO #if 0 MIXERCAPSA micA; UINT ret = mixerGetDevCapsA(devid, &micA, sizeof(micA)); - + if (ret == MMSYSERR_NOERROR) { mixcaps->wMid = micA.wMid; mixcaps->wPid = micA.wPid; @@ -371,9 +371,9 @@ static void CALLBACK MMDRV_MidiIn_Callback(HDRVR hDev, UINT uMsg, DWORD dwInstan case MIM_CLOSE: /* dwParam1 & dwParam2 are supposed to be 0, nothing to do */ - case MIM_DATA: - case MIM_MOREDATA: - case MIM_ERROR: + case MIM_DATA: + case MIM_MOREDATA: + case MIM_ERROR: /* dwParam1 & dwParam2 are are data, nothing to do */ break; case MIM_LONGDATA: @@ -383,7 +383,7 @@ static void CALLBACK MMDRV_MidiIn_Callback(HDRVR hDev, UINT uMsg, DWORD dwInstan /* initial map is: 32 => 16 */ LPMIDIHDR mh16 = MapSL(dwParam1); LPMIDIHDR mh32 = *(LPMIDIHDR*)((LPSTR)mh16 - sizeof(LPMIDIHDR)); - + dwParam1 = (DWORD)mh32; mh32->dwFlags = mh16->dwFlags; mh32->dwBytesRecorded = mh16->dwBytesRecorded; @@ -394,13 +394,13 @@ static void CALLBACK MMDRV_MidiIn_Callback(HDRVR hDev, UINT uMsg, DWORD dwInstan LPMIDIHDR mh32 = (LPMIDIHDR)(dwParam1); SEGPTR segmh16 = *(SEGPTR*)((LPSTR)mh32 - sizeof(LPMIDIHDR)); LPMIDIHDR mh16 = MapSL(segmh16); - + dwParam1 = (DWORD)segmh16; mh16->dwFlags = mh32->dwFlags; mh16->dwBytesRecorded = mh32->dwBytesRecorded; if (mh16->reserved >= sizeof(MIDIHDR)) mh16->dwOffset = mh32->dwOffset; - } + } /* else { 16 => 16 or 32 => 32, nothing to do, same struct is kept }*/ break; /* case MOM_POSITIONCB: */ @@ -429,7 +429,7 @@ static MMDRV_MapType MMDRV_MidiOut_Map16To32A (UINT wMsg, LPDWORD lpdwUser, LPD case MODM_SETVOLUME: ret = MMDRV_MAP_OK; break; - + case MODM_OPEN: case MODM_CLOSE: case MODM_GETVOLUME: @@ -522,7 +522,7 @@ static MMDRV_MapType MMDRV_MidiOut_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPD case MODM_SETVOLUME: ret = MMDRV_MAP_OK; break; - + case MODM_OPEN: case MODM_CLOSE: case MODM_GETVOLUME: @@ -612,7 +612,7 @@ static MMDRV_MapType MMDRV_MidiOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD case MODM_PREPARE: { LPMIDIHDR mh32 = (LPMIDIHDR)*lpParam1; - LPMIDIHDR mh16; + LPMIDIHDR mh16; LPVOID ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPMIDIHDR) + sizeof(MIDIHDR) + mh32->dwBufferLength); @@ -629,11 +629,11 @@ static MMDRV_MapType MMDRV_MidiOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD /* FIXME: nothing on mh32->lpNext */ /* could link the mh32->lpNext at this level for memory house keeping */ mh16->dwOffset = (*lpParam2 >= sizeof(MIDIHDR)) ? mh32->dwOffset : 0; - + mh32->lpNext = (LPMIDIHDR)mh16; /* for reuse in unprepare and write */ mh32->reserved = *lpParam2; - TRACE("mh16=%08lx mh16->lpData=%08lx mh32->buflen=%lu mh32->lpData=%08lx\n", + TRACE("mh16=%08lx mh16->lpData=%08lx mh32->buflen=%lu mh32->lpData=%08lx\n", *lpParam1, (DWORD)mh16->lpData, mh32->dwBufferLength, (DWORD)mh32->lpData); *lpParam2 = sizeof(MIDIHDR); @@ -652,13 +652,13 @@ static MMDRV_MapType MMDRV_MidiOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD LPSTR ptr = (LPSTR)mh16 - sizeof(LPMIDIHDR); assert(*(LPMIDIHDR*)ptr == mh32); - + if (wMsg == MODM_LONGDATA) memcpy((LPSTR)mh16 + sizeof(MIDIHDR), mh32->lpData, mh32->dwBufferLength); *lpParam1 = MapLS(mh16); *lpParam2 = sizeof(MIDIHDR); - TRACE("mh16=%08lx mh16->lpData=%08lx mh32->buflen=%lu mh32->lpData=%08lx\n", + TRACE("mh16=%08lx mh16->lpData=%08lx mh32->buflen=%lu mh32->lpData=%08lx\n", *lpParam1, (DWORD)mh16->lpData, mh32->dwBufferLength, (DWORD)mh32->lpData); /* dwBufferLength can be reduced between prepare & write */ @@ -681,7 +681,7 @@ static MMDRV_MapType MMDRV_MidiOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD DWORD orig dwUser, which is a pointer to DWORD:driver dwInstance DWORD dwUser passed to driver MIDIOPENDESC16 mod16: openDesc passed to driver - MIDIOPENSTRMID cIds + MIDIOPENSTRMID cIds */ ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPMIDIOPENDESC) + 2*sizeof(DWORD) + sizeof(MIDIOPENDESC16) + @@ -813,7 +813,7 @@ static void CALLBACK MMDRV_MidiOut_Callback(HDRVR hDev, UINT uMsg, DWORD dwInsta /* initial map is: 32 => 16 */ LPMIDIHDR mh16 = MapSL(dwParam1); LPMIDIHDR mh32 = *(LPMIDIHDR*)((LPSTR)mh16 - sizeof(LPMIDIHDR)); - + dwParam1 = (DWORD)mh32; mh32->dwFlags = mh16->dwFlags; mh32->dwOffset = mh16->dwOffset; @@ -824,12 +824,12 @@ static void CALLBACK MMDRV_MidiOut_Callback(HDRVR hDev, UINT uMsg, DWORD dwInsta LPMIDIHDR mh32 = (LPMIDIHDR)(dwParam1); SEGPTR segmh16 = *(SEGPTR*)((LPSTR)mh32 - sizeof(LPMIDIHDR)); LPMIDIHDR mh16 = MapSL(segmh16); - + dwParam1 = (DWORD)segmh16; mh16->dwFlags = mh32->dwFlags; if (mh16->reserved >= sizeof(MIDIHDR)) mh16->dwOffset = mh32->dwOffset; - } + } /* else { 16 => 16 or 32 => 32, nothing to do, same struct is kept }*/ break; /* case MOM_POSITIONCB: */ @@ -978,11 +978,11 @@ static MMDRV_MapType MMDRV_WaveIn_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDW LPWAVEINCAPS16 wic16 = *(LPWAVEINCAPS16*)((LPSTR)wic32 - sizeof(LPWAVEINCAPS16)); wic16->wMid = wic32->wMid; - wic16->wPid = wic32->wPid; - wic16->vDriverVersion = wic32->vDriverVersion; + wic16->wPid = wic32->wPid; + wic16->vDriverVersion = wic32->vDriverVersion; strcpy(wic16->szPname, wic32->szPname); - wic16->dwFormats = wic32->dwFormats; - wic16->wChannels = wic32->wChannels; + wic16->dwFormats = wic32->dwFormats; + wic16->wChannels = wic32->wChannels; HeapFree(GetProcessHeap(), 0, (LPSTR)wic32 - sizeof(LPWAVEINCAPS16)); ret = MMDRV_MAP_OK; } @@ -1073,12 +1073,12 @@ static MMDRV_MapType MMDRV_WaveIn_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPDW wod16->hWave = wod32->hWave; wod16->lpFormat = (LPWAVEFORMATEX)(seg_ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD) + sizeof(WAVEOPENDESC16)); memcpy(wod16 + 1, wod32->lpFormat, sz); - + wod16->dwCallback = wod32->dwCallback; wod16->dwInstance = wod32->dwInstance; wod16->uMappedDeviceID = wod32->uMappedDeviceID; wod16->dnDevNode = wod32->dnDevNode; - + *lpParam1 = seg_ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD); *lpdwUser = seg_ptr + sizeof(LPWAVEOPENDESC) + sizeof(DWORD); @@ -1091,7 +1091,7 @@ static MMDRV_MapType MMDRV_WaveIn_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPDW case WIDM_PREPARE: { LPWAVEHDR wh32 = (LPWAVEHDR)*lpParam1; - LPWAVEHDR wh16; + LPWAVEHDR wh16; LPVOID ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPWAVEHDR) + sizeof(WAVEHDR) + wh32->dwBufferLength); @@ -1109,7 +1109,7 @@ static MMDRV_MapType MMDRV_WaveIn_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPDW /* FIXME: nothing on wh32->lpNext */ /* could link the wh32->lpNext at this level for memory house keeping */ wh32->lpNext = wh16; /* for reuse in unprepare and write */ - TRACE("wh16=%08lx wh16->lpData=%08lx wh32->buflen=%lu wh32->lpData=%08lx\n", + TRACE("wh16=%08lx wh16->lpData=%08lx wh32->buflen=%lu wh32->lpData=%08lx\n", seg_ptr + sizeof(LPWAVEHDR), (DWORD)wh16->lpData, wh32->dwBufferLength, (DWORD)wh32->lpData); *lpParam1 = seg_ptr + sizeof(LPWAVEHDR); @@ -1130,8 +1130,8 @@ static MMDRV_MapType MMDRV_WaveIn_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPDW SEGPTR seg_ptr = MapLS( ptr ); assert(*(LPWAVEHDR*)ptr == wh32); - - TRACE("wh16=%08lx wh16->lpData=%08lx wh32->buflen=%lu wh32->lpData=%08lx\n", + + TRACE("wh16=%08lx wh16->lpData=%08lx wh32->buflen=%lu wh32->lpData=%08lx\n", seg_ptr + sizeof(LPWAVEHDR), (DWORD)wh16->lpData, wh32->dwBufferLength, (DWORD)wh32->lpData); @@ -1306,7 +1306,7 @@ static void CALLBACK MMDRV_WaveIn_Callback(HDRVR hDev, UINT uMsg, DWORD dwInstan /* initial map is: 32 => 16 */ LPWAVEHDR wh16 = MapSL(dwParam1); LPWAVEHDR wh32 = *(LPWAVEHDR*)((LPSTR)wh16 - sizeof(LPWAVEHDR)); - + dwParam1 = (DWORD)wh32; wh32->dwFlags = wh16->dwFlags; wh32->dwBytesRecorded = wh16->dwBytesRecorded; @@ -1315,11 +1315,11 @@ static void CALLBACK MMDRV_WaveIn_Callback(HDRVR hDev, UINT uMsg, DWORD dwInstan LPWAVEHDR wh32 = (LPWAVEHDR)(dwParam1); SEGPTR segwh16 = *(SEGPTR*)((LPSTR)wh32 - sizeof(LPWAVEHDR)); LPWAVEHDR wh16 = MapSL(segwh16); - + dwParam1 = (DWORD)segwh16; wh16->dwFlags = wh32->dwFlags; wh16->dwBytesRecorded = wh32->dwBytesRecorded; - } + } /* else { 16 => 16 or 32 => 32, nothing to do, same struct is kept }*/ break; default: @@ -1361,7 +1361,7 @@ static MMDRV_MapType MMDRV_WaveOut_Map16To32A (UINT wMsg, LPDWORD lpdwUser, LPD FIXME("Shouldn't be used: the corresponding 16 bit functions use the 32 bit interface\n"); break; - case WODM_GETDEVCAPS: + case WODM_GETDEVCAPS: { LPWAVEOUTCAPSA woc32 = HeapAlloc(GetProcessHeap(), 0, sizeof(LPWAVEOUTCAPS16) + sizeof(WAVEOUTCAPSA)); LPWAVEOUTCAPS16 woc16 = MapSL(*lpParam1); @@ -1479,19 +1479,19 @@ static MMDRV_MapType MMDRV_WaveOut_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPD case WODM_OPEN: FIXME("Shouldn't be used: those 16 bit functions use the 32 bit interface\n"); break; - - case WODM_GETDEVCAPS: + + case WODM_GETDEVCAPS: { LPWAVEOUTCAPSA woc32 = (LPWAVEOUTCAPSA)(*lpParam1); LPWAVEOUTCAPS16 woc16 = *(LPWAVEOUTCAPS16*)((LPSTR)woc32 - sizeof(LPWAVEOUTCAPS16)); woc16->wMid = woc32->wMid; - woc16->wPid = woc32->wPid; - woc16->vDriverVersion = woc32->vDriverVersion; + woc16->wPid = woc32->wPid; + woc16->vDriverVersion = woc32->vDriverVersion; strcpy(woc16->szPname, woc32->szPname); - woc16->dwFormats = woc32->dwFormats; - woc16->wChannels = woc32->wChannels; - woc16->dwSupport = woc32->dwSupport; + woc16->dwFormats = woc32->dwFormats; + woc16->wChannels = woc32->wChannels; + woc16->dwSupport = woc32->dwSupport; HeapFree(GetProcessHeap(), 0, (LPSTR)woc32 - sizeof(LPWAVEOUTCAPS16)); ret = MMDRV_MAP_OK; } @@ -1554,7 +1554,7 @@ static MMDRV_MapType MMDRV_WaveOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD case WODM_SETVOLUME: ret = MMDRV_MAP_OK; break; - + case WODM_GETDEVCAPS: { LPWAVEOUTCAPSA woc32 = (LPWAVEOUTCAPSA)*lpParam1; @@ -1632,12 +1632,12 @@ static MMDRV_MapType MMDRV_WaveOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD wod16->hWave = wod32->hWave; wod16->lpFormat = (LPWAVEFORMATEX)(seg_ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD) + sizeof(WAVEOPENDESC16)); memcpy(wod16 + 1, wod32->lpFormat, sz); - + wod16->dwCallback = wod32->dwCallback; wod16->dwInstance = wod32->dwInstance; wod16->uMappedDeviceID = wod32->uMappedDeviceID; wod16->dnDevNode = wod32->dnDevNode; - + *lpParam1 = seg_ptr + sizeof(LPWAVEOPENDESC) + 2*sizeof(DWORD); *lpdwUser = seg_ptr + sizeof(LPWAVEOPENDESC) + sizeof(DWORD); @@ -1650,7 +1650,7 @@ static MMDRV_MapType MMDRV_WaveOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD case WODM_PREPARE: { LPWAVEHDR wh32 = (LPWAVEHDR)*lpParam1; - LPWAVEHDR wh16; + LPWAVEHDR wh16; LPVOID ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(LPWAVEHDR) + sizeof(WAVEHDR) + wh32->dwBufferLength); @@ -1668,7 +1668,7 @@ static MMDRV_MapType MMDRV_WaveOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD /* FIXME: nothing on wh32->lpNext */ /* could link the wh32->lpNext at this level for memory house keeping */ wh32->lpNext = wh16; /* for reuse in unprepare and write */ - TRACE("wh16=%08lx wh16->lpData=%08lx wh32->buflen=%lu wh32->lpData=%08lx\n", + TRACE("wh16=%08lx wh16->lpData=%08lx wh32->buflen=%lu wh32->lpData=%08lx\n", seg_ptr + sizeof(LPWAVEHDR), (DWORD)wh16->lpData, wh32->dwBufferLength, (DWORD)wh32->lpData); *lpParam1 = seg_ptr + sizeof(LPWAVEHDR); @@ -1689,8 +1689,8 @@ static MMDRV_MapType MMDRV_WaveOut_Map32ATo16 (UINT wMsg, LPDWORD lpdwUser, LPD SEGPTR seg_ptr = MapLS( ptr ); assert(*(LPWAVEHDR*)ptr == wh32); - - TRACE("wh16=%08lx wh16->lpData=%08lx wh32->buflen=%lu wh32->lpData=%08lx\n", + + TRACE("wh16=%08lx wh16->lpData=%08lx wh32->buflen=%lu wh32->lpData=%08lx\n", seg_ptr + sizeof(LPWAVEHDR), (DWORD)wh16->lpData, wh32->dwBufferLength, (DWORD)wh32->lpData); @@ -1743,7 +1743,7 @@ static MMDRV_MapType MMDRV_WaveOut_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPD case WODM_SETVOLUME: ret = MMDRV_MAP_OK; break; - + case WODM_GETDEVCAPS: { LPWAVEOUTCAPS16 woc16 = MapSL(*lpParam1); @@ -1852,7 +1852,7 @@ static void CALLBACK MMDRV_WaveOut_Callback(HDRVR hDev, UINT uMsg, DWORD dwInsta /* initial map is: 32 => 16 */ LPWAVEHDR wh16 = MapSL(dwParam1); LPWAVEHDR wh32 = *(LPWAVEHDR*)((LPSTR)wh16 - sizeof(LPWAVEHDR)); - + dwParam1 = (DWORD)wh32; wh32->dwFlags = wh16->dwFlags; } else if (!mld->bFrom32 && MMDrvs[mld->mmdIndex].bIs32) { @@ -1860,10 +1860,10 @@ static void CALLBACK MMDRV_WaveOut_Callback(HDRVR hDev, UINT uMsg, DWORD dwInsta LPWAVEHDR wh32 = (LPWAVEHDR)(dwParam1); SEGPTR segwh16 = *(SEGPTR*)((LPSTR)wh32 - sizeof(LPWAVEHDR)); LPWAVEHDR wh16 = MapSL(segwh16); - + dwParam1 = (DWORD)segwh16; wh16->dwFlags = wh32->dwFlags; - } + } /* else { 16 => 16 or 32 => 32, nothing to do, same struct is kept }*/ break; default: @@ -1903,7 +1903,7 @@ UINT MMDRV_GetNum(UINT type) /************************************************************************** * WINE_Message [internal] */ -DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, +DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32) { LPWINE_MM_DRIVER lpDrv; @@ -1913,13 +1913,13 @@ DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, MMDRV_MapType map; int devID; - TRACE("(%s %u %u 0x%08lx 0x%08lx 0x%08lx %c)!\n", - llTypes[mld->type].typestr, mld->uDeviceID, wMsg, + TRACE("(%s %u %u 0x%08lx 0x%08lx 0x%08lx %c)!\n", + llTypes[mld->type].typestr, mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2, bFrom32?'Y':'N'); if (mld->uDeviceID == (UINT16)-1) { if (!llType->bSupportMapper) { - WARN("uDev=-1 requested on non-mappable ll type %s\n", + WARN("uDev=-1 requested on non-mappable ll type %s\n", llTypes[mld->type].typestr); return MMSYSERR_BADDEVICEID; } @@ -1945,9 +1945,9 @@ DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, if (lpDrv->bIs32) { assert(part->u.fnMessage32); - + if (bFrom32) { - TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx\n", + TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx\n", mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); ret = part->u.fnMessage32(mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); TRACE("=> %lu\n", ret); @@ -1963,9 +1963,9 @@ DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, break; case MMDRV_MAP_OK: case MMDRV_MAP_OKMEM: - TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx\n", + TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx\n", mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); - ret = part->u.fnMessage32(mld->uDeviceID, wMsg, mld->dwDriverInstance, + ret = part->u.fnMessage32(mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); TRACE("=> %lu\n", ret); if (map == MMDRV_MAP_OKMEM) @@ -1993,9 +1993,9 @@ DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, break; case MMDRV_MAP_OK: case MMDRV_MAP_OKMEM: - TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx\n", + TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx\n", mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); - ret = MMDRV_CallTo16_word_wwlll((FARPROC16)part->u.fnMessage16, mld->uDeviceID, + ret = MMDRV_CallTo16_word_wwlll((FARPROC16)part->u.fnMessage16, mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); TRACE("=> %lu\n", ret); if (map == MMDRV_MAP_OKMEM) @@ -2008,9 +2008,9 @@ DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, break; } } else { - TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx\n", + TRACE("Calling message(dev=%u msg=%u usr=0x%08lx p1=0x%08lx p2=0x%08lx\n", mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); - ret = MMDRV_CallTo16_word_wwlll((FARPROC16)part->u.fnMessage16, mld->uDeviceID, + ret = MMDRV_CallTo16_word_wwlll((FARPROC16)part->u.fnMessage16, mld->uDeviceID, wMsg, mld->dwDriverInstance, dwParam1, dwParam2); TRACE("=> %lu\n", ret); } @@ -2021,7 +2021,7 @@ DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, /************************************************************************** * MMDRV_Alloc [internal] */ -LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags, +LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags, DWORD* dwCallback, DWORD* dwInstance, BOOL bFrom32) { LPWINE_MLD mld; @@ -2151,7 +2151,7 @@ LPWINE_MLD MMDRV_Get(HANDLE hndl, UINT type, BOOL bCanBeID) assert(type < MMDRV_MAX); - if ((UINT)hndl >= llTypes[type].wMaxId && + if ((UINT)hndl >= llTypes[type].wMaxId && hndl != (UINT16)-1 && hndl != (UINT)-1) { if (hndl & 0x8000) { hndl &= ~0x8000; @@ -2181,14 +2181,14 @@ LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, WINE_MM_DRIVER_PART* part = &MMDrvs[mld->mmdIndex].parts[dstType]; if (part->nIDMin < part->nIDMax) return MMDRV_GetByID(part->nIDMin, dstType); - } + } return NULL; } /************************************************************************** * MMDRV_PhysicalFeatures [internal] */ -UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, +UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, DWORD dwParam2) { WINE_MM_DRIVER* lpDrv = &MMDrvs[mld->mmdIndex]; @@ -2250,7 +2250,7 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg) #endif count = part->u.fnMessage32(0, wMsg, 0L, 0L, 0L); } else if (!lpDrv->bIs32 && part->u.fnMessage16) { - ret = MMDRV_CallTo16_word_wwlll((FARPROC16)part->u.fnMessage16, + ret = MMDRV_CallTo16_word_wwlll((FARPROC16)part->u.fnMessage16, 0, DRVM_INIT, 0L, 0L, 0L); TRACE("DRVM_INIT => %08lx\n", ret); #if 0 @@ -2258,7 +2258,7 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg) 0, DRVM_ENABLE, 0L, 0L, 0L); TRACE("DRVM_ENABLE => %08lx\n", ret); #endif - count = MMDRV_CallTo16_word_wwlll((FARPROC16)part->u.fnMessage16, + count = MMDRV_CallTo16_word_wwlll((FARPROC16)part->u.fnMessage16, 0, wMsg, 0L, 0L, 0L); } else { return FALSE; @@ -2270,7 +2270,7 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg) if (lpDrv->bIsMapper) { /* it seems native mappers return 0 devices :-( */ if (llTypes[type].nMapper != -1) - ERR("Two mappers for type %s (%d, %s)\n", + ERR("Two mappers for type %s (%d, %s)\n", llTypes[type].typestr, llTypes[type].nMapper, lpDrv->drvname); if (count > 1) ERR("Strange: mapper with %d > 1 devices\n", count); @@ -2283,7 +2283,7 @@ static BOOL MMDRV_InitPerType(LPWINE_MM_DRIVER lpDrv, UINT type, UINT wMsg) part->nIDMax = llTypes[type].wMaxId; } TRACE("Setting min=%d max=%d (ttop=%d) for (%s:%s)\n", - part->nIDMin, part->nIDMax, llTypes[type].wMaxId, + part->nIDMin, part->nIDMax, llTypes[type].wMaxId, lpDrv->drvname, llTypes[type].typestr); /* realloc translation table */ llTypes[type].lpMlds = (LPWINE_MLD) @@ -2322,10 +2322,10 @@ static BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper) TRACE("('%s', '%s', mapper=%c);\n", drvRegName, drvFileName, bIsMapper ? 'Y' : 'N'); - /* be sure that size of MMDrvs matches the max number of loadable drivers !! + /* be sure that size of MMDrvs matches the max number of loadable drivers !! * if not just increase size of MMDrvs */ assert(MMDrvsHi <= sizeof(MMDrvs)/sizeof(MMDrvs[0])); - + for (i = 0; i < MMDrvsHi; i++) { if (!strcmp(drvRegName, MMDrvs[i].drvname)) return FALSE; } @@ -2336,7 +2336,7 @@ static BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper) WARN("Couldn't open driver '%s'\n", drvFileName); return FALSE; } - + d = DRIVER_FindFromHDrvr(lpDrv->hDriver); lpDrv->bIs32 = (d->dwFlags & WINE_GDF_16BIT) ? FALSE : TRUE; @@ -2365,20 +2365,20 @@ static BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper) /* * DESCRIPTION 'wave,aux,mixer:Creative Labs Sound Blaster 16 Driver' - * The beginning of the module description indicates the driver supports - * waveform, auxiliary, and mixer devices. Use one of the following + * The beginning of the module description indicates the driver supports + * waveform, auxiliary, and mixer devices. Use one of the following * device-type names, followed by a colon (:) to indicate the type of * device your driver supports. If the driver supports more than one - * type of device, separate each device-type name with a comma (,). - * - * wave for waveform audio devices + * type of device, separate each device-type name with a comma (,). + * + * wave for waveform audio devices * wavemapper for wave mappers - * midi for MIDI audio devices + * midi for MIDI audio devices * midimapper for midi mappers - * aux for auxiliary audio devices - * mixer for mixer devices + * aux for auxiliary audio devices + * mixer for mixer devices */ - + if (d->d.d16.hDriver16) { HMODULE16 hMod16 = GetDriverModuleHandle16(d->d.d16.hDriver16); @@ -2422,7 +2422,7 @@ static BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper) MMDRV_InitPerType(lpDrv, MMDRV_MIDIOUT, MODM_GETNUMDEVS); MMDRV_InitPerType(lpDrv, MMDRV_WAVEIN, WIDM_GETNUMDEVS); MMDRV_InitPerType(lpDrv, MMDRV_WAVEOUT, WODM_GETNUMDEVS); - /* FIXME: if all those func calls return FALSE, + /* FIXME: if all those func calls return FALSE, * then the driver must be unloaded */ diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index 4dc2ab6c22a..a44a7cde017 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -73,7 +73,7 @@ inline static LPSTR str_dup_upper( LPCSTR str ) /************************************************************************** * MCI_GetDriver [internal] */ -LPWINE_MCIDRIVER MCI_GetDriver(UINT16 wDevID) +LPWINE_MCIDRIVER MCI_GetDriver(UINT16 wDevID) { LPWINE_MCIDRIVER wmd = 0; LPWINE_MM_IDATA iData = MULTIMEDIA_GetIData(); @@ -98,10 +98,10 @@ UINT MCI_GetDriverFromString(LPCSTR lpstrName) if (!lpstrName) return 0; - + if (!lstrcmpiA(lpstrName, "ALL")) return MCI_ALL_DEVICE_ID; - + EnterCriticalSection(&iData->cs); for (wmd = iData->lpMciDrvs; wmd; wmd = wmd->lpNext) { if (wmd->lpstrElementName && strcmp(wmd->lpstrElementName, lpstrName) == 0) { @@ -118,7 +118,7 @@ UINT MCI_GetDriverFromString(LPCSTR lpstrName) } } LeaveCriticalSection(&iData->cs); - + return ret; } @@ -128,9 +128,9 @@ UINT MCI_GetDriverFromString(LPCSTR lpstrName) const char* MCI_MessageToString(UINT16 wMsg) { static char buffer[100]; - + #define CASE(s) case (s): return #s - + switch (wMsg) { CASE(MCI_BREAK); CASE(MCI_CLOSE); @@ -224,10 +224,10 @@ static BOOL MCI_IsCommandTableValid(UINT uTbl) int idx = 0; BOOL inCst = FALSE; - TRACE("Dumping cmdTbl=%d [hMem=%08x devType=%d]\n", + TRACE("Dumping cmdTbl=%d [hMem=%08x devType=%d]\n", uTbl, S_MciCmdTable[uTbl].hMem, S_MciCmdTable[uTbl].uDevType); - if (uTbl >= MAX_MCICMDTABLE || !S_MciCmdTable[uTbl].hMem || !S_MciCmdTable[uTbl].lpTable) + if (uTbl >= MAX_MCICMDTABLE || !S_MciCmdTable[uTbl].hMem || !S_MciCmdTable[uTbl].lpTable) return FALSE; lmem = S_MciCmdTable[uTbl].lpTable; @@ -267,7 +267,7 @@ static BOOL MCI_DumpCommandTable(UINT uTbl) LPCSTR str; DWORD flg; WORD eid; - + if (!MCI_IsCommandTableValid(uTbl)) { ERR("Ooops: %d is not valid\n", uTbl); return FALSE; @@ -298,11 +298,11 @@ static UINT MCI_GetCommandTable(LPWINE_MM_IDATA iData, UINT uDevType) UINT uTbl; char buf[32]; LPSTR str = NULL; - + /* first look up existing for existing devType */ for (uTbl = 0; uTbl < MAX_MCICMDTABLE; uTbl++) { if (S_MciCmdTable[uTbl].hMem && S_MciCmdTable[uTbl].uDevType == uDevType) - return uTbl; + return uTbl; } /* well try to load id */ @@ -322,7 +322,7 @@ static UINT MCI_GetCommandTable(LPWINE_MM_IDATA iData, UINT uDevType) if (hMem) { uTbl = MCI_SetCommandTable(iData, hMem, uDevType); } else { - WARN("No command table found in resource %04x[%s]\n", + WARN("No command table found in resource %04x[%s]\n", iData->hWinMM32Instance, str); } } @@ -333,9 +333,9 @@ static UINT MCI_GetCommandTable(LPWINE_MM_IDATA iData, UINT uDevType) /************************************************************************** * MCI_SetCommandTable [internal] */ -static UINT MCI_SetCommandTable(LPWINE_MM_IDATA iData, HANDLE hMem, +static UINT MCI_SetCommandTable(LPWINE_MM_IDATA iData, HANDLE hMem, UINT uDevType) -{ +{ int uTbl; static BOOL bInitDone = FALSE; @@ -454,7 +454,7 @@ static BOOL MCI_UnLoadMciDriver(LPWINE_MM_IDATA iData, LPWINE_MCIDRIVER wmd) static BOOL MCI_OpenMciDriver(LPWINE_MCIDRIVER wmd, LPCSTR drvTyp, LPARAM lp) { char libName[128]; - + if (!DRIVER_GetLibName(drvTyp, "mci", libName, sizeof(libName))) return FALSE; @@ -487,19 +487,19 @@ static BOOL MCI_OpenMciDriver(LPWINE_MCIDRIVER wmd, LPCSTR drvTyp, LPARAM lp) /************************************************************************** * MCI_LoadMciDriver [internal] */ -static DWORD MCI_LoadMciDriver(LPWINE_MM_IDATA iData, LPCSTR _strDevTyp, +static DWORD MCI_LoadMciDriver(LPWINE_MM_IDATA iData, LPCSTR _strDevTyp, LPWINE_MCIDRIVER* lpwmd) { LPSTR strDevTyp = str_dup_upper(_strDevTyp); LPWINE_MCIDRIVER wmd = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wmd)); MCI_OPEN_DRIVER_PARMSA modp; DWORD dwRet = 0; - + if (!wmd || !strDevTyp) { dwRet = MCIERR_OUT_OF_MEMORY; goto errCleanUp; } - + wmd->lpfnYieldProc = MCI_DefYieldProc; wmd->dwYieldData = VK_CANCEL; wmd->hCreatorTask = GetCurrentTask(); @@ -511,8 +511,8 @@ static DWORD MCI_LoadMciDriver(LPWINE_MM_IDATA iData, LPCSTR _strDevTyp, wmd->lpNext = iData->lpMciDrvs; iData->lpMciDrvs = wmd; - for (modp.wDeviceID = MCI_MAGIC; - MCI_GetDriver(modp.wDeviceID) != 0; + for (modp.wDeviceID = MCI_MAGIC; + MCI_GetDriver(modp.wDeviceID) != 0; modp.wDeviceID++); wmd->wDeviceID = modp.wDeviceID; @@ -522,7 +522,7 @@ static DWORD MCI_LoadMciDriver(LPWINE_MM_IDATA iData, LPCSTR _strDevTyp, TRACE("wDevID=%04X \n", modp.wDeviceID); modp.lpstrParams = NULL; - + if (!MCI_OpenMciDriver(wmd, strDevTyp, (LPARAM)&modp)) { /* silence warning if all is used... some bogus program use commands like * 'open all'... @@ -538,7 +538,7 @@ static DWORD MCI_LoadMciDriver(LPWINE_MM_IDATA iData, LPCSTR _strDevTyp, } goto errCleanUp; } - + /* FIXME: should also check that module's description is of the form * MODULENAME:[MCI] comment */ @@ -547,13 +547,13 @@ static DWORD MCI_LoadMciDriver(LPWINE_MM_IDATA iData, LPCSTR _strDevTyp, wmd->uSpecificCmdTable = LOWORD(modp.wCustomCommandTable); wmd->uTypeCmdTable = MCI_COMMAND_TABLE_NOT_LOADED; - TRACE("Loaded driver %x (%s), type is %d, cmdTable=%08x\n", + TRACE("Loaded driver %x (%s), type is %d, cmdTable=%08x\n", wmd->hDriver, strDevTyp, modp.wType, modp.wCustomCommandTable); - + wmd->lpstrDeviceType = strDevTyp; wmd->wType = modp.wType; - TRACE("mcidev=%d, uDevTyp=%04X wDeviceID=%04X !\n", + TRACE("mcidev=%d, uDevTyp=%04X wDeviceID=%04X !\n", modp.wDeviceID, modp.wType, modp.wDeviceID); *lpwmd = wmd; return 0; @@ -563,11 +563,11 @@ errCleanUp: *lpwmd = 0; return dwRet; } - + /************************************************************************** * MCI_FinishOpen [internal] */ -static DWORD MCI_FinishOpen(LPWINE_MCIDRIVER wmd, LPMCI_OPEN_PARMSA lpParms, +static DWORD MCI_FinishOpen(LPWINE_MCIDRIVER wmd, LPMCI_OPEN_PARMSA lpParms, DWORD dwParam) { if (dwParam & MCI_OPEN_ELEMENT) @@ -582,7 +582,7 @@ static DWORD MCI_FinishOpen(LPWINE_MCIDRIVER wmd, LPMCI_OPEN_PARMSA lpParms, } lpParms->wDeviceID = wmd->wDeviceID; - return MCI_SendCommandFrom32(wmd->wDeviceID, MCI_OPEN_DRIVER, dwParam, + return MCI_SendCommandFrom32(wmd->wDeviceID, MCI_OPEN_DRIVER, dwParam, (DWORD)lpParms); } @@ -685,7 +685,7 @@ static DWORD MCI_GetString(LPSTR* str, LPSTR* args) /************************************************************************** * MCI_ParseOptArgs [internal] */ -static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd, +static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd, LPSTR args, LPDWORD dwFlags) { int len, offset; @@ -703,7 +703,7 @@ static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd, /* skip any leading white space(s) */ while (*args == ' ') args++; TRACE("args='%s' offset=%d\n", args, offset); - + do { /* loop on options for command table for the requested verb */ str = lmem; lmem += (len = strlen(lmem)) + 1; @@ -711,20 +711,20 @@ static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd, eid = *(LPWORD)(lmem + sizeof(DWORD)); lmem += sizeof(DWORD) + sizeof(WORD); /* EPP TRACE("\tcmd='%s' inCst=%c eid=%04x\n", str, inCst ? 'Y' : 'N', eid); */ - + switch (eid) { - case MCI_CONSTANT: + case MCI_CONSTANT: inCst = TRUE; cflg = flg; break; - case MCI_END_CONSTANT: + case MCI_END_CONSTANT: /* there may be additional integral values after flag in constant */ if (inCst && MCI_GetDWord(&(data[offset]), &args)) { *dwFlags |= cflg; } - inCst = FALSE; cflg = 0; + inCst = FALSE; cflg = 0; break; } - if (strncasecmp(args, str, len) == 0 && + if (strncasecmp(args, str, len) == 0 && (args[len] == 0 || args[len] == ' ')) { /* store good values into data[] */ args += len; @@ -739,7 +739,7 @@ static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd, case MCI_CONSTANT: /* done above */ case MCI_END_CONSTANT: /* done above */ break; - case MCI_FLAG: + case MCI_FLAG: *dwFlags |= flg; break; case MCI_INTEGER: @@ -754,7 +754,7 @@ static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd, } } break; - case MCI_RECT: + case MCI_RECT: /* store rect in data (offset...offset+3) */ *dwFlags |= flg; if (!MCI_GetDWord(&(data[offset+0]), &args) || @@ -784,7 +784,7 @@ static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd, case MCI_CONSTANT: case MCI_FLAG: break; case MCI_INTEGER: if (!inCst) offset++; break; - case MCI_END_CONSTANT: + case MCI_END_CONSTANT: case MCI_STRING: offset++; break; case MCI_RECT: offset += 4; break; default: ERR("oops\n"); @@ -806,47 +806,47 @@ static DWORD MCI_ParseOptArgs(LPDWORD data, int _offset, LPCSTR lpCmd, /************************************************************************** * MCI_HandleReturnValues [internal] */ -static DWORD MCI_HandleReturnValues(LPWINE_MM_IDATA iData, DWORD dwRet, - LPWINE_MCIDRIVER wmd, LPCSTR lpCmd, LPDWORD data, +static DWORD MCI_HandleReturnValues(LPWINE_MM_IDATA iData, DWORD dwRet, + LPWINE_MCIDRIVER wmd, LPCSTR lpCmd, LPDWORD data, LPSTR lpstrRet, UINT uRetLen) { if (lpstrRet) { switch (MCI_GetReturnType(lpCmd)) { case 0: /* nothing to return */ break; - case MCI_INTEGER: + case MCI_INTEGER: switch (dwRet & 0xFFFF0000ul) { case 0: case MCI_INTEGER_RETURNED: snprintf(lpstrRet, uRetLen, "%ld", data[1]); break; case MCI_RESOURCE_RETURNED: - /* return string which ID is HIWORD(data[1]), + /* return string which ID is HIWORD(data[1]), * string is loaded from mmsystem.dll */ - LoadStringA(iData->hWinMM32Instance, HIWORD(data[1]), + LoadStringA(iData->hWinMM32Instance, HIWORD(data[1]), lpstrRet, uRetLen); break; case MCI_RESOURCE_RETURNED|MCI_RESOURCE_DRIVER: - /* return string which ID is HIWORD(data[1]), + /* return string which ID is HIWORD(data[1]), * string is loaded from driver */ /* FIXME: this is wrong for a 16 bit handle */ - LoadStringA(GetDriverModuleHandle(wmd->hDriver), + LoadStringA(GetDriverModuleHandle(wmd->hDriver), HIWORD(data[1]), lpstrRet, uRetLen); break; case MCI_COLONIZED3_RETURN: - snprintf(lpstrRet, uRetLen, "%d:%d:%d", - LOBYTE(LOWORD(data[1])), HIBYTE(LOWORD(data[1])), + snprintf(lpstrRet, uRetLen, "%d:%d:%d", + LOBYTE(LOWORD(data[1])), HIBYTE(LOWORD(data[1])), LOBYTE(HIWORD(data[1]))); break; case MCI_COLONIZED4_RETURN: - snprintf(lpstrRet, uRetLen, "%d:%d:%d:%d", - LOBYTE(LOWORD(data[1])), HIBYTE(LOWORD(data[1])), + snprintf(lpstrRet, uRetLen, "%d:%d:%d:%d", + LOBYTE(LOWORD(data[1])), HIBYTE(LOWORD(data[1])), LOBYTE(HIWORD(data[1])), HIBYTE(HIWORD(data[1]))); break; default: ERR("Ooops (%04X)\n", HIWORD(dwRet)); } break; - case MCI_STRING: + case MCI_STRING: switch (dwRet & 0xFFFF0000ul) { case 0: /* nothing to do data[1] == lpstrRet */ @@ -860,11 +860,11 @@ static DWORD MCI_HandleReturnValues(LPWINE_MM_IDATA iData, DWORD dwRet, break; } break; - case MCI_RECT: - if (dwRet & 0xFFFF0000ul) + case MCI_RECT: + if (dwRet & 0xFFFF0000ul) WARN("Oooch. MCI_STRING and HIWORD(dwRet)=%04x\n", HIWORD(dwRet)); - snprintf(lpstrRet, uRetLen, "%ld %ld %ld %ld", - data[1], data[2], data[3], data[4]); + snprintf(lpstrRet, uRetLen, "%ld %ld %ld %ld", + data[1], data[2], data[3], data[4]); break; default: ERR("oops\n"); } @@ -875,7 +875,7 @@ static DWORD MCI_HandleReturnValues(LPWINE_MM_IDATA iData, DWORD dwRet, /************************************************************************** * mciSendStringA [WINMM.@] */ -DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet, +DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet, UINT uRetLen, HWND hwndCallback) { LPSTR verb, dev, args; @@ -918,7 +918,7 @@ DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet, LPSTR devType, tmp; if ((devType = strchr(dev, '!')) != NULL) { - *devType++ = '\0'; + *devType++ = '\0'; tmp = devType; devType = dev; dev = tmp; dwFlags |= MCI_OPEN_TYPE; @@ -974,10 +974,10 @@ DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet, /* auto open */ char buf[128]; sprintf(buf, "open %s wait", dev); - + if ((dwRet = mciSendStringA(buf, NULL, 0, 0)) != 0) goto errCleanUp; - + wmd = MCI_GetDriver(mciGetDeviceIDA(dev)); if (!wmd) { /* FIXME: memory leak, MCI driver is not closed */ @@ -1038,7 +1038,7 @@ DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet, #define STR_OF(_x) (IsBadReadPtr((char*)_x,1)?"?":(char*)(_x)) TRACE("[%d, %s, %08lx, %08lx/%s %08lx/%s %08lx/%s %08lx/%s %08lx/%s %08lx/%s]\n", - wmd->wDeviceID, MCI_MessageToString(MCI_GetMessage(lpCmd)), dwFlags, + wmd->wDeviceID, MCI_MessageToString(MCI_GetMessage(lpCmd)), dwFlags, data[0], STR_OF(data[0]), data[1], STR_OF(data[1]), data[2], STR_OF(data[2]), data[3], STR_OF(data[3]), data[4], STR_OF(data[4]), data[5], STR_OF(data[5])); @@ -1064,7 +1064,7 @@ errCleanUp: /************************************************************************** * mciSendStringW [WINMM.@] */ -DWORD WINAPI mciSendStringW(LPCWSTR lpwstrCommand, LPSTR lpstrRet, +DWORD WINAPI mciSendStringW(LPCWSTR lpwstrCommand, LPSTR lpstrRet, UINT uRetLen, HWND hwndCallback) { LPSTR lpstrCommand; @@ -1083,7 +1083,7 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpwstrCommand, LPSTR lpstrRet, /************************************************************************** * mciSendString [MMSYSTEM.702] */ -DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet, +DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet, UINT16 uRetLen, HWND16 hwndCallback) { return mciSendStringA(lpstrCommand, lpstrRet, uRetLen, hwndCallback); @@ -1105,7 +1105,7 @@ DWORD WINAPI mciExecute(LPCSTR lpstrCommand) if (!mciGetErrorStringA(ret, strRet, sizeof(strRet))) { sprintf(strRet, "Unknown MCI error (%ld)", ret); } - MessageBoxA(0, strRet, "Error in mciExecute()", MB_OK); + MessageBoxA(0, strRet, "Error in mciExecute()", MB_OK); } /* FIXME: what shall I return ? */ return 0; @@ -1156,7 +1156,7 @@ BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable) return MCI_DeleteCommandTable(uTable); } - + /************************************************************************** * mciLoadCommandResource [WINMM.@] * @@ -1232,8 +1232,8 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam) */ switch (wMsg) { /* case MCI_CAPTURE */ - case MCI_CLOSE: - case MCI_CLOSE_DRIVER: + case MCI_CLOSE: + case MCI_CLOSE_DRIVER: case MCI_CONFIGURE: case MCI_COPY: case MCI_CUE: @@ -1245,20 +1245,20 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam) /* case MCI_MARK: */ /* case MCI_MONITOR: */ case MCI_PASTE: - case MCI_PAUSE: - case MCI_PLAY: + case MCI_PAUSE: + case MCI_PLAY: case MCI_PUT: case MCI_REALIZE: - case MCI_RECORD: - case MCI_RESUME: - case MCI_SEEK: + case MCI_RECORD: + case MCI_RESUME: + case MCI_SEEK: case MCI_SET: /* case MCI_SETTIMECODE:*/ /* case MCI_SIGNAL:*/ case MCI_SPIN: case MCI_STATUS: /* FIXME: is wrong for digital video */ case MCI_STEP: - case MCI_STOP: + case MCI_STOP: /* case MCI_UNDO: */ case MCI_UNFREEZE: case MCI_UPDATE: @@ -1266,8 +1266,8 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam) *lParam = (DWORD)MapSL(*lParam); return MCI_MAP_OK; case MCI_WINDOW: - /* in fact, I would also need the dwFlags... to see - * which members of lParam are effectively used + /* in fact, I would also need the dwFlags... to see + * which members of lParam are effectively used */ *lParam = (DWORD)MapSL(*lParam); FIXME("Current mapping may be wrong\n"); @@ -1306,7 +1306,7 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam) LPMCI_INFO_PARMSA mip32a = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_INFO_PARMSA)); LPMCI_INFO_PARMS16 mip16 = MapSL(*lParam); - /* FIXME this is wrong if device is of type + /* FIXME this is wrong if device is of type * MCI_DEVTYPE_DIGITAL_VIDEO, some members are not mapped */ if (mip32a) { @@ -1320,7 +1320,7 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam) } return MCI_MAP_OKMEM; case MCI_OPEN: - case MCI_OPEN_DRIVER: + case MCI_OPEN_DRIVER: { LPMCI_OPEN_PARMSA mop32a = HeapAlloc(GetProcessHeap(), 0, sizeof(LPMCI_OPEN_PARMS16) + sizeof(MCI_OPEN_PARMSA) + 2 * sizeof(DWORD)); LPMCI_OPEN_PARMS16 mop16 = MapSL(*lParam); @@ -1336,9 +1336,9 @@ static MCI_MapType MCI_MapMsg16To32A(WORD uDevType, WORD wMsg, DWORD* lParam) /* copy extended information if any... * FIXME: this may seg fault if initial structure does not contain them and * the reads after msip16 fail under LDT limits... - * NOTE: this should be split in two. First pass, while calling MCI_OPEN, and + * NOTE: this should be split in two. First pass, while calling MCI_OPEN, and * should not take care of extended parameters, and should be used by MCI_Open - * to fetch uDevType. When, this is known, the mapping for sending the + * to fetch uDevType. When, this is known, the mapping for sending the * MCI_OPEN_DRIVER shall be done depending on uDevType. */ memcpy(mop32a + 1, mop16 + 1, 2 * sizeof(DWORD)); @@ -1395,7 +1395,7 @@ static MCI_MapType MCI_UnMapMsg16To32A(WORD uDevType, WORD wMsg, DWORD lParam) switch (wMsg) { /* case MCI_CAPTURE */ case MCI_CLOSE: - case MCI_CLOSE_DRIVER: + case MCI_CLOSE_DRIVER: case MCI_CONFIGURE: case MCI_COPY: case MCI_CUE: @@ -1407,20 +1407,20 @@ static MCI_MapType MCI_UnMapMsg16To32A(WORD uDevType, WORD wMsg, DWORD lParam) /* case MCI_MARK: */ /* case MCI_MONITOR: */ case MCI_PASTE: - case MCI_PAUSE: - case MCI_PLAY: + case MCI_PAUSE: + case MCI_PLAY: case MCI_PUT: case MCI_REALIZE: - case MCI_RECORD: - case MCI_RESUME: - case MCI_SEEK: + case MCI_RECORD: + case MCI_RESUME: + case MCI_SEEK: case MCI_SET: /* case MCI_SETTIMECODE:*/ /* case MCI_SIGNAL:*/ case MCI_SPIN: - case MCI_STATUS: + case MCI_STATUS: case MCI_STEP: - case MCI_STOP: + case MCI_STOP: /* case MCI_UNDO: */ case MCI_UNFREEZE: case MCI_UPDATE: @@ -1438,11 +1438,11 @@ static MCI_MapType MCI_UnMapMsg16To32A(WORD uDevType, WORD wMsg, DWORD lParam) HeapFree(GetProcessHeap(), 0, (LPVOID)lParam); return MCI_MAP_OK; case MCI_OPEN: - case MCI_OPEN_DRIVER: + case MCI_OPEN_DRIVER: if (lParam) { LPMCI_OPEN_PARMSA mop32a = (LPMCI_OPEN_PARMSA)lParam; LPMCI_OPEN_PARMS16 mop16 = *(LPMCI_OPEN_PARMS16*)((char*)mop32a - sizeof(LPMCI_OPEN_PARMS16)); - + mop16->wDeviceID = mop32a->wDeviceID; if (!HeapFree(GetProcessHeap(), 0, (LPVOID)(lParam - sizeof(LPMCI_OPEN_PARMS16)))) FIXME("bad free line=%d\n", __LINE__); @@ -1474,7 +1474,7 @@ static MCI_MapType MCI_UnMapMsg16To32A(WORD uDevType, WORD wMsg, DWORD lParam) * 0001 squeeze signed 4 bytes to 2 bytes *( LPINT16)D = ( INT16)*( LPINT16)S; D += 2; S += 4 * 0010 squeeze unsigned 4 bytes to 2 bytes *(LPUINT16)D = (UINT16)*(LPUINT16)S; D += 2; S += 4 * 0100 - * 0101 + * 0101 * 0110 zero 4 bytes *(DWORD)D = 0 D += 4; S += 4 * 0111 copy string *(LPSTR*)D = seg dup(*(LPSTR*)S) D += 4; S += 4 * 1xxx copy xxx + 1 bytes memcpy(D, S, xxx + 1); D += xxx+1; S += xxx+1 @@ -1483,8 +1483,8 @@ static MCI_MapType MCI_UnMapMsg16To32A(WORD uDevType, WORD wMsg, DWORD lParam) /************************************************************************** * MCI_MsgMapper32To16_Create [internal] * - * Helper for MCI_MapMsg32ATo16. - * Maps the 32 bit pointer (*ptr), of size bytes, to an allocated 16 bit + * Helper for MCI_MapMsg32ATo16. + * Maps the 32 bit pointer (*ptr), of size bytes, to an allocated 16 bit * segmented pointer. * map contains a list of action to be performed for the mapping (see list * above) @@ -1507,7 +1507,7 @@ static MCI_MapType MCI_MsgMapper32To16_Create(void** ptr, int size16, DWORD map, p16 = lp; *ptr = (void*)MapLS(lp); } - + if (map == 0) { memcpy(p16, p32, size16); } else { @@ -1563,7 +1563,7 @@ static MCI_MapType MCI_MsgMapper32To16_Create(void** ptr, int size16, DWORD map, /************************************************************************** * MCI_MsgMapper32To16_Destroy [internal] * - * Helper for MCI_UnMapMsg32ATo16. + * Helper for MCI_UnMapMsg32ATo16. */ static MCI_MapType MCI_MsgMapper32To16_Destroy(void* ptr, int size16, DWORD map, BOOLEAN kept) { @@ -1656,9 +1656,9 @@ static MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DW break; /* case MCI_CAPTURE */ case MCI_CLOSE: - case MCI_CLOSE_DRIVER: + case MCI_CLOSE_DRIVER: case MCI_CONFIGURE: - size = sizeof(MCI_GENERIC_PARMS); + size = sizeof(MCI_GENERIC_PARMS); break; /* case MCI_COPY: */ case MCI_CUE: @@ -1693,7 +1693,7 @@ static MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DW { LPMCI_INFO_PARMSA mip32a = (LPMCI_INFO_PARMSA)(*lParam); LPMCI_INFO_PARMS16 mip16; - + switch (uDevType) { case MCI_DEVTYPE_DIGITAL_VIDEO: size = sizeof(MCI_DGV_INFO_PARMS16); break; default: size = sizeof(MCI_INFO_PARMS16); break; @@ -1716,7 +1716,7 @@ static MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DW /* case MCI_MARK: */ /* case MCI_MONITOR: */ case MCI_OPEN: - case MCI_OPEN_DRIVER: + case MCI_OPEN_DRIVER: { LPMCI_OPEN_PARMSA mop32a = (LPMCI_OPEN_PARMSA)(*lParam); char* ptr = HeapAlloc( GetProcessHeap(), 0, @@ -1758,9 +1758,9 @@ static MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DW /* copy extended information if any... * FIXME: this may seg fault if initial structure does not contain them and * the reads after msip16 fail under LDT limits... - * NOTE: this should be split in two. First pass, while calling MCI_OPEN, and + * NOTE: this should be split in two. First pass, while calling MCI_OPEN, and * should not take care of extended parameters, and should be used by MCI_Open - * to fetch uDevType. When, this is known, the mapping for sending the + * to fetch uDevType. When, this is known, the mapping for sending the * MCI_OPEN_DRIVER shall be done depending on uDevType. */ memcpy(mop16 + 1, mop32a + 1, 2 * sizeof(DWORD)); @@ -1794,7 +1794,7 @@ static MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DW default: size = sizeof(MCI_RECORD_PARMS); break; } break; - case MCI_RESUME: + case MCI_RESUME: size = sizeof(MCI_GENERIC_PARMS); break; case MCI_SEEK: @@ -1808,13 +1808,13 @@ static MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DW case MCI_DEVTYPE_DIGITAL_VIDEO: size = sizeof(MCI_DGV_SET_PARMS); break; case MCI_DEVTYPE_VCR: /*size = sizeof(MCI_VCR_SET_PARMS); break;*/FIXME("NIY vcr\n"); return MCI_MAP_NOMEM; case MCI_DEVTYPE_SEQUENCER: size = sizeof(MCI_SEQ_SET_PARMS); break; - /* FIXME: normally the 16 and 32 bit structures are byte by byte aligned, + /* FIXME: normally the 16 and 32 bit structures are byte by byte aligned, * so not doing anything should work... */ case MCI_DEVTYPE_WAVEFORM_AUDIO:size = sizeof(MCI_WAVE_SET_PARMS); break; default: size = sizeof(MCI_SET_PARMS); break; } - break; + break; case MCI_SETAUDIO: switch (uDevType) { case MCI_DEVTYPE_DIGITAL_VIDEO: size = sizeof(MCI_DGV_SETAUDIO_PARMS16);map = 0x0000077FF; break; @@ -1825,13 +1825,13 @@ static MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DW /* case MCI_SETTIMECODE:*/ /* case MCI_SIGNAL:*/ case MCI_SPIN: - size = sizeof(MCI_SET_PARMS); + size = sizeof(MCI_SET_PARMS); break; case MCI_STATUS: keep = TRUE; switch (uDevType) { /* FIXME: - * don't know if buffer for value is the one passed through lpstrDevice + * don't know if buffer for value is the one passed through lpstrDevice * or is provided by MCI driver. * Assuming solution 2: provided by MCI driver, so zeroing on entry */ @@ -1847,9 +1847,9 @@ static MCI_MapType MCI_MapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, DW case MCI_DEVTYPE_VIDEODISC: size = sizeof(MCI_VD_STEP_PARMS); break; default: size = sizeof(MCI_GENERIC_PARMS); break; } - break; - case MCI_STOP: - size = sizeof(MCI_SET_PARMS); + break; + case MCI_STOP: + size = sizeof(MCI_SET_PARMS); break; case MCI_SYSINFO: { @@ -1954,12 +1954,12 @@ static MCI_MapType MCI_UnMapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, case MCI_BREAK: break; /* case MCI_CAPTURE */ - case MCI_CLOSE: - case MCI_CLOSE_DRIVER: + case MCI_CLOSE: + case MCI_CLOSE_DRIVER: case MCI_CONFIGURE: break; /* case MCI_COPY: */ - case MCI_CUE: + case MCI_CUE: break; /* case MCI_CUT: */ case MCI_DELETE: @@ -1983,7 +1983,7 @@ static MCI_MapType MCI_UnMapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, /* case MCI_MARK: */ /* case MCI_MONITOR: */ case MCI_OPEN: - case MCI_OPEN_DRIVER: + case MCI_OPEN_DRIVER: if (lParam) { LPMCI_OPEN_PARMS16 mop16 = (LPMCI_OPEN_PARMS16)MapSL(lParam); LPMCI_OPEN_PARMSA mop32a = *(LPMCI_OPEN_PARMSA*)((char*)mop16 - sizeof(LPMCI_OPEN_PARMSA)); @@ -2001,7 +2001,7 @@ static MCI_MapType MCI_UnMapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, /* case MCI_PASTE:*/ case MCI_PAUSE: break; - case MCI_PLAY: + case MCI_PLAY: break; case MCI_PUT: break; @@ -2028,7 +2028,7 @@ static MCI_MapType MCI_UnMapMsg32ATo16(WORD uDevType, WORD wMsg, DWORD dwFlags, case MCI_STATUS: kept = TRUE; switch (uDevType) { - case MCI_DEVTYPE_DIGITAL_VIDEO: + case MCI_DEVTYPE_DIGITAL_VIDEO: if (lParam) { LPMCI_DGV_STATUS_PARMS16 mdsp16 = (LPMCI_DGV_STATUS_PARMS16)MapSL(lParam); LPMCI_DGV_STATUS_PARMSA mdsp32a = *(LPMCI_DGV_STATUS_PARMSA*)((char*)mdsp16 - sizeof(LPMCI_DGV_STATUS_PARMSA)); @@ -2137,7 +2137,7 @@ DWORD MCI_SendCommandFrom32(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwPa dwRet = SendDriverMessage(wmd->hDriver, wMsg, dwParam1, dwParam2); } else { MCI_MapType res; - + switch (res = MCI_MapMsg32ATo16(wmd->wType, wMsg, dwParam1, &dwParam2)) { case MCI_MAP_MSGERROR: TRACE("Not handled yet (%s)\n", MCI_MessageToString(wMsg)); @@ -2172,7 +2172,7 @@ DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwPa if (wmd->bIs32) { MCI_MapType res; - + switch (res = MCI_MapMsg16To32A(wmd->wType, wMsg, &dwParam2)) { case MCI_MAP_MSGERROR: TRACE("Not handled yet (%s)\n", MCI_MessageToString(wMsg)); @@ -2202,7 +2202,7 @@ DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwPa static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms) { char strDevTyp[128]; - DWORD dwRet; + DWORD dwRet; LPWINE_MCIDRIVER wmd = NULL; LPWINE_MM_IDATA iData = MULTIMEDIA_GetIData(); @@ -2254,7 +2254,7 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms) /* FIXME: not a good idea to write in user supplied buffer */ lpParms->lpstrElementName = ptr; } - + } TRACE("devType='%s' !\n", strDevTyp); } @@ -2274,8 +2274,8 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms) } /* type, if given as a parameter, supersedes file extension */ - if (!strDevTyp[0] && - MCI_GetDevTypeFromFileName(lpParms->lpstrElementName, + if (!strDevTyp[0] && + MCI_GetDevTypeFromFileName(lpParms->lpstrElementName, strDevTyp, sizeof(strDevTyp))) { if (GetDriveTypeA(lpParms->lpstrElementName) != DRIVE_CDROM) { dwRet = MCIERR_EXTENSION_NOT_FOUND; @@ -2285,7 +2285,7 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms) strcpy(strDevTyp, "CDAUDIO"); } } - + if (strDevTyp[0] == 0) { FIXME("Couldn't load driver\n"); dwRet = MCIERR_INVALID_DEVICE_NAME; @@ -2315,7 +2315,7 @@ static DWORD MCI_Open(DWORD dwParam, LPMCI_OPEN_PARMSA lpParms) if (dwParam & MCI_NOTIFY) mciDriverNotify16(lpParms->dwCallback, wmd->wDeviceID, MCI_NOTIFY_SUCCESSFUL); - + return 0; errCleanUp: if (wmd) MCI_UnLoadMciDriver(iData, wmd); @@ -2340,7 +2340,7 @@ static DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms LPWINE_MCIDRIVER next; EnterCriticalSection(&iData->cs); - /* FIXME: shall I notify once after all is done, or for + /* FIXME: shall I notify once after all is done, or for * each of the open drivers ? if the latest, which notif * to return when only one fails ? */ @@ -2348,7 +2348,7 @@ static DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms next = wmd->lpNext; MCI_Close(wmd->wDeviceID, dwParam, lpParms); wmd = next; - } + } LeaveCriticalSection(&iData->cs); return 0; } @@ -2364,7 +2364,7 @@ static DWORD MCI_Close(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms if (dwParam & MCI_NOTIFY) mciDriverNotify16(lpParms->dwCallback, wDevID, (dwRet == 0) ? MCI_NOTIFY_SUCCESSFUL : MCI_NOTIFY_FAILURE); - + return dwRet; } @@ -2381,7 +2381,7 @@ DWORD MCI_WriteString(LPSTR lpDstStr, DWORD dstSize, LPCSTR lpSrcStr) ret = MCIERR_PARAM_OVERFLOW; } else { strcpy(lpDstStr, lpSrcStr); - } + } } else { *lpDstStr = 0; } @@ -2399,15 +2399,15 @@ static DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParm if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; - TRACE("(%08x, %08lX, %08lX[num=%ld, wDevTyp=%u])\n", + TRACE("(%08x, %08lX, %08lX[num=%ld, wDevTyp=%u])\n", uDevID, dwFlags, (DWORD)lpParms, lpParms->dwNumber, lpParms->wDeviceType); - + switch (dwFlags & ~MCI_SYSINFO_OPEN) { case MCI_SYSINFO_QUANTITY: { DWORD cnt = 0; - - if (lpParms->wDeviceType < MCI_DEVTYPE_FIRST || + + if (lpParms->wDeviceType < MCI_DEVTYPE_FIRST || lpParms->wDeviceType > MCI_DEVTYPE_LAST) { if (dwFlags & MCI_SYSINFO_OPEN) { TRACE("MCI_SYSINFO_QUANTITY: # of open MCI drivers\n"); @@ -2422,7 +2422,7 @@ static DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParm } } else { if (dwFlags & MCI_SYSINFO_OPEN) { - TRACE("MCI_SYSINFO_QUANTITY: # of open MCI drivers of type %u\n", + TRACE("MCI_SYSINFO_QUANTITY: # of open MCI drivers of type %u\n", lpParms->wDeviceType); EnterCriticalSection(&iData->cs); for (wmd = iData->lpMciDrvs; wmd; wmd = wmd->lpNext) { @@ -2431,7 +2431,7 @@ static DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParm } LeaveCriticalSection(&iData->cs); } else { - TRACE("MCI_SYSINFO_QUANTITY: # of installed MCI drivers of type %u\n", + TRACE("MCI_SYSINFO_QUANTITY: # of installed MCI drivers of type %u\n", lpParms->wDeviceType); FIXME("Don't know how to get # of MCI devices of a given type\n"); cnt = 1; @@ -2445,7 +2445,7 @@ static DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParm case MCI_SYSINFO_INSTALLNAME: TRACE("MCI_SYSINFO_INSTALLNAME \n"); if ((wmd = MCI_GetDriver(uDevID))) { - ret = MCI_WriteString(lpParms->lpstrReturn, lpParms->dwRetSize, + ret = MCI_WriteString(lpParms->lpstrReturn, lpParms->dwRetSize, wmd->lpstrDeviceType); } else { *lpParms->lpstrReturn = 0; @@ -2482,7 +2482,7 @@ static DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSA lpParm static DWORD MCI_Break(UINT wDevID, DWORD dwFlags, LPMCI_BREAK_PARMS lpParms) { DWORD dwRet = 0; - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (dwFlags & MCI_NOTIFY) @@ -2491,11 +2491,11 @@ static DWORD MCI_Break(UINT wDevID, DWORD dwFlags, LPMCI_BREAK_PARMS lpParms) return dwRet; } - + /************************************************************************** * MCI_SendCommand [internal] */ -DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, +DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32) { DWORD dwRet = MCIERR_UNRECOGNIZED_COMMAND; @@ -2570,7 +2570,7 @@ DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, dwRet = (bFrom32) ? MCI_SendCommandFrom32(wDevID, wMsg, dwParam1, dwParam2) : MCI_SendCommandFrom16(wDevID, wMsg, dwParam1, dwParam2); - } + } break; } return dwRet; @@ -2579,13 +2579,13 @@ DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD dwParam1, /************************************************************************** * MCI_CleanUp [internal] * - * Some MCI commands need to be cleaned-up (when not called from + * Some MCI commands need to be cleaned-up (when not called from * mciSendString), because MCI drivers return extra information for string * transformation. This function gets rid of them. */ LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32) { - if (LOWORD(dwRet)) + if (LOWORD(dwRet)) return LOWORD(dwRet); switch (wMsg) { @@ -2605,10 +2605,10 @@ LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32) lmgp = (LPMCI_GETDEVCAPS_PARMS)(bIs32 ? (void*)dwParam2 : MapSL(dwParam2)); TRACE("Changing %08lx to %08lx\n", lmgp->dwReturn, (DWORD)LOWORD(lmgp->dwReturn)); lmgp->dwReturn = LOWORD(lmgp->dwReturn); - } + } break; default: - FIXME("Unsupported value for hiword (%04x) returned by DriverProc(%s)\n", + FIXME("Unsupported value for hiword (%04x) returned by DriverProc(%s)\n", HIWORD(dwRet), MCI_MessageToString(wMsg)); } break; @@ -2631,7 +2631,7 @@ LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32) } break; default: - FIXME("Unsupported value for hiword (%04x) returned by DriverProc(%s)\n", + FIXME("Unsupported value for hiword (%04x) returned by DriverProc(%s)\n", HIWORD(dwRet), MCI_MessageToString(wMsg)); } break; @@ -2642,12 +2642,12 @@ LRESULT MCI_CleanUp(LRESULT dwRet, UINT wMsg, DWORD dwParam2, BOOL bIs32) /* nothing to do */ break; default: - FIXME("Unsupported value for hiword (%04x)\n", HIWORD(dwRet)); + FIXME("Unsupported value for hiword (%04x)\n", HIWORD(dwRet)); } break; default: if (HIWORD(dwRet)) { - FIXME("Got non null hiword for dwRet=0x%08lx for command %s\n", + FIXME("Got non null hiword for dwRet=0x%08lx for command %s\n", dwRet, MCI_MessageToString(wMsg)); } break; @@ -2681,7 +2681,7 @@ BOOL MULTIMEDIA_MciInit(void) !(err = RegOpenKeyA(hWineConf, "options", &hkey))) { err = RegQueryValueExA(hkey, "mci", 0, &type, MCI_lpInstallNames, &count); RegCloseKey(hkey); - + } if (!err) { TRACE("Wine => '%s' \n", ptr1); diff --git a/dlls/winmm/mcianim/mcianim.c b/dlls/winmm/mcianim/mcianim.c index 39a41920473..ea4f9394b63 100644 --- a/dlls/winmm/mcianim/mcianim.c +++ b/dlls/winmm/mcianim/mcianim.c @@ -53,7 +53,7 @@ typedef struct { /*-----------------------------------------------------------------------*/ /************************************************************************** - * MCIANIM_drvOpen [internal] + * MCIANIM_drvOpen [internal] */ static DWORD MCIANIM_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) { @@ -74,7 +74,7 @@ static DWORD MCIANIM_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) } /************************************************************************** - * MCIANIM_drvClose [internal] + * MCIANIM_drvClose [internal] */ static DWORD MCIANIM_drvClose(DWORD dwDevID) { @@ -88,12 +88,12 @@ static DWORD MCIANIM_drvClose(DWORD dwDevID) } /************************************************************************** - * MCIANIM_mciGetOpenDrv [internal] + * MCIANIM_mciGetOpenDrv [internal] */ static WINE_MCIANIM* MCIANIM_mciGetOpenDrv(UINT16 wDevID) { WINE_MCIANIM* wma = (WINE_MCIANIM*)mciGetDriverData(wDevID); - + if (wma == NULL || wma->nUseCount == 0) { WARN("Invalid wDevID=%u\n", wDevID); return 0; @@ -108,12 +108,12 @@ static DWORD MCIANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpO { DWORD dwDeviceID; WINE_MCIANIM* wma = (WINE_MCIANIM*)mciGetDriverData(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpOpenParms); - + if (lpOpenParms == NULL) return MCIERR_INTERNAL; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wma->nUseCount > 0) { /* The driver already open on this channel */ /* If the driver was opened shareable before and this open specifies */ @@ -126,13 +126,13 @@ static DWORD MCIANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpO wma->nUseCount = 1; wma->fShareable = dwFlags & MCI_OPEN_SHAREABLE; } - + dwDeviceID = lpOpenParms->wDeviceID; - + TRACE("wDevID=%04X\n", wDevID); /* FIXME this is not consistent with other implementations */ lpOpenParms->wDeviceID = wDevID; - + /*TRACE("lpParms->wDevID=%04X\n", lpParms->wDeviceID);*/ if (dwFlags & MCI_OPEN_ELEMENT) { TRACE("MCI_OPEN_ELEMENT '%s' !\n", lpOpenParms->lpstrElementName); @@ -150,12 +150,12 @@ static DWORD MCIANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpO wma->lpdwTrackLen = NULL; wma->lpdwTrackPos = NULL; /* - Moved to mmsystem.c mciOpen routine - + Moved to mmsystem.c mciOpen routine + if (dwFlags & MCI_NOTIFY) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", + TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND16)LOWORD(lpParms->dwCallback), wma->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } */ @@ -168,11 +168,11 @@ static DWORD MCIANIM_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpO static DWORD MCIANIM_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwParam, lpParms); - + if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (--wma->nUseCount == 0) { /* do the actual clean-up */ } @@ -182,17 +182,17 @@ static DWORD MCIANIM_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS /************************************************************************** * MCIANIM_mciGetDevCaps [internal] */ -static DWORD MCIANIM_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, +static DWORD MCIANIM_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); DWORD ret; TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_GETDEVCAPS_ITEM) { TRACE("MCI_GETDEVCAPS_ITEM dwItem=%08lX;\n", lpParms->dwItem); @@ -256,9 +256,9 @@ static DWORD MCIANIM_CalcTime(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwFra UINT16 wMinutes; UINT16 wSeconds; UINT16 wFrames; - + TRACE("(%p, %08lX, %lu);\n", wma, dwFormatType, dwFrame); - + switch (dwFormatType) { case MCI_FORMAT_MILLISECONDS: dwTime = dwFrame / ANIMFRAMES_PERSEC * 1000; @@ -268,7 +268,7 @@ static DWORD MCIANIM_CalcTime(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwFra case MCI_FORMAT_MSF: wMinutes = dwFrame / ANIMFRAMES_PERMIN; wSeconds = (dwFrame - ANIMFRAMES_PERMIN * wMinutes) / ANIMFRAMES_PERSEC; - wFrames = dwFrame - ANIMFRAMES_PERMIN * wMinutes - + wFrames = dwFrame - ANIMFRAMES_PERMIN * wMinutes - ANIMFRAMES_PERSEC * wSeconds; dwTime = MCI_MAKE_MSF(wMinutes, wSeconds, wFrames); TRACE("MSF %02u:%02u:%02u -> dwTime=%lu\n",wMinutes, wSeconds, wFrames, dwTime); @@ -286,7 +286,7 @@ static DWORD MCIANIM_CalcTime(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwFra } wMinutes = dwFrame / ANIMFRAMES_PERMIN; wSeconds = (dwFrame - ANIMFRAMES_PERMIN * wMinutes) / ANIMFRAMES_PERSEC; - wFrames = dwFrame - ANIMFRAMES_PERMIN * wMinutes - + wFrames = dwFrame - ANIMFRAMES_PERMIN * wMinutes - ANIMFRAMES_PERSEC * wSeconds; dwTime = MCI_MAKE_TMSF(wTrack, wMinutes, wSeconds, wFrames); *lpRet = MCI_COLONIZED4_RETURN; @@ -304,9 +304,9 @@ static DWORD MCIANIM_CalcFrame(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwTi { DWORD dwFrame = 0; UINT16 wTrack; - + TRACE("(%p, %08lX, %lu);\n", wma, dwFormatType, dwTime); - + switch (dwFormatType) { case MCI_FORMAT_MILLISECONDS: dwFrame = dwTime * ANIMFRAMES_PERSEC / 1000; @@ -314,7 +314,7 @@ static DWORD MCIANIM_CalcFrame(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwTi break; case MCI_FORMAT_MSF: TRACE("MSF %02u:%02u:%02u\n", - MCI_MSF_MINUTE(dwTime), MCI_MSF_SECOND(dwTime), + MCI_MSF_MINUTE(dwTime), MCI_MSF_SECOND(dwTime), MCI_MSF_FRAME(dwTime)); dwFrame += ANIMFRAMES_PERMIN * MCI_MSF_MINUTE(dwTime); dwFrame += ANIMFRAMES_PERSEC * MCI_MSF_SECOND(dwTime); @@ -326,7 +326,7 @@ static DWORD MCIANIM_CalcFrame(WINE_MCIANIM* wma, DWORD dwFormatType, DWORD dwTi case MCI_FORMAT_TMSF: wTrack = MCI_TMSF_TRACK(dwTime); TRACE("TMSF %02u-%02u:%02u:%02u\n", - MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime), + MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime), MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime)); TRACE("TMSF trackpos[%u]=%lu\n", wTrack, wma->lpdwTrackPos[wTrack - 1]); @@ -347,17 +347,17 @@ static DWORD MCIANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpP WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); LPSTR str = 0; DWORD ret = 0; - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL || lpParms->lpstrReturn == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize); - + switch(dwFlags) { case MCI_INFO_PRODUCT: str = "Wine's animation"; @@ -379,7 +379,7 @@ static DWORD MCIANIM_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpP ret = MCIERR_PARAM_OVERFLOW; } else { strcpy(lpParms->lpstrReturn, str); - } + } } else { *lpParms->lpstrReturn = 0; } @@ -395,10 +395,10 @@ static DWORD MCIANIM_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS DWORD ret; TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_INTERNAL; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_NOTIFY) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); @@ -482,16 +482,16 @@ static DWORD MCIANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa { WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); int start, end; - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_INTERNAL; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + start = 0; end = wma->dwTotalLen; wma->nCurTrack = 1; if (dwFlags & MCI_FROM) { - start = MCIANIM_CalcFrame(wma, wma->dwTimeFormat, lpParms->dwFrom); + start = MCIANIM_CalcFrame(wma, wma->dwTimeFormat, lpParms->dwFrom); TRACE("MCI_FROM=%08lX -> %u \n", lpParms->dwFrom, start); } if (dwFlags & MCI_TO) { @@ -500,7 +500,7 @@ static DWORD MCIANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa } wma->mode = MCI_MODE_PLAY; if (dwFlags & MCI_NOTIFY) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", + TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wma->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); @@ -514,12 +514,12 @@ static DWORD MCIANIM_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpPa static DWORD MCIANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_INTERNAL; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + wma->mode = MCI_MODE_STOP; if (dwFlags & MCI_NOTIFY) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); @@ -536,7 +536,7 @@ static DWORD MCIANIM_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l static DWORD MCIANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; wma->mode = MCI_MODE_PAUSE; @@ -555,7 +555,7 @@ static DWORD MCIANIM_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS static DWORD MCIANIM_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; wma->mode = MCI_MODE_STOP; @@ -576,9 +576,9 @@ static DWORD MCIANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpPa WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); DWORD dwRet; MCI_PLAY_PARMS PlayParms; - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_INTERNAL; wma->mode = MCI_MODE_SEEK; switch (dwFlags) { @@ -611,7 +611,7 @@ static DWORD MCIANIM_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpPa static DWORD MCIANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { WINE_MCIANIM* wma = MCIANIM_mciGetOpenDrv(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_INTERNAL; @@ -651,12 +651,12 @@ static DWORD MCIANIM_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParm /************************************************************************** * DriverProc (MCIANIM.@) */ -LONG WINAPI MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG WINAPI MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { switch (wMsg) { case DRV_LOAD: return 1; - case DRV_FREE: return 1; + case DRV_FREE: return 1; case DRV_OPEN: return MCIANIM_drvOpen((LPSTR)dwParam1, (LPMCI_OPEN_DRIVER_PARMSA)dwParam2); case DRV_CLOSE: return MCIANIM_drvClose(dwDevID); case DRV_ENABLE: return 1; @@ -666,11 +666,11 @@ LONG WINAPI MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case DRV_INSTALL: return DRVCNF_RESTART; case DRV_REMOVE: return DRVCNF_RESTART; } - + if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION; switch (wMsg) { - case MCI_OPEN_DRIVER: return MCIANIM_mciOpen(dwDevID, dwParam1, (LPMCI_OPEN_PARMSA)dwParam2); + case MCI_OPEN_DRIVER: return MCIANIM_mciOpen(dwDevID, dwParam1, (LPMCI_OPEN_PARMSA)dwParam2); case MCI_CLOSE_DRIVER: return MCIANIM_mciClose(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2); case MCI_GETDEVCAPS: return MCIANIM_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS)dwParam2); case MCI_INFO: return MCIANIM_mciInfo(dwDevID, dwParam1, (LPMCI_INFO_PARMSA)dwParam2); @@ -681,29 +681,29 @@ LONG WINAPI MCIANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case MCI_PAUSE: return MCIANIM_mciPause(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2); case MCI_RESUME: return MCIANIM_mciResume(dwDevID, dwParam1, (LPMCI_GENERIC_PARMS)dwParam2); case MCI_SEEK: return MCIANIM_mciSeek(dwDevID, dwParam1, (LPMCI_SEEK_PARMS)dwParam2); - case MCI_LOAD: - case MCI_SAVE: - case MCI_FREEZE: - case MCI_PUT: - case MCI_REALIZE: - case MCI_UNFREEZE: - case MCI_UPDATE: - case MCI_WHERE: - case MCI_WINDOW: - case MCI_STEP: - case MCI_SPIN: - case MCI_ESCAPE: - case MCI_COPY: - case MCI_CUT: - case MCI_DELETE: - case MCI_PASTE: + case MCI_LOAD: + case MCI_SAVE: + case MCI_FREEZE: + case MCI_PUT: + case MCI_REALIZE: + case MCI_UNFREEZE: + case MCI_UPDATE: + case MCI_WHERE: + case MCI_WINDOW: + case MCI_STEP: + case MCI_SPIN: + case MCI_ESCAPE: + case MCI_COPY: + case MCI_CUT: + case MCI_DELETE: + case MCI_PASTE: FIXME("Unsupported message [%lu]\n", wMsg); break; case MCI_OPEN: case MCI_CLOSE: ERR("Shouldn't receive a MCI_OPEN or CLOSE message\n"); break; - default: + default: TRACE("Sending msg [%lu] to default driver proc\n", wMsg); return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); } diff --git a/dlls/winmm/mciavi/info.c b/dlls/winmm/mciavi/info.c index 885e510ec3e..003ecef4467 100644 --- a/dlls/winmm/mciavi/info.c +++ b/dlls/winmm/mciavi/info.c @@ -27,12 +27,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(mciavi); /************************************************************************** - * MCIAVI_ConvertFrameToTimeFormat [internal] + * MCIAVI_ConvertFrameToTimeFormat [internal] */ DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet) { DWORD ret = 0; - + switch (wma->dwMciTimeFormat) { case MCI_FORMAT_MILLISECONDS: ret = (val * wma->mah.dwMicroSecPerFrame) / 1000; @@ -49,12 +49,12 @@ DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRe } /************************************************************************** - * MCIAVI_ConvertTimeFormatToFrame [internal] + * MCIAVI_ConvertTimeFormatToFrame [internal] */ DWORD MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val) { DWORD ret = 0; - + switch (wma->dwMciTimeFormat) { case MCI_FORMAT_MILLISECONDS: ret = (val * 1000) / wma->mah.dwMicroSecPerFrame; @@ -76,12 +76,12 @@ DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS l { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); DWORD ret; - + TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_GETDEVCAPS_ITEM) { switch (lpParms->dwItem) { case MCI_GETDEVCAPS_DEVICE_TYPE: @@ -148,13 +148,13 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms) LPSTR str = 0; WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); DWORD ret = 0; - + if (lpParms == NULL || lpParms->lpstrReturn == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize); - + switch (dwFlags) { case MCI_INFO_PRODUCT: str = "Wine's AVI player"; @@ -184,10 +184,10 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSA lpParms) DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_SET_TIME_FORMAT) { switch (lpParms->dwTimeFormat) { case MCI_FORMAT_MILLISECONDS: @@ -203,7 +203,7 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) return MCIERR_BAD_TIME_FORMAT; } } - + if (dwFlags & MCI_SET_DOOR_OPEN) { TRACE("No support for door open !\n"); return MCIERR_UNSUPPORTED_FUNCTION; @@ -214,9 +214,9 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) } if (dwFlags & MCI_SET_ON) { char buffer[256]; - + strcpy(buffer, "MCI_SET_ON:"); - + if (dwFlags & MCI_SET_VIDEO) { strncat(buffer, " video", sizeof(buffer)); wma->dwSet |= 4; @@ -246,10 +246,10 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) } FIXME("%s\n", buffer); } - + if (dwFlags & MCI_SET_OFF) { char buffer[256]; - + strcpy(buffer, "MCI_SET_OFF:"); if (dwFlags & MCI_SET_VIDEO) { strncat(buffer, " video", sizeof(buffer)); @@ -282,9 +282,9 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) } if (dwFlags & MCI_DGV_SET_FILEFORMAT) { LPSTR str = "save"; - if (dwFlags & MCI_DGV_SET_STILL) + if (dwFlags & MCI_DGV_SET_STILL) str = "capture"; - + switch (lpParms->dwFileFormat) { case MCI_DGV_FF_AVI: FIXME("Setting file format (%s) to 'AVI'\n", str); break; case MCI_DGV_FF_AVSS: FIXME("Setting file format (%s) to 'AVSS'\n", str); break; @@ -297,11 +297,11 @@ DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms) default: FIXME("Setting unknown file format (%s): %ld\n", str, lpParms->dwFileFormat); } } - + if (dwFlags & MCI_DGV_SET_SPEED) { FIXME("Setting speed to %ld\n", lpParms->dwSpeed); } - + return 0; } @@ -312,10 +312,10 @@ DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA lpPar { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); DWORD ret = 0; - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_STATUS_ITEM) { switch (lpParms->dwItem) { case MCI_STATUS_CURRENT_TRACK: @@ -351,10 +351,10 @@ DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA lpPar return MCIERR_UNSUPPORTED_FUNCTION; } /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */ - lpParms->dwReturn = MCIAVI_ConvertFrameToTimeFormat(wma, + lpParms->dwReturn = MCIAVI_ConvertFrameToTimeFormat(wma, (dwFlags & MCI_STATUS_START) ? 0 : wma->dwCurrVideoFrame, &ret); - TRACE("MCI_STATUS_POSITION %s => %lu\n", + TRACE("MCI_STATUS_POSITION %s => %lu\n", (dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn); break; case MCI_STATUS_READY: @@ -447,7 +447,7 @@ DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSA lpPar mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wma->openParms.wDeviceID, MCI_NOTIFY_SUCCESSFUL); } - + return ret; } diff --git a/dlls/winmm/mciavi/mciavi.c b/dlls/winmm/mciavi/mciavi.c index 2dc974c632c..7f40e07d3b8 100644 --- a/dlls/winmm/mciavi/mciavi.c +++ b/dlls/winmm/mciavi/mciavi.c @@ -31,7 +31,7 @@ * - better move the AVI handling part to avifile DLL and make use of it * - some files appear to have more than one audio stream (we only play the * first one) - * - some files contain an index of audio/video frame. Better use it, + * - some files contain an index of audio/video frame. Better use it, * instead of rebuilding it * - mciWindow (for setting the hWnd) is broken with media player * - stopping while playing a file with sound blocks until all buffered @@ -67,7 +67,7 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg) { struct SCA* sca = (struct SCA*)arg; DWORD ret; - + TRACE("In thread before async command (%08x,%u,%08lx,%08lx)\n", sca->wDevID, sca->wMsg, sca->dwParam1, sca->dwParam2); ret = mciSendCommandA(sca->wDevID, sca->wMsg, sca->dwParam1 | MCI_WAIT, sca->dwParam2); @@ -83,28 +83,28 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg) /************************************************************************** * MCI_SendCommandAsync [internal] */ -static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, +static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size) { struct SCA* sca = HeapAlloc(GetProcessHeap(), 0, sizeof(struct SCA) + size); - + if (sca == 0) return MCIERR_OUT_OF_MEMORY; - + sca->wDevID = wDevID; sca->wMsg = wMsg; sca->dwParam1 = dwParam1; - + if (size && dwParam2) { sca->dwParam2 = (DWORD)sca + sizeof(struct SCA); - /* copy structure passed by program in dwParam2 to be sure - * we can still use it whatever the program does + /* copy structure passed by program in dwParam2 to be sure + * we can still use it whatever the program does */ memcpy((LPVOID)sca->dwParam2, (LPVOID)dwParam2, size); } else { sca->dwParam2 = dwParam2; } - + if (CreateThread(NULL, 0, MCI_SCAStarter, sca, 0, NULL) == 0) { WARN("Couldn't allocate thread for async command handling, sending synchronously\n"); return MCI_SCAStarter(&sca); @@ -129,7 +129,7 @@ BOOL WINAPI MCIAVI_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad) } /************************************************************************** - * MCIAVI_drvOpen [internal] + * MCIAVI_drvOpen [internal] */ static DWORD MCIAVI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) { @@ -141,7 +141,7 @@ static DWORD MCIAVI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) wma = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_MCIAVI)); if (!wma) return 0; - + wma->wDevID = modp->wDeviceID; mciSetDriverData(wma->wDevID, (DWORD)wma); wma->wCommandTable = mciLoadCommandResource(MCIAVI_hInstance, mciAviWStr, 0); @@ -151,42 +151,42 @@ static DWORD MCIAVI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) } /************************************************************************** - * MCIAVI_drvClose [internal] + * MCIAVI_drvClose [internal] */ static DWORD MCIAVI_drvClose(DWORD dwDevID) { WINE_MCIAVI* wma = (WINE_MCIAVI*)mciGetDriverData(dwDevID); - + if (wma) { mciSetDriverData(dwDevID, 0); mciFreeCommandResource(wma->wCommandTable); - HeapFree(GetProcessHeap(), 0, wma); + HeapFree(GetProcessHeap(), 0, wma); return 1; } return (dwDevID == 0xFFFFFFFF) ? 1 : 0; } /************************************************************************** - * MCIAVI_drvConfigure [internal] + * MCIAVI_drvConfigure [internal] */ static DWORD MCIAVI_drvConfigure(DWORD dwDevID) { WINE_MCIAVI* wma = (WINE_MCIAVI*)mciGetDriverData(dwDevID); if (wma) { - MessageBoxA(0, "Sample AVI Wine Driver !", "MM-Wine Driver", MB_OK); + MessageBoxA(0, "Sample AVI Wine Driver !", "MM-Wine Driver", MB_OK); return 1; } return 0; } /************************************************************************** - * MCIAVI_mciGetOpenDev [internal] + * MCIAVI_mciGetOpenDev [internal] */ WINE_MCIAVI* MCIAVI_mciGetOpenDev(UINT wDevID) { WINE_MCIAVI* wma = (WINE_MCIAVI*)mciGetDriverData(wDevID); - + if (wma == NULL || wma->nUseCount == 0) { WARN("Invalid wDevID=%u\n", wDevID); return 0; @@ -219,7 +219,7 @@ static void MCIAVI_CleanUp(WINE_MCIAVI* wma) wma->hbmFrame = 0; if (wma->hWnd) DestroyWindow(wma->hWnd); wma->hWnd = 0; - + if (wma->lpWaveFormat) HeapFree(GetProcessHeap(), 0, wma->lpWaveFormat); wma->lpWaveFormat = 0; @@ -235,17 +235,17 @@ static DWORD MCIAVI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa /*************************************************************************** * MCIAVI_mciOpen [internal] */ -static DWORD MCIAVI_mciOpen(UINT wDevID, DWORD dwFlags, +static DWORD MCIAVI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSA lpOpenParms) { WINE_MCIAVI* wma = (WINE_MCIAVI*)mciGetDriverData(wDevID); LRESULT dwRet = 0; - + TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpOpenParms); - + if (lpOpenParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wma->nUseCount > 0) { /* The driver is already open on this channel */ /* If the driver was opened shareable before and this open specifies */ @@ -258,44 +258,44 @@ static DWORD MCIAVI_mciOpen(UINT wDevID, DWORD dwFlags, wma->nUseCount = 1; wma->fShareable = dwFlags & MCI_OPEN_SHAREABLE; } - - wma->dwStatus = MCI_MODE_NOT_READY; + + wma->dwStatus = MCI_MODE_NOT_READY; InitializeCriticalSection(&wma->cs); - + if (dwFlags & MCI_OPEN_ELEMENT) { if (dwFlags & MCI_OPEN_ELEMENT_ID) { - /* could it be that (DWORD)lpOpenParms->lpstrElementName - * contains the hFile value ? + /* could it be that (DWORD)lpOpenParms->lpstrElementName + * contains the hFile value ? */ dwRet = MCIERR_UNRECOGNIZED_COMMAND; } else if (strlen(lpOpenParms->lpstrElementName) > 0) { /* FIXME : what should be done id wma->hFile is already != 0, or the driver is playin' */ TRACE("MCI_OPEN_ELEMENT '%s' !\n", lpOpenParms->lpstrElementName); - + if (lpOpenParms->lpstrElementName && (strlen(lpOpenParms->lpstrElementName) > 0)) { - wma->hFile = mmioOpenA(lpOpenParms->lpstrElementName, NULL, + wma->hFile = mmioOpenA(lpOpenParms->lpstrElementName, NULL, MMIO_ALLOCBUF | MMIO_DENYWRITE | MMIO_READWRITE); - + if (wma->hFile == 0) { WARN("can't find file='%s' !\n", lpOpenParms->lpstrElementName); dwRet = MCIERR_FILE_NOT_FOUND; } else { - if (!MCIAVI_GetInfo(wma)) + if (!MCIAVI_GetInfo(wma)) dwRet = MCIERR_INVALID_FILE; else if (!MCIAVI_OpenVideo(wma)) dwRet = MCIERR_CANNOT_LOAD_DRIVER; else if (!MCIAVI_CreateWindow(wma, dwFlags, lpOpenParms)) dwRet = MCIERR_CREATEWINDOW; - } + } } } else { FIXME("Don't record yet\n"); dwRet = MCIERR_UNSUPPORTED_FUNCTION; } } - + memcpy(&wma->openParms, lpOpenParms, sizeof(MCI_WAVE_OPEN_PARMSA)); - + if (dwRet == 0) { wma->dwStatus = MCI_MODE_STOP; wma->dwMciTimeFormat = MCI_FORMAT_FRAMES; @@ -303,7 +303,7 @@ static DWORD MCIAVI_mciOpen(UINT wDevID, DWORD dwFlags, MCIAVI_CleanUp(wma); } return dwRet; - + } /*************************************************************************** @@ -313,18 +313,18 @@ static DWORD MCIAVI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); DWORD dwRet = 0; - - TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpParms); - + + TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpParms); + if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wma->nUseCount == 1) { if (wma->dwStatus != MCI_MODE_STOP) dwRet = MCIAVI_mciStop(wDevID, MCI_WAIT, lpParms); MCIAVI_CleanUp(wma); - + if ((dwFlags & MCI_NOTIFY) && lpParms) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wma->openParms.wDeviceID, MCI_NOTIFY_SUCCESSFUL); } @@ -350,27 +350,27 @@ static DWORD MCIAVI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms DWORD dwFromFrame, dwToFrame; TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (!wma->hFile) return MCIERR_FILE_NOT_FOUND; if (!wma->hWnd) return MCIERR_NO_WINDOW; - + wma->dwStatus = MCI_MODE_PLAY; - + if (!(dwFlags & MCI_WAIT)) { - return MCI_SendCommandAsync(wma->openParms.wDeviceID, MCI_PLAY, dwFlags, + return MCI_SendCommandAsync(wma->openParms.wDeviceID, MCI_PLAY, dwFlags, (DWORD)lpParms, sizeof(MCI_PLAY_PARMS)); } - + ShowWindow(wma->hWnd, SW_SHOW); - + dwFromFrame = wma->dwCurrVideoFrame; dwToFrame = wma->dwPlayableVideoFrames - 1; - + if (lpParms && (dwFlags & MCI_FROM)) { - dwFromFrame = MCIAVI_ConvertTimeFormatToFrame(wma, lpParms->dwFrom); + dwFromFrame = MCIAVI_ConvertTimeFormatToFrame(wma, lpParms->dwFrom); } if (lpParms && (dwFlags & MCI_TO)) { dwToFrame = MCIAVI_ConvertTimeFormatToFrame(wma, lpParms->dwTo); @@ -379,14 +379,14 @@ static DWORD MCIAVI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms dwToFrame = wma->dwPlayableVideoFrames - 1; TRACE("Playing from frame=%lu to frame=%lu\n", dwFromFrame, dwToFrame); - + if (dwToFrame <= wma->dwCurrVideoFrame) return TRUE; wma->dwCurrVideoFrame = dwFromFrame; if (dwFlags & (MCI_DGV_PLAY_REPEAT|MCI_DGV_PLAY_REVERSE|MCI_MCIAVI_PLAY_WINDOW|MCI_MCIAVI_PLAY_FULLSCREEN)) FIXME("Unsupported flag %08lx\n", dwFlags); - + /* time is in microseconds, we should convert it to milliseconds */ frameTime = (wma->mah.dwMicroSecPerFrame + 500) / 1000; @@ -399,7 +399,7 @@ static DWORD MCIAVI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms while (wma->dwStatus != MCI_MODE_STOP && wma->dwStatus != MCI_MODE_NOT_READY) { tc = GetTickCount(); - + MCIAVI_DrawFrame(wma); if (wma->lpWaveFormat) { @@ -422,7 +422,7 @@ static DWORD MCIAVI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms while (*(volatile DWORD*)&wma->dwEventCount != nHdr - 1) { Sleep(100); } - + /* just to get rid of some race conditions between play, stop and pause */ waveOutReset(wma->hWave); @@ -447,9 +447,9 @@ cleanUp: mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wma->openParms.wDeviceID, MCI_NOTIFY_SUCCESSFUL); } - + wma->dwStatus = MCI_MODE_STOP; - + return dwRet; } @@ -459,12 +459,12 @@ cleanUp: static DWORD MCIAVI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECORD_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + wma->dwStatus = MCI_MODE_RECORD; return 0; } @@ -478,10 +478,10 @@ static DWORD MCIAVI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa DWORD dwRet = 0; TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + switch (wma->dwStatus) { case MCI_MODE_PAUSE: case MCI_MODE_PLAY: @@ -499,12 +499,12 @@ static DWORD MCIAVI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa wma->dwStatus = MCI_MODE_STOP; break; } - + if ((dwFlags & MCI_NOTIFY) && lpParms) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wma->openParms.wDeviceID, MCI_NOTIFY_SUCCESSFUL); } - + return dwRet; } @@ -514,10 +514,10 @@ static DWORD MCIAVI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa static DWORD MCIAVI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wma->dwStatus == MCI_MODE_PLAY) wma->dwStatus = MCI_MODE_PAUSE; @@ -530,12 +530,12 @@ static DWORD MCIAVI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP static DWORD MCIAVI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wma->dwStatus == MCI_MODE_PAUSE) wma->dwStatus = MCI_MODE_PLAY; @@ -548,16 +548,16 @@ static DWORD MCIAVI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lp static DWORD MCIAVI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + EnterCriticalSection(&wma->cs); - + MCIAVI_mciStop(wDevID, MCI_WAIT, 0); - + if (dwFlags & MCI_SEEK_TO_START) { wma->dwCurrVideoFrame = 0; } else if (dwFlags & MCI_SEEK_TO_END) { @@ -568,11 +568,11 @@ static DWORD MCIAVI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms WARN("dwFlag doesn't tell where to seek to...\n"); return MCIERR_MISSING_PARAMETER; } - + TRACE("Seeking to frame=%lu bytes\n", wma->dwCurrVideoFrame); - + if (dwFlags & MCI_NOTIFY) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wma->openParms.wDeviceID, MCI_NOTIFY_SUCCESSFUL); } @@ -587,12 +587,12 @@ static DWORD MCIAVI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms static DWORD MCIAVI_mciLoad(UINT wDevID, DWORD dwFlags, LPMCI_DGV_LOAD_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -602,12 +602,12 @@ static DWORD MCIAVI_mciLoad(UINT wDevID, DWORD dwFlags, LPMCI_DGV_LOAD_PARMSA lp static DWORD MCIAVI_mciSave(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SAVE_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -617,12 +617,12 @@ static DWORD MCIAVI_mciSave(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SAVE_PARMSA lp static DWORD MCIAVI_mciFreeze(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -632,12 +632,12 @@ static DWORD MCIAVI_mciFreeze(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS l static DWORD MCIAVI_mciRealize(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -647,12 +647,12 @@ static DWORD MCIAVI_mciRealize(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS l static DWORD MCIAVI_mciUnFreeze(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -664,10 +664,10 @@ static DWORD MCIAVI_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -677,12 +677,12 @@ static DWORD MCIAVI_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS static DWORD MCIAVI_mciStep(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STEP_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -692,12 +692,12 @@ static DWORD MCIAVI_mciStep(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STEP_PARMS lpP static DWORD MCIAVI_mciCopy(UINT wDevID, DWORD dwFlags, LPMCI_DGV_COPY_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -707,12 +707,12 @@ static DWORD MCIAVI_mciCopy(UINT wDevID, DWORD dwFlags, LPMCI_DGV_COPY_PARMS lpP static DWORD MCIAVI_mciCut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CUT_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -722,12 +722,12 @@ static DWORD MCIAVI_mciCut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CUT_PARMS lpPar static DWORD MCIAVI_mciDelete(UINT wDevID, DWORD dwFlags, LPMCI_DGV_DELETE_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -737,12 +737,12 @@ static DWORD MCIAVI_mciDelete(UINT wDevID, DWORD dwFlags, LPMCI_DGV_DELETE_PARMS static DWORD MCIAVI_mciPaste(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PASTE_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -752,12 +752,12 @@ static DWORD MCIAVI_mciPaste(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PASTE_PARMS l static DWORD MCIAVI_mciCue(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CUE_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -767,12 +767,12 @@ static DWORD MCIAVI_mciCue(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CUE_PARMS lpPar static DWORD MCIAVI_mciCapture(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CAPTURE_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -782,12 +782,12 @@ static DWORD MCIAVI_mciCapture(UINT wDevID, DWORD dwFlags, LPMCI_DGV_CAPTURE_PAR static DWORD MCIAVI_mciMonitor(UINT wDevID, DWORD dwFlags, LPMCI_DGV_MONITOR_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -797,12 +797,12 @@ static DWORD MCIAVI_mciMonitor(UINT wDevID, DWORD dwFlags, LPMCI_DGV_MONITOR_PAR static DWORD MCIAVI_mciReserve(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RESERVE_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -812,12 +812,12 @@ static DWORD MCIAVI_mciReserve(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RESERVE_PAR static DWORD MCIAVI_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -827,12 +827,12 @@ static DWORD MCIAVI_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_P static DWORD MCIAVI_mciSignal(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SIGNAL_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -842,12 +842,12 @@ static DWORD MCIAVI_mciSignal(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SIGNAL_PARMS static DWORD MCIAVI_mciSetVideo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETVIDEO_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -857,12 +857,12 @@ static DWORD MCIAVI_mciSetVideo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETVIDEO_P static DWORD MCIAVI_mciQuality(UINT wDevID, DWORD dwFlags, LPMCI_DGV_QUALITY_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -872,12 +872,12 @@ static DWORD MCIAVI_mciQuality(UINT wDevID, DWORD dwFlags, LPMCI_DGV_QUALITY_PAR static DWORD MCIAVI_mciList(UINT wDevID, DWORD dwFlags, LPMCI_DGV_LIST_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -887,12 +887,12 @@ static DWORD MCIAVI_mciList(UINT wDevID, DWORD dwFlags, LPMCI_DGV_LIST_PARMSA lp static DWORD MCIAVI_mciUndo(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -902,12 +902,12 @@ static DWORD MCIAVI_mciUndo(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa static DWORD MCIAVI_mciConfigure(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -917,12 +917,12 @@ static DWORD MCIAVI_mciConfigure(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS static DWORD MCIAVI_mciRestore(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RESTORE_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + FIXME("(%04x, %08lx, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + return 0; } @@ -933,12 +933,12 @@ static DWORD MCIAVI_mciRestore(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RESTORE_PAR /************************************************************************** * DriverProc (MCIAVI.@) */ -LONG CALLBACK MCIAVI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK MCIAVI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { - TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", + TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", dwDevID, hDriv, wMsg, dwParam1, dwParam2); - + switch (wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; @@ -951,7 +951,7 @@ LONG CALLBACK MCIAVI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case DRV_INSTALL: return DRVCNF_RESTART; case DRV_REMOVE: return DRVCNF_RESTART; } - + if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION; switch (wMsg) { @@ -967,22 +967,22 @@ LONG CALLBACK MCIAVI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case MCI_GETDEVCAPS: return MCIAVI_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS) dwParam2); case MCI_INFO: return MCIAVI_mciInfo (dwDevID, dwParam1, (LPMCI_DGV_INFO_PARMSA) dwParam2); case MCI_SEEK: return MCIAVI_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2); - case MCI_PUT: return MCIAVI_mciPut (dwDevID, dwParam1, (LPMCI_DGV_PUT_PARMS) dwParam2); - case MCI_WINDOW: return MCIAVI_mciWindow (dwDevID, dwParam1, (LPMCI_DGV_WINDOW_PARMSA) dwParam2); - case MCI_LOAD: return MCIAVI_mciLoad (dwDevID, dwParam1, (LPMCI_DGV_LOAD_PARMSA) dwParam2); - case MCI_SAVE: return MCIAVI_mciSave (dwDevID, dwParam1, (LPMCI_DGV_SAVE_PARMSA) dwParam2); + case MCI_PUT: return MCIAVI_mciPut (dwDevID, dwParam1, (LPMCI_DGV_PUT_PARMS) dwParam2); + case MCI_WINDOW: return MCIAVI_mciWindow (dwDevID, dwParam1, (LPMCI_DGV_WINDOW_PARMSA) dwParam2); + case MCI_LOAD: return MCIAVI_mciLoad (dwDevID, dwParam1, (LPMCI_DGV_LOAD_PARMSA) dwParam2); + case MCI_SAVE: return MCIAVI_mciSave (dwDevID, dwParam1, (LPMCI_DGV_SAVE_PARMSA) dwParam2); case MCI_FREEZE: return MCIAVI_mciFreeze (dwDevID, dwParam1, (LPMCI_DGV_RECT_PARMS) dwParam2); case MCI_REALIZE: return MCIAVI_mciRealize (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_UNFREEZE: return MCIAVI_mciUnFreeze (dwDevID, dwParam1, (LPMCI_DGV_RECT_PARMS) dwParam2); case MCI_UPDATE: return MCIAVI_mciUpdate (dwDevID, dwParam1, (LPMCI_DGV_UPDATE_PARMS) dwParam2); case MCI_WHERE: return MCIAVI_mciWhere (dwDevID, dwParam1, (LPMCI_DGV_RECT_PARMS) dwParam2); case MCI_STEP: return MCIAVI_mciStep (dwDevID, dwParam1, (LPMCI_DGV_STEP_PARMS) dwParam2); - case MCI_COPY: return MCIAVI_mciCopy (dwDevID, dwParam1, (LPMCI_DGV_COPY_PARMS) dwParam2); - case MCI_CUT: return MCIAVI_mciCut (dwDevID, dwParam1, (LPMCI_DGV_CUT_PARMS) dwParam2); - case MCI_DELETE: return MCIAVI_mciDelete (dwDevID, dwParam1, (LPMCI_DGV_DELETE_PARMS) dwParam2); - case MCI_PASTE: return MCIAVI_mciPaste (dwDevID, dwParam1, (LPMCI_DGV_PASTE_PARMS) dwParam2); + case MCI_COPY: return MCIAVI_mciCopy (dwDevID, dwParam1, (LPMCI_DGV_COPY_PARMS) dwParam2); + case MCI_CUT: return MCIAVI_mciCut (dwDevID, dwParam1, (LPMCI_DGV_CUT_PARMS) dwParam2); + case MCI_DELETE: return MCIAVI_mciDelete (dwDevID, dwParam1, (LPMCI_DGV_DELETE_PARMS) dwParam2); + case MCI_PASTE: return MCIAVI_mciPaste (dwDevID, dwParam1, (LPMCI_DGV_PASTE_PARMS) dwParam2); case MCI_CUE: return MCIAVI_mciCue (dwDevID, dwParam1, (LPMCI_DGV_CUE_PARMS) dwParam2); - /* Digital Video specific */ + /* Digital Video specific */ case MCI_CAPTURE: return MCIAVI_mciCapture (dwDevID, dwParam1, (LPMCI_DGV_CAPTURE_PARMSA) dwParam2); case MCI_MONITOR: return MCIAVI_mciMonitor (dwDevID, dwParam1, (LPMCI_DGV_MONITOR_PARMS) dwParam2); case MCI_RESERVE: return MCIAVI_mciReserve (dwDevID, dwParam1, (LPMCI_DGV_RESERVE_PARMSA) dwParam2); @@ -994,20 +994,20 @@ LONG CALLBACK MCIAVI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case MCI_UNDO: return MCIAVI_mciUndo (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_CONFIGURE: return MCIAVI_mciConfigure (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_RESTORE: return MCIAVI_mciRestore (dwDevID, dwParam1, (LPMCI_DGV_RESTORE_PARMSA) dwParam2); - + case MCI_SPIN: - case MCI_ESCAPE: + case MCI_ESCAPE: WARN("Unsupported command [%lu]\n", wMsg); break; case MCI_OPEN: case MCI_CLOSE: FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n"); break; - default: + default: TRACE("Sending msg [%lu] to default driver proc\n", wMsg); return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); } return MCIERR_UNRECOGNIZED_COMMAND; } - + diff --git a/dlls/winmm/mciavi/mmoutput.c b/dlls/winmm/mciavi/mmoutput.c index 9b4ea34cf3d..1408f1437c8 100644 --- a/dlls/winmm/mciavi/mmoutput.c +++ b/dlls/winmm/mciavi/mmoutput.c @@ -28,22 +28,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(mciavi); static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI* wma, const MMCKINFO* mmckList) { MMCKINFO mmckInfo; - + mmckInfo.ckid = ckidSTREAMHEADER; if (mmioDescend(wma->hFile, &mmckInfo, mmckList, MMIO_FINDCHUNK) != 0) { WARN("Can't find 'strh' chunk\n"); return FALSE; } - + mmioRead(wma->hFile, (LPSTR)&wma->ash_audio, sizeof(wma->ash_audio)); - - TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_audio.fccType)), - HIBYTE(LOWORD(wma->ash_audio.fccType)), - LOBYTE(HIWORD(wma->ash_audio.fccType)), + + TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_audio.fccType)), + HIBYTE(LOWORD(wma->ash_audio.fccType)), + LOBYTE(HIWORD(wma->ash_audio.fccType)), HIBYTE(HIWORD(wma->ash_audio.fccType))); - TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_audio.fccHandler)), - HIBYTE(LOWORD(wma->ash_audio.fccHandler)), - LOBYTE(HIWORD(wma->ash_audio.fccHandler)), + TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_audio.fccHandler)), + HIBYTE(LOWORD(wma->ash_audio.fccHandler)), + LOBYTE(HIWORD(wma->ash_audio.fccHandler)), HIBYTE(HIWORD(wma->ash_audio.fccHandler))); TRACE("ash.dwFlags=%ld\n", wma->ash_audio.dwFlags); TRACE("ash.wPriority=%d\n", wma->ash_audio.wPriority); @@ -56,11 +56,11 @@ static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI* wma, const MMCKINFO* mmckList) TRACE("ash.dwSuggestedBufferSize=%ld\n", wma->ash_audio.dwSuggestedBufferSize); TRACE("ash.dwQuality=%ld\n", wma->ash_audio.dwQuality); TRACE("ash.dwSampleSize=%ld\n", wma->ash_audio.dwSampleSize); - TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", wma->ash_audio.rcFrame.top, wma->ash_audio.rcFrame.left, + TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", wma->ash_audio.rcFrame.top, wma->ash_audio.rcFrame.left, wma->ash_audio.rcFrame.bottom, wma->ash_audio.rcFrame.right); - + mmioAscend(wma->hFile, &mmckInfo, 0); - + mmckInfo.ckid = ckidSTREAMFORMAT; if (mmioDescend(wma->hFile, &mmckInfo, mmckList, MMIO_FINDCHUNK) != 0) { WARN("Can't find 'strh' chunk\n"); @@ -75,9 +75,9 @@ static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI* wma, const MMCKINFO* mmckList) WARN("Can't alloc WaveFormat\n"); return FALSE; } - + mmioRead(wma->hFile, (LPSTR)wma->lpWaveFormat, mmckInfo.cksize); - + TRACE("waveFormat.wFormatTag=%d\n", wma->lpWaveFormat->wFormatTag); TRACE("waveFormat.nChannels=%d\n", wma->lpWaveFormat->nChannels); TRACE("waveFormat.nSamplesPerSec=%ld\n", wma->lpWaveFormat->nSamplesPerSec); @@ -86,31 +86,31 @@ static BOOL MCIAVI_GetInfoAudio(WINE_MCIAVI* wma, const MMCKINFO* mmckList) TRACE("waveFormat.wBitsPerSample=%d\n", wma->lpWaveFormat->wBitsPerSample); if (mmckInfo.cksize >= sizeof(WAVEFORMATEX)) TRACE("waveFormat.cbSize=%d\n", wma->lpWaveFormat->cbSize); - + mmioAscend(wma->hFile, &mmckInfo, 0); - + return TRUE; } static BOOL MCIAVI_GetInfoVideo(WINE_MCIAVI* wma, const MMCKINFO* mmckList) { MMCKINFO mmckInfo; - + mmckInfo.ckid = ckidSTREAMHEADER; if (mmioDescend(wma->hFile, &mmckInfo, mmckList, MMIO_FINDCHUNK) != 0) { WARN("Can't find 'strh' chunk\n"); return FALSE; } - + mmioRead(wma->hFile, (LPSTR)&wma->ash_video, sizeof(wma->ash_video)); - - TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_video.fccType)), - HIBYTE(LOWORD(wma->ash_video.fccType)), - LOBYTE(HIWORD(wma->ash_video.fccType)), + + TRACE("ash.fccType='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_video.fccType)), + HIBYTE(LOWORD(wma->ash_video.fccType)), + LOBYTE(HIWORD(wma->ash_video.fccType)), HIBYTE(HIWORD(wma->ash_video.fccType))); - TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_video.fccHandler)), - HIBYTE(LOWORD(wma->ash_video.fccHandler)), - LOBYTE(HIWORD(wma->ash_video.fccHandler)), + TRACE("ash.fccHandler='%c%c%c%c'\n", LOBYTE(LOWORD(wma->ash_video.fccHandler)), + HIBYTE(LOWORD(wma->ash_video.fccHandler)), + LOBYTE(HIWORD(wma->ash_video.fccHandler)), HIBYTE(HIWORD(wma->ash_video.fccHandler))); TRACE("ash.dwFlags=%ld\n", wma->ash_video.dwFlags); TRACE("ash.wPriority=%d\n", wma->ash_video.wPriority); @@ -123,25 +123,25 @@ static BOOL MCIAVI_GetInfoVideo(WINE_MCIAVI* wma, const MMCKINFO* mmckList) TRACE("ash.dwSuggestedBufferSize=%ld\n", wma->ash_video.dwSuggestedBufferSize); TRACE("ash.dwQuality=%ld\n", wma->ash_video.dwQuality); TRACE("ash.dwSampleSize=%ld\n", wma->ash_video.dwSampleSize); - TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", wma->ash_video.rcFrame.top, wma->ash_video.rcFrame.left, + TRACE("ash.rcFrame=(%d,%d,%d,%d)\n", wma->ash_video.rcFrame.top, wma->ash_video.rcFrame.left, wma->ash_video.rcFrame.bottom, wma->ash_video.rcFrame.right); - + mmioAscend(wma->hFile, &mmckInfo, 0); - + mmckInfo.ckid = ckidSTREAMFORMAT; if (mmioDescend(wma->hFile, &mmckInfo, mmckList, MMIO_FINDCHUNK) != 0) { WARN("Can't find 'strh' chunk\n"); return FALSE; } - + wma->inbih = HeapAlloc(GetProcessHeap(), 0, mmckInfo.cksize); if (!wma->inbih) { WARN("Can't alloc input BIH\n"); return FALSE; } - + mmioRead(wma->hFile, (LPSTR)wma->inbih, mmckInfo.cksize); - + TRACE("bih.biSize=%ld\n", wma->inbih->biSize); TRACE("bih.biWidth=%ld\n", wma->inbih->biWidth); TRACE("bih.biHeight=%ld\n", wma->inbih->biHeight); @@ -153,9 +153,9 @@ static BOOL MCIAVI_GetInfoVideo(WINE_MCIAVI* wma, const MMCKINFO* mmckList) TRACE("bih.biYPelsPerMeter=%ld\n", wma->inbih->biYPelsPerMeter); TRACE("bih.biClrUsed=%ld\n", wma->inbih->biClrUsed); TRACE("bih.biClrImportant=%ld\n", wma->inbih->biClrImportant); - + mmioAscend(wma->hFile, &mmckInfo, 0); - + return TRUE; } @@ -167,16 +167,16 @@ struct AviListBuild { DWORD inAudioSize; }; -static BOOL MCIAVI_AddFrame(WINE_MCIAVI* wma, LPMMCKINFO mmck, +static BOOL MCIAVI_AddFrame(WINE_MCIAVI* wma, LPMMCKINFO mmck, struct AviListBuild* alb) { if (mmck->ckid == ckidAVIPADDING) return TRUE; - + switch (TWOCCFromFOURCC(mmck->ckid)) { case cktypeDIBbits: case cktypeDIBcompressed: case cktypePALchange: - TRACE("Adding video frame[%ld]: %ld bytes\n", + TRACE("Adding video frame[%ld]: %ld bytes\n", alb->numVideoFrames, mmck->cksize); if (alb->numVideoFrames < wma->dwPlayableVideoFrames) { wma->lpVideoIndex[alb->numVideoFrames].dwOffset = mmck->dwDataOffset; @@ -189,13 +189,13 @@ static BOOL MCIAVI_AddFrame(WINE_MCIAVI* wma, LPMMCKINFO mmck, } break; case cktypeWAVEbytes: - TRACE("Adding audio frame[%ld]: %ld bytes\n", + TRACE("Adding audio frame[%ld]: %ld bytes\n", alb->numAudioBlocks, mmck->cksize); if (wma->lpWaveFormat) { if (alb->numAudioBlocks >= alb->numAudioAllocated) { alb->numAudioAllocated += 32; - wma->lpAudioIndex = HeapReAlloc(GetProcessHeap(), 0, - wma->lpAudioIndex, + wma->lpAudioIndex = HeapReAlloc(GetProcessHeap(), 0, + wma->lpAudioIndex, alb->numAudioAllocated * sizeof(struct MMIOPos)); if (!wma->lpAudioIndex) return FALSE; } @@ -222,31 +222,31 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) MMCKINFO mmckList; MMCKINFO mmckInfo; struct AviListBuild alb; - + if (mmioDescend(wma->hFile, &ckMainRIFF, NULL, 0) != 0) { WARN("Can't find 'RIFF' chunk\n"); return FALSE; } - + if ((ckMainRIFF.ckid != FOURCC_RIFF) || (ckMainRIFF.fccType != formtypeAVI)) { WARN("Can't find 'AVI ' chunk\n"); return FALSE; } - + mmckHead.fccType = listtypeAVIHEADER; if (mmioDescend(wma->hFile, &mmckHead, &ckMainRIFF, MMIO_FINDLIST) != 0) { WARN("Can't find 'hdrl' list\n"); return FALSE; } - + mmckInfo.ckid = ckidAVIMAINHDR; if (mmioDescend(wma->hFile, &mmckInfo, &mmckHead, MMIO_FINDCHUNK) != 0) { WARN("Can't find 'avih' chunk\n"); return FALSE; } - + mmioRead(wma->hFile, (LPSTR)&wma->mah, sizeof(wma->mah)); - + TRACE("mah.dwMicroSecPerFrame=%ld\n", wma->mah.dwMicroSecPerFrame); TRACE("mah.dwMaxBytesPerSec=%ld\n", wma->mah.dwMaxBytesPerSec); TRACE("mah.dwPaddingGranularity=%ld\n", wma->mah.dwPaddingGranularity); @@ -257,21 +257,21 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) TRACE("mah.dwSuggestedBufferSize=%ld\n", wma->mah.dwSuggestedBufferSize); TRACE("mah.dwWidth=%ld\n", wma->mah.dwWidth); TRACE("mah.dwHeight=%ld\n", wma->mah.dwHeight); - + mmioAscend(wma->hFile, &mmckInfo, 0); - + mmckList.fccType = listtypeSTREAMHEADER; if (mmioDescend(wma->hFile, &mmckList, &mmckHead, MMIO_FINDLIST) != 0) { WARN("Can't find 'strl' list\n"); return FALSE; } - + if (!MCIAVI_GetInfoVideo(wma, &mmckList)) { return FALSE; } - + mmioAscend(wma->hFile, &mmckList, 0); - + mmckList.fccType = listtypeSTREAMHEADER; if (mmioDescend(wma->hFile, &mmckList, &mmckHead, MMIO_FINDLIST) == 0) { if (!MCIAVI_GetInfoAudio(wma, &mmckList)) { @@ -279,40 +279,40 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) } mmioAscend(wma->hFile, &mmckList, 0); } - + mmioAscend(wma->hFile, &mmckHead, 0); - + /* no need to read optional JUNK chunk */ - + mmckList.fccType = listtypeAVIMOVIE; if (mmioDescend(wma->hFile, &mmckList, &ckMainRIFF, MMIO_FINDLIST) != 0) { WARN("Can't find 'movi' list\n"); return FALSE; } - + wma->dwPlayableVideoFrames = wma->mah.dwTotalFrames; - wma->lpVideoIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + wma->lpVideoIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, wma->dwPlayableVideoFrames * sizeof(struct MMIOPos)); if (!wma->lpVideoIndex) { WARN("Can't alloc video index array\n"); return FALSE; } wma->dwPlayableAudioBlocks = 0; - wma->lpAudioIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + wma->lpAudioIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, wma->dwPlayableVideoFrames * sizeof(struct MMIOPos)); if (!wma->lpAudioIndex) { WARN("Can't alloc audio index array\n"); return FALSE; } - + alb.numAudioBlocks = alb.numVideoFrames = 0; alb.inVideoSize = alb.inAudioSize = 0; alb.numAudioAllocated = 0; - + while (mmioDescend(wma->hFile, &mmckInfo, &mmckList, 0) == 0) { - if (mmckInfo.fccType == listtypeAVIRECORD) { + if (mmckInfo.fccType == listtypeAVIRECORD) { MMCKINFO tmp; - + while (mmioDescend(wma->hFile, &tmp, &mmckInfo, 0) == 0) { MCIAVI_AddFrame(wma, &tmp, &alb); mmioAscend(wma->hFile, &tmp, 0); @@ -320,16 +320,16 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) } else { MCIAVI_AddFrame(wma, &mmckInfo, &alb); } - + mmioAscend(wma->hFile, &mmckInfo, 0); } if (alb.numVideoFrames != wma->dwPlayableVideoFrames) { - WARN("Found %ld video frames (/%ld), reducing playable frames\n", + WARN("Found %ld video frames (/%ld), reducing playable frames\n", alb.numVideoFrames, wma->dwPlayableVideoFrames); wma->dwPlayableVideoFrames = alb.numVideoFrames; } wma->dwPlayableAudioBlocks = alb.numAudioBlocks; - + if (alb.inVideoSize > wma->ash_video.dwSuggestedBufferSize) { WARN("inVideoSize=%ld suggestedSize=%ld\n", alb.inVideoSize, wma->ash_video.dwSuggestedBufferSize); wma->ash_video.dwSuggestedBufferSize = alb.inVideoSize; @@ -338,13 +338,13 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) WARN("inAudioSize=%ld suggestedSize=%ld\n", alb.inAudioSize, wma->ash_audio.dwSuggestedBufferSize); wma->ash_audio.dwSuggestedBufferSize = alb.inAudioSize; } - + wma->indata = HeapAlloc(GetProcessHeap(), 0, wma->ash_video.dwSuggestedBufferSize); if (!wma->indata) { WARN("Can't alloc input buffer\n"); return FALSE; } - + return TRUE; } @@ -352,28 +352,28 @@ BOOL MCIAVI_OpenVideo(WINE_MCIAVI* wma) { DWORD outSize; FOURCC fcc = wma->ash_video.fccHandler; - + /* check uncompressed AVI */ - if ((fcc == mmioFOURCC('D','I','B',' ')) || + if ((fcc == mmioFOURCC('D','I','B',' ')) || (fcc == mmioFOURCC('R','L','E',' '))) { - wma->hic = 0; + wma->hic = 0; MCIAVI_DrawFrame(wma); return TRUE; } - + /* get the right handle */ if (fcc == 0) fcc = wma->inbih->biCompression; if (fcc == mmioFOURCC('C','R','A','M')) fcc = mmioFOURCC('M','S','V','C'); - + /* try to get a decompressor for that type */ wma->hic = ICLocate(ICTYPE_VIDEO, fcc, wma->inbih, NULL, ICMODE_DECOMPRESS); if (!wma->hic) { WARN("Can't locate codec for the file\n"); return FALSE; } - + outSize = sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD); - + wma->outbih = HeapAlloc(GetProcessHeap(), 0, outSize); if (!wma->outbih) { WARN("Can't alloc output BIH\n"); @@ -383,7 +383,7 @@ BOOL MCIAVI_OpenVideo(WINE_MCIAVI* wma) WARN("Can't open decompressor\n"); return FALSE; } - + TRACE("bih.biSize=%ld\n", wma->outbih->biSize); TRACE("bih.biWidth=%ld\n", wma->outbih->biWidth); TRACE("bih.biHeight=%ld\n", wma->outbih->biHeight); @@ -395,29 +395,29 @@ BOOL MCIAVI_OpenVideo(WINE_MCIAVI* wma) TRACE("bih.biYPelsPerMeter=%ld\n", wma->outbih->biYPelsPerMeter); TRACE("bih.biClrUsed=%ld\n", wma->outbih->biClrUsed); TRACE("bih.biClrImportant=%ld\n", wma->outbih->biClrImportant); - + wma->outdata = HeapAlloc(GetProcessHeap(), 0, wma->outbih->biSizeImage); if (!wma->outdata) { WARN("Can't alloc output buffer\n"); return FALSE; } - - if (ICSendMessage(wma->hic, ICM_DECOMPRESS_BEGIN, + + if (ICSendMessage(wma->hic, ICM_DECOMPRESS_BEGIN, (DWORD)wma->inbih, (DWORD)wma->outbih) != ICERR_OK) { WARN("Can't begin decompression\n"); return FALSE; } - + MCIAVI_DrawFrame(wma); - + return TRUE; } -static void CALLBACK MCIAVI_waveCallback(HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, +static void CALLBACK MCIAVI_waveCallback(HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { WINE_MCIAVI* wma = (WINE_MCIAVI*)dwInstance; - + switch (uMsg) { case WOM_OPEN: case WOM_CLOSE: @@ -437,8 +437,8 @@ DWORD MCIAVI_OpenAudio(WINE_MCIAVI* wma, unsigned* nHdr, LPWAVEHDR* pWaveHdr) DWORD dwRet; LPWAVEHDR waveHdr; unsigned i; - - dwRet = waveOutOpen(&wma->hWave, WAVE_MAPPER, wma->lpWaveFormat, + + dwRet = waveOutOpen(&wma->hWave, WAVE_MAPPER, wma->lpWaveFormat, (DWORD)MCIAVI_waveCallback, (DWORD)wma, CALLBACK_FUNCTION); if (dwRet != 0) { TRACE("Can't open low level audio device %ld\n", dwRet); @@ -446,22 +446,22 @@ DWORD MCIAVI_OpenAudio(WINE_MCIAVI* wma, unsigned* nHdr, LPWAVEHDR* pWaveHdr) wma->hWave = 0; goto cleanUp; } - + /* FIXME: should set up a heuristic to compute the number of wave headers * to be used... */ *nHdr = 7; - waveHdr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + waveHdr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *nHdr * (sizeof(WAVEHDR) + wma->ash_audio.dwSuggestedBufferSize)); if (!waveHdr) { TRACE("Can't alloc wave headers\n"); dwRet = MCIERR_DEVICE_OPEN; goto cleanUp; } - + for (i = 0; i < *nHdr; i++) { /* other fields are zero:ed on allocation */ - waveHdr[i].lpData = (char*)waveHdr + + waveHdr[i].lpData = (char*)waveHdr + *nHdr * sizeof(WAVEHDR) + i * wma->ash_audio.dwSuggestedBufferSize; waveHdr[i].dwBufferLength = wma->ash_audio.dwSuggestedBufferSize; if (waveOutPrepareHeader(wma->hWave, &waveHdr[i], sizeof(WAVEHDR))) { @@ -469,36 +469,36 @@ DWORD MCIAVI_OpenAudio(WINE_MCIAVI* wma, unsigned* nHdr, LPWAVEHDR* pWaveHdr) goto cleanUp; } } - + if (wma->dwCurrVideoFrame != 0 && wma->lpWaveFormat) { FIXME("Should recompute dwCurrAudioBlock, except unsynchronized sound & video\n"); } wma->dwCurrAudioBlock = 0; - + wma->hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); wma->dwEventCount = *nHdr - 1; *pWaveHdr = waveHdr; cleanUp: return dwRet; -} +} void MCIAVI_PlayAudioBlocks(WINE_MCIAVI* wma, unsigned nHdr, LPWAVEHDR waveHdr) { TRACE("%ld (ec=%lu)\n", wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset, wma->dwEventCount); - + /* push as many blocks as possible => audio gets priority */ - while (wma->dwStatus != MCI_MODE_STOP && wma->dwStatus != MCI_MODE_NOT_READY && + while (wma->dwStatus != MCI_MODE_STOP && wma->dwStatus != MCI_MODE_NOT_READY && wma->dwCurrAudioBlock < wma->dwPlayableAudioBlocks) { unsigned whidx = wma->dwCurrAudioBlock % nHdr; - + ResetEvent(wma->hEvent); if (InterlockedDecrement(&wma->dwEventCount) < 0 || !wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset) break; - + mmioSeek(wma->hFile, wma->lpAudioIndex[wma->dwCurrAudioBlock].dwOffset, SEEK_SET); mmioRead(wma->hFile, waveHdr[whidx].lpData, wma->lpAudioIndex[wma->dwCurrAudioBlock].dwSize); - + waveHdr[whidx].dwFlags &= ~WHDR_DONE; waveHdr[whidx].dwBufferLength = wma->lpAudioIndex[wma->dwCurrAudioBlock].dwSize; waveOutWrite(wma->hWave, &waveHdr[whidx], sizeof(WAVEHDR)); @@ -515,36 +515,36 @@ LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC) HBITMAP hbmOld; int nWidth; int nHeight; - + if (!hDC || !wma->inbih) return TRUE; - + TRACE("Painting frame %lu\n", wma->dwCurrVideoFrame); - + if (wma->hic) { pBitmapData = wma->outdata; pBitmapInfo = (LPBITMAPINFO)wma->outbih; - + nWidth = wma->outbih->biWidth; - nHeight = wma->outbih->biHeight; - } else { + nHeight = wma->outbih->biHeight; + } else { pBitmapData = wma->indata; pBitmapInfo = (LPBITMAPINFO)wma->inbih; - + nWidth = wma->inbih->biWidth; - nHeight = wma->inbih->biHeight; - } - - if (!wma->hbmFrame) + nHeight = wma->inbih->biHeight; + } + + if (!wma->hbmFrame) wma->hbmFrame = CreateCompatibleBitmap(hDC, nWidth, nHeight); - - SetDIBits(hDC, wma->hbmFrame, 0, nHeight, pBitmapData, pBitmapInfo, DIB_RGB_COLORS); - + + SetDIBits(hDC, wma->hbmFrame, 0, nHeight, pBitmapData, pBitmapInfo, DIB_RGB_COLORS); + hdcMem = CreateCompatibleDC(hDC); hbmOld = SelectObject(hdcMem, wma->hbmFrame); - - BitBlt(hDC, 0, 0, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY); - + + BitBlt(hDC, 0, 0, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY); + SelectObject(hdcMem, hbmOld); DeleteDC(hdcMem); return TRUE; @@ -553,35 +553,35 @@ LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC) LRESULT MCIAVI_DrawFrame(WINE_MCIAVI* wma) { HDC hDC; - + TRACE("Drawing frame %lu\n", wma->dwCurrVideoFrame); - + if (!wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset) return FALSE; - + EnterCriticalSection(&wma->cs); - + mmioSeek(wma->hFile, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset, SEEK_SET); mmioRead(wma->hFile, wma->indata, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize); - + /* FIXME ? */ wma->inbih->biSizeImage = wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize; - + if (wma->hic && - ICDecompress(wma->hic, 0, wma->inbih, wma->indata, + ICDecompress(wma->hic, 0, wma->inbih, wma->indata, wma->outbih, wma->outdata) != ICERR_OK) { LeaveCriticalSection(&wma->cs); WARN("Decompression error\n"); return FALSE; } - + if (IsWindowVisible(wma->hWnd) && (hDC = GetDC(wma->hWnd)) != 0) { MCIAVI_PaintFrame(wma, hDC); ReleaseDC(wma->hWnd, hDC); } - + LeaveCriticalSection(&wma->cs); - + return TRUE; } diff --git a/dlls/winmm/mciavi/private_mciavi.h b/dlls/winmm/mciavi/private_mciavi.h index 259c184887a..4c7ebbc84a1 100644 --- a/dlls/winmm/mciavi/private_mciavi.h +++ b/dlls/winmm/mciavi/private_mciavi.h @@ -60,7 +60,7 @@ typedef struct { HIC hic; LPBITMAPINFOHEADER outbih; LPVOID indata; - LPVOID outdata; + LPVOID outdata; HBITMAP hbmFrame; /* data for playing the audio part */ HANDLE hWave; diff --git a/dlls/winmm/mciavi/wnd.c b/dlls/winmm/mciavi/wnd.c index 87c9b27c970..342783428bd 100644 --- a/dlls/winmm/mciavi/wnd.c +++ b/dlls/winmm/mciavi/wnd.c @@ -29,19 +29,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(mciavi); static LRESULT WINAPI MCIAVI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { TRACE("hwnd=%x msg=%x wparam=%x lparam=%lx\n", hWnd, uMsg, wParam, lParam); - + if (!(WINE_MCIAVI*)GetWindowLongA(hWnd, 0) && uMsg != WM_CREATE) return DefWindowProcA(hWnd, uMsg, wParam, lParam); - + switch (uMsg) { case WM_CREATE: SetWindowLongA(hWnd, 0, (LPARAM)((CREATESTRUCTA*)lParam)->lpCreateParams); return DefWindowProcA(hWnd, uMsg, wParam, lParam); - + case WM_DESTROY: SetWindowLongA(hWnd, 0, 0); return DefWindowProcA(hWnd, uMsg, wParam, lParam); - + case WM_ERASEBKGND: { RECT rect; @@ -52,12 +52,12 @@ static LRESULT WINAPI MCIAVI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA case WM_PAINT: { WINE_MCIAVI* wma = (WINE_MCIAVI*)GetWindowLongA(hWnd, 0); - + /* the animation isn't playing, don't paint */ if (wma->dwStatus == MCI_MODE_NOT_READY) /* default paint handling */ return DefWindowProcA(hWnd, uMsg, wParam, lParam); - + if (wParam) { EnterCriticalSection(&wma->cs); MCIAVI_PaintFrame(wma, (HDC)wParam); @@ -65,16 +65,16 @@ static LRESULT WINAPI MCIAVI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA } else { PAINTSTRUCT ps; HDC hDC = BeginPaint(hWnd, &ps); - + EnterCriticalSection(&wma->cs); MCIAVI_PaintFrame(wma, hDC); LeaveCriticalSection(&wma->cs); - + EndPaint(hWnd, &ps); } } break; - + default: return DefWindowProcA(hWnd, uMsg, wParam, lParam); } @@ -90,7 +90,7 @@ BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARM /* what should be done ? */ if (wma->hWnd) return TRUE; - + ZeroMemory(&wndClass, sizeof(WNDCLASSA)); wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS; wndClass.lpfnWndProc = (WNDPROC)MCIAVI_WindowProc; @@ -99,17 +99,17 @@ BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARM wndClass.hCursor = LoadCursorA(0, IDC_ARROWA); wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wndClass.lpszClassName = "MCIAVI"; - + RegisterClassA(&wndClass); if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpOpenParms->hWndParent; if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpOpenParms->dwStyle; if (dwStyle & WS_CHILD) p = 0; - wma->hWnd = CreateWindowA("MCIAVI", "Wine MCI-AVI player", - dwStyle, p, p, - (wma->hic ? wma->outbih : wma->inbih)->biWidth, - (wma->hic ? wma->outbih : wma->inbih)->biHeight, + wma->hWnd = CreateWindowA("MCIAVI", "Wine MCI-AVI player", + dwStyle, p, p, + (wma->hic ? wma->outbih : wma->inbih)->biWidth, + (wma->hic ? wma->outbih : wma->inbih)->biHeight, hParent, 0, MCIAVI_hInstance, wma); return (BOOL)wma->hWnd; } @@ -122,18 +122,18 @@ DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms) WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); RECT rc; char buffer[256]; - + FIXME("(%04x, %08lX, %p) : stub\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_DGV_RECT) { rc = lpParms->rc; } else { SetRectEmpty(&rc); } - + *buffer = 0; if (dwFlags & MCI_DGV_PUT_CLIENT) { strncat(buffer, "PUT_CLIENT", sizeof(buffer)); @@ -154,7 +154,7 @@ DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms) strncat(buffer, "PUT_WINDOW", sizeof(buffer)); } TRACE("%s (%d,%d,%d,%d)\n", buffer, rc.left, rc.top, rc.right, rc.bottom); - + return 0; } @@ -167,10 +167,10 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) LPSTR x = ""; TRACE("(%04x, %08lx, %p)\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_DGV_WHERE_MAX) FIXME("Max NIY\n"); if (dwFlags & MCI_DGV_WHERE_DESTINATION) { @@ -195,7 +195,7 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) x = "Window"; GetClientRect(wma->hWnd, &lpParms->rc); } - TRACE("%s -> (%d,%d,%d,%d)\n", + TRACE("%s -> (%d,%d,%d,%d)\n", x, lpParms->rc.left, lpParms->rc.top, lpParms->rc.right, lpParms->rc.bottom); return 0; @@ -207,12 +207,12 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSA lpParms) { WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID); - + TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_DGV_WINDOW_HWND) { FIXME("Setting hWnd to %08lx\n", (DWORD)lpParms->hWnd); #if 0 @@ -229,7 +229,7 @@ DWORD MCIAVI_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSA lpPar TRACE("Setting caption to '%s'\n", lpParms->lpstrText); SetWindowTextA(wma->hWnd, lpParms->lpstrText); } - + return 0; } diff --git a/dlls/winmm/mcicda/mcicda.c b/dlls/winmm/mcicda/mcicda.c index 8460b7fc658..fb24e3d6e6a 100644 --- a/dlls/winmm/mcicda/mcicda.c +++ b/dlls/winmm/mcicda/mcicda.c @@ -55,7 +55,7 @@ typedef struct { /*-----------------------------------------------------------------------*/ /************************************************************************** - * MCICDA_drvOpen [internal] + * MCICDA_drvOpen [internal] */ static DWORD MCICDA_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) { @@ -76,7 +76,7 @@ static DWORD MCICDA_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) } /************************************************************************** - * MCICDA_drvClose [internal] + * MCICDA_drvClose [internal] */ static DWORD MCICDA_drvClose(DWORD dwDevID) { @@ -90,12 +90,12 @@ static DWORD MCICDA_drvClose(DWORD dwDevID) } /************************************************************************** - * MCICDA_GetOpenDrv [internal] + * MCICDA_GetOpenDrv [internal] */ static WINE_MCICDAUDIO* MCICDA_GetOpenDrv(UINT wDevID) { WINE_MCICDAUDIO* wmcda = (WINE_MCICDAUDIO*)mciGetDriverData(wDevID); - + if (wmcda == NULL || wmcda->nUseCount == 0) { WARN("Invalid wDevID=%u\n", wDevID); return 0; @@ -114,7 +114,7 @@ static DWORD MCICDA_GetStatus(WINE_MCICDAUDIO* wmcda) DWORD mode = MCI_MODE_NOT_READY; fmt.Format = IOCTL_CDROM_CURRENT_POSITION; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { if (GetLastError() == STATUS_NO_MEDIA_IN_DEVICE) mode = MCI_MODE_OPEN; } else { @@ -158,9 +158,9 @@ static DWORD MCICDA_CalcFrame(WINE_MCICDAUDIO* wmcda, DWORD dwTime) CDROM_TOC toc; DWORD br; BYTE* addr; - + TRACE("(%p, %08lX, %lu);\n", wmcda, wmcda->dwTimeFormat, dwTime); - + switch (wmcda->dwTimeFormat) { case MCI_FORMAT_MILLISECONDS: dwFrame = ((dwTime - 1) * CDFRAMES_PERSEC + 500) / 1000; @@ -176,13 +176,13 @@ static DWORD MCICDA_CalcFrame(WINE_MCICDAUDIO* wmcda, DWORD dwTime) case MCI_FORMAT_TMSF: default: /* unknown format ! force TMSF ! ... */ wTrack = MCI_TMSF_TRACK(dwTime); - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) return 0; if (wTrack < toc.FirstTrack || wTrack > toc.LastTrack) return 0; TRACE("MSF %02u-%02u:%02u:%02u\n", - MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime), + MCI_TMSF_TRACK(dwTime), MCI_TMSF_MINUTE(dwTime), MCI_TMSF_SECOND(dwTime), MCI_TMSF_FRAME(dwTime)); addr = toc.TrackData[wTrack - toc.FirstTrack].Address; TRACE("TMSF trackpos[%u]=%d:%d:%d\n", @@ -207,9 +207,9 @@ static DWORD MCICDA_CalcTime(WINE_MCICDAUDIO* wmcda, DWORD tf, DWORD dwFrame, LP UINT wFrames; CDROM_TOC toc; DWORD br; - + TRACE("(%p, %08lX, %lu);\n", wmcda, tf, dwFrame); - + switch (tf) { case MCI_FORMAT_MILLISECONDS: dwTime = (dwFrame * 1000) / CDFRAMES_PERSEC + 1; @@ -227,13 +227,13 @@ static DWORD MCICDA_CalcTime(WINE_MCICDAUDIO* wmcda, DWORD tf, DWORD dwFrame, LP break; case MCI_FORMAT_TMSF: default: /* unknown format ! force TMSF ! ... */ - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) return 0; - if (dwFrame < FRAME_OF_TOC(toc, toc.FirstTrack) || + if (dwFrame < FRAME_OF_TOC(toc, toc.FirstTrack) || dwFrame > FRAME_OF_TOC(toc, toc.LastTrack + 1)) { - ERR("Out of range value %lu [%u,%u]\n", - dwFrame, FRAME_OF_TOC(toc, toc.FirstTrack), + ERR("Out of range value %lu [%u,%u]\n", + dwFrame, FRAME_OF_TOC(toc, toc.FirstTrack), FRAME_OF_TOC(toc, toc.LastTrack + 1)); *lpRet = 0; return 0; @@ -271,7 +271,7 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenPar char drive = 0; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpOpenParms); - + if (lpOpenParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; @@ -298,7 +298,7 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpOpenPar lpOpenParms->lpstrElementName[2]) { WARN("MCI_OPEN_ELEMENT unsupported format: %s\n", lpOpenParms->lpstrElementName); - ret = MCIERR_NO_ELEMENT_ALLOWED; + ret = MCIERR_NO_ELEMENT_ALLOWED; goto the_error; } drive = toupper(lpOpenParms->lpstrElementName[0]); @@ -354,7 +354,7 @@ static DWORD MCICDA_Close(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParm TRACE("(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms); if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (--wmcda->nUseCount == 0) { CloseHandle(wmcda->handle); } @@ -364,7 +364,7 @@ static DWORD MCICDA_Close(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParm /************************************************************************** * MCICDA_GetDevCaps [internal] */ -static DWORD MCICDA_GetDevCaps(UINT wDevID, DWORD dwFlags, +static DWORD MCICDA_GetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { DWORD ret = 0; @@ -431,7 +431,7 @@ static DWORD CDROM_Audio_GetSerial(CDROM_TOC* toc) int i; WORD wMagic; DWORD dwStart, dwEnd; - + /* * wMagic collects the wFrames from track 1 * dwStart, dwEnd collect the beginning and end of the disc respectively, in @@ -443,17 +443,17 @@ static DWORD CDROM_Audio_GetSerial(CDROM_TOC* toc) dwStart = FRAME_OF_TOC(*toc, toc->FirstTrack); for (i = 0; i <= toc->LastTrack - toc->FirstTrack; i++) { - serial += (toc->TrackData[i].Address[1] << 16) | + serial += (toc->TrackData[i].Address[1] << 16) | (toc->TrackData[i].Address[2] << 8) | toc->TrackData[i].Address[3]; } dwEnd = FRAME_OF_TOC(*toc, toc->LastTrack + 1); - + if (toc->LastTrack - toc->FirstTrack + 1 < 3) serial += wMagic + (dwEnd - dwStart); return serial; } - + /************************************************************************** * MCICDA_Info [internal] @@ -466,13 +466,13 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) char buffer[16]; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL || lpParms->lpstrReturn == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize); - + if (dwFlags & MCI_INFO_PRODUCT) { str = "Wine's audio CD"; } else if (dwFlags & MCI_INFO_MEDIA_UPC) { @@ -482,7 +482,7 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) CDROM_TOC toc; DWORD br; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { return MCICDA_GetError(wmcda); } @@ -500,7 +500,7 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) ret = MCIERR_PARAM_OVERFLOW; } else { strcpy(lpParms->lpstrReturn, str); - } + } } else { *lpParms->lpstrReturn = 0; } @@ -522,13 +522,13 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm DWORD br; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; if (dwFlags & MCI_NOTIFY) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } if (dwFlags & MCI_STATUS_ITEM) { @@ -536,7 +536,7 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm switch (lpParms->dwItem) { case MCI_STATUS_CURRENT_TRACK: fmt.Format = IOCTL_CDROM_CURRENT_POSITION; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { return MCICDA_GetError(wmcda); @@ -545,7 +545,7 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm TRACE("CURRENT_TRACK=%lu!\n", lpParms->dwReturn); break; case MCI_STATUS_LENGTH: - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -555,7 +555,7 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm if (lpParms->dwTrack < toc.FirstTrack || lpParms->dwTrack > toc.LastTrack) return MCIERR_OUTOFRANGE; idx = lpParms->dwTrack - toc.FirstTrack; - lpParms->dwReturn = FRAME_OF_TOC(toc, lpParms->dwTrack + 1) - + lpParms->dwReturn = FRAME_OF_TOC(toc, lpParms->dwTrack + 1) - FRAME_OF_TOC(toc, lpParms->dwTrack); /* Windows returns one frame less than the total track length for the last track on the CD. See CDDB HOWTO. Verified on Win95OSR2. */ @@ -568,8 +568,8 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm lpParms->dwReturn = FRAME_OF_TOC(toc, toc.LastTrack + 1) - FRAME_OF_TOC(toc, toc.FirstTrack) - 1; } - lpParms->dwReturn = MCICDA_CalcTime(wmcda, - (wmcda->dwTimeFormat == MCI_FORMAT_TMSF) + lpParms->dwReturn = MCICDA_CalcTime(wmcda, + (wmcda->dwTimeFormat == MCI_FORMAT_TMSF) ? MCI_FORMAT_MSF : wmcda->dwTimeFormat, lpParms->dwReturn, &ret); @@ -588,19 +588,19 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm ret = MCI_RESOURCE_RETURNED; break; case MCI_STATUS_NUMBER_OF_TRACKS: - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); } lpParms->dwReturn = toc.LastTrack - toc.FirstTrack + 1; TRACE("MCI_STATUS_NUMBER_OF_TRACKS = %lu !\n", lpParms->dwReturn); - if (lpParms->dwReturn == (WORD)-1) + if (lpParms->dwReturn == (WORD)-1) return MCICDA_GetError(wmcda); break; case MCI_STATUS_POSITION: if (dwFlags & MCI_STATUS_START) { - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -608,7 +608,7 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm lpParms->dwReturn = FRAME_OF_TOC(toc, toc.FirstTrack); TRACE("get MCI_STATUS_START !\n"); } else if (dwFlags & MCI_TRACK) { - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -619,7 +619,7 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm TRACE("get MCI_TRACK #%lu !\n", lpParms->dwTrack); } else { fmt.Format = IOCTL_CDROM_CURRENT_POSITION; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { return MCICDA_GetError(wmcda); } @@ -650,10 +650,10 @@ static DWORD MCICDA_Status(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParm break; case 4001: /* FIXME: for bogus FullCD */ case MCI_CDA_STATUS_TYPE_TRACK: - if (!(dwFlags & MCI_TRACK)) + if (!(dwFlags & MCI_TRACK)) ret = MCIERR_MISSING_PARAMETER; else { - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -688,9 +688,9 @@ static DWORD MCICDA_Play(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) CDROM_PLAY_AUDIO_MSF play; CDROM_SUB_Q_DATA_FORMAT fmt; SUB_Q_CHANNEL_DATA data; - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; @@ -702,7 +702,7 @@ static DWORD MCICDA_Play(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) TRACE("MCI_FROM=%08lX -> %lu \n", lpParms->dwFrom, start); } else { fmt.Format = IOCTL_CDROM_CURRENT_POSITION; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { return MCICDA_GetError(wmcda); } @@ -712,7 +712,7 @@ static DWORD MCICDA_Play(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) end = MCICDA_CalcFrame(wmcda, lpParms->dwTo); TRACE("MCI_TO=%08lX -> %lu \n", lpParms->dwTo, end); } else { - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -726,7 +726,7 @@ static DWORD MCICDA_Play(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) play.EndingM = end / CDFRAMES_PERMIN; play.EndingS = (end / CDFRAMES_PERSEC) % 60; play.EndingF = end % CDFRAMES_PERSEC; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PLAY_AUDIO_MSF, &play, sizeof(play), + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PLAY_AUDIO_MSF, &play, sizeof(play), NULL, 0, &br, NULL)) { ret = MCIERR_HARDWARE; } else if (dwFlags & MCI_NOTIFY) { @@ -748,15 +748,15 @@ static DWORD MCICDA_Stop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms DWORD br; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_STOP_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -771,15 +771,15 @@ static DWORD MCICDA_Pause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm DWORD br; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PAUSE_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -792,17 +792,17 @@ static DWORD MCICDA_Resume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar { WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID); DWORD br; - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_RESUME_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -820,14 +820,14 @@ static DWORD MCICDA_Seek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) DWORD br; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; - + switch (dwFlags & ~(MCI_NOTIFY|MCI_WAIT)) { case MCI_SEEK_TO_START: TRACE("Seeking to start\n"); - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -836,7 +836,7 @@ static DWORD MCICDA_Seek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) break; case MCI_SEEK_TO_END: TRACE("Seeking to end\n"); - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -855,13 +855,13 @@ static DWORD MCICDA_Seek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) seek.M = at / CDFRAMES_PERMIN; seek.S = (at / CDFRAMES_PERSEC) % 60; seek.F = at % CDFRAMES_PERSEC; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_SEEK_AUDIO_MSF, &seek, sizeof(seek), + if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_SEEK_AUDIO_MSF, &seek, sizeof(seek), NULL, 0, &br, NULL)) return MCIERR_HARDWARE; if (dwFlags & MCI_NOTIFY) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -876,14 +876,14 @@ static DWORD MCICDA_SetDoor(UINT wDevID, BOOL open) DWORD br; TRACE("(%04x, %s) !\n", wDevID, (open) ? "OPEN" : "CLOSE"); - + if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; - - if (!DeviceIoControl(wmcda->handle, + + if (!DeviceIoControl(wmcda->handle, (open) ? IOCTL_STORAGE_EJECT_MEDIA : IOCTL_STORAGE_LOAD_MEDIA, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; - + return 0; } @@ -893,9 +893,9 @@ static DWORD MCICDA_SetDoor(UINT wDevID, BOOL open) static DWORD MCICDA_Set(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; if (dwFlags & MCI_SET_DOOR_OPEN) { @@ -932,9 +932,9 @@ static DWORD MCICDA_Set(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) if (dwFlags & MCI_SET_ON) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_SET_OFF) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_NOTIFY) { - TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", + TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmcda->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -943,7 +943,7 @@ static DWORD MCICDA_Set(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) /************************************************************************** * DriverProc (MCICDA.@) */ -LONG CALLBACK MCICDA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK MCICDA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { switch(wMsg) { @@ -951,14 +951,14 @@ LONG CALLBACK MCICDA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case DRV_FREE: return 1; case DRV_OPEN: return MCICDA_drvOpen((LPSTR)dwParam1, (LPMCI_OPEN_DRIVER_PARMSA)dwParam2); case DRV_CLOSE: return MCICDA_drvClose(dwDevID); - case DRV_ENABLE: return 1; + case DRV_ENABLE: return 1; case DRV_DISABLE: return 1; case DRV_QUERYCONFIGURE: return 1; case DRV_CONFIGURE: MessageBoxA(0, "MCI audio CD driver !", "Wine Driver", MB_OK); return 1; case DRV_INSTALL: return DRVCNF_RESTART; case DRV_REMOVE: return DRVCNF_RESTART; } - + if (dwDevID == 0xFFFFFFFF) return MCIERR_UNSUPPORTED_FUNCTION; switch (wMsg) { @@ -979,25 +979,25 @@ LONG CALLBACK MCICDA_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case MCI_SET_DOOR_CLOSED: FIXME("MCI_SET_DOOR_CLOSED called. Please report this.\n"); return MCICDA_SetDoor(dwDevID, FALSE); /* commands that should be supported */ - case MCI_LOAD: - case MCI_SAVE: - case MCI_FREEZE: - case MCI_PUT: - case MCI_REALIZE: - case MCI_UNFREEZE: - case MCI_UPDATE: - case MCI_WHERE: - case MCI_STEP: - case MCI_SPIN: - case MCI_ESCAPE: - case MCI_COPY: - case MCI_CUT: - case MCI_DELETE: - case MCI_PASTE: + case MCI_LOAD: + case MCI_SAVE: + case MCI_FREEZE: + case MCI_PUT: + case MCI_REALIZE: + case MCI_UNFREEZE: + case MCI_UPDATE: + case MCI_WHERE: + case MCI_STEP: + case MCI_SPIN: + case MCI_ESCAPE: + case MCI_COPY: + case MCI_CUT: + case MCI_DELETE: + case MCI_PASTE: FIXME("Unsupported yet command [%lu]\n", wMsg); break; /* commands that should report an error */ - case MCI_WINDOW: + case MCI_WINDOW: TRACE("Unsupported command [%lu]\n", wMsg); break; case MCI_OPEN: diff --git a/dlls/winmm/mciseq/mcimidi.c b/dlls/winmm/mciseq/mcimidi.c index 91be36aa41a..dffab6e6f64 100644 --- a/dlls/winmm/mciseq/mcimidi.c +++ b/dlls/winmm/mciseq/mcimidi.c @@ -21,8 +21,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* - * Eric POUECH : +/* + * Eric POUECH : * 98/7 changes for making this MIDI driver work on OSS * current support is limited to MIDI ports of OSS systems * 98/9 rewriting MCI code for MIDI @@ -67,16 +67,16 @@ typedef struct tagWINE_MCIMIDI { HMMIO hFile; /* mmio file handle open as Element */ LPSTR lpstrElementName; /* Name of file */ LPSTR lpstrCopyright; - LPSTR lpstrName; + LPSTR lpstrName; WORD dwStatus; /* one from MCI_MODE_xxxx */ - DWORD dwMciTimeFormat; /* One of the supported MCI_FORMAT_xxxx */ + DWORD dwMciTimeFormat; /* One of the supported MCI_FORMAT_xxxx */ WORD wFormat; /* Format of MIDI hFile (0, 1 or 2) */ WORD nTracks; /* Number of tracks in hFile */ WORD nDivision; /* Number of division in hFile PPQN or SMPTE */ WORD wStartedPlaying; DWORD dwTempo; /* Tempo (# of 1/4 note per second */ MCI_MIDITRACK* tracks; /* Content of each track */ - DWORD dwPulse; + DWORD dwPulse; DWORD dwPositionMS; DWORD dwStartTicks; } WINE_MCIMIDI; @@ -122,7 +122,7 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg) /************************************************************************** * MCI_SendCommandAsync [internal] */ -static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, +static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size) { struct SCA* sca = HeapAlloc(GetProcessHeap(), 0, sizeof(struct SCA) + size); @@ -133,11 +133,11 @@ static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, sca->wDevID = wDevID; sca->wMsg = wMsg; sca->dwParam1 = dwParam1; - + if (size && dwParam2) { sca->dwParam2 = (DWORD)sca + sizeof(struct SCA); - /* copy structure passed by program in dwParam2 to be sure - * we can still use it whatever the program does + /* copy structure passed by program in dwParam2 to be sure + * we can still use it whatever the program does */ memcpy((LPVOID)sca->dwParam2, (LPVOID)dwParam2, size); } else { @@ -158,7 +158,7 @@ static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, static DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms); /************************************************************************** - * MIDI_drvOpen [internal] + * MIDI_drvOpen [internal] */ static DWORD MIDI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) { @@ -179,14 +179,14 @@ static DWORD MIDI_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) } /************************************************************************** - * MCIMIDI_drvClose [internal] + * MCIMIDI_drvClose [internal] */ static DWORD MIDI_drvClose(DWORD dwDevID) { WINE_MCIMIDI* wmm = (WINE_MCIMIDI*)mciGetDriverData(dwDevID); if (wmm) { - HeapFree(GetProcessHeap(), 0, wmm); + HeapFree(GetProcessHeap(), 0, wmm); mciSetDriverData(dwDevID, 0); return 1; } @@ -194,12 +194,12 @@ static DWORD MIDI_drvClose(DWORD dwDevID) } /************************************************************************** - * MIDI_mciGetOpenDev [internal] + * MIDI_mciGetOpenDev [internal] */ static WINE_MCIMIDI* MIDI_mciGetOpenDev(UINT wDevID) { WINE_MCIMIDI* wmm = (WINE_MCIMIDI*)mciGetDriverData(wDevID); - + if (wmm == NULL || wmm->nUseCount == 0) { WARN("Invalid wDevID=%u\n", wDevID); return 0; @@ -208,31 +208,31 @@ static WINE_MCIMIDI* MIDI_mciGetOpenDev(UINT wDevID) } /************************************************************************** - * MIDI_mciReadByte [internal] + * MIDI_mciReadByte [internal] */ static DWORD MIDI_mciReadByte(WINE_MCIMIDI* wmm, BYTE *lpbyt) { DWORD ret = 0; - - if (lpbyt == NULL || + + if (lpbyt == NULL || mmioRead(wmm->hFile, (HPSTR)lpbyt, sizeof(BYTE)) != (long)sizeof(BYTE)) { WARN("Error reading wmm=%p\n", wmm); ret = MCIERR_INVALID_FILE; } - + return ret; } /************************************************************************** - * MIDI_mciReadWord [internal] + * MIDI_mciReadWord [internal] */ static DWORD MIDI_mciReadWord(WINE_MCIMIDI* wmm, LPWORD lpw) { BYTE hibyte, lobyte; DWORD ret = MCIERR_INVALID_FILE; - - if (lpw != NULL && - MIDI_mciReadByte(wmm, &hibyte) == 0 && + + if (lpw != NULL && + MIDI_mciReadByte(wmm, &hibyte) == 0 && MIDI_mciReadByte(wmm, &lobyte) == 0) { *lpw = ((WORD)hibyte << 8) + lobyte; ret = 0; @@ -241,13 +241,13 @@ static DWORD MIDI_mciReadWord(WINE_MCIMIDI* wmm, LPWORD lpw) } /************************************************************************** - * MIDI_mciReadLong [internal] + * MIDI_mciReadLong [internal] */ static DWORD MIDI_mciReadLong(WINE_MCIMIDI* wmm, LPDWORD lpdw) { WORD hiword, loword; DWORD ret = MCIERR_INVALID_FILE; - + if (lpdw != NULL && MIDI_mciReadWord(wmm, &hiword) == 0 && MIDI_mciReadWord(wmm, &loword) == 0) { @@ -258,14 +258,14 @@ static DWORD MIDI_mciReadLong(WINE_MCIMIDI* wmm, LPDWORD lpdw) } /************************************************************************** - * MIDI_mciReadVaryLen [internal] + * MIDI_mciReadVaryLen [internal] */ static WORD MIDI_mciReadVaryLen(WINE_MCIMIDI* wmm, LPDWORD lpdw) { BYTE byte; DWORD value = 0; WORD ret = 0; - + if (lpdw == NULL) { ret = MCIERR_INVALID_FILE; } else { @@ -274,7 +274,7 @@ static WORD MIDI_mciReadVaryLen(WINE_MCIMIDI* wmm, LPDWORD lpdw) return 0; } value = (value << 7) + (byte & 0x7F); - ret++; + ret++; } while (byte & 0x80); *lpdw = value; /* @@ -285,16 +285,16 @@ static WORD MIDI_mciReadVaryLen(WINE_MCIMIDI* wmm, LPDWORD lpdw) } /************************************************************************** - * MIDI_mciReadNextEvent [internal] + * MIDI_mciReadNextEvent [internal] */ -static DWORD MIDI_mciReadNextEvent(WINE_MCIMIDI* wmm, MCI_MIDITRACK* mmt) +static DWORD MIDI_mciReadNextEvent(WINE_MCIMIDI* wmm, MCI_MIDITRACK* mmt) { BYTE b1, b2 = 0, b3; WORD hw = 0; DWORD evtPulse; DWORD evtLength; DWORD tmp; - + if (mmioSeek(wmm->hFile, mmt->dwIndex, SEEK_SET) != mmt->dwIndex) { WARN("Can't seek at %08lX \n", mmt->dwIndex); return MCIERR_INVALID_FILE; @@ -309,7 +309,7 @@ static DWORD MIDI_mciReadNextEvent(WINE_MCIMIDI* wmm, MCI_MIDITRACK* mmt) break; case 0xFF: MIDI_mciReadByte(wmm, &b2); evtLength++; - + evtLength += MIDI_mciReadVaryLen(wmm, &tmp); if (evtLength >= 0x10000u) { /* this limitation shouldn't be a problem */ @@ -342,47 +342,47 @@ static DWORD MIDI_mciReadNextEvent(WINE_MCIMIDI* wmm, MCI_MIDITRACK* mmt) } if (mmt->dwIndex + evtLength > mmt->dwLast) return MCIERR_INTERNAL; - + mmt->dwEventPulse += evtPulse; mmt->dwEventData = (hw << 16) + (b2 << 8) + b1; mmt->wEventLength = evtLength; - + /* - TRACE("[%u] => pulse=%08lx(%08lx), data=%08lx, length=%u\n", - mmt->wTrackNr, mmt->dwEventPulse, evtPulse, + TRACE("[%u] => pulse=%08lx(%08lx), data=%08lx, length=%u\n", + mmt->wTrackNr, mmt->dwEventPulse, evtPulse, mmt->dwEventData, mmt->wEventLength); */ return 0; } /************************************************************************** - * MIDI_mciReadMTrk [internal] + * MIDI_mciReadMTrk [internal] */ static DWORD MIDI_mciReadMTrk(WINE_MCIMIDI* wmm, MCI_MIDITRACK* mmt) { DWORD toberead; FOURCC fourcc; - - if (mmioRead(wmm->hFile, (HPSTR)&fourcc, (long)sizeof(FOURCC)) != + + if (mmioRead(wmm->hFile, (HPSTR)&fourcc, (long)sizeof(FOURCC)) != (long)sizeof(FOURCC)) { return MCIERR_INVALID_FILE; } - + if (fourcc != mmioFOURCC('M', 'T', 'r', 'k')) { WARN("Can't synchronize on 'MTrk' !\n"); return MCIERR_INVALID_FILE; } - + if (MIDI_mciReadLong(wmm, &toberead) != 0) { return MCIERR_INVALID_FILE; } mmt->dwFirst = mmioSeek(wmm->hFile, 0, SEEK_CUR); /* >= 0 */ mmt->dwLast = mmt->dwFirst + toberead; - + /* compute # of pulses in this track */ mmt->dwIndex = mmt->dwFirst; mmt->dwEventPulse = 0; - + while (MIDI_mciReadNextEvent(wmm, mmt) == 0 && LOWORD(mmt->dwEventData) != 0x2FFF) { char buf[1024]; WORD len; @@ -395,7 +395,7 @@ static DWORD MIDI_mciReadMTrk(WINE_MCIMIDI* wmm, MCI_MIDITRACK* mmt) /* position after meta data header */ mmioSeek(wmm->hFile, mmt->dwIndex + HIWORD(mmt->dwEventData), SEEK_SET); len = mmt->wEventLength - HIWORD(mmt->dwEventData); - + if (len >= sizeof(buf)) { WARN("Buffer for text is too small (%d bytes, when %u are needed)\n", sizeof(buf) - 1, len); len = sizeof(buf) - 1; @@ -425,35 +425,35 @@ static DWORD MIDI_mciReadMTrk(WINE_MCIMIDI* wmm, MCI_MIDITRACK* mmt) } } mmt->dwLength = mmt->dwEventPulse; - + TRACE("Track %u has %lu bytes and %lu pulses\n", mmt->wTrackNr, toberead, mmt->dwLength); - + /* reset track data */ mmt->wStatus = 1; /* ok, playing */ mmt->dwIndex = mmt->dwFirst; mmt->dwEventPulse = 0; - + if (mmioSeek(wmm->hFile, 0, SEEK_CUR) != mmt->dwLast) { - WARN("Ouch, out of sync seek=%lu track=%lu\n", + WARN("Ouch, out of sync seek=%lu track=%lu\n", mmioSeek(wmm->hFile, 0, SEEK_CUR), mmt->dwLast); /* position at end of this track, to be ready to read next track */ mmioSeek(wmm->hFile, mmt->dwLast, SEEK_SET); } - + return 0; } /************************************************************************** - * MIDI_mciReadMThd [internal] + * MIDI_mciReadMThd [internal] */ static DWORD MIDI_mciReadMThd(WINE_MCIMIDI* wmm, DWORD dwOffset) { DWORD toberead; FOURCC fourcc; WORD nt; - + TRACE("(%p, %08lX);\n", wmm, dwOffset); - + if (mmioSeek(wmm->hFile, dwOffset, SEEK_SET) != dwOffset) { WARN("Can't seek at %08lX begin of 'MThd' \n", dwOffset); return MCIERR_INVALID_FILE; @@ -461,24 +461,24 @@ static DWORD MIDI_mciReadMThd(WINE_MCIMIDI* wmm, DWORD dwOffset) if (mmioRead(wmm->hFile, (HPSTR)&fourcc, (long) sizeof(FOURCC)) != (long) sizeof(FOURCC)) return MCIERR_INVALID_FILE; - + if (fourcc != mmioFOURCC('M', 'T', 'h', 'd')) { WARN("Can't synchronize on 'MThd' !\n"); return MCIERR_INVALID_FILE; } - + if (MIDI_mciReadLong(wmm, &toberead) != 0 || toberead < 3 * sizeof(WORD)) return MCIERR_INVALID_FILE; - + if (MIDI_mciReadWord(wmm, &wmm->wFormat) != 0 || MIDI_mciReadWord(wmm, &wmm->nTracks) != 0 || MIDI_mciReadWord(wmm, &wmm->nDivision) != 0) { return MCIERR_INVALID_FILE; } - + TRACE("toberead=0x%08lX, wFormat=0x%04X nTracks=0x%04X nDivision=0x%04X\n", toberead, wmm->wFormat, wmm->nTracks, wmm->nDivision); - + /* MS doc says that the MIDI MCI time format must be put by default to the format * stored in the MIDI file... */ @@ -486,12 +486,12 @@ static DWORD MIDI_mciReadMThd(WINE_MCIMIDI* wmm, DWORD dwOffset) /* eric.pouech@lemel.fr 98/11 * In did not check this very code (pulses are expressed as SMPTE sub-frames). * In about 40 MB of MIDI files I have, none was SMPTE based... - * I'm just wondering if this is widely used :-). So, if someone has one of + * I'm just wondering if this is widely used :-). So, if someone has one of * these files, I'd like to know about. */ FIXME("Handling SMPTE time in MIDI files has not been tested\n" "Please report to comp.emulators.ms-windows.wine with MIDI file !\n"); - + switch (HIBYTE(wmm->nDivision)) { case 0xE8: wmm->dwMciTimeFormat = MCI_FORMAT_SMPTE_24; break; /* -24 */ case 0xE7: wmm->dwMciTimeFormat = MCI_FORMAT_SMPTE_25; break; /* -25 */ @@ -517,7 +517,7 @@ static DWORD MIDI_mciReadMThd(WINE_MCIMIDI* wmm, DWORD dwOffset) } else { wmm->dwMciTimeFormat = MCI_FORMAT_MILLISECONDS; } - + switch (wmm->wFormat) { case 0: if (wmm->nTracks != 1) { @@ -533,23 +533,23 @@ static DWORD MIDI_mciReadMThd(WINE_MCIMIDI* wmm, DWORD dwOffset) "Please report with MIDI file !\n", wmm->wFormat); return MCIERR_INVALID_FILE; } - + if (wmm->nTracks & 0x8000) { /* this shouldn't be a problem... */ WARN("Ouch !! Implementation limitation to 32k tracks per MIDI file is overflowed\n"); wmm->nTracks = 0x7FFF; } - + if ((wmm->tracks = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_MIDITRACK) * wmm->nTracks)) == NULL) { return MCIERR_OUT_OF_MEMORY; } - - toberead -= 3 * sizeof(WORD); + + toberead -= 3 * sizeof(WORD); if (toberead > 0) { TRACE("Size of MThd > 6, skipping %ld extra bytes\n", toberead); mmioSeek(wmm->hFile, toberead, SEEK_CUR); } - + for (nt = 0; nt < wmm->nTracks; nt++) { wmm->tracks[nt].wTrackNr = nt; if (MIDI_mciReadMTrk(wmm, &wmm->tracks[nt]) != 0) { @@ -557,9 +557,9 @@ static DWORD MIDI_mciReadMThd(WINE_MCIMIDI* wmm, DWORD dwOffset) return MCIERR_INVALID_FILE; } } - + wmm->dwTempo = 500000; - + return 0; } @@ -569,7 +569,7 @@ static DWORD MIDI_mciReadMThd(WINE_MCIMIDI* wmm, DWORD dwOffset) static DWORD MIDI_ConvertPulseToMS(WINE_MCIMIDI* wmm, DWORD pulse) { DWORD ret = 0; - + /* FIXME: this function may return false values since the tempo (wmm->dwTempo) * may change during file playing */ @@ -580,15 +580,15 @@ static DWORD MIDI_ConvertPulseToMS(WINE_MCIMIDI* wmm, DWORD pulse) int nsf = LOBYTE(wmm->nDivision); /* number of sub-frames */ ret = (pulse * 1000) / (nf * nsf); } else { - ret = (DWORD)((double)pulse * ((double)wmm->dwTempo / 1000) / + ret = (DWORD)((double)pulse * ((double)wmm->dwTempo / 1000) / (double)wmm->nDivision); } - + /* - TRACE("pulse=%lu tempo=%lu division=%u=0x%04x => ms=%lu\n", + TRACE("pulse=%lu tempo=%lu division=%u=0x%04x => ms=%lu\n", pulse, wmm->dwTempo, wmm->nDivision, wmm->nDivision, ret); */ - + return ret; } @@ -602,23 +602,23 @@ static DWORD MIDI_ConvertPulseToMS(WINE_MCIMIDI* wmm, DWORD pulse) static DWORD MIDI_ConvertTimeFormatToMS(WINE_MCIMIDI* wmm, DWORD val) { DWORD ret = 0; - + switch (wmm->dwMciTimeFormat) { - case MCI_FORMAT_MILLISECONDS: - ret = val; + case MCI_FORMAT_MILLISECONDS: + ret = val; break; case MCI_FORMAT_SMPTE_24: - ret = + ret = (HIBYTE(HIWORD(val)) * 125) / 3 + LOBYTE(HIWORD(val)) * TIME_MS_IN_ONE_SECOND + HIBYTE(LOWORD(val)) * TIME_MS_IN_ONE_MINUTE + LOBYTE(LOWORD(val)) * TIME_MS_IN_ONE_HOUR; break; - case MCI_FORMAT_SMPTE_25: - ret = + case MCI_FORMAT_SMPTE_25: + ret = HIBYTE(HIWORD(val)) * 40 + LOBYTE(HIWORD(val)) * TIME_MS_IN_ONE_SECOND + HIBYTE(LOWORD(val)) * TIME_MS_IN_ONE_MINUTE + LOBYTE(LOWORD(val)) * TIME_MS_IN_ONE_HOUR; break; - case MCI_FORMAT_SMPTE_30: - ret = + case MCI_FORMAT_SMPTE_30: + ret = (HIBYTE(HIWORD(val)) * 100) / 3 + LOBYTE(HIWORD(val)) * TIME_MS_IN_ONE_SECOND + HIBYTE(LOWORD(val)) * TIME_MS_IN_ONE_MINUTE + LOBYTE(LOWORD(val)) * TIME_MS_IN_ONE_HOUR; break; @@ -629,7 +629,7 @@ static DWORD MIDI_ConvertTimeFormatToMS(WINE_MCIMIDI* wmm, DWORD val) TRACE("val=%lu=0x%08lx [tf=%lu] => ret=%lu\n", val, val, wmm->dwMciTimeFormat, ret); */ return ret; -} +} /************************************************************************** * MIDI_ConvertMSToTimeFormat [internal] @@ -638,27 +638,27 @@ static DWORD MIDI_ConvertMSToTimeFormat(WINE_MCIMIDI* wmm, DWORD _val) { DWORD ret = 0, val = _val; DWORD h, m, s, f; - + switch (wmm->dwMciTimeFormat) { - case MCI_FORMAT_MILLISECONDS: - ret = val; + case MCI_FORMAT_MILLISECONDS: + ret = val; break; case MCI_FORMAT_SMPTE_24: - case MCI_FORMAT_SMPTE_25: - case MCI_FORMAT_SMPTE_30: - h = val / TIME_MS_IN_ONE_HOUR; - m = (val -= h * TIME_MS_IN_ONE_HOUR) / TIME_MS_IN_ONE_MINUTE; + case MCI_FORMAT_SMPTE_25: + case MCI_FORMAT_SMPTE_30: + h = val / TIME_MS_IN_ONE_HOUR; + m = (val -= h * TIME_MS_IN_ONE_HOUR) / TIME_MS_IN_ONE_MINUTE; s = (val -= m * TIME_MS_IN_ONE_MINUTE) / TIME_MS_IN_ONE_SECOND; switch (wmm->dwMciTimeFormat) { case MCI_FORMAT_SMPTE_24: /* one frame is 1000/24 val long, 1000/24 == 125/3 */ f = (val * 3) / 125; val -= (f * 125) / 3; break; - case MCI_FORMAT_SMPTE_25: + case MCI_FORMAT_SMPTE_25: /* one frame is 1000/25 ms long, 1000/25 == 40 */ f = val / 40; val -= f * 40; break; - case MCI_FORMAT_SMPTE_30: + case MCI_FORMAT_SMPTE_30: /* one frame is 1000/30 ms long, 1000/30 == 100/3 */ f = (val * 3) / 100; val -= (f * 100) / 3; break; @@ -677,7 +677,7 @@ static DWORD MIDI_ConvertMSToTimeFormat(WINE_MCIMIDI* wmm, DWORD _val) TRACE("val=%lu [tf=%lu] => ret=%lu=0x%08lx\n", _val, wmm->dwMciTimeFormat, ret, ret); */ return ret; -} +} /************************************************************************** * MIDI_GetMThdLengthMS [internal] @@ -686,7 +686,7 @@ static DWORD MIDI_GetMThdLengthMS(WINE_MCIMIDI* wmm) { WORD nt; DWORD ret = 0; - + for (nt = 0; nt < wmm->nTracks; nt++) { if (wmm->wFormat == 2) { ret += wmm->tracks[nt].dwLength; @@ -699,16 +699,16 @@ static DWORD MIDI_GetMThdLengthMS(WINE_MCIMIDI* wmm) } /************************************************************************** - * MIDI_mciOpen [internal] + * MIDI_mciOpen [internal] */ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpParms) { DWORD dwRet = 0; DWORD dwDeviceID; WINE_MCIMIDI* wmm = (WINE_MCIMIDI*)mciGetDriverData(wDevID); - + TRACE("(%04x, %08lX, %p)\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; if (dwFlags & MCI_OPEN_SHAREABLE) @@ -721,18 +721,18 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpParms) return MCIERR_DEVICE_OPEN; } wmm->nUseCount++; - + wmm->hFile = 0; wmm->hMidi = 0; dwDeviceID = lpParms->wDeviceID; - + TRACE("wDevID=%04X (lpParams->wDeviceID=%08lX)\n", wDevID, dwDeviceID); /* lpParms->wDeviceID = wDevID;*/ - + if (dwFlags & MCI_OPEN_ELEMENT) { TRACE("MCI_OPEN_ELEMENT '%s' !\n", lpParms->lpstrElementName); if (lpParms->lpstrElementName && strlen(lpParms->lpstrElementName) > 0) { - wmm->hFile = mmioOpenA(lpParms->lpstrElementName, NULL, + wmm->hFile = mmioOpenA(lpParms->lpstrElementName, NULL, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE); if (wmm->hFile == 0) { WARN("Can't find file '%s' !\n", lpParms->lpstrElementName); @@ -744,7 +744,7 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpParms) } } TRACE("hFile=%u\n", wmm->hFile); - + /* FIXME: should I get a strdup() of it instead? */ wmm->lpstrElementName = HeapAlloc( GetProcessHeap(), 0, strlen(lpParms->lpstrElementName)+1 ); strcpy( wmm->lpstrElementName, lpParms->lpstrElementName ); @@ -755,18 +755,18 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpParms) wmm->dwStatus = MCI_MODE_NOT_READY; /* while loading file contents */ /* spec says it should be the default format from the MIDI file... */ wmm->dwMciTimeFormat = MCI_FORMAT_MILLISECONDS; - + if (wmm->hFile != 0) { MMCKINFO ckMainRIFF; MMCKINFO mmckInfo; DWORD dwOffset = 0; - + if (mmioDescend(wmm->hFile, &ckMainRIFF, NULL, 0) != 0) { dwRet = MCIERR_INVALID_FILE; } else { TRACE("ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n", (LPSTR)&ckMainRIFF.ckid, (LPSTR)&ckMainRIFF.fccType, ckMainRIFF.cksize); - + if (ckMainRIFF.ckid == FOURCC_RIFF && ckMainRIFF.fccType == mmioFOURCC('R', 'M', 'I', 'D')) { mmckInfo.ckid = mmioFOURCC('d', 'a', 't', 'a'); mmioSeek(wmm->hFile, ckMainRIFF.dwDataOffset + ((ckMainRIFF.cksize + 1) & ~1), SEEK_SET); @@ -804,14 +804,14 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpParms) * MIDI_mciStop [internal] */ static DWORD MIDI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) -{ +{ WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); DWORD dwRet = 0; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wmm->dwStatus != MCI_MODE_STOP) { int oldstat = wmm->dwStatus; @@ -826,11 +826,11 @@ static DWORD MIDI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm /* sanitiy reset */ wmm->dwStatus = MCI_MODE_STOP; - TRACE("wmm->dwStatus=%d\n", wmm->dwStatus); + TRACE("wmm->dwStatus=%d\n", wmm->dwStatus); if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -842,15 +842,15 @@ static DWORD MIDI_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm static DWORD MIDI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wmm->dwStatus != MCI_MODE_STOP) { MIDI_mciStop(wDevID, MCI_WAIT, lpParms); } - + wmm->nUseCount--; if (wmm->nUseCount == 0) { if (wmm->hFile != 0) { @@ -866,10 +866,10 @@ static DWORD MIDI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar TRACE("Shouldn't happen... nUseCount=%d\n", wmm->nUseCount); return MCIERR_INTERNAL; } - + if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -878,16 +878,16 @@ static DWORD MIDI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar /************************************************************************** * MIDI_mciFindNextEvent [internal] */ -static MCI_MIDITRACK* MIDI_mciFindNextEvent(WINE_MCIMIDI* wmm, LPDWORD hiPulse) +static MCI_MIDITRACK* MIDI_mciFindNextEvent(WINE_MCIMIDI* wmm, LPDWORD hiPulse) { WORD cnt, nt; MCI_MIDITRACK* mmt; - + *hiPulse = 0xFFFFFFFFul; cnt = 0xFFFFu; for (nt = 0; nt < wmm->nTracks; nt++) { mmt = &wmm->tracks[nt]; - + if (mmt->wStatus == 0) continue; if (mmt->dwEventPulse < *hiPulse) { @@ -910,16 +910,16 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) MCI_MIDITRACK* mmt; DWORD hiPulse; WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wmm->hFile == 0) { WARN("Can't play: no file '%s' !\n", wmm->lpstrElementName); return MCIERR_FILE_NOT_FOUND; } - + if (wmm->dwStatus != MCI_MODE_STOP) { if (wmm->dwStatus == MCI_MODE_PAUSE) { /* FIXME: parameters (start/end) in lpParams may not be used */ @@ -928,30 +928,30 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) WARN("Can't play: device is not stopped !\n"); return MCIERR_INTERNAL; } - - if (!(dwFlags & MCI_WAIT)) { + + if (!(dwFlags & MCI_WAIT)) { /** FIXME: I'm not 100% sure that wNotifyDeviceID is the right value in all cases ??? */ return MCI_SendCommandAsync(wmm->wNotifyDeviceID, MCI_PLAY, dwFlags, (DWORD)lpParms, sizeof(LPMCI_PLAY_PARMS)); } - + if (lpParms && (dwFlags & MCI_FROM)) { - dwStartMS = MIDI_ConvertTimeFormatToMS(wmm, lpParms->dwFrom); + dwStartMS = MIDI_ConvertTimeFormatToMS(wmm, lpParms->dwFrom); } else { dwStartMS = wmm->dwPositionMS; } - + if (lpParms && (dwFlags & MCI_TO)) { dwEndMS = MIDI_ConvertTimeFormatToMS(wmm, lpParms->dwTo); } else { dwEndMS = 0xFFFFFFFFul; } - + TRACE("Playing from %lu to %lu\n", dwStartMS, dwEndMS); - + /* init tracks */ for (nt = 0; nt < wmm->nTracks; nt++) { mmt = &wmm->tracks[nt]; - + mmt->wStatus = 1; /* ok, playing */ mmt->dwIndex = mmt->dwFirst; if (wmm->wFormat == 2 && nt > 0) { @@ -961,7 +961,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) } MIDI_mciReadNextEvent(wmm, mmt); /* FIXME == 0 */ } - + dwRet = midiOutOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL); /* dwRet = midiInOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);*/ if (dwRet != MMSYSERR_NOERROR) { @@ -973,20 +973,20 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) wmm->dwStatus = MCI_MODE_PLAY; wmm->dwPositionMS = 0; wmm->wStartedPlaying = FALSE; - + while (wmm->dwStatus != MCI_MODE_STOP && wmm->dwStatus != MCI_MODE_NOT_READY) { - /* it seems that in case of multi-threading, gcc is optimizing just a little bit - * too much. Tell gcc not to optimize status value using volatile. + /* it seems that in case of multi-threading, gcc is optimizing just a little bit + * too much. Tell gcc not to optimize status value using volatile. */ while (((volatile WINE_MCIMIDI*)wmm)->dwStatus == MCI_MODE_PAUSE); - + doPlay = (wmm->dwPositionMS >= dwStartMS && wmm->dwPositionMS <= dwEndMS); - + TRACE("wmm->dwStatus=%d, doPlay=%c\n", wmm->dwStatus, doPlay ? 'T' : 'F'); - + if ((mmt = MIDI_mciFindNextEvent(wmm, &hiPulse)) == NULL) break; /* no more event on tracks */ - + /* if starting playing, then set StartTicks to the value it would have had * if play had started at position 0 */ @@ -995,22 +995,22 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) wmm->wStartedPlaying = TRUE; TRACE("Setting dwStartTicks to %lu\n", wmm->dwStartTicks); } - + if (hiPulse > wmm->dwPulse) { wmm->dwPositionMS += MIDI_ConvertPulseToMS(wmm, hiPulse - wmm->dwPulse); if (doPlay) { DWORD togo = wmm->dwStartTicks + wmm->dwPositionMS; DWORD tc = GetTickCount(); - + TRACE("Pulses hi=0x%08lx <> cur=0x%08lx\n", hiPulse, wmm->dwPulse); - TRACE("Wait until %lu => %lu ms\n", + TRACE("Wait until %lu => %lu ms\n", tc - wmm->dwStartTicks, togo - wmm->dwStartTicks); - if (tc < togo) + if (tc < togo) Sleep(togo - tc); } wmm->dwPulse = hiPulse; } - + switch (LOBYTE(LOWORD(mmt->dwEventData))) { case 0xF0: case 0xF7: /* sysex events */ @@ -1025,7 +1025,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) case 0x00: /* 16-bit sequence number */ if (TRACE_ON(mcimidi)) { WORD twd; - + MIDI_mciReadWord(wmm, &twd); /* == 0 */ TRACE("Got sequence number %u\n", twd); } @@ -1040,10 +1040,10 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) if (TRACE_ON(mcimidi)) { char buf[1024]; WORD len = mmt->wEventLength - HIWORD(mmt->dwEventData); - static char* info[8] = {"", "Text", "Copyright", "Seq/Trk name", + static char* info[8] = {"", "Text", "Copyright", "Seq/Trk name", "Instrument", "Lyric", "Marker", "Cue-point"}; WORD idx = HIBYTE(LOWORD(mmt->dwEventData)); - + if (len >= sizeof(buf)) { WARN("Buffer for text is too small (%d bytes, when %u are needed)\n", sizeof(buf) - 1, len); len = sizeof(buf) - 1; @@ -1056,11 +1056,11 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) } } break; - case 0x20: + case 0x20: /* MIDI channel (cc) */ if (FIXME_ON(mcimidi)) { BYTE bt; - + MIDI_mciReadByte(wmm, &bt); /* == 0 */ FIXME("NIY: MIDI channel=%u, track=%u\n", bt, mmt->wTrackNr); } @@ -1069,7 +1069,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) /* MIDI port (pp) */ if (FIXME_ON(mcimidi)) { BYTE bt; - + MIDI_mciReadByte(wmm, &bt); /* == 0 */ FIXME("NIY: MIDI port=%u, track=%u\n", bt, mmt->wTrackNr); } @@ -1083,10 +1083,10 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) */ if (mmt->wTrackNr != 0 && wmm->wFormat == 1) { WARN("For format #1 MIDI files, tempo can only be changed on track #0 (%u)\n", mmt->wTrackNr); - } else { + } else { BYTE tbt; DWORD value = 0; - + MIDI_mciReadByte(wmm, &tbt); value = ((DWORD)tbt) << 16; MIDI_mciReadByte(wmm, &tbt); value |= ((DWORD)tbt) << 8; MIDI_mciReadByte(wmm, &tbt); value |= ((DWORD)tbt) << 0; @@ -1101,7 +1101,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) WARN("SMPTE track start can only be expressed at start of track (%lu)\n", mmt->dwEventPulse); } else { BYTE h, m, s, f, ff; - + MIDI_mciReadByte(wmm, &h); MIDI_mciReadByte(wmm, &m); MIDI_mciReadByte(wmm, &s); @@ -1113,24 +1113,24 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) case 0x58: /* file rythm */ if (TRACE_ON(mcimidi)) { BYTE num, den, cpmc, _32npqn; - - MIDI_mciReadByte(wmm, &num); + + MIDI_mciReadByte(wmm, &num); MIDI_mciReadByte(wmm, &den); /* to notate e.g. 6/8 */ - MIDI_mciReadByte(wmm, &cpmc); /* number of MIDI clocks per metronome click */ + MIDI_mciReadByte(wmm, &cpmc); /* number of MIDI clocks per metronome click */ MIDI_mciReadByte(wmm, &_32npqn); /* number of notated 32nd notes per MIDI quarter note */ - + TRACE("%u/%u, clock per metronome click=%u, 32nd notes by 1/4 note=%u\n", num, 1 << den, cpmc, _32npqn); } break; case 0x59: /* key signature */ if (TRACE_ON(mcimidi)) { BYTE sf, mm; - - MIDI_mciReadByte(wmm, &sf); - MIDI_mciReadByte(wmm, &mm); - - if (sf >= 0x80) TRACE("%d flats\n", -(char)sf); - else if (sf > 0) TRACE("%d sharps\n", (char)sf); + + MIDI_mciReadByte(wmm, &sf); + MIDI_mciReadByte(wmm, &mm); + + if (sf >= 0x80) TRACE("%d flats\n", -(char)sf); + else if (sf > 0) TRACE("%d sharps\n", (char)sf); else TRACE("Key of C\n"); TRACE("Mode: %s\n", (mm = 0) ? "major" : "minor"); } @@ -1147,7 +1147,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) switch (LOBYTE(LOWORD(mmt->dwEventData)) & 0xF0) { case MIDI_NOTEON: case MIDI_NOTEOFF: - dwRet = 0; + dwRet = 0; break; default: dwRet = midiOutShortMsg(wmm->hMidi, mmt->dwEventData); @@ -1157,21 +1157,21 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) mmt->dwIndex += mmt->wEventLength; if (mmt->dwIndex < mmt->dwFirst || mmt->dwIndex >= mmt->dwLast) { mmt->wStatus = 0; - } - if (mmt->wStatus) { + } + if (mmt->wStatus) { MIDI_mciReadNextEvent(wmm, mmt); } } - + midiOutReset(wmm->hMidi); - + dwRet = midiOutClose(wmm->hMidi); /* to restart playing at beginning when it's over */ wmm->dwPositionMS = 0; - + if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } @@ -1188,18 +1188,18 @@ static DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar MIDIHDR midiHdr; DWORD dwRet; WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmm == 0) return MCIERR_INVALID_DEVICE_ID; - + if (wmm->hFile == 0) { WARN("Can't find file='%s' !\n", wmm->lpstrElementName); return MCIERR_FILE_NOT_FOUND; } start = 1; end = 99999; if (lpParms && (dwFlags & MCI_FROM)) { - start = lpParms->dwFrom; + start = lpParms->dwFrom; TRACE("MCI_FROM=%d \n", start); } if (lpParms && (dwFlags & MCI_TO)) { @@ -1234,7 +1234,7 @@ static DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar wmm->dwStatus = MCI_MODE_STOP; if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -1246,24 +1246,24 @@ static DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar static DWORD MIDI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wmm->dwStatus == MCI_MODE_PLAY) { /* stop all notes */ unsigned chn; for (chn = 0; chn < 16; chn++) midiOutShortMsg(wmm->hMidi, 0x78B0 | chn); wmm->dwStatus = MCI_MODE_PAUSE; - } + } if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } - + return 0; } @@ -1273,18 +1273,18 @@ static DWORD MIDI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar static DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) { WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wmm->dwStatus == MCI_MODE_PAUSE) { wmm->wStartedPlaying = FALSE; wmm->dwStatus = MCI_MODE_PLAY; - } + } if (lpParms && (dwFlags & MCI_NOTIFY)) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return 0; @@ -1296,12 +1296,12 @@ static DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_SET_TIME_FORMAT) { switch (lpParms->dwTimeFormat) { case MCI_FORMAT_MILLISECONDS: @@ -1346,7 +1346,7 @@ static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) WARN("MCI_SET_AUDIO without SET_ON or SET_OFF\n"); return MCIERR_BAD_INTEGER; } - + if (lpParms->dwAudio & MCI_SET_AUDIO_ALL) TRACE("MCI_SET_AUDIO_ALL !\n"); if (lpParms->dwAudio & MCI_SET_AUDIO_LEFT) @@ -1354,7 +1354,7 @@ static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) if (lpParms->dwAudio & MCI_SET_AUDIO_RIGHT) TRACE("MCI_SET_AUDIO_RIGHT !\n"); } - + if (dwFlags & MCI_SEQ_SET_MASTER) TRACE("MCI_SEQ_SET_MASTER !\n"); if (dwFlags & MCI_SEQ_SET_SLAVE) @@ -1377,10 +1377,10 @@ static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar DWORD ret = 0; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_STATUS_ITEM) { switch (lpParms->dwItem) { case MCI_STATUS_CURRENT_TRACK: @@ -1416,9 +1416,9 @@ static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar break; case MCI_STATUS_POSITION: /* FIXME: do I need to use MCI_TRACK ? */ - lpParms->dwReturn = MIDI_ConvertMSToTimeFormat(wmm, + lpParms->dwReturn = MIDI_ConvertMSToTimeFormat(wmm, (dwFlags & MCI_STATUS_START) ? 0 : wmm->dwPositionMS); - TRACE("MCI_STATUS_POSITION %s => %lu\n", + TRACE("MCI_STATUS_POSITION %s => %lu\n", (dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn); break; case MCI_STATUS_READY: @@ -1478,7 +1478,7 @@ static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar } if (dwFlags & MCI_NOTIFY) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } return ret; @@ -1487,17 +1487,17 @@ static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar /************************************************************************** * MIDI_mciGetDevCaps [internal] */ -static DWORD MIDI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, +static DWORD MIDI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); DWORD ret; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_GETDEVCAPS_ITEM) { switch (lpParms->dwItem) { case MCI_GETDEVCAPS_DEVICE_TYPE: @@ -1566,13 +1566,13 @@ static DWORD MIDI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) DWORD ret = 0; TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL || lpParms->lpstrReturn == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmm == NULL) return MCIERR_INVALID_DEVICE_ID; TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize); - + switch (dwFlags & ~(MCI_WAIT|MCI_NOTIFY)) { case MCI_INFO_PRODUCT: str = "Wine's MIDI sequencer"; @@ -1582,7 +1582,7 @@ static DWORD MIDI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) break; case MCI_INFO_COPYRIGHT: str = wmm->lpstrCopyright; - break; + break; case MCI_INFO_NAME: str = wmm->lpstrName; break; @@ -1596,7 +1596,7 @@ static DWORD MIDI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) ret = MCIERR_PARAM_OVERFLOW; } else { strcpy(lpParms->lpstrReturn, str); - } + } } else { *lpParms->lpstrReturn = 0; } @@ -1610,16 +1610,16 @@ static DWORD MIDI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) { DWORD ret = 0; WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) { ret = MCIERR_NULL_PARAMETER_BLOCK; } else if (wmm == NULL) { ret = MCIERR_INVALID_DEVICE_ID; } else { MIDI_mciStop(wDevID, MCI_WAIT, 0); - + if (dwFlags & MCI_SEEK_TO_START) { wmm->dwPositionMS = 0; } else if (dwFlags & MCI_SEEK_TO_END) { @@ -1630,17 +1630,17 @@ static DWORD MIDI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) WARN("dwFlag doesn't tell where to seek to...\n"); return MCIERR_MISSING_PARAMETER; } - + TRACE("Seeking to position=%lu ms\n", wmm->dwPositionMS); - + if (dwFlags & MCI_NOTIFY) { TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); } } - return ret; -} + return ret; +} /*======================================================================* * MIDI entry points * @@ -1649,7 +1649,7 @@ static DWORD MIDI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) /************************************************************************** * DriverProc (MCISEQ.@) */ -LONG CALLBACK MCIMIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK MCIMIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { switch (wMsg) { @@ -1681,36 +1681,36 @@ LONG CALLBACK MCIMIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case MCI_INFO: return MIDI_mciInfo (dwDevID, dwParam1, (LPMCI_INFO_PARMSA) dwParam2); case MCI_SEEK: return MIDI_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2); /* commands that should be supported */ - case MCI_LOAD: - case MCI_SAVE: - case MCI_FREEZE: - case MCI_PUT: - case MCI_REALIZE: - case MCI_UNFREEZE: - case MCI_UPDATE: - case MCI_WHERE: - case MCI_STEP: - case MCI_SPIN: - case MCI_ESCAPE: - case MCI_COPY: - case MCI_CUT: - case MCI_DELETE: - case MCI_PASTE: + case MCI_LOAD: + case MCI_SAVE: + case MCI_FREEZE: + case MCI_PUT: + case MCI_REALIZE: + case MCI_UNFREEZE: + case MCI_UPDATE: + case MCI_WHERE: + case MCI_STEP: + case MCI_SPIN: + case MCI_ESCAPE: + case MCI_COPY: + case MCI_CUT: + case MCI_DELETE: + case MCI_PASTE: WARN("Unsupported command [%lu]\n", wMsg); break; /* commands that should report an error */ - case MCI_WINDOW: + case MCI_WINDOW: TRACE("Unsupported command [%lu]\n", wMsg); break; case MCI_OPEN: case MCI_CLOSE: FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n"); break; - default: + default: TRACE("Sending msg [%lu] to default driver proc\n", wMsg); return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); } return MCIERR_UNRECOGNIZED_COMMAND; } - + diff --git a/dlls/winmm/mciwave/mciwave.c b/dlls/winmm/mciwave/mciwave.c index ab18942ef7d..f4928522f68 100644 --- a/dlls/winmm/mciwave/mciwave.c +++ b/dlls/winmm/mciwave/mciwave.c @@ -1,5 +1,5 @@ /* -*- tab-width: 8; c-basic-offset: 4 -*- */ -/* +/* * Sample Wine Driver for MCI wave forms * * Copyright 1994 Martin Ayotte @@ -92,7 +92,7 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg) /************************************************************************** * MCI_SendCommandAsync [internal] */ -static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, +static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2, UINT size) { struct SCA* sca = HeapAlloc(GetProcessHeap(), 0, sizeof(struct SCA) + size); @@ -103,11 +103,11 @@ static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, sca->wDevID = wDevID; sca->wMsg = wMsg; sca->dwParam1 = dwParam1; - + if (size && dwParam2) { sca->dwParam2 = (DWORD)sca + sizeof(struct SCA); - /* copy structure passed by program in dwParam2 to be sure - * we can still use it whatever the program does + /* copy structure passed by program in dwParam2 to be sure + * we can still use it whatever the program does */ memcpy((LPVOID)sca->dwParam2, (LPVOID)dwParam2, size); } else { @@ -128,7 +128,7 @@ static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1, static DWORD WAVE_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms); /************************************************************************** - * MCIWAVE_drvOpen [internal] + * MCIWAVE_drvOpen [internal] */ static DWORD WAVE_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) { @@ -146,11 +146,11 @@ static DWORD WAVE_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) modp->wCustomCommandTable = MCI_NO_COMMAND_TABLE; modp->wType = MCI_DEVTYPE_WAVEFORM_AUDIO; - wmw->wfxRef.wFormatTag = WAVE_FORMAT_PCM; + wmw->wfxRef.wFormatTag = WAVE_FORMAT_PCM; wmw->wfxRef.nChannels = 1; /* MONO */ wmw->wfxRef.nSamplesPerSec = 11025; wmw->wfxRef.nAvgBytesPerSec = 11025; - wmw->wfxRef.nBlockAlign = 1; + wmw->wfxRef.nBlockAlign = 1; wmw->wfxRef.wBitsPerSample = 8; wmw->wfxRef.cbSize = 0; /* don't care */ @@ -158,14 +158,14 @@ static DWORD WAVE_drvOpen(LPSTR str, LPMCI_OPEN_DRIVER_PARMSA modp) } /************************************************************************** - * MCIWAVE_drvClose [internal] + * MCIWAVE_drvClose [internal] */ static DWORD WAVE_drvClose(DWORD dwDevID) { WINE_MCIWAVE* wmw = (WINE_MCIWAVE*)mciGetDriverData(dwDevID); if (wmw) { - HeapFree(GetProcessHeap(), 0, wmw); + HeapFree(GetProcessHeap(), 0, wmw); mciSetDriverData(dwDevID, 0); return 1; } @@ -173,12 +173,12 @@ static DWORD WAVE_drvClose(DWORD dwDevID) } /************************************************************************** - * WAVE_mciGetOpenDev [internal] + * WAVE_mciGetOpenDev [internal] */ static WINE_MCIWAVE* WAVE_mciGetOpenDev(UINT wDevID) { WINE_MCIWAVE* wmw = (WINE_MCIWAVE*)mciGetDriverData(wDevID); - + if (wmw == NULL || wmw->nUseCount == 0) { WARN("Invalid wDevID=%u\n", wDevID); return 0; @@ -187,12 +187,12 @@ static WINE_MCIWAVE* WAVE_mciGetOpenDev(UINT wDevID) } /************************************************************************** - * WAVE_ConvertByteToTimeFormat [internal] + * WAVE_ConvertByteToTimeFormat [internal] */ static DWORD WAVE_ConvertByteToTimeFormat(WINE_MCIWAVE* wmw, DWORD val, LPDWORD lpRet) { DWORD ret = 0; - + switch (wmw->dwMciTimeFormat) { case MCI_FORMAT_MILLISECONDS: ret = MulDiv(val,1000,wmw->lpWaveFormat->nAvgBytesPerSec); @@ -212,12 +212,12 @@ static DWORD WAVE_ConvertByteToTimeFormat(WINE_MCIWAVE* wmw, DWORD val, LPDWORD } /************************************************************************** - * WAVE_ConvertTimeFormatToByte [internal] + * WAVE_ConvertTimeFormatToByte [internal] */ static DWORD WAVE_ConvertTimeFormatToByte(WINE_MCIWAVE* wmw, DWORD val) { DWORD ret = 0; - + switch (wmw->dwMciTimeFormat) { case MCI_FORMAT_MILLISECONDS: ret = (val * wmw->lpWaveFormat->nAvgBytesPerSec) / 1000; @@ -253,7 +253,7 @@ static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, MMCKINFO* pckMainRIFF) r = mmioRead(wmw->hFile, (HPSTR)wmw->lpWaveFormat, mmckInfo.cksize); if (r < sizeof(WAVEFORMAT)) return MCIERR_INVALID_FILE; - + TRACE("wFormatTag=%04X !\n", wmw->lpWaveFormat->wFormatTag); TRACE("nChannels=%d \n", wmw->lpWaveFormat->nChannels); TRACE("nSamplesPerSec=%ld\n", wmw->lpWaveFormat->nSamplesPerSec); @@ -262,7 +262,7 @@ static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, MMCKINFO* pckMainRIFF) TRACE("wBitsPerSample=%u !\n", wmw->lpWaveFormat->wBitsPerSample); if (r >= (long)sizeof(WAVEFORMATEX)) TRACE("cbSize=%u !\n", wmw->lpWaveFormat->cbSize); - + mmioAscend(wmw->hFile, &mmckInfo, 0); wmw->ckWaveData.ckid = mmioFOURCC('d', 'a', 't', 'a'); if (mmioDescend(wmw->hFile, &wmw->ckWaveData, pckMainRIFF, MMIO_FINDCHUNK) != 0) { @@ -273,7 +273,7 @@ static DWORD WAVE_mciReadFmt(WINE_MCIWAVE* wmw, MMCKINFO* pckMainRIFF) (LPSTR)&wmw->ckWaveData.ckid, (LPSTR)&wmw->ckWaveData.fccType, wmw->ckWaveData.cksize); TRACE("nChannels=%d nSamplesPerSec=%ld\n", wmw->lpWaveFormat->nChannels, wmw->lpWaveFormat->nSamplesPerSec); - + return 0; } @@ -318,8 +318,8 @@ static DWORD WAVE_mciCreateRIFFSkeleton(WINE_MCIWAVE* wmw) /* only the first 16 bytes are serialized */ /* wrong... for non PCM, the whole waveFormat is stored */ - if (-1 == mmioWrite(hmmio, (HPCSTR) lpWaveFormat, 16)) - goto err; + if (-1 == mmioWrite(hmmio, (HPCSTR) lpWaveFormat, 16)) + goto err; if (MMSYSERR_NOERROR != mmioAscend(hmmio, &ckWaveFormat, 0)) goto err; @@ -327,14 +327,14 @@ static DWORD WAVE_mciCreateRIFFSkeleton(WINE_MCIWAVE* wmw) lpckWaveData->cksize = 0; lpckWaveData->fccType = 0; lpckWaveData->ckid = mmioFOURCC('d', 'a', 't', 'a'); - + /* create data chunk */ if (MMSYSERR_NOERROR != mmioCreateChunk(hmmio, lpckWaveData, 0)) goto err; return 0; -err: +err: HeapFree(GetProcessHeap(), 0, wmw->lpWaveFormat); return MCIERR_INVALID_FILE; } @@ -347,14 +347,14 @@ static DWORD WAVE_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA lpO DWORD dwRet = 0; WINE_MCIWAVE* wmw = (WINE_MCIWAVE*)mciGetDriverData(wDevID); CHAR* pszTmpFileName = 0; - + TRACE("(%04X, %08lX, %p)\n", wDevID, dwFlags, lpOpenParms); if (lpOpenParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; if (dwFlags & MCI_OPEN_SHAREABLE) return MCIERR_HARDWARE; - + if (wmw->nUseCount > 0) { /* The driver is already opened on this channel * Wave driver cannot be shared @@ -363,17 +363,17 @@ static DWORD WAVE_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA lpO } wmw->nUseCount++; - + wmw->fInput = FALSE; wmw->hWave = 0; - wmw->dwStatus = MCI_MODE_NOT_READY; + wmw->dwStatus = MCI_MODE_NOT_READY; TRACE("wDevID=%04X (lpParams->wDeviceID=%08X)\n", wDevID, lpOpenParms->wDeviceID); - + if (dwFlags & MCI_OPEN_ELEMENT) { if (dwFlags & MCI_OPEN_ELEMENT_ID) { - /* could it be that (DWORD)lpOpenParms->lpstrElementName - * contains the hFile value ? + /* could it be that (DWORD)lpOpenParms->lpstrElementName + * contains the hFile value ? */ dwRet = MCIERR_UNRECOGNIZED_COMMAND; } else { @@ -384,7 +384,7 @@ static DWORD WAVE_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA lpO TRACE("MCI_OPEN_ELEMENT '%s' !\n", lpOpenParms->lpstrElementName); if (lpOpenParms->lpstrElementName && (strlen(lpOpenParms->lpstrElementName) > 0)) { - wmw->hFile = mmioOpenA((LPSTR)lpOpenParms->lpstrElementName, NULL, + wmw->hFile = mmioOpenA((LPSTR)lpOpenParms->lpstrElementName, NULL, MMIO_ALLOCBUF | MMIO_DENYWRITE | MMIO_READWRITE); if (wmw->hFile == 0) { @@ -403,31 +403,31 @@ static DWORD WAVE_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA lpO dwRet = MCIERR_INVALID_FILE; } else { TRACE("ParentChunk ckid=%.4s fccType=%.4s cksize=%08lX \n", - (LPSTR)&(lpckMainRIFF->ckid), - (LPSTR) &(lpckMainRIFF->fccType), + (LPSTR)&(lpckMainRIFF->ckid), + (LPSTR) &(lpckMainRIFF->fccType), (lpckMainRIFF->cksize)); - if ((lpckMainRIFF->ckid != FOURCC_RIFF) || + if ((lpckMainRIFF->ckid != FOURCC_RIFF) || lpckMainRIFF->fccType != mmioFOURCC('W', 'A', 'V', 'E')) { dwRet = MCIERR_INVALID_FILE; } else { dwRet = WAVE_mciReadFmt(wmw, lpckMainRIFF); } - } + } } - } + } else { wmw->hFile = 0; } - } + } else { CHAR szTmpPath[MAX_PATH]; CHAR szPrefix[4] = "TMP\0"; - + pszTmpFileName = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, + HEAP_ZERO_MEMORY, MAX_PATH * sizeof(*pszTmpFileName)); - + if (!GetTempPathA(sizeof(szTmpPath), szTmpPath)) { WARN("can't retrieve temp path!\n"); HeapFree(GetProcessHeap(), 0, pszTmpFileName); @@ -441,14 +441,14 @@ static DWORD WAVE_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA lpO } wmw->bTemporaryFile = TRUE; - + TRACE("MCI_OPEN_ELEMENT '%s' !\n", pszTmpFileName); - + if (pszTmpFileName && (strlen(pszTmpFileName) > 0)) { - wmw->hFile = mmioOpenA(pszTmpFileName, NULL, + wmw->hFile = mmioOpenA(pszTmpFileName, NULL, MMIO_ALLOCBUF | MMIO_READWRITE | MMIO_CREATE); - + if (wmw->hFile == 0) { /* temporary file could not be created. clean filename. */ HeapFree(GetProcessHeap(), 0, pszTmpFileName); @@ -456,12 +456,12 @@ static DWORD WAVE_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA lpO dwRet = MCIERR_FILE_NOT_FOUND; } } - } + } } } TRACE("hFile=%u\n", wmw->hFile); - + memcpy(&wmw->openParms, lpOpenParms, sizeof(MCI_WAVE_OPEN_PARMSA)); if (wmw->bTemporaryFile == TRUE) @@ -469,26 +469,26 @@ static DWORD WAVE_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_PARMSA lpO /* Additional openParms is temporary file's name */ wmw->openParms.lpstrElementName = pszTmpFileName; } - + if (dwRet == 0) { if (wmw->lpWaveFormat) { switch (wmw->lpWaveFormat->wFormatTag) { case WAVE_FORMAT_PCM: - if (wmw->lpWaveFormat->nAvgBytesPerSec != + if (wmw->lpWaveFormat->nAvgBytesPerSec != wmw->lpWaveFormat->nSamplesPerSec * wmw->lpWaveFormat->nBlockAlign) { - WARN("Incorrect nAvgBytesPerSec (%ld), setting it to %ld\n", - wmw->lpWaveFormat->nAvgBytesPerSec, - wmw->lpWaveFormat->nSamplesPerSec * + WARN("Incorrect nAvgBytesPerSec (%ld), setting it to %ld\n", + wmw->lpWaveFormat->nAvgBytesPerSec, + wmw->lpWaveFormat->nSamplesPerSec * wmw->lpWaveFormat->nBlockAlign); - wmw->lpWaveFormat->nAvgBytesPerSec = - wmw->lpWaveFormat->nSamplesPerSec * + wmw->lpWaveFormat->nAvgBytesPerSec = + wmw->lpWaveFormat->nSamplesPerSec * wmw->lpWaveFormat->nBlockAlign; } break; } } wmw->dwPosition = 0; - + wmw->dwStatus = MCI_MODE_STOP; } else { wmw->nUseCount--; @@ -506,30 +506,30 @@ static DWORD WAVE_mciCue(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms { /* FIXME - + This routine is far from complete. At the moment only a check is done on the MCI_WAVE_INPUT flag. No explicit check on MCI_WAVE_OUTPUT is done since that is the default. - + The flags MCI_NOTIFY (and the callback parameter in lpParms) and MCI_WAIT are ignored */ - + DWORD dwRet; WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); - + FIXME("(%u, %08lX, %p); likely to fail\n", wDevID, dwParam, lpParms); - + if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; - - /* always close elements ? */ + + /* always close elements ? */ if (wmw->hFile != 0) { mmioClose(wmw->hFile, 0); wmw->hFile = 0; } - + dwRet = MMSYSERR_NOERROR; /* assume success */ - + if ((dwParam & MCI_WAVE_INPUT) && !wmw->fInput) { dwRet = waveOutClose(wmw->hWave); if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL; @@ -550,11 +550,11 @@ static DWORD WAVE_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm { DWORD dwRet = 0; WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; - + /* wait for playback thread (if any) to exit before processing further */ switch (wmw->dwStatus) { case MCI_MODE_PAUSE: @@ -575,12 +575,12 @@ static DWORD WAVE_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm /* sanity resets */ wmw->dwStatus = MCI_MODE_STOP; - + if ((dwFlags & MCI_NOTIFY) && lpParms) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmw->openParms.wDeviceID, MCI_NOTIFY_SUCCESSFUL); } - + return dwRet; } @@ -591,17 +591,17 @@ static DWORD WAVE_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar { DWORD dwRet = 0; WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wmw->dwStatus != MCI_MODE_STOP) { dwRet = WAVE_mciStop(wDevID, MCI_WAIT, lpParms); } - + wmw->nUseCount--; - + if (wmw->nUseCount == 0) { if (wmw->hFile != 0) { mmioClose(wmw->hFile, 0); @@ -618,12 +618,12 @@ static DWORD WAVE_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar HeapFree(GetProcessHeap(), 0, (CHAR*) wmw->openParms.lpstrElementName); wmw->openParms.lpstrElementName = NULL; } - + HeapFree(GetProcessHeap(), 0, wmw->lpWaveFormat); wmw->lpWaveFormat = NULL; if ((dwFlags & MCI_NOTIFY) && lpParms) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmw->openParms.wDeviceID, (dwRet == 0) ? MCI_NOTIFY_SUCCESSFUL : MCI_NOTIFY_FAILURE); } @@ -634,8 +634,8 @@ static DWORD WAVE_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar /************************************************************************** * WAVE_mciPlayCallback [internal] */ -static void CALLBACK WAVE_mciPlayCallback(HWAVEOUT hwo, UINT uMsg, - DWORD dwInstance, +static void CALLBACK WAVE_mciPlayCallback(HWAVEOUT hwo, UINT uMsg, + DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { WINE_MCIWAVE* wmw = (WINE_MCIWAVE*)dwInstance; @@ -662,7 +662,7 @@ static void WAVE_mciPlayWaitDone(WINE_MCIWAVE* wmw) break; } InterlockedIncrement(&wmw->dwEventCount); - + WaitForSingleObject(wmw->hEvent, INFINITE); } } @@ -678,13 +678,13 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) LPWAVEHDR waveHdr = NULL; WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); int whidx; - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; - /* FIXME : since there is no way to determine in which mode the device is + /* FIXME : since there is no way to determine in which mode the device is * open (recording/playback) automatically switch from a mode to another */ wmw->fInput = FALSE; @@ -698,12 +698,12 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) WARN("Can't play: no file='%s' !\n", wmw->openParms.lpstrElementName); return MCIERR_FILE_NOT_FOUND; } - + if (wmw->dwStatus == MCI_MODE_PAUSE) { /* FIXME: parameters (start/end) in lpParams may not be used */ return WAVE_mciResume(wDevID, dwFlags, (LPMCI_GENERIC_PARMS)lpParms); } - + /** This function will be called again by a thread when async is used. * We have to set MCI_MODE_PLAY before we do this so that the app can spin * on MCI_STATUS, so we have to allow it here if we're not going to start this thread. @@ -713,22 +713,22 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) } wmw->dwStatus = MCI_MODE_PLAY; - + if (!(dwFlags & MCI_WAIT)) { - return MCI_SendCommandAsync(wmw->openParms.wDeviceID, MCI_PLAY, dwFlags, + return MCI_SendCommandAsync(wmw->openParms.wDeviceID, MCI_PLAY, dwFlags, (DWORD)lpParms, sizeof(MCI_PLAY_PARMS)); } end = 0xFFFFFFFF; if (lpParms && (dwFlags & MCI_FROM)) { - wmw->dwPosition = WAVE_ConvertTimeFormatToByte(wmw, lpParms->dwFrom); + wmw->dwPosition = WAVE_ConvertTimeFormatToByte(wmw, lpParms->dwFrom); } if (lpParms && (dwFlags & MCI_TO)) { end = WAVE_ConvertTimeFormatToByte(wmw, lpParms->dwTo); } - + TRACE("Playing from byte=%lu to byte=%lu\n", wmw->dwPosition, end); - + if (end <= wmw->dwPosition) return TRUE; @@ -743,14 +743,14 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) if (wmw->lpWaveFormat) { switch (wmw->lpWaveFormat->wFormatTag) { case WAVE_FORMAT_PCM: - if (wmw->lpWaveFormat->nAvgBytesPerSec != + if (wmw->lpWaveFormat->nAvgBytesPerSec != wmw->lpWaveFormat->nSamplesPerSec * wmw->lpWaveFormat->nBlockAlign) { - WARN("Incorrect nAvgBytesPerSec (%ld), setting it to %ld\n", - wmw->lpWaveFormat->nAvgBytesPerSec, - wmw->lpWaveFormat->nSamplesPerSec * + WARN("Incorrect nAvgBytesPerSec (%ld), setting it to %ld\n", + wmw->lpWaveFormat->nAvgBytesPerSec, + wmw->lpWaveFormat->nSamplesPerSec * wmw->lpWaveFormat->nBlockAlign); - wmw->lpWaveFormat->nAvgBytesPerSec = - wmw->lpWaveFormat->nSamplesPerSec * + wmw->lpWaveFormat->nAvgBytesPerSec = + wmw->lpWaveFormat->nSamplesPerSec * wmw->lpWaveFormat->nBlockAlign; } break; @@ -760,10 +760,10 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) TRACE("can't retrieve wave format %ld\n", dwRet); goto cleanUp; } - - + + /* go back to beginning of chunk plus the requested position */ - /* FIXME: I'm not sure this is correct, notably because some data linked to + /* FIXME: I'm not sure this is correct, notably because some data linked to * the decompression state machine will not be correcly initialized. * try it this way (other way would be to decompress from 0 up to dwPosition * and to start sending to hWave when dwPosition is reached) @@ -774,7 +774,7 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) * change from output to input and back */ /* FIXME: how to choose between several output channels ? here mapper is forced */ - dwRet = waveOutOpen(&wmw->hWave, WAVE_MAPPER, wmw->lpWaveFormat, + dwRet = waveOutOpen(&wmw->hWave, WAVE_MAPPER, wmw->lpWaveFormat, (DWORD)WAVE_mciPlayCallback, (DWORD)wmw, CALLBACK_FUNCTION); if (dwRet != 0) { @@ -794,7 +794,7 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) waveHdr[0].dwLoops = waveHdr[1].dwLoops = 0L; waveHdr[0].dwFlags = waveHdr[1].dwFlags = 0L; waveHdr[0].dwBufferLength = waveHdr[1].dwBufferLength = bufsize; - if (waveOutPrepareHeader(wmw->hWave, &waveHdr[0], sizeof(WAVEHDR)) || + if (waveOutPrepareHeader(wmw->hWave, &waveHdr[0], sizeof(WAVEHDR)) || waveOutPrepareHeader(wmw->hWave, &waveHdr[1], sizeof(WAVEHDR))) { dwRet = MCIERR_INTERNAL; goto cleanUp; @@ -806,20 +806,20 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) wmw->dwEventCount = 1L; /* for first buffer */ TRACE("Playing (normalized) from byte=%lu for %lu bytes\n", wmw->dwPosition, left); - + /* FIXME: this doesn't work if wmw->dwPosition != 0 */ while (left > 0 && wmw->dwStatus != MCI_MODE_STOP && wmw->dwStatus != MCI_MODE_NOT_READY) { count = mmioRead(wmw->hFile, waveHdr[whidx].lpData, min(bufsize, left)); TRACE("mmioRead bufsize=%ld count=%ld\n", bufsize, count); - if (count < 1) + if (count < 1) break; - /* count is always <= bufsize, so this is correct regarding the - * waveOutPrepareHeader function + /* count is always <= bufsize, so this is correct regarding the + * waveOutPrepareHeader function */ waveHdr[whidx].dwBufferLength = count; waveHdr[whidx].dwFlags &= ~WHDR_DONE; TRACE("before WODM_WRITE lpWaveHdr=%p dwBufferLength=%lu dwBytesRecorded=%lu\n", - &waveHdr[whidx], waveHdr[whidx].dwBufferLength, + &waveHdr[whidx], waveHdr[whidx].dwBufferLength, waveHdr[whidx].dwBytesRecorded); dwRet = waveOutWrite(wmw->hWave, &waveHdr[whidx], sizeof(WAVEHDR)); left -= count; @@ -840,7 +840,7 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) dwRet = 0; -cleanUp: +cleanUp: HeapFree(GetProcessHeap(), 0, waveHdr); if (wmw->hWave) { @@ -850,8 +850,8 @@ cleanUp: CloseHandle(wmw->hEvent); if (lpParms && (dwFlags & MCI_NOTIFY)) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), - wmw->openParms.wDeviceID, + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + wmw->openParms.wDeviceID, dwRet ? MCI_NOTIFY_FAILURE : MCI_NOTIFY_SUCCESSFUL); } @@ -863,13 +863,13 @@ cleanUp: /************************************************************************** * WAVE_mciPlayCallback [internal] */ -static void CALLBACK WAVE_mciRecordCallback(HWAVEOUT hwo, UINT uMsg, - DWORD dwInstance, +static void CALLBACK WAVE_mciRecordCallback(HWAVEOUT hwo, UINT uMsg, + DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { WINE_MCIWAVE* wmw = (WINE_MCIWAVE*)dwInstance; - LPWAVEHDR lpWaveHdr = NULL; - LONG count = 0; + LPWAVEHDR lpWaveHdr = NULL; + LONG count = 0; switch (uMsg) { case WIM_OPEN: case WIM_CLOSE: @@ -883,18 +883,18 @@ static void CALLBACK WAVE_mciRecordCallback(HWAVEOUT hwo, UINT uMsg, lpWaveHdr->dwFlags &= ~WHDR_DONE; wmw->dwPosition += count; - wmw->dwRemaining -= count; + wmw->dwRemaining -= count; if (wmw->dwStatus == MCI_MODE_RECORD) { /* Only queue up another buffer if we are recording. We could receive this message also when waveInReset() is called, since it notifies on all wave buffers that are outstanding. Queueing up more sometimes causes waveInClose - to fail. */ + to fail. */ waveInAddBuffer(wmw->hWave, lpWaveHdr, sizeof(*lpWaveHdr)); TRACE("after mmioWrite dwPosition=%lu\n", wmw->dwPosition); } - + SetEvent(wmw->hEvent); break; default: @@ -910,7 +910,7 @@ static void WAVE_mciRecordWaitDone(WINE_MCIWAVE* wmw) break; } InterlockedIncrement(&wmw->dwEventCount); - + WaitForSingleObject(wmw->hEvent, INFINITE); } } @@ -922,17 +922,17 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar { DWORD end; DWORD dwRet = 0; - LONG bufsize; + LONG bufsize; LPWAVEHDR waveHdr = NULL; WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; - - /* FIXME : since there is no way to determine in which mode the device is + + /* FIXME : since there is no way to determine in which mode the device is * open (recording/playback) automatically switch from a mode to another */ wmw->fInput = TRUE; @@ -946,7 +946,7 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar /* FIXME: parameters (start/end) in lpParams may not be used */ return WAVE_mciResume(wDevID, dwFlags, (LPMCI_GENERIC_PARMS)lpParms); } - + /** This function will be called again by a thread when async is used. * We have to set MCI_MODE_PLAY before we do this so that the app can spin * on MCI_STATUS, so we have to allow it here if we're not going to start this thread. @@ -956,9 +956,9 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar } wmw->dwStatus = MCI_MODE_RECORD; - - if (!(dwFlags & MCI_WAIT)) { - return MCI_SendCommandAsync(wmw->openParms.wDeviceID, MCI_RECORD, dwFlags, + + if (!(dwFlags & MCI_WAIT)) { + return MCI_SendCommandAsync(wmw->openParms.wDeviceID, MCI_RECORD, dwFlags, (DWORD)lpParms, sizeof(MCI_RECORD_PARMS)); } @@ -966,14 +966,14 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar { /* new RIFF file */ dwRet = WAVE_mciCreateRIFFSkeleton(wmw); - } else + } else { FIXME("Should descend into data chunk. Please report.\n"); } - + end = 0xFFFFFFFF; if (lpParms && (dwFlags & MCI_FROM)) { - wmw->dwPosition = WAVE_ConvertTimeFormatToByte(wmw, lpParms->dwFrom); + wmw->dwPosition = WAVE_ConvertTimeFormatToByte(wmw, lpParms->dwFrom); } if (lpParms && (dwFlags & MCI_TO)) { @@ -994,7 +994,7 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar wmw->ckWaveData.cksize = WAVE_ALIGN_ON_BLOCK(wmw, wmw->ckWaveData.cksize); /* go back to beginning of chunk plus the requested position */ - /* FIXME: I'm not sure this is correct, notably because some data linked to + /* FIXME: I'm not sure this is correct, notably because some data linked to * the decompression state machine will not be correcly initialized. * try it this way (other way would be to decompress from 0 up to dwPosition * and to start sending to hWave when dwPosition is reached) @@ -1005,7 +1005,7 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar * change from output to input and back */ /* FIXME: how to choose between several output channels ? here mapper is forced */ - dwRet = waveInOpen(&wmw->hWave, WAVE_MAPPER, wmw->lpWaveFormat, + dwRet = waveInOpen(&wmw->hWave, WAVE_MAPPER, wmw->lpWaveFormat, (DWORD)WAVE_mciRecordCallback, (DWORD)wmw, CALLBACK_FUNCTION); if (dwRet != 0) { @@ -1026,7 +1026,7 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar waveHdr[0].dwFlags = waveHdr[1].dwFlags = 0L; waveHdr[0].dwBufferLength = waveHdr[1].dwBufferLength = bufsize; - if (waveInPrepareHeader(wmw->hWave, &waveHdr[0], sizeof(WAVEHDR)) || + if (waveInPrepareHeader(wmw->hWave, &waveHdr[0], sizeof(WAVEHDR)) || waveInPrepareHeader(wmw->hWave, &waveHdr[1], sizeof(WAVEHDR))) { dwRet = MCIERR_INTERNAL; goto cleanUp; @@ -1037,23 +1037,23 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar dwRet = MCIERR_INTERNAL; goto cleanUp; } - + wmw->hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); wmw->dwEventCount = 1L; /* for first buffer */ wmw->dwRemaining = end - wmw->dwPosition; - + TRACE("Recording (normalized) from byte=%lu for %lu bytes\n", wmw->dwPosition, wmw->dwRemaining); - dwRet = waveInStart(wmw->hWave); - + dwRet = waveInStart(wmw->hWave); + while ( wmw->dwRemaining > 0 && wmw->dwStatus != MCI_MODE_STOP && wmw->dwStatus != MCI_MODE_NOT_READY) { - WAVE_mciRecordWaitDone(wmw); + WAVE_mciRecordWaitDone(wmw); } /* needed so that the callback above won't add again the buffers returned by the reset */ wmw->dwStatus = MCI_MODE_STOP; - + waveInReset(wmw->hWave); waveInUnprepareHeader(wmw->hWave, &waveHdr[0], sizeof(WAVEHDR)); @@ -1061,7 +1061,7 @@ static DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar dwRet = 0; -cleanUp: +cleanUp: HeapFree(GetProcessHeap(), 0, waveHdr); if (wmw->hWave) { @@ -1076,8 +1076,8 @@ cleanUp: } if (lpParms && (dwFlags & MCI_NOTIFY)) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), - wmw->openParms.wDeviceID, + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + wmw->openParms.wDeviceID, dwRet ? MCI_NOTIFY_FAILURE : MCI_NOTIFY_SUCCESSFUL); } @@ -1094,19 +1094,19 @@ static DWORD WAVE_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar { DWORD dwRet; WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wmw->dwStatus == MCI_MODE_PLAY) { wmw->dwStatus = MCI_MODE_PAUSE; - } - + } + if (wmw->fInput) dwRet = waveInStop(wmw->hWave); else dwRet = waveOutPause(wmw->hWave); - + return (dwRet == MMSYSERR_NOERROR) ? 0 : MCIERR_INTERNAL; } @@ -1117,15 +1117,15 @@ static DWORD WAVE_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa { WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); DWORD dwRet = 0; - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (wmw->dwStatus == MCI_MODE_PAUSE) { wmw->dwStatus = MCI_MODE_PLAY; - } - + } + if (wmw->fInput) dwRet = waveInStart(wmw->hWave); else dwRet = waveOutRestart(wmw->hWave); return (dwRet == MMSYSERR_NOERROR) ? 0 : MCIERR_INTERNAL; @@ -1138,16 +1138,16 @@ static DWORD WAVE_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) { DWORD ret = 0; WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); - + TRACE("(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) { ret = MCIERR_NULL_PARAMETER_BLOCK; } else if (wmw == NULL) { ret = MCIERR_INVALID_DEVICE_ID; } else { WAVE_mciStop(wDevID, MCI_WAIT, 0); - + if (dwFlags & MCI_SEEK_TO_START) { wmw->dwPosition = 0; } else if (dwFlags & MCI_SEEK_TO_END) { @@ -1158,16 +1158,16 @@ static DWORD WAVE_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) WARN("dwFlag doesn't tell where to seek to...\n"); return MCIERR_MISSING_PARAMETER; } - + TRACE("Seeking to position=%lu bytes\n", wmw->dwPosition); - + if (dwFlags & MCI_NOTIFY) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmw->openParms.wDeviceID, MCI_NOTIFY_SUCCESSFUL); } } - return ret; -} + return ret; +} /************************************************************************** * WAVE_mciSet [internal] @@ -1175,12 +1175,12 @@ static DWORD WAVE_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) static DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) { WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_SET_TIME_FORMAT) { switch (lpParms->dwTimeFormat) { case MCI_FORMAT_MILLISECONDS: @@ -1221,7 +1221,7 @@ static DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) WARN("MCI_SET_AUDIO without SET_ON or SET_OFF\n"); return MCIERR_BAD_INTEGER; } - + if (lpParms->dwAudio & MCI_SET_AUDIO_ALL) TRACE("MCI_SET_AUDIO_ALL !\n"); if (lpParms->dwAudio & MCI_SET_AUDIO_LEFT) @@ -1229,13 +1229,13 @@ static DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) if (lpParms->dwAudio & MCI_SET_AUDIO_RIGHT) TRACE("MCI_SET_AUDIO_RIGHT !\n"); } - if (dwFlags & MCI_WAVE_INPUT) + if (dwFlags & MCI_WAVE_INPUT) TRACE("MCI_WAVE_INPUT !\n"); - if (dwFlags & MCI_WAVE_OUTPUT) + if (dwFlags & MCI_WAVE_OUTPUT) TRACE("MCI_WAVE_OUTPUT !\n"); - if (dwFlags & MCI_WAVE_SET_ANYINPUT) + if (dwFlags & MCI_WAVE_SET_ANYINPUT) TRACE("MCI_WAVE_SET_ANYINPUT !\n"); - if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) + if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) TRACE("MCI_WAVE_SET_ANYOUTPUT !\n"); if (dwFlags & MCI_WAVE_SET_AVGBYTESPERSEC) { wmw->wfxRef.nAvgBytesPerSec = ((LPMCI_WAVE_SET_PARMS)lpParms)->nAvgBytesPerSec; @@ -1253,7 +1253,7 @@ static DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) wmw->wfxRef.nChannels = ((LPMCI_WAVE_SET_PARMS)lpParms)->nChannels; TRACE("MCI_WAVE_SET_CHANNELS = %d\n", wmw->wfxRef.nChannels); } - if (dwFlags & MCI_WAVE_SET_FORMATTAG) { + if (dwFlags & MCI_WAVE_SET_FORMATTAG) { wmw->wfxRef.wFormatTag = ((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag; TRACE("MCI_WAVE_SET_FORMATTAG = %d\n", wmw->wfxRef.wFormatTag); } @@ -1270,7 +1270,7 @@ static DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) static DWORD WAVE_mciSave(UINT wDevID, DWORD dwFlags, LPMCI_SAVE_PARMS lpParms) { WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); - DWORD ret = MCIERR_FILE_NOT_SAVED, tmpRet; + DWORD ret = MCIERR_FILE_NOT_SAVED, tmpRet; WPARAM wparam = MCI_NOTIFY_FAILURE; TRACE("%d, %08lX, %p);\n", wDevID, dwFlags, lpParms); @@ -1287,7 +1287,7 @@ static DWORD WAVE_mciSave(UINT wDevID, DWORD dwFlags, LPMCI_SAVE_PARMS lpParms) ret = mmioClose(wmw->hFile, 0); - + /* If the destination file already exists, it has to be overwritten. (Behaviour verified in Windows (2000)). If it doesn't overwrite, it is breaking one of @@ -1300,15 +1300,15 @@ static DWORD WAVE_mciSave(UINT wDevID, DWORD dwFlags, LPMCI_SAVE_PARMS lpParms) tmpRet = GetLastError(); DeleteFileA (lpParms->lpfilename); SetLastError(tmpRet); - + if (0 == mmioRenameA(wmw->openParms.lpstrElementName, lpParms->lpfilename, 0, 0 )) { ret = ERROR_SUCCESS; } - + if (dwFlags & MCI_NOTIFY) { if (ret == ERROR_SUCCESS) wparam = MCI_NOTIFY_SUCCESSFUL; - mciDriverNotify( (HWND) LOWORD(lpParms->dwCallback), + mciDriverNotify( (HWND) LOWORD(lpParms->dwCallback), wmw->openParms.wDeviceID, wparam); } @@ -1326,7 +1326,7 @@ static DWORD WAVE_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_STATUS_ITEM) { switch (lpParms->dwItem) { case MCI_STATUS_CURRENT_TRACK: @@ -1363,10 +1363,10 @@ static DWORD WAVE_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar return MCIERR_UNSUPPORTED_FUNCTION; } /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */ - lpParms->dwReturn = WAVE_ConvertByteToTimeFormat(wmw, + lpParms->dwReturn = WAVE_ConvertByteToTimeFormat(wmw, (dwFlags & MCI_STATUS_START) ? 0 : wmw->dwPosition, &ret); - TRACE("MCI_STATUS_POSITION %s => %lu\n", + TRACE("MCI_STATUS_POSITION %s => %lu\n", (dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn); break; case MCI_STATUS_READY: @@ -1455,7 +1455,7 @@ static DWORD WAVE_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar } } if (dwFlags & MCI_NOTIFY) { - mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), + mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), wmw->openParms.wDeviceID, MCI_NOTIFY_SUCCESSFUL); } return ret; @@ -1464,17 +1464,17 @@ static DWORD WAVE_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar /************************************************************************** * WAVE_mciGetDevCaps [internal] */ -static DWORD WAVE_mciGetDevCaps(UINT wDevID, DWORD dwFlags, +static DWORD WAVE_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms) { WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); DWORD ret = 0; TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; if (wmw == NULL) return MCIERR_INVALID_DEVICE_ID; - + if (dwFlags & MCI_GETDEVCAPS_ITEM) { switch(lpParms->dwItem) { case MCI_GETDEVCAPS_DEVICE_TYPE: @@ -1538,16 +1538,16 @@ static DWORD WAVE_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) DWORD ret = 0; LPCSTR str = 0; WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); - + TRACE("(%u, %08lX, %p);\n", wDevID, dwFlags, lpParms); - + if (lpParms == NULL || lpParms->lpstrReturn == NULL) { ret = MCIERR_NULL_PARAMETER_BLOCK; } else if (wmw == NULL) { ret = MCIERR_INVALID_DEVICE_ID; } else { TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize); - + switch (dwFlags & ~(MCI_WAIT|MCI_NOTIFY)) { case MCI_INFO_PRODUCT: str = "Wine's audio player"; @@ -1575,19 +1575,19 @@ static DWORD WAVE_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms) } else { lpParms->lpstrReturn[0] = 0; } - + return ret; } /************************************************************************** * DriverProc (MCIWAVE.@) */ -LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { - TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", + TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", dwDevID, hDriv, wMsg, dwParam1, dwParam2); - + switch (wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; @@ -1616,23 +1616,23 @@ LONG CALLBACK MCIWAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, case MCI_STATUS: return WAVE_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2); case MCI_GETDEVCAPS: return WAVE_mciGetDevCaps(dwDevID, dwParam1, (LPMCI_GETDEVCAPS_PARMS) dwParam2); case MCI_INFO: return WAVE_mciInfo (dwDevID, dwParam1, (LPMCI_INFO_PARMSA) dwParam2); - case MCI_SEEK: return WAVE_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2); + case MCI_SEEK: return WAVE_mciSeek (dwDevID, dwParam1, (LPMCI_SEEK_PARMS) dwParam2); case MCI_SAVE: return WAVE_mciSave (dwDevID, dwParam1, (LPMCI_SAVE_PARMS) dwParam2); /* commands that should be supported */ - case MCI_LOAD: - case MCI_FREEZE: - case MCI_PUT: - case MCI_REALIZE: - case MCI_UNFREEZE: - case MCI_UPDATE: - case MCI_WHERE: - case MCI_STEP: - case MCI_SPIN: - case MCI_ESCAPE: - case MCI_COPY: - case MCI_CUT: - case MCI_DELETE: - case MCI_PASTE: + case MCI_LOAD: + case MCI_FREEZE: + case MCI_PUT: + case MCI_REALIZE: + case MCI_UNFREEZE: + case MCI_UPDATE: + case MCI_WHERE: + case MCI_STEP: + case MCI_SPIN: + case MCI_ESCAPE: + case MCI_COPY: + case MCI_CUT: + case MCI_DELETE: + case MCI_PASTE: FIXME("Unsupported yet command [%lu]\n", wMsg); break; case MCI_WINDOW: diff --git a/dlls/winmm/midimap/midimap.c b/dlls/winmm/midimap/midimap.c index 60e02472a28..6c6f1ad009a 100644 --- a/dlls/winmm/midimap/midimap.c +++ b/dlls/winmm/midimap/midimap.c @@ -1,5 +1,5 @@ /* -*- tab-width: 8; c-basic-offset: 4 -*- */ -/* +/* * Wine Midi mapper driver * * Copyright 1999, 2000, 2001 Eric Pouech @@ -62,7 +62,7 @@ * "Channels"="" * (the default value of this key also refers to the name of the device). * - * this defines, for each midiOut device (identified by its index in ), which + * this defines, for each midiOut device (identified by its index in ), which * channels have to be mapped onto it. The defines the channels (from 0 to 15) * will be mapped (mapping occurs for channel if bit is set in * @@ -77,7 +77,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msacm); -typedef struct tagMIDIOUTPORT +typedef struct tagMIDIOUTPORT { char name[MAXPNAMELEN]; int loaded; @@ -87,7 +87,7 @@ typedef struct tagMIDIOUTPORT unsigned int aChn[16]; } MIDIOUTPORT; -typedef struct tagMIDIMAPDATA +typedef struct tagMIDIMAPDATA { struct tagMIDIMAPDATA* self; MIDIOUTPORT* ChannelMap[16]; @@ -106,14 +106,14 @@ static BOOL MIDIMAP_IsBadData(MIDIMAPDATA* mm) static BOOL MIDIMAP_FindPort(const char* name, unsigned* dev) { - for (*dev = 0; *dev < numMidiOutPorts; (*dev)++) + for (*dev = 0; *dev < numMidiOutPorts; (*dev)++) { TRACE("%s\n", midiOutPorts[*dev].name); if (strcmp(midiOutPorts[*dev].name, name) == 0) return TRUE; } /* try the form #nnn */ - if (*name == '#' && isdigit(name[1])) + if (*name == '#' && isdigit(name[1])) { *dev = atoi(name + 1); if (*dev < numMidiOutPorts) @@ -126,7 +126,7 @@ static BOOL MIDIMAP_LoadSettingsDefault(MIDIMAPDATA* mom, const char* port) { unsigned i, dev = 0; - if (port != NULL && !MIDIMAP_FindPort(port, &dev)) + if (port != NULL && !MIDIMAP_FindPort(port, &dev)) { ERR("Registry glitch: couldn't find midi out (%s)\n", port); dev = 0; @@ -150,19 +150,19 @@ static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA* mom, const char* scheme) for (i = 0; i < 16; i++) mom->ChannelMap[i] = NULL; - if (RegOpenKeyA(HKEY_LOCAL_MACHINE, - "System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Schemes", - &hSchemesKey)) + if (RegOpenKeyA(HKEY_LOCAL_MACHINE, + "System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Schemes", + &hSchemesKey)) { return FALSE; } - if (RegOpenKeyA(hSchemesKey, scheme, &hKey)) + if (RegOpenKeyA(hSchemesKey, scheme, &hKey)) { RegCloseKey(hSchemesKey); return FALSE; } - for (idx = 0; !RegEnumKeyA(hKey, idx, buffer, sizeof(buffer)); idx++) + for (idx = 0; !RegEnumKeyA(hKey, idx, buffer, sizeof(buffer)); idx++) { if (RegOpenKeyA(hKey, buffer, &hPortKey)) continue; @@ -175,11 +175,11 @@ static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA* mom, const char* scheme) if (RegQueryValueExA(hPortKey, "Channels", 0, &type, (void*)&mask, &size)) continue; - for (i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { - if (mask & (1 << i)) + if (mask & (1 << i)) { - if (mom->ChannelMap[i]) + if (mom->ChannelMap[i]) ERR("Quirks in registry, channel %u is mapped twice\n", i); mom->ChannelMap[i] = &midiOutPorts[dev]; } @@ -188,7 +188,7 @@ static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA* mom, const char* scheme) RegCloseKey(hSchemesKey); RegCloseKey(hKey); - + return TRUE; } @@ -197,39 +197,39 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom) HKEY hKey; BOOL ret; - if (RegOpenKeyA(HKEY_CURRENT_USER, - "Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap", &hKey)) + if (RegOpenKeyA(HKEY_CURRENT_USER, + "Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap", &hKey)) { ret = MIDIMAP_LoadSettingsDefault(mom, NULL); } - else + else { DWORD type, size, out; char buffer[256]; - + ret = 2; size = sizeof(out); - if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out) + if (!RegQueryValueExA(hKey, "UseScheme", 0, &type, (void*)&out, &size) && out) { size = sizeof(buffer); - if (!RegQueryValueExA(hKey, "CurrentScheme", 0, &type, buffer, &size)) + if (!RegQueryValueExA(hKey, "CurrentScheme", 0, &type, buffer, &size)) { if (!(ret = MIDIMAP_LoadSettingsScheme(mom, buffer))) ret = MIDIMAP_LoadSettingsDefault(mom, NULL); } - else + else { ERR("Wrong registry: UseScheme is active, but no CurrentScheme found\n"); } } - if (ret == 2) + if (ret == 2) { size = sizeof(buffer); - if (!RegQueryValueExA(hKey, "CurrentInstrument", 0, &type, buffer, &size) && *buffer) + if (!RegQueryValueExA(hKey, "CurrentInstrument", 0, &type, buffer, &size) && *buffer) { ret = MIDIMAP_LoadSettingsDefault(mom, buffer); } - else + else { ret = MIDIMAP_LoadSettingsDefault(mom, NULL); } @@ -237,13 +237,13 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom) } RegCloseKey(hKey); - if (ret && TRACE_ON(msacm)) + if (ret && TRACE_ON(msacm)) { unsigned i; - for (i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { - TRACE("chnMap[% 2d] => %d\n", + TRACE("chnMap[% 2d] => %d\n", i, mom->ChannelMap[i] ? mom->ChannelMap[i]->uDevID : -1); } } @@ -258,7 +258,7 @@ static DWORD modOpen(LPDWORD lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags) if (!mom) return MMSYSERR_NOMEM; - if (MIDIMAP_LoadSettings(mom)) + if (MIDIMAP_LoadSettings(mom)) { *lpdwUser = (DWORD)mom; mom->self = mom; @@ -276,13 +276,13 @@ static DWORD modClose(MIDIMAPDATA* mom) if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR; - for (i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { DWORD t; - if (mom->ChannelMap[i] && mom->ChannelMap[i]->loaded > 0) + if (mom->ChannelMap[i] && mom->ChannelMap[i]->loaded > 0) { t = midiOutClose(mom->ChannelMap[i]->hMidi); - if (t == MMSYSERR_NOERROR) + if (t == MMSYSERR_NOERROR) { mom->ChannelMap[i]->loaded = 0; mom->ChannelMap[i]->hMidi = 0; @@ -306,9 +306,9 @@ static DWORD modLongData(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD dwParam2) return MMSYSERR_ERROR; mh = *lpMidiHdr; - for (chn = 0; chn < 16; chn++) + for (chn = 0; chn < 16; chn++) { - if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0) + if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0) { mh.dwFlags = 0; midiOutPrepareHeader(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh)); @@ -331,7 +331,7 @@ static DWORD modData(MIDIMAPDATA* mom, DWORD dwParam) if (!mom->ChannelMap[chn]) return MMSYSERR_NOERROR; - switch (lb & 0xF0) + switch (lb & 0xF0) { case 0x80: case 0x90: @@ -340,7 +340,7 @@ static DWORD modData(MIDIMAPDATA* mom, DWORD dwParam) case 0xC0: case 0xD0: case 0xE0: - if (mom->ChannelMap[chn]->loaded == 0) + if (mom->ChannelMap[chn]->loaded == 0) { if (midiOutOpen(&mom->ChannelMap[chn]->hMidi, mom->ChannelMap[chn]->uDevID, 0L, 0L, CALLBACK_NULL) == MMSYSERR_NOERROR) @@ -348,17 +348,17 @@ static DWORD modData(MIDIMAPDATA* mom, DWORD dwParam) else mom->ChannelMap[chn]->loaded = -1; /* FIXME: should load here the IDF midi data... and allow channel and - * patch mappings + * patch mappings */ } - if (mom->ChannelMap[chn]->loaded > 0) + if (mom->ChannelMap[chn]->loaded > 0) { /* change channel */ dwParam &= ~0x0F; dwParam |= mom->ChannelMap[chn]->aChn[chn]; if ((LOBYTE(LOWORD(dwParam)) & 0xF0) == 0xC0 /* program change */ && - mom->ChannelMap[chn]->lpbPatch) + mom->ChannelMap[chn]->lpbPatch) { BYTE patch = HIBYTE(LOWORD(dwParam)); @@ -370,7 +370,7 @@ static DWORD modData(MIDIMAPDATA* mom, DWORD dwParam) } break; case 0xF0: - for (chn = 0; chn < 16; chn++) + for (chn = 0; chn < 16; chn++) { if (mom->ChannelMap[chn]->loaded > 0) ret = midiOutShortMsg(mom->ChannelMap[chn]->hMidi, dwParam); @@ -426,9 +426,9 @@ static DWORD modReset(MIDIMAPDATA* mom) if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR; - for (chn = 0; chn < 16; chn++) + for (chn = 0; chn < 16; chn++) { - if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0) + if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0) { ret = midiOutReset(mom->ChannelMap[chn]->hMidi); if (ret != MMSYSERR_NOERROR) break; @@ -440,13 +440,13 @@ static DWORD modReset(MIDIMAPDATA* mom) /************************************************************************** * modMessage (MIDIMAP.@) */ -DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, +DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); - - switch (wMsg) + + switch (wMsg) { case DRVM_INIT: case DRVM_EXIT: @@ -479,7 +479,7 @@ DWORD WINAPI MIDIMAP_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, *======================================================================*/ /************************************************************************** - * MIDIMAP_drvOpen [internal] + * MIDIMAP_drvOpen [internal] */ static DWORD MIDIMAP_drvOpen(LPSTR str) { @@ -488,13 +488,13 @@ static DWORD MIDIMAP_drvOpen(LPSTR str) if (midiOutPorts) return 0; - + numMidiOutPorts = midiOutGetNumDevs(); - midiOutPorts = HeapAlloc(GetProcessHeap(), 0, + midiOutPorts = HeapAlloc(GetProcessHeap(), 0, numMidiOutPorts * sizeof(MIDIOUTPORT)); - for (dev = 0; dev < numMidiOutPorts; dev++) + for (dev = 0; dev < numMidiOutPorts; dev++) { - if (midiOutGetDevCapsA((HMIDIOUT)dev, &moc, sizeof(moc)) == 0L) + if (midiOutGetDevCapsA((HMIDIOUT)dev, &moc, sizeof(moc)) == 0L) { strcpy(midiOutPorts[dev].name, moc.szPname); midiOutPorts[dev].loaded = 0; @@ -504,7 +504,7 @@ static DWORD MIDIMAP_drvOpen(LPSTR str) for (i = 0; i < 16; i++) midiOutPorts[dev].aChn[i] = i; } - else + else { midiOutPorts[dev].loaded = -1; } @@ -514,11 +514,11 @@ static DWORD MIDIMAP_drvOpen(LPSTR str) } /************************************************************************** - * MIDIMAP_drvClose [internal] + * MIDIMAP_drvClose [internal] */ static DWORD MIDIMAP_drvClose(DWORD dwDevID) { - if (midiOutPorts) + if (midiOutPorts) { HeapFree(GetProcessHeap(), 0, midiOutPorts); midiOutPorts = NULL; @@ -530,13 +530,13 @@ static DWORD MIDIMAP_drvClose(DWORD dwDevID) /************************************************************************** * DriverProc (MIDIMAP.@) */ -LONG CALLBACK MIDIMAP_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK MIDIMAP_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */ /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */ - - switch (wMsg) + + switch (wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c index b70b325bed7..61e80c31080 100644 --- a/dlls/winmm/mmio.c +++ b/dlls/winmm/mmio.c @@ -25,7 +25,7 @@ * + correct handling of global/local IOProcs * + mode of mmio objects is not used (read vs write vs readwrite) * + optimization of internal buffers (seg / lin) - * + even in 32 bit only, a seg ptr IO buffer is allocated (after this is + * + even in 32 bit only, a seg ptr IO buffer is allocated (after this is * fixed, we'll have a proper 32/16 separation) * + thread safeness * + rename operation is broken @@ -52,15 +52,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmio); /************************************************************************** * mmioDosIOProc [internal] */ -static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, - LPARAM lParam1, LPARAM lParam2) +static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, + LPARAM lParam1, LPARAM lParam2) { LRESULT ret = MMSYSERR_NOERROR; TRACE("(%p, %X, 0x%lx, 0x%lx);\n", lpmmioinfo, uMessage, lParam1, lParam2); - + switch (uMessage) { - case MMIOM_OPEN: + case MMIOM_OPEN: { /* Parameters: * lParam1 = szFileName parameter from mmioOpen @@ -75,10 +75,10 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, FIXME("MMIO_GETTEMP not implemented\n"); return MMIOERR_CANNOTOPEN; } - + /* if filename NULL, assume open file handle in adwInfo[0] */ if (!szFileName) { - if (lParam2) + if (lParam2) lpmmioinfo->adwInfo[0] = DosFileHandleToWin32Handle(lpmmioinfo->adwInfo[0]); break; } @@ -87,8 +87,8 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, ret = MMIOERR_CANNOTOPEN; } break; - - case MMIOM_CLOSE: + + case MMIOM_CLOSE: /* Parameters: * lParam1 = wFlags parameter from mmioClose * lParam2 = unused @@ -97,8 +97,8 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, if (!(lParam1 & MMIO_FHOPEN)) _lclose((HFILE)lpmmioinfo->adwInfo[0]); break; - - case MMIOM_READ: + + case MMIOM_READ: /* Parameters: * lParam1 = huge pointer to read buffer * lParam2 = number of bytes to read @@ -108,13 +108,13 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, ret = _lread((HFILE)lpmmioinfo->adwInfo[0], (HPSTR)lParam1, (LONG)lParam2); if (ret != -1) lpmmioinfo->lDiskOffset += ret; - + break; - + case MMIOM_WRITE: - case MMIOM_WRITEFLUSH: + case MMIOM_WRITEFLUSH: /* no internal buffering, so WRITEFLUSH handled same as WRITE */ - + /* Parameters: * lParam1 = huge pointer to write buffer * lParam2 = number of bytes to write @@ -125,8 +125,8 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, if (ret != -1) lpmmioinfo->lDiskOffset += ret; break; - - case MMIOM_SEEK: + + case MMIOM_SEEK: /* Parameters: * lParam1 = new position * lParam2 = from whence to seek (SEEK_SET, SEEK_CUR, SEEK_END) @@ -136,8 +136,8 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, if (ret != -1) lpmmioinfo->lDiskOffset = ret; return ret; - - case MMIOM_RENAME: + + case MMIOM_RENAME: /* Parameters: * lParam1 = old name * lParam2 = new name @@ -151,21 +151,21 @@ static LRESULT CALLBACK mmioDosIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, FIXME("unexpected message %u\n", uMessage); return 0; } - + return ret; } /************************************************************************** * mmioMemIOProc [internal] */ -static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, - LPARAM lParam1, LPARAM lParam2) +static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, + LPARAM lParam1, LPARAM lParam2) { TRACE("(%p,0x%04x,0x%08lx,0x%08lx)\n", lpmmioinfo, uMessage, lParam1, lParam2); switch (uMessage) { - - case MMIOM_OPEN: + + case MMIOM_OPEN: /* Parameters: * lParam1 = filename (must be NULL) * lParam2 = reserved (we use it for 16-bitness) @@ -177,16 +177,16 @@ static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, lpmmioinfo->pchEndRead = lpmmioinfo->pchEndWrite; lpmmioinfo->adwInfo[0] = HFILE_ERROR; return 0; - - case MMIOM_CLOSE: + + case MMIOM_CLOSE: /* Parameters: * lParam1 = wFlags parameter from mmioClose * lParam2 = unused * Returns: zero on success, error code on error */ return 0; - - case MMIOM_READ: + + case MMIOM_READ: /* Parameters: * lParam1 = huge pointer to read buffer * lParam2 = number of bytes to read @@ -196,11 +196,11 @@ static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, */ FIXME("MMIOM_READ on memory files should not occur, buffer may be lost!\n"); return 0; - + case MMIOM_WRITE: - case MMIOM_WRITEFLUSH: + case MMIOM_WRITEFLUSH: /* no internal buffering, so WRITEFLUSH handled same as WRITE */ - + /* Parameters: * lParam1 = huge pointer to write buffer * lParam2 = number of bytes to write @@ -210,8 +210,8 @@ static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, */ FIXME("MMIOM_WRITE on memory files should not occur, buffer may be lost!\n"); return 0; - - case MMIOM_SEEK: + + case MMIOM_SEEK: /* Parameters: * lParam1 = new position * lParam2 = from whence to seek (SEEK_SET, SEEK_CUR, SEEK_END) @@ -220,12 +220,12 @@ static LRESULT CALLBACK mmioMemIOProc(LPMMIOINFO lpmmioinfo, UINT uMessage, */ FIXME("MMIOM_SEEK on memory files should not occur, buffer may be lost!\n"); return -1; - + default: FIXME("unexpected message %u\n", uMessage); return 0; } - + return 0; } @@ -255,7 +255,7 @@ static struct IOProcList* pIOProcListAnchor = &defaultProcs[0]; * * Finds the ProcList node associated with a given FOURCC code. */ -static struct IOProcList* MMIO_FindProcNode(FOURCC fccIOProc) +static struct IOProcList* MMIO_FindProcNode(FOURCC fccIOProc) { struct IOProcList* pListNode; @@ -297,19 +297,19 @@ static LPMMIOPROC MMIO_InstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc, /* Stick it on the end of the list */ pListNode->pNext = pIOProcListAnchor; pIOProcListAnchor = pListNode; - + /* Return this IOProc - that's how the caller knows we succeeded */ lpProc = pIOProc; - } + } break; - + case MMIO_REMOVEPROC: - /* + /* * Search for the node that we're trying to remove - note * that this method won't find the first item on the list, but * since the first two items on this list are ones we won't * let the user delete anyway, that's okay - */ + */ ppListNode = &pIOProcListAnchor; while ((*ppListNode) && (*ppListNode)->fourCC != fccIOProc) ppListNode = &((*ppListNode)->pNext); @@ -323,7 +323,7 @@ static LPMMIOPROC MMIO_InstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc, break; } /* remove it, but only if it isn't builtin */ - if ((*ppListNode) >= defaultProcs && + if ((*ppListNode) >= defaultProcs && (*ppListNode) < defaultProcs + sizeof(defaultProcs)) { WARN("Tried to remove built-in mmio proc. Skipping\n"); } else { @@ -335,14 +335,14 @@ static LPMMIOPROC MMIO_InstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc, } } break; - + case MMIO_FINDPROC: if ((pListNode = MMIO_FindProcNode(fccIOProc))) { lpProc = pListNode->pIOProc; } break; } - + return lpProc; } @@ -394,7 +394,7 @@ static LRESULT MMIO_UnMap32To16(DWORD wMsg, LPARAM lParam1, LPARAM lParam2, /**************************************************************** * MMIO_SendMessage [INTERNAL] */ -static LRESULT MMIO_SendMessage(LPWINE_MMIO wm, DWORD wMsg, LPARAM lParam1, +static LRESULT MMIO_SendMessage(LPWINE_MMIO wm, DWORD wMsg, LPARAM lParam1, LPARAM lParam2, enum mmioProcType type) { MMIOINFO16 mmioInfo16; @@ -442,14 +442,14 @@ static LRESULT MMIO_SendMessage(LPWINE_MMIO wm, DWORD wMsg, LPARAM lParam1, WARN("NIY\n"); } result = (wm->info.pIOProc)((LPSTR)&wm->info, wMsg, lp1, lp2); - + #if 0 if (wm->ioProc->type != type) { /* unmap (lParam1, lParam2) into (lp1, lp2) 16=>32 */ } #endif break; - default: + default: FIXME("Internal error\n"); result = MMSYSERR_ERROR; } @@ -470,31 +470,31 @@ static FOURCC MMIO_ParseExt(LPCSTR szFileName) /* Filenames are of the form file.ext+ABC FIXME: What if a '+' is part of the file name? For now, we take the last '+' present */ - + FOURCC ret = 0; - + /* Note that ext{Start,End} point to the . and + respectively */ LPSTR extEnd; - + TRACE("(%s)\n",debugstr_a(szFileName)); - + if (!szFileName) return ret; extEnd = strrchr(szFileName,'+'); if (extEnd) { /* Need to parse to find the extension */ LPSTR extStart; - + extStart = extEnd; while (extStart >= szFileName && extStart[0] != '.') { extStart--; } - + if (extStart < szFileName) { ERR("+ but no . in szFileName: %s\n", debugstr_a(szFileName)); } else { CHAR ext[5]; - + if (extEnd - extStart - 1 > 4) WARN("Extension length > 4\n"); lstrcpynA(ext,extStart + 1,min(extEnd-extStart,5)); @@ -587,7 +587,7 @@ static MMRESULT MMIO_Flush(WINE_MMIO* wm, UINT uFlags) MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)wm->info.pchBuffer, wm->info.pchNext - wm->info.pchBuffer, MMIO_PROC_32A); } - if (uFlags & MMIO_EMPTYBUF) + if (uFlags & MMIO_EMPTYBUF) wm->info.pchNext = wm->info.pchEndRead = wm->info.pchBuffer; } wm->info.dwFlags &= ~MMIO_DIRTY; @@ -602,10 +602,10 @@ static LONG MMIO_GrabNextBuffer(LPWINE_MMIO wm, int for_read) { LONG size = wm->info.cchBuffer; - TRACE("bo=%lx do=%lx of=%lx\n", - wm->info.lBufOffset, wm->info.lDiskOffset, + TRACE("bo=%lx do=%lx of=%lx\n", + wm->info.lBufOffset, wm->info.lDiskOffset, MMIO_SendMessage(wm, MMIOM_SEEK, 0, SEEK_CUR, MMIO_PROC_32A)); - + wm->info.lBufOffset = wm->info.lDiskOffset; wm->info.pchNext = wm->info.pchBuffer; wm->info.pchEndRead = wm->info.pchBuffer; @@ -625,7 +625,7 @@ static LONG MMIO_GrabNextBuffer(LPWINE_MMIO wm, int for_read) /*************************************************************************** * MMIO_SetBuffer [INTERNAL] */ -static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer, +static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer, UINT uFlags, BOOL bFrom32) { TRACE("(%p %p %ld %u %d)\n", wm, pchBuffer, cchBuffer, uFlags, bFrom32); @@ -633,10 +633,10 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer, if (uFlags) return MMSYSERR_INVALPARAM; if (cchBuffer > 0xFFFF) WARN("Untested handling of huge mmio buffers (%ld >= 64k)\n", cchBuffer); - + if (MMIO_Flush(wm, 0) != MMSYSERR_NOERROR) return MMIOERR_CANNOTWRITE; - + if (wm->hMem && (wm->info.dwFlags & MMIO_ALLOCBUF)) { GlobalUnlock16(wm->hMem); GlobalFree16(wm->hMem); @@ -681,7 +681,7 @@ static MMRESULT MMIO_SetBuffer(WINE_MMIO* wm, void* pchBuffer, LONG cchBuffer, /************************************************************************** * MMIO_Open [internal] */ -static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, +static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags, enum mmioProcType type) { LPWINE_MMIO wm; @@ -690,7 +690,7 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, if (dwOpenFlags & (MMIO_PARSE|MMIO_EXIST)) { char buffer[MAX_PATH]; - + if (GetFullPathNameA(szFileName, sizeof(buffer), buffer, NULL) >= sizeof(buffer)) return (HMMIO16)FALSE; if ((dwOpenFlags & MMIO_EXIST) && (GetFileAttributesA(buffer) == -1)) @@ -698,7 +698,7 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, strcpy(szFileName, buffer); return (HMMIO)TRUE; } - + if ((wm = MMIO_Create()) == NULL) return 0; @@ -713,46 +713,46 @@ static HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, wm->bTmpIOProc = FALSE; } /* if just the four character code is present, look up IO proc */ - else if (refmminfo->pIOProc == NULL) { + else if (refmminfo->pIOProc == NULL) { wm->info.fccIOProc = refmminfo->fccIOProc; if (!(wm->ioProc = MMIO_FindProcNode(wm->info.fccIOProc))) goto error2; wm->info.pIOProc = wm->ioProc->pIOProc; wm->bTmpIOProc = FALSE; - } + } /* if IO proc specified, use it and specified four character code */ else { wm->info.fccIOProc = refmminfo->fccIOProc; wm->info.pIOProc = refmminfo->pIOProc; - MMIO_InstallIOProc(wm->info.fccIOProc, wm->info.pIOProc, + MMIO_InstallIOProc(wm->info.fccIOProc, wm->info.pIOProc, MMIO_INSTALLPROC, type); if (!(wm->ioProc = MMIO_FindProcNode(wm->info.fccIOProc))) goto error2; assert(wm->ioProc->pIOProc == refmminfo->pIOProc); wm->info.pIOProc = wm->ioProc->pIOProc; wm->bTmpIOProc = TRUE; } - + wm->bBufferLoaded = FALSE; wm->ioProc->count++; if (dwOpenFlags & MMIO_ALLOCBUF) { - if ((refmminfo->wErrorRet = MMIO_SetBuffer(wm, NULL, MMIO_DEFAULTBUFFER, 0, + if ((refmminfo->wErrorRet = MMIO_SetBuffer(wm, NULL, MMIO_DEFAULTBUFFER, 0, type != MMIO_PROC_16))) goto error1; } else if (wm->info.fccIOProc == FOURCC_MEM) { - refmminfo->wErrorRet = MMIO_SetBuffer(wm, refmminfo->pchBuffer, - refmminfo->cchBuffer, 0, + refmminfo->wErrorRet = MMIO_SetBuffer(wm, refmminfo->pchBuffer, + refmminfo->cchBuffer, 0, type != MMIO_PROC_16); if (refmminfo->wErrorRet != MMSYSERR_NOERROR) goto error1; wm->bBufferLoaded = TRUE; } /* else => unbuffered, wm->info.pchBuffer == NULL */ - + /* see mmioDosIOProc for that one */ wm->info.adwInfo[0] = refmminfo->adwInfo[0]; wm->info.dwFlags = dwOpenFlags; - + /* call IO proc to actually open file */ - refmminfo->wErrorRet = MMIO_SendMessage(wm, MMIOM_OPEN, (LPARAM)szFileName, + refmminfo->wErrorRet = MMIO_SendMessage(wm, MMIOM_OPEN, (LPARAM)szFileName, type == MMIO_PROC_16, MMIO_PROC_32A); /* grab file size, when possible */ @@ -780,12 +780,12 @@ HMMIO WINAPI mmioOpenW(LPWSTR szFileName, MMIOINFO* lpmmioinfo, ret = MMIO_Open(szFn, lpmmioinfo, dwOpenFlags, MMIO_PROC_32W); } else { MMIOINFO mmioinfo; - + mmioinfo.fccIOProc = 0; mmioinfo.pIOProc = NULL; mmioinfo.pchBuffer = NULL; mmioinfo.cchBuffer = 0; - + ret = MMIO_Open(szFn, &mmioinfo, dwOpenFlags, MMIO_PROC_32W); } @@ -796,21 +796,21 @@ HMMIO WINAPI mmioOpenW(LPWSTR szFileName, MMIOINFO* lpmmioinfo, /************************************************************************** * mmioOpenA [WINMM.@] */ -HMMIO WINAPI mmioOpenA(LPSTR szFileName, MMIOINFO* lpmmioinfo, +HMMIO WINAPI mmioOpenA(LPSTR szFileName, MMIOINFO* lpmmioinfo, DWORD dwOpenFlags) { HMMIO ret; - + if (lpmmioinfo) { ret = MMIO_Open(szFileName, lpmmioinfo, dwOpenFlags, MMIO_PROC_32A); } else { MMIOINFO mmioinfo; - + mmioinfo.fccIOProc = 0; mmioinfo.pIOProc = NULL; mmioinfo.pchBuffer = NULL; mmioinfo.cchBuffer = 0; - + ret = MMIO_Open(szFileName, &mmioinfo, dwOpenFlags, MMIO_PROC_32A); } return ret; @@ -819,27 +819,27 @@ HMMIO WINAPI mmioOpenA(LPSTR szFileName, MMIOINFO* lpmmioinfo, /************************************************************************** * mmioOpen [MMSYSTEM.1210] */ -HMMIO16 WINAPI mmioOpen16(LPSTR szFileName, MMIOINFO16* lpmmioinfo16, +HMMIO16 WINAPI mmioOpen16(LPSTR szFileName, MMIOINFO16* lpmmioinfo16, DWORD dwOpenFlags) { HMMIO ret; MMIOINFO mmio; - + if (lpmmioinfo16) { MMIOINFO mmioinfo; - + memset(&mmioinfo, 0, sizeof(mmioinfo)); - mmioinfo.dwFlags = lpmmioinfo16->dwFlags; - mmioinfo.fccIOProc = lpmmioinfo16->fccIOProc; - mmioinfo.pIOProc = (LPMMIOPROC)lpmmioinfo16->pIOProc; - mmioinfo.cchBuffer = lpmmioinfo16->cchBuffer; + mmioinfo.dwFlags = lpmmioinfo16->dwFlags; + mmioinfo.fccIOProc = lpmmioinfo16->fccIOProc; + mmioinfo.pIOProc = (LPMMIOPROC)lpmmioinfo16->pIOProc; + mmioinfo.cchBuffer = lpmmioinfo16->cchBuffer; mmioinfo.pchBuffer = lpmmioinfo16->pchBuffer; - mmioinfo.adwInfo[0] = lpmmioinfo16->adwInfo[0]; - mmioinfo.adwInfo[1] = lpmmioinfo16->adwInfo[1]; - mmioinfo.adwInfo[2] = lpmmioinfo16->adwInfo[2]; - mmioinfo.adwInfo[3] = lpmmioinfo16->adwInfo[3]; - + mmioinfo.adwInfo[0] = lpmmioinfo16->adwInfo[0]; + mmioinfo.adwInfo[1] = lpmmioinfo16->adwInfo[1]; + mmioinfo.adwInfo[2] = lpmmioinfo16->adwInfo[2]; + mmioinfo.adwInfo[3] = lpmmioinfo16->adwInfo[3]; + ret = MMIO_Open(szFileName, &mmioinfo, dwOpenFlags, MMIO_PROC_16); mmioGetInfo16(mmioinfo.hmmio, lpmmioinfo16, 0); @@ -854,7 +854,7 @@ HMMIO16 WINAPI mmioOpen16(LPSTR szFileName, MMIOINFO16* lpmmioinfo16, return ret; } - + /************************************************************************** * mmioClose [WINMM.@] */ @@ -862,23 +862,23 @@ MMRESULT WINAPI mmioClose(HMMIO hmmio, UINT uFlags) { LPWINE_MMIO wm; MMRESULT result; - + TRACE("(%04X, %04X);\n", hmmio, uFlags); - + if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return MMSYSERR_INVALHANDLE; - + if ((result = MMIO_Flush(wm, 0)) != MMSYSERR_NOERROR) return result; - + result = MMIO_SendMessage(wm, MMIOM_CLOSE, uFlags, 0, MMIO_PROC_32A); - + MMIO_SetBuffer(wm, NULL, 0, 0, TRUE); - + wm->ioProc->count--; if (wm->bTmpIOProc) - MMIO_InstallIOProc(wm->info.fccIOProc, NULL, + MMIO_InstallIOProc(wm->info.fccIOProc, NULL, MMIO_REMOVEPROC, wm->ioProc->type); MMIO_Destroy(wm); @@ -901,9 +901,9 @@ LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch) { LPWINE_MMIO wm; LONG count; - + TRACE("(%04X, %p, %ld);\n", hmmio, pch, cch); - + if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return -1; @@ -921,7 +921,7 @@ LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch) cch -= count; } else count = 0; - + if (cch && (wm->info.fccIOProc != FOURCC_MEM)) { assert(wm->info.cchBuffer); @@ -938,7 +938,7 @@ LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch) count += size; } } - + TRACE("count=%ld\n", count); return count; } @@ -958,12 +958,12 @@ LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch) { LPWINE_MMIO wm; LONG count; - + TRACE("(%04X, %p, %ld);\n", hmmio, pch, cch); if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return -1; - + if (wm->info.cchBuffer) { LONG bytesW = 0; @@ -977,13 +977,13 @@ LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch) pch += count; cch -= count; bytesW += count; - wm->info.dwFlags |= MMIO_DIRTY; + wm->info.dwFlags |= MMIO_DIRTY; } else { if (wm->info.fccIOProc == FOURCC_MEM) { if (wm->info.adwInfo[0]) { /* from where would we get the memory handle? */ FIXME("memory file expansion not implemented!\n"); - break; + break; } else break; } } @@ -1000,7 +1000,7 @@ LONG WINAPI mmioWrite(HMMIO hmmio, HPCSTR pch, LONG cch) count = MMIO_SendMessage(wm, MMIOM_WRITE, (LPARAM)pch, cch, MMIO_PROC_32A); wm->info.lBufOffset = wm->info.lDiskOffset; } - + TRACE("bytes written=%ld\n", count); return count; } @@ -1022,7 +1022,7 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin) LONG offset; TRACE("(%04X, %08lX, %d);\n", hmmio, lOffset, iOrigin); - + if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return MMSYSERR_INVALHANDLE; @@ -1031,13 +1031,13 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin) return MMIO_SendMessage(wm, MMIOM_SEEK, lOffset, iOrigin, MMIO_PROC_32A); switch (iOrigin) { - case SEEK_SET: + case SEEK_SET: offset = lOffset; break; - case SEEK_CUR: + case SEEK_CUR: offset = wm->info.lBufOffset + (wm->info.pchNext - wm->info.pchBuffer) + lOffset; break; - case SEEK_END: + case SEEK_END: offset = ((wm->info.fccIOProc == FOURCC_MEM)? wm->info.cchBuffer : wm->dwFileSize) - lOffset; break; default: @@ -1062,10 +1062,10 @@ LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, INT iOrigin) /* some memory mapped buffers are defined with -1 as a size */ /* condition to change buffer */ - if ((wm->info.fccIOProc == FOURCC_MEM) || + if ((wm->info.fccIOProc == FOURCC_MEM) || MMIO_Flush(wm, 0) != MMSYSERR_NOERROR || /* this also sets the wm->info.lDiskOffset field */ - MMIO_SendMessage(wm, MMIOM_SEEK, + MMIO_SendMessage(wm, MMIOM_SEEK, (offset / wm->info.cchBuffer) * wm->info.cchBuffer, SEEK_SET, MMIO_PROC_32A) == -1) return -1; @@ -1101,25 +1101,25 @@ MMRESULT16 WINAPI mmioGetInfo16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uF if (!wm->buffer16) return MMSYSERR_ERROR; - lpmmioinfo->dwFlags = wm->info.dwFlags; - lpmmioinfo->fccIOProc = wm->info.fccIOProc; - lpmmioinfo->pIOProc = (LPMMIOPROC16)wm->info.pIOProc; - lpmmioinfo->wErrorRet = wm->info.wErrorRet; - lpmmioinfo->hTask = wm->info.hTask; - lpmmioinfo->cchBuffer = wm->info.cchBuffer; + lpmmioinfo->dwFlags = wm->info.dwFlags; + lpmmioinfo->fccIOProc = wm->info.fccIOProc; + lpmmioinfo->pIOProc = (LPMMIOPROC16)wm->info.pIOProc; + lpmmioinfo->wErrorRet = wm->info.wErrorRet; + lpmmioinfo->hTask = wm->info.hTask; + lpmmioinfo->cchBuffer = wm->info.cchBuffer; lpmmioinfo->pchBuffer = (void*)wm->buffer16; lpmmioinfo->pchNext = (void*)(wm->buffer16 + (wm->info.pchNext - wm->info.pchBuffer)); lpmmioinfo->pchEndRead = (void*)(wm->buffer16 + (wm->info.pchEndRead - wm->info.pchBuffer)); - lpmmioinfo->pchEndWrite = (void*)(wm->buffer16 + (wm->info.pchEndWrite - wm->info.pchBuffer)); - lpmmioinfo->lBufOffset = wm->info.lBufOffset; - lpmmioinfo->lDiskOffset = wm->info.lDiskOffset; - lpmmioinfo->adwInfo[0] = wm->info.adwInfo[0]; - lpmmioinfo->adwInfo[1] = wm->info.adwInfo[1]; - lpmmioinfo->adwInfo[2] = wm->info.adwInfo[2]; - lpmmioinfo->adwInfo[3] = wm->info.adwInfo[3]; + lpmmioinfo->pchEndWrite = (void*)(wm->buffer16 + (wm->info.pchEndWrite - wm->info.pchBuffer)); + lpmmioinfo->lBufOffset = wm->info.lBufOffset; + lpmmioinfo->lDiskOffset = wm->info.lDiskOffset; + lpmmioinfo->adwInfo[0] = wm->info.adwInfo[0]; + lpmmioinfo->adwInfo[1] = wm->info.adwInfo[1]; + lpmmioinfo->adwInfo[2] = wm->info.adwInfo[2]; + lpmmioinfo->adwInfo[3] = wm->info.adwInfo[3]; lpmmioinfo->dwReserved1 = 0; lpmmioinfo->dwReserved2 = 0; - lpmmioinfo->hmmio = wm->info.hmmio; + lpmmioinfo->hmmio = wm->info.hmmio; return MMSYSERR_NOERROR; } @@ -1130,7 +1130,7 @@ MMRESULT16 WINAPI mmioGetInfo16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uF MMRESULT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags) { LPWINE_MMIO wm; - + TRACE("(0x%04x,%p,0x%08x)\n",hmmio,lpmmioinfo,uFlags); if ((wm = MMIO_Get(NULL, hmmio)) == NULL) @@ -1157,13 +1157,13 @@ MMRESULT16 WINAPI mmioSetInfo16(HMMIO16 hmmio, const MMIOINFO16* lpmmioinfo, UIN if (wm->info.cchBuffer != lpmmioinfo->cchBuffer || wm->info.pchBuffer != MapSL(wm->buffer16)) return MMSYSERR_INVALPARAM; - + /* check pointers coherence */ - if (lpmmioinfo->pchNext < lpmmioinfo->pchBuffer || + if (lpmmioinfo->pchNext < lpmmioinfo->pchBuffer || lpmmioinfo->pchNext > lpmmioinfo->pchBuffer + lpmmioinfo->cchBuffer || - lpmmioinfo->pchEndRead < lpmmioinfo->pchBuffer || + lpmmioinfo->pchEndRead < lpmmioinfo->pchBuffer || lpmmioinfo->pchEndRead > lpmmioinfo->pchBuffer + lpmmioinfo->cchBuffer || - lpmmioinfo->pchEndWrite < lpmmioinfo->pchBuffer || + lpmmioinfo->pchEndWrite < lpmmioinfo->pchBuffer || lpmmioinfo->pchEndWrite > lpmmioinfo->pchBuffer + lpmmioinfo->cchBuffer) return MMSYSERR_INVALPARAM; @@ -1185,13 +1185,13 @@ MMRESULT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO* lpmmioinfo, UINT uFlags if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return MMSYSERR_INVALHANDLE; - + /* check pointers coherence */ - if (lpmmioinfo->pchNext < wm->info.pchBuffer || + if (lpmmioinfo->pchNext < wm->info.pchBuffer || lpmmioinfo->pchNext > wm->info.pchBuffer + wm->info.cchBuffer || - lpmmioinfo->pchEndRead < wm->info.pchBuffer || + lpmmioinfo->pchEndRead < wm->info.pchBuffer || lpmmioinfo->pchEndRead > wm->info.pchBuffer + wm->info.cchBuffer || - lpmmioinfo->pchEndWrite < wm->info.pchBuffer || + lpmmioinfo->pchEndWrite < wm->info.pchBuffer || lpmmioinfo->pchEndWrite > wm->info.pchBuffer + wm->info.cchBuffer) return MMSYSERR_INVALPARAM; @@ -1210,7 +1210,7 @@ MMRESULT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT TRACE("(hmmio=%04x, pchBuf=%p, cchBuf=%ld, uFlags=%#08x)\n", hmmio, pchBuffer, cchBuffer, uFlags); - + if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return MMSYSERR_INVALHANDLE; @@ -1220,14 +1220,14 @@ MMRESULT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT /************************************************************************** * mmioSetBuffer [MMSYSTEM.1217] */ -MMRESULT16 WINAPI mmioSetBuffer16(HMMIO16 hmmio, LPSTR segpchBuffer, +MMRESULT16 WINAPI mmioSetBuffer16(HMMIO16 hmmio, LPSTR segpchBuffer, LONG cchBuffer, UINT16 uFlags) { LPWINE_MMIO wm; TRACE("(hmmio=%04x, segpchBuf=%p, cchBuf=%ld, uFlags=%#08x)\n", hmmio, segpchBuffer, cchBuffer, uFlags); - + if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return MMSYSERR_INVALHANDLE; @@ -1245,7 +1245,7 @@ MMRESULT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags) if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return MMSYSERR_INVALHANDLE; - + return MMIO_Flush(wm, uFlags); } @@ -1263,7 +1263,7 @@ MMRESULT16 WINAPI mmioFlush16(HMMIO16 hmmio, UINT16 uFlags) MMRESULT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags) { LPWINE_MMIO wm; - + TRACE("hmmio=%04X, lpmmioinfo=%p, uFlags=%04X\n", hmmio, lpmmioinfo, uFlags); if ((wm = MMIO_Get(NULL, hmmio)) == NULL) @@ -1292,9 +1292,9 @@ MMRESULT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO* lpmmioinfo, UINT uFlags) if (lpmmioinfo) { lpmmioinfo->pchNext = lpmmioinfo->pchBuffer; - lpmmioinfo->pchEndRead = lpmmioinfo->pchBuffer + + lpmmioinfo->pchEndRead = lpmmioinfo->pchBuffer + (wm->info.pchEndRead - wm->info.pchBuffer); - lpmmioinfo->pchEndWrite = lpmmioinfo->pchBuffer + + lpmmioinfo->pchEndWrite = lpmmioinfo->pchBuffer + (wm->info.pchEndWrite - wm->info.pchBuffer); lpmmioinfo->lDiskOffset = wm->info.lDiskOffset; lpmmioinfo->lBufOffset = wm->info.lBufOffset; @@ -1324,11 +1324,11 @@ MMRESULT16 WINAPI mmioAdvance16(HMMIO16 hmmio, MMIOINFO16* lpmmioinfo, UINT16 uF return MMIOERR_CANNOTWRITE; MMIO_GrabNextBuffer(wm, uFlags == MMIO_READ); - + lpmmioinfo->pchNext = lpmmioinfo->pchBuffer; - lpmmioinfo->pchEndRead = lpmmioinfo->pchBuffer + + lpmmioinfo->pchEndRead = lpmmioinfo->pchBuffer + (wm->info.pchEndRead - wm->info.pchBuffer); - lpmmioinfo->pchEndWrite = lpmmioinfo->pchBuffer + + lpmmioinfo->pchEndWrite = lpmmioinfo->pchBuffer + (wm->info.pchEndWrite - wm->info.pchBuffer); lpmmioinfo->lDiskOffset = wm->info.lDiskOffset; lpmmioinfo->lBufOffset = wm->info.lBufOffset; @@ -1343,7 +1343,7 @@ FOURCC WINAPI mmioStringToFOURCCA(LPCSTR sz, UINT uFlags) { CHAR cc[4]; int i = 0; - + for (i = 0; i < 4 && sz[i]; i++) { if (uFlags & MMIO_TOUPPER) { cc[i] = toupper(sz[i]); @@ -1351,10 +1351,10 @@ FOURCC WINAPI mmioStringToFOURCCA(LPCSTR sz, UINT uFlags) cc[i] = sz[i]; } } - + /* Pad with spaces */ while (i < 4) cc[i++] = ' '; - + TRACE("Got '%.4s'\n",cc); return mmioFOURCC(cc[0],cc[1],cc[2],cc[3]); } @@ -1366,7 +1366,7 @@ FOURCC WINAPI mmioStringToFOURCCW(LPCWSTR sz, UINT uFlags) { LPSTR szA = HEAP_strdupWtoA(GetProcessHeap(),0,sz); FOURCC ret = mmioStringToFOURCCA(szA,uFlags); - + HeapFree(GetProcessHeap(), 0, szA); return ret; } @@ -1385,14 +1385,14 @@ FOURCC WINAPI mmioStringToFOURCC16(LPCSTR sz, UINT16 uFlags) LPMMIOPROC16 WINAPI mmioInstallIOProc16(FOURCC fccIOProc, LPMMIOPROC16 pIOProc, DWORD dwFlags) { - return (LPMMIOPROC16)MMIO_InstallIOProc(fccIOProc, (LPMMIOPROC)pIOProc, - dwFlags, MMIO_PROC_16); + return (LPMMIOPROC16)MMIO_InstallIOProc(fccIOProc, (LPMMIOPROC)pIOProc, + dwFlags, MMIO_PROC_16); } /************************************************************************** * mmioInstallIOProcA [WINMM.@] */ -LPMMIOPROC WINAPI mmioInstallIOProcA(FOURCC fccIOProc, +LPMMIOPROC WINAPI mmioInstallIOProcA(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags) { return MMIO_InstallIOProc(fccIOProc, pIOProc, dwFlags, MMIO_PROC_32A); @@ -1401,7 +1401,7 @@ LPMMIOPROC WINAPI mmioInstallIOProcA(FOURCC fccIOProc, /************************************************************************** * mmioInstallIOProcW [WINMM.@] */ -LPMMIOPROC WINAPI mmioInstallIOProcW(FOURCC fccIOProc, +LPMMIOPROC WINAPI mmioInstallIOProcW(FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags) { return MMIO_InstallIOProc(fccIOProc, pIOProc, dwFlags, MMIO_PROC_32W); @@ -1414,15 +1414,15 @@ LRESULT WINAPI mmioSendMessage16(HMMIO16 hmmio, UINT16 uMessage, LPARAM lParam1, LPARAM lParam2) { LPWINE_MMIO wm; - + TRACE("(%04X, %u, %ld, %ld)\n", hmmio, uMessage, lParam1, lParam2); if (uMessage < MMIOM_USER) return MMSYSERR_INVALPARAM; - + if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return MMSYSERR_INVALHANDLE; - + return MMIO_SendMessage(wm, uMessage, lParam1, lParam2, MMIO_PROC_16); } @@ -1433,15 +1433,15 @@ LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMessage, LPARAM lParam1, LPARAM lParam2) { LPWINE_MMIO wm; - + TRACE("(%04X, %u, %ld, %ld)\n", hmmio, uMessage, lParam1, lParam2); if (uMessage < MMIOM_USER) return MMSYSERR_INVALPARAM; - + if ((wm = MMIO_Get(NULL, hmmio)) == NULL) return MMSYSERR_INVALHANDLE; - + return MMIO_SendMessage(wm, uMessage, lParam1, lParam2, MMIO_PROC_32A); } @@ -1454,30 +1454,30 @@ MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, DWORD dwOldPos; FOURCC srchCkId; FOURCC srchType; - - + + TRACE("(%04X, %p, %p, %04X);\n", hmmio, lpck, lpckParent, uFlags); - + if (lpck == NULL) return MMSYSERR_INVALPARAM; - + dwOldPos = mmioSeek(hmmio, 0, SEEK_CUR); TRACE("dwOldPos=%ld\n", dwOldPos); - + if (lpckParent != NULL) { TRACE("seek inside parent at %ld !\n", lpckParent->dwDataOffset); /* EPP: was dwOldPos = mmioSeek(hmmio,lpckParent->dwDataOffset,SEEK_SET); */ - if (dwOldPos < lpckParent->dwDataOffset || + if (dwOldPos < lpckParent->dwDataOffset || dwOldPos >= lpckParent->dwDataOffset + lpckParent->cksize) { WARN("outside parent chunk\n"); return MMIOERR_CHUNKNOTFOUND; } } - + /* The SDK docu says 'ckid' is used for all cases. Real World - * examples disagree -Marcus,990216. + * examples disagree -Marcus,990216. */ - + srchType = 0; /* find_chunk looks for 'ckid' */ if (uFlags & MMIO_FINDCHUNK) @@ -1491,15 +1491,15 @@ MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, srchCkId = FOURCC_RIFF; srchType = lpck->fccType; } - + if (uFlags & (MMIO_FINDCHUNK|MMIO_FINDLIST|MMIO_FINDRIFF)) { - TRACE("searching for %.4s.%.4s\n", + TRACE("searching for %.4s.%.4s\n", (LPSTR)&srchCkId, srchType?(LPSTR)&srchType:"any "); - + while (TRUE) { LONG ix; - + ix = mmioRead(hmmio, (LPSTR)lpck, 3 * sizeof(DWORD)); if (ix < 2*sizeof(DWORD)) { mmioSeek(hmmio, dwOldPos, SEEK_SET); @@ -1513,14 +1513,14 @@ MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, return MMIOERR_CHUNKNOTFOUND; } TRACE("ckid=%.4s fcc=%.4s cksize=%08lX !\n", - (LPSTR)&lpck->ckid, + (LPSTR)&lpck->ckid, srchType?(LPSTR)&lpck->fccType:"", lpck->cksize); if ((srchCkId == lpck->ckid) && (!srchType || (srchType == lpck->fccType)) ) break; - + dwOldPos = lpck->dwDataOffset + ((lpck->cksize + 1) & ~1); mmioSeek(hmmio, dwOldPos, SEEK_SET); } @@ -1543,8 +1543,8 @@ MMRESULT WINAPI mmioDescend(HMMIO hmmio, LPMMCKINFO lpck, mmioSeek(hmmio, lpck->dwDataOffset + sizeof(DWORD), SEEK_SET); else mmioSeek(hmmio, lpck->dwDataOffset, SEEK_SET); - TRACE("lpck: ckid=%.4s, cksize=%ld, dwDataOffset=%ld fccType=%08lX (%.4s)!\n", - (LPSTR)&lpck->ckid, lpck->cksize, lpck->dwDataOffset, + TRACE("lpck: ckid=%.4s, cksize=%ld, dwDataOffset=%ld fccType=%08lX (%.4s)!\n", + (LPSTR)&lpck->ckid, lpck->cksize, lpck->dwDataOffset, lpck->fccType, srchType?(LPSTR)&lpck->fccType:""); return MMSYSERR_NOERROR; } @@ -1564,10 +1564,10 @@ MMRESULT16 WINAPI mmioDescend16(HMMIO16 hmmio, LPMMCKINFO lpck, MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags) { TRACE("(%04X, %p, %04X);\n", hmmio, lpck, uFlags); - + if (lpck->dwFlags & MMIO_DIRTY) { DWORD dwOldPos, dwNewSize; - + TRACE("Chunk is dirty, checking if chunk's size is correct\n"); dwOldPos = mmioSeek(hmmio, 0, SEEK_CUR); TRACE("dwOldPos=%ld lpck->dwDataOffset = %ld\n", dwOldPos, lpck->dwDataOffset); @@ -1575,7 +1575,7 @@ MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags) if (dwNewSize != lpck->cksize) { TRACE("Nope: lpck->cksize=%ld dwNewSize=%ld\n", lpck->cksize, dwNewSize); lpck->cksize = dwNewSize; - + /* pad odd size with 0 */ if (dwNewSize & 1) { char ch = 0; @@ -1586,9 +1586,9 @@ MMRESULT WINAPI mmioAscend(HMMIO hmmio, LPMMCKINFO lpck, UINT uFlags) } lpck->dwFlags = 0; } - + mmioSeek(hmmio, lpck->dwDataOffset + ((lpck->cksize + 1) & ~1), SEEK_SET); - + return MMSYSERR_NOERROR; } @@ -1608,26 +1608,26 @@ MMRESULT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO* lpck, UINT uFlags) DWORD dwOldPos; LONG size; LONG ix; - + TRACE("(%04X, %p, %04X);\n", hmmio, lpck, uFlags); - + dwOldPos = mmioSeek(hmmio, 0, SEEK_CUR); TRACE("dwOldPos=%ld\n", dwOldPos); - + if (uFlags == MMIO_CREATELIST) lpck->ckid = FOURCC_LIST; else if (uFlags == MMIO_CREATERIFF) lpck->ckid = FOURCC_RIFF; - + TRACE("ckid=%.4s\n", (LPSTR)&lpck->ckid); - + size = 2 * sizeof(DWORD); lpck->dwDataOffset = dwOldPos + size; - - if (lpck->ckid == FOURCC_RIFF || lpck->ckid == FOURCC_LIST) + + if (lpck->ckid == FOURCC_RIFF || lpck->ckid == FOURCC_LIST) size += sizeof(DWORD); lpck->dwFlags = MMIO_DIRTY; - + ix = mmioWrite(hmmio, (LPSTR)lpck, size); TRACE("after mmioWrite ix = %ld req = %ld, errno = %d\n",ix, size, errno); if (ix < size) { @@ -1658,7 +1658,7 @@ MMRESULT16 WINAPI mmioRename16(LPCSTR szFileName, LPCSTR szNewFileName, TRACE("('%s', '%s', %p, %08lX);\n", szFileName, szNewFileName, lpmmioinfo, dwRenameFlags); - + /* If both params are NULL, then parse the file name */ if (lpmmioinfo && lpmmioinfo->fccIOProc == 0 && lpmmioinfo->pIOProc == NULL) lpmmioinfo->fccIOProc = MMIO_ParseExt(szFileName); @@ -1676,10 +1676,10 @@ MMRESULT16 WINAPI mmioRename16(LPCSTR szFileName, LPCSTR szNewFileName, * thunk somewhere. The main issue is that Wine's current thunking * 32 to 16 only supports pascal calling convention */ - if (ioProc) - result = (ioProc)(0, MMIOM_RENAME, + if (ioProc) + result = (ioProc)(0, MMIOM_RENAME, (LPARAM)szFileName, (LPARAM)szNewFileName); - + return result; } @@ -1704,15 +1704,15 @@ MMRESULT WINAPI mmioRenameA(LPCSTR szFileName, LPCSTR szNewFileName, ioProc = (LPMMIOPROC)mmioDosIOProc; /* if just the four character code is present, look up IO proc */ else if (lpmmioinfo->pIOProc == NULL) - ioProc = MMIO_InstallIOProc(lpmmioinfo->fccIOProc, NULL, + ioProc = MMIO_InstallIOProc(lpmmioinfo->fccIOProc, NULL, MMIO_FINDPROC, MMIO_PROC_32A); else /* use relevant ioProc */ ioProc = lpmmioinfo->pIOProc; - if (ioProc) - result = (ioProc)(0, MMIOM_RENAME, + if (ioProc) + result = (ioProc)(0, MMIOM_RENAME, (LPARAM)szFileName, (LPARAM)szNewFileName); - + return result; } @@ -1725,7 +1725,7 @@ MMRESULT WINAPI mmioRenameW(LPCWSTR szFileName, LPCWSTR szNewFileName, LPSTR szFn = HEAP_strdupWtoA(GetProcessHeap(), 0, szFileName); LPSTR sznFn = HEAP_strdupWtoA(GetProcessHeap(), 0, szNewFileName); UINT ret = mmioRenameA(szFn, sznFn, lpmmioinfo, dwRenameFlags); - + HeapFree(GetProcessHeap(),0,szFn); HeapFree(GetProcessHeap(),0,sznFn); return ret; diff --git a/dlls/winmm/mmsystem.c b/dlls/winmm/mmsystem.c index 6e54f29781c..33c9132df60 100644 --- a/dlls/winmm/mmsystem.c +++ b/dlls/winmm/mmsystem.c @@ -20,15 +20,15 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* - * Eric POUECH : +/* + * Eric POUECH : * 98/9 added Win32 MCI support * 99/4 added mmTask and mmThread functions support * added midiStream support * 99/9 added support for loadable low level drivers */ -/* FIXME: I think there are some segmented vs. linear pointer weirdnesses +/* FIXME: I think there are some segmented vs. linear pointer weirdnesses * and long term pointers to 16 bit space in here */ @@ -83,7 +83,7 @@ LPWINE_MM_IDATA MULTIMEDIA_GetIData(void) static BOOL MULTIMEDIA_CreateIData(HINSTANCE hInstDLL) { LPWINE_MM_IDATA iData; - + iData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_MM_IDATA)); if (!iData) @@ -107,7 +107,7 @@ static void MULTIMEDIA_DeleteIData(void) { LPWINE_MM_IDATA iData = MULTIMEDIA_GetIDataNoCheck(); LPWINE_MM_IDATA* ppid; - + if (iData) { TIME_MMTimeStop(); @@ -117,7 +117,7 @@ static void MULTIMEDIA_DeleteIData(void) break; } } - /* FIXME: should also free content and resources allocated + /* FIXME: should also free content and resources allocated * inside iData */ CloseHandle(iData->psStopEvent); CloseHandle(iData->psLastEvent); @@ -161,7 +161,7 @@ BOOL WINAPI WINMM_LibMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad) * MMSYSTEM DLL entry point * */ -BOOL WINAPI MMSYSTEM_LibMain(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds, +BOOL WINAPI MMSYSTEM_LibMain(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds, WORD wHeapSize, DWORD dwReserved1, WORD wReserved2) { HANDLE hndl; @@ -176,7 +176,7 @@ BOOL WINAPI MMSYSTEM_LibMain(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds, * - create correctly the per process WINE_MM_IDATA chunk */ hndl = LoadLibraryA("WINMM.DLL"); - + if (!hndl) { ERR("Could not load sibling WinMM.dll\n"); return FALSE; @@ -206,7 +206,7 @@ int WINAPI MMSYSTEM_WEP(HINSTANCE16 hInstance, WORD wDataSeg, return TRUE; } -void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32) +void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32) { mmt16->wType = mmt32->wType; /* layout of rest is the same for 32/16, @@ -215,7 +215,7 @@ void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32) memcpy(&(mmt16->u), &(mmt32->u), sizeof(mmt16->u)); } -void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16) +void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16) { mmt32->wType = mmt16->wType; /* layout of rest is the same for 32/16, @@ -241,7 +241,7 @@ static HMMIO get_mmioFromFile(LPCWSTR lpszName) return 0; } -static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName) +static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName) { WCHAR str[128]; LPWSTR ptr; @@ -259,7 +259,7 @@ static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName) TRACE("searching in SystemSound list for %s\n", debugstr_w(lpszName)); GetProfileStringW(wszSounds, (LPWSTR)lpszName, wszNull, str, sizeof(str)/sizeof(str[0])); - if (lstrlenW(str) == 0) + if (lstrlenW(str) == 0) { if (uFlags & SND_NODEFAULT) goto next; GetProfileStringW(wszSounds, wszDefault, wszNull, str, sizeof(str)/sizeof(str[0])); @@ -314,14 +314,14 @@ static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName) return 0; } -struct playsound_data +struct playsound_data { HANDLE hEvent; DWORD dwEventCount; }; -static void CALLBACK PlaySound_Callback(HWAVEOUT hwo, UINT uMsg, - DWORD dwInstance, +static void CALLBACK PlaySound_Callback(HWAVEOUT hwo, UINT uMsg, + DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { struct playsound_data* s = (struct playsound_data*)dwInstance; @@ -340,13 +340,13 @@ static void CALLBACK PlaySound_Callback(HWAVEOUT hwo, UINT uMsg, } } -static void PlaySound_WaitDone(struct playsound_data* s) +static void PlaySound_WaitDone(struct playsound_data* s) { for (;;) { ResetEvent(s->hEvent); if (InterlockedDecrement(&s->dwEventCount) >= 0) break; InterlockedIncrement(&s->dwEventCount); - + WaitForSingleObject(s->hEvent, INFINITE); } } @@ -362,7 +362,7 @@ static BOOL PlaySound_IsString(DWORD fdwSound, const void* psz) case SND_MEMORY: return FALSE; case SND_ALIAS: /* what about ALIAS_ID ??? */ case SND_FILENAME: - case 0: return TRUE; + case 0: return TRUE; default: FIXME("WTF\n"); return FALSE; } } @@ -381,7 +381,7 @@ static void PlaySound_Free(WINE_PLAYSOUND* wps) HeapFree(GetProcessHeap(), 0, wps); } -static WINE_PLAYSOUND* PlaySound_Alloc(const void* pszSound, HMODULE hmod, +static WINE_PLAYSOUND* PlaySound_Alloc(const void* pszSound, HMODULE hmod, DWORD fdwSound, BOOL bUnicode) { WINE_PLAYSOUND* wps; @@ -397,7 +397,7 @@ static WINE_PLAYSOUND* PlaySound_Alloc(const void* pszSound, HMODULE hmod, { if (fdwSound & SND_ASYNC) { - wps->pszSound = HeapAlloc(GetProcessHeap(), 0, + wps->pszSound = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pszSound)+1) * sizeof(WCHAR)); if (!wps->pszSound) goto oom_error; lstrcpyW((LPWSTR)wps->pszSound, pszSound); @@ -446,7 +446,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg) static WCHAR wszWave[] = {'W','A','V','E',0}; HRSRC hRes; HGLOBAL hGlob; - + if ((hRes = FindResourceW(wps->hMod, wps->pszSound, wszWave)) == 0 || (hGlob = LoadResource(wps->hMod, hRes)) == 0) goto errCleanUp; @@ -480,9 +480,9 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg) } else { - if ((hmmio = get_mmioFromProfile(wps->fdwSound | SND_NODEFAULT, wps->pszSound)) == 0) + if ((hmmio = get_mmioFromProfile(wps->fdwSound | SND_NODEFAULT, wps->pszSound)) == 0) { - if ((hmmio = get_mmioFromFile(wps->pszSound)) == 0) + if ((hmmio = get_mmioFromFile(wps->pszSound)) == 0) { hmmio = get_mmioFromProfile(wps->fdwSound, wps->pszSound); } @@ -525,7 +525,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg) if (mmioDescend(hmmio, &mmckInfo, &ckMainRIFF, MMIO_FINDCHUNK)) goto errCleanUp; - TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n", + TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n", (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize); s.hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); @@ -544,7 +544,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg) waveHdr[0].dwLoops = waveHdr[1].dwLoops = 0L; waveHdr[0].dwFlags = waveHdr[1].dwFlags = 0L; waveHdr[0].dwBufferLength = waveHdr[1].dwBufferLength = bufsize; - if (waveOutPrepareHeader(hWave, &waveHdr[0], sizeof(WAVEHDR)) || + if (waveOutPrepareHeader(hWave, &waveHdr[0], sizeof(WAVEHDR)) || waveOutPrepareHeader(hWave, &waveHdr[1], sizeof(WAVEHDR))) { goto errCleanUp; } @@ -555,7 +555,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg) s.dwEventCount = 1L; /* for first buffer */ mmioSeek(hmmio, mmckInfo.dwDataOffset, SEEK_SET); - while (left) + while (left) { if (WaitForSingleObject(iData->psStopEvent, 0) == WAIT_OBJECT_0) { @@ -602,11 +602,11 @@ static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSo TRACE("pszSound='%p' hmod=%04X fdwSound=%08lX\n", pszSound, hmod, fdwSound); - + /* FIXME? I see no difference between SND_NOWAIT and SND_NOSTOP ! * there could be one if several sounds can be played at once... - */ - if ((fdwSound & (SND_NOWAIT | SND_NOSTOP)) && iData->lpPlaySound != NULL) + */ + if ((fdwSound & (SND_NOWAIT | SND_NOSTOP)) && iData->lpPlaySound != NULL) return FALSE; /* alloc internal structure, if we need to play something */ @@ -615,7 +615,7 @@ static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSo if (!(wps = PlaySound_Alloc(pszSound, hmod, fdwSound, bUnicode))) return FALSE; } - + EnterCriticalSection(&iData->cs); /* since several threads can enter PlaySound in parallel, we're not * sure, at this point, that another thread didn't start a new playsound @@ -640,7 +640,7 @@ static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSo if (!pszSound || (fdwSound & SND_PURGE)) return TRUE; - if (fdwSound & SND_ASYNC) + if (fdwSound & SND_ASYNC) { DWORD id; wps->bLoop = (fdwSound & SND_LOOP) ? TRUE : FALSE; @@ -739,8 +739,8 @@ UINT WINAPI mmsystemGetVersion(void) /************************************************************************** * DriverCallback [WINMM.@] */ -BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, - UINT wMsg, DWORD dwUser, DWORD dwParam1, +BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, + UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { TRACE("(%08lX, %04X, %04X, %04X, %08lX, %08lX, %08lX); !\n", @@ -782,7 +782,7 @@ BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, SetEvent(lpMMThd->hEvent); /* some other stuff on lpMMThd->hVxD */ } - break; + break; #if 0 case 4: /* this is an undocumented DCB_ value for... I don't know */ @@ -799,8 +799,8 @@ BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, /************************************************************************** * DriverCallback [MMSYSTEM.31] */ -BOOL16 WINAPI DriverCallback16(DWORD dwCallBack, UINT16 uFlags, HDRVR16 hDev, - WORD wMsg, DWORD dwUser, DWORD dwParam1, +BOOL16 WINAPI DriverCallback16(DWORD dwCallBack, UINT16 uFlags, HDRVR16 hDev, + WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { return DriverCallback(dwCallBack, uFlags, hDev, wMsg, dwUser, dwParam1, dwParam2); @@ -813,7 +813,7 @@ BOOL16 WINAPI DriverCallback16(DWORD dwCallBack, UINT16 uFlags, HDRVR16 hDev, /************************************************************************** * find out the real mixer ID depending on hmix (depends on dwFlags) */ -static LPWINE_MIXER MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags) +static LPWINE_MIXER MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags) { LPWINE_MIXER lpwm = NULL; @@ -861,7 +861,7 @@ static LPWINE_MIXER MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags) /************************************************************************** * mixerGetNumDevs [WINMM.@] */ -UINT WINAPI mixerGetNumDevs(void) +UINT WINAPI mixerGetNumDevs(void) { return MMDRV_GetNum(MMDRV_MIXER); } @@ -869,7 +869,7 @@ UINT WINAPI mixerGetNumDevs(void) /************************************************************************** * mixerGetNumDevs [MMSYSTEM.800] */ -UINT16 WINAPI mixerGetNumDevs16(void) +UINT16 WINAPI mixerGetNumDevs16(void) { return MMDRV_GetNum(MMDRV_MIXER); } @@ -877,7 +877,7 @@ UINT16 WINAPI mixerGetNumDevs16(void) /************************************************************************** * mixerGetDevCapsA [WINMM.@] */ -UINT WINAPI mixerGetDevCapsA(UINT devid, LPMIXERCAPSA mixcaps, UINT size) +UINT WINAPI mixerGetDevCapsA(UINT devid, LPMIXERCAPSA mixcaps, UINT size) { LPWINE_MLD wmld; @@ -890,7 +890,7 @@ UINT WINAPI mixerGetDevCapsA(UINT devid, LPMIXERCAPSA mixcaps, UINT size) /************************************************************************** * mixerGetDevCapsW [WINMM.@] */ -UINT WINAPI mixerGetDevCapsW(UINT devid, LPMIXERCAPSW mixcaps, UINT size) +UINT WINAPI mixerGetDevCapsW(UINT devid, LPMIXERCAPSW mixcaps, UINT size) { MIXERCAPSA micA; UINT ret = mixerGetDevCapsA(devid, &micA, sizeof(micA)); @@ -910,12 +910,12 @@ UINT WINAPI mixerGetDevCapsW(UINT devid, LPMIXERCAPSW mixcaps, UINT size) /************************************************************************** * mixerGetDevCaps [MMSYSTEM.801] */ -UINT16 WINAPI mixerGetDevCaps16(UINT16 devid, LPMIXERCAPS16 mixcaps, - UINT16 size) +UINT16 WINAPI mixerGetDevCaps16(UINT16 devid, LPMIXERCAPS16 mixcaps, + UINT16 size) { MIXERCAPSA micA; UINT ret = mixerGetDevCapsA(devid, &micA, sizeof(micA)); - + if (ret == MMSYSERR_NOERROR) { mixcaps->wMid = micA.wMid; mixcaps->wPid = micA.wPid; @@ -928,7 +928,7 @@ UINT16 WINAPI mixerGetDevCaps16(UINT16 devid, LPMIXERCAPS16 mixcaps, } static UINT MMSYSTEM_mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32) + DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32) { HMIXER hMix; LPWINE_MLD wmld; @@ -962,9 +962,9 @@ static UINT MMSYSTEM_mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallbac * mixerOpen [WINMM.@] */ UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen) + DWORD dwInstance, DWORD fdwOpen) { - return MMSYSTEM_mixerOpen(lphMix, uDeviceID, + return MMSYSTEM_mixerOpen(lphMix, uDeviceID, dwCallback, dwInstance, fdwOpen, TRUE); } @@ -972,12 +972,12 @@ UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD dwCallback, * mixerOpen [MMSYSTEM.802] */ UINT16 WINAPI mixerOpen16(LPHMIXER16 lphmix, UINT16 uDeviceID, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen) + DWORD dwInstance, DWORD fdwOpen) { HMIXER hmix; UINT ret; - - ret = MMSYSTEM_mixerOpen(&hmix, uDeviceID, + + ret = MMSYSTEM_mixerOpen(&hmix, uDeviceID, dwCallback, dwInstance, fdwOpen, FALSE); if (lphmix) *lphmix = hmix; return ret; @@ -986,11 +986,11 @@ UINT16 WINAPI mixerOpen16(LPHMIXER16 lphmix, UINT16 uDeviceID, DWORD dwCallback, /************************************************************************** * mixerClose [WINMM.@] */ -UINT WINAPI mixerClose(HMIXER hMix) +UINT WINAPI mixerClose(HMIXER hMix) { LPWINE_MLD wmld; - DWORD dwRet; - + DWORD dwRet; + TRACE("(%04x)\n", hMix); if ((wmld = MMDRV_Get(hMix, MMDRV_MIXER, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; @@ -1004,7 +1004,7 @@ UINT WINAPI mixerClose(HMIXER hMix) /************************************************************************** * mixerClose [MMSYSTEM.803] */ -UINT16 WINAPI mixerClose16(HMIXER16 hMix) +UINT16 WINAPI mixerClose16(HMIXER16 hMix) { return mixerClose(hMix); } @@ -1012,7 +1012,7 @@ UINT16 WINAPI mixerClose16(HMIXER16 hMix) /************************************************************************** * mixerGetID [WINMM.@] */ -UINT WINAPI mixerGetID(HMIXEROBJ hmix, LPUINT lpid, DWORD fdwID) +UINT WINAPI mixerGetID(HMIXEROBJ hmix, LPUINT lpid, DWORD fdwID) { LPWINE_MIXER lpwm; @@ -1031,12 +1031,12 @@ UINT WINAPI mixerGetID(HMIXEROBJ hmix, LPUINT lpid, DWORD fdwID) /************************************************************************** * mixerGetID (MMSYSTEM.806) */ -UINT16 WINAPI mixerGetID16(HMIXEROBJ16 hmix, LPUINT16 lpid, DWORD fdwID) +UINT16 WINAPI mixerGetID16(HMIXEROBJ16 hmix, LPUINT16 lpid, DWORD fdwID) { - UINT xid; + UINT xid; UINT ret = mixerGetID(hmix, &xid, fdwID); - if (lpid) + if (lpid) *lpid = xid; return ret; } @@ -1045,26 +1045,26 @@ UINT16 WINAPI mixerGetID16(HMIXEROBJ16 hmix, LPUINT16 lpid, DWORD fdwID) * mixerGetControlDetailsA [WINMM.@] */ UINT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA, - DWORD fdwDetails) + DWORD fdwDetails) { LPWINE_MIXER lpwm; TRACE("(%04x, %p, %08lx)\n", hmix, lpmcdA, fdwDetails); - if ((lpwm = MIXER_GetDev(hmix, fdwDetails)) == NULL) + if ((lpwm = MIXER_GetDev(hmix, fdwDetails)) == NULL) return MMSYSERR_INVALHANDLE; if (lpmcdA == NULL || lpmcdA->cbStruct != sizeof(*lpmcdA)) return MMSYSERR_INVALPARAM; - return MMDRV_Message(&lpwm->mld, MXDM_GETCONTROLDETAILS, (DWORD)lpmcdA, + return MMDRV_Message(&lpwm->mld, MXDM_GETCONTROLDETAILS, (DWORD)lpmcdA, fdwDetails, TRUE); } /************************************************************************** * mixerGetControlDetailsW [WINMM.@] */ -UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails) +UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails) { DWORD ret = MMSYSERR_NOTENABLED; @@ -1122,9 +1122,9 @@ UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, /************************************************************************** * mixerGetControlDetails [MMSYSTEM.808] */ -UINT16 WINAPI mixerGetControlDetails16(HMIXEROBJ16 hmix, - LPMIXERCONTROLDETAILS16 lpmcd, - DWORD fdwDetails) +UINT16 WINAPI mixerGetControlDetails16(HMIXEROBJ16 hmix, + LPMIXERCONTROLDETAILS16 lpmcd, + DWORD fdwDetails) { DWORD ret = MMSYSERR_NOTENABLED; SEGPTR sppaDetails; @@ -1145,28 +1145,28 @@ UINT16 WINAPI mixerGetControlDetails16(HMIXEROBJ16 hmix, /************************************************************************** * mixerGetLineControlsA [WINMM.@] */ -UINT WINAPI mixerGetLineControlsA(HMIXEROBJ hmix, LPMIXERLINECONTROLSA lpmlcA, - DWORD fdwControls) +UINT WINAPI mixerGetLineControlsA(HMIXEROBJ hmix, LPMIXERLINECONTROLSA lpmlcA, + DWORD fdwControls) { LPWINE_MIXER lpwm; TRACE("(%04x, %p, %08lx)\n", hmix, lpmlcA, fdwControls); - if ((lpwm = MIXER_GetDev(hmix, fdwControls)) == NULL) + if ((lpwm = MIXER_GetDev(hmix, fdwControls)) == NULL) return MMSYSERR_INVALHANDLE; if (lpmlcA == NULL || lpmlcA->cbStruct != sizeof(*lpmlcA)) return MMSYSERR_INVALPARAM; - return MMDRV_Message(&lpwm->mld, MXDM_GETLINECONTROLS, (DWORD)lpmlcA, + return MMDRV_Message(&lpwm->mld, MXDM_GETLINECONTROLS, (DWORD)lpmlcA, fdwControls, TRUE); } /************************************************************************** * mixerGetLineControlsW [WINMM.@] */ -UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, - DWORD fdwControls) +UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, + DWORD fdwControls) { MIXERLINECONTROLSA mlcA; DWORD ret; @@ -1174,7 +1174,7 @@ UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, TRACE("(%04x, %p, %08lx)\n", hmix, lpmlcW, fdwControls); - if (lpmlcW == NULL || lpmlcW->cbStruct != sizeof(*lpmlcW) || + if (lpmlcW == NULL || lpmlcW->cbStruct != sizeof(*lpmlcW) || lpmlcW->cbmxctrl != sizeof(MIXERCONTROLW)) return MMSYSERR_INVALPARAM; @@ -1184,7 +1184,7 @@ UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, mlcA.u.dwControlType = lpmlcW->u.dwControlType; mlcA.cControls = lpmlcW->cControls; mlcA.cbmxctrl = sizeof(MIXERCONTROLA); - mlcA.pamxctrl = HeapAlloc(GetProcessHeap(), 0, + mlcA.pamxctrl = HeapAlloc(GetProcessHeap(), 0, mlcA.cControls * mlcA.cbmxctrl); ret = mixerGetLineControlsA(hmix, &mlcA, fdwControls); @@ -1194,7 +1194,7 @@ UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, lpmlcW->u.dwControlID = mlcA.u.dwControlID; lpmlcW->u.dwControlType = mlcA.u.dwControlType; lpmlcW->cControls = mlcA.cControls; - + for (i = 0; i < mlcA.cControls; i++) { lpmlcW->pamxctrl[i].cbStruct = sizeof(MIXERCONTROLW); lpmlcW->pamxctrl[i].dwControlID = mlcA.pamxctrl[i].dwControlID; @@ -1207,13 +1207,13 @@ UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, MultiByteToWideChar( CP_ACP, 0, mlcA.pamxctrl[i].szName, -1, lpmlcW->pamxctrl[i].szName, sizeof(lpmlcW->pamxctrl[i].szName)/sizeof(WCHAR) ); - /* sizeof(lpmlcW->pamxctrl[i].Bounds) == + /* sizeof(lpmlcW->pamxctrl[i].Bounds) == * sizeof(mlcA.pamxctrl[i].Bounds) */ - memcpy(&lpmlcW->pamxctrl[i].Bounds, &mlcA.pamxctrl[i].Bounds, + memcpy(&lpmlcW->pamxctrl[i].Bounds, &mlcA.pamxctrl[i].Bounds, sizeof(mlcA.pamxctrl[i].Bounds)); - /* sizeof(lpmlcW->pamxctrl[i].Metrics) == + /* sizeof(lpmlcW->pamxctrl[i].Metrics) == * sizeof(mlcA.pamxctrl[i].Metrics) */ - memcpy(&lpmlcW->pamxctrl[i].Metrics, &mlcA.pamxctrl[i].Metrics, + memcpy(&lpmlcW->pamxctrl[i].Metrics, &mlcA.pamxctrl[i].Metrics, sizeof(mlcA.pamxctrl[i].Metrics)); } } @@ -1226,9 +1226,9 @@ UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, /************************************************************************** * mixerGetLineControls [MMSYSTEM.807] */ -UINT16 WINAPI mixerGetLineControls16(HMIXEROBJ16 hmix, - LPMIXERLINECONTROLS16 lpmlc16, - DWORD fdwControls) +UINT16 WINAPI mixerGetLineControls16(HMIXEROBJ16 hmix, + LPMIXERLINECONTROLS16 lpmlc16, + DWORD fdwControls) { MIXERLINECONTROLSA mlcA; DWORD ret; @@ -1237,7 +1237,7 @@ UINT16 WINAPI mixerGetLineControls16(HMIXEROBJ16 hmix, TRACE("(%04x, %p, %08lx)\n", hmix, lpmlc16, fdwControls); - if (lpmlc16 == NULL || lpmlc16->cbStruct != sizeof(*lpmlc16) || + if (lpmlc16 == NULL || lpmlc16->cbStruct != sizeof(*lpmlc16) || lpmlc16->cbmxctrl != sizeof(MIXERCONTROL16)) return MMSYSERR_INVALPARAM; @@ -1247,7 +1247,7 @@ UINT16 WINAPI mixerGetLineControls16(HMIXEROBJ16 hmix, mlcA.u.dwControlType = lpmlc16->u.dwControlType; mlcA.cControls = lpmlc16->cControls; mlcA.cbmxctrl = sizeof(MIXERCONTROLA); - mlcA.pamxctrl = HeapAlloc(GetProcessHeap(), 0, + mlcA.pamxctrl = HeapAlloc(GetProcessHeap(), 0, mlcA.cControls * mlcA.cbmxctrl); ret = mixerGetLineControlsA(hmix, &mlcA, fdwControls); @@ -1257,9 +1257,9 @@ UINT16 WINAPI mixerGetLineControls16(HMIXEROBJ16 hmix, lpmlc16->u.dwControlID = mlcA.u.dwControlID; lpmlc16->u.dwControlType = mlcA.u.dwControlType; lpmlc16->cControls = mlcA.cControls; - + lpmc16 = MapSL(lpmlc16->pamxctrl); - + for (i = 0; i < mlcA.cControls; i++) { lpmc16[i].cbStruct = sizeof(MIXERCONTROL16); lpmc16[i].dwControlID = mlcA.pamxctrl[i].dwControlID; @@ -1269,10 +1269,10 @@ UINT16 WINAPI mixerGetLineControls16(HMIXEROBJ16 hmix, strcpy(lpmc16[i].szShortName, mlcA.pamxctrl[i].szShortName); strcpy(lpmc16[i].szName, mlcA.pamxctrl[i].szName); /* sizeof(lpmc16[i].Bounds) == sizeof(mlcA.pamxctrl[i].Bounds) */ - memcpy(&lpmc16[i].Bounds, &mlcA.pamxctrl[i].Bounds, + memcpy(&lpmc16[i].Bounds, &mlcA.pamxctrl[i].Bounds, sizeof(mlcA.pamxctrl[i].Bounds)); /* sizeof(lpmc16[i].Metrics) == sizeof(mlcA.pamxctrl[i].Metrics) */ - memcpy(&lpmc16[i].Metrics, &mlcA.pamxctrl[i].Metrics, + memcpy(&lpmc16[i].Metrics, &mlcA.pamxctrl[i].Metrics, sizeof(mlcA.pamxctrl[i].Metrics)); } } @@ -1288,28 +1288,28 @@ UINT16 WINAPI mixerGetLineControls16(HMIXEROBJ16 hmix, UINT WINAPI mixerGetLineInfoA(HMIXEROBJ hmix, LPMIXERLINEA lpmliW, DWORD fdwInfo) { LPWINE_MIXER lpwm; - + TRACE("(%04x, %p, %08lx)\n", hmix, lpmliW, fdwInfo); - - if ((lpwm = MIXER_GetDev(hmix, fdwInfo)) == NULL) + + if ((lpwm = MIXER_GetDev(hmix, fdwInfo)) == NULL) return MMSYSERR_INVALHANDLE; - return MMDRV_Message(&lpwm->mld, MXDM_GETLINEINFO, (DWORD)lpmliW, + return MMDRV_Message(&lpwm->mld, MXDM_GETLINEINFO, (DWORD)lpmliW, fdwInfo, TRUE); } /************************************************************************** * mixerGetLineInfoW [WINMM.@] */ -UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, - DWORD fdwInfo) +UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, + DWORD fdwInfo) { MIXERLINEA mliA; UINT ret; - + TRACE("(%04x, %p, %08lx)\n", hmix, lpmliW, fdwInfo); - if (lpmliW == NULL || lpmliW->cbStruct != sizeof(*lpmliW)) + if (lpmliW == NULL || lpmliW->cbStruct != sizeof(*lpmliW)) return MMSYSERR_INVALPARAM; mliA.cbStruct = sizeof(mliA); @@ -1367,15 +1367,15 @@ UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, /************************************************************************** * mixerGetLineInfo [MMSYSTEM.805] */ -UINT16 WINAPI mixerGetLineInfo16(HMIXEROBJ16 hmix, LPMIXERLINE16 lpmli16, - DWORD fdwInfo) +UINT16 WINAPI mixerGetLineInfo16(HMIXEROBJ16 hmix, LPMIXERLINE16 lpmli16, + DWORD fdwInfo) { MIXERLINEA mliA; UINT ret; - + TRACE("(%04x, %p, %08lx)\n", hmix, lpmli16, fdwInfo); - if (lpmli16 == NULL || lpmli16->cbStruct != sizeof(*lpmli16)) + if (lpmli16 == NULL || lpmli16->cbStruct != sizeof(*lpmli16)) return MMSYSERR_INVALPARAM; mliA.cbStruct = sizeof(mliA); @@ -1430,26 +1430,26 @@ UINT16 WINAPI mixerGetLineInfo16(HMIXEROBJ16 hmix, LPMIXERLINE16 lpmli16, /************************************************************************** * mixerSetControlDetails [WINMM.@] */ -UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA, - DWORD fdwDetails) +UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA, + DWORD fdwDetails) { LPWINE_MIXER lpwm; TRACE("(%04x, %p, %08lx)\n", hmix, lpmcdA, fdwDetails); - if ((lpwm = MIXER_GetDev(hmix, fdwDetails)) == NULL) + if ((lpwm = MIXER_GetDev(hmix, fdwDetails)) == NULL) return MMSYSERR_INVALHANDLE; - return MMDRV_Message(&lpwm->mld, MXDM_SETCONTROLDETAILS, (DWORD)lpmcdA, + return MMDRV_Message(&lpwm->mld, MXDM_SETCONTROLDETAILS, (DWORD)lpmcdA, fdwDetails, TRUE); } /************************************************************************** * mixerSetControlDetails [MMSYSTEM.809] */ -UINT16 WINAPI mixerSetControlDetails16(HMIXEROBJ16 hmix, - LPMIXERCONTROLDETAILS16 lpmcd, - DWORD fdwDetails) +UINT16 WINAPI mixerSetControlDetails16(HMIXEROBJ16 hmix, + LPMIXERCONTROLDETAILS16 lpmcd, + DWORD fdwDetails) { TRACE("(%04x, %p, %08lx)\n", hmix, lpmcd, fdwDetails); return MMSYSERR_NOTENABLED; @@ -1461,7 +1461,7 @@ UINT16 WINAPI mixerSetControlDetails16(HMIXEROBJ16 hmix, UINT WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD dwParam1, DWORD dwParam2) { LPWINE_MLD wmld; - + TRACE("(%04lx, %d, %08lx, %08lx): semi-stub?\n", (DWORD)hmix, uMsg, dwParam1, dwParam2); @@ -1474,8 +1474,8 @@ UINT WINAPI mixerMessage(HMIXER hmix, UINT uMsg, DWORD dwParam1, DWORD dwParam2) /************************************************************************** * mixerMessage [MMSYSTEM.804] */ -DWORD WINAPI mixerMessage16(HMIXER16 hmix, UINT16 uMsg, DWORD dwParam1, - DWORD dwParam2) +DWORD WINAPI mixerMessage16(HMIXER16 hmix, UINT16 uMsg, DWORD dwParam1, + DWORD dwParam2) { return mixerMessage(hmix, uMsg, dwParam1, dwParam2); } @@ -1503,7 +1503,7 @@ UINT WINAPI auxGetDevCapsW(UINT uDeviceID, LPAUXCAPSW lpCaps, UINT uSize) { AUXCAPSA acA; UINT ret = auxGetDevCapsA(uDeviceID, &acA, sizeof(acA)); - + lpCaps->wMid = acA.wMid; lpCaps->wPid = acA.wPid; lpCaps->vDriverVersion = acA.vDriverVersion; @@ -1647,7 +1647,7 @@ BOOL WINAPI mciGetErrorStringW(DWORD wError, LPWSTR lpstrBuffer, UINT uLength) { LPSTR bufstr = HeapAlloc(GetProcessHeap(), 0, uLength); BOOL ret = mciGetErrorStringA(wError, bufstr, uLength); - + MultiByteToWideChar( CP_ACP, 0, bufstr, -1, lpstrBuffer, uLength ); HeapFree(GetProcessHeap(), 0, bufstr); return ret; @@ -1668,10 +1668,10 @@ BOOL WINAPI mciGetErrorStringA(DWORD dwError, LPSTR lpstrBuffer, UINT uLength) { BOOL16 ret = FALSE; - if (lpstrBuffer != NULL && uLength > 0 && + if (lpstrBuffer != NULL && uLength > 0 && dwError >= MCIERR_BASE && dwError <= MCIERR_CUSTOM_DRIVER_BASE) { - if (LoadStringA(MULTIMEDIA_GetIData()->hWinMM32Instance, + if (LoadStringA(MULTIMEDIA_GetIData()->hWinMM32Instance, dwError, lpstrBuffer, uLength) > 0) { ret = TRUE; } @@ -1703,7 +1703,7 @@ BOOL WINAPI mciDriverNotify(HWND hWndCallBack, UINT wDevID, UINT wStatus) /************************************************************************** * mciGetDriverData [MMSYSTEM.708] */ -DWORD WINAPI mciGetDriverData16(UINT16 uDeviceID) +DWORD WINAPI mciGetDriverData16(UINT16 uDeviceID) { return mciGetDriverData(uDeviceID); } @@ -1711,7 +1711,7 @@ DWORD WINAPI mciGetDriverData16(UINT16 uDeviceID) /************************************************************************** * mciGetDriverData [WINMM.@] */ -DWORD WINAPI mciGetDriverData(UINT uDeviceID) +DWORD WINAPI mciGetDriverData(UINT uDeviceID) { LPWINE_MCIDRIVER wmd; @@ -1723,14 +1723,14 @@ DWORD WINAPI mciGetDriverData(UINT uDeviceID) WARN("Bad uDeviceID\n"); return 0L; } - + return wmd->dwPrivate; } /************************************************************************** * mciSetDriverData [MMSYSTEM.707] */ -BOOL16 WINAPI mciSetDriverData16(UINT16 uDeviceID, DWORD data) +BOOL16 WINAPI mciSetDriverData16(UINT16 uDeviceID, DWORD data) { return mciSetDriverData(uDeviceID, data); } @@ -1738,7 +1738,7 @@ BOOL16 WINAPI mciSetDriverData16(UINT16 uDeviceID, DWORD data) /************************************************************************** * mciSetDriverData [WINMM.@] */ -BOOL WINAPI mciSetDriverData(UINT uDeviceID, DWORD data) +BOOL WINAPI mciSetDriverData(UINT uDeviceID, DWORD data) { LPWINE_MCIDRIVER wmd; @@ -1750,7 +1750,7 @@ BOOL WINAPI mciSetDriverData(UINT uDeviceID, DWORD data) WARN("Bad uDeviceID\n"); return FALSE; } - + wmd->dwPrivate = data; return TRUE; } @@ -1762,7 +1762,7 @@ DWORD WINAPI mciSendCommandA(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwPar { DWORD dwRet; - TRACE("(%08x, %s, %08lx, %08lx)\n", + TRACE("(%08x, %s, %08lx, %08lx)\n", wDevID, MCI_MessageToString(wMsg), dwParam1, dwParam2); dwRet = MCI_SendCommand(wDevID, wMsg, dwParam1, dwParam2, TRUE); @@ -1776,7 +1776,7 @@ DWORD WINAPI mciSendCommandA(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwPar */ DWORD WINAPI mciSendCommandW(UINT wDevID, UINT wMsg, DWORD dwParam1, DWORD dwParam2) { - FIXME("(%08x, %s, %08lx, %08lx): stub\n", + FIXME("(%08x, %s, %08lx, %08lx): stub\n", wDevID, MCI_MessageToString(wMsg), dwParam1, dwParam2); return MCIERR_UNSUPPORTED_FUNCTION; } @@ -1788,7 +1788,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD { DWORD dwRet; - TRACE("(%04X, %s, %08lX, %08lX)\n", + TRACE("(%04X, %s, %08lX, %08lX)\n", wDevID, MCI_MessageToString(wMsg), dwParam1, dwParam2); dwRet = MCI_SendCommand(wDevID, wMsg, dwParam1, dwParam2, FALSE); @@ -1796,7 +1796,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD TRACE("=> %ld\n", dwRet); return dwRet; } - + /************************************************************************** * mciGetDeviceID [MMSYSTEM.703] */ @@ -1835,7 +1835,7 @@ UINT WINAPI mciGetDeviceIDW(LPCWSTR lpwstrName) UINT WINAPI MCI_DefYieldProc(MCIDEVICEID wDevID, DWORD data) { INT16 ret; - + TRACE("(0x%04x, 0x%08lx)\n", wDevID, data); if ((HIWORD(data) != 0 && GetActiveWindow() != HIWORD(data)) || @@ -1865,7 +1865,7 @@ BOOL16 WINAPI mciSetYieldProc16(UINT16 uDeviceID, YIELDPROC16 fpYieldProc, DWORD WARN("Bad uDeviceID\n"); return FALSE; } - + wmd->lpfnYieldProc = (YIELDPROC)fpYieldProc; wmd->dwYieldData = dwYieldData; wmd->bIs32 = FALSE; @@ -1886,7 +1886,7 @@ BOOL WINAPI mciSetYieldProc(UINT uDeviceID, YIELDPROC fpYieldProc, DWORD dwYield WARN("Bad uDeviceID\n"); return FALSE; } - + wmd->lpfnYieldProc = fpYieldProc; wmd->dwYieldData = dwYieldData; wmd->bIs32 = TRUE; @@ -1902,19 +1902,19 @@ UINT16 WINAPI mciGetDeviceIDFromElementID16(DWORD dwElementID, LPCSTR lpstrType) FIXME("(%lu, %s) stub\n", dwElementID, lpstrType); return 0; } - + /************************************************************************** * mciGetDeviceIDFromElementIDW [WINMM.@] */ UINT WINAPI mciGetDeviceIDFromElementIDW(DWORD dwElementID, LPCWSTR lpstrType) { - /* FIXME: that's rather strange, there is no + /* FIXME: that's rather strange, there is no * mciGetDeviceIDFromElementID32A in winmm.spec */ FIXME("(%lu, %p) stub\n", dwElementID, lpstrType); return 0; } - + /************************************************************************** * mciGetYieldProc [MMSYSTEM.716] */ @@ -1938,7 +1938,7 @@ YIELDPROC16 WINAPI mciGetYieldProc16(UINT16 uDeviceID, DWORD* lpdwYieldData) } return (YIELDPROC16)wmd->lpfnYieldProc; } - + /************************************************************************** * mciGetYieldProc [WINMM.@] */ @@ -1990,7 +1990,7 @@ HTASK WINAPI mciGetCreatorTask(UINT uDeviceID) /************************************************************************** * mciDriverYield [MMSYSTEM.710] */ -UINT16 WINAPI mciDriverYield16(UINT16 uDeviceID) +UINT16 WINAPI mciDriverYield16(UINT16 uDeviceID) { LPWINE_MCIDRIVER wmd; UINT16 ret = 0; @@ -2009,7 +2009,7 @@ UINT16 WINAPI mciDriverYield16(UINT16 uDeviceID) /************************************************************************** * mciDriverYield [WINMM.@] */ -UINT WINAPI mciDriverYield(UINT uDeviceID) +UINT WINAPI mciDriverYield(UINT uDeviceID) { LPWINE_MCIDRIVER wmd; UINT ret = 0; @@ -2044,12 +2044,12 @@ UINT16 WINAPI midiOutGetNumDevs16(void) /************************************************************************** * midiOutGetDevCapsW [WINMM.@] */ -UINT WINAPI midiOutGetDevCapsW(UINT uDeviceID, LPMIDIOUTCAPSW lpCaps, +UINT WINAPI midiOutGetDevCapsW(UINT uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize) { MIDIOUTCAPSA mocA; UINT ret; - + ret = midiOutGetDevCapsA(uDeviceID, &mocA, sizeof(mocA)); lpCaps->wMid = mocA.wMid; lpCaps->wPid = mocA.wPid; @@ -2067,7 +2067,7 @@ UINT WINAPI midiOutGetDevCapsW(UINT uDeviceID, LPMIDIOUTCAPSW lpCaps, /************************************************************************** * midiOutGetDevCapsA [WINMM.@] */ -UINT WINAPI midiOutGetDevCapsA(UINT uDeviceID, LPMIDIOUTCAPSA lpCaps, +UINT WINAPI midiOutGetDevCapsA(UINT uDeviceID, LPMIDIOUTCAPSA lpCaps, UINT uSize) { LPWINE_MLD wmld; @@ -2085,7 +2085,7 @@ UINT WINAPI midiOutGetDevCapsA(UINT uDeviceID, LPMIDIOUTCAPSA lpCaps, /************************************************************************** * midiOutGetDevCaps [MMSYSTEM.202] */ -UINT16 WINAPI midiOutGetDevCaps16(UINT16 uDeviceID, LPMIDIOUTCAPS16 lpCaps, +UINT16 WINAPI midiOutGetDevCaps16(UINT16 uDeviceID, LPMIDIOUTCAPS16 lpCaps, UINT16 uSize) { MIDIOUTCAPSA capsA; @@ -2124,8 +2124,8 @@ static UINT16 MIDI_GetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize) * a warning for the test was always true */ (/*uError >= MMSYSERR_BASE && */ uError <= MMSYSERR_LASTERROR) || (uError >= MIDIERR_BASE && uError <= MIDIERR_LASTERROR)) { - - if (LoadStringA(MULTIMEDIA_GetIData()->hWinMM32Instance, + + if (LoadStringA(MULTIMEDIA_GetIData()->hWinMM32Instance, uError, lpText, uSize) > 0) { ret = MMSYSERR_NOERROR; } @@ -2148,7 +2148,7 @@ UINT WINAPI midiOutGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize) { LPSTR xstr = HeapAlloc(GetProcessHeap(), 0, uSize); UINT ret; - + ret = MIDI_GetErrorText(uError, xstr, uSize); MultiByteToWideChar( CP_ACP, 0, xstr, -1, lpText, uSize ); HeapFree(GetProcessHeap(), 0, xstr); @@ -2166,20 +2166,20 @@ UINT16 WINAPI midiOutGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize) /************************************************************************** * MIDI_OutAlloc [internal] */ -static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT* lphMidiOut, LPDWORD lpdwCallback, - LPDWORD lpdwInstance, LPDWORD lpdwFlags, +static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT* lphMidiOut, LPDWORD lpdwCallback, + LPDWORD lpdwInstance, LPDWORD lpdwFlags, DWORD cIDs, MIDIOPENSTRMID* lpIDs, BOOL bFrom32) { HMIDIOUT hMidiOut; LPWINE_MIDI lpwm; UINT size; - + size = sizeof(WINE_MIDI) + (cIDs ? (cIDs-1) : 0) * sizeof(MIDIOPENSTRMID); - lpwm = (LPWINE_MIDI)MMDRV_Alloc(size, MMDRV_MIDIOUT, &hMidiOut, lpdwFlags, + lpwm = (LPWINE_MIDI)MMDRV_Alloc(size, MMDRV_MIDIOUT, &hMidiOut, lpdwFlags, lpdwCallback, lpdwInstance, bFrom32); - if (lphMidiOut != NULL) + if (lphMidiOut != NULL) *lphMidiOut = hMidiOut; if (lpwm) { @@ -2194,19 +2194,19 @@ static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT* lphMidiOut, LPDWORD lpdwCallback, return lpwm; } -UINT MMSYSTEM_midiOutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback, +UINT MMSYSTEM_midiOutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) { HMIDIOUT hMidiOut; LPWINE_MIDI lpwm; UINT dwRet = 0; - - TRACE("(%p, %d, %08lX, %08lX, %08lX);\n", + + TRACE("(%p, %d, %08lX, %08lX, %08lX);\n", lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags); if (lphMidiOut != NULL) *lphMidiOut = 0; - lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &dwFlags, + lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &dwFlags, 0, NULL, bFrom32); if (lpwm == NULL) @@ -2214,7 +2214,7 @@ UINT MMSYSTEM_midiOutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback lpwm->mld.uDeviceID = uDeviceID; - dwRet = MMDRV_Open((LPWINE_MLD)lpwm, MODM_OPEN, (DWORD)&lpwm->mod, + dwRet = MMDRV_Open((LPWINE_MLD)lpwm, MODM_OPEN, (DWORD)&lpwm->mod, dwFlags); if (dwRet != MMSYSERR_NOERROR) { @@ -2234,7 +2234,7 @@ UINT MMSYSTEM_midiOutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback UINT WINAPI midiOutOpen(HMIDIOUT* lphMidiOut, UINT uDeviceID, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags) { - return MMSYSTEM_midiOutOpen(lphMidiOut, uDeviceID, dwCallback, + return MMSYSTEM_midiOutOpen(lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags, TRUE); } @@ -2246,10 +2246,10 @@ UINT16 WINAPI midiOutOpen16(HMIDIOUT16* lphMidiOut, UINT16 uDeviceID, { HMIDIOUT hmo; UINT ret; - - ret = MMSYSTEM_midiOutOpen(&hmo, uDeviceID, dwCallback, dwInstance, + + ret = MMSYSTEM_midiOutOpen(&hmo, uDeviceID, dwCallback, dwInstance, dwFlags, FALSE); - + if (lphMidiOut != NULL) *lphMidiOut = hmo; return ret; } @@ -2264,7 +2264,7 @@ UINT WINAPI midiOutClose(HMIDIOUT hMidiOut) TRACE("(%04X)\n", hMidiOut); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; dwRet = MMDRV_Close(wmld, MODM_CLOSE); @@ -2291,7 +2291,7 @@ UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut, TRACE("(%04X, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_PREPARE, (DWORD)lpMidiOutHdr, uSize, TRUE); @@ -2308,7 +2308,7 @@ UINT16 WINAPI midiOutPrepareHeader16(HMIDIOUT16 hMidiOut, /* [in] */ TRACE("(%04X, %08lx, %d)\n", hMidiOut, lpsegMidiOutHdr, uSize); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_PREPARE, lpsegMidiOutHdr, uSize, FALSE); @@ -2319,7 +2319,7 @@ UINT16 WINAPI midiOutPrepareHeader16(HMIDIOUT16 hMidiOut, /* [in] */ */ UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut, MIDIHDR* lpMidiOutHdr, UINT uSize) -{ +{ LPWINE_MLD wmld; TRACE("(%04X, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize); @@ -2328,7 +2328,7 @@ UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut, return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_UNPREPARE, (DWORD)lpMidiOutHdr, uSize, TRUE); @@ -2350,7 +2350,7 @@ UINT16 WINAPI midiOutUnprepareHeader16(HMIDIOUT16 hMidiOut, /* [in] */ return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_UNPREPARE, (DWORD)lpsegMidiOutHdr, uSize, FALSE); @@ -2365,7 +2365,7 @@ UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg) TRACE("(%04X, %08lX)\n", hMidiOut, dwMsg); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_DATA, dwMsg, 0L, FALSE); @@ -2389,7 +2389,7 @@ UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut, TRACE("(%04X, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_LONGDATA, (DWORD)lpMidiOutHdr, uSize, TRUE); @@ -2406,7 +2406,7 @@ UINT16 WINAPI midiOutLongMsg16(HMIDIOUT16 hMidiOut, /* [in] */ TRACE("(%04X, %p, %d)\n", hMidiOut, lpsegMidiOutHdr, uSize); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_LONGDATA, (DWORD)lpsegMidiOutHdr, uSize, FALSE); @@ -2421,7 +2421,7 @@ UINT WINAPI midiOutReset(HMIDIOUT hMidiOut) TRACE("(%04X)\n", hMidiOut); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_RESET, 0L, 0L, TRUE); @@ -2444,7 +2444,7 @@ UINT WINAPI midiOutGetVolume(UINT uDeviceID, DWORD* lpdwVolume) TRACE("(%04X, %p);\n", uDeviceID, lpdwVolume); - if ((wmld = MMDRV_Get(uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL) + if ((wmld = MMDRV_Get(uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_GETVOLUME, (DWORD)lpdwVolume, 0L, TRUE); @@ -2467,7 +2467,7 @@ UINT WINAPI midiOutSetVolume(UINT uDeviceID, DWORD dwVolume) TRACE("(%04X, %ld);\n", uDeviceID, dwVolume); - if ((wmld = MMDRV_Get(uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL) + if ((wmld = MMDRV_Get(uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MODM_SETVOLUME, dwVolume, 0L, TRUE); @@ -2530,7 +2530,7 @@ UINT WINAPI midiOutGetID(HMIDIOUT hMidiOut, UINT* lpuDeviceID) TRACE("(%04X, %p)\n", hMidiOut, lpuDeviceID); if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -2547,7 +2547,7 @@ UINT16 WINAPI midiOutGetID16(HMIDIOUT16 hMidiOut, UINT16* lpuDeviceID) TRACE("(%04X, %p)\n", hMidiOut, lpuDeviceID); if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -2557,7 +2557,7 @@ UINT16 WINAPI midiOutGetID16(HMIDIOUT16 hMidiOut, UINT16* lpuDeviceID) /************************************************************************** * midiOutMessage [WINMM.@] */ -DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, +DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, DWORD dwParam1, DWORD dwParam2) { LPWINE_MLD wmld; @@ -2588,14 +2588,14 @@ DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, /************************************************************************** * midiOutMessage [MMSYSTEM.216] */ -DWORD WINAPI midiOutMessage16(HMIDIOUT16 hMidiOut, UINT16 uMessage, +DWORD WINAPI midiOutMessage16(HMIDIOUT16 hMidiOut, UINT16 uMessage, DWORD dwParam1, DWORD dwParam2) { LPWINE_MLD wmld; TRACE("(%04X, %04X, %08lX, %08lX)\n", hMidiOut, uMessage, dwParam1, dwParam2); - if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; switch (uMessage) { @@ -2640,7 +2640,7 @@ UINT WINAPI midiInGetDevCapsW(UINT uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize) { MIDIINCAPSA micA; UINT ret = midiInGetDevCapsA(uDeviceID, &micA, uSize); - + if (ret == MMSYSERR_NOERROR) { lpCaps->wMid = micA.wMid; lpCaps->wPid = micA.wPid; @@ -2661,7 +2661,7 @@ UINT WINAPI midiInGetDevCapsA(UINT uDeviceID, LPMIDIINCAPSA lpCaps, UINT uSize) TRACE("(%d, %p, %d);\n", uDeviceID, lpCaps, uSize); - if ((wmld = MMDRV_Get(uDeviceID, MMDRV_MIDIIN, TRUE)) == NULL) + if ((wmld = MMDRV_Get(uDeviceID, MMDRV_MIDIIN, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_GETDEVCAPS, (DWORD)lpCaps, uSize, TRUE); @@ -2670,12 +2670,12 @@ UINT WINAPI midiInGetDevCapsA(UINT uDeviceID, LPMIDIINCAPSA lpCaps, UINT uSize) /************************************************************************** * midiInGetDevCaps [MMSYSTEM.302] */ -UINT16 WINAPI midiInGetDevCaps16(UINT16 uDeviceID, LPMIDIINCAPS16 lpCaps, +UINT16 WINAPI midiInGetDevCaps16(UINT16 uDeviceID, LPMIDIINCAPS16 lpCaps, UINT16 uSize) { MIDIINCAPSA micA; UINT ret = midiInGetDevCapsA(uDeviceID, &micA, uSize); - + if (ret == MMSYSERR_NOERROR) { lpCaps->wMid = micA.wMid; lpCaps->wPid = micA.wPid; @@ -2683,7 +2683,7 @@ UINT16 WINAPI midiInGetDevCaps16(UINT16 uDeviceID, LPMIDIINCAPS16 lpCaps, strcpy(lpCaps->szPname, micA.szPname); lpCaps->dwSupport = micA.dwSupport; } - + return ret; } @@ -2716,14 +2716,14 @@ UINT16 WINAPI midiInGetErrorText16(UINT16 uError, LPSTR lpText, UINT16 uSize) return MIDI_GetErrorText(uError, lpText, uSize); } -static UINT MMSYSTEM_midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCallback, +static UINT MMSYSTEM_midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) { HMIDIIN hMidiIn; LPWINE_MIDI lpwm; DWORD dwRet = 0; - - TRACE("(%p, %d, %08lX, %08lX, %08lX);\n", + + TRACE("(%p, %d, %08lX, %08lX, %08lX);\n", lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags); if (lphMidiIn != NULL) *lphMidiIn = 0; @@ -2731,7 +2731,7 @@ static UINT MMSYSTEM_midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCall lpwm = (LPWINE_MIDI)MMDRV_Alloc(sizeof(WINE_MIDI), MMDRV_MIDIIN, &hMidiIn, &dwFlags, &dwCallback, &dwInstance, bFrom32); - if (lpwm == NULL) + if (lpwm == NULL) return MMSYSERR_NOMEM; lpwm->mod.hMidi = hMidiIn; @@ -2757,7 +2757,7 @@ static UINT MMSYSTEM_midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCall UINT WINAPI midiInOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags) { - return MMSYSTEM_midiInOpen(lphMidiIn, uDeviceID, dwCallback, + return MMSYSTEM_midiInOpen(lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags, TRUE); } @@ -2770,9 +2770,9 @@ UINT16 WINAPI midiInOpen16(HMIDIIN16* lphMidiIn, UINT16 uDeviceID, HMIDIIN xhmid; UINT ret; - ret = MMSYSTEM_midiInOpen(&xhmid, uDeviceID, dwCallback, dwInstance, + ret = MMSYSTEM_midiInOpen(&xhmid, uDeviceID, dwCallback, dwInstance, dwFlags, FALSE); - + if (lphMidiIn) *lphMidiIn = xhmid; return ret; } @@ -2783,11 +2783,11 @@ UINT16 WINAPI midiInOpen16(HMIDIIN16* lphMidiIn, UINT16 uDeviceID, UINT WINAPI midiInClose(HMIDIIN hMidiIn) { LPWINE_MLD wmld; - DWORD dwRet; + DWORD dwRet; TRACE("(%04X)\n", hMidiIn); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; dwRet = MMDRV_Close(wmld, MIDM_CLOSE); @@ -2806,14 +2806,14 @@ UINT16 WINAPI midiInClose16(HMIDIIN16 hMidiIn) /************************************************************************** * midiInPrepareHeader [WINMM.@] */ -UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn, +UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn, MIDIHDR* lpMidiInHdr, UINT uSize) { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_PREPARE, (DWORD)lpMidiInHdr, uSize, TRUE); @@ -2830,7 +2830,7 @@ UINT16 WINAPI midiInPrepareHeader16(HMIDIIN16 hMidiIn, /* [in] */ TRACE("(%04X, %08lx, %d)\n", hMidiIn, lpsegMidiInHdr, uSize); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_PREPARE, (DWORD)lpsegMidiInHdr, uSize, FALSE); @@ -2850,7 +2850,7 @@ UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn, return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_UNPREPARE, (DWORD)lpMidiInHdr, uSize, TRUE); @@ -2872,7 +2872,7 @@ UINT16 WINAPI midiInUnprepareHeader16(HMIDIIN16 hMidiIn, /* [in] */ return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_UNPREPARE, (DWORD)lpsegMidiInHdr, uSize, FALSE); @@ -2888,7 +2888,7 @@ UINT WINAPI midiInAddBuffer(HMIDIIN hMidiIn, TRACE("(%04X, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_ADDBUFFER, (DWORD)lpMidiInHdr, uSize, TRUE); @@ -2905,7 +2905,7 @@ UINT16 WINAPI midiInAddBuffer16(HMIDIIN16 hMidiIn, /* [in] */ TRACE("(%04X, %p, %d)\n", hMidiIn, lpsegMidiInHdr, uSize); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_ADDBUFFER, (DWORD)lpsegMidiInHdr, uSize, FALSE); @@ -2920,7 +2920,7 @@ UINT WINAPI midiInStart(HMIDIIN hMidiIn) TRACE("(%04X)\n", hMidiIn); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_START, 0L, 0L, TRUE); @@ -2943,7 +2943,7 @@ UINT WINAPI midiInStop(HMIDIIN hMidiIn) TRACE("(%04X)\n", hMidiIn); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_STOP, 0L, 0L, TRUE); @@ -2966,7 +2966,7 @@ UINT WINAPI midiInReset(HMIDIIN hMidiIn) TRACE("(%04X)\n", hMidiIn); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, MIDM_RESET, 0L, 0L, TRUE); @@ -2991,11 +2991,11 @@ UINT WINAPI midiInGetID(HMIDIIN hMidiIn, UINT* lpuDeviceID) if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, TRUE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; - + return MMSYSERR_NOERROR; } @@ -3010,25 +3010,25 @@ UINT16 WINAPI midiInGetID16(HMIDIIN16 hMidiIn, UINT16* lpuDeviceID) if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, TRUE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; - + return MMSYSERR_NOERROR; } /************************************************************************** * midiInMessage [WINMM.@] */ -DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage, +DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage, DWORD dwParam1, DWORD dwParam2) { LPWINE_MLD wmld; TRACE("(%04X, %04X, %08lX, %08lX)\n", hMidiIn, uMessage, dwParam1, dwParam2); - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; switch (uMessage) { @@ -3043,7 +3043,7 @@ DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage, /************************************************************************** * midiInMessage [MMSYSTEM.313] */ -DWORD WINAPI midiInMessage16(HMIDIIN16 hMidiIn, UINT16 uMessage, +DWORD WINAPI midiInMessage16(HMIDIIN16 hMidiIn, UINT16 uMessage, DWORD dwParam1, DWORD dwParam2) { LPWINE_MLD wmld; @@ -3066,7 +3066,7 @@ DWORD WINAPI midiInMessage16(HMIDIIN16 hMidiIn, UINT16 uMessage, return midiInAddBuffer16(hMidiIn, MapSL(dwParam1), dwParam2); } - if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, FALSE); @@ -3114,7 +3114,7 @@ static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream** lpMidi static DWORD MMSYSTEM_MidiStream_Convert(WINE_MIDIStream* lpMidiStrm, DWORD pulse) { DWORD ret = 0; - + if (lpMidiStrm->dwTimeDiv == 0) { FIXME("Shouldn't happen. lpMidiStrm->dwTimeDiv = 0\n"); } else if (lpMidiStrm->dwTimeDiv > 0x8000) { /* SMPTE, unchecked FIXME? */ @@ -3122,10 +3122,10 @@ static DWORD MMSYSTEM_MidiStream_Convert(WINE_MIDIStream* lpMidiStrm, DWORD puls int nsf = LOBYTE(lpMidiStrm->dwTimeDiv); /* number of sub-frames */ ret = (pulse * 1000) / (nf * nsf); } else { - ret = (DWORD)((double)pulse * ((double)lpMidiStrm->dwTempo / 1000) / + ret = (DWORD)((double)pulse * ((double)lpMidiStrm->dwTempo / 1000) / (double)lpMidiStrm->dwTimeDiv); } - + return ret; } @@ -3150,8 +3150,8 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI for (lpMidiHdr = lpMidiStrm->lpMidiHdr; lpMidiHdr; lpMidiHdr = (LPMIDIHDR)lpMidiHdr->lpNext) { lpMidiHdr->dwFlags |= MHDR_DONE; lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; - - DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice, + + DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice, MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L); } lpMidiStrm->lpMidiHdr = 0; @@ -3161,14 +3161,14 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI /* sets initial tick count for first MIDIHDR */ if (!lpMidiStrm->dwStartTicks) lpMidiStrm->dwStartTicks = GetTickCount(); - + /* FIXME(EPP): "I don't understand the content of the first MIDIHDR sent * by native mcimidi, it doesn't look like a correct one". - * this trick allows to throw it away... but I don't like it. - * It looks like part of the file I'm trying to play and definitively looks + * this trick allows to throw it away... but I don't like it. + * It looks like part of the file I'm trying to play and definitively looks * like raw midi content * I'd really like to understand why native mcimidi sends it. Perhaps a bad - * synchronization issue where native mcimidi is still processing raw MIDI + * synchronization issue where native mcimidi is still processing raw MIDI * content before generating MIDIEVENTs ? * * 4c 04 89 3b 00 81 7c 99 3b 43 00 99 23 5e 04 89 L..;..|.;C..#^.. @@ -3191,19 +3191,19 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI */ lpMidiHdr = (LPMIDIHDR)msg->lParam; lpData = lpMidiHdr->lpData; - TRACE("Adding %s lpMidiHdr=%p [lpData=0x%08lx dwBufferLength=%lu/%lu dwFlags=0x%08lx size=%u]\n", - (lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular", lpMidiHdr, - (DWORD)lpMidiHdr, lpMidiHdr->dwBufferLength, lpMidiHdr->dwBytesRecorded, + TRACE("Adding %s lpMidiHdr=%p [lpData=0x%08lx dwBufferLength=%lu/%lu dwFlags=0x%08lx size=%u]\n", + (lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular", lpMidiHdr, + (DWORD)lpMidiHdr, lpMidiHdr->dwBufferLength, lpMidiHdr->dwBytesRecorded, lpMidiHdr->dwFlags, msg->wParam); #if 0 /* dumps content of lpMidiHdr->lpData * FIXME: there should be a debug routine somewhere that already does this - * I hate spreading this type of shit all around the code - */ + * I hate spreading this type of shit all around the code + */ for (dwToGo = 0; dwToGo < lpMidiHdr->dwBufferLength; dwToGo += 16) { DWORD i; BYTE ch; - + for (i = 0; i < min(16, lpMidiHdr->dwBufferLength - dwToGo); i++) printf("%02x ", lpData[dwToGo + i]); for (; i < 16; i++) @@ -3215,20 +3215,20 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI printf("\n"); } #endif - if (((LPMIDIEVENT)lpData)->dwStreamID != 0 && + if (((LPMIDIEVENT)lpData)->dwStreamID != 0 && ((LPMIDIEVENT)lpData)->dwStreamID != 0xFFFFFFFF && ((LPMIDIEVENT)lpData)->dwStreamID != (DWORD)lpMidiStrm) { - FIXME("Dropping bad %s lpMidiHdr (streamID=%08lx)\n", - (lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular", + FIXME("Dropping bad %s lpMidiHdr (streamID=%08lx)\n", + (lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular", ((LPMIDIEVENT)lpData)->dwStreamID); lpMidiHdr->dwFlags |= MHDR_DONE; lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; - - DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice, + + DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice, MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L); break; - } - + } + for (lpmh = &lpMidiStrm->lpMidiHdr; *lpmh; lpmh = (LPMIDIHDR*)&((*lpmh)->lpNext)); *lpmh = lpMidiHdr; lpMidiHdr = (LPMIDIHDR)msg->lParam; @@ -3236,7 +3236,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI lpMidiHdr->dwFlags |= MHDR_INQUEUE; lpMidiHdr->dwFlags &= MHDR_DONE; lpMidiHdr->dwOffset = 0; - + break; default: FIXME("Unknown message %d\n", msg->message); @@ -3261,7 +3261,7 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt) TRACE("(%p)!\n", lpMidiStrm); - if (!lpMidiStrm || + if (!lpMidiStrm || (lpwm = (LPWINE_MIDI)MMDRV_Get(lpMidiStrm->hDevice, MMDRV_MIDIOUT, FALSE)) == NULL) goto the_end; @@ -3277,7 +3277,7 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt) SuspendThread(lpMidiStrm->hThread); TRACE("Ready to go 2\n"); - lpMidiStrm->dwStartTicks = 0; + lpMidiStrm->dwStartTicks = 0; lpMidiStrm->dwPulses = 0; lpMidiStrm->lpMidiHdr = 0; @@ -3297,16 +3297,16 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt) if (!lpData) lpData = lpMidiHdr->lpData; - + me = (LPMIDIEVENT)(lpData + lpMidiHdr->dwOffset); - + /* do we have to wait ? */ if (me->dwDeltaTime) { lpMidiStrm->dwPositionMS += MMSYSTEM_MidiStream_Convert(lpMidiStrm, me->dwDeltaTime); lpMidiStrm->dwPulses += me->dwDeltaTime; dwToGo = lpMidiStrm->dwStartTicks + lpMidiStrm->dwPositionMS; - + TRACE("%ld/%ld/%ld\n", dwToGo, GetTickCount(), me->dwDeltaTime); while ((dwCurrTC = GetTickCount()) < dwToGo) { if (MsgWaitForMultipleObjects(0, NULL, FALSE, dwToGo - dwCurrTC, QS_ALLINPUT) == WAIT_OBJECT_0) { @@ -3320,7 +3320,7 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt) /* timeout, so me->dwDeltaTime is elapsed, can break the while loop */ break; } - } + } } switch (MEVT_EVENTTYPE(me->dwEvent & ~MEVT_F_CALLBACK)) { case MEVT_COMMENT: @@ -3345,19 +3345,19 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt) break; } if (me->dwEvent & MEVT_F_CALLBACK) { - DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice, + DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice, MM_MOM_POSITIONCB, lpwm->mod.dwInstance, (LPARAM)lpMidiHdr, 0L); } lpMidiHdr->dwOffset += sizeof(MIDIEVENT) - sizeof(me->dwParms); - if (me->dwEvent & MEVT_F_LONG) + if (me->dwEvent & MEVT_F_LONG) lpMidiHdr->dwOffset += (MEVT_EVENTPARM(me->dwEvent) + 3) & ~3; if (lpMidiHdr->dwOffset >= lpMidiHdr->dwBufferLength) { /* done with this header */ lpMidiHdr->dwFlags |= MHDR_DONE; lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; - + lpMidiStrm->lpMidiHdr = (LPMIDIHDR)lpMidiHdr->lpNext; - DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice, + DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, lpMidiStrm->hDevice, MM_MOM_DONE, lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L); lpData = 0; } @@ -3382,7 +3382,7 @@ static BOOL MMSYSTEM_MidiStream_PostMessage(WINE_MIDIStream* lpMidiStrm, WORD ms } else { WARN("bad PostThreadMessageA\n"); return FALSE; - } + } return TRUE; } @@ -3409,9 +3409,9 @@ MMRESULT WINAPI midiStreamClose(HMIDISTRM hMidiStrm) /************************************************************************** * MMSYSTEM_MidiStream_Open [internal] */ -static MMRESULT WINAPI MMSYSTEM_MidiStream_Open(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, - DWORD cMidi, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32) +static MMRESULT WINAPI MMSYSTEM_MidiStream_Open(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, + DWORD cMidi, DWORD dwCallback, + DWORD dwInstance, DWORD fdwOpen, BOOL bFrom32) { WINE_MIDIStream* lpMidiStrm; MMRESULT ret; @@ -3449,20 +3449,20 @@ static MMRESULT WINAPI MMSYSTEM_MidiStream_Open(HMIDISTRM* lphMidiStrm, LPUINT l lpMidiStrm->hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); lpMidiStrm->wFlags = HIWORD(fdwOpen); - lpMidiStrm->hThread = CreateThread(NULL, 0, MMSYSTEM_MidiStream_Player, + lpMidiStrm->hThread = CreateThread(NULL, 0, MMSYSTEM_MidiStream_Player, lpMidiStrm, 0, &(lpMidiStrm->dwThreadID)); if (!lpMidiStrm->hThread) { midiStreamClose((HMIDISTRM)hMidiOut); - return MMSYSERR_NOMEM; + return MMSYSERR_NOMEM; } /* wait for thread to have started, and for its queue to be created */ { DWORD count; - /* (Release|Restore)ThunkLock() is needed when this method is called from 16 bit code, - * (meaning the Win16Lock is set), so that it's released and the 32 bit thread running + /* (Release|Restore)ThunkLock() is needed when this method is called from 16 bit code, + * (meaning the Win16Lock is set), so that it's released and the 32 bit thread running * MMSYSTEM_MidiStreamPlayer can acquire Win16Lock to create its queue. */ ReleaseThunkLock(&count); @@ -3470,27 +3470,27 @@ static MMRESULT WINAPI MMSYSTEM_MidiStream_Open(HMIDISTRM* lphMidiStrm, LPUINT l RestoreThunkLock(count); } - TRACE("=> (%u/%d) hMidi=0x%04x ret=%d lpMidiStrm=%p\n", - *lpuDeviceID, lpwm->mld.uDeviceID, *lphMidiStrm, ret, lpMidiStrm); + TRACE("=> (%u/%d) hMidi=0x%04x ret=%d lpMidiStrm=%p\n", + *lpuDeviceID, lpwm->mld.uDeviceID, *lphMidiStrm, ret, lpMidiStrm); return ret; } /************************************************************************** * midiStreamOpen [WINMM.@] */ -MMRESULT WINAPI midiStreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, - DWORD cMidi, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen) +MMRESULT WINAPI midiStreamOpen(HMIDISTRM* lphMidiStrm, LPUINT lpuDeviceID, + DWORD cMidi, DWORD dwCallback, + DWORD dwInstance, DWORD fdwOpen) { - return MMSYSTEM_MidiStream_Open(lphMidiStrm, lpuDeviceID, cMidi, dwCallback, + return MMSYSTEM_MidiStream_Open(lphMidiStrm, lpuDeviceID, cMidi, dwCallback, dwInstance, fdwOpen, TRUE); } /************************************************************************** * midiStreamOut [WINMM.@] */ -MMRESULT WINAPI midiStreamOut(HMIDISTRM hMidiStrm, LPMIDIHDR lpMidiHdr, - UINT cbMidiHdr) +MMRESULT WINAPI midiStreamOut(HMIDISTRM hMidiStrm, LPMIDIHDR lpMidiHdr, + UINT cbMidiHdr) { WINE_MIDIStream* lpMidiStrm; DWORD ret = MMSYSERR_NOERROR; @@ -3502,8 +3502,8 @@ MMRESULT WINAPI midiStreamOut(HMIDISTRM hMidiStrm, LPMIDIHDR lpMidiHdr, } else if (!lpMidiHdr) { ret = MMSYSERR_INVALPARAM; } else { - if (!PostThreadMessageA(lpMidiStrm->dwThreadID, - WINE_MSM_HEADER, cbMidiHdr, + if (!PostThreadMessageA(lpMidiStrm->dwThreadID, + WINE_MSM_HEADER, cbMidiHdr, (DWORD)lpMidiHdr)) { WARN("bad PostThreadMessageA\n"); ret = MMSYSERR_ERROR; @@ -3515,7 +3515,7 @@ MMRESULT WINAPI midiStreamOut(HMIDISTRM hMidiStrm, LPMIDIHDR lpMidiHdr, /************************************************************************** * midiStreamPause [WINMM.@] */ -MMRESULT WINAPI midiStreamPause(HMIDISTRM hMidiStrm) +MMRESULT WINAPI midiStreamPause(HMIDISTRM hMidiStrm) { WINE_MIDIStream* lpMidiStrm; DWORD ret = MMSYSERR_NOERROR; @@ -3536,7 +3536,7 @@ MMRESULT WINAPI midiStreamPause(HMIDISTRM hMidiStrm) /************************************************************************** * midiStreamPosition [WINMM.@] */ -MMRESULT WINAPI midiStreamPosition(HMIDISTRM hMidiStrm, LPMMTIME lpMMT, UINT cbmmt) +MMRESULT WINAPI midiStreamPosition(HMIDISTRM hMidiStrm, LPMMTIME lpMMT, UINT cbmmt) { WINE_MIDIStream* lpMidiStrm; DWORD ret = MMSYSERR_NOERROR; @@ -3549,12 +3549,12 @@ MMRESULT WINAPI midiStreamPosition(HMIDISTRM hMidiStrm, LPMMTIME lpMMT, UINT cbm ret = MMSYSERR_INVALPARAM; } else { switch (lpMMT->wType) { - case TIME_MS: - lpMMT->u.ms = lpMidiStrm->dwPositionMS; + case TIME_MS: + lpMMT->u.ms = lpMidiStrm->dwPositionMS; TRACE("=> %ld ms\n", lpMMT->u.ms); break; case TIME_TICKS: - lpMMT->u.ticks = lpMidiStrm->dwPulses; + lpMMT->u.ticks = lpMidiStrm->dwPulses; TRACE("=> %ld ticks\n", lpMMT->u.ticks); break; default: @@ -3570,7 +3570,7 @@ MMRESULT WINAPI midiStreamPosition(HMIDISTRM hMidiStrm, LPMMTIME lpMMT, UINT cbm /************************************************************************** * midiStreamProperty [WINMM.@] */ -MMRESULT WINAPI midiStreamProperty(HMIDISTRM hMidiStrm, LPBYTE lpPropData, DWORD dwProperty) +MMRESULT WINAPI midiStreamProperty(HMIDISTRM hMidiStrm, LPBYTE lpPropData, DWORD dwProperty) { WINE_MIDIStream* lpMidiStrm; MMRESULT ret = MMSYSERR_NOERROR; @@ -3583,7 +3583,7 @@ MMRESULT WINAPI midiStreamProperty(HMIDISTRM hMidiStrm, LPBYTE lpPropData, DWORD ret = MMSYSERR_INVALPARAM; } else if (dwProperty & MIDIPROP_TEMPO) { MIDIPROPTEMPO* mpt = (MIDIPROPTEMPO*)lpPropData; - + if (sizeof(MIDIPROPTEMPO) != mpt->cbStruct) { ret = MMSYSERR_INVALPARAM; } else if (dwProperty & MIDIPROP_SET) { @@ -3595,7 +3595,7 @@ MMRESULT WINAPI midiStreamProperty(HMIDISTRM hMidiStrm, LPBYTE lpPropData, DWORD } } else if (dwProperty & MIDIPROP_TIMEDIV) { MIDIPROPTIMEDIV* mptd = (MIDIPROPTIMEDIV*)lpPropData; - + if (sizeof(MIDIPROPTIMEDIV) != mptd->cbStruct) { ret = MMSYSERR_INVALPARAM; } else if (dwProperty & MIDIPROP_SET) { @@ -3604,7 +3604,7 @@ MMRESULT WINAPI midiStreamProperty(HMIDISTRM hMidiStrm, LPBYTE lpPropData, DWORD } else if (dwProperty & MIDIPROP_GET) { mptd->dwTimeDiv = lpMidiStrm->dwTimeDiv; TRACE("Getting time div <= %ld\n", mptd->dwTimeDiv); - } + } } else { ret = MMSYSERR_INVALPARAM; } @@ -3615,7 +3615,7 @@ MMRESULT WINAPI midiStreamProperty(HMIDISTRM hMidiStrm, LPBYTE lpPropData, DWORD /************************************************************************** * midiStreamRestart [WINMM.@] */ -MMRESULT WINAPI midiStreamRestart(HMIDISTRM hMidiStrm) +MMRESULT WINAPI midiStreamRestart(HMIDISTRM hMidiStrm) { WINE_MIDIStream* lpMidiStrm; MMRESULT ret = MMSYSERR_NOERROR; @@ -3646,7 +3646,7 @@ MMRESULT WINAPI midiStreamRestart(HMIDISTRM hMidiStrm) /************************************************************************** * midiStreamStop [WINMM.@] */ -MMRESULT WINAPI midiStreamStop(HMIDISTRM hMidiStrm) +MMRESULT WINAPI midiStreamStop(HMIDISTRM hMidiStrm) { WINE_MIDIStream* lpMidiStrm; MMRESULT ret = MMSYSERR_NOERROR; @@ -3674,9 +3674,9 @@ MMRESULT16 WINAPI midiStreamClose16(HMIDISTRM16 hMidiStrm) /************************************************************************** * midiStreamOpen [MMSYSTEM.251] */ -MMRESULT16 WINAPI midiStreamOpen16(HMIDISTRM16* phMidiStrm, LPUINT16 devid, - DWORD cMidi, DWORD dwCallback, - DWORD dwInstance, DWORD fdwOpen) +MMRESULT16 WINAPI midiStreamOpen16(HMIDISTRM16* phMidiStrm, LPUINT16 devid, + DWORD cMidi, DWORD dwCallback, + DWORD dwInstance, DWORD fdwOpen) { HMIDISTRM hMidiStrm32; MMRESULT ret; @@ -3685,7 +3685,7 @@ MMRESULT16 WINAPI midiStreamOpen16(HMIDISTRM16* phMidiStrm, LPUINT16 devid, if (!phMidiStrm || !devid) return MMSYSERR_INVALPARAM; devid32 = *devid; - ret = MMSYSTEM_MidiStream_Open(&hMidiStrm32, &devid32, cMidi, dwCallback, + ret = MMSYSTEM_MidiStream_Open(&hMidiStrm32, &devid32, cMidi, dwCallback, dwInstance, fdwOpen, FALSE); *phMidiStrm = hMidiStrm32; *devid = devid32; @@ -3695,7 +3695,7 @@ MMRESULT16 WINAPI midiStreamOpen16(HMIDISTRM16* phMidiStrm, LPUINT16 devid, /************************************************************************** * midiStreamOut [MMSYSTEM.254] */ -MMRESULT16 WINAPI midiStreamOut16(HMIDISTRM16 hMidiStrm, LPMIDIHDR16 lpMidiHdr, UINT16 cbMidiHdr) +MMRESULT16 WINAPI midiStreamOut16(HMIDISTRM16 hMidiStrm, LPMIDIHDR16 lpMidiHdr, UINT16 cbMidiHdr) { return midiStreamOut(hMidiStrm, (LPMIDIHDR)lpMidiHdr, cbMidiHdr); } @@ -3703,7 +3703,7 @@ MMRESULT16 WINAPI midiStreamOut16(HMIDISTRM16 hMidiStrm, LPMIDIHDR16 lpMidiHdr, /************************************************************************** * midiStreamPause [MMSYSTEM.255] */ -MMRESULT16 WINAPI midiStreamPause16(HMIDISTRM16 hMidiStrm) +MMRESULT16 WINAPI midiStreamPause16(HMIDISTRM16 hMidiStrm) { return midiStreamPause(hMidiStrm); } @@ -3711,7 +3711,7 @@ MMRESULT16 WINAPI midiStreamPause16(HMIDISTRM16 hMidiStrm) /************************************************************************** * midiStreamPosition [MMSYSTEM.253] */ -MMRESULT16 WINAPI midiStreamPosition16(HMIDISTRM16 hMidiStrm, LPMMTIME16 lpmmt16, UINT16 cbmmt) +MMRESULT16 WINAPI midiStreamPosition16(HMIDISTRM16 hMidiStrm, LPMMTIME16 lpmmt16, UINT16 cbmmt) { MMTIME mmt32; MMRESULT ret; @@ -3727,7 +3727,7 @@ MMRESULT16 WINAPI midiStreamPosition16(HMIDISTRM16 hMidiStrm, LPMMTIME16 lpmmt16 /************************************************************************** * midiStreamProperty [MMSYSTEM.250] */ -MMRESULT16 WINAPI midiStreamProperty16(HMIDISTRM16 hMidiStrm, LPBYTE lpPropData, DWORD dwProperty) +MMRESULT16 WINAPI midiStreamProperty16(HMIDISTRM16 hMidiStrm, LPBYTE lpPropData, DWORD dwProperty) { return midiStreamProperty(hMidiStrm, lpPropData, dwProperty); } @@ -3735,7 +3735,7 @@ MMRESULT16 WINAPI midiStreamProperty16(HMIDISTRM16 hMidiStrm, LPBYTE lpPropData, /************************************************************************** * midiStreamRestart [MMSYSTEM.256] */ -MMRESULT16 WINAPI midiStreamRestart16(HMIDISTRM16 hMidiStrm) +MMRESULT16 WINAPI midiStreamRestart16(HMIDISTRM16 hMidiStrm) { return midiStreamRestart(hMidiStrm); } @@ -3743,14 +3743,14 @@ MMRESULT16 WINAPI midiStreamRestart16(HMIDISTRM16 hMidiStrm) /************************************************************************** * midiStreamStop [MMSYSTEM.257] */ -MMRESULT16 WINAPI midiStreamStop16(HMIDISTRM16 hMidiStrm) +MMRESULT16 WINAPI midiStreamStop16(HMIDISTRM16 hMidiStrm) { return midiStreamStop(hMidiStrm); } static UINT WINAPI MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType, - const LPWAVEFORMATEX lpFormat, - DWORD dwCallback, DWORD dwInstance, + const LPWAVEFORMATEX lpFormat, + DWORD dwCallback, DWORD dwInstance, DWORD dwFlags, BOOL bFrom32) { HANDLE handle; @@ -3758,8 +3758,8 @@ static UINT WINAPI MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType, DWORD dwRet = MMSYSERR_NOERROR; WAVEOPENDESC wod; - TRACE("(%p, %d, %s, %p, %08lX, %08lX, %08lX, %d);\n", - lphndl, (int)uDeviceID, (uType==MMDRV_WAVEOUT)?"Out":"In", lpFormat, dwCallback, + TRACE("(%p, %d, %s, %p, %08lX, %08lX, %08lX, %d);\n", + lphndl, (int)uDeviceID, (uType==MMDRV_WAVEOUT)?"Out":"In", lpFormat, dwCallback, dwInstance, dwFlags, bFrom32?32:16); if (dwFlags & WAVE_FORMAT_QUERY) TRACE("WAVE_FORMAT_QUERY requested !\n"); @@ -3768,12 +3768,12 @@ static UINT WINAPI MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType, if ((dwFlags & WAVE_MAPPED) && (uDeviceID == (UINT)-1)) return MMSYSERR_INVALPARAM; - TRACE("wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u\n", - lpFormat->wFormatTag, lpFormat->nChannels, lpFormat->nSamplesPerSec, + TRACE("wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u\n", + lpFormat->wFormatTag, lpFormat->nChannels, lpFormat->nSamplesPerSec, lpFormat->nAvgBytesPerSec, lpFormat->nBlockAlign, lpFormat->wBitsPerSample, lpFormat->cbSize); - - if ((wmld = MMDRV_Alloc(sizeof(WINE_WAVE), uType, &handle, - &dwFlags, &dwCallback, &dwInstance, bFrom32)) == NULL) + + if ((wmld = MMDRV_Alloc(sizeof(WINE_WAVE), uType, &handle, + &dwFlags, &dwCallback, &dwInstance, bFrom32)) == NULL) return MMSYSERR_NOMEM; wod.hWave = handle; @@ -3806,7 +3806,7 @@ static UINT WINAPI MMSYSTEM_waveOpen(HANDLE* lphndl, UINT uDeviceID, UINT uType, /************************************************************************** * waveOutGetNumDevs [WINMM.@] */ -UINT WINAPI waveOutGetNumDevs(void) +UINT WINAPI waveOutGetNumDevs(void) { return MMDRV_GetNum(MMDRV_WAVEOUT); } @@ -3822,7 +3822,7 @@ UINT16 WINAPI waveOutGetNumDevs16(void) /************************************************************************** * waveOutGetDevCaps [MMSYSTEM.402] */ -UINT16 WINAPI waveOutGetDevCaps16(UINT16 uDeviceID, +UINT16 WINAPI waveOutGetDevCaps16(UINT16 uDeviceID, LPWAVEOUTCAPS16 lpCaps, UINT16 uSize) { WAVEOUTCAPSA wocA; @@ -3856,8 +3856,8 @@ UINT WINAPI waveOutGetDevCapsA(UINT uDeviceID, LPWAVEOUTCAPSA lpCaps, TRACE("(%u %p %u)!\n", uDeviceID, lpCaps, uSize); if (lpCaps == NULL) return MMSYSERR_INVALPARAM; - - if ((wmld = MMDRV_Get(uDeviceID, MMDRV_WAVEOUT, TRUE)) == NULL) + + if ((wmld = MMDRV_Get(uDeviceID, MMDRV_WAVEOUT, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_GETDEVCAPS, (DWORD)lpCaps, uSize, TRUE); @@ -3874,7 +3874,7 @@ UINT WINAPI waveOutGetDevCapsW(UINT uDeviceID, LPWAVEOUTCAPSW lpCaps, UINT ret; if (lpCaps == NULL) return MMSYSERR_INVALPARAM; - + ret = waveOutGetDevCapsA(uDeviceID, &wocA, sizeof(wocA)); if (ret == MMSYSERR_NOERROR) { @@ -3906,8 +3906,8 @@ static UINT16 WAVE_GetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize) * a warning for the test was always true */ (/*uError >= MMSYSERR_BASE && */uError <= MMSYSERR_LASTERROR) || (uError >= WAVERR_BASE && uError <= WAVERR_LASTERROR)) { - - if (LoadStringA(MULTIMEDIA_GetIData()->hWinMM32Instance, + + if (LoadStringA(MULTIMEDIA_GetIData()->hWinMM32Instance, uError, lpText, uSize) > 0) { ret = MMSYSERR_NOERROR; } @@ -3938,7 +3938,7 @@ UINT WINAPI waveOutGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize) { LPSTR xstr = HeapAlloc(GetProcessHeap(), 0, uSize); UINT ret = WAVE_GetErrorText(uError, xstr, uSize); - + MultiByteToWideChar( CP_ACP, 0, xstr, -1, lpText, uSize ); HeapFree(GetProcessHeap(), 0, xstr); return ret; @@ -3952,7 +3952,7 @@ UINT WINAPI waveOutOpen(HWAVEOUT* lphWaveOut, UINT uDeviceID, const LPWAVEFORMATEX lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags) { - return MMSYSTEM_waveOpen(lphWaveOut, uDeviceID, MMDRV_WAVEOUT, lpFormat, + return MMSYSTEM_waveOpen(lphWaveOut, uDeviceID, MMDRV_WAVEOUT, lpFormat, dwCallback, dwInstance, dwFlags, TRUE); } @@ -3968,10 +3968,10 @@ UINT16 WINAPI waveOutOpen16(HWAVEOUT16* lphWaveOut, UINT16 uDeviceID, /* since layout of WAVEFORMATEX is the same for 16/32 bits, we directly * call the 32 bit version - * however, we need to promote correctly the wave mapper id + * however, we need to promote correctly the wave mapper id * (0xFFFFFFFF and not 0x0000FFFF) */ - ret = MMSYSTEM_waveOpen(&hWaveOut, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, + ret = MMSYSTEM_waveOpen(&hWaveOut, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, MMDRV_WAVEOUT, lpFormat, dwCallback, dwInstance, dwFlags, FALSE); if (lphWaveOut != NULL) *lphWaveOut = hWaveOut; @@ -3985,10 +3985,10 @@ UINT WINAPI waveOutClose(HWAVEOUT hWaveOut) { LPWINE_MLD wmld; DWORD dwRet; - + TRACE("(%04X)\n", hWaveOut); - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; dwRet = MMDRV_Close(wmld, WODM_CLOSE); @@ -4018,12 +4018,12 @@ UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut, WAVEHDR* lpWaveOutHdr, UINT uSize) { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); if (lpWaveOutHdr == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_PREPARE, (DWORD)lpWaveOutHdr, uSize, TRUE); @@ -4038,12 +4038,12 @@ UINT16 WINAPI waveOutPrepareHeader16(HWAVEOUT16 hWaveOut, /* [in] */ { LPWINE_MLD wmld; LPWAVEHDR lpWaveOutHdr = MapSL(lpsegWaveOutHdr); - + TRACE("(%04X, %08lx, %u);\n", hWaveOut, lpsegWaveOutHdr, uSize); if (lpWaveOutHdr == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_PREPARE, (DWORD)lpsegWaveOutHdr, uSize, FALSE); @@ -4056,14 +4056,14 @@ UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize) { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); if (!(lpWaveOutHdr->dwFlags & WHDR_PREPARED)) { return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_UNPREPARE, (DWORD)lpWaveOutHdr, uSize, TRUE); @@ -4078,14 +4078,14 @@ UINT16 WINAPI waveOutUnprepareHeader16(HWAVEOUT16 hWaveOut, /* [in] */ { LPWINE_MLD wmld; LPWAVEHDR lpWaveOutHdr = MapSL(lpsegWaveOutHdr); - + TRACE("(%04X, %08lx, %u);\n", hWaveOut, lpsegWaveOutHdr, uSize); if (!(lpWaveOutHdr->dwFlags & WHDR_PREPARED)) { return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_UNPREPARE, (DWORD)lpsegWaveOutHdr, uSize, FALSE); @@ -4098,10 +4098,10 @@ UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize) { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize); - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_WRITE, (DWORD)lpWaveOutHdr, uSize, TRUE); @@ -4115,10 +4115,10 @@ UINT16 WINAPI waveOutWrite16(HWAVEOUT16 hWaveOut, /* [in] */ UINT16 uSize) /* [in] */ { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %u);\n", hWaveOut, lpsegWaveOutHdr, uSize); - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_WRITE, (DWORD)lpsegWaveOutHdr, uSize, FALSE); @@ -4246,7 +4246,7 @@ UINT WINAPI waveOutGetPosition(HWAVEOUT hWaveOut, LPMMTIME lpTime, TRACE("(%04X, %p, %u);\n", hWaveOut, lpTime, uSize); - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WODM_GETPOS, (DWORD)lpTime, uSize, TRUE); @@ -4377,7 +4377,7 @@ UINT16 WINAPI waveOutGetVolume16(UINT16 devid, LPDWORD lpdw) { return waveOutGetVolume(devid, lpdw); } - + /************************************************************************** * waveOutSetVolume [WINMM.@] */ @@ -4400,7 +4400,7 @@ UINT16 WINAPI waveOutSetVolume16(UINT16 devid, DWORD dw) { return waveOutSetVolume(devid, dw); } - + /************************************************************************** * waveOutGetID [WINMM.@] */ @@ -4412,7 +4412,7 @@ UINT WINAPI waveOutGetID(HWAVEOUT hWaveOut, UINT* lpuDeviceID) if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -4430,7 +4430,7 @@ UINT16 WINAPI waveOutGetID16(HWAVEOUT16 hWaveOut, UINT16* lpuDeviceID) if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; - if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -4440,11 +4440,11 @@ UINT16 WINAPI waveOutGetID16(HWAVEOUT16 hWaveOut, UINT16* lpuDeviceID) /************************************************************************** * waveOutMessage [WINMM.@] */ -DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, +DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, DWORD dwParam1, DWORD dwParam2) { LPWINE_MLD wmld; - + TRACE("(%04x, %u, %ld, %ld)\n", hWaveOut, uMessage, dwParam1, dwParam2); if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) { @@ -4464,11 +4464,11 @@ DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, /************************************************************************** * waveOutMessage [MMSYSTEM.421] */ -DWORD WINAPI waveOutMessage16(HWAVEOUT16 hWaveOut, UINT16 uMessage, +DWORD WINAPI waveOutMessage16(HWAVEOUT16 hWaveOut, UINT16 uMessage, DWORD dwParam1, DWORD dwParam2) { LPWINE_MLD wmld; - + TRACE("(%04x, %u, %ld, %ld)\n", hWaveOut, uMessage, dwParam1, dwParam2); if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) { @@ -4518,7 +4518,7 @@ UINT WINAPI waveInGetDevCapsW(UINT uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize) lpCaps->dwFormats = wicA.dwFormats; lpCaps->wChannels = wicA.wChannels; } - + return ret; } @@ -4531,7 +4531,7 @@ UINT WINAPI waveInGetDevCapsA(UINT uDeviceID, LPWAVEINCAPSA lpCaps, UINT uSize) TRACE("(%u %p %u)!\n", uDeviceID, lpCaps, uSize); - if ((wmld = MMDRV_Get(uDeviceID, MMDRV_WAVEIN, TRUE)) == NULL) + if ((wmld = MMDRV_Get(uDeviceID, MMDRV_WAVEIN, TRUE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WIDM_GETDEVCAPS, (DWORD)lpCaps, uSize, TRUE); @@ -4540,7 +4540,7 @@ UINT WINAPI waveInGetDevCapsA(UINT uDeviceID, LPWAVEINCAPSA lpCaps, UINT uSize) /************************************************************************** * waveInGetDevCaps [MMSYSTEM.502] */ -UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps, +UINT16 WINAPI waveInGetDevCaps16(UINT16 uDeviceID, LPWAVEINCAPS16 lpCaps, UINT16 uSize) { WAVEINCAPSA wicA; @@ -4574,7 +4574,7 @@ UINT WINAPI waveInGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize) { LPSTR txt = HeapAlloc(GetProcessHeap(), 0, uSize); UINT ret = WAVE_GetErrorText(uError, txt, uSize); - + MultiByteToWideChar( CP_ACP, 0, txt, -1, lpText, uSize ); HeapFree(GetProcessHeap(), 0, txt); return ret; @@ -4595,7 +4595,7 @@ UINT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID, const LPWAVEFORMATEX lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags) { - return MMSYSTEM_waveOpen(lphWaveIn, uDeviceID, MMDRV_WAVEIN, lpFormat, + return MMSYSTEM_waveOpen(lphWaveIn, uDeviceID, MMDRV_WAVEIN, lpFormat, dwCallback, dwInstance, dwFlags, TRUE); } @@ -4611,10 +4611,10 @@ UINT16 WINAPI waveInOpen16(HWAVEIN16* lphWaveIn, UINT16 uDeviceID, /* since layout of WAVEFORMATEX is the same for 16/32 bits, we directly * call the 32 bit version - * however, we need to promote correctly the wave mapper id + * however, we need to promote correctly the wave mapper id * (0xFFFFFFFF and not 0x0000FFFF) */ - ret = MMSYSTEM_waveOpen(&hWaveIn, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, + ret = MMSYSTEM_waveOpen(&hWaveIn, (uDeviceID == (UINT16)-1) ? (UINT)-1 : uDeviceID, MMDRV_WAVEIN, lpFormat, dwCallback, dwInstance, dwFlags, FALSE); if (lphWaveIn != NULL) *lphWaveIn = hWaveIn; @@ -4628,10 +4628,10 @@ UINT WINAPI waveInClose(HWAVEIN hWaveIn) { LPWINE_MLD wmld; DWORD dwRet; - + TRACE("(%04X)\n", hWaveIn); - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; dwRet = MMDRV_Message(wmld, WIDM_CLOSE, 0L, 0L, TRUE); @@ -4656,15 +4656,15 @@ UINT16 WINAPI waveInClose16(HWAVEIN16 hWaveIn) /************************************************************************** * waveInPrepareHeader [WINMM.@] */ -UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr, +UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr, UINT uSize) { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); if (lpWaveInHdr == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; lpWaveInHdr->dwBytesRecorded = 0; @@ -4682,11 +4682,11 @@ UINT16 WINAPI waveInPrepareHeader16(HWAVEIN16 hWaveIn, /* [in] */ LPWINE_MLD wmld; LPWAVEHDR lpWaveInHdr = MapSL(lpsegWaveInHdr); UINT16 ret; - + TRACE("(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); if (lpWaveInHdr == NULL) return MMSYSERR_INVALHANDLE; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; lpWaveInHdr->dwBytesRecorded = 0; @@ -4698,11 +4698,11 @@ UINT16 WINAPI waveInPrepareHeader16(HWAVEIN16 hWaveIn, /* [in] */ /************************************************************************** * waveInUnprepareHeader [WINMM.@] */ -UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr, +UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr, UINT uSize) { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); if (lpWaveInHdr == NULL) return MMSYSERR_INVALPARAM; @@ -4710,7 +4710,7 @@ UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr, return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WIDM_UNPREPARE, (DWORD)lpWaveInHdr, uSize, TRUE); @@ -4719,13 +4719,13 @@ UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr, /************************************************************************** * waveInUnprepareHeader [MMSYSTEM.507] */ -UINT16 WINAPI waveInUnprepareHeader16(HWAVEIN16 hWaveIn, /* [in] */ +UINT16 WINAPI waveInUnprepareHeader16(HWAVEIN16 hWaveIn, /* [in] */ SEGPTR lpsegWaveInHdr, /* [???] */ UINT16 uSize) /* [in] */ { LPWINE_MLD wmld; LPWAVEHDR lpWaveInHdr = MapSL(lpsegWaveInHdr); - + TRACE("(%04X, %08lx, %u);\n", hWaveIn, lpsegWaveInHdr, uSize); if (lpWaveInHdr == NULL) return MMSYSERR_INVALPARAM; @@ -4734,7 +4734,7 @@ UINT16 WINAPI waveInUnprepareHeader16(HWAVEIN16 hWaveIn, /* [in] */ return MMSYSERR_NOERROR; } - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WIDM_UNPREPARE, (DWORD)lpsegWaveInHdr, uSize, FALSE); @@ -4747,11 +4747,11 @@ UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn, WAVEHDR* lpWaveInHdr, UINT uSize) { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize); if (lpWaveInHdr == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WIDM_ADDBUFFER, (DWORD)lpWaveInHdr, uSize, TRUE); @@ -4765,11 +4765,11 @@ UINT16 WINAPI waveInAddBuffer16(HWAVEIN16 hWaveIn, /* [in] */ UINT16 uSize) /* [in] */ { LPWINE_MLD wmld; - + TRACE("(%04X, %p, %u);\n", hWaveIn, lpsegWaveInHdr, uSize); if (lpsegWaveInHdr == NULL) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WIDM_ADDBUFFER, (DWORD)lpsegWaveInHdr, uSize, FALSE); @@ -4872,7 +4872,7 @@ UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, LPMMTIME lpTime, TRACE("(%04X, %p, %u);\n", hWaveIn, lpTime, uSize); - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, WIDM_GETPOS, (DWORD)lpTime, uSize, TRUE); @@ -4904,7 +4904,7 @@ UINT WINAPI waveInGetID(HWAVEIN hWaveIn, UINT* lpuDeviceID) if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -4922,7 +4922,7 @@ UINT16 WINAPI waveInGetID16(HWAVEIN16 hWaveIn, UINT16* lpuDeviceID) if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; *lpuDeviceID = wmld->uDeviceID; @@ -4936,14 +4936,14 @@ DWORD WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage, DWORD dwParam1, DWORD dwParam2) { LPWINE_MLD wmld; - + TRACE("(%04x, %u, %ld, %ld)\n", hWaveIn, uMessage, dwParam1, dwParam2); /* from M$ KB */ if (uMessage < DRVM_IOCTL || (uMessage >= DRVM_IOCTL_LAST && uMessage < DRVM_MAPPER)) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE); @@ -4963,7 +4963,7 @@ DWORD WINAPI waveInMessage16(HWAVEIN16 hWaveIn, UINT16 uMessage, if (uMessage < DRVM_IOCTL || (uMessage >= DRVM_IOCTL_LAST && uMessage < DRVM_MAPPER)) return MMSYSERR_INVALPARAM; - if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) + if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) return MMSYSERR_INVALHANDLE; return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2, TRUE); @@ -5004,7 +5004,7 @@ HINSTANCE16 WINAPI mmTaskCreate16(SEGPTR spProc, HINSTANCE16 *lphMmTask, DWORD d lp.cmdLine = MapLS(cmdline); lp.showCmd = MapLS(&showCmd); lp.reserved = 0; - + #ifndef USE_MM_TSK_WINE handle = LoadModule16("c:\\windows\\system\\mmtask.tsk", &lp); #else @@ -5074,7 +5074,7 @@ void WINAPI mmTaskBlock16(HINSTANCE16 WINE_UNUSED hInst) /************************************************************************** * mmTaskSignal [MMSYSTEM.903] */ -LRESULT WINAPI mmTaskSignal16(HTASK16 ht) +LRESULT WINAPI mmTaskSignal16(HTASK16 ht) { TRACE("(%04x);\n", ht); return PostAppMessage16(ht, WM_USER, 0, 0); @@ -5106,12 +5106,12 @@ DWORD WINAPI GetProcessFlags(DWORD); * mmThreadCreate [MMSYSTEM.1120] * * undocumented - * Creates a MM thread, calling fpThreadAddr(dwPmt). - * dwFlags: + * Creates a MM thread, calling fpThreadAddr(dwPmt). + * dwFlags: * bit.0 set means create a 16 bit task instead of thread calling a 16 bit proc - * bit.1 set means to open a VxD for this thread (unsupported) + * bit.1 set means to open a VxD for this thread (unsupported) */ -LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD dwPmt, DWORD dwFlags) +LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD dwPmt, DWORD dwFlags) { HANDLE16 hndl; LRESULT ret; @@ -5127,7 +5127,7 @@ LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD d #if 0 /* force mmtask routines even if mmthread is required */ - /* this will work only if the patch about binary cmd line and NE tasks + /* this will work only if the patch about binary cmd line and NE tasks * is committed */ dwFlags |= 1; @@ -5145,20 +5145,20 @@ LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD d lpMMThd->dwStatus = 0; lpMMThd->dwFlags = dwFlags; lpMMThd->hTask = 0; - + if ((dwFlags & 1) == 0 && (GetProcessFlags(GetCurrentThreadId()) & 8) == 0) { lpMMThd->hEvent = CreateEventA(0, 0, 1, 0); TRACE("Let's go crazy... trying new MM thread. lpMMThd=%p\n", lpMMThd); if (lpMMThd->dwFlags & 2) { - /* as long as we don't support MM VxD in wine, we don't need + /* as long as we don't support MM VxD in wine, we don't need * to care about this flag */ /* FIXME("Don't know how to properly open VxD handles\n"); */ /* lpMMThd->hVxD = OpenVxDHandle(lpMMThd->hEvent); */ } - lpMMThd->hThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)WINE_mmThreadEntryPoint, + lpMMThd->hThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)WINE_mmThreadEntryPoint, (LPVOID)(DWORD)hndl, CREATE_SUSPENDED, &lpMMThd->dwThreadID); if (lpMMThd->hThread == 0) { WARN("Couldn't create thread\n"); @@ -5171,7 +5171,7 @@ LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD d ret = 0; } } else { - /* get WINE_mmThreadEntryPoint() + /* get WINE_mmThreadEntryPoint() * 2047 is its ordinal in mmsystem.spec */ FARPROC16 fp = GetProcAddress16(GetModuleHandle16("MMSYSTEM"), (LPCSTR)2047); @@ -5206,7 +5206,7 @@ LRESULT WINAPI mmThreadCreate16(FARPROC16 fpThreadAddr, LPHANDLE lpHndl, DWORD d /************************************************************************** * mmThreadSignal [MMSYSTEM.1121] */ -void WINAPI mmThreadSignal16(HANDLE16 hndl) +void WINAPI mmThreadSignal16(HANDLE16 hndl) { TRACE("(%04x)!\n", hndl); @@ -5240,9 +5240,9 @@ static void MMSYSTEM_ThreadBlock(WINE_MMTHREAD* lpMMThd) if (InterlockedDecrement(&lpMMThd->dwSignalCount) >= 0) break; InterlockedIncrement(&lpMMThd->dwSignalCount); - + TRACE("S1\n"); - + ret = MsgWaitForMultipleObjects(1, &lpMMThd->hEvent, FALSE, INFINITE, QS_ALLINPUT); switch (ret) { case WAIT_OBJECT_0: /* Event */ @@ -5265,16 +5265,16 @@ static void MMSYSTEM_ThreadBlock(WINE_MMTHREAD* lpMMThd) /************************************************************************** * mmThreadBlock [MMSYSTEM.1122] */ -void WINAPI mmThreadBlock16(HANDLE16 hndl) +void WINAPI mmThreadBlock16(HANDLE16 hndl) { TRACE("(%04x)!\n", hndl); if (hndl) { WINE_MMTHREAD* lpMMThd = MapSL( MAKESEGPTR(hndl, 0) ); - + if (lpMMThd->hThread != 0) { DWORD lc; - + ReleaseThunkLock(&lc); MMSYSTEM_ThreadBlock(lpMMThd); RestoreThunkLock(lc); @@ -5288,7 +5288,7 @@ void WINAPI mmThreadBlock16(HANDLE16 hndl) /************************************************************************** * mmThreadIsCurrent [MMSYSTEM.1123] */ -BOOL16 WINAPI mmThreadIsCurrent16(HANDLE16 hndl) +BOOL16 WINAPI mmThreadIsCurrent16(HANDLE16 hndl) { BOOL16 ret = FALSE; @@ -5337,7 +5337,7 @@ BOOL16 WINAPI mmThreadIsValid16(HANDLE16 hndl) /************************************************************************** * mmThreadGetTask [MMSYSTEM.1125] */ -HANDLE16 WINAPI mmThreadGetTask16(HANDLE16 hndl) +HANDLE16 WINAPI mmThreadGetTask16(HANDLE16 hndl) { HANDLE16 ret = 0; @@ -5394,7 +5394,7 @@ typedef BOOL16 (WINAPI *MMCPLCALLBACK)(HWND, LPCSTR, LPCSTR, LPCSTR); /************************************************************************** * mmShowMMCPLPropertySheet [MMSYSTEM.1150] */ -BOOL16 WINAPI mmShowMMCPLPropertySheet16(HWND hWnd, LPCSTR lpStrDevice, +BOOL16 WINAPI mmShowMMCPLPropertySheet16(HWND hWnd, LPCSTR lpStrDevice, LPCSTR lpStrTab, LPCSTR lpStrTitle) { HANDLE hndl; @@ -5413,7 +5413,7 @@ BOOL16 WINAPI mmShowMMCPLPropertySheet16(HWND hWnd, LPCSTR lpStrDevice, } FreeLibrary(hndl); } - + return ret; } diff --git a/dlls/winmm/sound16.c b/dlls/winmm/sound16.c index 1ad1f5e9221..bf1755ccca3 100644 --- a/dlls/winmm/sound16.c +++ b/dlls/winmm/sound16.c @@ -67,7 +67,7 @@ INT16 WINAPI SetVoiceNote16(INT16 nVoice, INT16 nValue, INT16 nLength, INT16 WINAPI SetVoiceAccent16(INT16 nVoice, INT16 nTempo, INT16 nVolume, INT16 nMode, INT16 nPitch) { - FIXME("(%d,%d,%d,%d,%d): stub\n", nVoice, nTempo, + FIXME("(%d,%d,%d,%d,%d): stub\n", nVoice, nTempo, nVolume, nMode, nPitch); return 0; } diff --git a/dlls/winmm/time.c b/dlls/winmm/time.c index ca76c7f74ed..192140eacc5 100644 --- a/dlls/winmm/time.c +++ b/dlls/winmm/time.c @@ -59,11 +59,11 @@ static void TIME_TriggerCallBack(LPWINE_TIMERENTRY lpTimer) { TRACE("before CallBack => lpFunc=%p wTimerID=%04X dwUser=%08lX !\n", lpTimer->lpFunc, lpTimer->wTimerID, lpTimer->dwUser); - - /* - TimeProc callback that is called here is something strange, under Windows 3.1x it is called + + /* - TimeProc callback that is called here is something strange, under Windows 3.1x it is called * during interrupt time, is allowed to execute very limited number of API calls (like - * PostMessage), and must reside in DLL (therefore uses stack of active application). So I - * guess current implementation via SetTimer has to be improved upon. + * PostMessage), and must reside in DLL (therefore uses stack of active application). So I + * guess current implementation via SetTimer has to be improved upon. */ switch (lpTimer->wFlags & 0x30) { case TIME_CALLBACK_FUNCTION: @@ -80,7 +80,7 @@ static void TIME_TriggerCallBack(LPWINE_TIMERENTRY lpTimer) PulseEvent((HANDLE)lpTimer->lpFunc); break; default: - FIXME("Unknown callback type 0x%04x for mmtime callback (%p), ignored.\n", + FIXME("Unknown callback type 0x%04x for mmtime callback (%p), ignored.\n", lpTimer->wFlags, lpTimer->lpFunc); break; } @@ -101,23 +101,23 @@ static void CALLBACK TIME_MMSysTimeCallback(LPWINE_MM_IDATA iData) while (delta >= MMSYSTIME_MININTERVAL) { delta -= MMSYSTIME_MININTERVAL; iData->mmSysTimeMS += MMSYSTIME_MININTERVAL; - + /* since timeSetEvent() and timeKillEvent() can be called * from 16 bit code, there are cases where win16 lock is - * locked upon entering timeSetEvent(), and then the mm timer + * locked upon entering timeSetEvent(), and then the mm timer * critical section is locked. This function cannot call the * timer callback with the crit sect locked (because callback * may need to acquire Win16 lock, thus providing a deadlock * situation). * To cope with that, we just copy the WINE_TIMERENTRY struct * that need to trigger the callback, and call it without the - * mm timer crit sect locked. The bad side of this + * mm timer crit sect locked. The bad side of this * implementation is that, in some cases, the callback may be * invoked *after* a timer has been destroyed... * EPP 99/07/13 */ idx = 0; - + EnterCriticalSection(&iData->cs); for (lpTimer = iData->lpTimerList; lpTimer != NULL; ) { lpNextTimer = lpTimer->lpNext; @@ -129,8 +129,8 @@ static void CALLBACK TIME_MMSysTimeCallback(LPWINE_MM_IDATA iData) if (lpTimer->lpFunc) { if (idx == iData->nSizeLpTimers) { iData->lpTimers = (LPWINE_TIMERENTRY) - HeapReAlloc(GetProcessHeap(), 0, - iData->lpTimers, + HeapReAlloc(GetProcessHeap(), 0, + iData->lpTimers, ++iData->nSizeLpTimers * sizeof(WINE_TIMERENTRY)); } iData->lpTimers[idx++] = *lpTimer; @@ -144,7 +144,7 @@ static void CALLBACK TIME_MMSysTimeCallback(LPWINE_MM_IDATA iData) lpTimer = lpNextTimer; } LeaveCriticalSection(&iData->cs); - + while (idx > 0) { TIME_TriggerCallBack(&iData->lpTimers[--idx]); } @@ -283,7 +283,7 @@ static WORD timeSetEventInternal(UINT wDelay, UINT wResol, for (lpTimer = iData->lpTimerList; lpTimer != NULL; lpTimer = lpTimer->lpNext) { wNewID = max(wNewID, lpTimer->wTimerID); } - + lpNewTimer->lpNext = iData->lpTimerList; iData->lpTimerList = lpNewTimer; lpNewTimer->wTimerID = wNewID + 1; @@ -304,20 +304,20 @@ MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc, if (wFlags & WINE_TIMER_IS32) WARN("Unknown windows flag... wine internally used.. ooch\n"); - return timeSetEventInternal(wDelay, wResol, (FARPROC16)lpFunc, + return timeSetEventInternal(wDelay, wResol, (FARPROC16)lpFunc, dwUser, wFlags|WINE_TIMER_IS32); } /************************************************************************** * timeSetEvent [MMSYSTEM.602] */ -MMRESULT16 WINAPI timeSetEvent16(UINT16 wDelay, UINT16 wResol, LPTIMECALLBACK16 lpFunc, +MMRESULT16 WINAPI timeSetEvent16(UINT16 wDelay, UINT16 wResol, LPTIMECALLBACK16 lpFunc, DWORD dwUser, UINT16 wFlags) { if (wFlags & WINE_TIMER_IS32) WARN("Unknown windows flag... wine internally used.. ooch\n"); - return timeSetEventInternal(wDelay, wResol, (FARPROC16)lpFunc, + return timeSetEventInternal(wDelay, wResol, (FARPROC16)lpFunc, dwUser, wFlags & ~WINE_TIMER_IS32); } @@ -339,7 +339,7 @@ MMRESULT WINAPI timeKillEvent(UINT wID) } } LeaveCriticalSection(&iData->cs); - + if (*lpTimer) { LPWINE_TIMERENTRY lpTemp = *lpTimer; @@ -393,7 +393,7 @@ MMRESULT WINAPI timeBeginPeriod(UINT wPeriod) { TRACE("(%u) !\n", wPeriod); - if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) + if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) return TIMERR_NOCANDO; return 0; } @@ -405,7 +405,7 @@ MMRESULT16 WINAPI timeBeginPeriod16(UINT16 wPeriod) { TRACE("(%u) !\n", wPeriod); - if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) + if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) return TIMERR_NOCANDO; return 0; } @@ -417,7 +417,7 @@ MMRESULT WINAPI timeEndPeriod(UINT wPeriod) { TRACE("(%u) !\n", wPeriod); - if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) + if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) return TIMERR_NOCANDO; return 0; } @@ -429,7 +429,7 @@ MMRESULT16 WINAPI timeEndPeriod16(UINT16 wPeriod) { TRACE("(%u) !\n", wPeriod); - if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) + if (wPeriod < MMSYSTIME_MININTERVAL || wPeriod > MMSYSTIME_MAXINTERVAL) return TIMERR_NOCANDO; return 0; } diff --git a/dlls/winmm/wavemap/wavemap.c b/dlls/winmm/wavemap/wavemap.c index 9b1e6dfdcbc..a30c6080a56 100644 --- a/dlls/winmm/wavemap/wavemap.c +++ b/dlls/winmm/wavemap/wavemap.c @@ -1,5 +1,5 @@ /* -*- tab-width: 8; c-basic-offset: 4 -*- */ -/* +/* * Wine Wave mapper driver * * Copyright 1999,2001 Eric Pouech @@ -59,7 +59,7 @@ static BOOL WAVEMAP_IsData(WAVEMAPDATA* wm) * WAVE OUT part * *======================================================================*/ -static void CALLBACK wodCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance, +static void CALLBACK wodCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { WAVEMAPDATA* wom = (WAVEMAPDATA*)dwInstance; @@ -71,7 +71,7 @@ static void CALLBACK wodCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance, return; } - if (hWave != wom->hInnerWave && uMsg != WOM_OPEN) + if (hWave != wom->hInnerWave && uMsg != WOM_OPEN) ERR("Shouldn't happen (%08x %08x)\n", hWave, wom->hInnerWave); switch (uMsg) { @@ -94,12 +94,12 @@ static void CALLBACK wodCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance, ERR("Unknown msg %u\n", uMsg); } - DriverCallback(wom->dwCallback, HIWORD(wom->dwFlags), wom->hOuterWave, uMsg, + DriverCallback(wom->dwCallback, HIWORD(wom->dwFlags), wom->hOuterWave, uMsg, wom->dwClientInstance, dwParam1, dwParam2); } -static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx, - LPWAVEOPENDESC lpDesc, LPWAVEFORMATEX lpwfx, +static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx, + LPWAVEOPENDESC lpDesc, LPWAVEFORMATEX lpwfx, DWORD dwFlags) { DWORD ret; @@ -113,7 +113,7 @@ static DWORD wodOpenHelper(WAVEMAPDATA* wom, UINT idx, ret = acmStreamOpen(&wom->hAcmStream, 0, lpDesc->lpFormat, lpwfx, NULL, 0L, 0L, 0L); } if (ret == MMSYSERR_NOERROR) { - ret = waveOutOpen(&wom->hInnerWave, idx, lpwfx, (DWORD)wodCallback, + ret = waveOutOpen(&wom->hInnerWave, idx, lpwfx, (DWORD)wodCallback, (DWORD)wom, (dwFlags & ~CALLBACK_TYPEMASK) | CALLBACK_FUNCTION); if (ret != MMSYSERR_NOERROR && !(dwFlags & WAVE_FORMAT_QUERY)) { acmStreamClose(wom->hAcmStream, 0); @@ -154,7 +154,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) /* if no ACM stuff is involved, no need to handle callbacks at this * level, this will be done transparently */ - if (waveOutOpen(&wom->hInnerWave, i, lpDesc->lpFormat, (DWORD)wodCallback, + if (waveOutOpen(&wom->hInnerWave, i, lpDesc->lpFormat, (DWORD)wodCallback, (DWORD)wom, (dwFlags & ~CALLBACK_TYPEMASK) | CALLBACK_FUNCTION) == MMSYSERR_NOERROR) { wom->hAcmStream = 0; goto found; @@ -176,7 +176,7 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) TRY(11025, 16); /* 2^3 => 1, 1^3 => 2, so if stereo, try mono (and the other way around) */ - wfx.nChannels ^= 3; + wfx.nChannels ^= 3; TRY(44100, 16); TRY(22050, 16); TRY(11025, 16); @@ -188,13 +188,13 @@ static DWORD wodOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) TRY(11025, 8); /* 2^3 => 1, 1^3 => 2, so if stereo, try mono (and the other way around) */ - wfx.nChannels ^= 3; + wfx.nChannels ^= 3; TRY(44100, 8); TRY(22050, 8); TRY(11025, 8); } #undef TRY - + HeapFree(GetProcessHeap(), 0, wom); return MMSYSERR_ALLOCATED; found: @@ -230,14 +230,14 @@ static DWORD wodWrite(WAVEMAPDATA* wom, LPWAVEHDR lpWaveHdrSrc, DWORD dwParam2) if (!wom->hAcmStream) { return waveOutWrite(wom->hInnerWave, lpWaveHdrSrc, dwParam2); } - + lpWaveHdrSrc->dwFlags |= WHDR_INQUEUE; ash = (PACMSTREAMHEADER)lpWaveHdrSrc->reserved; /* acmStreamConvert will actually check that the new size is less than initial size */ ash->cbSrcLength = lpWaveHdrSrc->dwBufferLength; if (acmStreamConvert(wom->hAcmStream, ash, 0L) != MMSYSERR_NOERROR) return MMSYSERR_ERROR; - + lpWaveHdrDst = (LPWAVEHDR)((LPSTR)ash + sizeof(ACMSTREAMHEADER)); if (ash->cbDstLengthUsed == 0) { @@ -311,12 +311,12 @@ static DWORD wodUnprepare(WAVEMAPDATA* wom, LPWAVEHDR lpWaveHdrSrc, DWORD dwPara } ash = (PACMSTREAMHEADER)lpWaveHdrSrc->reserved; dwRet1 = acmStreamUnprepareHeader(wom->hAcmStream, ash, 0L); - + lpWaveHdrDst = (LPWAVEHDR)((LPSTR)ash + sizeof(ACMSTREAMHEADER)); dwRet2 = waveOutUnprepareHeader(wom->hInnerWave, lpWaveHdrDst, sizeof(*lpWaveHdrDst)); HeapFree(GetProcessHeap(), 0, ash); - + lpWaveHdrSrc->dwFlags &= ~WHDR_PREPARED; return (dwRet1 == MMSYSERR_NOERROR) ? dwRet2 : dwRet1; } @@ -339,7 +339,7 @@ static DWORD wodGetDevCaps(UINT wDevID, WAVEMAPDATA* wom, LPWAVEOUTCAPSA lpWaveC lpWaveCaps->wPid = 0x0001; lpWaveCaps->vDriverVersion = 0x0100; strcpy(lpWaveCaps->szPname, "Wine wave out mapper"); - lpWaveCaps->dwFormats = + lpWaveCaps->dwFormats = WAVE_FORMAT_4M08 | WAVE_FORMAT_4S08 | WAVE_FORMAT_4M16 | WAVE_FORMAT_4S16 | WAVE_FORMAT_2M08 | WAVE_FORMAT_2S08 | WAVE_FORMAT_2M16 | WAVE_FORMAT_2S16 | WAVE_FORMAT_1M08 | WAVE_FORMAT_1S08 | WAVE_FORMAT_1M16 | WAVE_FORMAT_1S16; @@ -349,7 +349,7 @@ static DWORD wodGetDevCaps(UINT wDevID, WAVEMAPDATA* wom, LPWAVEOUTCAPSA lpWaveC return MMSYSERR_NOERROR; } ERR("This shouldn't happen\n"); - return MMSYSERR_ERROR; + return MMSYSERR_ERROR; } static DWORD wodGetVolume(UINT wDevID, WAVEMAPDATA* wom, LPDWORD lpVol) @@ -392,13 +392,13 @@ static DWORD wodMapperStatus(WAVEMAPDATA* wom, DWORD flags, LPVOID ptr) DWORD ret = MMSYSERR_NOTSUPPORTED; switch (flags) { - case WAVEOUT_MAPPER_STATUS_DEVICE: + case WAVEOUT_MAPPER_STATUS_DEVICE: ret = waveOutGetID(wom->hInnerWave, &id); *(LPDWORD)ptr = id; break; case WAVEOUT_MAPPER_STATUS_MAPPED: FIXME("Unsupported flag=%ld\n", flags); - *(LPDWORD)ptr = 0; /* FIXME ?? */ + *(LPDWORD)ptr = 0; /* FIXME ?? */ break; case WAVEOUT_MAPPER_STATUS_FORMAT: FIXME("Unsupported flag=%ld\n", flags); @@ -416,12 +416,12 @@ static DWORD wodMapperStatus(WAVEMAPDATA* wom, DWORD flags, LPVOID ptr) /************************************************************************** * wodMessage (MSACMMAP.@) */ -DWORD WINAPI WAVEMAP_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, +DWORD WINAPI WAVEMAP_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); - + switch (wMsg) { case DRVM_INIT: case DRVM_EXIT: @@ -458,7 +458,7 @@ DWORD WINAPI WAVEMAP_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, * WAVE IN part * *======================================================================*/ -static void CALLBACK widCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance, +static void CALLBACK widCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { WAVEMAPDATA* wim = (WAVEMAPDATA*)dwInstance; @@ -470,7 +470,7 @@ static void CALLBACK widCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance, return; } - if (hWave != wim->hInnerWave && uMsg != WIM_OPEN) + if (hWave != wim->hInnerWave && uMsg != WIM_OPEN) ERR("Shouldn't happen (%08x %08x)\n", hWave, wim->hInnerWave); switch (uMsg) { @@ -502,12 +502,12 @@ static void CALLBACK widCallback(HWAVE hWave, UINT uMsg, DWORD dwInstance, ERR("Unknown msg %u\n", uMsg); } - DriverCallback(wim->dwCallback, HIWORD(wim->dwFlags), wim->hOuterWave, uMsg, + DriverCallback(wim->dwCallback, HIWORD(wim->dwFlags), wim->hOuterWave, uMsg, wim->dwClientInstance, dwParam1, dwParam2); } -static DWORD widOpenHelper(WAVEMAPDATA* wim, UINT idx, - LPWAVEOPENDESC lpDesc, LPWAVEFORMATEX lpwfx, +static DWORD widOpenHelper(WAVEMAPDATA* wim, UINT idx, + LPWAVEOPENDESC lpDesc, LPWAVEFORMATEX lpwfx, DWORD dwFlags) { DWORD ret; @@ -521,7 +521,7 @@ static DWORD widOpenHelper(WAVEMAPDATA* wim, UINT idx, ret = acmStreamOpen(&wim->hAcmStream, 0, lpwfx, lpDesc->lpFormat, NULL, 0L, 0L, 0L); } if (ret == MMSYSERR_NOERROR) { - ret = waveInOpen(&wim->hInnerWave, idx, lpwfx, (DWORD)widCallback, + ret = waveInOpen(&wim->hInnerWave, idx, lpwfx, (DWORD)widCallback, (DWORD)wim, (dwFlags & ~CALLBACK_TYPEMASK) | CALLBACK_FUNCTION); if (ret != MMSYSERR_NOERROR && !(dwFlags & WAVE_FORMAT_QUERY)) { acmStreamClose(wim->hAcmStream, 0); @@ -548,7 +548,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) wim->dwFlags = dwFlags; wim->dwClientInstance = lpDesc->dwInstance; wim->hOuterWave = lpDesc->hWave; - + ndhi = waveOutGetNumDevs(); if (dwFlags & WAVE_MAPPED) { if (lpDesc->uMappedDeviceID >= ndhi) return MMSYSERR_INVALPARAM; @@ -560,7 +560,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) } for (i = ndlo; i < ndhi; i++) { - if (waveInOpen(&wim->hInnerWave, i, lpDesc->lpFormat, (DWORD)widCallback, + if (waveInOpen(&wim->hInnerWave, i, lpDesc->lpFormat, (DWORD)widCallback, (DWORD)wim, (dwFlags & ~CALLBACK_TYPEMASK) | CALLBACK_FUNCTION) == MMSYSERR_NOERROR) { wim->hAcmStream = 0; goto found; @@ -581,7 +581,7 @@ static DWORD widOpen(LPDWORD lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags) TRY(11025, 8); /* 2^3 => 1, 1^3 => 2, so if stereo, try mono (and the other way around) */ - wfx.nChannels ^= 3; + wfx.nChannels ^= 3; TRY(44100, 8); TRY(22050, 8); TRY(11025, 8); @@ -627,7 +627,7 @@ static DWORD widAddBuffer(WAVEMAPDATA* wim, LPWAVEHDR lpWaveHdrDst, DWORD dwPara lpWaveHdrDst->dwFlags |= WHDR_INQUEUE; ash = (PACMSTREAMHEADER)lpWaveHdrDst->reserved; - + lpWaveHdrSrc = (LPWAVEHDR)((LPSTR)ash + sizeof(ACMSTREAMHEADER)); return waveInAddBuffer(wim->hInnerWave, lpWaveHdrSrc, sizeof(*lpWaveHdrSrc)); } @@ -642,7 +642,7 @@ static DWORD widPrepare(WAVEMAPDATA* wim, LPWAVEHDR lpWaveHdrDst, DWORD dwParam2 if (!wim->hAcmStream) { return waveInPrepareHeader(wim->hInnerWave, lpWaveHdrDst, dwParam2); } - if (acmStreamSize(wim->hAcmStream, lpWaveHdrDst->dwBufferLength, &size, + if (acmStreamSize(wim->hAcmStream, lpWaveHdrDst->dwBufferLength, &size, ACM_STREAMSIZEF_DESTINATION) != MMSYSERR_NOERROR) return MMSYSERR_ERROR; @@ -695,12 +695,12 @@ static DWORD widUnprepare(WAVEMAPDATA* wim, LPWAVEHDR lpWaveHdrDst, DWORD dwPara } ash = (PACMSTREAMHEADER)lpWaveHdrDst->reserved; dwRet1 = acmStreamUnprepareHeader(wim->hAcmStream, ash, 0L); - + lpWaveHdrSrc = (LPWAVEHDR)((LPSTR)ash + sizeof(ACMSTREAMHEADER)); dwRet2 = waveInUnprepareHeader(wim->hInnerWave, lpWaveHdrSrc, sizeof(*lpWaveHdrSrc)); HeapFree(GetProcessHeap(), 0, ash); - + lpWaveHdrDst->dwFlags &= ~WHDR_PREPARED; return (dwRet1 == MMSYSERR_NOERROR) ? dwRet2 : dwRet1; } @@ -723,15 +723,15 @@ static DWORD widGetDevCaps(UINT wDevID, WAVEMAPDATA* wim, LPWAVEINCAPSA lpWaveCa lpWaveCaps->wPid = 0x0001; lpWaveCaps->vDriverVersion = 0x0001; strcpy(lpWaveCaps->szPname, "Wine wave in mapper"); - lpWaveCaps->dwFormats = + lpWaveCaps->dwFormats = WAVE_FORMAT_4M08 | WAVE_FORMAT_4S08 | WAVE_FORMAT_4M16 | WAVE_FORMAT_4S16 | WAVE_FORMAT_2M08 | WAVE_FORMAT_2S08 | WAVE_FORMAT_2M16 | WAVE_FORMAT_2S16 | - WAVE_FORMAT_1M08 | WAVE_FORMAT_1S08 | WAVE_FORMAT_1M16 | WAVE_FORMAT_1S16; + WAVE_FORMAT_1M08 | WAVE_FORMAT_1S08 | WAVE_FORMAT_1M16 | WAVE_FORMAT_1S16; lpWaveCaps->wChannels = 2; return MMSYSERR_NOERROR; } ERR("This shouldn't happen\n"); - return MMSYSERR_ERROR; + return MMSYSERR_ERROR; } static DWORD widStop(WAVEMAPDATA* wim) @@ -755,18 +755,18 @@ static DWORD widMapperStatus(WAVEMAPDATA* wim, DWORD flags, LPVOID ptr) DWORD ret = MMSYSERR_NOTSUPPORTED; switch (flags) { - case WAVEIN_MAPPER_STATUS_DEVICE: + case WAVEIN_MAPPER_STATUS_DEVICE: ret = waveInGetID(wim->hInnerWave, &id); *(LPDWORD)ptr = id; break; case WAVEIN_MAPPER_STATUS_MAPPED: FIXME("Unsupported yet flag=%ld\n", flags); - *(LPDWORD)ptr = 0; /* FIXME ?? */ + *(LPDWORD)ptr = 0; /* FIXME ?? */ break; case WAVEIN_MAPPER_STATUS_FORMAT: FIXME("Unsupported flag=%ld\n", flags); /* ptr points to a WAVEFORMATEX struct - before or after streaming ? */ - *(LPDWORD)ptr = 0; /* FIXME ?? */ + *(LPDWORD)ptr = 0; /* FIXME ?? */ break; default: FIXME("Unsupported flag=%ld\n", flags); @@ -779,7 +779,7 @@ static DWORD widMapperStatus(WAVEMAPDATA* wim, DWORD flags, LPVOID ptr) /************************************************************************** * widMessage (MSACMMAP.@) */ -DWORD WINAPI WAVEMAP_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, +DWORD WINAPI WAVEMAP_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n", @@ -819,20 +819,20 @@ DWORD WINAPI WAVEMAP_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, static struct WINE_WAVEMAP* oss = NULL; /************************************************************************** - * WAVEMAP_drvOpen [internal] + * WAVEMAP_drvOpen [internal] */ static DWORD WAVEMAP_drvOpen(LPSTR str) { if (oss) return 0; - + /* I know, this is ugly, but who cares... */ oss = (struct WINE_WAVEMAP*)1; return 1; } /************************************************************************** - * WAVEMAP_drvClose [internal] + * WAVEMAP_drvClose [internal] */ static DWORD WAVEMAP_drvClose(DWORD dwDevID) { @@ -846,12 +846,12 @@ static DWORD WAVEMAP_drvClose(DWORD dwDevID) /************************************************************************** * DriverProc (MSACMMAP.@) */ -LONG CALLBACK WAVEMAP_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK WAVEMAP_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", dwDevID, hDriv, wMsg, dwParam1, dwParam2); - + switch(wMsg) { case DRV_LOAD: return 1; case DRV_FREE: return 1; diff --git a/dlls/winmm/winearts/arts.c b/dlls/winmm/winearts/arts.c index eb10352a35c..a6625c0150f 100644 --- a/dlls/winmm/winearts/arts.c +++ b/dlls/winmm/winearts/arts.c @@ -1,5 +1,5 @@ /* -*- tab-width: 8; c-basic-offset: 4 -*- */ -/* +/* * Wine Driver for aRts Sound Server * http://www.arts-project.org * @@ -34,20 +34,20 @@ static int arts = 0; /************************************************************************** - * ARTS_drvOpen [internal] + * ARTS_drvOpen [internal] */ static DWORD ARTS_drvOpen(LPSTR str) { if (arts) return 0; - + /* I know, this is ugly, but who cares... */ arts = 1; return 1; } /************************************************************************** - * ARTS_drvClose [internal] + * ARTS_drvClose [internal] */ static DWORD ARTS_drvClose(DWORD dwDevID) { @@ -63,16 +63,16 @@ static DWORD ARTS_drvClose(DWORD dwDevID) /************************************************************************** * DriverProc (WINEARTS.@) */ -LONG CALLBACK ARTS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK ARTS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */ /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */ - + switch(wMsg) { #ifdef HAVE_ARTS case DRV_LOAD: ARTS_WaveInit(); -/* ARTS_MidiInit(); FIXME: no midi +/* ARTS_MidiInit(); FIXME: no midi support in artsc so we don't have any in the arts driver */ return 1; case DRV_FREE: return ARTS_WaveClose(); diff --git a/dlls/winmm/winearts/audio.c b/dlls/winmm/winearts/audio.c index 0db2c8ac54c..edac29ac0bd 100644 --- a/dlls/winmm/winearts/audio.c +++ b/dlls/winmm/winearts/audio.c @@ -1,5 +1,5 @@ /* -*- tab-width: 8; c-basic-offset: 4 -*- */ -/* +/* * Wine Driver for aRts Sound Server * http://www.arts-project.org * @@ -24,7 +24,7 @@ */ /* NOTE: * with arts we cannot stop the audio that is already in - * the servers buffer, so to reduce delays during starting + * the servers buffer, so to reduce delays during starting * and stoppping of audio streams adjust the * audio buffer size in the kde control center or in the * artsd startup script @@ -105,7 +105,7 @@ typedef struct { HANDLE hEvent; /* if message is synchronous, handle of event for synchro */ } RING_MSG; -/* implement an in-process message ring for better performance +/* implement an in-process message ring for better performance * (compared to passing thru the server) * this ring will be used by the input (resp output) record (resp playback) routine */ @@ -142,7 +142,7 @@ typedef struct { LPWAVEHDR lpLoopPtr; /* pointer of first buffer in loop, if any */ DWORD dwLoops; /* private copy of loop counter */ - + DWORD dwPlayedTotal; /* number of bytes actually played since opening */ DWORD dwWrittenTotal; /* number of bytes written to the audio device since opening */ @@ -156,7 +156,7 @@ typedef struct { static WINE_WAVEOUT WOutDev [MAX_WAVEOUTDRV]; static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); - + /* These strings used only for tracing */ static const char *wodPlayerCmdString[] = { "WINE_WM_PAUSING", @@ -186,7 +186,7 @@ void volume_effect16(void *bufin, void* bufout, int length, int left, */ if (right == -1) right = left; - + for(i = 0; i < length; i+=(nChannels)) { v = (int) ((*(d_in++) * left) / 100); @@ -210,9 +210,9 @@ void volume_effect8(void *bufin, void* bufout, int length, int left, /* TRACE("length == %d, nChannels == %d\n", length, nChannels); */ - + if (right == -1) right = left; - + for(i = 0; i < length; i+=(nChannels)) { v = (char) ((*(d_in++) * left) / 100); @@ -256,7 +256,7 @@ LONG ARTS_WaveClose(void) { int iDevice; - /* close all open devices */ + /* close all open devices */ for(iDevice = 0; iDevice < MAX_WAVEOUTDRV; iDevice++) { if(WOutDev[iDevice].play_stream != (arts_stream_t*)-1) @@ -280,7 +280,7 @@ LONG ARTS_WaveInit(void) int errorcode; TRACE("called\n"); - + if ((errorcode = ARTS_Init()) < 0) { ERR("arts_init() failed (%d)\n", errorcode); @@ -294,7 +294,7 @@ LONG ARTS_WaveInit(void) memset(&WOutDev[i].caps, 0, sizeof(WOutDev[i].caps)); /* zero out caps values */ /* FIXME: some programs compare this string against the content of the registry - * for MM drivers. The names have to match in order for the program to work + * for MM drivers. The names have to match in order for the program to work * (e.g. MS win9x mplayer.exe) */ #ifdef EMULATE_SB16 @@ -310,7 +310,7 @@ LONG ARTS_WaveInit(void) WOutDev[i].caps.vDriverVersion = 0x0100; WOutDev[i].caps.dwFormats = 0x00000000; WOutDev[i].caps.dwSupport = WAVECAPS_VOLUME; - + WOutDev[i].caps.wChannels = 2; WOutDev[i].caps.dwSupport |= WAVECAPS_LRVOLUME; @@ -367,7 +367,7 @@ static int ARTS_DestroyRingMessage(ARTS_MSG_RING* mr) static int ARTS_AddRingMessage(ARTS_MSG_RING* mr, enum win_wm_message msg, DWORD param, BOOL wait) { HANDLE hEvent = INVALID_HANDLE_VALUE; - + EnterCriticalSection(&mr->msg_crst); if ((mr->msg_toget == ((mr->msg_tosave + 1) % ARTS_RING_BUFFER_SIZE))) /* buffer overflow? */ { @@ -386,7 +386,7 @@ static int ARTS_AddRingMessage(ARTS_MSG_RING* mr, enum win_wm_message msg, DWORD } if (mr->msg_toget != mr->msg_tosave && mr->messages[mr->msg_toget].msg != WINE_WM_HEADER) FIXME("two fast messages in the queue!!!!\n"); - + /* fast messages have to be added at the start of the queue */ mr->msg_toget = (mr->msg_toget + ARTS_RING_BUFFER_SIZE - 1) % ARTS_RING_BUFFER_SIZE; @@ -421,7 +421,7 @@ static int ARTS_AddRingMessage(ARTS_MSG_RING* mr, enum win_wm_message msg, DWORD * * Get a message from the ring. Should be called by the playback/record thread. */ -static int ARTS_RetrieveRingMessage(ARTS_MSG_RING* mr, +static int ARTS_RetrieveRingMessage(ARTS_MSG_RING* mr, enum win_wm_message *msg, DWORD *param, HANDLE *hEvent) { EnterCriticalSection(&mr->msg_crst); @@ -431,7 +431,7 @@ static int ARTS_RetrieveRingMessage(ARTS_MSG_RING* mr, LeaveCriticalSection(&mr->msg_crst); return 0; } - + *msg = mr->messages[mr->msg_toget].msg; mr->messages[mr->msg_toget].msg = 0; *param = mr->messages[mr->msg_toget].param; @@ -451,13 +451,13 @@ static int ARTS_RetrieveRingMessage(ARTS_MSG_RING* mr, static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { TRACE("wMsg = 0x%04x dwParm1 = %04lX dwParam2 = %04lX\n", wMsg, dwParam1, dwParam2); - + switch (wMsg) { case WOM_OPEN: case WOM_CLOSE: case WOM_DONE: - if (wwo->wFlags != DCB_NULL && - !DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags, wwo->waveDesc.hWave, + if (wwo->wFlags != DCB_NULL && + !DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags, wwo->waveDesc.hWave, wMsg, wwo->waveDesc.dwInstance, dwParam1, dwParam2)) { WARN("can't notify client !\n"); return MMSYSERR_ERROR; @@ -477,8 +477,8 @@ static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD dwParam1, DWORD static BOOL wodUpdatePlayedTotal(WINE_WAVEOUT* wwo) { /* total played is the bytes written less the bytes to write ;-) */ - wwo->dwPlayedTotal = wwo->dwWrittenTotal - - (wwo->dwBufferSize - + wwo->dwPlayedTotal = wwo->dwWrittenTotal - + (wwo->dwBufferSize - arts_stream_get(wwo->play_stream, ARTS_P_BUFFER_SPACE)); return TRUE; @@ -556,9 +556,9 @@ static LPWAVEHDR wodPlayer_PlayPtrNext(WINE_WAVEOUT* wwo) */ static DWORD wodPlayer_DSPWait(const WINE_WAVEOUT *wwo) { - int waitvalue = (wwo->dwBufferSize - arts_stream_get(wwo->play_stream, - ARTS_P_BUFFER_SPACE)) / ((wwo->format.wf.nSamplesPerSec * - wwo->format.wBitsPerSample * wwo->format.wf.nChannels) + int waitvalue = (wwo->dwBufferSize - arts_stream_get(wwo->play_stream, + ARTS_P_BUFFER_SPACE)) / ((wwo->format.wf.nSamplesPerSec * + wwo->format.wBitsPerSample * wwo->format.wf.nChannels) /1000); TRACE("wait value of %d\n", waitvalue); @@ -576,7 +576,7 @@ static DWORD wodPlayer_DSPWait(const WINE_WAVEOUT *wwo) */ static DWORD wodPlayer_NotifyWait(const WINE_WAVEOUT* wwo, LPWAVEHDR lpWaveHdr) { - DWORD dwMillis; + DWORD dwMillis; if(lpWaveHdr->reserved < wwo->dwPlayedTotal) { @@ -606,7 +606,7 @@ static int wodPlayer_WriteMaxFrags(WINE_WAVEOUT* wwo, DWORD* bytes) int toWrite = min(dwLength, *bytes); int written; - TRACE("Writing wavehdr %p.%lu[%lu]\n", + TRACE("Writing wavehdr %p.%lu[%lu]\n", wwo->lpPlayPtr, wwo->dwPartialOffset, wwo->lpPlayPtr->dwBufferLength); /* see if our buffer isn't large enough for the data we are writing */ @@ -639,18 +639,18 @@ static int wodPlayer_WriteMaxFrags(WINE_WAVEOUT* wwo, DWORD* bytes) { /* apply volume to the buffer we are about to send */ /* divide toWrite(bytes) by 2 as volume processes by 16 bits */ - volume_effect16(wwo->lpPlayPtr->lpData + wwo->dwPartialOffset, - wwo->sound_buffer, toWrite>>1, wwo->volume_left, + volume_effect16(wwo->lpPlayPtr->lpData + wwo->dwPartialOffset, + wwo->sound_buffer, toWrite>>1, wwo->volume_left, wwo->volume_right, wwo->format.wf.nChannels); } else if(wwo->format.wBitsPerSample == 8) { /* apply volume to the buffer we are about to send */ - volume_effect8(wwo->lpPlayPtr->lpData + wwo->dwPartialOffset, - wwo->sound_buffer, toWrite>>1, wwo->volume_left, + volume_effect8(wwo->lpPlayPtr->lpData + wwo->dwPartialOffset, + wwo->sound_buffer, toWrite>>1, wwo->volume_left, wwo->volume_right, wwo->format.wf.nChannels); } else { - FIXME("unsupported wwo->format.wBitsPerSample of %d\n", + FIXME("unsupported wwo->format.wBitsPerSample of %d\n", wwo->format.wBitsPerSample); } @@ -690,8 +690,8 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force) * - we hit the beginning of a running loop * - we hit a wavehdr which hasn't finished playing */ - while ((lpWaveHdr = wwo->lpQueuePtr) && - (force || + while ((lpWaveHdr = wwo->lpQueuePtr) && + (force || (lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr && lpWaveHdr->reserved <= wwo->dwPlayedTotal))) { @@ -703,7 +703,7 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force) wodNotifyClient(wwo, WOM_DONE, (DWORD)lpWaveHdr, 0); } - return (lpWaveHdr && lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr) ? + return (lpWaveHdr && lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr) ? wodPlayer_NotifyWait(wwo, lpWaveHdr) : INFINITE; } @@ -750,11 +750,11 @@ static void wodPlayer_Reset(WINE_WAVEOUT* wwo, BOOL reset) } ((LPWAVEHDR)param)->dwFlags &= ~WHDR_INQUEUE; ((LPWAVEHDR)param)->dwFlags |= WHDR_DONE; - + wodNotifyClient(wwo, WOM_DONE, param, 0); } ResetEvent(wwo->msgRing.msg_event); - LeaveCriticalSection(&wwo->msgRing.msg_crst); + LeaveCriticalSection(&wwo->msgRing.msg_crst); } else { if (wwo->lpLoopPtr) { /* complicated case, not handled yet (could imply modifying the loop counter */ @@ -794,7 +794,7 @@ static void wodPlayer_ProcessMessages(WINE_WAVEOUT* wwo) break; case WINE_WM_HEADER: lpWaveHdr = (LPWAVEHDR)param; - + /* insert buffer at the end of queue */ { LPWAVEHDR* wh; @@ -923,9 +923,9 @@ static DWORD CALLBACK wodPlayer(LPVOID pmt) static DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPSA lpCaps, DWORD dwSize) { TRACE("(%u, %p, %lu);\n", wDevID, lpCaps, dwSize); - + if (lpCaps == NULL) return MMSYSERR_NOTENABLED; - + if (wDevID >= MAX_WAVEOUTDRV) { TRACE("MAX_WAVOUTDRV reached !\n"); return MMSYSERR_BADDEVICEID; @@ -963,14 +963,14 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM || lpDesc->lpFormat->nChannels == 0 || lpDesc->lpFormat->nSamplesPerSec == 0) { - WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", + WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, lpDesc->lpFormat->nSamplesPerSec); return WAVERR_BADFORMAT; } if (dwFlags & WAVE_FORMAT_QUERY) { - TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", + TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, lpDesc->lpFormat->nSamplesPerSec); return MMSYSERR_NOERROR; @@ -982,10 +982,10 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) dwFlags &= ~WAVE_DIRECTSOUND; wwo->wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); - + memcpy(&wwo->waveDesc, lpDesc, sizeof(WAVEOPENDESC)); memcpy(&wwo->format, lpDesc->lpFormat, sizeof(PCMWAVEFORMAT)); - + if (wwo->format.wBitsPerSample == 0) { WARN("Resetting zeroed wBitsPerSample\n"); wwo->format.wBitsPerSample = 8 * @@ -994,7 +994,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) wwo->format.wf.nChannels; } - wwo->play_stream = arts_play_stream(wwo->format.wf.nSamplesPerSec, + wwo->play_stream = arts_play_stream(wwo->format.wf.nSamplesPerSec, wwo->format.wBitsPerSample, wwo->format.wf.nChannels, "winearts"); /* clear these so we don't have any confusion ;-) */ @@ -1005,9 +1005,9 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) if(!wwo->play_stream) return MMSYSERR_ALLOCATED; - /* Try to set buffer size from constant and store the value that it + /* Try to set buffer size from constant and store the value that it was set to for future use */ - wwo->dwBufferSize = arts_stream_set(wwo->play_stream, + wwo->dwBufferSize = arts_stream_set(wwo->play_stream, ARTS_P_BUFFER_SIZE, BUFFER_SIZE); TRACE("Tried to set BUFFER_SIZE of %d, wwo->dwBufferSize is actually %ld\n", BUFFER_SIZE, wwo->dwBufferSize); wwo->dwPlayedTotal = 0; @@ -1027,14 +1027,14 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) } wwo->hStartUpEvent = INVALID_HANDLE_VALUE; - TRACE("stream=0x%lx, dwBufferSize=%ld\n", + TRACE("stream=0x%lx, dwBufferSize=%ld\n", (long)wwo->play_stream, wwo->dwBufferSize); - TRACE("wBitsPerSample=%u, nAvgBytesPerSec=%lu, nSamplesPerSec=%lu, nChannels=%u nBlockAlign=%u!\n", - wwo->format.wBitsPerSample, wwo->format.wf.nAvgBytesPerSec, + TRACE("wBitsPerSample=%u, nAvgBytesPerSec=%lu, nSamplesPerSec=%lu, nChannels=%u nBlockAlign=%u!\n", + wwo->format.wBitsPerSample, wwo->format.wf.nAvgBytesPerSec, wwo->format.wf.nSamplesPerSec, wwo->format.wf.nChannels, wwo->format.wf.nBlockAlign); - + return wodNotifyClient(wwo, WOM_OPEN, 0L, 0L); } @@ -1047,14 +1047,14 @@ static DWORD wodClose(WORD wDevID) WINE_WAVEOUT* wwo; TRACE("(%u);\n", wDevID); - - if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == + + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == (arts_stream_t*)-1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + wwo = &WOutDev[wDevID]; if (wwo->lpQueuePtr) { WARN("buffers still playing !\n"); @@ -1076,27 +1076,27 @@ static DWORD wodClose(WORD wDevID) /************************************************************************** * wodWrite [internal] - * + * */ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { TRACE("(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); - + /* first, do the sanity checks... */ - if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == (arts_stream_t*)-1) { WARN("bad dev ID !\n"); return MMSYSERR_BADDEVICEID; } - - if (lpWaveHdr->lpData == NULL || !(lpWaveHdr->dwFlags & WHDR_PREPARED)) + + if (lpWaveHdr->lpData == NULL || !(lpWaveHdr->dwFlags & WHDR_PREPARED)) { TRACE("unprepared\n"); return WAVERR_UNPREPARED; } - - if (lpWaveHdr->dwFlags & WHDR_INQUEUE) + + if (lpWaveHdr->dwFlags & WHDR_INQUEUE) { TRACE("still playing\n"); return WAVERR_STILLPLAYING; @@ -1118,15 +1118,15 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) static DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { TRACE("(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); - + if (wDevID >= MAX_WAVEOUTDRV) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + if (lpWaveHdr->dwFlags & WHDR_INQUEUE) return WAVERR_STILLPLAYING; - + lpWaveHdr->dwFlags |= WHDR_PREPARED; lpWaveHdr->dwFlags &= ~WHDR_DONE; return MMSYSERR_NOERROR; @@ -1138,18 +1138,18 @@ static DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) static DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { TRACE("(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); - + if (wDevID >= MAX_WAVEOUTDRV) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + if (lpWaveHdr->dwFlags & WHDR_INQUEUE) return WAVERR_STILLPLAYING; - + lpWaveHdr->dwFlags &= ~WHDR_PREPARED; lpWaveHdr->dwFlags |= WHDR_DONE; - + return MMSYSERR_NOERROR; } @@ -1159,17 +1159,17 @@ static DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) static DWORD wodPause(WORD wDevID) { TRACE("(%u);!\n", wDevID); - - if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == + + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == (arts_stream_t*)-1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + TRACE("imhere[3-PAUSING]\n"); ARTS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_PAUSING, 0, TRUE); - + return MMSYSERR_NOERROR; } @@ -1179,24 +1179,24 @@ static DWORD wodPause(WORD wDevID) static DWORD wodRestart(WORD wDevID) { TRACE("(%u);\n", wDevID); - - if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == + + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == (arts_stream_t*)-1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + if (WOutDev[wDevID].state == WINE_WS_PAUSED) { TRACE("imhere[3-RESTARTING]\n"); ARTS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_RESTARTING, 0, TRUE); } - + /* FIXME: is NotifyClient with WOM_DONE right ? (Comet Busters 1.3.3 needs this notification) */ /* FIXME: Myst crashes with this ... hmm -MM return wodNotifyClient(wwo, WOM_DONE, 0L, 0L); */ - + return MMSYSERR_NOERROR; } @@ -1206,17 +1206,17 @@ static DWORD wodRestart(WORD wDevID) static DWORD wodReset(WORD wDevID) { TRACE("(%u);\n", wDevID); - - if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == + + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == (arts_stream_t*)-1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + TRACE("imhere[3-RESET]\n"); ARTS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_RESETTING, 0, TRUE); - + return MMSYSERR_NOERROR; } @@ -1230,26 +1230,26 @@ static DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) WINE_WAVEOUT* wwo; TRACE("(%u, %p, %lu);\n", wDevID, lpTime, uSize); - - if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == + + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == (arts_stream_t*)-1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + if (lpTime == NULL) return MMSYSERR_INVALPARAM; wwo = &WOutDev[wDevID]; ARTS_AddRingMessage(&wwo->msgRing, WINE_WM_UPDATE, 0, TRUE); val = wwo->dwPlayedTotal; - TRACE("wType=%04X wBitsPerSample=%u nSamplesPerSec=%lu nChannels=%u nAvgBytesPerSec=%lu\n", - lpTime->wType, wwo->format.wBitsPerSample, - wwo->format.wf.nSamplesPerSec, wwo->format.wf.nChannels, - wwo->format.wf.nAvgBytesPerSec); + TRACE("wType=%04X wBitsPerSample=%u nSamplesPerSec=%lu nChannels=%u nAvgBytesPerSec=%lu\n", + lpTime->wType, wwo->format.wBitsPerSample, + wwo->format.wf.nSamplesPerSec, wwo->format.wf.nChannels, + wwo->format.wf.nAvgBytesPerSec); TRACE("dwPlayedTotal=%lu\n", val); - + switch (lpTime->wType) { case TIME_BYTES: lpTime->u.cb = val; @@ -1290,8 +1290,8 @@ static DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) static DWORD wodBreakLoop(WORD wDevID) { TRACE("(%u);\n", wDevID); - - if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == + + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].play_stream == (arts_stream_t*)-1) { WARN("bad device ID !\n"); @@ -1300,7 +1300,7 @@ static DWORD wodBreakLoop(WORD wDevID) ARTS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_BREAKLOOP, 0, TRUE); return MMSYSERR_NOERROR; } - + /************************************************************************** * wodGetVolume [internal] */ @@ -1313,7 +1313,7 @@ static DWORD wodGetVolume(WORD wDevID, LPDWORD lpdwVol) TRACE("(%u, %p);\n", wDevID, lpdwVol); - *lpdwVol = ((left * 0xFFFFl) / 100) + (((right * 0xFFFFl) / 100) << + *lpdwVol = ((left * 0xFFFFl) / 100) + (((right * 0xFFFFl) / 100) << 16); return MMSYSERR_NOERROR; @@ -1327,7 +1327,7 @@ static DWORD wodSetVolume(WORD wDevID, DWORD dwParam) DWORD left, right; left = (LOWORD(dwParam) * 100) / 0xFFFFl; - right = (HIWORD(dwParam) * 100) / 0xFFFFl; + right = (HIWORD(dwParam) * 100) / 0xFFFFl; TRACE("(%u, %08lX);\n", wDevID, dwParam); @@ -1348,12 +1348,12 @@ static DWORD wodGetNumDevs(void) /************************************************************************** * wodMessage (WINEARTS.@) */ -DWORD WINAPI ARTS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, +DWORD WINAPI ARTS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); - + switch (wMsg) { case DRVM_INIT: case DRVM_EXIT: @@ -1392,7 +1392,7 @@ DWORD WINAPI ARTS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, *======================================================================*/ static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv) { - /* we can't perform memory mapping as we don't have a file stream + /* we can't perform memory mapping as we don't have a file stream interface with arts like we do with oss */ MESSAGE("This sound card's driver does not support direct access\n"); MESSAGE("The (slower) DirectSound HEL mode will be used instead.\n"); @@ -1404,7 +1404,7 @@ static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv) /************************************************************************** * wodMessage (WINEARTS.@) */ -DWORD WINAPI ARTS_wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, +DWORD WINAPI ARTS_wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); diff --git a/dlls/winmm/winemm.h b/dlls/winmm/winemm.h index 6d7b1c399f3..5f5cef3b339 100644 --- a/dlls/winmm/winemm.h +++ b/dlls/winmm/winemm.h @@ -77,7 +77,7 @@ typedef struct { extern BOOL MMDRV_Init(void); extern UINT MMDRV_GetNum(UINT); -extern LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags, +extern LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags, DWORD* dwCallback, DWORD* dwInstance, BOOL bFrom32); extern void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld); extern DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD dwParam1, DWORD dwParam2); @@ -218,7 +218,7 @@ extern DWORD MCI_SendCommandFrom16(UINT wDevID, UINT16 wMsg, DWORD dwParam1, void CALLBACK WINE_mmThreadEntryPoint(DWORD _pmt); void MMSYSTEM_MMTIME16to32(LPMMTIME mmt32, const MMTIME16* mmt16); -void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32); +void MMSYSTEM_MMTIME32to16(LPMMTIME16 mmt16, const MMTIME* mmt32); BOOL MULTIMEDIA_MciInit(void); LPWINE_MM_IDATA MULTIMEDIA_GetIData(void); diff --git a/dlls/winmm/wineoss/audio.c b/dlls/winmm/wineoss/audio.c index 1db4fed6ebf..44269aeb144 100644 --- a/dlls/winmm/wineoss/audio.c +++ b/dlls/winmm/wineoss/audio.c @@ -1,5 +1,5 @@ /* -*- tab-width: 8; c-basic-offset: 4 -*- */ -/* +/* * Sample Wine Driver for Open Sound System (featured in Linux and FreeBSD) * * Copyright 1994 Martin Ayotte @@ -101,7 +101,7 @@ typedef struct { HANDLE hEvent; /* if message is synchronous, handle of event for synchro */ } OSS_MSG; -/* implement an in-process message ring for better performance +/* implement an in-process message ring for better performance * (compared to passing thru the server) * this ring will be used by the input (resp output) record (resp playback) routine */ @@ -132,7 +132,7 @@ typedef struct { LPWAVEHDR lpLoopPtr; /* pointer of first buffer in loop, if any */ DWORD dwLoops; /* private copy of loop counter */ - + DWORD dwPlayedTotal; /* number of bytes actually played since opening */ DWORD dwWrittenTotal; /* number of bytes written to OSS buffer since opening */ @@ -170,7 +170,7 @@ static WINE_WAVEOUT WOutDev [MAX_WAVEOUTDRV]; static WINE_WAVEIN WInDev [MAX_WAVEINDRV ]; static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv); - + /* These strings used only for tracing */ static const char *wodPlayerCmdString[] = { "WINE_WM_PAUSING", @@ -208,8 +208,8 @@ static int OSS_OpenDevice(unsigned wDevID, unsigned req_access) /* FIXME: race */ if (OSS_OpenCount == 0) { - if (access(SOUND_DEV, 0) != 0 || - (OSS_OpenFD = open(SOUND_DEV, req_access|O_NDELAY, 0)) == -1) + if (access(SOUND_DEV, 0) != 0 || + (OSS_OpenFD = open(SOUND_DEV, req_access|O_NDELAY, 0)) == -1) { WARN("Couldn't open out %s (%s)\n", SOUND_DEV, strerror(errno)); return -1; @@ -220,7 +220,7 @@ static int OSS_OpenDevice(unsigned wDevID, unsigned req_access) OSS_OpenAccess = req_access; OSS_OwnerThreadID = GetCurrentThreadId(); } - else + else { if (OSS_OpenAccess != req_access) { @@ -238,7 +238,7 @@ static int OSS_OpenDevice(unsigned wDevID, unsigned req_access) return OSS_OpenFD; #else int fd; - if (access(SOUND_DEV, 0) != 0 || (fd = open(SOUND_DEV, req_access|O_NDELAY, 0)) == -1) + if (access(SOUND_DEV, 0) != 0 || (fd = open(SOUND_DEV, req_access|O_NDELAY, 0)) == -1) { WARN("Couldn't open out %s (%s)\n", SOUND_DEV, strerror(errno)); return -1; @@ -282,7 +282,7 @@ LONG OSS_WaveInit(void) int mask; int i; - + /* start with output device */ /* initialize all device handles to -1 */ @@ -299,7 +299,7 @@ LONG OSS_WaveInit(void) ioctl(audio, SNDCTL_DSP_RESET, 0); /* FIXME: some programs compare this string against the content of the registry - * for MM drivers. The names have to match in order for the program to work + * for MM drivers. The names have to match in order for the program to work * (e.g. MS win9x mplayer.exe) */ #ifdef EMULATE_SB16 @@ -315,16 +315,16 @@ LONG OSS_WaveInit(void) WOutDev[0].caps.vDriverVersion = 0x0100; WOutDev[0].caps.dwFormats = 0x00000000; WOutDev[0].caps.dwSupport = WAVECAPS_VOLUME; - + ioctl(audio, SNDCTL_DSP_GETFMTS, &mask); TRACE("OSS dsp out mask=%08x\n", mask); /* First bytespersampl, then stereo */ bytespersmpl = (ioctl(audio, SNDCTL_DSP_SAMPLESIZE, &samplesize) != 0) ? 1 : 2; - + WOutDev[0].caps.wChannels = (ioctl(audio, SNDCTL_DSP_STEREO, &dsp_stereo) != 0) ? 1 : 2; if (WOutDev[0].caps.wChannels > 1) WOutDev[0].caps.dwSupport |= WAVECAPS_LRVOLUME; - + smplrate = 44100; if (ioctl(audio, SNDCTL_DSP_SPEED, &smplrate) == 0) { if (mask & AFMT_U8) { @@ -381,12 +381,12 @@ LONG OSS_WaveInit(void) /* then do input device */ samplesize = 16; dsp_stereo = 1; - + for (i = 0; i < MAX_WAVEINDRV; ++i) { WInDev[i].unixdev = -1; } - + memset(&WInDev[0].caps, 0, sizeof(WInDev[0].caps)); if ((audio = OSS_OpenDevice(0, O_RDONLY)) == -1) return -1; @@ -404,7 +404,7 @@ LONG OSS_WaveInit(void) #endif WInDev[0].caps.dwFormats = 0x00000000; WInDev[0].caps.wChannels = (ioctl(audio, SNDCTL_DSP_STEREO, &dsp_stereo) != 0) ? 1 : 2; - + WInDev[0].bTriggerSupport = FALSE; if (ioctl(audio, SNDCTL_DSP_GETCAPS, &caps) == 0) { TRACE("OSS dsp in caps=%08X\n", caps); @@ -532,7 +532,7 @@ static int OSS_AddRingMessage(OSS_MSG_RING* omr, enum win_wm_message msg, DWORD omr->messages[omr->msg_toget].hEvent = hEvent; } else - { + { omr->messages[omr->msg_tosave].msg = msg; omr->messages[omr->msg_tosave].param = param; omr->messages[omr->msg_tosave].hEvent = INVALID_HANDLE_VALUE; @@ -555,7 +555,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, +static int OSS_RetrieveRingMessage(OSS_MSG_RING* omr, enum win_wm_message *msg, DWORD *param, HANDLE *hEvent) { EnterCriticalSection(&omr->msg_crst); @@ -565,7 +565,7 @@ static int OSS_RetrieveRingMessage(OSS_MSG_RING* omr, LeaveCriticalSection(&omr->msg_crst); return 0; } - + *msg = omr->messages[omr->msg_toget].msg; omr->messages[omr->msg_toget].msg = 0; *param = omr->messages[omr->msg_toget].param; @@ -585,13 +585,13 @@ static int OSS_RetrieveRingMessage(OSS_MSG_RING* omr, static DWORD wodNotifyClient(WINE_WAVEOUT* wwo, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { TRACE("wMsg = 0x%04x dwParm1 = %04lX dwParam2 = %04lX\n", wMsg, dwParam1, dwParam2); - + switch (wMsg) { case WOM_OPEN: case WOM_CLOSE: case WOM_DONE: - if (wwo->wFlags != DCB_NULL && - !DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags, wwo->waveDesc.hWave, + if (wwo->wFlags != DCB_NULL && + !DriverCallback(wwo->waveDesc.dwCallback, wwo->wFlags, wwo->waveDesc.hWave, wMsg, wwo->waveDesc.dwInstance, dwParam1, dwParam2)) { WARN("can't notify client !\n"); return MMSYSERR_ERROR; @@ -686,7 +686,7 @@ static LPWAVEHDR wodPlayer_PlayPtrNext(WINE_WAVEOUT* wwo) /************************************************************************** * wodPlayer_DSPWait [internal] - * Returns the number of milliseconds to wait for the DSP buffer to write + * Returns the number of milliseconds to wait for the DSP buffer to write * one fragment. */ static DWORD wodPlayer_DSPWait(const WINE_WAVEOUT *wwo) @@ -729,7 +729,7 @@ static BOOL wodPlayer_WriteMaxFrags(WINE_WAVEOUT* wwo, DWORD* bytes) int written; BOOL ret = FALSE; - TRACE("Writing wavehdr %p.%lu[%lu]/%lu\n", + TRACE("Writing wavehdr %p.%lu[%lu]/%lu\n", wwo->lpPlayPtr, wwo->dwPartialOffset, wwo->lpPlayPtr->dwBufferLength, toWrite); if (toWrite > 0) @@ -772,8 +772,8 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force) * - we hit the beginning of a running loop * - we hit a wavehdr which hasn't finished playing */ - while ((lpWaveHdr = wwo->lpQueuePtr) && - (force || + while ((lpWaveHdr = wwo->lpQueuePtr) && + (force || (lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr && lpWaveHdr->reserved <= wwo->dwPlayedTotal))) { @@ -785,7 +785,7 @@ static DWORD wodPlayer_NotifyCompletions(WINE_WAVEOUT* wwo, BOOL force) wodNotifyClient(wwo, WOM_DONE, (DWORD)lpWaveHdr, 0); } - return (lpWaveHdr && lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr) ? + return (lpWaveHdr && lpWaveHdr != wwo->lpPlayPtr && lpWaveHdr != wwo->lpLoopPtr) ? wodPlayer_NotifyWait(wwo, lpWaveHdr) : INFINITE; } @@ -827,7 +827,7 @@ static void wodPlayer_Reset(WINE_WAVEOUT* wwo, BOOL reset) /* return all pending headers in queue */ while (OSS_RetrieveRingMessage(&wwo->msgRing, &msg, ¶m, &ev)) { - if (msg != WINE_WM_HEADER) + if (msg != WINE_WM_HEADER) { FIXME("shouldn't have headers left\n"); SetEvent(ev); @@ -884,7 +884,7 @@ static void wodPlayer_ProcessMessages(WINE_WAVEOUT* wwo) SetEvent(ev); break; case WINE_WM_RESTARTING: - if (wwo->state == WINE_WS_PAUSED) + if (wwo->state == WINE_WS_PAUSED) { wwo->state = WINE_WS_PLAYING; } @@ -892,7 +892,7 @@ static void wodPlayer_ProcessMessages(WINE_WAVEOUT* wwo) break; case WINE_WM_HEADER: lpWaveHdr = (LPWAVEHDR)param; - + /* insert buffer at the end of queue */ { LPWAVEHDR* wh; @@ -951,7 +951,7 @@ static DWORD wodPlayer_FeedDSP(WINE_WAVEOUT* wwo) /* input queue empty and output buffer with less than one fragment to play */ if (!wwo->lpPlayPtr && wwo->dwBufferSize < availInQ + 2 * wwo->dwFragmentSize) { - TRACE("Run out of wavehdr:s... flushing (%lu => %lu)\n", + TRACE("Run out of wavehdr:s... flushing (%lu => %lu)\n", wwo->dwPlayedTotal, wwo->dwWrittenTotal); ioctl(wwo->unixdev, SNDCTL_DSP_SYNC, 0); wwo->dwPlayedTotal = wwo->dwWrittenTotal; @@ -968,7 +968,7 @@ static DWORD wodPlayer_FeedDSP(WINE_WAVEOUT* wwo) /* Feed wavehdrs until we run out of wavehdrs or DSP space */ if (wwo->dwPartialOffset == 0 && wwo->lpPlayPtr) { do { - TRACE("Setting time to elapse for %p to %lu\n", + TRACE("Setting time to elapse for %p to %lu\n", wwo->lpPlayPtr, wwo->dwWrittenTotal + wwo->lpPlayPtr->dwBufferLength); /* note the value that dwPlayedTotal will return when this wave finishes playing */ wwo->lpPlayPtr->reserved = wwo->dwWrittenTotal + wwo->lpPlayPtr->dwBufferLength; @@ -1017,9 +1017,9 @@ static DWORD CALLBACK wodPlayer(LPVOID pmt) static DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPSA lpCaps, DWORD dwSize) { TRACE("(%u, %p, %lu);\n", wDevID, lpCaps, dwSize); - + if (lpCaps == NULL) return MMSYSERR_NOTENABLED; - + if (wDevID >= MAX_WAVEOUTDRV) { TRACE("MAX_WAVOUTDRV reached !\n"); return MMSYSERR_BADDEVICEID; @@ -1055,14 +1055,14 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM || lpDesc->lpFormat->nChannels == 0 || lpDesc->lpFormat->nSamplesPerSec == 0) { - WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", + WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, lpDesc->lpFormat->nSamplesPerSec); return WAVERR_BADFORMAT; } if (dwFlags & WAVE_FORMAT_QUERY) { - TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", + TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, lpDesc->lpFormat->nSamplesPerSec); return MMSYSERR_NOERROR; @@ -1079,17 +1079,17 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) if (wwo->unixdev != -1) return MMSYSERR_ALLOCATED; /* we want to be able to mmap() the device, which means it must be opened readable, * otherwise mmap() will fail (at least under Linux) */ - wwo->unixdev = OSS_OpenDevice(wDevID, - ((dwFlags & WAVE_DIRECTSOUND) || OSS_FullDuplex) ? + wwo->unixdev = OSS_OpenDevice(wDevID, + ((dwFlags & WAVE_DIRECTSOUND) || OSS_FullDuplex) ? O_RDWR : O_WRONLY); if (wwo->unixdev == -1) return MMSYSERR_ALLOCATED; fcntl(wwo->unixdev, F_SETFD, 1); /* set close on exec flag */ wwo->wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); - + memcpy(&wwo->waveDesc, lpDesc, sizeof(WAVEOPENDESC)); memcpy(&wwo->format, lpDesc->lpFormat, sizeof(PCMWAVEFORMAT)); - + if (wwo->format.wBitsPerSample == 0) { WARN("Resetting zeroed wBitsPerSample\n"); wwo->format.wBitsPerSample = 8 * @@ -1097,7 +1097,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) wwo->format.wf.nSamplesPerSec) / wwo->format.wf.nChannels; } - + if (dwFlags & WAVE_DIRECTSOUND) { if (wwo->caps.dwSupport & WAVECAPS_SAMPLEACCURATE) /* we have realtime DirectSound, fragments just waste our time, @@ -1126,13 +1126,13 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) /* paranoid checks */ if (format != ((wwo->format.wBitsPerSample == 16) ? AFMT_S16_LE : AFMT_U8)) - ERR("Can't set format to %d (%d)\n", + ERR("Can't set format to %d (%d)\n", (wwo->format.wBitsPerSample == 16) ? AFMT_S16_LE : AFMT_U8, format); - if (dsp_stereo != (wwo->format.wf.nChannels > 1) ? 1 : 0) - ERR("Can't set stereo to %u (%d)\n", + if (dsp_stereo != (wwo->format.wf.nChannels > 1) ? 1 : 0) + ERR("Can't set stereo to %u (%d)\n", (wwo->format.wf.nChannels > 1) ? 1 : 0, dsp_stereo); if (!NEAR_MATCH(sample_rate, wwo->format.wf.nSamplesPerSec)) - ERR("Can't set sample_rate to %lu (%d)\n", + ERR("Can't set sample_rate to %lu (%d)\n", wwo->format.wf.nSamplesPerSec, sample_rate); /* Read output space info for future reference */ @@ -1170,16 +1170,16 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) } wwo->hStartUpEvent = INVALID_HANDLE_VALUE; - TRACE("fd=%d fragmentSize=%ld\n", + TRACE("fd=%d fragmentSize=%ld\n", wwo->unixdev, wwo->dwFragmentSize); if (wwo->dwFragmentSize % wwo->format.wf.nBlockAlign) ERR("Fragment doesn't contain an integral number of data blocks\n"); - TRACE("wBitsPerSample=%u, nAvgBytesPerSec=%lu, nSamplesPerSec=%lu, nChannels=%u nBlockAlign=%u!\n", - wwo->format.wBitsPerSample, wwo->format.wf.nAvgBytesPerSec, + TRACE("wBitsPerSample=%u, nAvgBytesPerSec=%lu, nSamplesPerSec=%lu, nChannels=%u nBlockAlign=%u!\n", + wwo->format.wBitsPerSample, wwo->format.wf.nAvgBytesPerSec, wwo->format.wf.nSamplesPerSec, wwo->format.wf.nChannels, wwo->format.wf.nBlockAlign); - + return wodNotifyClient(wwo, WOM_OPEN, 0L, 0L); } @@ -1192,12 +1192,12 @@ static DWORD wodClose(WORD wDevID) WINE_WAVEOUT* wwo; TRACE("(%u);\n", wDevID); - + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].unixdev == -1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + wwo = &WOutDev[wDevID]; if (wwo->lpQueuePtr) { WARN("buffers still playing !\n"); @@ -1223,22 +1223,22 @@ static DWORD wodClose(WORD wDevID) /************************************************************************** * wodWrite [internal] - * + * */ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { TRACE("(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); - + /* first, do the sanity checks... */ if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].unixdev == -1) { WARN("bad dev ID !\n"); return MMSYSERR_BADDEVICEID; } - - if (lpWaveHdr->lpData == NULL || !(lpWaveHdr->dwFlags & WHDR_PREPARED)) + + if (lpWaveHdr->lpData == NULL || !(lpWaveHdr->dwFlags & WHDR_PREPARED)) return WAVERR_UNPREPARED; - - if (lpWaveHdr->dwFlags & WHDR_INQUEUE) + + if (lpWaveHdr->dwFlags & WHDR_INQUEUE) return WAVERR_STILLPLAYING; lpWaveHdr->dwFlags &= ~WHDR_DONE; @@ -1256,15 +1256,15 @@ static DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) static DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { TRACE("(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); - + if (wDevID >= MAX_WAVEOUTDRV) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + if (lpWaveHdr->dwFlags & WHDR_INQUEUE) return WAVERR_STILLPLAYING; - + lpWaveHdr->dwFlags |= WHDR_PREPARED; lpWaveHdr->dwFlags &= ~WHDR_DONE; return MMSYSERR_NOERROR; @@ -1276,18 +1276,18 @@ static DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) static DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { TRACE("(%u, %p, %08lX);\n", wDevID, lpWaveHdr, dwSize); - + if (wDevID >= MAX_WAVEOUTDRV) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + if (lpWaveHdr->dwFlags & WHDR_INQUEUE) return WAVERR_STILLPLAYING; - + lpWaveHdr->dwFlags &= ~WHDR_PREPARED; lpWaveHdr->dwFlags |= WHDR_DONE; - + return MMSYSERR_NOERROR; } @@ -1297,14 +1297,14 @@ static DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) static DWORD wodPause(WORD wDevID) { TRACE("(%u);!\n", wDevID); - + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].unixdev == -1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + OSS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_PAUSING, 0, TRUE); - + return MMSYSERR_NOERROR; } @@ -1314,19 +1314,19 @@ static DWORD wodPause(WORD wDevID) static DWORD wodRestart(WORD wDevID) { TRACE("(%u);\n", wDevID); - + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].unixdev == -1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + OSS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_RESTARTING, 0, TRUE); - + /* FIXME: is NotifyClient with WOM_DONE right ? (Comet Busters 1.3.3 needs this notification) */ /* FIXME: Myst crashes with this ... hmm -MM return wodNotifyClient(wwo, WOM_DONE, 0L, 0L); */ - + return MMSYSERR_NOERROR; } @@ -1336,14 +1336,14 @@ static DWORD wodRestart(WORD wDevID) static DWORD wodReset(WORD wDevID) { TRACE("(%u);\n", wDevID); - + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].unixdev == -1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + OSS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_RESETTING, 0, TRUE); - + return MMSYSERR_NOERROR; } @@ -1357,24 +1357,24 @@ static DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) WINE_WAVEOUT* wwo; TRACE("(%u, %p, %lu);\n", wDevID, lpTime, uSize); - + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].unixdev == -1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; } - + if (lpTime == NULL) return MMSYSERR_INVALPARAM; wwo = &WOutDev[wDevID]; OSS_AddRingMessage(&wwo->msgRing, WINE_WM_UPDATE, 0, TRUE); val = wwo->dwPlayedTotal; - TRACE("wType=%04X wBitsPerSample=%u nSamplesPerSec=%lu nChannels=%u nAvgBytesPerSec=%lu\n", - lpTime->wType, wwo->format.wBitsPerSample, - wwo->format.wf.nSamplesPerSec, wwo->format.wf.nChannels, - wwo->format.wf.nAvgBytesPerSec); + TRACE("wType=%04X wBitsPerSample=%u nSamplesPerSec=%lu nChannels=%u nAvgBytesPerSec=%lu\n", + lpTime->wType, wwo->format.wBitsPerSample, + wwo->format.wf.nSamplesPerSec, wwo->format.wf.nChannels, + wwo->format.wf.nAvgBytesPerSec); TRACE("dwPlayedTotal=%lu\n", val); - + switch (lpTime->wType) { case TIME_BYTES: lpTime->u.cb = val; @@ -1415,7 +1415,7 @@ static DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) static DWORD wodBreakLoop(WORD wDevID) { TRACE("(%u);\n", wDevID); - + if (wDevID >= MAX_WAVEOUTDRV || WOutDev[wDevID].unixdev == -1) { WARN("bad device ID !\n"); return MMSYSERR_BADDEVICEID; @@ -1423,7 +1423,7 @@ static DWORD wodBreakLoop(WORD wDevID) OSS_AddRingMessage(&WOutDev[wDevID].msgRing, WINE_WM_BREAKLOOP, 0, TRUE); return MMSYSERR_NOERROR; } - + /************************************************************************** * wodGetVolume [internal] */ @@ -1432,10 +1432,10 @@ static DWORD wodGetVolume(WORD wDevID, LPDWORD lpdwVol) int mixer; int volume; DWORD left, right; - + TRACE("(%u, %p);\n", wDevID, lpdwVol); - - if (lpdwVol == NULL) + + if (lpdwVol == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDONLY|O_NDELAY)) < 0) { WARN("mixer device not available !\n"); @@ -1467,7 +1467,7 @@ static DWORD wodSetVolume(WORD wDevID, DWORD dwParam) left = (LOWORD(dwParam) * 100) / 0xFFFFl; right = (HIWORD(dwParam) * 100) / 0xFFFFl; volume = left + (right << 8); - + if ((mixer = open(MIXER_DEV, O_WRONLY|O_NDELAY)) < 0) { WARN("mixer device not available !\n"); return MMSYSERR_NOTENABLED; @@ -1490,7 +1490,7 @@ static DWORD wodGetNumDevs(void) DWORD ret = 1; /* FIXME: For now, only one sound device (SOUND_DEV) is allowed */ int audio = OSS_OpenDevice(0, OSS_FullDuplex ? O_RDWR : O_WRONLY); - + if (audio == -1) { if (errno != EBUSY) ret = 0; @@ -1503,12 +1503,12 @@ static DWORD wodGetNumDevs(void) /************************************************************************** * wodMessage (WINEOSS.7) */ -DWORD WINAPI OSS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, +DWORD WINAPI OSS_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); - + switch (wMsg) { case DRVM_INIT: case DRVM_EXIT: @@ -1585,7 +1585,7 @@ static HRESULT DSDB_MapPrimary(IDsDriverBufferImpl *dsdb) * clear it, or we get junk noise */ /* some libc implementations are buggy: their memset reads from the buffer... * to work around it, we have to zero the block by hand. We don't do the expected: - * memset(wwo->mapping,0, wwo->maplen); + * memset(wwo->mapping,0, wwo->maplen); */ { char* p1 = wwo->mapping; @@ -1594,7 +1594,7 @@ static HRESULT DSDB_MapPrimary(IDsDriverBufferImpl *dsdb) if (len >= 16) /* so we can have at least a 4 long area to store... */ { /* the mmap:ed value is (at least) dword aligned - * so, start filling the complete unsigned long:s + * so, start filling the complete unsigned long:s */ int b = len >> 2; unsigned long* p4 = (unsigned long*)p1; @@ -1825,7 +1825,7 @@ static HRESULT WINAPI IDsDriverImpl_GetDriverDesc(PIDSDRIVER iface, PDSDRIVERDES strcpy(pDesc->szDesc,"WineOSS DirectSound Driver"); strcpy(pDesc->szDrvName,"wineoss.drv"); pDesc->dnDevNode = WOutDev[This->wDevID].waveDesc.dnDevNode; - pDesc->wVxdId = 0; + pDesc->wVxdId = 0; pDesc->wReserved = 0; pDesc->ulDeviceNum = This->wDevID; pDesc->dwHeapType = DSDHEAP_NOHEAP; @@ -1994,13 +1994,13 @@ static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv) static DWORD widNotifyClient(WINE_WAVEIN* wwi, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { TRACE("wMsg = 0x%04x dwParm1 = %04lX dwParam2 = %04lX\n", wMsg, dwParam1, dwParam2); - + switch (wMsg) { case WIM_OPEN: case WIM_CLOSE: case WIM_DATA: - if (wwi->wFlags != DCB_NULL && - !DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags, wwi->waveDesc.hWave, + if (wwi->wFlags != DCB_NULL && + !DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags, wwi->waveDesc.hWave, wMsg, wwi->waveDesc.dwInstance, dwParam1, dwParam2)) { WARN("can't notify client !\n"); return MMSYSERR_ERROR; @@ -2019,9 +2019,9 @@ static DWORD widNotifyClient(WINE_WAVEIN* wwi, WORD wMsg, DWORD dwParam1, DWORD static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPSA lpCaps, DWORD dwSize) { TRACE("(%u, %p, %lu);\n", wDevID, lpCaps, dwSize); - + if (lpCaps == NULL) return MMSYSERR_NOTENABLED; - + if (wDevID >= MAX_WAVEINDRV) { TRACE("MAX_WAVINDRV reached !\n"); return MMSYSERR_BADDEVICEID; @@ -2058,7 +2058,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) * (or GETISPACE will have 0 frags all the time) */ read(wwi->unixdev,&xs,4); - + /* make sleep time to be # of ms to output a fragment */ dwSleepTime = (wwi->dwFragmentSize * 1000) / wwi->format.wf.nAvgBytesPerSec; TRACE("sleeptime=%ld ms\n", dwSleepTime); @@ -2069,7 +2069,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) * ie, number of queued fragments */ - if (wwi->lpQueuePtr != NULL && wwi->state == WINE_WS_PLAYING) + if (wwi->lpQueuePtr != NULL && wwi->state == WINE_WS_PLAYING) { lpWaveHdr = wwi->lpQueuePtr; @@ -2084,8 +2084,8 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) if (lpWaveHdr->dwBufferLength - lpWaveHdr->dwBytesRecorded >= wwi->dwFragmentSize) { /* directly read fragment in wavehdr */ - bytesRead = read(wwi->unixdev, - lpWaveHdr->lpData + lpWaveHdr->dwBytesRecorded, + bytesRead = read(wwi->unixdev, + lpWaveHdr->lpData + lpWaveHdr->dwBytesRecorded, wwi->dwFragmentSize); TRACE("bytesRead=%ld (direct)\n", bytesRead); @@ -2094,9 +2094,9 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) /* update number of bytes recorded in current buffer and by this device */ lpWaveHdr->dwBytesRecorded += bytesRead; wwi->dwTotalRecorded += bytesRead; - + /* buffer is full. notify client */ - if (lpWaveHdr->dwBytesRecorded == lpWaveHdr->dwBufferLength) + if (lpWaveHdr->dwBytesRecorded == lpWaveHdr->dwBufferLength) { /* must copy the value of next waveHdr, because we have no idea of what * will be done with the content of lpWaveHdr in callback @@ -2119,7 +2119,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) TRACE("bytesRead=%ld (local)\n", bytesRead); - /* copy data in client buffers */ + /* copy data in client buffers */ while (bytesRead != (DWORD) -1 && bytesRead > 0) { DWORD dwToCopy = min (bytesRead, lpWaveHdr->dwBufferLength - lpWaveHdr->dwBytesRecorded); @@ -2133,9 +2133,9 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) wwi->dwTotalRecorded += dwToCopy; bytesRead -= dwToCopy; pOffset += dwToCopy; - + /* client buffer is full. notify client */ - if (lpWaveHdr->dwBytesRecorded == lpWaveHdr->dwBufferLength) + if (lpWaveHdr->dwBytesRecorded == lpWaveHdr->dwBufferLength) { /* must copy the value of next waveHdr, because we have no idea of what * will be done with the content of lpWaveHdr in callback @@ -2147,12 +2147,12 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) lpWaveHdr->dwFlags |= WHDR_DONE; widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); - + wwi->lpQueuePtr = lpWaveHdr = lpNext; if (!lpNext && bytesRead) { - /* no more buffer to copy data to, but we did read more. + /* no more buffer to copy data to, but we did read more. * what hasn't been copied will be dropped - */ + */ WARN("buffer under run! %lu bytes dropped.\n", bytesRead); wwi->lpQueuePtr = NULL; break; @@ -2162,7 +2162,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) } } } - + WaitForSingleObject(wwi->msgRing.msg_event, dwSleepTime); while (OSS_RetrieveRingMessage(&wwi->msgRing, &msg, ¶m, &ev)) @@ -2183,7 +2183,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) if (wwi->bTriggerSupport) { /* start the recording */ - if (ioctl(wwi->unixdev, SNDCTL_DSP_SETTRIGGER, &enable) < 0) + if (ioctl(wwi->unixdev, SNDCTL_DSP_SETTRIGGER, &enable) < 0) { ERR("ioctl(SNDCTL_DSP_SETTRIGGER) failed (%d)\n", errno); } @@ -2194,7 +2194,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) /* read 4 bytes to start the recording */ read(wwi->unixdev, data, 4); } - + SetEvent(ev); break; } @@ -2216,7 +2216,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) TRACE("reset %p %p\n", lpWaveHdr, lpWaveHdr->lpNext); lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags |= WHDR_DONE; - + widNotifyClient(wwi, WIM_DATA, (DWORD)lpWaveHdr, 0); } wwi->lpQueuePtr = NULL; @@ -2226,7 +2226,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) wwi->hThread = 0; wwi->state = WINE_WS_CLOSED; SetEvent(ev); - HeapFree(GetProcessHeap(), 0, buffer); + HeapFree(GetProcessHeap(), 0, buffer); ExitThread(0); /* shouldn't go here */ default: @@ -2237,7 +2237,7 @@ static DWORD CALLBACK widRecorder(LPVOID pmt) } ExitThread(0); /* just for not generating compilation warnings... should never be executed */ - return 0; + return 0; } @@ -2264,14 +2264,14 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM || lpDesc->lpFormat->nChannels == 0 || lpDesc->lpFormat->nSamplesPerSec == 0) { - WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", + WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, lpDesc->lpFormat->nSamplesPerSec); return WAVERR_BADFORMAT; } if (dwFlags & WAVE_FORMAT_QUERY) { - TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", + TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, lpDesc->lpFormat->nSamplesPerSec); return MMSYSERR_NOERROR; @@ -2279,7 +2279,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) wwi = &WInDev[wDevID]; if (wwi->unixdev != -1) return MMSYSERR_ALLOCATED; - if ((wwi->unixdev = OSS_OpenDevice(wDevID, OSS_FullDuplex ? O_RDWR : O_RDONLY)) == -1) + if ((wwi->unixdev = OSS_OpenDevice(wDevID, OSS_FullDuplex ? O_RDWR : O_RDONLY)) == -1) return MMSYSERR_ALLOCATED; fcntl(wwi->unixdev, F_SETFD, 1); /* set close on exec flag */ if (wwi->lpQueuePtr) { @@ -2319,13 +2319,13 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) /* paranoid checks */ if (format != ((wwi->format.wBitsPerSample == 16) ? AFMT_S16_LE : AFMT_U8)) - ERR("Can't set format to %d (%d)\n", + ERR("Can't set format to %d (%d)\n", (wwi->format.wBitsPerSample == 16) ? AFMT_S16_LE : AFMT_U8, format); - if (dsp_stereo != (wwi->format.wf.nChannels > 1) ? 1 : 0) - ERR("Can't set stereo to %u (%d)\n", + if (dsp_stereo != (wwi->format.wf.nChannels > 1) ? 1 : 0) + ERR("Can't set stereo to %u (%d)\n", (wwi->format.wf.nChannels > 1) ? 1 : 0, dsp_stereo); if (!NEAR_MATCH(sample_rate, wwi->format.wf.nSamplesPerSec)) - ERR("Can't set sample_rate to %lu (%d)\n", + ERR("Can't set sample_rate to %lu (%d)\n", wwi->format.wf.nSamplesPerSec, sample_rate); ioctl(wwi->unixdev, SNDCTL_DSP_GETBLKSIZE, &fragment_size); @@ -2337,8 +2337,8 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) } wwi->dwFragmentSize = fragment_size; - TRACE("wBitsPerSample=%u, nAvgBytesPerSec=%lu, nSamplesPerSec=%lu, nChannels=%u nBlockAlign=%u!\n", - wwi->format.wBitsPerSample, wwi->format.wf.nAvgBytesPerSec, + TRACE("wBitsPerSample=%u, nAvgBytesPerSec=%lu, nSamplesPerSec=%lu, nChannels=%u nBlockAlign=%u!\n", + wwi->format.wBitsPerSample, wwi->format.wf.nAvgBytesPerSec, wwi->format.wf.nSamplesPerSec, wwi->format.wf.nChannels, wwi->format.wf.nBlockAlign); @@ -2405,7 +2405,7 @@ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->dwFlags &= ~WHDR_DONE; lpWaveHdr->dwBytesRecorded = 0; lpWaveHdr->lpNext = NULL; - + OSS_AddRingMessage(&WInDev[wDevID].msgRing, WINE_WM_HEADER, (DWORD)lpWaveHdr, FALSE); return MMSYSERR_NOERROR; } @@ -2442,7 +2442,7 @@ static DWORD widUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) lpWaveHdr->dwFlags &= ~WHDR_PREPARED; lpWaveHdr->dwFlags |= WHDR_DONE; - + return MMSYSERR_NOERROR; } @@ -2473,7 +2473,7 @@ static DWORD widStop(WORD wDevID) } /* FIXME: reset aint stop */ OSS_AddRingMessage(&WInDev[wDevID].msgRing, WINE_WM_RESETTING, 0, TRUE); - + return MMSYSERR_NOERROR; } @@ -2498,7 +2498,7 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) { int time; WINE_WAVEIN* wwi; - + TRACE("(%u, %p, %lu);\n", wDevID, lpTime, uSize); if (wDevID >= MAX_WAVEINDRV || WInDev[wDevID].unixdev == -1) { @@ -2510,10 +2510,10 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) wwi = &WInDev[wDevID]; TRACE("wType=%04X !\n", lpTime->wType); - TRACE("wBitsPerSample=%u\n", wwi->format.wBitsPerSample); - TRACE("nSamplesPerSec=%lu\n", wwi->format.wf.nSamplesPerSec); - TRACE("nChannels=%u\n", wwi->format.wf.nChannels); - TRACE("nAvgBytesPerSec=%lu\n", wwi->format.wf.nAvgBytesPerSec); + TRACE("wBitsPerSample=%u\n", wwi->format.wBitsPerSample); + TRACE("nSamplesPerSec=%lu\n", wwi->format.wf.nSamplesPerSec); + TRACE("nChannels=%u\n", wwi->format.wf.nChannels); + TRACE("nAvgBytesPerSec=%lu\n", wwi->format.wf.nAvgBytesPerSec); switch (lpTime->wType) { case TIME_BYTES: lpTime->u.cb = wwi->dwTotalRecorded; @@ -2554,7 +2554,7 @@ static DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) /************************************************************************** * widMessage (WINEOSS.6) */ -DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, +DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { TRACE("(%u, %04X, %08lX, %08lX, %08lX);\n", @@ -2589,7 +2589,7 @@ DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, /************************************************************************** * wodMessage (WINEOSS.7) */ -DWORD WINAPI OSS_wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, +DWORD WINAPI OSS_wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); @@ -2599,7 +2599,7 @@ DWORD WINAPI OSS_wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, /************************************************************************** * widMessage (WINEOSS.6) */ -DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, +DWORD WINAPI OSS_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { FIXME("(%u, %04X, %08lX, %08lX, %08lX):stub\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); diff --git a/dlls/winmm/wineoss/midi.c b/dlls/winmm/wineoss/midi.c index 08dfb2e4ef8..0c3dc9d4a22 100644 --- a/dlls/winmm/wineoss/midi.c +++ b/dlls/winmm/wineoss/midi.c @@ -5,7 +5,7 @@ * * Copyright 1994 Martin Ayotte * Copyright 1998 Luiz Otavio L. Zorzella (init procedures) - * Copyright 1998/1999 Eric POUECH : + * Copyright 1998/1999 Eric POUECH : * 98/7 changes for making this MIDI driver work on OSS * current support is limited to MIDI ports of OSS systems * 98/9 rewriting MCI code for MIDI @@ -76,16 +76,16 @@ static WINE_MIDIIN MidiInDev [MAX_MIDIINDRV ]; static WINE_MIDIOUT MidiOutDev[MAX_MIDIOUTDRV]; /* this is the total number of MIDI out devices found */ -static int MODM_NUMDEVS = 0; -/* this is the number of FM synthetizers (index from 0 to +static int MODM_NUMDEVS = 0; +/* this is the number of FM synthetizers (index from 0 to NUMFMSYNTHDEVS - 1) */ -static int MODM_NUMFMSYNTHDEVS = 0; -/* this is the number of Midi ports (index from NUMFMSYNTHDEVS to +static int MODM_NUMFMSYNTHDEVS = 0; +/* this is the number of Midi ports (index from NUMFMSYNTHDEVS to NUMFMSYNTHDEVS + NUMMIDIDEVS - 1) */ -static int MODM_NUMMIDIDEVS = 0; +static int MODM_NUMMIDIDEVS = 0; /* this is the total number of MIDI out devices found */ -static int MIDM_NUMDEVS = 0; +static int MIDM_NUMDEVS = 0; static int midiSeqFD = -1; static int numOpenMidiSeq = 0; @@ -102,8 +102,8 @@ static LPMIDIOUTCAPSA midiOutDevices[MAX_MIDIOUTDRV]; */ static LPMIDIINCAPSA midiInDevices [MAX_MIDIINDRV]; -/* - * FIXME : all tests on device ID for midXXX and modYYY are made against +/* + * FIXME : all tests on device ID for midXXX and modYYY are made against * MAX_MIDIxxDRV (when they are made) but should be done against the actual * number of midi devices found... */ @@ -123,16 +123,16 @@ static int midiCloseSeq(void); */ static int MIDI_UnixToWindowsDeviceType(int type) { - /* MOD_MIDIPORT output port - * MOD_SYNTH generic internal synth - * MOD_SQSYNTH square wave internal synth - * MOD_FMSYNTH FM internal synth + /* MOD_MIDIPORT output port + * MOD_SYNTH generic internal synth + * MOD_SQSYNTH square wave internal synth + * MOD_FMSYNTH FM internal synth * MOD_MAPPER MIDI mapper */ - - /* FIXME Is this really the correct equivalence from UNIX to + + /* FIXME Is this really the correct equivalence from UNIX to Windows Sound type */ - + switch (type) { case SYNTH_TYPE_FM: return MOD_FMSYNTH; case SYNTH_TYPE_SAMPLE: return MOD_SYNTH; @@ -162,15 +162,15 @@ BOOL OSS_MidiInit(void) TRACE("Initializing the MIDI variables.\n"); bInitDone = TRUE; - + /* try to open device */ if (midiOpenSeq() == -1) { return TRUE; } - + /* find how many Synth devices are there in the system */ status = ioctl(midiSeqFD, SNDCTL_SEQ_NRSYNTHS, &numsynthdevs); - + if (status == -1) { ERR("ioctl for nr synth failed.\n"); midiCloseSeq(); @@ -182,10 +182,10 @@ BOOL OSS_MidiInit(void) "Some FM devices will not be available.\n",MAX_MIDIOUTDRV,numsynthdevs); numsynthdevs = MAX_MIDIOUTDRV; } - + for (i = 0; i < numsynthdevs; i++) { LPMIDIOUTCAPSA tmplpCaps; - + sinfo.device = i; status = ioctl(midiSeqFD, SNDCTL_SYNTH_INFO, &sinfo); if (status == -1) { @@ -193,32 +193,32 @@ BOOL OSS_MidiInit(void) midiCloseSeq(); return TRUE; } - + tmplpCaps = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIOUTCAPSA)); if (!tmplpCaps) break; /* We also have the information sinfo.synth_subtype, not used here */ - + /* Manufac ID. We do not have access to this with soundcard.h * Does not seem to be a problem, because in mmsystem.h only * Microsoft's ID is listed. */ - tmplpCaps->wMid = 0x00FF; + tmplpCaps->wMid = 0x00FF; tmplpCaps->wPid = 0x0001; /* FIXME Product ID */ /* Product Version. We simply say "1" */ - tmplpCaps->vDriverVersion = 0x001; + tmplpCaps->vDriverVersion = 0x001; strcpy(tmplpCaps->szPname, sinfo.name); - + tmplpCaps->wTechnology = MIDI_UnixToWindowsDeviceType(sinfo.synth_type); tmplpCaps->wVoices = sinfo.nr_voices; - + /* FIXME Is it possible to know the maximum * number of simultaneous notes of a soundcard ? * I believe we don't have this information, but * it's probably equal or more than wVoices */ - tmplpCaps->wNotes = sinfo.nr_voices; + tmplpCaps->wNotes = sinfo.nr_voices; tmplpCaps->wChannelMask= 0xFFFF; /* FIXME Do we have this information? @@ -227,20 +227,20 @@ BOOL OSS_MidiInit(void) * not MIDICAPS_CACHE. */ tmplpCaps->dwSupport = MIDICAPS_VOLUME|MIDICAPS_LRVOLUME; - + midiOutDevices[i] = tmplpCaps; - + if (sinfo.capabilities & SYNTH_CAP_INPUT) { FIXME("Synthesizer support MIDI in. Not supported yet (please report)\n"); } - + TRACE("SynthOut[%d]\tname='%s' techn=%d voices=%d notes=%d chnMsk=%04x support=%ld\n" - "\tOSS info: synth subtype=%d capa=%lx\n", + "\tOSS info: synth subtype=%d capa=%lx\n", i, tmplpCaps->szPname, tmplpCaps->wTechnology, tmplpCaps->wVoices, tmplpCaps->wNotes, tmplpCaps->wChannelMask, tmplpCaps->dwSupport, sinfo.synth_subtype, (long)sinfo.capabilities); } - + /* find how many MIDI devices are there in the system */ status = ioctl(midiSeqFD, SNDCTL_SEQ_NRMIDIS, &nummididevs); if (status == -1) { @@ -248,24 +248,24 @@ BOOL OSS_MidiInit(void) midiCloseSeq(); return TRUE; } - + /* FIXME: the two restrictions below could be loosen in some cases */ if (numsynthdevs + nummididevs > MAX_MIDIOUTDRV) { ERR("MAX_MIDIOUTDRV was not enough for the number of devices. " "Some MIDI devices will not be available.\n"); nummididevs = MAX_MIDIOUTDRV - numsynthdevs; } - + if (nummididevs > MAX_MIDIINDRV) { ERR("MAX_MIDIINDRV (%d) was not enough for the number of devices (%d). " "Some MIDI devices will not be available.\n",MAX_MIDIINDRV,nummididevs); nummididevs = MAX_MIDIINDRV; } - + for (i = 0; i < nummididevs; i++) { LPMIDIOUTCAPSA tmplpOutCaps; LPMIDIINCAPSA tmplpInCaps; - + minfo.device = i; status = ioctl(midiSeqFD, SNDCTL_MIDI_INFO, &minfo); if (status == -1) { @@ -273,113 +273,113 @@ BOOL OSS_MidiInit(void) midiCloseSeq(); return TRUE; } - + tmplpOutCaps = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIOUTCAPSA)); if (!tmplpOutCaps) break; /* This whole part is somewhat obscure to me. I'll keep trying to dig - info about it. If you happen to know, please tell us. The very + info about it. If you happen to know, please tell us. The very descritive minfo.dev_type was not used here. */ /* Manufac ID. We do not have access to this with soundcard.h Does not seem to be a problem, because in mmsystem.h only Microsoft's ID is listed */ - tmplpOutCaps->wMid = 0x00FF; + tmplpOutCaps->wMid = 0x00FF; tmplpOutCaps->wPid = 0x0001; /* FIXME Product ID */ /* Product Version. We simply say "1" */ - tmplpOutCaps->vDriverVersion = 0x001; + tmplpOutCaps->vDriverVersion = 0x001; strcpy(tmplpOutCaps->szPname, minfo.name); - + tmplpOutCaps->wTechnology = MOD_MIDIPORT; /* FIXME Is this right? */ /* Does it make any difference? */ - tmplpOutCaps->wVoices = 16; + tmplpOutCaps->wVoices = 16; /* Does it make any difference? */ tmplpOutCaps->wNotes = 16; tmplpOutCaps->wChannelMask= 0xFFFF; /* FIXME Does it make any difference? */ - tmplpOutCaps->dwSupport = MIDICAPS_VOLUME|MIDICAPS_LRVOLUME; - + tmplpOutCaps->dwSupport = MIDICAPS_VOLUME|MIDICAPS_LRVOLUME; + midiOutDevices[numsynthdevs + i] = tmplpOutCaps; - + tmplpInCaps = HeapAlloc(GetProcessHeap(), 0, sizeof(MIDIINCAPSA)); if (!tmplpInCaps) break; /* This whole part is somewhat obscure to me. I'll keep trying to dig - info about it. If you happen to know, please tell us. The very + info about it. If you happen to know, please tell us. The very descritive minfo.dev_type was not used here. */ /* Manufac ID. We do not have access to this with soundcard.h Does not seem to be a problem, because in mmsystem.h only Microsoft's ID is listed */ - tmplpInCaps->wMid = 0x00FF; + tmplpInCaps->wMid = 0x00FF; tmplpInCaps->wPid = 0x0001; /* FIXME Product ID */ /* Product Version. We simply say "1" */ - tmplpInCaps->vDriverVersion = 0x001; + tmplpInCaps->vDriverVersion = 0x001; strcpy(tmplpInCaps->szPname, minfo.name); - + /* FIXME : could we get better information than that ? */ - tmplpInCaps->dwSupport = MIDICAPS_VOLUME|MIDICAPS_LRVOLUME; - + tmplpInCaps->dwSupport = MIDICAPS_VOLUME|MIDICAPS_LRVOLUME; + midiInDevices[i] = tmplpInCaps; - + TRACE("MidiOut[%d]\tname='%s' techn=%d voices=%d notes=%d chnMsk=%04x support=%ld\n" "MidiIn [%d]\tname='%s' support=%ld\n" - "\tOSS info: midi dev-type=%d, capa=%lx\n", - i, tmplpOutCaps->szPname, tmplpOutCaps->wTechnology, - tmplpOutCaps->wVoices, tmplpOutCaps->wNotes, + "\tOSS info: midi dev-type=%d, capa=%lx\n", + i, tmplpOutCaps->szPname, tmplpOutCaps->wTechnology, + tmplpOutCaps->wVoices, tmplpOutCaps->wNotes, tmplpOutCaps->wChannelMask, tmplpOutCaps->dwSupport, i, tmplpInCaps->szPname, tmplpInCaps->dwSupport, minfo.dev_type, (long)minfo.capabilities); } - + /* windows does not seem to differentiate Synth from MIDI devices */ MODM_NUMFMSYNTHDEVS = numsynthdevs; MODM_NUMMIDIDEVS = nummididevs; MODM_NUMDEVS = numsynthdevs + nummididevs; - + MIDM_NUMDEVS = nummididevs; - + /* close file and exit */ midiCloseSeq(); - + return TRUE; } /************************************************************************** * MIDI_NotifyClient [internal] */ -static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, +static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, DWORD dwParam1, DWORD dwParam2) { DWORD dwCallBack; UINT uFlags; HANDLE hDev; DWORD dwInstance; - - TRACE("wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n", + + TRACE("wDevID = %04X wMsg = %d dwParm1 = %04lX dwParam2 = %04lX\n", wDevID, wMsg, dwParam1, dwParam2); - + switch (wMsg) { case MOM_OPEN: case MOM_CLOSE: case MOM_DONE: - if (wDevID > MAX_MIDIOUTDRV) + if (wDevID > MAX_MIDIOUTDRV) return MCIERR_INTERNAL; - + dwCallBack = MidiOutDev[wDevID].midiDesc.dwCallback; uFlags = MidiOutDev[wDevID].wFlags; hDev = MidiOutDev[wDevID].midiDesc.hMidi; dwInstance = MidiOutDev[wDevID].midiDesc.dwInstance; break; - + case MIM_OPEN: case MIM_CLOSE: case MIM_DATA: case MIM_ERROR: - if (wDevID > MAX_MIDIINDRV) + if (wDevID > MAX_MIDIINDRV) return MCIERR_INTERNAL; - + dwCallBack = MidiInDev[wDevID].midiDesc.dwCallback; uFlags = MidiInDev[wDevID].wFlags; hDev = MidiInDev[wDevID].midiDesc.hMidi; @@ -389,7 +389,7 @@ static DWORD MIDI_NotifyClient(UINT wDevID, WORD wMsg, WARN("Unsupported MSW-MIDI message %u\n", wMsg); return MCIERR_INTERNAL; } - + return DriverCallback(dwCallBack, uFlags, hDev, wMsg, dwInstance, dwParam1, dwParam2) ? 0 : MCIERR_INTERNAL; } @@ -447,8 +447,8 @@ static int midiCloseSeq(void) /* FIXME: this is a bad idea, it's even not static... */ SEQ_DEFINEBUF(1024); -/* FIXME: this is not reentrant, not static - because of global variable - * _seqbuf and al. +/* FIXME: this is not reentrant, not static - because of global variable + * _seqbuf and al. */ /************************************************************************** * seqbuf_dump [internal] @@ -457,12 +457,12 @@ void seqbuf_dump(void) { if (_seqbufptr) { if (write(midiSeqFD, _seqbuf, _seqbufptr) == -1) { - WARN("Can't write data to sequencer %d, errno %d (%s)!\n", + WARN("Can't write data to sequencer %d, errno %d (%s)!\n", midiSeqFD, errno, strerror(errno)); } /* FIXME: - * in any case buffer is lost so that if many errors occur the buffer - * will not overrun + * in any case buffer is lost so that if many errors occur the buffer + * will not overrun */ _seqbufptr = 0; } @@ -471,9 +471,9 @@ void seqbuf_dump(void) static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) { DWORD toSend = 0; - + TRACE("Adding %02xh to %d[%d]\n", value, wDevID, MidiInDev[wDevID].incLen); - + if (wDevID >= MAX_MIDIINDRV) { WARN("bad devID\n"); return; @@ -489,11 +489,11 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) if (lpMidiHdr) { LPBYTE lpData = lpMidiHdr->lpData; - + lpData[lpMidiHdr->dwBytesRecorded++] = value; if (lpMidiHdr->dwBytesRecorded == lpMidiHdr->dwBufferLength) { sbfb = TRUE; - } + } } if (value == 0xF7) { /* then end */ MidiInDev[wDevID].state &= ~2; @@ -510,10 +510,10 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) } return; } - + #define IS_CMD(_x) (((_x) & 0x80) == 0x80) #define IS_SYS_CMD(_x) (((_x) & 0xF0) == 0xF0) - + if (!IS_CMD(value) && MidiInDev[wDevID].incLen == 0) { /* try to reuse old cmd */ if (IS_CMD(MidiInDev[wDevID].incPrev) && !IS_SYS_CMD(MidiInDev[wDevID].incPrev)) { MidiInDev[wDevID].incoming[0] = MidiInDev[wDevID].incPrev; @@ -521,7 +521,7 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) TRACE("Reusing old command %02xh\n", MidiInDev[wDevID].incPrev); } else { FIXME("error for midi-in, should generate MIM_ERROR notification:" - " prev=%02Xh, incLen=%02Xh\n", + " prev=%02Xh, incLen=%02Xh\n", MidiInDev[wDevID].incPrev, MidiInDev[wDevID].incLen); return; } @@ -542,7 +542,7 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) case MIDI_CTL_CHANGE: case MIDI_PITCH_BEND: if (MidiInDev[wDevID].incLen == 3) { - toSend = (MidiInDev[wDevID].incoming[2] << 16) | + toSend = (MidiInDev[wDevID].incoming[2] << 16) | (MidiInDev[wDevID].incoming[1] << 8) | (MidiInDev[wDevID].incoming[0] << 0); } @@ -558,7 +558,7 @@ static void midReceiveChar(WORD wDevID, unsigned char value, DWORD dwTime) if (MidiInDev[wDevID].incoming[0] == 0xF0) { MidiInDev[wDevID].state |= 2; MidiInDev[wDevID].incLen = 0; - } else { + } else { if (MidiInDev[wDevID].incLen == 1) { toSend = (MidiInDev[wDevID].incoming[0] << 0); } @@ -581,24 +581,24 @@ static VOID WINAPI midTimeCallback(HWND hwnd, UINT msg, UINT id, DWORD dwTime) { unsigned char buffer[256]; int len, idx; - + TRACE("(%04X, %d, %d, %lu)\n", hwnd, msg, id, dwTime); - + len = read(midiSeqFD, buffer, sizeof(buffer)); - + if (len < 0) return; if ((len % 4) != 0) { WARN("Bad length %d, errno %d (%s)\n", len, errno, strerror(errno)); return; } - + for (idx = 0; idx < len; ) { if (buffer[idx] & 0x80) { TRACE( - "Reading<8> %02x %02x %02x %02x %02x %02x %02x %02x\n", - buffer[idx + 0], buffer[idx + 1], - buffer[idx + 2], buffer[idx + 3], - buffer[idx + 4], buffer[idx + 5], + "Reading<8> %02x %02x %02x %02x %02x %02x %02x %02x\n", + buffer[idx + 0], buffer[idx + 1], + buffer[idx + 2], buffer[idx + 3], + buffer[idx + 4], buffer[idx + 5], buffer[idx + 6], buffer[idx + 7]); idx += 8; } else { @@ -614,7 +614,7 @@ static VOID WINAPI midTimeCallback(HWND hwnd, UINT msg, UINT id, DWORD dwTime) break; } idx += 4; - } + } } } @@ -624,12 +624,12 @@ static VOID WINAPI midTimeCallback(HWND hwnd, UINT msg, UINT id, DWORD dwTime) static DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPSA lpCaps, DWORD dwSize) { TRACE("(%04X, %p, %08lX);\n", wDevID, lpCaps, dwSize); - + if (wDevID >= MIDM_NUMDEVS) return MMSYSERR_BADDEVICEID; if (lpCaps == NULL) return MMSYSERR_INVALPARAM; memcpy(lpCaps, midiInDevices[wDevID], min(dwSize, sizeof(*lpCaps))); - + return MMSYSERR_NOERROR; } @@ -639,7 +639,7 @@ static DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPSA lpCaps, DWORD dwSize) static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) { TRACE("(%04X, %p, %08lX);\n", wDevID, lpDesc, dwFlags); - + if (lpDesc == NULL) { WARN("Invalid Parameter !\n"); return MMSYSERR_INVALPARAM; @@ -656,19 +656,19 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) WARN("device already open !\n"); return MMSYSERR_ALLOCATED; } - if ((dwFlags & MIDI_IO_STATUS) != 0) { + if ((dwFlags & MIDI_IO_STATUS) != 0) { WARN("No support for MIDI_IO_STATUS in dwFlags yet, ignoring it\n"); dwFlags &= ~MIDI_IO_STATUS; } - if ((dwFlags & ~CALLBACK_TYPEMASK) != 0) { + if ((dwFlags & ~CALLBACK_TYPEMASK) != 0) { FIXME("Bad dwFlags\n"); return MMSYSERR_INVALFLAG; } - + if (midiOpenSeq() < 0) { return MMSYSERR_ERROR; } - + if (numStartedMidiIn++ == 0) { midiInTimerID = SetTimer(0, 0, 250, midTimeCallback); if (!midiInTimerID) { @@ -679,7 +679,7 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) } TRACE("Starting timer (%u) for midi-in\n", midiInTimerID); } - + MidiInDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); MidiInDev[wDevID].lpQueueHdr = NULL; @@ -703,9 +703,9 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) static DWORD midClose(WORD wDevID) { int ret = MMSYSERR_NOERROR; - + TRACE("(%04X);\n", wDevID); - + if (wDevID >= MAX_MIDIINDRV) { WARN("wDevID too big (%u) !\n", wDevID); return MMSYSERR_BADDEVICEID; @@ -717,7 +717,7 @@ static DWORD midClose(WORD wDevID) if (MidiInDev[wDevID].lpQueueHdr != 0) { return MIDIERR_STILLPLAYING; } - + if (midiSeqFD == -1) { WARN("ooops !\n"); return MMSYSERR_ERROR; @@ -726,7 +726,7 @@ static DWORD midClose(WORD wDevID) TRACE("Stopping timer for midi-in\n"); if (!KillTimer(0, midiInTimerID)) { WARN("Couldn't stop timer for midi-in\n"); - } + } midiInTimerID = 0; } midiCloseSeq(); @@ -746,20 +746,20 @@ static DWORD midClose(WORD wDevID) static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); - + if (lpMidiHdr == NULL) return MMSYSERR_INVALPARAM; if (sizeof(MIDIHDR) > dwSize) return MMSYSERR_INVALPARAM; if (lpMidiHdr->dwBufferLength == 0) return MMSYSERR_INVALPARAM; if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING; if (!(lpMidiHdr->dwFlags & MHDR_PREPARED)) return MIDIERR_UNPREPARED; - + if (MidiInDev[wDevID].lpQueueHdr == 0) { MidiInDev[wDevID].lpQueueHdr = lpMidiHdr; } else { LPMIDIHDR ptr; - - for (ptr = MidiInDev[wDevID].lpQueueHdr; - ptr->lpNext != 0; + + for (ptr = MidiInDev[wDevID].lpQueueHdr; + ptr->lpNext != 0; ptr = (LPMIDIHDR)ptr->lpNext); ptr->lpNext = (struct midihdr_tag*)lpMidiHdr; } @@ -772,16 +772,16 @@ static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); - - if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || - lpMidiHdr->lpData == 0 || lpMidiHdr->dwFlags != 0 || + + if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || + lpMidiHdr->lpData == 0 || lpMidiHdr->dwFlags != 0 || lpMidiHdr->dwBufferLength >= 0x10000ul) return MMSYSERR_INVALPARAM; - + lpMidiHdr->lpNext = 0; lpMidiHdr->dwFlags |= MHDR_PREPARED; lpMidiHdr->dwBytesRecorded = 0; - + return MMSYSERR_NOERROR; } @@ -791,16 +791,16 @@ static DWORD midPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) static DWORD midUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); - - if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || + + if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || lpMidiHdr->lpData == 0 || lpMidiHdr->dwBufferLength >= 0x10000ul) return MMSYSERR_INVALPARAM; - + if (!(lpMidiHdr->dwFlags & MHDR_PREPARED)) return MIDIERR_UNPREPARED; if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING; - + lpMidiHdr->dwFlags &= ~MHDR_PREPARED; - + return MMSYSERR_NOERROR; } @@ -810,20 +810,20 @@ static DWORD midUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) static DWORD midReset(WORD wDevID) { DWORD dwTime = GetTickCount(); - + TRACE("(%04X);\n", wDevID); - + while (MidiInDev[wDevID].lpQueueHdr) { MidiInDev[wDevID].lpQueueHdr->dwFlags &= ~MHDR_INQUEUE; 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, + if (MIDI_NotifyClient(wDevID, MIM_LONGDATA, (DWORD)MidiInDev[wDevID].lpQueueHdr, dwTime) != MMSYSERR_NOERROR) { WARN("Couldn't notify client\n"); } MidiInDev[wDevID].lpQueueHdr = (LPMIDIHDR)MidiInDev[wDevID].lpQueueHdr->lpNext; } - + return MMSYSERR_NOERROR; } @@ -834,9 +834,9 @@ static DWORD midReset(WORD wDevID) static DWORD midStart(WORD wDevID) { TRACE("(%04X);\n", wDevID); - + /* FIXME : should test value of wDevID */ - + MidiInDev[wDevID].state = 1; MidiInDev[wDevID].startTime = GetTickCount(); return MMSYSERR_NOERROR; @@ -848,7 +848,7 @@ static DWORD midStart(WORD wDevID) static DWORD midStop(WORD wDevID) { TRACE("(%04X);\n", wDevID); - + /* FIXME : should test value of wDevID */ MidiInDev[wDevID].state = 0; return MMSYSERR_NOERROR; @@ -868,7 +868,7 @@ typedef struct sVoice { typedef struct sChannel { int program; - + int bender; int benderRange; /* controlers */ @@ -877,7 +877,7 @@ typedef struct sChannel { int balance; /* CTL_BALANCE */ int expression; /* CTL_EXPRESSION */ int sustain; /* CTL_SUSTAIN */ - + unsigned char nrgPmtMSB; /* Non register Parameters */ unsigned char nrgPmtLSB; unsigned char regPmtMSB; /* Non register Parameters */ @@ -889,7 +889,7 @@ typedef struct sFMextra { int drumSetMask; sChannel channel[16]; /* MIDI has only 16 channels */ sVoice voice[1]; /* dyn allocated according to sound card */ - /* do not append fields below voice[1] since the size of this structure + /* do not append fields below voice[1] since the size of this structure * depends on the number of available voices on the FM synth... */ } sFMextra; @@ -904,29 +904,29 @@ static int modFMLoad(int dev) { int i; struct sbi_instrument sbi; - + sbi.device = dev; sbi.key = FM_PATCH; - + memset(sbi.operators + 16, 0, 16); for (i = 0; i < 128; i++) { sbi.channel = i; memcpy(sbi.operators, midiFMInstrumentPatches + i * 16, 16); - + if (write(midiSeqFD, (char*)&sbi, sizeof(sbi)) == -1) { WARN("Couldn't write patch for instrument %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno)); return -1; } - } + } for (i = 0; i < 128; i++) { sbi.channel = 128 + i; memcpy(sbi.operators, midiFMDrumsPatches + i * 16, 16); - + if (write(midiSeqFD, (char*)&sbi, sizeof(sbi)) == -1) { WARN("Couldn't write patch for drum %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno)); return -1; } - } + } return 0; } @@ -939,7 +939,7 @@ static void modFMReset(WORD wDevID) sVoice* voice = extra->voice; sChannel* channel = extra->channel; int i; - + for (i = 0; i < midiOutDevices[wDevID]->wVoices; i++) { if (voice[i].status != sVS_UNUSED) { SEQ_STOP_NOTE(wDevID, i, voice[i].note, 64); @@ -958,8 +958,8 @@ static void modFMReset(WORD wDevID) channel[i].bank = 0; channel[i].volume = 127; channel[i].balance = 64; - channel[i].expression = 0; - channel[i].sustain = 0; + channel[i].expression = 0; + channel[i].sustain = 0; } extra->counter = 0; extra->drumSetMask = 1 << 9; /* channel 10 is normally drums, sometimes 16 also */ @@ -1001,7 +1001,7 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) WARN("device already open !\n"); return MMSYSERR_ALLOCATED; } - if ((dwFlags & ~CALLBACK_TYPEMASK) != 0) { + if ((dwFlags & ~CALLBACK_TYPEMASK) != 0) { WARN("bad dwFlags\n"); return MMSYSERR_INVALFLAG; } @@ -1009,16 +1009,16 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) TRACE("un-allocated wDevID\n"); return MMSYSERR_BADDEVICEID; } - + MidiOutDev[wDevID].lpExtra = 0; - + switch (midiOutDevices[wDevID]->wTechnology) { case MOD_FMSYNTH: { - void* extra = HeapAlloc(GetProcessHeap(), 0, - sizeof(struct sFMextra) + + void* extra = HeapAlloc(GetProcessHeap(), 0, + sizeof(struct sFMextra) + sizeof(struct sVoice) * (midiOutDevices[wDevID]->wVoices - 1)); - + if (extra == 0) { WARN("can't alloc extra data !\n"); return MMSYSERR_NOMEM; @@ -1044,18 +1044,18 @@ static DWORD modOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) } break; default: - WARN("Technology not supported (yet) %d !\n", + WARN("Technology not supported (yet) %d !\n", midiOutDevices[wDevID]->wTechnology); return MMSYSERR_NOTENABLED; } - + MidiOutDev[wDevID].wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); MidiOutDev[wDevID].lpQueueHdr = NULL; MidiOutDev[wDevID].dwTotalPlayed = 0; MidiOutDev[wDevID].bufsize = 0x3FFF; MidiOutDev[wDevID].midiDesc = *lpDesc; - + if (MIDI_NotifyClient(wDevID, MOM_OPEN, 0L, 0L) != MMSYSERR_NOERROR) { WARN("can't notify client !\n"); return MMSYSERR_INVALPARAM; @@ -1073,35 +1073,35 @@ static DWORD modClose(WORD wDevID) int ret = MMSYSERR_NOERROR; TRACE("(%04X);\n", wDevID); - + if (MidiOutDev[wDevID].midiDesc.hMidi == 0) { WARN("device not opened !\n"); return MMSYSERR_ERROR; } /* FIXME: should test that no pending buffer is still in the queue for * playing */ - + if (midiSeqFD == -1) { WARN("can't close !\n"); return MMSYSERR_ERROR; } - + switch (midiOutDevices[wDevID]->wTechnology) { case MOD_FMSYNTH: case MOD_MIDIPORT: midiCloseSeq(); break; default: - WARN("Technology not supported (yet) %d !\n", + WARN("Technology not supported (yet) %d !\n", midiOutDevices[wDevID]->wTechnology); return MMSYSERR_NOTENABLED; } - + if (MidiOutDev[wDevID].lpExtra != 0) { HeapFree(GetProcessHeap(), 0, MidiOutDev[wDevID].lpExtra); MidiOutDev[wDevID].lpExtra = 0; } - + MidiOutDev[wDevID].bufsize = 0; if (MIDI_NotifyClient(wDevID, MOM_CLOSE, 0L, 0L) != MMSYSERR_NOERROR) { WARN("can't notify client !\n"); @@ -1119,9 +1119,9 @@ static DWORD modData(WORD wDevID, DWORD dwParam) WORD evt = LOBYTE(LOWORD(dwParam)); WORD d1 = HIBYTE(LOWORD(dwParam)); WORD d2 = LOBYTE(HIWORD(dwParam)); - + TRACE("(%04X, %08lX);\n", wDevID, dwParam); - + if (midiSeqFD == -1) { WARN("can't play !\n"); return MIDIERR_NODEVICE; @@ -1137,7 +1137,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam) sChannel* channel = extra->channel; int chn = (evt & 0x0F); int i, nv; - + switch (evt & 0xF0) { case MIDI_NOTEOFF: for (i = 0; i < midiOutDevices[wDevID]->wVoices; i++) { @@ -1147,7 +1147,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam) SEQ_STOP_NOTE(wDevID, i, d1, d2); } } - break; + break; case MIDI_NOTEON: if (d2 == 0) { /* note off if velocity == 0 */ for (i = 0; i < midiOutDevices[wDevID]->wVoices; i++) { @@ -1165,7 +1165,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam) * - the older voice (LRU) */ for (i = nv = 0; i < midiOutDevices[wDevID]->wVoices; i++) { - if (voice[i].status == sVS_UNUSED || + if (voice[i].status == sVS_UNUSED || (voice[i].note == d1 && voice[i].channel == chn)) { nv = i; break; @@ -1176,24 +1176,24 @@ static DWORD modData(WORD wDevID, DWORD dwParam) } TRACE( "playing on voice=%d, pgm=%d, pan=0x%02X, vol=0x%02X, " - "bender=0x%02X, note=0x%02X, vel=0x%02X\n", - nv, channel[chn].program, - channel[chn].balance, - channel[chn].volume, + "bender=0x%02X, note=0x%02X, vel=0x%02X\n", + nv, channel[chn].program, + channel[chn].balance, + channel[chn].volume, channel[chn].bender, d1, d2); - - SEQ_SET_PATCH(wDevID, nv, IS_DRUM_CHANNEL(extra, chn) ? + + SEQ_SET_PATCH(wDevID, nv, IS_DRUM_CHANNEL(extra, chn) ? (128 + d1) : channel[chn].program); SEQ_BENDER_RANGE(wDevID, nv, channel[chn].benderRange * 100); SEQ_BENDER(wDevID, nv, channel[chn].bender); SEQ_CONTROL(wDevID, nv, CTL_PAN, channel[chn].balance); SEQ_CONTROL(wDevID, nv, CTL_EXPRESSION, channel[chn].expression); -#if 0 +#if 0 /* FIXME: does not really seem to work on my SB card and * screws everything up... so lay it down */ SEQ_CONTROL(wDevID, nv, CTL_MAIN_VOLUME, channel[chn].volume); -#endif +#endif SEQ_START_NOTE(wDevID, nv, d1, d2); voice[nv].status = channel[chn].sustain ? sVS_SUSTAINED : sVS_PLAYING; voice[nv].note = d1; @@ -1232,10 +1232,10 @@ static DWORD modData(WORD wDevID, DWORD dwParam) case CTL_NONREG_PARM_NUM_LSB: channel[chn].nrgPmtLSB = d2; break; case CTL_NONREG_PARM_NUM_MSB: channel[chn].nrgPmtMSB = d2; break; case CTL_REGIST_PARM_NUM_LSB: channel[chn].regPmtLSB = d2; break; - case CTL_REGIST_PARM_NUM_MSB: channel[chn].regPmtMSB = d2; break; + case CTL_REGIST_PARM_NUM_MSB: channel[chn].regPmtMSB = d2; break; case CTL_DATA_ENTRY: switch ((channel[chn].regPmtMSB << 8) | channel[chn].regPmtLSB) { - case 0x0000: + case 0x0000: if (channel[chn].benderRange != d2) { channel[chn].benderRange = d2; for (i = 0; i < midiOutDevices[wDevID]->wVoices; i++) { @@ -1245,7 +1245,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam) } } break; - + case 0x7F7F: channel[chn].benderRange = 2; for (i = 0; i < midiOutDevices[wDevID]->wVoices; i++) { @@ -1262,9 +1262,9 @@ static DWORD modData(WORD wDevID, DWORD dwParam) break; } break; - + case 0x78: /* all sounds off */ - /* FIXME: I don't know if I have to take care of the channel + /* FIXME: I don't know if I have to take care of the channel * for this control ? */ for (i = 0; i < midiOutDevices[wDevID]->wVoices; i++) { @@ -1275,7 +1275,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam) } break; case 0x7B: /* all notes off */ - /* FIXME: I don't know if I have to take care of the channel + /* FIXME: I don't know if I have to take care of the channel * for this control ? */ for (i = 0; i < midiOutDevices[wDevID]->wVoices; i++) { @@ -1284,9 +1284,9 @@ static DWORD modData(WORD wDevID, DWORD dwParam) SEQ_STOP_NOTE(wDevID, i, voice[i].note, 64); } } - break; + break; default: - TRACE("Dropping MIDI control event 0x%02x(%02x) on channel %d\n", + TRACE("Dropping MIDI control event 0x%02x(%02x) on channel %d\n", d1, d2, chn); break; } @@ -1313,12 +1313,12 @@ static DWORD modData(WORD wDevID, DWORD dwParam) switch (evt & 0x0F) { case 0x0F: /* Reset */ modFMReset(wDevID); - break; + break; default: WARN("Unsupported (yet) system event %02x\n", evt & 0x0F); } break; - default: + default: WARN("Internal error, shouldn't happen (event=%08x)\n", evt & 0xF0); return MMSYSERR_NOTENABLED; } @@ -1331,25 +1331,25 @@ static DWORD modData(WORD wDevID, DWORD dwParam) WARN("Internal error on devID (%u) !\n", wDevID); return MIDIERR_NODEVICE; } - + switch (evt & 0xF0) { case MIDI_NOTEOFF: case MIDI_NOTEON: case MIDI_KEY_PRESSURE: case MIDI_CTL_CHANGE: case MIDI_PITCH_BEND: - SEQ_MIDIOUT(dev, evt); - SEQ_MIDIOUT(dev, d1); - SEQ_MIDIOUT(dev, d2); + SEQ_MIDIOUT(dev, evt); + SEQ_MIDIOUT(dev, d1); + SEQ_MIDIOUT(dev, d2); break; case MIDI_PGM_CHANGE: case MIDI_CHN_PRESSURE: - SEQ_MIDIOUT(dev, evt); - SEQ_MIDIOUT(dev, d1); - break; + SEQ_MIDIOUT(dev, evt); + SEQ_MIDIOUT(dev, d1); + break; case MIDI_SYSTEM_PREFIX: switch (evt & 0x0F) { - case 0x00: /* System Exclusive, don't do it on modData, + case 0x00: /* System Exclusive, don't do it on modData, * should require modLongData*/ case 0x01: /* Undefined */ case 0x04: /* Undefined. */ @@ -1364,7 +1364,7 @@ static DWORD modData(WORD wDevID, DWORD dwParam) case 0x0B: /* Continue */ case 0x0C: /* Stop */ case 0x0E: /* Active Sensing. */ - SEQ_MIDIOUT(dev, evt); + SEQ_MIDIOUT(dev, evt); break; case 0x0F: /* Reset */ /* SEQ_MIDIOUT(dev, evt); @@ -1377,10 +1377,10 @@ static DWORD modData(WORD wDevID, DWORD dwParam) SEQ_MIDIOUT(dev, 0xf7); break; case 0x03: /* Song Select. */ - SEQ_MIDIOUT(dev, evt); - SEQ_MIDIOUT(dev, d1); + SEQ_MIDIOUT(dev, evt); + SEQ_MIDIOUT(dev, d1); case 0x02: /* Song Position Pointer. */ - SEQ_MIDIOUT(dev, evt); + SEQ_MIDIOUT(dev, evt); SEQ_MIDIOUT(dev, d1); SEQ_MIDIOUT(dev, d2); } @@ -1389,11 +1389,11 @@ static DWORD modData(WORD wDevID, DWORD dwParam) } break; default: - WARN("Technology not supported (yet) %d !\n", + WARN("Technology not supported (yet) %d !\n", midiOutDevices[wDevID]->wTechnology); return MMSYSERR_NOTENABLED; } - + SEQ_DUMPBUF(); return MMSYSERR_NOERROR; @@ -1408,25 +1408,25 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) LPBYTE lpData; TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); - + if (midiSeqFD == -1) { WARN("can't play !\n"); return MIDIERR_NODEVICE; } - + lpData = lpMidiHdr->lpData; - if (lpData == NULL) + if (lpData == NULL) return MIDIERR_UNPREPARED; - if (!(lpMidiHdr->dwFlags & MHDR_PREPARED)) + if (!(lpMidiHdr->dwFlags & MHDR_PREPARED)) return MIDIERR_UNPREPARED; - if (lpMidiHdr->dwFlags & MHDR_INQUEUE) + if (lpMidiHdr->dwFlags & MHDR_INQUEUE) return MIDIERR_STILLPLAYING; lpMidiHdr->dwFlags &= ~MHDR_DONE; lpMidiHdr->dwFlags |= MHDR_INQUEUE; /* FIXME: MS doc is not 100% clear. Will lpData only contain system exclusive - * data, or can it also contain raw MIDI data, to be split up and sent to + * data, or can it also contain raw MIDI data, to be split up and sent to * modShortData() ? * If the latest is true, then the following WARNing will fire up */ @@ -1436,7 +1436,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) TRACE("dwBufferLength=%lu !\n", lpMidiHdr->dwBufferLength); TRACE(" %02X %02X %02X ... %02X %02X %02X\n", - lpData[0], lpData[1], lpData[2], lpData[lpMidiHdr->dwBufferLength-3], + lpData[0], lpData[1], lpData[2], lpData[lpMidiHdr->dwBufferLength-3], lpData[lpMidiHdr->dwBufferLength-2], lpData[lpMidiHdr->dwBufferLength-1]); switch (midiOutDevices[wDevID]->wTechnology) { @@ -1451,7 +1451,7 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) "system exclusive byte stream\n"); } for (count = 0; count < lpMidiHdr->dwBytesRecorded; count++) { - SEQ_MIDIOUT(wDevID - MODM_NUMFMSYNTHDEVS, lpData[count]); + SEQ_MIDIOUT(wDevID - MODM_NUMFMSYNTHDEVS, lpData[count]); } if (lpData[count - 1] != 0xF7) { /* Send end of System Exclusive */ @@ -1462,11 +1462,11 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) SEQ_DUMPBUF(); break; default: - WARN("Technology not supported (yet) %d !\n", + WARN("Technology not supported (yet) %d !\n", midiOutDevices[wDevID]->wTechnology); return MMSYSERR_NOTENABLED; } - + lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags |= MHDR_DONE; if (MIDI_NotifyClient(wDevID, MOM_DONE, (DWORD)lpMidiHdr, 0L) != MMSYSERR_NOERROR) { @@ -1482,24 +1482,24 @@ static DWORD modLongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) static DWORD modPrepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) { TRACE("(%04X, %p, %08lX);\n", wDevID, lpMidiHdr, dwSize); - + if (midiSeqFD == -1) { WARN("can't prepare !\n"); return MMSYSERR_NOTENABLED; } - /* MS doc says taht dwFlags must be set to zero, but (kinda funny) MS mciseq drivers + /* MS doc says taht dwFlags must be set to zero, but (kinda funny) MS mciseq drivers * asks to prepare MIDIHDR which dwFlags != 0. * So at least check for the inqueue flag */ - if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || - lpMidiHdr->lpData == 0 || (lpMidiHdr->dwFlags & MHDR_INQUEUE) != 0 || + if (dwSize < sizeof(MIDIHDR) || lpMidiHdr == 0 || + lpMidiHdr->lpData == 0 || (lpMidiHdr->dwFlags & MHDR_INQUEUE) != 0 || lpMidiHdr->dwBufferLength >= 0x10000ul) { - WARN("%p %p %08lx %d/%ld\n", lpMidiHdr, lpMidiHdr->lpData, + WARN("%p %p %08lx %d/%ld\n", lpMidiHdr, lpMidiHdr->lpData, lpMidiHdr->dwFlags, sizeof(MIDIHDR), dwSize); return MMSYSERR_INVALPARAM; } - + lpMidiHdr->lpNext = 0; lpMidiHdr->dwFlags |= MHDR_PREPARED; lpMidiHdr->dwFlags &= ~MHDR_DONE; @@ -1532,11 +1532,11 @@ static DWORD modUnprepare(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) static DWORD modReset(WORD wDevID) { unsigned chn; - + TRACE("(%04X);\n", wDevID); /* stop all notes */ - /* FIXME: check if 0x78B0 is channel dependant or not. I coded it so that + /* FIXME: check if 0x78B0 is channel dependant or not. I coded it so that * it's channel dependent... */ for (chn = 0; chn < 16; chn++) { @@ -1558,10 +1558,10 @@ static DWORD modReset(WORD wDevID) /************************************************************************** * midMessage (WINEOSS.4) */ -DWORD WINAPI OSS_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, +DWORD WINAPI OSS_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch (wMsg) { #ifdef HAVE_OSS_MIDI @@ -1583,7 +1583,7 @@ DWORD WINAPI OSS_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case MIDM_GETDEVCAPS: return midGetDevCaps(wDevID, (LPMIDIINCAPSA)dwParam1,dwParam2); case MIDM_GETNUMDEVS: - return MIDM_NUMDEVS; + return MIDM_NUMDEVS; case MIDM_RESET: return midReset(wDevID); case MIDM_START: @@ -1600,10 +1600,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 WINAPI OSS_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); switch (wMsg) { diff --git a/dlls/winmm/wineoss/midipatch.c b/dlls/winmm/wineoss/midipatch.c index a75798734f9..37f47a51f12 100644 --- a/dlls/winmm/wineoss/midipatch.c +++ b/dlls/winmm/wineoss/midipatch.c @@ -20,141 +20,141 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* +/* * Eric POUECH : MIDI FM patches for GM instruments */ -#define NOT_DEFINED 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +#define NOT_DEFINED 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, unsigned char midiFMInstrumentPatches[128 * 16] = { -/* 0 Acoustic Grand Piano */ 0x21, 0x11, 0x4c, 0x00, 0xf1, 0xf2, 0x63, 0x72, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 1 Bright Acoustic Piano */ 0x01, 0x11, 0x4f, 0x00, 0xf1, 0xd2, 0x53, 0x74, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 2 Electric Grand Piano */ 0x01, 0x01, 0x4f, 0x04, 0xf1, 0xd2, 0x50, 0x7c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 3 Honky-Tonk Piano */ 0x81, 0x13, 0x9d, 0x00, 0xf2, 0xf2, 0x51, 0xf1, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 4 Rhodes Piano */ 0x01, 0x01, 0x4f, 0x04, 0xf1, 0xd2, 0x50, 0x7c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 5 Chorused Piano */ 0x01, 0x11, 0x4d, 0x00, 0xf1, 0xd2, 0x60, 0x7b, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 6 Harpsichord */ 0x32, 0x16, 0x87, 0x80, 0xa1, 0x7d, 0x10, 0x33, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 7 Clavinet */ 0x13, 0x08, 0x80, 0x00, 0xfb, 0xe8, 0xff, 0xff, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 8 Celesta */ 0x14, 0x04, 0x07, 0x00, 0x93, 0xb6, 0x73, 0x62, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 9 Glockenspiel */ 0x07, 0x12, 0x4f, 0x00, 0xf2, 0xf2, 0x60, 0x72, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 10 Music Box */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 11 Vibraphone */ 0x44, 0x60, 0x53, 0x80, 0xf5, 0xfd, 0x33, 0x25, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 12 Marimba */ 0x05, 0x01, 0x4e, 0x00, 0xda, 0xf9, 0x25, 0x15, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 13 Xylophone */ 0x11, 0x31, 0x2d, 0x00, 0xc8, 0xf5, 0x2f, 0xf5, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 14 Tubular Bells */ 0x03, 0x17, 0x4f, 0x03, 0xf1, 0xf2, 0x53, 0x74, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 15 Dulcimer */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 16 Hammond Organ */ 0x72, 0x71, 0xcd, 0x80, 0x91, 0x91, 0x2a, 0x2a, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 17 Percussive Organ */ 0x0c, 0x00, 0x00, 0x00, 0xf8, 0xd6, 0xb5, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 18 Rock Organ */ 0x72, 0x70, 0xce, 0x80, 0x9f, 0x94, 0x12, 0x11, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 19 Church Organ */ 0xa5, 0xb1, 0xd2, 0x80, 0x81, 0xf1, 0x03, 0x05, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 20 Reed Organ */ 0x3e, 0xb1, 0x29, 0x80, 0xfb, 0xa0, 0xf0, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 21 Accordion */ 0x24, 0x31, 0x4f, 0x00, 0xf2, 0x52, 0x0b, 0x0b, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 22 Harmonica */ 0x22, 0xf2, 0x8f, 0x40, 0x41, 0x61, 0x03, 0x05, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 23 Tango Accordion */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 24 Acoustic Nylon Guitar */ 0x01, 0x01, 0x11, 0x00, 0xf2, 0xf5, 0x1f, 0x88, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 25 Acoustic Steel Guitar */ 0x01, 0xa1, 0x46, 0x03, 0xf1, 0x31, 0x83, 0x86, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 26 Electric Jazz Guitar */ 0x03, 0x11, 0x5e, 0x00, 0x85, 0xd2, 0x51, 0x71, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 27 Electric Clean Guitar */ 0x32, 0x16, 0x87, 0x80, 0xa1, 0x7d, 0x10, 0x33, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 28 Electric Muted Guitar */ 0x13, 0x11, 0x96, 0x80, 0xff, 0xff, 0x21, 0x03, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 29 Overdriven Guitar */ 0x07, 0x14, 0x8f, 0x80, 0x82, 0x82, 0x7d, 0x7d, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 30 Distortion Guitar */ 0x05, 0x01, 0x8f, 0x80, 0xda, 0xf9, 0x15, 0x14, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 31 Guitar Harmonics */ 0xc3, 0x01, 0x05, 0x0d, 0x91, 0xf1, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 32 Acoustic Bass */ 0x21, 0x01, 0x2a, 0x00, 0xf2, 0xf5, 0x1f, 0x88, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 33 Electric Bass Fingered */ 0x01, 0x21, 0x15, 0x80, 0x25, 0x65, 0x2f, 0x6c, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 34 Electric Bass Picked */ 0x01, 0x01, 0x1d, 0x00, 0xf2, 0xf5, 0xef, 0x78, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 35 Fretless Bass */ 0x30, 0x21, 0x1e, 0x00, 0xf2, 0xf5, 0xef, 0x78, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 Slap Bass 1 */ 0x20, 0x21, 0x40, 0x00, 0x7b, 0x75, 0x04, 0x72, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 37 Slap Bass 2 */ 0x20, 0x21, 0x40, 0x00, 0x7b, 0xf5, 0x04, 0x72, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 38 Synth Bass 1 */ 0x41, 0x91, 0x83, 0x00, 0x65, 0x32, 0x05, 0x74, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 39 Synth Bass 2 */ 0x30, 0xb1, 0x88, 0x80, 0xd5, 0x61, 0x19, 0x1b, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 40 Violin */ 0x72, 0x62, 0x1c, 0x05, 0x51, 0x52, 0x03, 0x13, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 41 Viola */ 0x70, 0x71, 0xd0, 0x80, 0x52, 0x31, 0x11, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 42 Cello */ 0x70, 0x71, 0xc5, 0x80, 0x52, 0x31, 0x11, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 43 Contrabass */ 0x01, 0x00, 0x00, 0x00, 0x94, 0x83, 0xb6, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 44 Tremolo Strings */ 0x71, 0xa1, 0x8b, 0x40, 0x71, 0x42, 0x11, 0x15, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 45 Pizzicato Strings */ 0xf2, 0xe1, 0x40, 0x80, 0xf5, 0xfd, 0xa8, 0xad, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 46 Orchestral Harp */ 0x21, 0x11, 0x11, 0x00, 0xa3, 0xc4, 0x43, 0x22, 0x02, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 47 Timpani */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 48 String Ensemble 1 */ 0xe1, 0x21, 0x4f, 0x00, 0xc1, 0x32, 0xd3, 0x74, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 49 String Ensemble 2 */ 0xe1, 0x21, 0x4f, 0x00, 0xb1, 0x12, 0xd3, 0x74, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 50 Synth Strings 1 */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 51 Synth Strings 2 */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 52 Choir Aahs */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 53 Voice oohs */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 54 Synth Voice */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 55 Orchestra Hit */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 56 Trumpet */ 0x31, 0xa1, 0x1c, 0x80, 0x41, 0x92, 0x0b, 0x3b, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 57 Trombone */ 0x21, 0xa1, 0x18, 0x80, 0x53, 0x52, 0x1d, 0x3b, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 58 Tuba */ 0x21, 0x21, 0x19, 0x80, 0x43, 0x85, 0x8c, 0x2f, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 59 Muted Trumpet */ 0x31, 0xa1, 0x1c, 0x80, 0x41, 0x92, 0x0b, 0x3b, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 60 French Horn */ 0x21, 0x21, 0x9f, 0x80, 0x53, 0xaa, 0x5a, 0x1a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 61 Brass Section */ 0x21, 0x21, 0x16, 0x00, 0x71, 0x81, 0xae, 0x9e, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 62 Synth Brass 1 */ 0x61, 0x60, 0x1c, 0x00, 0x71, 0x81, 0xae, 0x2e, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 63 Synth Brass 2 */ 0x21, 0x21, 0x8e, 0x80, 0xbb, 0x90, 0x29, 0x0a, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 64 Soprano Sax */ 0x01, 0x12, 0x4f, 0x00, 0x71, 0x52, 0x53, 0x7c, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 65 Alto Sax */ 0x01, 0x13, 0x4f, 0x00, 0x71, 0x62, 0x53, 0x84, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 66 Tenor Sax */ 0x01, 0x13, 0x8d, 0x00, 0x51, 0x52, 0x53, 0x7c, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 67 Baritone Sax */ 0x01, 0x12, 0x4f, 0x00, 0x71, 0x22, 0x53, 0x7c, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 68 Oboe */ 0x71, 0x62, 0xc5, 0x05, 0x6e, 0x8b, 0x17, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 69 English Horn */ 0xe1, 0xe4, 0x23, 0x00, 0x71, 0x82, 0xae, 0x9e, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 70 Bassoon */ 0x30, 0xb1, 0xcd, 0x80, 0xd5, 0x61, 0x19, 0x1b, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 71 Clarinet */ 0x32, 0xa1, 0x1c, 0x80, 0x51, 0x82, 0x15, 0x45, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 72 Piccolo */ 0xe4, 0xe4, 0x0f, 0x00, 0x70, 0x60, 0x0f, 0x9f, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 73 Flute */ 0xe1, 0x61, 0x27, 0x80, 0x53, 0x53, 0x8a, 0x57, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 74 Recorder */ 0x61, 0x61, 0x27, 0x80, 0x74, 0x65, 0x8f, 0x2a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 75 Pan Flute */ 0xe0, 0xa1, 0xec, 0x00, 0x6e, 0x65, 0x8f, 0x2a, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 76 Bottle Blow */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 77 Shakuhashi */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 78 Whistle */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 79 Ocarina */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 80 Synth lead 1 - Sq wave lead */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 81 Synth lead 2 - Sawtooth Wave */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 82 Synth lead 3 - Caliope lead */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 83 Synth lead 4 - Chiff lead */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 84 Synth lead 5 - Charang */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 85 Synth lead 6 - Solo Synth Voice */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 86 Synth lead 7 - Bright Saw Wave */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 87 Synth lead 8 - Brass and Lead */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 88 Synth pad 1 - Fantasia Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 89 Synth pad 2 - Warm Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 90 Synth pad 3 - Poly Synth Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 91 Synth pad 4 - Space Voice Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 92 Synth pad 5 - Bowed Glass Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 93 Synth pad 6 - Metal Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 94 Synth pad 7 - Halo Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 95 Synth pad 8 - Sweep Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 96 Synth SFX 1 - Ice Rain */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 97 Synth SFX 2 - Soundtrack */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 98 Synth SFX 3 - Crystal */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 99 Synth SFX 4 - Athmosphere */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 100 Synth SFX 5 - Brightness */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 101 Synth SFX 6 - Goblin */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 102 Synth SFX 7 - Echo drops */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 103 Synth SFX 8 - Star Theme */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 104 Sitar */ 0x01, 0x08, 0x40, 0x00, 0xf2, 0xf2, 0x54, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 105 Banjo */ 0x31, 0x16, 0x87, 0x80, 0xa1, 0x7d, 0x11, 0x43, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 106 Shamisen */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 107 Koto */ 0x0e, 0x02, 0x40, 0x00, 0x09, 0xf7, 0x53, 0x94, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 108 Kalimba */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 109 Bagpipe */ 0x31, 0x22, 0x43, 0x05, 0x6e, 0x8b, 0x17, 0x0c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 110 Fiddle */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 111 Shanai */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 112 Tinkle Bell */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 113 Agogo */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 114 Steel Drums */ 0x00, 0x00, 0x0b, 0x00, 0xa8, 0xd6, 0x4c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 115 Woodblock */ 0x02, 0x11, 0x4f, 0x00, 0x71, 0x52, 0x53, 0x7c, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 116 Taiko Drum */ 0x12, 0x02, 0x0b, 0x00, 0x95, 0xd4, 0x4c, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 117 Melodic Tom */ 0x01, 0x02, 0x00, 0x00, 0xfa, 0xda, 0xbf, 0xbf, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 118 Synth Drum */ 0x06, 0x00, 0x00, 0x00, 0xf0, 0xf6, 0xf0, 0xb4, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 119 Reverse Cymbal */ 0x64, 0x03, 0x00, 0x40, 0xb2, 0x97, 0x82, 0xd4, 0x02, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 120 Guitar Fret Noise */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 121 Breath Noise */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 122 Seashore */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 123 Bird Tweet */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 124 Telephone Ring */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 125 Helicopter */ 0xf0, 0xe2, 0x00, 0xc0, 0x1e, 0x11, 0x11, 0x11, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 126 Applause */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 127 Gunshot */ 0x0c, 0x50, 0x00, 0x21, 0xf8, 0x09, 0xb6, 0x04, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 0 Acoustic Grand Piano */ 0x21, 0x11, 0x4c, 0x00, 0xf1, 0xf2, 0x63, 0x72, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 1 Bright Acoustic Piano */ 0x01, 0x11, 0x4f, 0x00, 0xf1, 0xd2, 0x53, 0x74, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 2 Electric Grand Piano */ 0x01, 0x01, 0x4f, 0x04, 0xf1, 0xd2, 0x50, 0x7c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 3 Honky-Tonk Piano */ 0x81, 0x13, 0x9d, 0x00, 0xf2, 0xf2, 0x51, 0xf1, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 4 Rhodes Piano */ 0x01, 0x01, 0x4f, 0x04, 0xf1, 0xd2, 0x50, 0x7c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 5 Chorused Piano */ 0x01, 0x11, 0x4d, 0x00, 0xf1, 0xd2, 0x60, 0x7b, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 6 Harpsichord */ 0x32, 0x16, 0x87, 0x80, 0xa1, 0x7d, 0x10, 0x33, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 7 Clavinet */ 0x13, 0x08, 0x80, 0x00, 0xfb, 0xe8, 0xff, 0xff, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 8 Celesta */ 0x14, 0x04, 0x07, 0x00, 0x93, 0xb6, 0x73, 0x62, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 9 Glockenspiel */ 0x07, 0x12, 0x4f, 0x00, 0xf2, 0xf2, 0x60, 0x72, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 10 Music Box */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 11 Vibraphone */ 0x44, 0x60, 0x53, 0x80, 0xf5, 0xfd, 0x33, 0x25, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 12 Marimba */ 0x05, 0x01, 0x4e, 0x00, 0xda, 0xf9, 0x25, 0x15, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 13 Xylophone */ 0x11, 0x31, 0x2d, 0x00, 0xc8, 0xf5, 0x2f, 0xf5, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 14 Tubular Bells */ 0x03, 0x17, 0x4f, 0x03, 0xf1, 0xf2, 0x53, 0x74, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 15 Dulcimer */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 16 Hammond Organ */ 0x72, 0x71, 0xcd, 0x80, 0x91, 0x91, 0x2a, 0x2a, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 17 Percussive Organ */ 0x0c, 0x00, 0x00, 0x00, 0xf8, 0xd6, 0xb5, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 18 Rock Organ */ 0x72, 0x70, 0xce, 0x80, 0x9f, 0x94, 0x12, 0x11, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 19 Church Organ */ 0xa5, 0xb1, 0xd2, 0x80, 0x81, 0xf1, 0x03, 0x05, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 20 Reed Organ */ 0x3e, 0xb1, 0x29, 0x80, 0xfb, 0xa0, 0xf0, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 21 Accordion */ 0x24, 0x31, 0x4f, 0x00, 0xf2, 0x52, 0x0b, 0x0b, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 22 Harmonica */ 0x22, 0xf2, 0x8f, 0x40, 0x41, 0x61, 0x03, 0x05, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 23 Tango Accordion */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 24 Acoustic Nylon Guitar */ 0x01, 0x01, 0x11, 0x00, 0xf2, 0xf5, 0x1f, 0x88, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 25 Acoustic Steel Guitar */ 0x01, 0xa1, 0x46, 0x03, 0xf1, 0x31, 0x83, 0x86, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 26 Electric Jazz Guitar */ 0x03, 0x11, 0x5e, 0x00, 0x85, 0xd2, 0x51, 0x71, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 27 Electric Clean Guitar */ 0x32, 0x16, 0x87, 0x80, 0xa1, 0x7d, 0x10, 0x33, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 28 Electric Muted Guitar */ 0x13, 0x11, 0x96, 0x80, 0xff, 0xff, 0x21, 0x03, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 29 Overdriven Guitar */ 0x07, 0x14, 0x8f, 0x80, 0x82, 0x82, 0x7d, 0x7d, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 30 Distortion Guitar */ 0x05, 0x01, 0x8f, 0x80, 0xda, 0xf9, 0x15, 0x14, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 31 Guitar Harmonics */ 0xc3, 0x01, 0x05, 0x0d, 0x91, 0xf1, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 32 Acoustic Bass */ 0x21, 0x01, 0x2a, 0x00, 0xf2, 0xf5, 0x1f, 0x88, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 33 Electric Bass Fingered */ 0x01, 0x21, 0x15, 0x80, 0x25, 0x65, 0x2f, 0x6c, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 34 Electric Bass Picked */ 0x01, 0x01, 0x1d, 0x00, 0xf2, 0xf5, 0xef, 0x78, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 35 Fretless Bass */ 0x30, 0x21, 0x1e, 0x00, 0xf2, 0xf5, 0xef, 0x78, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 36 Slap Bass 1 */ 0x20, 0x21, 0x40, 0x00, 0x7b, 0x75, 0x04, 0x72, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 37 Slap Bass 2 */ 0x20, 0x21, 0x40, 0x00, 0x7b, 0xf5, 0x04, 0x72, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 38 Synth Bass 1 */ 0x41, 0x91, 0x83, 0x00, 0x65, 0x32, 0x05, 0x74, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 39 Synth Bass 2 */ 0x30, 0xb1, 0x88, 0x80, 0xd5, 0x61, 0x19, 0x1b, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 40 Violin */ 0x72, 0x62, 0x1c, 0x05, 0x51, 0x52, 0x03, 0x13, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 41 Viola */ 0x70, 0x71, 0xd0, 0x80, 0x52, 0x31, 0x11, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 42 Cello */ 0x70, 0x71, 0xc5, 0x80, 0x52, 0x31, 0x11, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 43 Contrabass */ 0x01, 0x00, 0x00, 0x00, 0x94, 0x83, 0xb6, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 44 Tremolo Strings */ 0x71, 0xa1, 0x8b, 0x40, 0x71, 0x42, 0x11, 0x15, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 45 Pizzicato Strings */ 0xf2, 0xe1, 0x40, 0x80, 0xf5, 0xfd, 0xa8, 0xad, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 46 Orchestral Harp */ 0x21, 0x11, 0x11, 0x00, 0xa3, 0xc4, 0x43, 0x22, 0x02, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 47 Timpani */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 48 String Ensemble 1 */ 0xe1, 0x21, 0x4f, 0x00, 0xc1, 0x32, 0xd3, 0x74, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 49 String Ensemble 2 */ 0xe1, 0x21, 0x4f, 0x00, 0xb1, 0x12, 0xd3, 0x74, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 50 Synth Strings 1 */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 51 Synth Strings 2 */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 52 Choir Aahs */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 53 Voice oohs */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 54 Synth Voice */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 55 Orchestra Hit */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 56 Trumpet */ 0x31, 0xa1, 0x1c, 0x80, 0x41, 0x92, 0x0b, 0x3b, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 57 Trombone */ 0x21, 0xa1, 0x18, 0x80, 0x53, 0x52, 0x1d, 0x3b, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 58 Tuba */ 0x21, 0x21, 0x19, 0x80, 0x43, 0x85, 0x8c, 0x2f, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 59 Muted Trumpet */ 0x31, 0xa1, 0x1c, 0x80, 0x41, 0x92, 0x0b, 0x3b, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 60 French Horn */ 0x21, 0x21, 0x9f, 0x80, 0x53, 0xaa, 0x5a, 0x1a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 61 Brass Section */ 0x21, 0x21, 0x16, 0x00, 0x71, 0x81, 0xae, 0x9e, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 62 Synth Brass 1 */ 0x61, 0x60, 0x1c, 0x00, 0x71, 0x81, 0xae, 0x2e, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 63 Synth Brass 2 */ 0x21, 0x21, 0x8e, 0x80, 0xbb, 0x90, 0x29, 0x0a, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 64 Soprano Sax */ 0x01, 0x12, 0x4f, 0x00, 0x71, 0x52, 0x53, 0x7c, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 65 Alto Sax */ 0x01, 0x13, 0x4f, 0x00, 0x71, 0x62, 0x53, 0x84, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 66 Tenor Sax */ 0x01, 0x13, 0x8d, 0x00, 0x51, 0x52, 0x53, 0x7c, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 67 Baritone Sax */ 0x01, 0x12, 0x4f, 0x00, 0x71, 0x22, 0x53, 0x7c, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 68 Oboe */ 0x71, 0x62, 0xc5, 0x05, 0x6e, 0x8b, 0x17, 0x0e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 69 English Horn */ 0xe1, 0xe4, 0x23, 0x00, 0x71, 0x82, 0xae, 0x9e, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 70 Bassoon */ 0x30, 0xb1, 0xcd, 0x80, 0xd5, 0x61, 0x19, 0x1b, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 71 Clarinet */ 0x32, 0xa1, 0x1c, 0x80, 0x51, 0x82, 0x15, 0x45, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 72 Piccolo */ 0xe4, 0xe4, 0x0f, 0x00, 0x70, 0x60, 0x0f, 0x9f, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 73 Flute */ 0xe1, 0x61, 0x27, 0x80, 0x53, 0x53, 0x8a, 0x57, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 74 Recorder */ 0x61, 0x61, 0x27, 0x80, 0x74, 0x65, 0x8f, 0x2a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 75 Pan Flute */ 0xe0, 0xa1, 0xec, 0x00, 0x6e, 0x65, 0x8f, 0x2a, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 76 Bottle Blow */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 77 Shakuhashi */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 78 Whistle */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 79 Ocarina */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 80 Synth lead 1 - Sq wave lead */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 81 Synth lead 2 - Sawtooth Wave */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 82 Synth lead 3 - Caliope lead */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 83 Synth lead 4 - Chiff lead */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 84 Synth lead 5 - Charang */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 85 Synth lead 6 - Solo Synth Voice */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 86 Synth lead 7 - Bright Saw Wave */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 87 Synth lead 8 - Brass and Lead */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 88 Synth pad 1 - Fantasia Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 89 Synth pad 2 - Warm Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 90 Synth pad 3 - Poly Synth Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 91 Synth pad 4 - Space Voice Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 92 Synth pad 5 - Bowed Glass Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 93 Synth pad 6 - Metal Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 94 Synth pad 7 - Halo Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 95 Synth pad 8 - Sweep Pad */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 96 Synth SFX 1 - Ice Rain */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 97 Synth SFX 2 - Soundtrack */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 98 Synth SFX 3 - Crystal */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 99 Synth SFX 4 - Athmosphere */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 100 Synth SFX 5 - Brightness */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 101 Synth SFX 6 - Goblin */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 102 Synth SFX 7 - Echo drops */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 103 Synth SFX 8 - Star Theme */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 104 Sitar */ 0x01, 0x08, 0x40, 0x00, 0xf2, 0xf2, 0x54, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 105 Banjo */ 0x31, 0x16, 0x87, 0x80, 0xa1, 0x7d, 0x11, 0x43, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 106 Shamisen */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 107 Koto */ 0x0e, 0x02, 0x40, 0x00, 0x09, 0xf7, 0x53, 0x94, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 108 Kalimba */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 109 Bagpipe */ 0x31, 0x22, 0x43, 0x05, 0x6e, 0x8b, 0x17, 0x0c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 110 Fiddle */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 111 Shanai */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 112 Tinkle Bell */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 113 Agogo */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 114 Steel Drums */ 0x00, 0x00, 0x0b, 0x00, 0xa8, 0xd6, 0x4c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 115 Woodblock */ 0x02, 0x11, 0x4f, 0x00, 0x71, 0x52, 0x53, 0x7c, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 116 Taiko Drum */ 0x12, 0x02, 0x0b, 0x00, 0x95, 0xd4, 0x4c, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 117 Melodic Tom */ 0x01, 0x02, 0x00, 0x00, 0xfa, 0xda, 0xbf, 0xbf, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 118 Synth Drum */ 0x06, 0x00, 0x00, 0x00, 0xf0, 0xf6, 0xf0, 0xb4, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 119 Reverse Cymbal */ 0x64, 0x03, 0x00, 0x40, 0xb2, 0x97, 0x82, 0xd4, 0x02, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 120 Guitar Fret Noise */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 121 Breath Noise */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 122 Seashore */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 123 Bird Tweet */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 124 Telephone Ring */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 125 Helicopter */ 0xf0, 0xe2, 0x00, 0xc0, 0x1e, 0x11, 0x11, 0x11, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 126 Applause */ 0x07, 0x01, 0x87, 0x80, 0xf0, 0xf0, 0x05, 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 127 Gunshot */ 0x0c, 0x50, 0x00, 0x21, 0xf8, 0x09, 0xb6, 0x04, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, }; unsigned char midiFMDrumsPatches[16 * 128] = { @@ -192,8 +192,8 @@ unsigned char midiFMDrumsPatches[16 * 128] = { /* 32 Not defined */ NOT_DEFINED /* 33 Not defined */ NOT_DEFINED /* 34 Not defined */ NOT_DEFINED -/* 35 Acoustic Bass Drum */ 0x00, 0x00, 0x0d, 0x00, 0xe8, 0xa5, 0xef, 0xff, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, -/* 36 Bass Drum 1 */ 0x00, 0x00, 0x0b, 0x00, 0xa8, 0xd6, 0x4c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 35 Acoustic Bass Drum */ 0x00, 0x00, 0x0d, 0x00, 0xe8, 0xa5, 0xef, 0xff, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, +/* 36 Bass Drum 1 */ 0x00, 0x00, 0x0b, 0x00, 0xa8, 0xd6, 0x4c, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 37 Side Stick */ NOT_DEFINED /* 38 Acoustic Snare */ 0x2e, 0x02, 0x0a, 0x1b, 0xff, 0xf6, 0x0f, 0x4a, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, /* snare */ /* 39 Hand Clap */ NOT_DEFINED @@ -208,7 +208,7 @@ unsigned char midiFMDrumsPatches[16 * 128] = { /* 48 Hi-Mid Tom */ NOT_DEFINED /* 49 Crash Cymbal 1 */ NOT_DEFINED /* 50 High Tom */ NOT_DEFINED -/* 51 Ride Cymbal 1 */ 0x64, 0x03, 0x00, 0x40, 0xb2, 0x97, 0x82, 0xd4, 0x02, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, /* bcymbal */ +/* 51 Ride Cymbal 1 */ 0x64, 0x03, 0x00, 0x40, 0xb2, 0x97, 0x82, 0xd4, 0x02, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, /* bcymbal */ /* 52 Chinese Cymbal */ NOT_DEFINED /* 53 Ride Bell */ NOT_DEFINED /* 54 Tambourine */ NOT_DEFINED @@ -287,5 +287,5 @@ unsigned char midiFMDrumsPatches[16 * 128] = { /* 127 Not defined */ NOT_DEFINED /* 128 Not defined */ NOT_DEFINED }; - + diff --git a/dlls/winmm/wineoss/mixer.c b/dlls/winmm/wineoss/mixer.c index 194c901ada7..6ef828dfe1d 100644 --- a/dlls/winmm/wineoss/mixer.c +++ b/dlls/winmm/wineoss/mixer.c @@ -73,7 +73,7 @@ struct mixerCtrl MIXERCONTROLA ctrl; }; -struct mixer +struct mixer { const char* name; int volume[SOUND_MIXER_NRDEVICES]; @@ -104,8 +104,8 @@ static void MIX_FillLineControls(struct mixer* mix, int c, DWORD lineID, DWORD d mc->ctrl.cbStruct = sizeof(MIXERCONTROLA); mc->ctrl.dwControlID = c + 1; mc->ctrl.dwControlType = dwType; - - switch (dwType) + + switch (dwType) { case MIXERCONTROL_CONTROLTYPE_VOLUME: mc->ctrl.fdwControl = 0; @@ -113,7 +113,7 @@ static void MIX_FillLineControls(struct mixer* mix, int c, DWORD lineID, DWORD d lstrcpynA(mc->ctrl.szShortName, "Vol", MIXER_SHORT_NAME_CHARS); lstrcpynA(mc->ctrl.szName, "Volume", MIXER_LONG_NAME_CHARS); memset(&mc->ctrl.Bounds, 0, sizeof(mc->ctrl.Bounds)); - /* CONTROLTYPE_VOLUME uses the MIXER_CONTROLDETAILS_UNSIGNED struct, + /* CONTROLTYPE_VOLUME uses the MIXER_CONTROLDETAILS_UNSIGNED struct, * [0, 100] is the range supported by OSS * whatever the min and max values are they must match * conversions done in (Get|Set)ControlDetails to stay in [0, 100] range @@ -145,7 +145,7 @@ static void MIX_FillLineControls(struct mixer* mix, int c, DWORD lineID, DWORD d memset(&mc->ctrl.Bounds, 0, sizeof(mc->ctrl.Bounds)); memset(&mc->ctrl.Metrics, 0, sizeof(mc->ctrl.Metrics)); break; - + default: FIXME("Internal error: unknown type: %08lx\n", dwType); } @@ -174,7 +174,7 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpMod, DWORD flags) DWORD ret = MMSYSERR_NOERROR; TRACE("(%04X, %p, %lu);\n", wDevID, lpMod, flags); - + /* as we partly init the mixer with MIX_Open, we can allow null open decs */ /* EPP if (lpMod == NULL) return MMSYSERR_INVALPARAM; */ /* anyway, it seems that WINMM/MMSYSTEM doesn't always open the mixer device before sending @@ -183,17 +183,17 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpMod, DWORD flags) */ if (!(mix = MIX_Get(wDevID))) return MMSYSERR_BADDEVICEID; - if ((mixer = open(mix->name, O_RDWR)) < 0) + if ((mixer = open(mix->name, O_RDWR)) < 0) { - if (errno == ENODEV || errno == ENXIO) - { + if (errno == ENODEV || errno == ENXIO) + { /* no driver present */ return MMSYSERR_NODRIVER; } return MMSYSERR_ERROR; } - - if (ioctl(mixer, SOUND_MIXER_READ_DEVMASK, &mix->devMask) == -1) + + if (ioctl(mixer, SOUND_MIXER_READ_DEVMASK, &mix->devMask) == -1) { perror("ioctl mixer SOUND_MIXER_DEVMASK"); ret = MMSYSERR_ERROR; @@ -206,7 +206,7 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpMod, DWORD flags) goto error; } - if (ioctl(mixer, SOUND_MIXER_READ_STEREODEVS, &mix->stereoMask) == -1) + if (ioctl(mixer, SOUND_MIXER_READ_STEREODEVS, &mix->stereoMask) == -1) { perror("ioctl mixer SOUND_MIXER_STEREODEVS"); ret = MMSYSERR_ERROR; @@ -214,7 +214,7 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpMod, DWORD flags) } mix->stereoMask &= WINE_MIXER_MASK_SPEAKER; - if (ioctl(mixer, SOUND_MIXER_READ_RECMASK, &mix->recMask) == -1) + if (ioctl(mixer, SOUND_MIXER_READ_RECMASK, &mix->recMask) == -1) { perror("ioctl mixer SOUND_MIXER_RECMASK"); ret = MMSYSERR_ERROR; @@ -228,17 +228,17 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpMod, DWORD flags) if (WINE_CHN_SUPPORTS(mix->recMask, SOUND_MIXER_IGAIN)) WARN("but it does support IGain, please report\n"); } - if (ioctl(mixer, SOUND_MIXER_READ_CAPS, &caps) == -1) + if (ioctl(mixer, SOUND_MIXER_READ_CAPS, &caps) == -1) { perror("ioctl mixer SOUND_MIXER_READ_CAPS"); ret = MMSYSERR_ERROR; goto error; } mix->singleRecChannel = caps & SOUND_CAP_EXCL_INPUT; - TRACE("dev=%04x rec=%04x stereo=%04x %s\n", - mix->devMask, mix->recMask, mix->stereoMask, + TRACE("dev=%04x rec=%04x stereo=%04x %s\n", + mix->devMask, mix->recMask, mix->stereoMask, mix->singleRecChannel ? "single" : "multiple"); - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) + for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { mix->volume[i] = -1; } @@ -250,18 +250,18 @@ static DWORD MIX_Open(WORD wDevID, LPMIXEROPENDESC lpMod, DWORD flags) mix->numCtrl += 2; /* volume & mute */ if (WINE_CHN_SUPPORTS(mix->recMask, i)) mix->numCtrl += 2; /* volume & onoff */ - + } if (!(mix->ctrl = HeapAlloc(GetProcessHeap(), 0, sizeof(mix->ctrl[0]) * mix->numCtrl))) { ret = MMSYSERR_NOMEM; goto error; } - + j = 0; MIX_FillLineControls(mix, j++, MAKELONG(0, LINEID_DST), MIXERCONTROL_CONTROLTYPE_VOLUME); MIX_FillLineControls(mix, j++, MAKELONG(0, LINEID_DST), MIXERCONTROL_CONTROLTYPE_MUTE); - MIX_FillLineControls(mix, j++, MAKELONG(1, LINEID_DST), + MIX_FillLineControls(mix, j++, MAKELONG(1, LINEID_DST), mix->singleRecChannel ? MIXERCONTROL_CONTROLTYPE_MUX : MIXERCONTROL_CONTROLTYPE_MIXER); MIX_FillLineControls(mix, j++, MAKELONG(1, LINEID_DST), MIXERCONTROL_CONTROLTYPE_MUTE/*EPP*/); @@ -299,14 +299,14 @@ static BOOL MIX_GetVal(struct mixer* mix, int chn, int* val) int mixer; BOOL ret = FALSE; - if ((mixer = open(mix->name, O_RDWR)) < 0) + if ((mixer = open(mix->name, O_RDWR)) < 0) { /* FIXME: ENXIO => no mixer installed */ WARN("mixer device not available !\n"); - } - else + } + else { - if (ioctl(mixer, MIXER_READ(chn), val) >= 0) + if (ioctl(mixer, MIXER_READ(chn), val) >= 0) { TRACE("Reading volume %x on %d\n", *val, chn); ret = TRUE; @@ -326,14 +326,14 @@ static BOOL MIX_SetVal(struct mixer* mix, int chn, int val) TRACE("Writing volume %x on %d\n", val, chn); - if ((mixer = open(mix->name, O_RDWR)) < 0) + if ((mixer = open(mix->name, O_RDWR)) < 0) { /* FIXME: ENXIO => no mixer installed */ WARN("mixer device not available !\n"); } - else + else { - if (ioctl(mixer, MIXER_WRITE(chn), &val) >= 0) + if (ioctl(mixer, MIXER_WRITE(chn), &val) >= 0) { ret = TRUE; } @@ -370,9 +370,9 @@ static BOOL MIX_SetRecSrc(struct mixer* mix, unsigned mask) int mixer; BOOL ret = FALSE; - if ((mixer = open(mix->name, O_RDWR)) >= 0) + if ((mixer = open(mix->name, O_RDWR)) >= 0) { - if (ioctl(mixer, SOUND_MIXER_WRITE_RECSRC, &mask) < 0) + if (ioctl(mixer, SOUND_MIXER_WRITE_RECSRC, &mask) < 0) { ERR("Can't write new mixer settings\n"); } @@ -391,7 +391,7 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPSA lpCaps, DWORD dwSize) struct mixer* mix; TRACE("(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize); - + if (lpCaps == NULL) return MMSYSERR_INVALPARAM; if (!(mix = MIX_Get(wDevID))) return MMSYSERR_BADDEVICEID; @@ -402,7 +402,7 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPSA lpCaps, DWORD dwSize) lpCaps->cDestinations = 2; /* speakers & record */ lpCaps->fdwSupport = 0; /* No bits defined yet */ - + return MMSYSERR_NOERROR; } @@ -410,7 +410,7 @@ static DWORD MIX_GetDevCaps(WORD wDevID, LPMIXERCAPSA lpCaps, DWORD dwSize) * MIX_GetLineInfoDst [internal] */ static DWORD MIX_GetLineInfoDst(struct mixer* mix, LPMIXERLINEA lpMl, DWORD dst) -{ +{ unsigned mask; int j; @@ -434,7 +434,7 @@ static DWORD MIX_GetLineInfoDst(struct mixer* mix, LPMIXERLINEA lpMl, DWORD dst) lpMl->dwSource = 0xFFFFFFFF; lstrcpynA(lpMl->szShortName, MIX_Labels[j], MIXER_SHORT_NAME_CHARS); lstrcpynA(lpMl->szName, MIX_Names[j], MIXER_LONG_NAME_CHARS); - + /* we have all connections found in the MIX_DevMask */ lpMl->cConnections = 0; for (j = 0; j < SOUND_MIXER_NRDEVICES; j++) @@ -470,7 +470,7 @@ static DWORD MIX_GetLineInfoSrc(struct mixer* mix, LPMIXERLINEA lpMl, DWORD idx, if (mix->ctrl[i].dwLineID == lpMl->dwLineID) lpMl->cControls++; - switch (idx) + switch (idx) { case SOUND_MIXER_SYNTH: lpMl->dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER; @@ -503,14 +503,14 @@ static DWORD MIX_GetLineInfoSrc(struct mixer* mix, LPMIXERLINEA lpMl, DWORD idx, lpMl->cChannels = 1; if (dst == 0 && WINE_CHN_SUPPORTS(mix->stereoMask, idx)) lpMl->cChannels++; - for (i = j = 0; j < SOUND_MIXER_NRDEVICES; j++) + for (i = j = 0; j < SOUND_MIXER_NRDEVICES; j++) { if (WINE_CHN_SUPPORTS(mask, j)) { if (j == idx) break; i++; } - } + } lpMl->dwSource = i; return MMSYSERR_NOERROR; } @@ -520,7 +520,7 @@ static DWORD MIX_GetLineInfoSrc(struct mixer* mix, LPMIXERLINEA lpMl, DWORD idx, */ static BOOL MIX_CheckLine(DWORD lineID) { - return ((HIWORD(lineID) < SOUND_MIXER_NRDEVICES && LOWORD(lineID) < 2) || + return ((HIWORD(lineID) < SOUND_MIXER_NRDEVICES && LOWORD(lineID) < 2) || (HIWORD(lineID) == LINEID_DST && LOWORD(lineID) < SOUND_MIXER_NRDEVICES)); } @@ -536,17 +536,17 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINEA lpMl, DWORD fdwInfo) TRACE("(%04X, %p, %lu);\n", wDevID, lpMl, fdwInfo); - if (lpMl == NULL || lpMl->cbStruct != sizeof(*lpMl)) + if (lpMl == NULL || lpMl->cbStruct != sizeof(*lpMl)) return MMSYSERR_INVALPARAM; if ((mix = MIX_Get(wDevID)) == NULL) return MMSYSERR_BADDEVICEID; - + /* FIXME: set all the variables correctly... the lines below * are very wrong... */ lpMl->fdwLine = MIXERLINE_LINEF_ACTIVE; lpMl->dwUser = 0; - - switch (fdwInfo & MIXER_GETLINEINFOF_QUERYMASK) + + switch (fdwInfo & MIXER_GETLINEINFOF_QUERYMASK) { case MIXER_GETLINEINFOF_DESTINATION: TRACE("DESTINATION (%08lx)\n", lpMl->dwDestination); @@ -564,7 +564,7 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINEA lpMl, DWORD fdwInfo) default: return MMSYSERR_INVALPARAM; } i = lpMl->dwSource; - for (j = 0; j < SOUND_MIXER_NRDEVICES; j++) + for (j = 0; j < SOUND_MIXER_NRDEVICES; j++) { if (WINE_CHN_SUPPORTS(mask, j) && (i-- == 0)) break; @@ -588,7 +588,7 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINEA lpMl, DWORD fdwInfo) break; case MIXER_GETLINEINFOF_COMPONENTTYPE: TRACE("COMPONENT TYPE (%08lx)\n", lpMl->dwComponentType); - switch (lpMl->dwComponentType) + switch (lpMl->dwComponentType) { case MIXERLINE_COMPONENTTYPE_DST_SPEAKERS: ret = MIX_GetLineInfoDst(mix, lpMl, 0); @@ -626,14 +626,14 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINEA lpMl, DWORD fdwInfo) WARN("Unknown flag (%08lx)\n", fdwInfo & MIXER_GETLINEINFOF_QUERYMASK); break; } - + lpMl->Target.dwType = MIXERLINE_TARGETTYPE_AUX; /* FIXME */ lpMl->Target.dwDeviceID = 0xFFFFFFFF; lpMl->Target.wMid = WINE_MIXER_MANUF_ID; lpMl->Target.wPid = WINE_MIXER_PRODUCT_ID; lpMl->Target.vDriverVersion = WINE_MIXER_VERSION; strcpy(lpMl->Target.szPname, WINE_MIXER_NAME); - + return ret; } @@ -655,21 +655,21 @@ static DWORD MIX_GetLineControls(WORD wDevID, LPMIXERLINECONTROLSA lpMlc, DWORD struct mixer* mix; TRACE("(%04X, %p, %lu);\n", wDevID, lpMlc, flags); - + if (lpMlc == NULL) return MMSYSERR_INVALPARAM; if (lpMlc->cbStruct < sizeof(*lpMlc) || lpMlc->cbmxctrl < sizeof(MIXERCONTROLA)) return MMSYSERR_INVALPARAM; if ((mix = MIX_Get(wDevID)) == NULL) return MMSYSERR_BADDEVICEID; - switch (flags & MIXER_GETLINECONTROLSF_QUERYMASK) + switch (flags & MIXER_GETLINECONTROLSF_QUERYMASK) { case MIXER_GETLINECONTROLSF_ALL: { int i, j; TRACE("line=%08lx GLCF_ALL (%ld)\n", lpMlc->dwLineID, lpMlc->cControls); - + for (i = j = 0; i < mix->numCtrl; i++) { if (mix->ctrl[i].dwLineID == lpMlc->dwLineID) @@ -677,7 +677,7 @@ static DWORD MIX_GetLineControls(WORD wDevID, LPMIXERLINECONTROLSA lpMlc, DWORD } if (!j || lpMlc->cControls != j) dwRet = MMSYSERR_INVALPARAM; else if (!MIX_CheckLine(lpMlc->dwLineID)) dwRet = MIXERR_INVALLINE; - else + else { for (i = j = 0; i < mix->numCtrl; i++) { @@ -702,7 +702,7 @@ static DWORD MIX_GetLineControls(WORD wDevID, LPMIXERLINECONTROLSA lpMlc, DWORD case MIXER_GETLINECONTROLSF_ONEBYTYPE: TRACE("line=%08lx GLCF_ONEBYTYPE (%lx)\n", lpMlc->dwLineID, lpMlc->u.dwControlType); if (!MIX_CheckLine(lpMlc->dwLineID)) dwRet = MIXERR_INVALLINE; - else + else { int i; DWORD ct = lpMlc->u.dwControlType & MIXERCONTROL_CT_CLASS_MASK; @@ -735,13 +735,13 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO DWORD ret = MMSYSERR_NOTSUPPORTED; DWORD c, chnl; struct mixer* mix; - + TRACE("(%04X, %p, %lu);\n", wDevID, lpmcd, fdwDetails); - + if (lpmcd == NULL) return MMSYSERR_INVALPARAM; if ((mix = MIX_Get(wDevID)) == NULL) return MMSYSERR_BADDEVICEID; - switch (fdwDetails & MIXER_GETCONTROLDETAILSF_QUERYMASK) + switch (fdwDetails & MIXER_GETCONTROLDETAILSF_QUERYMASK) { case MIXER_GETCONTROLDETAILSF_VALUE: TRACE("GCD VALUE (%08lx)\n", lpmcd->dwControlID); @@ -749,9 +749,9 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO { c = lpmcd->dwControlID - 1; chnl = HIWORD(mix->ctrl[c].dwLineID); - if (chnl == LINEID_DST) + if (chnl == LINEID_DST) chnl = LOWORD(mix->ctrl[c].dwLineID) ? SOUND_MIXER_RECLEV : SOUND_MIXER_VOLUME; - switch (mix->ctrl[c].ctrl.dwControlType) + switch (mix->ctrl[c].ctrl.dwControlType) { case MIXERCONTROL_CONTROLTYPE_VOLUME: { @@ -762,8 +762,8 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO /* return value is 00RL (4 bytes)... */ if ((val = mix->volume[chnl]) == -1 && !MIX_GetVal(mix, chnl, &val)) return MMSYSERR_INVALPARAM; - - switch (lpmcd->cChannels) + + switch (lpmcd->cChannels) { case 1: /* mono... so R = L */ @@ -788,7 +788,7 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO case MIXERCONTROL_CONTROLTYPE_ONOFF: { LPMIXERCONTROLDETAILS_BOOLEAN mcdb; - + TRACE(" <> %u %lu\n", sizeof(MIXERCONTROLDETAILS_BOOLEAN), lpmcd->cbDetails); /* we mute both channels at the same time */ mcdb = (LPMIXERCONTROLDETAILS_BOOLEAN)lpmcd->paDetails; @@ -808,7 +808,7 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO WARN("mixer device not available !\n"); ret = MMSYSERR_ERROR; } - else + else { LPMIXERCONTROLDETAILS_BOOLEAN mcdb; int i, j; @@ -820,7 +820,7 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO { if (WINE_CHN_SUPPORTS(mix->recMask, j)) { - if (i >= lpmcd->u.cMultipleItems) + if (i >= lpmcd->u.cMultipleItems) return MMSYSERR_INVALPARAM; mcdb[i++].fValue = WINE_CHN_SUPPORTS(mask, j); } @@ -833,7 +833,7 @@ static DWORD MIX_GetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO } ret = MMSYSERR_NOERROR; } - else + else { ret = MMSYSERR_INVALPARAM; } @@ -883,13 +883,13 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO DWORD c, chnl; int val; struct mixer* mix; - + TRACE("(%04X, %p, %lu);\n", wDevID, lpmcd, fdwDetails); - + if (lpmcd == NULL) return MMSYSERR_INVALPARAM; if ((mix = MIX_Get(wDevID)) == NULL) return MMSYSERR_BADDEVICEID; - - switch (fdwDetails & MIXER_GETCONTROLDETAILSF_QUERYMASK) + + switch (fdwDetails & MIXER_GETCONTROLDETAILSF_QUERYMASK) { case MIXER_GETCONTROLDETAILSF_VALUE: TRACE("GCD VALUE (%08lx)\n", lpmcd->dwControlID); @@ -897,18 +897,18 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO { c = lpmcd->dwControlID - 1; chnl = HIWORD(mix->ctrl[c].dwLineID); - if (chnl == LINEID_DST) + if (chnl == LINEID_DST) chnl = LOWORD(mix->ctrl[c].dwLineID) ? SOUND_MIXER_RECLEV : SOUND_MIXER_VOLUME; - switch (mix->ctrl[c].ctrl.dwControlType) + switch (mix->ctrl[c].ctrl.dwControlType) { case MIXERCONTROL_CONTROLTYPE_VOLUME: { LPMIXERCONTROLDETAILS_UNSIGNED mcdu; - + TRACE(" <> %u %lu\n", sizeof(MIXERCONTROLDETAILS_UNSIGNED), lpmcd->cbDetails); /* val should contain 00RL */ - switch (lpmcd->cChannels) + switch (lpmcd->cChannels) { case 1: /* mono... so R = L */ @@ -929,13 +929,13 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO WARN("Unknown cChannels (%ld)\n", lpmcd->cChannels); return MMSYSERR_INVALPARAM; } - - if (mix->volume[chnl] == -1) + + if (mix->volume[chnl] == -1) { if (!MIX_SetVal(mix, chnl, val)) return MMSYSERR_INVALPARAM; } - else + else { mix->volume[chnl] = val; } @@ -946,17 +946,17 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO case MIXERCONTROL_CONTROLTYPE_ONOFF: { LPMIXERCONTROLDETAILS_BOOLEAN mcdb; - + TRACE(" <> %u %lu\n", sizeof(MIXERCONTROLDETAILS_BOOLEAN), lpmcd->cbDetails); mcdb = (LPMIXERCONTROLDETAILS_BOOLEAN)lpmcd->paDetails; - if (mcdb->fValue) + if (mcdb->fValue) { if (!MIX_GetVal(mix, chnl, &mix->volume[chnl]) || !MIX_SetVal(mix, chnl, 0)) return MMSYSERR_INVALPARAM; - } - else + } + else { - if (mix->volume[chnl] == -1) + if (mix->volume[chnl] == -1) { ret = MMSYSERR_NOERROR; break; @@ -984,7 +984,7 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO if (WINE_CHN_SUPPORTS(mix->recMask, j) && mcdb[i++].fValue) { /* a mux can only select one line at a time... */ - if (mix->singleRecChannel && mask != 0) + if (mix->singleRecChannel && mask != 0) { FIXME("!!!\n"); return MMSYSERR_INVALPARAM; @@ -994,7 +994,7 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO } if (i != lpmcd->u.cMultipleItems) FIXME("bad count\n"); TRACE("writing %04x as rec src\n", mask); - if (!MIX_SetRecSrc(mix, mask)) + if (!MIX_SetRecSrc(mix, mask)) ERR("Can't write new mixer settings\n"); else ret = MMSYSERR_NOERROR; @@ -1017,10 +1017,10 @@ static DWORD MIX_Init(void) int mixer; #define MIXER_DEV "/dev/mixer" - if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) + if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { - if (errno == ENODEV || errno == ENXIO) - { + if (errno == ENODEV || errno == ENXIO) + { /* no driver present */ return MMSYSERR_NODRIVER; } @@ -1048,13 +1048,13 @@ static DWORD MIX_GetNumDevs(void) /************************************************************************** * mixMessage (WINEOSS.3) */ -DWORD WINAPI OSS_mixMessage(UINT wDevID, UINT wMsg, DWORD dwUser, +DWORD WINAPI OSS_mixMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { /* TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); */ - + #ifdef HAVE_OSS - switch (wMsg) + switch (wMsg) { case DRVM_INIT: return MIX_Init(); @@ -1063,7 +1063,7 @@ DWORD WINAPI OSS_mixMessage(UINT wDevID, UINT wMsg, DWORD dwUser, case DRVM_DISABLE: /* FIXME: Pretend this is supported */ return 0; - case MXDM_GETDEVCAPS: + case MXDM_GETDEVCAPS: return MIX_GetDevCaps(wDevID, (LPMIXERCAPSA)dwParam1, dwParam2); case MXDM_GETLINEINFO: return MIX_GetLineInfo(wDevID, (LPMIXERLINEA)dwParam1, dwParam2); diff --git a/dlls/winmm/wineoss/mmaux.c b/dlls/winmm/wineoss/mmaux.c index 6cbad782e1b..d2b987b55aa 100644 --- a/dlls/winmm/wineoss/mmaux.c +++ b/dlls/winmm/wineoss/mmaux.c @@ -37,11 +37,11 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(mmaux); - + #ifdef HAVE_OSS #define MIXER_DEV "/dev/mixer" - + static int NumDev = 6; /*-----------------------------------------------------------------------*/ @@ -66,7 +66,7 @@ static int AUXDRV_Init(void) static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPSA lpCaps, DWORD dwSize) { int mixer,volume; - + TRACE("(%04X, %p, %lu);\n", wDevID, lpCaps, dwSize); if (lpCaps == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { @@ -133,7 +133,7 @@ static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPSA lpCaps, DWORD dwSize) static DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol) { int mixer, volume, left, right, cmd; - + TRACE("(%04X, %p);\n", wDevID, lpdwVol); if (lpdwVol == NULL) return MMSYSERR_NOTENABLED; if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { @@ -189,18 +189,18 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam) int mixer; int volume, left, right; int cmd; - + TRACE("(%04X, %08lX);\n", wDevID, dwParam); - + left = (LOWORD(dwParam) * 100) >> 16; right = (HIWORD(dwParam) * 100) >> 16; volume = (right << 8) | left; - + if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) { WARN("mixer device not available !\n"); return MMSYSERR_NOTENABLED; } - + switch(wDevID) { case 0: TRACE("SOUND_MIXER_WRITE_PCM !\n"); @@ -243,10 +243,10 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam) /************************************************************************** * auxMessage (WINEOSS.2) */ -DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD dwUser, +DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) { - TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", + TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); #ifdef HAVE_OSS diff --git a/dlls/winmm/wineoss/oss.c b/dlls/winmm/wineoss/oss.c index 8d5368b267c..78e6ebd1b01 100644 --- a/dlls/winmm/wineoss/oss.c +++ b/dlls/winmm/wineoss/oss.c @@ -1,5 +1,5 @@ /* -*- tab-width: 8; c-basic-offset: 4 -*- */ -/* +/* * Wine Driver for Open Sound System * * Copyright 1999 Eric Pouech @@ -33,20 +33,20 @@ static struct WINE_OSS* oss = NULL; /************************************************************************** - * OSS_drvOpen [internal] + * OSS_drvOpen [internal] */ static DWORD OSS_drvOpen(LPSTR str) { if (oss) return 0; - + /* I know, this is ugly, but who cares... */ oss = (struct WINE_OSS*)1; return 1; } /************************************************************************** - * OSS_drvClose [internal] + * OSS_drvClose [internal] */ static DWORD OSS_drvClose(DWORD dwDevID) { @@ -63,17 +63,17 @@ static DWORD OSS_drvClose(DWORD dwDevID) /************************************************************************** * DriverProc (WINEOSS.1) */ -LONG CALLBACK OSS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, +LONG CALLBACK OSS_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg, DWORD dwParam1, DWORD dwParam2) { /* EPP TRACE("(%08lX, %04X, %08lX, %08lX, %08lX)\n", */ /* EPP dwDevID, hDriv, wMsg, dwParam1, dwParam2); */ - + switch(wMsg) { #ifdef HAVE_OSS - case DRV_LOAD: OSS_WaveInit(); + case DRV_LOAD: OSS_WaveInit(); #ifdef HAVE_OSS_MIDI - OSS_MidiInit(); + OSS_MidiInit(); #endif return 1; case DRV_FREE: return 1; diff --git a/dlls/winmm/wineoss/oss.h b/dlls/winmm/wineoss/oss.h index de55cd9074b..5334bbec62f 100644 --- a/dlls/winmm/wineoss/oss.h +++ b/dlls/winmm/wineoss/oss.h @@ -17,9 +17,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __WINE_CONFIG_H -# error You must include config.h to use this header -#endif +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif #if defined(HAVE_SYS_SOUNDCARD_H) # include diff --git a/dlls/winsock/async.c b/dlls/winsock/async.c index 50b282b1d34..c773605394c 100644 --- a/dlls/winsock/async.c +++ b/dlls/winsock/async.c @@ -1,5 +1,5 @@ /* Async WINSOCK DNS services - * + * * Copyright (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka. * Copyright (C) 1999 Marcus Meissner * @@ -20,7 +20,7 @@ * NOTE: If you make any changes to fix a particular app, make sure * they don't break something else like Netscape or telnet and ftp * clients and servers (www.winsite.com got a lot of those). - * + * * FIXME: * - Add WSACancel* and correct handle management. (works rather well for * now without it.) @@ -32,7 +32,7 @@ * - This implementation did ignore the "NOTE:" section above (since the * whole stuff did not work anyway to other changes). */ - + #include "config.h" #include "wine/port.h" @@ -139,14 +139,14 @@ static int list_size(char** l, int item_size) { int i,j = 0; if(l) - { for(i=0;l[i];i++) + { for(i=0;l[i];i++) j += (item_size) ? item_size : strlen(l[i]) + 1; j += (i + 1) * sizeof(char*); } return j; } static int list_dup(char** l_src, char* ref, char* base, int item_size) -{ +{ /* base is either either equal to ref or 0 or SEGPTR */ char* p = ref; @@ -169,9 +169,9 @@ static int hostent_size(struct hostent* p_he) { int size = 0; if( p_he ) - { size = sizeof(struct hostent); + { size = sizeof(struct hostent); size += strlen(p_he->h_name) + 1; - size += list_size(p_he->h_aliases, 0); + size += list_size(p_he->h_aliases, 0); size += list_size(p_he->h_addr_list, p_he->h_length ); } return size; } @@ -204,7 +204,7 @@ static int WS_copy_he(char *p_to,char *p_base,int t_size,struct hostent* p_he, i if (flag & AQ_WIN16) { - p_to16->h_addrtype = (INT16)p_he->h_addrtype; + 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)); @@ -212,7 +212,7 @@ static int WS_copy_he(char *p_to,char *p_base,int t_size,struct hostent* p_he, i } else { - p_to32->h_addrtype = p_he->h_addrtype; + p_to32->h_addrtype = p_he->h_addrtype; p_to32->h_length = p_he->h_length; p_to32->h_name = (p_base + (p_name - p_to)); p_to32->h_aliases = (char **)(p_base + (p_aliases - p_to)); @@ -262,13 +262,13 @@ static int WS_copy_pe(char *p_to,char *p_base,int t_size,struct protoent* p_pe, { 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)); + p_to16->p_aliases = (SEGPTR)((p_base) + (p_aliases - p_to)); } else { 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)); + p_to32->p_aliases = (char **)((p_base) + (p_aliases - p_to)); } return size; @@ -298,7 +298,7 @@ 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_WIN16) ? sizeof(struct ws_servent16) : sizeof(struct WS_servent) - sizeof(struct servent) ); @@ -319,14 +319,14 @@ static int WS_copy_se(char *p_to,char *p_base,int t_size,struct servent* p_se, i 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)); + p_to16->s_aliases = (SEGPTR)(p_base + (p_aliases - p_to)); } else { 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)); + p_to32->s_aliases = (char **)(p_base + (p_aliases - p_to)); } return size; @@ -369,7 +369,7 @@ typedef struct _async_query { * It is either called as a thread startup routine or directly. It has * to free the passed arg from the process heap and PostMessageA the async * result or the error code. - * + * * FIXME: * - errorhandling not verified. */ @@ -390,7 +390,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { int locerr = ENOBUFS; he = NULL; extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ; - while(extrabuf) { + while(extrabuf) { int res = (aq->flags & AQ_NAME) ? gethostbyname_r(aq->host_name, &hostentry, extrabuf, ebufsize, &he, &locerr): @@ -427,7 +427,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { char *copy_protoent = targetptr; EnterCriticalSection( &csWSgetXXXbyYYY ); pe = (aq->flags & AQ_NAME)? - getprotobyname(aq->proto_name) : + getprotobyname(aq->proto_name) : getprotobynumber(aq->proto_number); if (pe) { size = WS_copy_pe(copy_protoent,(char*)aq->sbuf,aq->sbuflen,pe,aq->flags); @@ -452,7 +452,7 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { char *copy_servent = targetptr; EnterCriticalSection( &csWSgetXXXbyYYY ); se = (aq->flags & AQ_NAME)? - getservbyname(aq->serv_name,aq->serv_proto) : + getservbyname(aq->serv_name,aq->serv_proto) : getservbyport(aq->serv_port,aq->serv_proto); if (se) { size = WS_copy_se(copy_servent,(char*)aq->sbuf,aq->sbuflen,se,aq->flags); @@ -464,11 +464,11 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { if (aq->flags & AQ_NAME) MESSAGE("service %s protocol %s not found; You might want to add " "this to /etc/services\n", debugstr_a(aq->serv_name) , - aq->serv_proto ? debugstr_a(aq->serv_proto ):"*"); + aq->serv_proto ? debugstr_a(aq->serv_proto ):"*"); else MESSAGE("service on port %d protocol %s not found; You might want to add " "this to /etc/services\n", aq->serv_port, - aq->serv_proto ? debugstr_a(aq->serv_proto ):"*"); + aq->serv_proto ? debugstr_a(aq->serv_proto ):"*"); fail = WSANO_DATA; } LeaveCriticalSection( &csWSgetXXXbyYYY ); @@ -481,8 +481,8 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { } /**************************************************************************** - * The main async help function. - * + * The main async help function. + * * It either starts a thread or just calls the function directly for platforms * with no thread support. This relies on the fact that PostMessage() does * not actually call the windowproc before the function returns. @@ -490,34 +490,34 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) { static HANDLE16 __WSAsyncDBQuery( HWND hWnd, UINT uMsg,INT int1,LPCSTR ptr1, INT int2, LPCSTR ptr2, void *sbuf, INT sbuflen, UINT flags -) +) { async_query* aq; char* pto; LPCSTR pfm; int xbuflen = 0; - + /* allocate buffer to copy protocol- and service name to */ /* note: this is done in the calling thread so we can return */ /* a decent error code if the Alloc fails */ - + switch (flags & AQ_MASKPTR1) { case 0: break; case AQ_COPYPTR1: xbuflen += int1; break; case AQ_DUPLOWPTR1: xbuflen += strlen(ptr1) + 1; break; } - + switch (flags & AQ_MASKPTR2) { case 0: break; case AQ_COPYPTR2: xbuflen += int2; break; case AQ_DUPLOWPTR2: xbuflen += strlen(ptr2) + 1; break; } - + if(!(aq = HeapAlloc(GetProcessHeap(),0,sizeof(async_query) + xbuflen))) { SetLastError(WSAEWOULDBLOCK); /* insufficient resources */ return 0; } - + pto = aq->xbuf; if (ptr1) switch (flags & AQ_MASKPTR1) { case 0: break; @@ -576,22 +576,22 @@ HANDLE WINAPI WSAAsyncGetHostByAddr(HWND hWnd, UINT uMsg, LPCSTR addr, /*********************************************************************** * WSAAsyncGetHostByName (WINSOCK.103) */ -HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, +HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, SEGPTR sbuf, INT16 buflen) { - TRACE("hwnd %04x, msg %04x, host %s, buffer %i\n", + TRACE("hwnd %04x, msg %04x, host %s, buffer %i\n", hWnd, uMsg, (name)?name:"", (int)buflen ); return __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,(void*)sbuf,buflen, AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN16|AQ_GETHOST); -} +} /*********************************************************************** * WSAAsyncGetHostByName (WS2_32.103) */ -HANDLE WINAPI WSAAsyncGetHostByName(HWND hWnd, UINT uMsg, LPCSTR name, +HANDLE WINAPI WSAAsyncGetHostByName(HWND hWnd, UINT uMsg, LPCSTR name, LPSTR sbuf, INT buflen) { - TRACE("hwnd %04x, msg %08x, host %s, buffer %i\n", + TRACE("hwnd %04x, msg %08x, host %s, buffer %i\n", (HWND16)hWnd, uMsg, (name)?name:"", (int)buflen ); return __WSAsyncDBQuery(hWnd,uMsg,0,name,0,NULL,sbuf,buflen, AQ_NAME|AQ_DUPLOWPTR1|AQ_WIN32|AQ_GETHOST); @@ -600,7 +600,7 @@ HANDLE WINAPI WSAAsyncGetHostByName(HWND hWnd, UINT uMsg, LPCSTR name, /*********************************************************************** * WSAAsyncGetProtoByName (WINSOCK.105) */ -HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, +HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, SEGPTR sbuf, INT16 buflen) { TRACE("hwnd %04x, msg %08x, protocol %s\n", @@ -647,7 +647,7 @@ HANDLE WINAPI WSAAsyncGetProtoByNumber(HWND hWnd, UINT uMsg, INT number, /*********************************************************************** * WSAAsyncGetServByName (WINSOCK.107) */ -HANDLE16 WINAPI WSAAsyncGetServByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, +HANDLE16 WINAPI WSAAsyncGetServByName16(HWND16 hWnd, UINT16 uMsg, LPCSTR name, LPCSTR proto, SEGPTR sbuf, INT16 buflen) { TRACE("hwnd %04x, msg %04x, name %s, proto %s\n", @@ -671,7 +671,7 @@ HANDLE WINAPI WSAAsyncGetServByName(HWND hWnd, UINT uMsg, LPCSTR name, /*********************************************************************** * WSAAsyncGetServByPort (WINSOCK.106) */ -HANDLE16 WINAPI WSAAsyncGetServByPort16(HWND16 hWnd, UINT16 uMsg, INT16 port, +HANDLE16 WINAPI WSAAsyncGetServByPort16(HWND16 hWnd, UINT16 uMsg, INT16 port, LPCSTR proto, SEGPTR sbuf, INT16 buflen) { TRACE("hwnd %04x, msg %04x, port %i, proto %s\n", diff --git a/dlls/winsock/socket.c b/dlls/winsock/socket.c index 3b199958896..7cd7643b10f 100644 --- a/dlls/winsock/socket.c +++ b/dlls/winsock/socket.c @@ -1,7 +1,7 @@ /* * based on Windows Sockets 1.1 specs * (ftp.microsoft.com:/Advsys/winsock/spec11/WINSOCK.TXT) - * + * * Copyright (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka. * * This library is free software; you can redistribute it and/or @@ -18,8 +18,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * NOTE: If you make any changes to fix a particular app, make sure - * they don't break something else like Netscape or telnet and ftp + * NOTE: If you make any changes to fix a particular app, make sure + * they don't break something else like Netscape or telnet and ftp * clients and servers (www.winsite.com got a lot of those). */ @@ -188,12 +188,12 @@ typedef struct /* WSAAsyncSelect() control struct */ HWND hWnd; UINT uMsg; LONG lEvent; -} ws_select_info; +} ws_select_info; #define WS_MAX_SOCKETS_PER_PROCESS 128 /* reasonable guess */ #define WS_MAX_UDP_DATAGRAM 1024 -#define PROCFS_NETDEV_FILE "/proc/net/dev" /* Points to the file in the /proc fs +#define PROCFS_NETDEV_FILE "/proc/net/dev" /* Points to the file in the /proc fs that lists the network devices. Do we need an #ifdef LINUX for this? */ @@ -222,7 +222,7 @@ int WSAIOCTL_GetInterfaceName(int intNumber, char *intName); UINT16 wsaErrno(void); UINT16 wsaHerrno(int errnr); - + static HANDLE _WSHeap = 0; #define WS_ALLOC(size) \ @@ -495,8 +495,8 @@ static fd_set* fd_set_import( fd_set* fds, void* wsfds, int* highfd, int lfd[], { /* translate Winsock fd set into local fd set */ - if( wsfds ) - { + if( wsfds ) + { #define wsfds16 ((ws_fd_set16*)wsfds) #define wsfds32 ((WS_fd_set*)wsfds) int i, count; @@ -628,7 +628,7 @@ void __ws_memfree(void* ptr) } -/* ----------------------------------- API ----- +/* ----------------------------------- API ----- * * Init / cleanup / error checking. */ @@ -860,8 +860,8 @@ static struct ws_protoent* check_buffer_pe(int size) /**********************************************************************/ -/* Returns the converted address if successful, NULL if it was too small to - * start with. Note that the returned pointer may be the original pointer +/* Returns the converted address if successful, NULL if it was too small to + * start with. Note that the returned pointer may be the original pointer * if no conversion is necessary. */ static const struct sockaddr* ws_sockaddr_ws2u(const struct WS_sockaddr* wsaddr, int wsaddrlen, int *uaddrlen) @@ -881,7 +881,7 @@ static const struct sockaddr* ws_sockaddr_ws2u(const struct WS_sockaddr* wsaddr, uipx=malloc(*uaddrlen); uipx->sipx_family=AF_IPX; uipx->sipx_port=wsipx->sa_socket; - /* copy sa_netnum and sa_nodenum to sipx_network and sipx_node + /* copy sa_netnum and sa_nodenum to sipx_network and sipx_node * in one go */ memcpy(&uipx->sipx_network,wsipx->sa_netnum,sizeof(uipx->sipx_network)+sizeof(uipx->sipx_node)); @@ -976,7 +976,7 @@ static int ws_sockaddr_u2ws(const struct sockaddr* uaddr, int uaddrlen, struct W return res; } -/* to be called to free the memory allocated by ws_sockaddr_ws2u or +/* to be called to free the memory allocated by ws_sockaddr_ws2u or * ws_sockaddr_alloc */ inline void ws_sockaddr_free(const struct sockaddr* uaddr, const struct WS_sockaddr* wsaddr) @@ -1758,7 +1758,7 @@ INT16 WINAPI WINSOCK_getsockname16(SOCKET16 s, struct WS_sockaddr *name, /*********************************************************************** * getsockopt (WS2_32.7) */ -INT WINAPI WS_getsockopt(SOCKET s, INT level, +INT WINAPI WS_getsockopt(SOCKET s, INT level, INT optname, char *optval, INT *optlen) { int fd; @@ -1869,8 +1869,8 @@ u_short WINAPI WS_ntohs(u_short netshort) */ char* WINAPI WS_inet_ntoa(struct WS_in_addr in) { - /* use "buffer for dummies" here because some applications have - * propensity to decode addresses in ws_hostent structure without + /* use "buffer for dummies" here because some applications have + * propensity to decode addresses in ws_hostent structure without * saving them first... */ static char dbuffer[16]; /* Yes, 16: 4*3 digits + 3 '.' + 1 '\0' */ @@ -1925,11 +1925,11 @@ INT WINAPI WSAIoctl (SOCKET s, int i, numInt; struct ifreq ifInfo; char ifName[512]; - + TRACE ("-> SIO_GET_INTERFACE_LIST request\n"); - - numInt = WSAIOCTL_GetInterfaceCount(); + + numInt = WSAIOCTL_GetInterfaceCount(); if (numInt < 0) { ERR ("Unable to open /proc filesystem to determine number of network interfaces!\n"); @@ -1937,7 +1937,7 @@ INT WINAPI WSAIoctl (SOCKET s, WSASetLastError(WSAEINVAL); return (SOCKET_ERROR); } - + for (i=0; iiiAddress.AddressIn.sin_family = AF_INET; intArray->iiAddress.AddressIn.sin_port = ipTemp->sin_port; intArray->iiAddress.AddressIn.sin_addr.WS_s_addr = ipTemp->sin_addr.S_un.S_addr; } - + /* Broadcast Address */ strcpy (ifInfo.ifr_name, ifName); if (ioctl(fd, SIOCGIFBRDADDR, &ifInfo) < 0) @@ -1980,10 +1980,10 @@ INT WINAPI WSAIoctl (SOCKET s, else { struct WS_sockaddr_in *ipTemp = (struct WS_sockaddr_in *)&ifInfo.ifr_broadaddr; - - intArray->iiBroadcastAddress.AddressIn.sin_family = AF_INET; + + intArray->iiBroadcastAddress.AddressIn.sin_family = AF_INET; intArray->iiBroadcastAddress.AddressIn.sin_port = ipTemp->sin_port; - intArray->iiBroadcastAddress.AddressIn.sin_addr.WS_s_addr = ipTemp->sin_addr.S_un.S_addr; + intArray->iiBroadcastAddress.AddressIn.sin_addr.WS_s_addr = ipTemp->sin_addr.S_un.S_addr; } /* Subnet Mask */ @@ -2001,29 +2001,29 @@ INT WINAPI WSAIoctl (SOCKET s, (Linux, FreeBSD, Solaris...) */ #ifndef ifr_netmask #ifndef ifr_addr - intArray->iiNetmask.AddressIn.sin_family = AF_INET; + intArray->iiNetmask.AddressIn.sin_family = AF_INET; intArray->iiNetmask.AddressIn.sin_port = 0; - intArray->iiNetmask.AddressIn.sin_addr.WS_s_addr = 0; + intArray->iiNetmask.AddressIn.sin_addr.WS_s_addr = 0; ERR ("Unable to determine Netmask on your platform!\n"); #else struct WS_sockaddr_in *ipTemp = (struct WS_sockaddr_in *)&ifInfo.ifr_addr; - - intArray->iiNetmask.AddressIn.sin_family = AF_INET; + + intArray->iiNetmask.AddressIn.sin_family = AF_INET; intArray->iiNetmask.AddressIn.sin_port = ipTemp->sin_port; - intArray->iiNetmask.AddressIn.sin_addr.WS_s_addr = ipTemp->sin_addr.S_un.S_addr; + intArray->iiNetmask.AddressIn.sin_addr.WS_s_addr = ipTemp->sin_addr.S_un.S_addr; #endif #else struct WS_sockaddr_in *ipTemp = (struct WS_sockaddr_in *)&ifInfo.ifr_netmask; - - intArray->iiNetmask.AddressIn.sin_family = AF_INET; + + intArray->iiNetmask.AddressIn.sin_family = AF_INET; intArray->iiNetmask.AddressIn.sin_port = ipTemp->sin_port; - intArray->iiNetmask.AddressIn.sin_addr.WS_s_addr = ipTemp->sin_addr.S_un.S_addr; + intArray->iiNetmask.AddressIn.sin_addr.WS_s_addr = ipTemp->sin_addr.S_un.S_addr; #endif } - + /* Socket Status Flags */ strcpy(ifInfo.ifr_name, ifName); - if (ioctl(fd, SIOCGIFFLAGS, &ifInfo) < 0) + if (ioctl(fd, SIOCGIFFLAGS, &ifInfo) < 0) { ERR ("Error obtaining status flags for socket!\n"); close(fd); @@ -2037,7 +2037,7 @@ INT WINAPI WSAIoctl (SOCKET s, } intArray++; /* Prepare for another interface */ } - + /* Calculate the size of the array being returned */ *lpcbBytesReturned = sizeof(INTERFACE_INFO) * numInt; break; @@ -2054,7 +2054,7 @@ INT WINAPI WSAIoctl (SOCKET s, /* Function executed with no errors */ close(fd); - return (0); + return (0); } else { @@ -2064,7 +2064,7 @@ INT WINAPI WSAIoctl (SOCKET s, } -/* +/* Helper function for WSAIoctl - Get count of the number of interfaces by parsing /proc filesystem. */ @@ -2073,21 +2073,21 @@ int WSAIOCTL_GetInterfaceCount(void) FILE *procfs; char buf[512]; /* Size doesn't matter, something big */ int intcnt=0; - - - /* Open /proc filesystem file for network devices */ + + + /* Open /proc filesystem file for network devices */ procfs = fopen(PROCFS_NETDEV_FILE, "r"); - if (!procfs) + if (!procfs) { /* If we can't open the file, return an error */ return (-1); } - + /* Omit first two lines, they are only headers */ - fgets(buf, sizeof buf, procfs); + fgets(buf, sizeof buf, procfs); fgets(buf, sizeof buf, procfs); - while (fgets(buf, sizeof buf, procfs)) + while (fgets(buf, sizeof buf, procfs)) { /* Each line in the file represents a network interface */ intcnt++; @@ -2108,16 +2108,16 @@ int WSAIOCTL_GetInterfaceName(int intNumber, char *intName) char buf[512]; /* Size doesn't matter, something big */ int i; - /* Open /proc filesystem file for network devices */ + /* Open /proc filesystem file for network devices */ procfs = fopen(PROCFS_NETDEV_FILE, "r"); - if (!procfs) + if (!procfs) { /* If we can't open the file, return an error */ return (-1); } - + /* Omit first two lines, they are only headers */ - fgets(buf, sizeof(buf), procfs); + fgets(buf, sizeof(buf), procfs); fgets(buf, sizeof(buf), procfs); for (i=0; ifd_count; - + TRACE("(%d,%8lx(%i))\n", s,(unsigned long)set, i); - + while (i--) if (set->fd_array[i] == s) return 1; return 0; -} +} /*********************************************************************** * __WSAFDIsSet (WS2_32.151) @@ -3452,8 +3452,8 @@ int WINAPI __WSAFDIsSet(SOCKET s, WS_fd_set *set) BOOL WINAPI WSAIsBlocking(void) { /* By default WinSock should set all its sockets to non-blocking mode - * and poll in PeekMessage loop when processing "blocking" ones. This - * function is supposed to tell if the program is in this loop. Our + * and poll in PeekMessage loop when processing "blocking" ones. This + * function is supposed to tell if the program is in this loop. Our * blocking calls are truly blocking so we always return FALSE. * * Note: It is allowed to call this function without prior WSAStartup(). @@ -3531,14 +3531,14 @@ static int list_size(char** l, int item_size) { int i,j = 0; if(l) - { for(i=0;l[i];i++) + { for(i=0;l[i];i++) j += (item_size) ? item_size : strlen(l[i]) + 1; j += (i + 1) * sizeof(char*); } return j; } static int list_dup(char** l_src, char* ref, char* base, int item_size) -{ +{ /* base is either either equal to ref or 0 or SEGPTR */ char* p = ref; @@ -3561,9 +3561,9 @@ static int hostent_size(struct hostent* p_he) { int size = 0; if( p_he ) - { size = sizeof(struct hostent); + { size = sizeof(struct hostent); size += strlen(p_he->h_name) + 1; - size += list_size(p_he->h_aliases, 0); + size += list_size(p_he->h_aliases, 0); size += list_size(p_he->h_addr_list, p_he->h_length ); } return size; } @@ -3574,8 +3574,8 @@ static int hostent_size(struct hostent* p_he) */ static int WS_dup_he(struct hostent* p_he, int flag) { - /* Convert hostent structure into ws_hostent so that the data fits - * into local_buffer. Internal pointers can be linear, SEGPTR, or + /* Convert hostent structure into ws_hostent so that the data fits + * into local_buffer. Internal pointers can be linear, SEGPTR, or * relative to local_buffer depending on "flag" value. Returns size * of the data copied. */ @@ -3606,7 +3606,7 @@ static int WS_dup_he(struct hostent* p_he, int flag) if (flag & WS_DUP_SEGPTR) /* Win16 */ { - p_to16->h_addrtype = (INT16)p_he->h_addrtype; + 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)); @@ -3615,7 +3615,7 @@ static int WS_dup_he(struct hostent* p_he, int flag) } else /* Win32 */ { - p_to32->h_addrtype = p_he->h_addrtype; + p_to32->h_addrtype = p_he->h_addrtype; p_to32->h_length = p_he->h_length; p_to32->h_name = (p_base + (p_name - p_to)); p_to32->h_aliases = (char **)(p_base + (p_aliases - p_to)); @@ -3665,14 +3665,14 @@ static int WS_dup_pe(struct protoent* p_pe, int flag) { 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)); + p_to16->p_aliases = (SEGPTR)((p_base) + (p_aliases - p_to)); size += (sizeof(struct ws_protoent16) - sizeof(struct protoent)); } else /* 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)); + p_to32->p_aliases = (char **)((p_base) + (p_aliases - p_to)); size += (sizeof(struct WS_protoent) - sizeof(struct protoent)); } } @@ -3717,7 +3717,7 @@ static int WS_dup_se(struct servent* p_se, int flag) list_dup(p_se->s_aliases, p, p_base + (p - p_to), 0); if (flag & WS_DUP_SEGPTR) /* 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)); @@ -3740,7 +3740,7 @@ static int WS_dup_se(struct servent* p_se, int flag) UINT16 wsaErrno(void) { - int loc_errno = errno; + int loc_errno = errno; WARN("errno %d, (%s).\n", loc_errno, strerror(loc_errno)); switch(loc_errno) @@ -3819,7 +3819,7 @@ UINT16 wsaHerrno(int loc_errno) case HOST_NOT_FOUND: return WSAHOST_NOT_FOUND; case TRY_AGAIN: return WSATRY_AGAIN; case NO_RECOVERY: return WSANO_RECOVERY; - case NO_DATA: return WSANO_DATA; + case NO_DATA: return WSANO_DATA; case ENOBUFS: return WSAENOBUFS; case 0: return 0; @@ -4000,26 +4000,26 @@ SOCKET WINAPI WSAAccept( SOCKET s, struct WS_sockaddr *addr, LPINT addrlen, TRACE("Socket %u, sockaddr %p, addrlen %p, fnCondition %p, dwCallbackData %ld\n", s, addr, addrlen, lpfnCondition, dwCallbackData); - + size = sizeof(src_addr); cs = WS_accept(s, &src_addr, &size); - + if (cs == SOCKET_ERROR) return SOCKET_ERROR; CallerId.buf = (char *)&src_addr; - CallerId.len = sizeof(src_addr); + CallerId.len = sizeof(src_addr); CallerData.buf = NULL; - CallerData.len = (ULONG)NULL; + CallerData.len = (ULONG)NULL; WS_getsockname(cs, &dst_addr, &size); CalleeId.buf = (char *)&dst_addr; - CalleeId.len = sizeof(dst_addr); + CalleeId.len = sizeof(dst_addr); + - ret = (*lpfnCondition)(&CallerId, &CallerData, NULL, NULL, - &CalleeId, &CalleeData, &g, dwCallbackData); + &CalleeId, &CalleeData, &g, dwCallbackData); switch (ret) { diff --git a/dlls/winspool/info.c b/dlls/winspool/info.c index f402b2c3f14..320b81ec2a0 100644 --- a/dlls/winspool/info.c +++ b/dlls/winspool/info.c @@ -1,6 +1,6 @@ -/* +/* * WINSPOOL functions - * + * * Copyright 1996 John Harvey * Copyright 1998 Andreas Mohr * Copyright 1999 Klaas van Gend @@ -76,7 +76,7 @@ static WCHAR Help_FileW[] = {'H','e','l','p',' ','F','i','l','e',0}; static WCHAR LocationW[] = {'L','o','c','a','t','i','o','n',0}; static WCHAR MonitorW[] = {'M','o','n','i','t','o','r',0}; static WCHAR NameW[] = {'N','a','m','e',0}; -static WCHAR ParametersW[] = {'P','a','r','a','m','e','t','e','r','s',0}; +static WCHAR ParametersW[] = {'P','a','r','a','m','e','t','e','r','s',0}; static WCHAR PortW[] = {'P','o','r','t',0}; static WCHAR Print_ProcessorW[] = {'P','r','i','n','t',' ','P','r','o','c','e', 's','s','o','r',0}; @@ -94,7 +94,7 @@ static BOOL WINSPOOL_GetPrinterDriver(HANDLE hPrinter, LPWSTR pEnvironment, DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded, BOOL unicode); -static void +static void WINSPOOL_SetDefaultPrinter(const char *devname, const char *name,BOOL force) { char qbuf[200]; @@ -195,15 +195,15 @@ PRINTCAP_ParseEntry(char *pent,BOOL isfirst) { isps = TRUE; } /* 2. Check if this is a remote printer. These usually are postscript - * capable + * capable */ if (strstr(pent,":rm")) { isps = TRUE; TRACE("%s is remote, assuming postscript.\n",name); } - /* 3. Check if we have an input filter program. If we have one, it + /* 3. Check if we have an input filter program. If we have one, it * most likely is one capable of converting postscript. - * (Could probably check for occurrence of 'gs' or 'ghostscript' + * (Could probably check for occurrence of 'gs' or 'ghostscript' * in the if file itself.) */ if (strstr(pent,":if=/")) { @@ -332,7 +332,7 @@ WINSPOOL_LoadSystemPrinters() { #endif /* Check for [ppd] section in config file before parsing /etc/printcap */ - + if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\ppd", &hkPPD) == ERROR_SUCCESS) { @@ -704,7 +704,7 @@ LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter, if(fMode == 0 && ret > 0) ret += (CCHDEVICENAME + CCHFORMNAME); HeapFree(GetProcessHeap(),0,pDevModeInputA); - HeapFree(GetProcessHeap(),0,pDeviceNameA); + HeapFree(GetProcessHeap(),0,pDeviceNameA); return ret; } @@ -857,7 +857,7 @@ SetPrinterW( * WritePrinter [WINSPOOL.@] */ BOOL WINAPI -WritePrinter( +WritePrinter( HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf, @@ -916,7 +916,7 @@ BOOL WINAPI AddJobW(HANDLE hPrinter, DWORD Level, LPBYTE pData, DWORD cbBuf, * * RETURNS: * the opened hkey on success - * NULL on error + * NULL on error */ static HKEY WINSPOOL_OpenDriverReg( LPVOID pEnvironment, BOOL unicode) { HKEY retval; @@ -943,7 +943,7 @@ static HKEY WINSPOOL_OpenDriverReg( LPVOID pEnvironment, BOOL unicode) case VER_PLATFORM_WIN32_NT: p = "Windows NT x86"; break; - default: + default: p = "Windows 4.0"; break; } @@ -980,7 +980,7 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter) LONG size; TRACE("(%s,%ld,%p)\n", debugstr_w(pName), Level, pPrinter); - + if(pName != NULL) { ERR("pName = %s - unsupported\n", debugstr_w(pName)); SetLastError(ERROR_INVALID_PARAMETER); @@ -1022,7 +1022,7 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter) RegCloseKey(hkeyPrinters); return 0; } - if(RegOpenKeyW(hkeyDrivers, pi->pDriverName, &hkeyDriver) != + if(RegOpenKeyW(hkeyDrivers, pi->pDriverName, &hkeyDriver) != ERROR_SUCCESS) { WARN("Can't find driver %s\n", debugstr_w(pi->pDriverName)); RegCloseKey(hkeyPrinters); @@ -1195,7 +1195,7 @@ BOOL WINAPI DeletePrinter(HANDLE hPrinter) SetLastError(ERROR_PRINTER_NOT_FOUND); /* ?? */ RegCloseKey(hkeyPrinters); return 0; - } + } ClosePrinter(hPrinter); return TRUE; @@ -1240,7 +1240,7 @@ BOOL WINAPI GetFormA(HANDLE hPrinter, LPSTR pFormName, DWORD Level, LPBYTE pForm, DWORD cbBuf, LPDWORD pcbNeeded) { FIXME("(%d,%s,%ld,%p,%ld,%p): stub\n",hPrinter,pFormName, - Level,pForm,cbBuf,pcbNeeded); + Level,pForm,cbBuf,pcbNeeded); return FALSE; } @@ -1307,7 +1307,7 @@ BOOL WINAPI ResetPrinterW(HANDLE hPrinter, LPPRINTER_DEFAULTSW pDefault) * WINSPOOL_GetDWORDFromReg * * Return DWORD associated with ValueName from hkey. - */ + */ static DWORD WINSPOOL_GetDWORDFromReg(HKEY hkey, LPCSTR ValueName) { DWORD sz = sizeof(DWORD), type, value = 0; @@ -1332,7 +1332,7 @@ static DWORD WINSPOOL_GetDWORDFromReg(HKEY hkey, LPCSTR ValueName) * Get ValueName from hkey storing result in ptr. buflen is space left in ptr * String is stored either as unicode or ascii. * Bit of a hack here to get the ValueName if we want ascii. - */ + */ static BOOL WINSPOOL_GetStringFromReg(HKEY hkey, LPCWSTR ValueName, LPBYTE ptr, DWORD buflen, DWORD *needed, BOOL unicode) @@ -1437,7 +1437,7 @@ static void WINSPOOL_GetDefaultDevMode( * * Get ValueName from hkey storing result in ptr. buflen is space left in ptr * DevMode is stored either as unicode or ascii. - */ + */ static BOOL WINSPOOL_GetDevModeFromReg(HKEY hkey, LPCWSTR ValueName, LPBYTE ptr, DWORD buflen, DWORD *needed, @@ -1609,7 +1609,7 @@ static BOOL WINSPOOL_GetPrinter_2(HKEY hkeyPrinter, PRINTER_INFO_2W *pi2, *pcbNeeded += size; } if(pi2) { - pi2->Attributes = WINSPOOL_GetDWORDFromReg(hkeyPrinter, "Attributes"); + pi2->Attributes = WINSPOOL_GetDWORDFromReg(hkeyPrinter, "Attributes"); pi2->Priority = WINSPOOL_GetDWORDFromReg(hkeyPrinter, "Priority"); pi2->DefaultPriority = WINSPOOL_GetDWORDFromReg(hkeyPrinter, "Default Priority"); @@ -1649,7 +1649,7 @@ static BOOL WINSPOOL_GetPrinter_4(HKEY hkeyPrinter, PRINTER_INFO_4W *pi4, *pcbNeeded += size; } if(pi4) { - pi4->Attributes = WINSPOOL_GetDWORDFromReg(hkeyPrinter, "Attributes"); + pi4->Attributes = WINSPOOL_GetDWORDFromReg(hkeyPrinter, "Attributes"); } if(!space && pi4) /* zero out pi4 if we can't completely fill buf */ @@ -1694,11 +1694,11 @@ static BOOL WINSPOOL_GetPrinter_5(HKEY hkeyPrinter, PRINTER_INFO_5W *pi5, *pcbNeeded += size; } if(pi5) { - pi5->Attributes = WINSPOOL_GetDWORDFromReg(hkeyPrinter, "Attributes"); + pi5->Attributes = WINSPOOL_GetDWORDFromReg(hkeyPrinter, "Attributes"); pi5->DeviceNotSelectedTimeout = WINSPOOL_GetDWORDFromReg(hkeyPrinter, - "dnsTimeout"); + "dnsTimeout"); pi5->TransmissionRetryTimeout = WINSPOOL_GetDWORDFromReg(hkeyPrinter, - "txTimeout"); + "txTimeout"); } if(!space && pi5) /* zero out pi5 if we can't completely fill buf */ @@ -1759,11 +1759,11 @@ static BOOL WINSPOOL_GetPrinter(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, needed += size; break; } - + case 4: { PRINTER_INFO_4W *pi4 = (PRINTER_INFO_4W *)pPrinter; - + size = sizeof(PRINTER_INFO_4W); if(size <= cbBuf) { ptr = pPrinter + size; @@ -1877,7 +1877,7 @@ static BOOL WINSPOOL_EnumPrinters(DWORD dwType, LPWSTR lpszName, ERR("Can't create Printers key\n"); return FALSE; } - + if(RegQueryInfoKeyA(hkeyPrinters, NULL, NULL, NULL, &number, NULL, NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) { RegCloseKey(hkeyPrinters); @@ -1911,7 +1911,7 @@ static BOOL WINSPOOL_EnumPrinters(DWORD dwType, LPWSTR lpszName, pi = (used <= cbBuf) ? lpbPrinters : NULL; for(i = 0; i < number; i++) { - if(RegEnumKeyW(hkeyPrinters, i, PrinterName, sizeof(PrinterName)) != + if(RegEnumKeyW(hkeyPrinters, i, PrinterName, sizeof(PrinterName)) != ERROR_SUCCESS) { ERR("Can't enum key number %ld\n", i); RegCloseKey(hkeyPrinters); @@ -1972,7 +1972,7 @@ static BOOL WINSPOOL_EnumPrinters(DWORD dwType, LPWSTR lpszName, return FALSE; } if(lpdwReturned) - *lpdwReturned = number; + *lpdwReturned = number; SetLastError(ERROR_SUCCESS); return TRUE; } @@ -1987,31 +1987,31 @@ static BOOL WINSPOOL_EnumPrinters(DWORD dwType, LPWSTR lpszName, * RETURNS: * * If level is set to 1: - * Not implemented yet! + * Not implemented yet! * Returns TRUE with an empty list. * * If level is set to 2: * Possible flags: PRINTER_ENUM_CONNECTIONS, PRINTER_ENUM_LOCAL. - * Returns an array of PRINTER_INFO_2 data structures in the - * lpbPrinters buffer. Note that according to MSDN also an + * Returns an array of PRINTER_INFO_2 data structures in the + * lpbPrinters buffer. Note that according to MSDN also an * OpenPrinter should be performed on every remote printer. * * If level is set to 4 (officially WinNT only): * Possible flags: PRINTER_ENUM_CONNECTIONS, PRINTER_ENUM_LOCAL. * Fast: Only the registry is queried to retrieve printer names, * no connection to the driver is made. - * Returns an array of PRINTER_INFO_4 data structures in the + * Returns an array of PRINTER_INFO_4 data structures in the * lpbPrinters buffer. * * If level is set to 5 (officially WinNT4/Win9x only): * Fast: Only the registry is queried to retrieve printer names, * no connection to the driver is made. - * Returns an array of PRINTER_INFO_5 data structures in the + * Returns an array of PRINTER_INFO_5 data structures in the * lpbPrinters buffer. * * If level set to 3 or 6+: * returns zero (failure!) - * + * * Returns nonzero (TRUE) on success, or zero on failure, use GetLastError * for information. * @@ -2019,8 +2019,8 @@ static BOOL WINSPOOL_EnumPrinters(DWORD dwType, LPWSTR lpszName, * - Only PRINTER_ENUM_LOCAL and PRINTER_ENUM_NAME are implemented. * - Only levels 2, 4 and 5 are implemented at the moment. * - 16-bit printer drivers are not enumerated. - * - Returned amount of bytes used/needed does not match the real Windoze - * implementation (as in this implementation, all strings are part + * - Returned amount of bytes used/needed does not match the real Windoze + * implementation (as in this implementation, all strings are part * of the buffer, whereas Win32 keeps them somewhere else) * - At level 2, EnumPrinters should also call OpenPrinter for remote printers. * @@ -2241,7 +2241,7 @@ static BOOL WINSPOOL_GetPrinterDriver(HANDLE hPrinter, LPWSTR pEnvironment, DWORD ret, type, size, needed = 0; LPBYTE ptr = NULL; HKEY hkeyPrinter, hkeyPrinters, hkeyDrivers; - + TRACE("(%d,%s,%ld,%p,%ld,%p)\n",hPrinter,debugstr_w(pEnvironment), Level,pDriverInfo,cbBuf, pcbNeeded); @@ -2336,7 +2336,7 @@ BOOL WINAPI GetPrinterDriverA(HANDLE hPrinter, LPSTR pEnvironment, * GetPrinterDriverW [WINSPOOL.@] */ BOOL WINAPI GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment, - DWORD Level, LPBYTE pDriverInfo, + DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded) { return WINSPOOL_GetPrinterDriver(hPrinter, pEnvironment, Level, @@ -2366,7 +2366,7 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment, } if(Level != 1) /* win95 ignores this so we just carry on */ WARN("Level = %ld - assuming 1\n", Level); - + /* FIXME should read from registry */ needed = GetSystemDirectoryA(pDriverDirectory, cbBuf); needed++; @@ -2428,7 +2428,7 @@ BOOL WINAPI AddPrinterDriverA(LPSTR pName, DWORD level, LPBYTE pDriverInfo) SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - + if(level == 3) di3 = *(DRIVER_INFO_3A *)pDriverInfo; else { @@ -2471,7 +2471,7 @@ BOOL WINAPI AddPrinterDriverA(LPSTR pName, DWORD level, LPBYTE pDriverInfo) 0); RegSetValueExA(hkeyName, "Data File", 0, REG_SZ, di3.pDataFile, 0); RegSetValueExA(hkeyName, "Driver", 0, REG_SZ, di3.pDriverPath, 0); - RegSetValueExA(hkeyName, "Version", 0, REG_DWORD, (LPSTR)&di3.cVersion, + RegSetValueExA(hkeyName, "Version", 0, REG_DWORD, (LPSTR)&di3.cVersion, sizeof(DWORD)); RegSetValueExA(hkeyName, "Datatype", 0, REG_SZ, di3.pDefaultDataType, 0); RegSetValueExA(hkeyName, "Dependent Files", 0, REG_MULTI_SZ, @@ -2486,7 +2486,7 @@ BOOL WINAPI AddPrinterDriverA(LPSTR pName, DWORD level, LPBYTE pDriverInfo) /***************************************************************************** * AddPrinterDriverW [WINSPOOL.@] */ -BOOL WINAPI AddPrinterDriverW(LPWSTR printerName,DWORD level, +BOOL WINAPI AddPrinterDriverW(LPWSTR printerName,DWORD level, LPBYTE pDriverInfo) { FIXME("(%s,%ld,%p): stub\n",debugstr_w(printerName), @@ -2500,7 +2500,7 @@ BOOL WINAPI AddPrinterDriverW(LPWSTR printerName,DWORD level, * * Displays a dialog to set the properties of the printer. * - * RETURNS + * RETURNS * nonzero on success or zero on failure * * BUGS @@ -2546,7 +2546,7 @@ BOOL WINAPI EnumJobsW(HANDLE hPrinter, DWORD FirstJob, DWORD NoJobs, /***************************************************************************** * WINSPOOL_EnumPrinterDrivers [internal] * - * Delivers information about all printer drivers installed on the + * Delivers information about all printer drivers installed on the * localhost or a given server * * RETURNS @@ -3229,7 +3229,7 @@ DWORD WINAPI EnumPrinterDataExA(HANDLE hPrinter, LPCSTR pKeyName, ret = GetLastError (); ERR ("HeapFree failed with code %li\n", ret); return ret; - } + } if (*pnEnumValues == 0) /* empty key */ return ERROR_SUCCESS; diff --git a/dlls/wsock32/protocol.c b/dlls/wsock32/protocol.c index 88f7ce3befb..c0749e33a64 100644 --- a/dlls/wsock32/protocol.c +++ b/dlls/wsock32/protocol.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* All we need are a couple constants for EnumProtocols. Once it is +/* All we need are a couple constants for EnumProtocols. Once it is * moved to ws2_32 we may no longer need it */ #define USE_WS_PREFIX @@ -196,7 +196,7 @@ static INT WSOCK32_EnterSingleProtocol( INT iProtocol, return iAnz; } -/* FIXME: EnumProtocols should be moved to winsock2, and this should be +/* FIXME: EnumProtocols should be moved to winsock2, and this should be * implemented by calling out to WSAEnumProtocols. See: * http://support.microsoft.com/support/kb/articles/Q129/3/15.asp */ diff --git a/dlls/wsock32/socket.c b/dlls/wsock32/socket.c index 79ffb521d95..53efd45f801 100644 --- a/dlls/wsock32/socket.c +++ b/dlls/wsock32/socket.c @@ -20,17 +20,17 @@ /* FIXME: This hack is fixing a problem in WsControl. When we call socket(), - * it will call into ws2_32's WSOCK32_socket (because of the redirection in + * it will call into ws2_32's WSOCK32_socket (because of the redirection in * our own .spec file). - * The problem is that socket() is predefined in a linux system header that + * The problem is that socket() is predefined in a linux system header that * we are including, which is different from the WINE definition. * (cdecl vs. stdapi). The result is stack corruption. - * Furthermore WsControl uses Unix macros and types. This forces us to include + * Furthermore WsControl uses Unix macros and types. This forces us to include * the Unix headers which then conflict with the winsock headers. This forces - * us to use USE_WS_PREFIX but then ioctlsocket is called WS_ioctlsocket, - * which causes link problems. The correct solution is to implement - * WsControl using calls to WSAIoctl. Then we should no longer need to use the - * Unix headers. This would also have the advantage of reducing code + * us to use USE_WS_PREFIX but then ioctlsocket is called WS_ioctlsocket, + * which causes link problems. The correct solution is to implement + * WsControl using calls to WSAIoctl. Then we should no longer need to use the + * Unix headers. This would also have the advantage of reducing code * duplication. * Until that happens we need this ugly hack. */ @@ -90,14 +90,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(winsock); /*********************************************************************** * WsControl (WSOCK32.1001) * - * WsControl seems to be an undocumented Win95 function. A lot of + * WsControl seems to be an undocumented Win95 function. A lot of * discussion about WsControl can be found on the net, e.g. * Subject: Re: WSOCK32.DLL WsControl Exported Function * From: "Peter Rindfuss" * Date: 1997/08/17 * * WSCNTL_TCPIP_QUERY_INFO option is partially implemeted based - * on observing the behaviour of WsControl with an app in + * on observing the behaviour of WsControl with an app in * Windows 98. It is not fully implemented, and there could * be (are?) errors due to incorrect assumptions made. * @@ -106,7 +106,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(winsock); * STATUS_BUFFER_TOO_SMALL is returned if the output buffer length * (*pcbResponseInfoLen) is too small, otherwise errors return -1. * - * It doesn't seem to generate errors that can be retrieved by + * It doesn't seem to generate errors that can be retrieved by * WSAGetLastError(). * */ @@ -116,93 +116,93 @@ DWORD WINAPI WsControl(DWORD protocoll, LPVOID pRequestInfo, LPDWORD pcbRequestInfoLen, LPVOID pResponseInfo, - LPDWORD pcbResponseInfoLen) + LPDWORD pcbResponseInfoLen) { /* Get the command structure into a pointer we can use, rather than void */ TDIObjectID *pcommand = (TDIObjectID *)pRequestInfo; - + TRACE (" WsControl TOI_ID=>0x%lx<, {TEI_ENTITY=0x%lx, TEI_INSTANCE=0x%lx}, TOI_CLASS=0x%lx, TOI_TYPE=0x%lx\n", pcommand->toi_id, pcommand->toi_entity.tei_entity, pcommand->toi_entity.tei_instance, pcommand->toi_class, pcommand->toi_type ); - - switch (action) + + switch (action) { - case WSCNTL_TCPIP_QUERY_INFO: + case WSCNTL_TCPIP_QUERY_INFO: { switch (pcommand->toi_id) { - /* + /* ENTITY_LIST_ID seems to get number of adapters in the system. (almost like an index to be used when calling other WsControl options) */ - case ENTITY_LIST_ID: + case ENTITY_LIST_ID: { TDIEntityID *baseptr = pResponseInfo; int numInt = 0, i; if (pcommand->toi_class != INFO_CLASS_GENERIC && - pcommand->toi_type != INFO_TYPE_PROVIDER) - { + pcommand->toi_type != INFO_TYPE_PROVIDER) + { FIXME ("Unexpected Option for ENTITY_LIST_ID request -> toi_class=0x%lx, toi_type=0x%lx\n", pcommand->toi_class, pcommand->toi_type); - return (WSAEOPNOTSUPP); + return (WSAEOPNOTSUPP); } - - numInt = WSCNTL_GetEntryCount(WSCNTL_COUNT_INTERFACES); + + numInt = WSCNTL_GetEntryCount(WSCNTL_COUNT_INTERFACES); if (numInt < 0) { ERR ("Unable to open /proc filesystem to determine number of network interfaces!\n"); - return (-1); + return (-1); } - if (*pcbResponseInfoLen < sizeof(TDIEntityID)*(numInt*2) ) + if (*pcbResponseInfoLen < sizeof(TDIEntityID)*(numInt*2) ) { return (STATUS_BUFFER_TOO_SMALL); } - + /* 0 it out first */ - memset(baseptr, 0, sizeof(TDIEntityID)*(numInt*2)); - + memset(baseptr, 0, sizeof(TDIEntityID)*(numInt*2)); + for (i=0; itei_entity = CL_NL_ENTITY; baseptr->tei_instance = i; baseptr++; - baseptr->tei_entity = IF_ENTITY; baseptr->tei_instance = i; baseptr++; + baseptr->tei_entity = IF_ENTITY; baseptr->tei_instance = i; baseptr++; } /* Calculate size of out buffer */ *pcbResponseInfoLen = sizeof(TDIEntityID)*(numInt*2); - + break; } - - - /* ENTITY_TYPE_ID is used to obtain simple information about a + + + /* ENTITY_TYPE_ID is used to obtain simple information about a network card, such as MAC Address, description, interface type, number of network addresses, etc. */ case ENTITY_TYPE_ID: /* ALSO: IP_MIB_STATS_ID */ { - if (pcommand->toi_class == INFO_CLASS_GENERIC && pcommand->toi_type == INFO_TYPE_PROVIDER) + if (pcommand->toi_class == INFO_CLASS_GENERIC && pcommand->toi_type == INFO_TYPE_PROVIDER) { if (pcommand->toi_entity.tei_entity == IF_ENTITY) { - * ((ULONG *)pResponseInfo) = IF_MIB; + * ((ULONG *)pResponseInfo) = IF_MIB; /* Calculate size of out buffer */ *pcbResponseInfoLen = sizeof (ULONG); } - else if (pcommand->toi_entity.tei_entity == CL_NL_ENTITY) + else if (pcommand->toi_entity.tei_entity == CL_NL_ENTITY) { - * ((ULONG *)pResponseInfo) = CL_NL_IP; + * ((ULONG *)pResponseInfo) = CL_NL_IP; /* Calculate size of out buffer */ - *pcbResponseInfoLen = sizeof (ULONG); + *pcbResponseInfoLen = sizeof (ULONG); } } else if (pcommand->toi_class == INFO_CLASS_PROTOCOL && @@ -210,10 +210,10 @@ DWORD WINAPI WsControl(DWORD protocoll, { if (pcommand->toi_entity.tei_entity == IF_ENTITY) { - /* In this case, we are requesting specific information about a + /* In this case, we are requesting specific information about a a particular network adapter. (MAC Address, speed, data transmitted/received, etc.) - */ + */ IFEntry *IntInfo = (IFEntry *) pResponseInfo; char ifName[512]; #if defined(SIOCGIFHWADDR) || defined(SIOCGENADDR) @@ -280,7 +280,7 @@ DWORD WINAPI WsControl(DWORD protocoll, IntInfo->if_descrlen= strlen (IntInfo->if_descr); /* Obtain bytes transmitted/received for interface */ - if ( (WSCNTL_GetTransRecvStat(pcommand->toi_entity.tei_instance, + if ( (WSCNTL_GetTransRecvStat(pcommand->toi_entity.tei_instance, &IntInfo->if_inoctets, &IntInfo->if_outoctets)) < 0) { ERR ("Error obtaining transmit/receive stats for the network interface!\n"); @@ -295,16 +295,16 @@ DWORD WINAPI WsControl(DWORD protocoll, /************************************************************************/ closesocket(sock); - *pcbResponseInfoLen = sizeof (IFEntry) + IntInfo->if_descrlen; + *pcbResponseInfoLen = sizeof (IFEntry) + IntInfo->if_descrlen; } - else if (pcommand->toi_entity.tei_entity == CL_NL_ENTITY) + else if (pcommand->toi_entity.tei_entity == CL_NL_ENTITY) { IPSNMPInfo *infoStruc = (IPSNMPInfo *) pResponseInfo; int numInt, numRoutes; - - /* This case is used to obtain general statistics about the + + /* This case is used to obtain general statistics about the network */ - + if (*pcbResponseInfoLen < sizeof(IPSNMPInfo) ) { return (STATUS_BUFFER_TOO_SMALL); @@ -313,20 +313,20 @@ DWORD WINAPI WsControl(DWORD protocoll, { /* 0 it out first */ memset(infoStruc, 0, sizeof(IPSNMPInfo)); - + /* Get the number of interfaces */ - numInt = WSCNTL_GetEntryCount(WSCNTL_COUNT_INTERFACES); + numInt = WSCNTL_GetEntryCount(WSCNTL_COUNT_INTERFACES); if (numInt < 0) { ERR ("Unable to open /proc filesystem to determine number of network interfaces!\n"); - return (-1); + return (-1); } /* Get the number of routes */ - numRoutes = WSCNTL_GetEntryCount(WSCNTL_COUNT_ROUTES); + numRoutes = WSCNTL_GetEntryCount(WSCNTL_COUNT_ROUTES); if (numRoutes < 0) { ERR ("Unable to open /proc filesystem to determine number of network routes!\n"); - return (-1); + return (-1); } infoStruc->ipsi_numif = numInt; /* # of interfaces */ @@ -355,7 +355,7 @@ DWORD WINAPI WsControl(DWORD protocoll, infoStruc->ipsi_fragfails = 0x0; infoStruc->ipsi_fragcreates = 0x0; /************************************************************************/ - + /* Calculate size of out buffer */ *pcbResponseInfoLen = sizeof(IPSNMPInfo); } @@ -365,17 +365,17 @@ DWORD WINAPI WsControl(DWORD protocoll, { FIXME ("Unexpected Option for ENTITY_TYPE_ID request -> toi_class=0x%lx, toi_type=0x%lx\n", pcommand->toi_class, pcommand->toi_type); - - return (WSAEOPNOTSUPP); + + return (WSAEOPNOTSUPP); } break; } - /* IP_MIB_ADDRTABLE_ENTRY_ID is used to obtain more detailed information about a + /* IP_MIB_ADDRTABLE_ENTRY_ID is used to obtain more detailed information about a particular network adapter */ - case IP_MIB_ADDRTABLE_ENTRY_ID: + case IP_MIB_ADDRTABLE_ENTRY_ID: { IPAddrEntry *baseIPInfo = (IPAddrEntry *) pResponseInfo; char ifName[IFNAMSIZ+1]; @@ -384,29 +384,29 @@ DWORD WINAPI WsControl(DWORD protocoll, if (*pcbResponseInfoLen < sizeof(IPAddrEntry)) { - return (STATUS_BUFFER_TOO_SMALL); + return (STATUS_BUFFER_TOO_SMALL); } - + if (!WSCNTL_GetInterfaceName(pcommand->toi_entity.tei_instance, ifName)) { ERR ("Unable to parse /proc filesystem!\n"); return (-1); } - - + + /* Get a socket so we can use ioctl */ if ( (sock = socket(AF_INET, SOCK_DGRAM, 0)) == INVALID_SOCKET) { ERR ("Error creating socket!\n"); return (-1); } - + /* 0 it out first */ memset(baseIPInfo, 0, sizeof(IPAddrEntry) ); - + /* Interface Id */ baseIPInfo->iae_index = pcommand->toi_entity.tei_instance; - + /* IP Address */ strcpy (ifInfo.ifr_name, ifName); ifInfo.ifr_addr.sa_family = AF_INET; @@ -419,7 +419,7 @@ DWORD WINAPI WsControl(DWORD protocoll, struct WS_sockaddr_in* ipTemp = (struct WS_sockaddr_in*)&ifInfo.ifr_addr; baseIPInfo->iae_addr = ipTemp->sin_addr.S_un.S_addr; } - + /* Broadcast Address */ strcpy (ifInfo.ifr_name, ifName); if (ioctlsocket(sock, SIOCGIFBRDADDR, (ULONG *)&ifInfo) < 0) @@ -461,7 +461,7 @@ DWORD WINAPI WsControl(DWORD protocoll, baseIPInfo->iae_context = 0x0; baseIPInfo->iae_pad = 0x0; /************************************************************************/ - + /* Calculate size of out buffer */ *pcbResponseInfoLen = sizeof(IPAddrEntry); closesocket(sock); @@ -482,22 +482,22 @@ DWORD WINAPI WsControl(DWORD protocoll, { int numRoutes, foundRoutes; wscntl_routeentry *routeTable, *routePtr; /* route table */ - + IPRouteEntry *winRouteTable = (IPRouteEntry *) pResponseInfo; /* Get the number of routes */ - numRoutes = WSCNTL_GetEntryCount(WSCNTL_COUNT_ROUTES); + numRoutes = WSCNTL_GetEntryCount(WSCNTL_COUNT_ROUTES); if (numRoutes < 0) { ERR ("Unable to open /proc filesystem to determine number of network routes!\n"); - return (-1); + return (-1); } if (*pcbResponseInfoLen < (sizeof(IPRouteEntry) * numRoutes)) { - return (STATUS_BUFFER_TOO_SMALL); + return (STATUS_BUFFER_TOO_SMALL); } - + /* malloc space for the routeTable */ routeTable = (wscntl_routeentry *) malloc(sizeof(wscntl_routeentry) * numRoutes); if (!routeTable) @@ -514,13 +514,13 @@ DWORD WINAPI WsControl(DWORD protocoll, return -1; } routePtr = routeTable; - + /* first 0 out the output buffer */ memset(winRouteTable, 0, *pcbResponseInfoLen); - + /* calculate the length of the data in the output buffer */ *pcbResponseInfoLen = sizeof(IPRouteEntry) * foundRoutes; - + for ( ; foundRoutes > 0; foundRoutes--) { winRouteTable->ire_addr = routePtr->wre_dest; @@ -539,25 +539,25 @@ DWORD WINAPI WsControl(DWORD protocoll, winRouteTable++; routePtr++; } - + free(routeTable); break; } - - default: + + default: { FIXME ("Command ID Not Supported -> toi_id=0x%lx, toi_entity={tei_entity=0x%lx, tei_instance=0x%lx}, toi_class=0x%lx, toi_type=0x%lx\n", - pcommand->toi_id, pcommand->toi_entity.tei_entity, pcommand->toi_entity.tei_instance, + pcommand->toi_id, pcommand->toi_entity.tei_entity, pcommand->toi_entity.tei_instance, pcommand->toi_class, pcommand->toi_type); - - return (WSAEOPNOTSUPP); + + return (WSAEOPNOTSUPP); } } - + break; } - + case WSCNTL_TCPIP_ICMP_ECHO: { unsigned int addr = *(unsigned int*)pRequestInfo; @@ -569,8 +569,8 @@ DWORD WINAPI WsControl(DWORD protocoll, char ttl = *(unsigned char*)(inbuf+13); char service = *(unsigned char*)(inbuf+14); char type= *(unsigned char*)(inbuf+15); /* 0x2: don't fragment*/ - #endif - + #endif + FIXME("(ICMP_ECHO) to 0x%08x stub \n", addr); break; } @@ -579,18 +579,18 @@ DWORD WINAPI WsControl(DWORD protocoll, { FIXME("Protocoll Not Supported -> protocoll=0x%lx, action=0x%lx, Request=%p, RequestLen=%p, Response=%p, ResponseLen=%p\n", protocoll, action, pRequestInfo, pcbRequestInfoLen, pResponseInfo, pcbResponseInfoLen); - - return (WSAEOPNOTSUPP); + + return (WSAEOPNOTSUPP); } } - - - return (WSCTL_SUCCESS); + + + return (WSCTL_SUCCESS); } -/* +/* Helper function for WsControl - Get count of the number of interfaces or routes by parsing /proc filesystem. */ @@ -602,8 +602,8 @@ int WSCNTL_GetEntryCount(const int entrytype) char *ptr; int count; int chrread; - - + + switch (entrytype) { case WSCNTL_COUNT_INTERFACES: @@ -633,12 +633,12 @@ int WSCNTL_GetEntryCount(const int entrytype) } /* read the file and count the EOL's */ - while ((chrread = read(fd, buf, sizeof(buf))) != 0) + while ((chrread = read(fd, buf, sizeof(buf))) != 0) { ptr = buf; - if (chrread < 0) + if (chrread < 0) { - if (errno == EINTR) + if (errno == EINTR) { continue; /* read interupted by a signal, try to read again */ } @@ -670,16 +670,16 @@ int WSCNTL_GetInterfaceName(int intNumber, char *intName) char buf[512]; /* Size doesn't matter, something big */ int i; - /* Open /proc filesystem file for network devices */ + /* Open /proc filesystem file for network devices */ procfs = fopen(PROCFS_NETDEV_FILE, "r"); - if (!procfs) + if (!procfs) { /* If we can't open the file, return an error */ return (-1); } - + /* Omit first two lines, they are only headers */ - fgets(buf, sizeof(buf), procfs); + fgets(buf, sizeof(buf), procfs); fgets(buf, sizeof(buf), procfs); for (i=0; iName); } } - + TSXFree(itemFmtName); } } @@ -510,7 +510,7 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At BOOL bRet = FALSE; HWND hWndClipWindow = GetOpenClipboardWindow(); - + if(prop == None) return bRet; @@ -535,17 +535,17 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At TSXFree(val); val = NULL; } - + TRACE("\tretrieving %ld bytes...\n", itemSize * aformat/8); lRequestLength = (itemSize * aformat/8)/4 + 1; - bwc = aformat/8; - /* we want to read the property, but not it too large of chunks or + bwc = aformat/8; + /* we want to read the property, but not it too large of chunks or we could hang the cause problems. Lets go for 4k blocks */ if(TSXGetWindowProperty(display,w,prop,0,4096,False, AnyPropertyType/*reqType*/, - &atype, &aformat, &nitems, &remain, &buffer) + &atype, &aformat, &nitems, &remain, &buffer) != Success) { WARN("\tcouldn't read property\n"); @@ -582,10 +582,10 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At { int i,inlcount = 0; char* lpstr; - + for(i=0; i <= nitems; i++) if( val[i] == '\n' ) inlcount++; - + if( (lpstr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nitems + inlcount + 1)) ) { static UINT text_cp = (UINT)-1; @@ -635,14 +635,14 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At /* Get the first pixmap handle passed to us */ Pixmap *pPixmap = (Pixmap *)val; HANDLE hTargetImage = 0; /* Handle to store the converted bitmap or DIB */ - + if (aformat != 32 || nitems < 1 || atype != XA_PIXMAP || (wFormat != CF_BITMAP && wFormat != CF_DIB)) { WARN("\tUnimplemented format conversion request\n"); goto END; } - + if ( wFormat == CF_BITMAP ) { /* For CF_BITMAP requests we must return an HBITMAP */ @@ -652,10 +652,10 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At { HWND hwnd = GetOpenClipboardWindow(); HDC hdc = GetDC(hwnd); - + /* For CF_DIB requests we must return an HGLOBAL storing a packed DIB */ hTargetImage = X11DRV_DIB_CreateDIBFromPixmap(*pPixmap, hdc, TRUE); - + ReleaseDC(hwnd, hdc); } @@ -669,7 +669,7 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At lpFormat = CLIPBOARD_LookupFormat(wFormat); if (lpFormat->wDataPresent && (lpFormat->hData16 || lpFormat->hData32)) CLIPBOARD_DeleteRecord(lpFormat, !(hWndClipWindow)); - + /* Update the clipboard record */ lpFormat->wDataPresent = 1; lpFormat->hData32 = hTargetImage; @@ -677,7 +677,7 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At bRet = TRUE; } - + /* For native properties simply copy the X data without conversion */ else if (X11DRV_CLIPBOARD_IsNativeProperty(reqType)) /* * */ { @@ -697,14 +697,14 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(UINT wFormat, Window w, Atom prop, At else hClipData = 0; } - + if( hClipData ) { /* delete previous clipboard record if any */ lpFormat = CLIPBOARD_LookupFormat(wFormat); - if (lpFormat->wDataPresent || lpFormat->hData16 || lpFormat->hData32) + if (lpFormat->wDataPresent || lpFormat->hData16 || lpFormat->hData32) CLIPBOARD_DeleteRecord(lpFormat, !(hWndClipWindow)); - + /* Update the clipboard record */ lpFormat->wDataPresent = 1; lpFormat->hData32 = hClipData; @@ -723,7 +723,7 @@ END: /* Delete the property on the window now that we are done * This will send a PropertyNotify event to the selection owner. */ TSXDeleteProperty(display,w,prop); - + /* Free the retrieved property data */ HeapFree(GetProcessHeap(),0,val); return bRet; @@ -752,12 +752,12 @@ void X11DRV_CLIPBOARD_ReleaseSelection(Atom selType, Window w, HWND hwnd) clearAllSelections = atoi(buffer); RegCloseKey(hkey); } - + /* w is the window that lost the selection - * selectionPrevWindow is nonzero if CheckSelection() was called. + * selectionPrevWindow is nonzero if CheckSelection() was called. */ - TRACE("\tevent->window = %08x (sw = %08x, spw=%08x)\n", + TRACE("\tevent->window = %08x (sw = %08x, spw=%08x)\n", (unsigned)w, (unsigned)selectionWindow, (unsigned)selectionPrevWindow ); if( selectionAcquired ) @@ -775,7 +775,7 @@ void X11DRV_CLIPBOARD_ReleaseSelection(Atom selType, Window w, HWND hwnd) /* We are completely giving up the selection. * Make sure we can open the windows clipboard first. */ - + if ( !OpenClipboard(hwnd) ) { /* @@ -795,17 +795,17 @@ void X11DRV_CLIPBOARD_ReleaseSelection(Atom selType, Window w, HWND hwnd) { XSetSelectionOwner(display, XA_PRIMARY, None, CurrentTime); } - + /* We really lost PRIMARY but want to voluntarily lose CLIPBOARD */ if ( (selType == XA_PRIMARY) && (selectionAcquired & S_CLIPBOARD) ) { XSetSelectionOwner(display, xaClipboard, None, CurrentTime); } - + selectionWindow = None; PrimarySelectionOwner = ClipboardSelectionOwner = 0; - + /* Empty the windows clipboard. * We should pretend that we still own the selection BEFORE calling * EmptyClipboard() since otherwise this has the side effect of @@ -835,7 +835,7 @@ void X11DRV_CLIPBOARD_ReleaseSelection(Atom selType, Window w, HWND hwnd) else if( w == selectionPrevWindow ) { Atom xaClipboard = TSXInternAtom(display, _CLIPBOARD, False); - + w = TSXGetSelectionOwner(display, XA_PRIMARY); if( w == None ) TSXSetSelectionOwner(display, XA_PRIMARY, selectionWindow, CurrentTime); @@ -852,7 +852,7 @@ void X11DRV_CLIPBOARD_ReleaseSelection(Atom selType, Window w, HWND hwnd) TRACE("Lost all selections, signalling to selectionClearEvent listener\n"); SetEvent(selectionClearEvent); } - + selectionPrevWindow = None; } @@ -873,10 +873,10 @@ void X11DRV_ReleaseClipboard(void) selectionAcquired = S_NOSELECTION; selectionPrevWindow = selectionWindow; selectionWindow = None; - - TRACE("\tgiving up selection (spw = %08x)\n", + + TRACE("\tgiving up selection (spw = %08x)\n", (unsigned)selectionPrevWindow); - + wine_tsx11_lock(); TRACE("Releasing CLIPBOARD selection\n"); @@ -890,7 +890,7 @@ void X11DRV_ReleaseClipboard(void) TRACE("Releasing XA_PRIMARY selection\n"); selectionPrevWindow = savePrevWindow; /* May be cleared in X11DRV_CLIPBOARD_ReleaseSelection */ XSetSelectionOwner(display, XA_PRIMARY, None, CurrentTime); - + if( selectionPrevWindow ) while( !XCheckTypedWindowEvent( display, selectionPrevWindow, SelectionClear, &xe ) ); @@ -939,7 +939,7 @@ void X11DRV_AcquireClipboard(void) /* Grab PRIMARY selection if not owned */ if ( !(selectionAcquired & S_PRIMARY) ) TSXSetSelectionOwner(display, XA_PRIMARY, owner, CurrentTime); - + /* Grab CLIPBOARD selection if not owned */ if ( !(selectionAcquired & S_CLIPBOARD) ) TSXSetSelectionOwner(display, xaClipboard, owner, CurrentTime); @@ -999,7 +999,7 @@ BOOL X11DRV_IsClipboardFormatAvailable(UINT wFormat) TRACE("There is no selection owner\n"); return FALSE; } - + /* Check if the format is available in the clipboard cache */ if ( CLIPBOARD_IsPresent(wFormat) ) return TRUE; @@ -1011,7 +1011,7 @@ BOOL X11DRV_IsClipboardFormatAvailable(UINT wFormat) */ if ( !cSelectionTargets ) return X11DRV_GetClipboardData( wFormat ); - + TRACE("There is no selection\n"); return FALSE; } @@ -1027,7 +1027,7 @@ BOOL X11DRV_RegisterClipboardFormat( LPCSTR FormatName ) Display *display = thread_display(); Atom prop = None; char str[256]; - + /* * If an X atom is registered for this format, return that * Otherwise register a new atom. @@ -1039,7 +1039,7 @@ BOOL X11DRV_RegisterClipboardFormat( LPCSTR FormatName ) strncat(str, FormatName, sizeof(str) - strlen(FMT_PREFIX)); prop = TSXInternAtom(display, str, False); } - + return (prop) ? TRUE : FALSE; } @@ -1057,7 +1057,7 @@ BOOL X11DRV_IsSelectionOwner(void) * SetClipboardData (X11DRV.@) * * We don't need to do anything special here since the clipboard code - * maintains the cache. + * maintains the cache. * */ void X11DRV_SetClipboardData(UINT wFormat) @@ -1100,7 +1100,7 @@ BOOL X11DRV_GetClipboardData(UINT wFormat) * If the format is in the cache, use the atom associated * with it. */ - + lpFormat = CLIPBOARD_LookupFormat( wFormat ); if (lpFormat && lpFormat->wDataPresent && lpFormat->drvData) propRequest = (Atom)lpFormat->drvData; @@ -1116,9 +1116,9 @@ BOOL X11DRV_GetClipboardData(UINT wFormat) XConvertSelection(display, selectionCacheSrc, propRequest, TSXInternAtom(display, "SELECTION_DATA", False), w, CurrentTime); - + /* wait until SelectionNotify is received */ - + while( TRUE ) { if( XCheckTypedWindowEvent(display, w, SelectionNotify, &xe) ) @@ -1143,7 +1143,7 @@ BOOL X11DRV_GetClipboardData(UINT wFormat) } TRACE("Returning %d\n", bRet); - + return bRet; } @@ -1178,7 +1178,7 @@ void X11DRV_ResetSelectionOwner(HWND hwnd, BOOL bFooBar) hWndClipOwner = GetClipboardOwner(); xaClipboard = TSXInternAtom(display, _CLIPBOARD, False); - + TRACE("clipboard owner = %04x, selection window = %08x\n", hWndClipOwner, (unsigned)selectionWindow); @@ -1201,13 +1201,13 @@ void X11DRV_ResetSelectionOwner(HWND hwnd, BOOL bFooBar) int saveSelectionState = selectionAcquired; selectionAcquired = False; - TRACE("\tswitching selection from %08x to %08x\n", + TRACE("\tswitching selection from %08x to %08x\n", (unsigned)selectionPrevWindow, (unsigned)selectionWindow); - + /* Assume ownership for the PRIMARY and CLIPBOARD selection */ if ( saveSelectionState & S_PRIMARY ) TSXSetSelectionOwner(display, XA_PRIMARY, selectionWindow, CurrentTime); - + TSXSetSelectionOwner(display, xaClipboard, selectionWindow, CurrentTime); /* Restore the selection masks */ @@ -1226,7 +1226,7 @@ void X11DRV_ResetSelectionOwner(HWND hwnd, BOOL bFooBar) /* Update selection state */ if (saveSelectionState & S_PRIMARY) PrimarySelectionOwner = selectionWindow; - + ClipboardSelectionOwner = selectionWindow; } } @@ -1241,7 +1241,7 @@ END: { /* Launch the clipboard server if the selection can no longer be recyled * to another top level window. */ - + if ( !X11DRV_CLIPBOARD_LaunchServer() ) { /* Empty the windows clipboard if the server was not launched. @@ -1250,15 +1250,15 @@ END: * triggering X11DRV_CLIPBOARD_Acquire() and causing the X selection * to be re-acquired by us! */ - + TRACE("\tLost the selection! Emptying the clipboard...\n"); - + OpenClipboard( 0 ); selectionAcquired = (S_PRIMARY | S_CLIPBOARD); EmptyClipboard(); - + CloseClipboard(); - + /* Give up ownership of the windows clipboard */ CLIPBOARD_ReleaseOwner(); } diff --git a/dlls/x11drv/dga2.c b/dlls/x11drv/dga2.c index 2c9aab44809..307e947c30f 100644 --- a/dlls/x11drv/dga2.c +++ b/dlls/x11drv/dga2.c @@ -72,7 +72,7 @@ void X11DRV_XF86DGA2_Init(void) if (!TSXDGAQueryExtension(gdi_display, &dga_event, &dga_error)) return; if (!TSXDGAQueryVersion(gdi_display, &major, &minor)) return; - + if (major < 2) return; /* only bother with DGA 2+ */ /* test that it works */ diff --git a/dlls/x11drv/dga2.h b/dlls/x11drv/dga2.h index 73e9e84c5b7..983bd0ca706 100644 --- a/dlls/x11drv/dga2.h +++ b/dlls/x11drv/dga2.h @@ -20,9 +20,9 @@ #ifndef __WINE_DGA2_H #define __WINE_DGA2_H -#ifndef __WINE_CONFIG_H -# error You must include config.h to use this header -#endif +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif #ifdef HAVE_LIBXXF86DGA2 #include "ddrawi.h" diff --git a/dlls/x11drv/event.c b/dlls/x11drv/event.c index 848f224bfc8..25d15ee5bca 100644 --- a/dlls/x11drv/event.c +++ b/dlls/x11drv/event.c @@ -49,7 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(event); WINE_DECLARE_DEBUG_CHANNEL(win); - + /* X context to associate a hwnd to an X window */ extern XContext winContext; @@ -241,7 +241,7 @@ static void EVENT_ProcessEvent( XEvent *event ) XDGAKeyEvent *evt = (XDGAKeyEvent *) event; TRACE("DGAKeyPress/ReleaseEvent received.\n"); - + if (evt->type == DGAKeyReleaseEventType) ke.type = KeyRelease; else @@ -270,7 +270,7 @@ static void EVENT_ProcessEvent( XEvent *event ) hWnd = 0; /* Not for a registered window */ if ( !hWnd && event->xany.window != root_window - && event->type != PropertyNotify + && event->type != PropertyNotify && event->type != MappingNotify) WARN( "Got event %s for unknown Window %08lx\n", event_names[event->type], event->xany.window ); @@ -324,7 +324,7 @@ static void EVENT_ProcessEvent( XEvent *event ) if (!hWnd) return; EVENT_SelectionClear( hWnd, (XSelectionClearEvent*) event ); break; - + case PropertyNotify: EVENT_PropertyNotify( (XPropertyEvent *)event ); break; @@ -353,7 +353,7 @@ static void EVENT_ProcessEvent( XEvent *event ) X11DRV_MappingNotify( (XMappingEvent *) event ); break; - default: + default: WARN("Unprocessed event %s for hwnd %04x\n", event_names[event->type], hWnd ); break; @@ -376,7 +376,7 @@ static void EVENT_FocusIn( HWND hWnd, XFocusChangeEvent *event ) bIsDisabled = GetWindowLongA( hWnd, GWL_STYLE ) & WS_DISABLED; /* If the window has been disabled, revert the X focus back to the last - * focus window. This is to disallow the window manager from switching + * focus window. This is to disallow the window manager from switching * focus away while the app is in a modal state. */ if (bIsDisabled && glastXFocusWin) @@ -441,10 +441,10 @@ static BOOL X11DRV_CheckFocus(void) HWND hWnd; Window xW; int state; - + TSXGetInputFocus(display, &xW, &state); if( xW == None || - TSXFindContext(display, xW, winContext, (char **)&hWnd) ) + TSXFindContext(display, xW, winContext, (char **)&hWnd) ) return FALSE; return TRUE; } @@ -466,7 +466,7 @@ static Atom EVENT_SelectionRequest_TARGETS( Display *display, Window requestor, int xRc; TRACE("Request for %s\n", TSXGetAtomName(display, target)); - + /* * Count the number of items we wish to expose as selection targets. * We include the TARGETS item, and a PIXMAP if we have CF_DIB or CF_BITMAP @@ -474,7 +474,7 @@ static Atom EVENT_SelectionRequest_TARGETS( Display *display, Window requestor, cTargets = CountClipboardFormats() + 1; if ( CLIPBOARD_IsPresent(CF_DIB) || CLIPBOARD_IsPresent(CF_BITMAP) ) cTargets++; - + /* Allocate temp buffer */ targets = (Atom*)HeapAlloc( GetProcessHeap(), 0, cTargets * sizeof(Atom)); if(targets == NULL) return None; @@ -500,7 +500,7 @@ static Atom EVENT_SelectionRequest_TARGETS( Display *display, Window requestor, if (!bExists) { targets[cTargets++] = prop; - + /* Add PIXMAP prop for bitmaps additionally */ if ( (wFormat == CF_DIB || wFormat == CF_BITMAP ) && !bHavePixmap ) @@ -525,7 +525,7 @@ static Atom EVENT_SelectionRequest_TARGETS( Display *display, Window requestor, } } } - + /* Update the X property */ TRACE("\tUpdating property %s...\n", TSXGetAtomName(display, rprop)); @@ -535,7 +535,7 @@ static Atom EVENT_SelectionRequest_TARGETS( Display *display, Window requestor, XA_ATOM, 32, PropModeReplace, (unsigned char *)targets, cTargets); TRACE("(Rc=%d)\n", xRc); - + HeapFree( GetProcessHeap(), 0, targets ); return rprop; @@ -596,17 +596,17 @@ static Atom EVENT_SelectionRequest_STRING( Display *display, Window requestor, WideCharToMultiByte(text_cp, 0, uni_text, -1, text, size, NULL, NULL); /* remove carriage returns */ - + lpstr = (char*)HeapAlloc( GetProcessHeap(), 0, size-- ); if(lpstr == NULL) return None; for(i=0,j=0; i < size && text[i]; i++ ) { - if( text[i] == '\r' && + if( text[i] == '\r' && (text[i+1] == '\n' || text[i+1] == '\0') ) continue; lpstr[j++] = text[i]; } lpstr[j]='\0'; - + /* Update the X property */ TRACE("\tUpdating property %s...\n", TSXGetAtomName(display, rprop)); xRc = TSXChangeProperty(display, requestor, rprop, @@ -637,7 +637,7 @@ static Atom EVENT_SelectionRequest_PIXMAP( Display *display, Window requestor, XSetWindowAttributes win_attr; XWindowAttributes win_attr_src; #endif - + /* * Map the requested X selection property type atom name to a * windows clipboard format ID. @@ -647,7 +647,7 @@ static Atom EVENT_SelectionRequest_PIXMAP( Display *display, Window requestor, TRACE("Request for %s (wFormat=%x %s)\n", itemFmtName, wFormat, CLIPBOARD_GetFormatName( wFormat)); TSXFree(itemFmtName); - + hClipData = GetClipboardData(wFormat); if ( !hClipData ) { @@ -660,17 +660,17 @@ static Atom EVENT_SelectionRequest_PIXMAP( Display *display, Window requestor, { HWND hwnd = GetOpenClipboardWindow(); HDC hdc = GetDC(hwnd); - + /* For convert from packed DIB to Pixmap */ pixmap = X11DRV_DIB_CreatePixmapFromDIB(hClipData, hdc); - + ReleaseDC(hwnd, hdc); } else if (wFormat == CF_BITMAP) { HWND hwnd = GetOpenClipboardWindow(); HDC hdc = GetDC(hwnd); - + pixmap = X11DRV_BITMAP_CreatePixmapFromBitmap(hClipData, hdc); ReleaseDC(hwnd, hdc); @@ -688,7 +688,7 @@ static Atom EVENT_SelectionRequest_PIXMAP( Display *display, Window requestor, TSXGetAtomName(display, target), pixmap); /* Store the Pixmap handle in the property */ - xRc = TSXChangeProperty(display, requestor, rprop, target, + xRc = TSXChangeProperty(display, requestor, rprop, target, 32, PropModeReplace, (unsigned char *)&pixmap, 1); TRACE("(Rc=%d)\n", xRc); @@ -714,7 +714,7 @@ static Atom EVENT_SelectionRequest_PIXMAP( Display *display, Window requestor, */ X11DRV_CLIPBOARD_RegisterPixmapResource( rprop, pixmap ); #endif - + END: return rprop; } @@ -734,7 +734,7 @@ static Atom EVENT_SelectionRequest_WCF( Display *display, Window requestor, char * itemFmtName; int cBytes; int xRc; - + /* * Map the requested X selection property type atom name to a * windows clipboard format ID. @@ -744,21 +744,21 @@ static Atom EVENT_SelectionRequest_WCF( Display *display, Window requestor, TRACE("Request for %s (wFormat=%x %s)\n", itemFmtName, wFormat, CLIPBOARD_GetFormatName( wFormat)); TSXFree(itemFmtName); - + hClipData = GetClipboardData(wFormat); - + if( hClipData && (lpClipData = GlobalLock(hClipData)) ) { cBytes = GlobalSize(hClipData); - + TRACE("\tUpdating property %s, %d bytes...\n", TSXGetAtomName(display, rprop), cBytes); - + xRc = TSXChangeProperty(display, requestor, rprop, target, 8, PropModeReplace, (unsigned char *)lpClipData, cBytes); TRACE("(Rc=%d)\n", xRc); - + GlobalUnlock(hClipData); } else @@ -766,7 +766,7 @@ static Atom EVENT_SelectionRequest_WCF( Display *display, Window requestor, TRACE("\tCould not retrieve native format!\n"); rprop = None; /* Fail the request */ } - + return rprop; } @@ -793,12 +793,12 @@ static Atom EVENT_SelectionRequest_MULTIPLE( HWND hWnd, XSelectionRequestEvent * Atom* targetPropList=NULL; unsigned long cTargetPropList = 0; /* Atom xAtomPair = TSXInternAtom(display, "ATOM_PAIR", False); */ - + /* If the specified property is None the requestor is an obsolete client. * We support these by using the specified target atom as the reply property. */ rprop = pevent->property; - if( rprop == None ) + if( rprop == None ) rprop = pevent->target; if (!rprop) goto END; @@ -827,7 +827,7 @@ static Atom EVENT_SelectionRequest_MULTIPLE( HWND hWnd, XSelectionRequestEvent * if(aformat == 32 /* atype == xAtomPair */ ) { int i; - + /* Iterate through the ATOM_PAIR list and execute a SelectionRequest * for each (target,property) pair */ @@ -841,19 +841,19 @@ static Atom EVENT_SelectionRequest_MULTIPLE( HWND hWnd, XSelectionRequestEvent * i/2, targetName, propName); TSXFree(targetName); TSXFree(propName); - + /* We must have a non "None" property to service a MULTIPLE target atom */ if ( !targetPropList[i+1] ) { TRACE("\tMULTIPLE(%d): Skipping target with empty property!\n", i); continue; } - + /* Set up an XSelectionRequestEvent for this (target,property) pair */ memcpy( &event, pevent, sizeof(XSelectionRequestEvent) ); event.target = targetPropList[i]; event.property = targetPropList[i+1]; - + /* Fire a SelectionRequest, informing the handler that we are processing * a MULTIPLE selection request event. */ @@ -906,9 +906,9 @@ static void EVENT_SelectionRequest( HWND hWnd, XSelectionRequestEvent *event, BO * We support these by using the specified target atom as the reply property. */ rprop = event->property; - if( rprop == None ) + if( rprop == None ) rprop = event->target; - + if(event->target == xaTargets) /* Return a list of all supported targets */ { /* TARGETS selection request */ @@ -945,11 +945,11 @@ static void EVENT_SelectionRequest( HWND hWnd, XSelectionRequestEvent *event, BO END: /* close clipboard only if we opened before */ if(couldOpen) CloseClipboard(); - - if( rprop == None) + + if( rprop == None) TRACE("\tRequest ignored\n"); - /* reply to sender + /* reply to sender * SelectionNotify should be sent only at the end of a MULTIPLE request */ if ( !bIsMultiple ) @@ -972,7 +972,7 @@ END: static void EVENT_SelectionClear( HWND hWnd, XSelectionClearEvent *event ) { Atom xaClipboard = TSXInternAtom(event->display, "CLIPBOARD", False); - + if (event->selection == XA_PRIMARY || event->selection == xaClipboard) X11DRV_CLIPBOARD_ReleaseSelection( event->selection, event->window, hWnd ); } @@ -993,7 +993,7 @@ static void EVENT_PropertyNotify( XPropertyEvent *event ) { TRACE("\tPropertyDelete for atom %s on window %ld\n", TSXGetAtomName(event->display, event->atom), (long)event->window); - + if (X11DRV_IsSelectionOwner()) X11DRV_CLIPBOARD_FreeResources( event->atom ); break; @@ -1005,7 +1005,7 @@ static void EVENT_PropertyNotify( XPropertyEvent *event ) TSXGetAtomName(event->display, event->atom), (long)event->window); break; } - + default: break; } @@ -1036,18 +1036,18 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event ) SEGPTR spDragInfo = K32WOWGlobalLock16(hDragInfo); Window w_aux_root, w_aux_child; WND* pWnd; - + if( !lpDragInfo || !spDragInfo ) return; - + pWnd = WIN_FindWndPtr(hWnd); - + TSXQueryPointer( event->display, get_whole_window(pWnd), &w_aux_root, &w_aux_child, &x, &y, (int *) &u.pt_aux.x, (int *) &u.pt_aux.y, (unsigned int*)&aux_long); - + lpDragInfo->hScope = hWnd; lpDragInfo->pt.x = (INT16)x; lpDragInfo->pt.y = (INT16)y; - + /* find out drop point and drop window */ if( x < 0 || y < 0 || x > (pWnd->rectWindow.right - pWnd->rectWindow.left) || @@ -1059,7 +1059,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event ) x = lpDragInfo->pt.x; y = lpDragInfo->pt.y; } WIN_ReleaseWndPtr(pWnd); - + GlobalFree16( hDragInfo ); if (!bAccept) return; @@ -1130,7 +1130,7 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event ) /********************************************************************** * EVENT_DropURLs * - * drop items are separated by \n + * drop items are separated by \n * each item is prefixed by its mime type * * event->data.l[3], event->data.l[4] contains drop x,y position @@ -1171,15 +1171,15 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event ) INT len = GetShortPathNameA( p+5, NULL, 0 ); if (len) drop_len += len + 1; } - if (next) { - *next = '\n'; + if (next) { + *next = '\n'; p = next + 1; next = strchr(p, '\n'); } else { p = NULL; } } - + if( drop_len && drop_len < 65535 ) { TSXQueryPointer( event->display, root_window, &u.w_aux, &u.w_aux, &x, &y, &u.i, &u.i, &u.i); @@ -1220,8 +1220,8 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event ) } else { WARN("unknown mime type %s\n", p); } - if (next) { - *next = '\n'; + if (next) { + *next = '\n'; p = next + 1; next = strchr(p, '\n'); } else { @@ -1234,7 +1234,7 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event ) PostMessageA( hWnd, WM_DROPFILES, (WPARAM)hDrop, 0L ); } } - if( p_data ) TSXFree(p_data); + if( p_data ) TSXFree(p_data); } } @@ -1244,7 +1244,7 @@ static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event ) static void EVENT_ClientMessage( HWND hWnd, XClientMessageEvent *event ) { if (event->message_type != None && event->format == 32) { - if ((event->message_type == wmProtocols) && + if ((event->message_type == wmProtocols) && (((Atom) event->data.l[0]) == wmDeleteWindow)) { /* Ignore the delete window request if the window has been disabled */ @@ -1279,7 +1279,7 @@ static void EVENT_ClientMessage( HWND hWnd, XClientMessageEvent *event ) AnyPropertyType, &u.atom, &u.i, &u.l, &u.l, &p_data); TRACE("message_type=%ld, data=%ld,%ld,%ld,%ld,%ld, msg=%s\n", - event->message_type, event->data.l[0], event->data.l[1], + event->message_type, event->data.l[0], event->data.l[1], event->data.l[2], event->data.l[3], event->data.l[4], p_data); #endif diff --git a/dlls/x11drv/keyboard.c b/dlls/x11drv/keyboard.c index 21bbe729d6b..d4895b195c6 100644 --- a/dlls/x11drv/keyboard.c +++ b/dlls/x11drv/keyboard.c @@ -2,7 +2,7 @@ * X11 keyboard driver * * Copyright 1993 Bob Amstadt - * Copyright 1996 Albrecht Kleine + * Copyright 1996 Albrecht Kleine * Copyright 1997 David Faure * Copyright 1998 Morten Welinder * Copyright 1998 Ulrich Weigand @@ -728,8 +728,8 @@ static WORD EVENT_event_to_vkey( XKeyEvent *e) TSXLookupString(e, NULL, 0, &keysym, NULL); - if ((keysym >= 0xFFAE) && (keysym <= 0xFFB9) && (keysym != 0xFFAF) - && (e->state & NumLockMask)) + if ((keysym >= 0xFFAE) && (keysym <= 0xFFB9) && (keysym != 0xFFAF) + && (e->state & NumLockMask)) /* Only the Keypad keys 0-9 and . send different keysyms * depending on the NumLock state */ return nonchar_key_vkey[keysym & 0xFF]; @@ -788,8 +788,8 @@ static void KEYBOARD_GenerateMsg( WORD vkey, WORD scan, int Evtype, DWORD event_ send_keyboard_input( vkey, scan, down, event_time ); send_keyboard_input( vkey, scan, up, event_time ); *State=FALSE; - pKeyStateTable[vkey] &= ~0x01; /* Toggle state to off. */ - } + pKeyStateTable[vkey] &= ~0x01; /* Toggle state to off. */ + } } else /* it was OFF */ if (Evtype==KeyPress) @@ -865,7 +865,7 @@ void X11DRV_KeymapNotify( HWND hwnd, XKeymapEvent *event ) */ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event ) { - char Str[24]; + char Str[24]; KeySym keysym; WORD vkey = 0, bScan; DWORD dwFlags; @@ -894,7 +894,7 @@ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event ) index instead of the modifier mask. The group index is set in bits 13-14 of the state field in the XKeyEvent structure. So if AltGr is pressed, look if the group index is diferent than 0. From XKB - extension documentation, the group index should for AltGr should + extension documentation, the group index should for AltGr should be 2 (event->state = 0x2000). It's probably better to not assume a predefined group index and find it dynamically @@ -908,7 +908,7 @@ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event ) ksname = TSXKeysymToString(keysym); if (!ksname) ksname = "No Name"; - TRACE_(key)("%s : keysym=%lX (%s), ascii chars=%u / %X / '%s'\n", + TRACE_(key)("%s : keysym=%lX (%s), ascii chars=%u / %X / '%s'\n", (event->type == KeyPress) ? "KeyPress" : "KeyRelease", keysym, ksname, ascii_chars, Str[0] & 0xff, Str); } @@ -922,7 +922,7 @@ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event ) { switch (vkey & 0xff) { - case VK_NUMLOCK: + case VK_NUMLOCK: KEYBOARD_GenerateMsg( VK_NUMLOCK, 0x45, event->type, event_time ); break; case VK_CAPITAL: @@ -933,7 +933,7 @@ void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event ) default: /* Adjust the NUMLOCK state if it has been changed outside wine */ if (!(pKeyStateTable[VK_NUMLOCK] & 0x01) != !(event->state & NumLockMask)) - { + { TRACE("Adjusting NumLock state. \n"); KEYBOARD_GenerateMsg( VK_NUMLOCK, 0x45, KeyPress, event_time ); KEYBOARD_GenerateMsg( VK_NUMLOCK, 0x45, KeyRelease, event_time ); @@ -1105,12 +1105,12 @@ void X11DRV_InitKeyboard( BYTE *key_state_table ) for (i = 0; i < 8; i += 1) /* There are 8 modifier keys */ { int j; - + for (j = 0; j < mmp->max_keypermod; j += 1, kcp += 1) if (*kcp) { int k; - + for (k = 0; k < keysyms_per_keycode; k += 1) if (TSXKeycodeToKeysym(display, *kcp, k) == XK_Num_Lock) { @@ -1221,7 +1221,7 @@ void X11DRV_InitKeyboard( BYTE *key_state_table ) } vkey = OEMvkey; - + if (TRACE_ON(keyboard)) { TRACE("OEM specific virtual key %X assigned to keycode %X:\n", @@ -1230,7 +1230,7 @@ void X11DRV_InitKeyboard( BYTE *key_state_table ) for (i = 0; i < keysyms_per_keycode; i += 1) { char *ksname; - + keysym = TSXLookupKeysym(&e2, i); ksname = TSXKeysymToString(keysym); if (!ksname) @@ -1286,14 +1286,14 @@ WORD X11DRV_VkKeyScan(CHAR cChar) { Display *display = thread_display(); KeyCode keycode; - KeySym keysym; + KeySym keysym; int i,index; int highbyte=0; /* char->keysym (same for ANSI chars) */ keysym=(unsigned char) cChar;/* (!) cChar is signed */ if (keysym<=27) keysym+=0xFF00;/*special chars : return, backspace...*/ - + keycode = TSXKeysymToKeycode(display, keysym); /* keysym -> keycode */ if (!keycode) { /* It didn't work ... let's try with deadchar code. */ @@ -1302,7 +1302,7 @@ WORD X11DRV_VkKeyScan(CHAR cChar) TRACE("VkKeyScan '%c'(%#lx, %lu): got keycode %#.2x\n", cChar,keysym,keysym,keycode); - + if (keycode) { for (index=-1, i=0; (i<8) && (index<0); i++) /* find shift state */ @@ -1384,7 +1384,7 @@ UINT X11DRV_MapVirtualKey(UINT wCode, UINT wMapType) if ((wCode>=VK_NUMPAD0) && (wCode<=VK_NUMPAD9)) e.keycode = TSXKeysymToKeycode(e.display, wCode-VK_NUMPAD0+XK_KP_0); - + if (wCode==VK_DECIMAL) e.keycode = TSXKeysymToKeycode(e.display, XK_KP_Decimal); @@ -1397,7 +1397,7 @@ UINT X11DRV_MapVirtualKey(UINT wCode, UINT wMapType) if (TSXLookupString(&e, s, 2, &keysym, NULL)) returnMVK (*s); - + TRACE("returning no ANSI.\n"); return 0; } @@ -1409,7 +1409,7 @@ UINT X11DRV_MapVirtualKey(UINT wCode, UINT wMapType) default: /* reserved */ WARN("Unknown wMapType %d !\n", wMapType); - return 0; + return 0; } return 0; } @@ -1424,7 +1424,7 @@ INT X11DRV_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT nSize) int keyi; KeySym keys; char *name; - + scanCode = lParam >> 16; scanCode &= 0x1ff; /* keep "extended-key" flag with code */ @@ -1468,7 +1468,7 @@ INT X11DRV_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT nSize) *lpBuffer = toupper((char)ansi); *(lpBuffer+1) = 0; return 1; - } + } else return 0; } @@ -1577,7 +1577,7 @@ static char KEYBOARD_MapDeadKeysym(KeySym keysym) #endif /* FIXME: I don't know this three. case XK_dead_iota : - return 'i'; + return 'i'; case XK_dead_voiced_sound : return 'v'; case XK_dead_semivoiced_sound : @@ -1666,7 +1666,7 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT scanCode, LPBYTE lpKeyState, if ((virtKey>=VK_NUMPAD0) && (virtKey<=VK_NUMPAD9)) e.keycode = TSXKeysymToKeycode(e.display, virtKey-VK_NUMPAD0+XK_KP_0); - + if (virtKey==VK_DECIMAL) e.keycode = TSXKeysymToKeycode(e.display, XK_KP_Decimal); @@ -1715,7 +1715,7 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT scanCode, LPBYTE lpKeyState, ret = 0; } - /* more areas where X returns characters but Windows does not + /* more areas where X returns characters but Windows does not CTRL + number or CTRL + symbol*/ if (e.state & ControlMask) { diff --git a/dlls/x11drv/mouse.c b/dlls/x11drv/mouse.c index 76d6dfd6a95..d64c4e04f6f 100644 --- a/dlls/x11drv/mouse.c +++ b/dlls/x11drv/mouse.c @@ -91,7 +91,7 @@ static void get_coords( HWND *hwnd, Window window, int x, int y, POINT *pt ) /*********************************************************************** * update_key_state * - * Update the key state with what X provides us + * Update the key state with what X provides us */ static void update_key_state( unsigned int state ) { @@ -159,7 +159,7 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr ) { XImage *image; GC gc; - + TRACE("Bitmap %dx%d planes=%d bpp=%d bytesperline=%d\n", ptr->nWidth, ptr->nHeight, ptr->bPlanes, ptr->bBitsPerPixel, ptr->nWidthBytes); @@ -174,11 +174,11 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr ) * the mask and the second is the image. */ if (!(pixmapAll = XCreatePixmap( display, root_window, - ptr->nWidth, ptr->nHeight * 2, 1 ))) + ptr->nWidth, ptr->nHeight * 2, 1 ))) return 0; if (!(image = XCreateImage( display, visual, 1, ZPixmap, 0, (char *)(ptr + 1), ptr->nWidth, - ptr->nHeight * 2, 16, ptr->nWidthBytes/ptr->bBitsPerPixel))) + ptr->nHeight * 2, 16, ptr->nWidthBytes/ptr->bBitsPerPixel))) { XFreePixmap( display, pixmapAll ); return 0; @@ -206,7 +206,7 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr ) unsigned char *theMask, *theImage, theChar; int threshold, fgBits, bgBits, bitShifted; BYTE pXorBits[128]; /* Up to 32x32 icons */ - + switch (ptr->bBitsPerPixel) { case 24: @@ -233,7 +233,7 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr ) /* The location of the mask. */ theMask = (char *)(ptr + 1); /* The mask should still be 1 bit per pixel. The color image - * should immediately follow the mask. + * should immediately follow the mask. */ theImage = &theMask[ptr->nWidth/8 * ptr->nHeight]; rfg = gfg = bfg = rbg = gbg = bbg = 0; @@ -248,7 +248,7 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr ) ptr->nWidth, ptr->nHeight); } ymax = (ptr->nHeight > 32) ? 32 : ptr->nHeight; - + memset(pXorBits, 0, 128); for (y=0; ynWidth, ptr->nHeight ); @@ -352,7 +352,7 @@ Cursor X11DRV_GetCursor( Display *display, CURSORICONINFO *ptr ) * compatible between Windows and X11. Under X11, there * are only 3 possible color cursor: black, white and * masked. So we map the 4th Windows color (invert the - * bits on the screen) to black and an additional white bit on + * bits on the screen) to black and an additional white bit on * an other place (+1,+1). This require some boolean arithmetic: * * Windows | X11 diff --git a/dlls/x11drv/scroll.c b/dlls/x11drv/scroll.c index ec69bdf18b8..fd3832a0bdd 100644 --- a/dlls/x11drv/scroll.c +++ b/dlls/x11drv/scroll.c @@ -69,7 +69,7 @@ static BOOL fix_caret(HWND hWnd, LPRECT lprc, UINT flags) /************************************************************************* * ScrollDC (X11DRV.@) - * + * * Only the hrgnUpdate is returned in device coordinates. * rcUpdate must be returned in logical coordinates to comply with win API. * FIXME: the doc explicitly states the opposite, to be checked @@ -141,7 +141,7 @@ BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *rc, /************************************************************************* * ScrollWindowEx (X11DRV.@) * - * Note: contrary to what the doc says, pixels that are scrolled from the + * Note: contrary to what the doc says, pixels that are scrolled from the * outside of clipRect to the inside are NOT painted. */ INT X11DRV_ScrollWindowEx( HWND hwnd, INT dx, INT dy, diff --git a/dlls/x11drv/window.c b/dlls/x11drv/window.c index b90bce9648b..088706829bf 100644 --- a/dlls/x11drv/window.c +++ b/dlls/x11drv/window.c @@ -926,7 +926,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) { TRACE("CBT-hook returned !0\n"); goto failed; - } + } } @@ -1143,7 +1143,7 @@ HWND X11DRV_SetParent( HWND hwnd, HWND parent ) /* SetParent additionally needs to make hwnd the topmost window in the x-order and send the expected WM_WINDOWPOSCHANGING and - WM_WINDOWPOSCHANGED notification messages. + WM_WINDOWPOSCHANGED notification messages. */ SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | (was_visible ? SWP_SHOWWINDOW : 0) ); diff --git a/dlls/x11drv/wineclipsrv.c b/dlls/x11drv/wineclipsrv.c index f3d65f3cc17..ed77dae233c 100644 --- a/dlls/x11drv/wineclipsrv.c +++ b/dlls/x11drv/wineclipsrv.c @@ -38,7 +38,7 @@ * * NOTES: * - * The Wine Clipboard Server is a standalone XLib application whose + * The Wine Clipboard Server is a standalone XLib application whose * purpose is to manage the X selection when Wine exits. * The server itself is started automatically with the appropriate * selection masks, whenever Wine exits after acquiring the PRIMARY and/or @@ -138,7 +138,7 @@ char __debug_msg_enabled[DEBUG_CLASS_COUNT] = {1, 1, 0, 0}; #define C_TRACE 8 /* - * Global variables + * Global variables */ static Display *g_display = NULL; @@ -154,7 +154,7 @@ static char _CLIPBOARD[] = "CLIPBOARD"; /* CLIPBOARD atom name */ static int g_selectionToAcquire = 0; /* Masks for the selection to be acquired */ static int g_selectionAcquired = 0; /* Contains the current selection masks */ static int g_clearAllSelections = 0; /* If TRUE *all* selections are lost on SelectionClear */ - + /* Selection cache */ typedef struct tag_CACHEENTRY { @@ -185,7 +185,7 @@ static const char * const event_names[] = /* - * Prototypes + * Prototypes */ int RunAsDaemon( void ); @@ -213,12 +213,12 @@ int main(int argc, char **argv) if ( RunAsDaemon() == -1 ) { ERR("could not run as daemon\n"); - exit(1); + exit(1); } if ( !Init(argc, argv) ) exit(0); - + /* Acquire the selection after retrieving all clipboard data * owned by the current selection owner. If we were unable to * Acquire any selection, terminate right away. @@ -227,12 +227,12 @@ int main(int argc, char **argv) TerminateServer(0); TRACE("Clipboard server running...\n"); - + /* Start an X event loop */ while (1) { XNextEvent(g_display, &event); - + EVENT_ProcessEvent( &event ); } } @@ -283,9 +283,9 @@ BOOL Init(int argc, char **argv) XClassHint *class_hints = NULL; XTextProperty windowName; char *display_name = NULL; - + progname = argv[0]; - + if (!(size_hints = XAllocSizeHints())) { ERR(g_szOutOfMemory); @@ -301,39 +301,39 @@ BOOL Init(int argc, char **argv) ERR(g_szOutOfMemory); return 0; } - + /* connect to X server */ if ( (g_display=XOpenDisplay(display_name)) == NULL ) { ERR( "cannot connect to X server %s\n", XDisplayName(display_name)); return 0; } - + /* get screen size from display structure macro */ screen_num = DefaultScreen(g_display); display_width = DisplayWidth(g_display, screen_num); display_height = DisplayHeight(g_display, screen_num); - + /* size window with enough room for text */ width = display_width/3, height = display_height/4; - + /* create opaque window */ g_win = XCreateSimpleWindow(g_display, RootWindow(g_display,screen_num), 0, 0, width, height, border_width, BlackPixel(g_display, screen_num), WhitePixel(g_display,screen_num)); - - + + /* Set size hints for window manager. The window manager may * override these settings. */ - + /* x, y, width, and height hints are now taken from * the actual settings of the window when mapped. Note * that PPosition and PSize must be specified anyway. */ - + size_hints->flags = PPosition | PSize | PMinSize; size_hints->min_width = 300; size_hints->min_height = 200; - + /* These calls store window_name into XTextProperty structures * and sets the other fields properly. */ if (XStringListToTextProperty(&window_name, 1, &windowName) == 0) @@ -341,25 +341,25 @@ BOOL Init(int argc, char **argv) ERR( "structure allocation for windowName failed.\n"); TerminateServer(-1); } - + wm_hints->initial_state = NormalState; wm_hints->input = True; wm_hints->flags = StateHint | InputHint; - + class_hints->res_name = progname; class_hints->res_class = "WineClipSrv"; - XSetWMProperties(g_display, g_win, &windowName, NULL, - argv, argc, size_hints, wm_hints, + XSetWMProperties(g_display, g_win, &windowName, NULL, + argv, argc, size_hints, wm_hints, class_hints); /* Select event types wanted */ - XSelectInput(g_display, g_win, ExposureMask | KeyPressMask | + XSelectInput(g_display, g_win, ExposureMask | KeyPressMask | ButtonPressMask | StructureNotifyMask | PropertyChangeMask ); - + /* create GC for text and drawing */ getGC(g_win, &g_gc); - + /* Display window */ /* XMapWindow(g_display, g_win); */ @@ -375,17 +375,17 @@ BOOL Init(int argc, char **argv) if (argc > 2) { int dbgClasses = atoi(argv[2]); - + __SET_DEBUGGING(__DBCL_FIXME, dbgClasses & C_FIXME); __SET_DEBUGGING(__DBCL_ERR, dbgClasses & C_ERR); __SET_DEBUGGING(__DBCL_WARN, dbgClasses & C_WARN); __SET_DEBUGGING(__DBCL_TRACE, dbgClasses & C_TRACE); } - + /* Set the "ClearSelections" state from the command line argument */ if (argc > 3) g_clearAllSelections = atoi(argv[3]); - + return TRUE; } @@ -396,7 +396,7 @@ BOOL Init(int argc, char **argv) void TerminateServer( int ret ) { TRACE("Terminating Wine clipboard server...\n"); - + /* Free Primary and Clipboard selection caches */ EmptyCache(g_pPrimaryCache, g_cPrimaryTargets); EmptyCache(g_pClipboardCache, g_cClipboardTargets); @@ -414,7 +414,7 @@ void TerminateServer( int ret ) /************************************************************************** * AcquireSelection() * - * Acquire the selection after retrieving all clipboard data owned by + * Acquire the selection after retrieving all clipboard data owned by * the current selection owner. */ int AcquireSelection() @@ -446,12 +446,12 @@ int AcquireSelection() /* Acquire the PRIMARY selection */ while (XGetSelectionOwner(g_display,XA_PRIMARY) != g_win) XSetSelectionOwner(g_display, XA_PRIMARY, g_win, CurrentTime); - + g_selectionAcquired |= S_PRIMARY; } else TRACE("No PRIMARY targets - ownership not acquired.\n"); - + if (g_cClipboardTargets) { /* Acquire the CLIPBOARD selection */ @@ -530,7 +530,7 @@ int CacheDataFormats( Atom SelectionSrc, PCACHEENTRY *ppCache ) TRACE("Requesting TARGETS selection for '%s' (owner=%08x)...\n", XGetAtomName(g_display, SelectionSrc), (unsigned)ownerSelection ); - + XConvertSelection(g_display, SelectionSrc, aTargets, XInternAtom(g_display, "SELECTION_DATA", False), g_win, CurrentTime); @@ -568,14 +568,14 @@ int CacheDataFormats( Atom SelectionSrc, PCACHEENTRY *ppCache ) /* Allocate the selection cache */ *ppCache = (PCACHEENTRY)calloc(cSelectionTargets, sizeof(CACHEENTRY)); - + /* Cache these formats in the selection cache */ for (i = 0; i < cSelectionTargets; i++) { char *itemFmtName = XGetAtomName(g_display, targetList[i]); - + TRACE("\tAtom# %d: '%s'\n", i, itemFmtName); - + /* Populate the cache entry */ if (!FillCacheEntry( SelectionSrc, targetList[i], &((*ppCache)[i]))) ERR("Failed to fill cache entry!\n"); @@ -587,7 +587,7 @@ int CacheDataFormats( Atom SelectionSrc, PCACHEENTRY *ppCache ) /* Free the list of targets */ XFree(targetList); } - + return cSelectionTargets; } @@ -627,13 +627,13 @@ BOOL FillCacheEntry( Atom SelectionSrc, Atom target, PCACHEENTRY pCacheEntry ) w = xe.xselection.requestor; prop = xe.xselection.property; reqType = xe.xselection.target; - + if(prop == None) { TRACE("\tOwner failed to convert selection!\n"); return bRet; } - + TRACE("\tretrieving property %s from window %ld into %s\n", XGetAtomName(g_display,reqType), (long)w, XGetAtomName(g_display,prop) ); @@ -653,10 +653,10 @@ BOOL FillCacheEntry( Atom SelectionSrc, Atom target, PCACHEENTRY pCacheEntry ) XFree(val); val = NULL; } - + TRACE("\tretrieving %ld bytes...\n", itemSize * aformat/8); lRequestLength = (itemSize * aformat/8)/4 + 1; - + /* * Retrieve the actual property in the required X format. */ @@ -669,7 +669,7 @@ BOOL FillCacheEntry( Atom SelectionSrc, Atom target, PCACHEENTRY pCacheEntry ) TRACE("\tType %s,Format %d,nitems %ld,remain %ld,value %s\n", atype ? XGetAtomName(g_display,atype) : NULL, aformat,nitems,remain,val); - + if (remain) { WARN("\tCouldn't read entire property- selection may be too large! Remain=%ld\n", remain); @@ -699,7 +699,7 @@ END: /* Delete the property on the window now that we are done * This will send a PropertyNotify event to the selection owner. */ XDeleteProperty(g_display,w,prop); - + return TRUE; } @@ -732,7 +732,7 @@ BOOL LookupCacheItem( Atom selection, Atom target, PCACHEENTRY *ppCacheEntry ) return FALSE; *ppCacheEntry = NULL; - + /* Look for the target item in the cache */ for (i = 0; i < nCachetargets; i++) { @@ -755,7 +755,7 @@ BOOL LookupCacheItem( Atom selection, Atom target, PCACHEENTRY *ppCacheEntry ) void EmptyCache(PCACHEENTRY pCache, int nItems) { int i; - + if (!pCache) return; @@ -768,10 +768,10 @@ void EmptyCache(PCACHEENTRY pCache, int nItems) if (pCache[i].target == XA_PIXMAP || pCache[i].target == XA_BITMAP) { Pixmap *pPixmap = (Pixmap *)pCache[i].pData; - + TRACE("Freeing %s (handle=%ld)...\n", XGetAtomName(g_display, pCache[i].target), *pPixmap); - + XFreePixmap(g_display, *pPixmap); /* Free the cached data item (allocated by us) */ @@ -781,7 +781,7 @@ void EmptyCache(PCACHEENTRY pCache, int nItems) { TRACE("Freeing %s (%p)...\n", XGetAtomName(g_display, pCache[i].target), pCache[i].pData); - + /* Free the cached data item (allocated by X) */ XFree(pCache[i].pData); } @@ -803,7 +803,7 @@ void EVENT_ProcessEvent( XEvent *event ) /* TRACE(" event %s for Window %08lx\n", event_names[event->type], event->xany.window ); */ - + switch (event->type) { case Expose: @@ -814,10 +814,10 @@ void EVENT_ProcessEvent( XEvent *event ) /* Output something */ TextOut(g_win, g_gc, "Click here to terminate"); break; - + case ConfigureNotify: break; - + case ButtonPress: /* fall into KeyPress (no break) */ case KeyPress: @@ -827,11 +827,11 @@ void EVENT_ProcessEvent( XEvent *event ) case SelectionRequest: EVENT_SelectionRequest( (XSelectionRequestEvent *)event, FALSE ); break; - + case SelectionClear: EVENT_SelectionClear( (XSelectionClearEvent*)event ); break; - + case PropertyNotify: #if 0 EVENT_PropertyNotify( (XPropertyEvent *)event ); @@ -840,7 +840,7 @@ void EVENT_ProcessEvent( XEvent *event ) default: /* ignore all other events */ break; - + } /* end switch */ } @@ -867,12 +867,12 @@ Atom EVENT_SelectionRequest_MULTIPLE( XSelectionRequestEvent *pevent ) Atom* targetPropList=NULL; unsigned long cTargetPropList = 0; /* Atom xAtomPair = XInternAtom(g_display, "ATOM_PAIR", False); */ - + /* If the specified property is None the requestor is an obsolete client. * We support these by using the specified target atom as the reply property. */ rprop = pevent->property; - if( rprop == None ) + if( rprop == None ) rprop = pevent->target; if (!rprop) goto END; @@ -900,7 +900,7 @@ Atom EVENT_SelectionRequest_MULTIPLE( XSelectionRequestEvent *pevent ) if(aformat == 32 /* atype == xAtomPair */ ) { int i; - + /* Iterate through the ATOM_PAIR list and execute a SelectionRequest * for each (target,property) pair */ @@ -913,19 +913,19 @@ Atom EVENT_SelectionRequest_MULTIPLE( XSelectionRequestEvent *pevent ) TRACE("MULTIPLE(%d): Target='%s' Prop='%s'\n", i/2, targetName, propName); XFree(targetName); XFree(propName); - + /* We must have a non "None" property to service a MULTIPLE target atom */ if ( !targetPropList[i+1] ) { TRACE("\tMULTIPLE(%d): Skipping target with empty property!\n", i); continue; } - + /* Set up an XSelectionRequestEvent for this (target,property) pair */ memcpy( &event, pevent, sizeof(XSelectionRequestEvent) ); event.target = targetPropList[i]; event.property = targetPropList[i+1]; - + /* Fire a SelectionRequest, informing the handler that we are processing * a MULTIPLE selection request event. */ @@ -963,7 +963,7 @@ void EVENT_SelectionRequest( XSelectionRequestEvent *event, BOOL bIsMultiple ) * We support these by using the specified target atom as the reply property. */ rprop = event->property; - if( rprop == None ) + if( rprop == None ) rprop = event->target; TRACE("Request for %s in selection %s\n", @@ -988,7 +988,7 @@ void EVENT_SelectionRequest( XSelectionRequestEvent *event, BOOL bIsMultiple ) TRACE("\tUpdating property %s...\n", XGetAtomName(g_display, rprop)); /* If we have a request for a pixmap, return a duplicate */ - + if(event->target == XA_PIXMAP || event->target == XA_BITMAP) { Pixmap *pPixmap = (Pixmap *)pCacheEntry->pData; @@ -997,16 +997,16 @@ void EVENT_SelectionRequest( XSelectionRequestEvent *event, BOOL bIsMultiple ) } else pData = pCacheEntry->pData; - + XChangeProperty(g_display, request, rprop, pCacheEntry->type, pCacheEntry->nFormat, PropModeReplace, (unsigned char *)pData, pCacheEntry->nElements); END: - if( rprop == None) + if( rprop == None) TRACE("\tRequest ignored\n"); - /* reply to sender + /* reply to sender * SelectionNotify should be sent only at the end of a MULTIPLE request */ if ( !bIsMultiple ) @@ -1032,7 +1032,7 @@ END: void EVENT_SelectionClear( XSelectionClearEvent *event ) { Atom xaClipboard = XInternAtom(g_display, _CLIPBOARD, False); - + TRACE("()\n"); /* If we're losing the CLIPBOARD selection, or if the preferences in .winerc @@ -1042,21 +1042,21 @@ void EVENT_SelectionClear( XSelectionClearEvent *event ) if ( g_clearAllSelections || (event->selection == xaClipboard) ) { TRACE("Lost CLIPBOARD (+PRIMARY) selection\n"); - + /* We really lost CLIPBOARD but want to voluntarily lose PRIMARY */ if ( (event->selection == xaClipboard) && (g_selectionAcquired & S_PRIMARY) ) { XSetSelectionOwner(g_display, XA_PRIMARY, None, CurrentTime); } - + /* We really lost PRIMARY but want to voluntarily lose CLIPBOARD */ if ( (event->selection == XA_PRIMARY) && (g_selectionAcquired & S_CLIPBOARD) ) { XSetSelectionOwner(g_display, xaClipboard, None, CurrentTime); } - + g_selectionAcquired = S_NOSELECTION; /* Clear the selection masks */ } else if (event->selection == XA_PRIMARY) @@ -1087,7 +1087,7 @@ void EVENT_PropertyNotify( XPropertyEvent *event ) { TRACE("\tPropertyDelete for atom %s on window %ld\n", XGetAtomName(event->display, event->atom), (long)event->window); - + /* FreeResources( event->atom ); */ break; } @@ -1098,7 +1098,7 @@ void EVENT_PropertyNotify( XPropertyEvent *event ) XGetAtomName(event->display, event->atom), (long)event->window); break; } - + default: break; } @@ -1117,7 +1117,7 @@ Pixmap DuplicatePixmap(Pixmap pixmap) unsigned int depth, width, height; TRACE("\t() Pixmap=%ld\n", (long)pixmap); - + /* Get the Pixmap dimensions and bit depth */ if ( 0 == XGetGeometry(g_display, pixmap, &root, &x, &y, &width, &height, &border_width, &depth) ) @@ -1125,15 +1125,15 @@ Pixmap DuplicatePixmap(Pixmap pixmap) TRACE("\tPixmap properties: width=%d, height=%d, depth=%d\n", width, height, depth); - + newPixmap = XCreatePixmap(g_display, g_win, width, height, depth); - + xi = XGetImage(g_display, pixmap, 0, 0, width, height, AllPlanes, XYPixmap); XPutImage(g_display, newPixmap, g_gc, xi, 0, 0, 0, 0, width, height); XDestroyImage(xi); - + TRACE("\t() New Pixmap=%ld\n", (long)newPixmap); return newPixmap; } @@ -1157,12 +1157,12 @@ void getGC(Window win, GC *gc) /* Create default Graphics Context */ *gc = XCreateGC(g_display, win, valuemask, &values); - /* specify black foreground since default window background is + /* specify black foreground since default window background is * white and default foreground is undefined. */ XSetForeground(g_display, *gc, BlackPixel(g_display,screen_num)); /* set line attributes */ - XSetLineAttributes(g_display, *gc, line_width, line_style, + XSetLineAttributes(g_display, *gc, line_width, line_style, cap_style, join_style); /* set dashes */ @@ -1181,6 +1181,6 @@ void TextOut(Window win, GC gc, char *pStr) x_offset = 2; /* output text, centered on each line */ - XDrawString(g_display, win, gc, x_offset, y_offset, pStr, + XDrawString(g_display, win, gc, x_offset, y_offset, pStr, strlen(pStr)); } diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c index 06109bcf031..558a207fec8 100644 --- a/dlls/x11drv/winpos.c +++ b/dlls/x11drv/winpos.c @@ -1169,7 +1169,7 @@ BOOL X11DRV_ShowWindow( HWND hwnd, INT cmd ) switch(cmd) { case SW_HIDE: - if (!wasVisible) goto END;; + if (!wasVisible) goto END; swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER; break; diff --git a/dlls/x11drv/x11ddraw.c b/dlls/x11drv/x11ddraw.c index cf96a39fe30..6162a33dd90 100644 --- a/dlls/x11drv/x11ddraw.c +++ b/dlls/x11drv/x11ddraw.c @@ -61,42 +61,42 @@ static void SetPrimaryDIB(HBITMAP hBmp) } } -static LRESULT WINAPI GrabWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ +static LRESULT WINAPI GrabWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ Display *display = thread_display(); if(message != X11DRV_DD_GrabMessage) return CallWindowProcA(X11DRV_DD_GrabOldProcedure, hWnd, message, wParam, lParam); - + TRACE("hwnd=%d, grab=%d\n", hWnd, wParam); - if (wParam) - { - /* find the X11 window that ddraw uses */ - Window win = X11DRV_get_whole_window(hWnd); - TRACE("X11 window: %ld\n", win); - if (!win) { - TRACE("host off desktop\n"); - win = root_window; - } - - TSXGrabPointer(display, win, True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime); - } - else + if (wParam) { - TSXUngrabPointer(display, CurrentTime); - } + /* find the X11 window that ddraw uses */ + Window win = X11DRV_get_whole_window(hWnd); + TRACE("X11 window: %ld\n", win); + if (!win) { + TRACE("host off desktop\n"); + win = root_window; + } - return 0; -} + TSXGrabPointer(display, win, True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime); + } + else + { + TSXUngrabPointer(display, CurrentTime); + } + + return 0; +} static void GrabPointer(BOOL grab) { - if(grab) { - Window window = X11DRV_get_whole_window(GetFocus()); + if(grab) { + Window window = X11DRV_get_whole_window(GetFocus()); if(window) - XSetInputFocus(thread_display(), window, RevertToParent, CurrentTime); - } + XSetInputFocus(thread_display(), window, RevertToParent, CurrentTime); + } if(!X11DRV_DD_GrabMessage) X11DRV_DD_GrabMessage = RegisterWindowMessageA("WINE_X11DRV_GRABPOINTER"); diff --git a/dlls/x11drv/x11ddraw.h b/dlls/x11drv/x11ddraw.h index dcd690886f3..cb173f41584 100644 --- a/dlls/x11drv/x11ddraw.h +++ b/dlls/x11drv/x11ddraw.h @@ -20,9 +20,9 @@ #ifndef __WINE_X11DDRAW_H #define __WINE_X11DDRAW_H -#ifndef __WINE_CONFIG_H -# error You must include config.h to use this header -#endif +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif #include "ddrawi.h" diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c index 0f26b83c294..694241262e7 100644 --- a/dlls/x11drv/x11drv_main.c +++ b/dlls/x11drv/x11drv_main.c @@ -152,7 +152,7 @@ static void unlock_tsx11(void) /*********************************************************************** * get_server_startup * - * Get the server startup time + * Get the server startup time * Won't be exact, but should be sufficient */ static void get_server_startup(void) @@ -260,7 +260,7 @@ static void setup_options(void) * setup_opengl_visual * * Setup the default visual used for OpenGL and Direct3D, and the desktop - * window (if it exists). If OpenGL isn't available, the visual is simply + * window (if it exists). If OpenGL isn't available, the visual is simply * set to the default visual for the display */ #ifdef HAVE_OPENGL @@ -268,11 +268,11 @@ static void setup_opengl_visual( Display *display ) { int err_base, evt_base; - /* In order to support OpenGL or D3D, we require a double-buffered + /* In order to support OpenGL or D3D, we require a double-buffered * visual */ if (glXQueryExtension(display, &err_base, &evt_base) == True) { int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16,GLX_DOUBLEBUFFER,None}; - + ENTER_GL(); desktop_vi = glXChooseVisual(display, DefaultScreen(display), dblBuf); LEAVE_GL(); @@ -284,7 +284,7 @@ static void setup_opengl_visual( Display *display ) screen_depth = desktop_vi->depth; } } -#endif /* HAVE_OPENGL */ +#endif /* HAVE_OPENGL */ /*********************************************************************** * X11DRV process initialisation routine diff --git a/dlls/x11drv/xrender.c b/dlls/x11drv/xrender.c index 39b478f6d08..96a1a306d35 100644 --- a/dlls/x11drv/xrender.c +++ b/dlls/x11drv/xrender.c @@ -243,7 +243,7 @@ static gsCacheEntry *AllocEntry(void) assert(glyphsetCache[lastfree].count == -1); glyphsetCache[lastfree].count = 1; best = lastfree; - lastfree = glyphsetCache[lastfree].next; + lastfree = glyphsetCache[lastfree].next; assert(best != mru); glyphsetCache[best].next = mru; mru = best; @@ -301,7 +301,7 @@ static gsCacheEntry *AllocEntry(void) mru = best; TRACE("new free cache slot at %d\n", mru); return glyphsetCache + mru; -} +} static gsCacheEntry *GetCacheEntry(LFANDSIZE *plfsz) { @@ -420,7 +420,7 @@ void X11DRV_XRender_DeleteDC(X11DRV_PDEVICE *physDev) if(physDev->xrender->cacheEntry) dec_ref_cache(physDev->xrender->cacheEntry); - + HeapFree(GetProcessHeap(), 0, physDev->xrender); physDev->xrender = NULL; return; @@ -677,7 +677,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag dc->CursPosY = INTERNAL_YDPTOWP( dc, x + xwidth, y - ywidth ); } break; - + case TA_CENTER: x -= xwidth / 2; y += ywidth / 2; @@ -773,7 +773,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag physDev->xrender->lastTextColor = ~dc->textColor; } - + if(dc->textColor != physDev->xrender->lastTextColor) { if(dc->bitsPerPixel != 1) { /* Map 0 -- 0xff onto 0 -- 0xffff */ @@ -800,7 +800,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag */ if((dc->bitsPerPixel == 1) && ((dc->textColor & 0xffffff) == 0)) render_op = PictOpOutReverse; /* This gives us 'black' text */ - + for(idx = 0; idx < count; idx++) { if(glyphs[idx] >= physDev->xrender->cacheEntry->nrealized || physDev->xrender->cacheEntry->realized[glyphs[idx]] == FALSE) { @@ -814,7 +814,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag wine_tsx11_lock(); if(!lpDx) - pXRenderCompositeString16(gdi_display, render_op, + pXRenderCompositeString16(gdi_display, render_op, physDev->xrender->tile_pict, physDev->xrender->pict, physDev->xrender->cacheEntry->font_format, @@ -825,7 +825,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag else { INT offset = 0, xoff = 0, yoff = 0; for(idx = 0; idx < count; idx++) { - pXRenderCompositeString16(gdi_display, render_op, + pXRenderCompositeString16(gdi_display, render_op, physDev->xrender->tile_pict, physDev->xrender->pict, physDev->xrender->cacheEntry->font_format, @@ -845,7 +845,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag physDev->xrender->pict = 0; wine_tsx11_unlock(); - if (flags & ETO_CLIPPED) + if (flags & ETO_CLIPPED) RestoreVisRgn16( hdc ); X11DRV_UnlockDIBSection( physDev, TRUE ); diff --git a/dlls/x11drv/xvidmode.h b/dlls/x11drv/xvidmode.h index 12a8b9a09d0..b3b01b8ce98 100644 --- a/dlls/x11drv/xvidmode.h +++ b/dlls/x11drv/xvidmode.h @@ -20,9 +20,9 @@ #ifndef __WINE_XVIDMODE_H #define __WINE_XVIDMODE_H -#ifndef __WINE_CONFIG_H -# error You must include config.h to use this header -#endif +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif #ifdef HAVE_LIBXXF86VM #include "ddrawi.h" diff --git a/files/change.c b/files/change.c index 32370c02398..55477cd96c6 100644 --- a/files/change.c +++ b/files/change.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(file); * FindFirstChangeNotificationA (KERNEL32.@) */ HANDLE WINAPI FindFirstChangeNotificationA( LPCSTR lpPathName, BOOL bWatchSubtree, - DWORD dwNotifyFilter ) + DWORD dwNotifyFilter ) { HANDLE ret = INVALID_HANDLE_VALUE; @@ -60,7 +60,7 @@ HANDLE WINAPI FindFirstChangeNotificationA( LPCSTR lpPathName, BOOL bWatchSubtre */ HANDLE WINAPI FindFirstChangeNotificationW( LPCWSTR lpPathName, BOOL bWatchSubtree, - DWORD dwNotifyFilter) + DWORD dwNotifyFilter) { HANDLE ret = INVALID_HANDLE_VALUE; @@ -79,7 +79,7 @@ HANDLE WINAPI FindFirstChangeNotificationW( LPCWSTR lpPathName, /**************************************************************************** * FindNextChangeNotification (KERNEL32.@) */ -BOOL WINAPI FindNextChangeNotification( HANDLE handle ) +BOOL WINAPI FindNextChangeNotification( HANDLE handle ) { /* FIXME: do something */ return TRUE; @@ -88,7 +88,7 @@ BOOL WINAPI FindNextChangeNotification( HANDLE handle ) /**************************************************************************** * FindCloseChangeNotification (KERNEL32.@) */ -BOOL WINAPI FindCloseChangeNotification( HANDLE handle) +BOOL WINAPI FindCloseChangeNotification( HANDLE handle) { return CloseHandle( handle ); } diff --git a/files/directory.c b/files/directory.c index 37acb3e2a22..9d5cae6368d 100644 --- a/files/directory.c +++ b/files/directory.c @@ -67,7 +67,7 @@ static int DIR_GetPath( const char *keyname, const char *defval, PROFILE_GetWineIniString( "wine", keyname, defval, path, sizeof(path) ); if (!DOSFS_GetFullName( path, TRUE, full_name ) || (!FILE_Stat( full_name->long_name, &info ) && (mess=strerror(errno)))|| - (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (mess="not a directory")) || + (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (mess="not a directory")) || (!(GetLongPathNameA(full_name->short_name, longname, MAX_PATHNAME_LEN))) ) { if (warn) @@ -168,7 +168,7 @@ int DIR_Init(void) { TRACE("USERPROFILE= %s\n", longpath ); SetEnvironmentVariableA( "USERPROFILE", longpath ); - } + } TRACE("SYSTEMROOT = %s\n", DIR_Windows.short_name ); SetEnvironmentVariableA( "SYSTEMROOT", DIR_Windows.short_name ); @@ -409,7 +409,7 @@ BOOL WINAPI CreateDirectoryA( LPCSTR path, if (!DOSFS_GetFullName( path, FALSE, &full_name )) return 0; if (mkdir( full_name.long_name, 0777 ) == -1) { WARN_(file)("Error '%s' trying to create directory '%s'\n", strerror(errno), full_name.long_name); - /* the FILE_SetDosError() generated error codes don't match the + /* the FILE_SetDosError() generated error codes don't match the * CreateDirectory ones for some errnos */ switch (errno) { case EEXIST: SetLastError(ERROR_ALREADY_EXISTS); break; @@ -534,7 +534,7 @@ static BOOL DIR_SearchSemicolonedPaths(LPCSTR name, DOS_FULL_NAME *full_name, LP LPSTR next, buffer = NULL; INT len = strlen(name), newlen, currlen = 0; BOOL ret = FALSE; - + next = pathlist; while (!ret && next) { @@ -737,7 +737,7 @@ DWORD DIR_SearchPath( LPCSTR path, LPCSTR name, LPCSTR ext, /* Try the "App Paths" entry if existing (undocumented ??) */ if (DIR_TryAppPath(name, full_name)) goto done; - + /* Try all directories in path */ ret = DIR_TryEnvironmentPath( name, full_name, NULL ); @@ -771,7 +771,7 @@ done: * longer than the length of the buffer, the length of the * filename is returned. * Failure: Zero - * + * * NOTES * If the file is not found, calls SetLastError(ERROR_FILE_NOT_FOUND) * (tested on NT 4.0) @@ -917,7 +917,7 @@ static BOOL search_alternate_path(LPCSTR dll_path, LPCSTR name, LPCSTR ext, * longer than the length of the buffer, the length of the * filename is returned. * Failure: Zero - * + * * NOTES * If the file is not found, calls SetLastError(ERROR_FILE_NOT_FOUND) */ diff --git a/files/dos_fs.c b/files/dos_fs.c index 7947b35cf65..c045a981f48 100644 --- a/files/dos_fs.c +++ b/files/dos_fs.c @@ -32,7 +32,7 @@ #include #include #include -#ifdef HAVE_SYS_IOCTL_H +#ifdef HAVE_SYS_IOCTL_H #include #endif #include @@ -268,7 +268,7 @@ BOOL DOSFS_ToDosFCBFormat( LPCSTR name, LPSTR buffer ) buffer[11] = '\0'; /* at most 3 character of the extension are processed - * is something behind this ? + * is something behind this ? */ while (*p == '*' || *p == ' ') p++; /* skip wildcards and spaces */ return IS_END_OF_NAME(*p); @@ -326,7 +326,7 @@ static int DOSFS_MatchShort( const char *mask, const char *name ) * t*t test1.ta.tornado.txt * * ?est* test1.txt * * ?est??? test1.txt - - * *test1.txt* test1.txt * + * *test1.txt* test1.txt * * h?l?o*t.dat hellothisisatest.dat * */ static int DOSFS_MatchLong( const char *mask, const char *name, @@ -796,8 +796,8 @@ HANDLE DOSFS_OpenDevice( const char *name, DWORD access, DWORD attributes, LPSEC return 0; } if (!DuplicateHandle( GetCurrentProcess(), to_dup, GetCurrentProcess(), - &handle, 0, - sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle, + &handle, 0, + sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle, DUPLICATE_SAME_ACCESS )) handle = 0; return handle; @@ -841,7 +841,7 @@ static int DOSFS_GetPathDrive( const char **name ) { MESSAGE("Warning: %s not accessible from a configured DOS drive\n", *name ); /* Assume it really was a DOS name */ - drive = DRIVE_GetCurrentDrive(); + drive = DRIVE_GetCurrentDrive(); } } else drive = DRIVE_GetCurrentDrive(); @@ -1007,10 +1007,10 @@ BOOL DOSFS_GetFullName( LPCSTR name, BOOL check_last, DOS_FULL_NAME *full ) * observed: * longpath=NULL: LastError=ERROR_INVALID_PARAMETER, ret=0 * longpath="" or invalid: LastError=ERROR_BAD_PATHNAME, ret=0 - * + * * more observations ( with NT 3.51 (WinDD) ): * longpath <= 8.3 -> just copy longpath to shortpath - * longpath > 8.3 -> + * longpath > 8.3 -> * a) file does not exist -> return 0, LastError = ERROR_FILE_NOT_FOUND * b) file does exist -> set the short filename. * - trailing slashes are reproduced in the short name, even if the @@ -1067,7 +1067,7 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, /* check for path delimiters and reproduce them */ if ( longpath[lp] == '\\' || longpath[lp] == '/' ) { - if (!sp || tmpshortpath[sp-1]!= '\\') + if (!sp || tmpshortpath[sp-1]!= '\\') { /* strip double "\\" */ tmpshortpath[sp] = '\\'; @@ -1078,9 +1078,9 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, continue; } - tmplen = strcspn ( longpath + lp, "\\/" ); + tmplen = strcspn ( longpath + lp, "\\/" ); lstrcpynA ( tmpshortpath+sp, longpath + lp, tmplen+1 ); - + /* Check, if the current element is a valid dos name */ if ( DOSFS_ValidDOSName ( longpath + lp, !(flags & DRIVE_CASE_SENSITIVE) ) ) { sp += tmplen; @@ -1106,7 +1106,7 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, TRACE("returning %s\n", debugstr_a(shortpath) ); tmplen = strlen ( tmpshortpath ); HeapFree ( GetProcessHeap(), 0, tmpshortpath ); - + return tmplen; } @@ -1171,29 +1171,29 @@ DWORD WINAPI GetLongPathNameA( LPCSTR shortpath, LPSTR longpath, while ((ss[0]=='\\') && (ss>=longpath)) ss--; p=ss; while ((ss[0]!='\\') && (ss>=longpath)) ss--; - if (ss>=longpath) + if (ss>=longpath) { /* FIXME: aren't we more paranoid, than needed? */ while ((ll[0]=='/') && (ll>=full_name.long_name)) ll--; while ((ll[0]!='/') && (ll>=full_name.long_name)) ll--; - if (ll0) longlen -= (p-longpath); lstrcpynA( p, ll , longlen); /* Now, change all '/' to '\' */ - for (r=p; r<(p+longlen); r++ ) + for (r=p; r<(p+longlen); r++ ) if (r[0]=='/') r[0]='\\'; return strlen(longpath) - strlen(p) + longlen; } @@ -1232,7 +1232,7 @@ DWORD WINAPI GetLongPathNameW( LPCWSTR shortpath, LPWSTR longpath, * Implementation of GetFullPathNameA/W. * * bon@elektron 000331: - * A test for GetFullPathName with many pathological cases + * A test for GetFullPathName with many pathological cases * now gives identical output for Wine and OSR2 */ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result, @@ -1348,7 +1348,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result, namelen=strlen(full_name.short_name); if (!strcmp(full_name.short_name+namelen-3,"\\..")) { - /* one more strange case: "c:\test\test1\.." + /* one more strange case: "c:\test\test1\.." return "c:\test" */ *(full_name.short_name+namelen-3)=0; q = strrchr(full_name.short_name,'\\'); @@ -1361,8 +1361,8 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result, full_name.short_name[(namelen--)-1] =0; TRACE("got %s\n",full_name.short_name); - /* If the lpBuffer buffer is too small, the return value is the - size of the buffer, in characters, required to hold the path + /* If the lpBuffer buffer is too small, the return value is the + size of the buffer, in characters, required to hold the path plus the terminating \0 (tested against win95osr2, bon 001118) . */ ret = strlen(full_name.short_name); @@ -1388,7 +1388,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result, /*********************************************************************** * GetFullPathNameA (KERNEL32.@) * NOTES - * if the path closed with '\', *lastpart is 0 + * if the path closed with '\', *lastpart is 0 */ DWORD WINAPI GetFullPathNameA( LPCSTR name, DWORD len, LPSTR buffer, LPSTR *lastpart ) @@ -1426,7 +1426,7 @@ DWORD WINAPI GetFullPathNameW( LPCWSTR name, DWORD len, LPWSTR buffer, while ((p > buffer + 2) && (*p != (WCHAR)'\\')) p--; *lastpart = p + 1; } - else *lastpart = NULL; + else *lastpart = NULL; } return ret; } @@ -1472,7 +1472,7 @@ static int DOSFS_FindNextEx( FIND_FIRST_INFO *info, WIN32_FIND_DATAA *entry ) entry->dwReserved0 = 0; entry->dwReserved1 = 0; DOSFS_ToDosDTAFormat( DRIVE_GetLabel( info->drive ), entry->cFileName ); - strcpy( entry->cAlternateFileName, entry->cFileName ); + strcpy( entry->cAlternateFileName, entry->cFileName ); info->cur_pos++; TRACE("returning %s (%s) as label\n", entry->cFileName, entry->cAlternateFileName); @@ -1588,7 +1588,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask, if (!(info.dir && info.path == path && info.short_mask == short_mask && info.long_mask == long_mask && info.drive == drive && info.attr == attr && info.cur_pos <= skip)) - { + { /* Not in the cache, open it anew */ if (info.dir) DOSFS_CloseDir( info.dir ); @@ -1638,7 +1638,7 @@ HANDLE WINAPI FindFirstFileExA( DOS_FULL_NAME full_name; HGLOBAL handle; FIND_FIRST_INFO *info; - + if ((fSearchOp != FindExSearchNameMatch) || (dwAdditionalFlags != 0)) { FIXME("options not implemented 0x%08x 0x%08lx\n", fSearchOp, dwAdditionalFlags ); @@ -1727,7 +1727,7 @@ HANDLE WINAPI FindFirstFileExW( handle = FindFirstFileExA(pathA, fInfoLevelId, _lpFindFileData, fSearchOp, lpSearchFilter, dwAdditionalFlags); HeapFree( GetProcessHeap(), 0, pathA ); if (handle == INVALID_HANDLE_VALUE) return handle; - + switch(fInfoLevelId) { case FindExInfoStandard: @@ -1769,7 +1769,7 @@ BOOL WINAPI FindNextFileA( HANDLE handle, WIN32_FIND_DATAA *data ) { FIND_FIRST_INFO *info; - if ((handle == INVALID_HANDLE_VALUE) || + if ((handle == INVALID_HANDLE_VALUE) || !(info = (FIND_FIRST_INFO *)GlobalLock( handle ))) { SetLastError( ERROR_INVALID_HANDLE ); @@ -1863,7 +1863,7 @@ void DOSFS_UnixTimeToFileTime( time_t unix_time, FILETIME *filetime, { /* NOTES: - CONSTANTS: + CONSTANTS: The time difference between 1 January 1601, 00:00:00 and 1 January 1970, 00:00:00 is 369 years, plus the leap years from 1604 to 1968, excluding 1700, 1800, 1900. @@ -1890,7 +1890,7 @@ void DOSFS_UnixTimeToFileTime( time_t unix_time, FILETIME *filetime, will run. DETAILS: - + Take care not to remove the casts. I have tested these functions (in both versions) for a lot of numbers. I would be interested in results on other compilers than GCC. @@ -2020,7 +2020,7 @@ time_t DOSFS_FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder ) else a1 += (1 << 16) - 54590 - carry, carry = 1; a2 -= 27111902 + carry; - + /* If a is negative, replace a by (-1-a) */ negative = (a2 >= ((UINT)1) << 31); if (negative) @@ -2074,7 +2074,7 @@ time_t DOSFS_FileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder ) * -1: Overflow occurred or Divisor was 0 */ INT WINAPI MulDiv( - INT nMultiplicand, + INT nMultiplicand, INT nMultiplier, INT nDivisor) { @@ -2113,9 +2113,9 @@ INT WINAPI MulDiv( if ( ( (nMultiplicand < 0) && (nMultiplier < 0) ) || ( (nMultiplicand >= 0) && (nMultiplier >= 0) ) ) return ((nMultiplicand * nMultiplier) + (nDivisor/2)) / nDivisor; - + return ((nMultiplicand * nMultiplier) - (nDivisor/2)) / nDivisor; - + #endif } @@ -2182,7 +2182,7 @@ BOOL WINAPI LocalFileTimeToFileTime( const FILETIME *localft, utctime = mktime(xtm); if(xtm->tm_isdst > 0) utctime-=3600; DOSFS_UnixTimeToFileTime( utctime, utcft, remainder ); - return TRUE; + return TRUE; } @@ -2211,7 +2211,7 @@ BOOL WINAPI FileTimeToLocalFileTime( const FILETIME *utcft, if(xtm->tm_isdst > 0) time-=3600; DOSFS_UnixTimeToFileTime( 2*unixtime-time, localft, remainder ); #endif - return TRUE; + return TRUE; } @@ -2232,7 +2232,7 @@ BOOL WINAPI FileTimeToSystemTime( const FILETIME *ft, LPSYSTEMTIME syst ) syst->wMinute = xtm->tm_min; syst->wSecond = xtm->tm_sec; syst->wMilliseconds = remainder / 10000; - return TRUE; + return TRUE; } /*********************************************************************** @@ -2255,7 +2255,7 @@ DWORD WINAPI QueryDosDeviceA(LPCSTR devname,LPSTR target,DWORD bufsize) /* In theory all that are possible and have been defined. * Now just those below, since mirc uses it to check for special files. * - * (It is more complex, and supports netmounted stuff, and \\.\ stuff, + * (It is more complex, and supports netmounted stuff, and \\.\ stuff, * but currently we just ignore that.) */ #define CHECK(x) (strstr(devname,#x)==devname) @@ -2318,16 +2318,16 @@ BOOL WINAPI SystemTimeToFileTime( const SYSTEMTIME *syst, LPFILETIME ft ) xtm.tm_isdst = -1; #ifdef HAVE_TIMEGM utctime = timegm(&xtm); - DOSFS_UnixTimeToFileTime( utctime, ft, + DOSFS_UnixTimeToFileTime( utctime, ft, syst->wMilliseconds * 10000 ); #else localtim = mktime(&xtm); /* now we've got local time */ utc_tm = gmtime(&localtim); utctime = mktime(utc_tm); - DOSFS_UnixTimeToFileTime( 2*localtim -utctime, ft, + DOSFS_UnixTimeToFileTime( 2*localtim -utctime, ft, syst->wMilliseconds * 10000 ); #endif - return TRUE; + return TRUE; } /*********************************************************************** diff --git a/files/drive.c b/files/drive.c index d4736b4ec98..9e5b453d06a 100644 --- a/files/drive.c +++ b/files/drive.c @@ -282,7 +282,7 @@ int DRIVE_Init(void) else WARN("%s: not defined\n", name ); } - if (!count) + if (!count) { MESSAGE("Warning: no valid DOS drive found, check your configuration file.\n" ); /* Create a C drive pointing to Unix root dir */ @@ -528,7 +528,7 @@ static WORD CDROM_Data_FindBestVoldesc(int fd) /*********************************************************************** * DRIVE_ReadSuperblock * - * NOTE + * NOTE * DRIVE_SetLabel and DRIVE_SetSerialNumber use this in order * to check, that they are writing on a FAT filesystem ! */ @@ -568,12 +568,12 @@ int DRIVE_ReadSuperblock (int drive, char * buff) break; } - if ((offs) && (lseek(fd,offs,SEEK_SET)!=offs)) + if ((offs) && (lseek(fd,offs,SEEK_SET)!=offs)) { ret = -4; goto the_end; } - if (read(fd,buff,DRIVE_SUPER)!=DRIVE_SUPER) + if (read(fd,buff,DRIVE_SUPER)!=DRIVE_SUPER) { ret = -2; goto the_end; @@ -625,24 +625,24 @@ int DRIVE_WriteSuperblockEntry (int drive, off_t ofs, size_t len, char * buff) { int fd; - if ((fd=open(DOSDrives[drive].device,O_WRONLY))==-1) + if ((fd=open(DOSDrives[drive].device,O_WRONLY))==-1) { ERR("Cannot open the device %s (for writing)\n", - DOSDrives[drive].device); + DOSDrives[drive].device); return -1; } if (lseek(fd,ofs,SEEK_SET)!=ofs) { ERR("lseek failed on device %s !\n", - DOSDrives[drive].device); + DOSDrives[drive].device); close(fd); return -2; } - if (write(fd,buff,len)!=len) + if (write(fd,buff,len)!=len) { close(fd); ERR("Cannot write on %s !\n", - DOSDrives[drive].device); + DOSDrives[drive].device); return -3; } return close (fd); @@ -673,18 +673,18 @@ DWORD CDROM_Data_GetLabel(int drive, char *label) WORD offs = CDROM_Data_FindBestVoldesc(dev); WCHAR label_read[LABEL_LEN]; /* Unicode possible, too */ DWORD unicode_id = 0; - + if (offs) { if ((lseek(dev, offs+0x58, SEEK_SET) == offs+0x58) && (read(dev, &unicode_id, 3) == 3)) { int ver = (unicode_id & 0xff0000) >> 16; - + if ((lseek(dev, offs+0x28, SEEK_SET) != offs+0x28) || (read(dev, &label_read, LABEL_LEN) != LABEL_LEN)) goto failure; - + close(dev); if ((LOWORD(unicode_id) == 0x2f25) /* Unicode ID */ && ((ver == 0x40) || (ver == 0x43) || (ver == 0x45))) @@ -758,7 +758,7 @@ const char * DRIVE_GetLabel( int drive ) if (!DRIVE_IsValid( drive )) return NULL; if (DOSDrives[drive].type == DRIVE_CDROM) { - read = CDROM_GetLabel(drive, DOSDrives[drive].label_read); + read = CDROM_GetLabel(drive, DOSDrives[drive].label_read); } else if (DOSDrives[drive].flags & DRIVE_READ_VOL_INFO) @@ -812,11 +812,11 @@ static DWORD CDROM_Audio_GetSerial(HANDLE h) dwStart = FRAME_OF_TOC(toc, toc.FirstTrack); for (i = 0; i <= toc.LastTrack - toc.FirstTrack; i++) { - serial += (toc.TrackData[i].Address[0] << 16) | + serial += (toc.TrackData[i].Address[0] << 16) | (toc.TrackData[i].Address[1] << 8) | toc.TrackData[i].Address[2]; } dwEnd = FRAME_OF_TOC(toc, toc.LastTrack + 1); - + if (toc.LastTrack - toc.FirstTrack + 1 < 3) serial += wMagic + (dwEnd - dwStart); @@ -835,7 +835,7 @@ static DWORD CDROM_Data_GetSerial(int drive) unsigned char p[4]; } serial; BYTE b0 = 0, b1 = 1, b2 = 2, b3 = 3; - + if (dev == -1) return 0; offs = CDROM_Data_FindBestVoldesc(dev); @@ -846,7 +846,7 @@ static DWORD CDROM_Data_GetSerial(int drive) BYTE buf[2048]; OSVERSIONINFOA ovi; int i; - + lseek(dev, offs, SEEK_SET); read(dev, buf, 2048); /* @@ -872,7 +872,7 @@ static DWORD CDROM_Data_GetSerial(int drive) close(dev); return serial.val; } - + /************************************************************************** * CDROM_GetSerial [internal] */ @@ -900,7 +900,7 @@ static DWORD CDROM_GetSerial(int drive) case 0: break; } - + if (serial) TRACE("CD serial number is %04x-%04x.\n", HIWORD(serial), LOWORD(serial)); @@ -918,7 +918,7 @@ DWORD DRIVE_GetSerialNumber( int drive ) char buff[DRIVE_SUPER]; if (!DRIVE_IsValid( drive )) return 0; - + if (DOSDrives[drive].flags & DRIVE_READ_VOL_INFO) { switch(DOSDrives[drive].type) @@ -939,7 +939,7 @@ DWORD DRIVE_GetSerialNumber( int drive ) FIXME("Serial number reading from file system on drive %c: not supported yet.\n", drive+'A'); } } - + return (serial) ? serial : DOSDrives[drive].serial_conf; } @@ -957,7 +957,7 @@ int DRIVE_SetSerialNumber( int drive, DWORD serial ) { if ((DOSDrives[drive].type != DRIVE_REMOVABLE) && (DOSDrives[drive].type != DRIVE_FIXED)) return 0; - /* check, if the drive has a FAT filesystem */ + /* check, if the drive has a FAT filesystem */ if (DRIVE_ReadSuperblock(drive, buff)) return 0; if (DRIVE_WriteSuperblockEntry(drive, 0x27, 4, (char *) &serial)) return 0; return 1; @@ -1023,7 +1023,7 @@ int DRIVE_Chdir( int drive, const char *path ) DOSDrives[drive].dos_cwd = heap_strdup( full_name.short_name + 3 ); DOSDrives[drive].unix_cwd = heap_strdup( unix_cwd ); - if (pTask && (pTask->curdrive & 0x80) && + if (pTask && (pTask->curdrive & 0x80) && ((pTask->curdrive & ~0x80) == drive)) { lstrcpynA( pTask->curdir, full_name.short_name + 2, @@ -1072,9 +1072,9 @@ int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive ) { /* If new_drive is already valid, do nothing and return 0 otherwise, copy DOSDrives[existing_drive] to DOSDrives[new_drive] */ - + DOSDRIVE *old, *new; - + old = DOSDrives + existing_drive; new = DOSDrives + new_drive; @@ -1185,7 +1185,7 @@ int DRIVE_RawWrite(BYTE drive, DWORD begin, DWORD nr_sect, BYTE *dataptr, BOOL f /*********************************************************************** * DRIVE_GetFreeSpace */ -static int DRIVE_GetFreeSpace( int drive, PULARGE_INTEGER size, +static int DRIVE_GetFreeSpace( int drive, PULARGE_INTEGER size, PULARGE_INTEGER available ) { struct statfs info; @@ -1229,7 +1229,7 @@ static int DRIVE_GetFreeSpace( int drive, PULARGE_INTEGER size, * DRIVE_GetCurrentDirectory * Returns "X:\\path\\etc\\". * - * Despite the API description, return required length including the + * Despite the API description, return required length including the * terminating null when buffer too small. This is the real behaviour. */ @@ -1293,7 +1293,7 @@ BOOL16 WINAPI GetDiskFreeSpace16( LPCSTR root, LPDWORD cluster_sectors, * Fails if expression resulting from current drive's dir and "root" * is not a root dir of the target drive. * - * UNDOC: setting some LPDWORDs to NULL is perfectly possible + * UNDOC: setting some LPDWORDs to NULL is perfectly possible * if the corresponding info is unneeded. * * FIXME: needs to support UNC names from Win95 OSR2 on. @@ -1491,7 +1491,7 @@ BOOL WINAPI GetDiskFreeSpaceExW( LPCWSTR root, PULARGE_INTEGER avail, /*********************************************************************** * GetDriveType (KERNEL.136) - * This function returns the type of a drive in Win16. + * This function returns the type of a drive in Win16. * Note that it returns DRIVE_REMOTE for CD-ROMs, since MSCDEX uses the * remote drive API. The return value DRIVE_REMOTE for CD-ROMs has been * verified on Win 3.11 and Windows 95. Some programs rely on it, so don't @@ -1818,7 +1818,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, BOOL WINAPI SetVolumeLabelA( LPCSTR root, LPCSTR volname ) { int drive; - + /* FIXME, SetLastErrors missing */ if (!root) drive = DRIVE_GetCurrentDrive(); diff --git a/files/file.c b/files/file.c index 06bdf0f11cd..214fceadd8a 100644 --- a/files/file.c +++ b/files/file.c @@ -829,7 +829,7 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes) * Linux and Windows privileges. Under Linux only the owner of * the file is allowed to change file attributes. Under Windows, * applications expect that if you can write to a file, you can also - * change its attributes (see GENERIC_WRITE). We could try to be + * change its attributes (see GENERIC_WRITE). We could try to be * clever here but that would break multi-user installations where * users share read-only DLLs. This is because some installers like * to change attributes of already installed DLLs. @@ -923,7 +923,7 @@ static UINT FILE_GetTempFileName( LPCSTR path, LPCSTR prefix, UINT unique, p = buffer + strlen(buffer); /* add a \, if there isn't one and path is more than just the drive letter ... */ - if ( !((strlen(buffer) == 2) && (buffer[1] == ':')) + if ( !((strlen(buffer) == 2) && (buffer[1] == ':')) && ((p == buffer) || (p[-1] != '\\'))) *p++ = '\\'; if (isWin16) *p++ = '~'; @@ -1038,7 +1038,7 @@ static HFILE FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode, char *p; if (!ofs) return HFILE_ERROR; - + TRACE("%s %s %s %s%s%s%s%s%s%s%s%s\n",name, ((mode & 0x3 )==OF_READ)?"OF_READ": ((mode & 0x3 )==OF_WRITE)?"OF_WRITE": @@ -1058,7 +1058,7 @@ static HFILE FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode, ((mode & OF_EXIST )==OF_EXIST)?"OF_EXIST ":"", ((mode & OF_REOPEN )==OF_REOPEN)?"OF_REOPEN ":"" ); - + ofs->cBytes = sizeof(OFSTRUCT); ofs->nErrCode = 0; @@ -1072,7 +1072,7 @@ static HFILE FILE_DoOpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode, TRACE("%s %04x\n", name, mode ); /* the watcom 10.6 IDE relies on a valid path returned in ofs->szPathName - Are there any cases where getting the path here is wrong? + Are there any cases where getting the path here is wrong? Uwe Bonnes 1997 Apr 2 */ if (!GetFullPathNameA( name, sizeof(ofs->szPathName), ofs->szPathName, NULL )) goto error; @@ -1125,7 +1125,7 @@ found: sizeof(ofs->szPathName) ); if (mode & OF_SHARE_EXCLUSIVE) - /* Some InstallShield version uses OF_SHARE_EXCLUSIVE + /* Some InstallShield version uses OF_SHARE_EXCLUSIVE on the file /_ins0432._mp to determine how far installation has proceeded. _ins0432._mp is an executable and while running the @@ -1197,7 +1197,7 @@ not_found: /* We get here if the file does not exist */ error: /* We get here if there was an error opening the file */ ofs->nErrCode = GetLastError(); - WARN("(%s): return = HFILE_ERROR error= %d\n", + WARN("(%s): return = HFILE_ERROR error= %d\n", name,ofs->nErrCode ); return HFILE_ERROR; } @@ -1391,7 +1391,7 @@ HFILE WINAPI _lclose( HFILE hFile ) * * BUGS * - * Currently only works for WaitCommEvent, ReadFile, WriteFile + * Currently only works for WaitCommEvent, ReadFile, WriteFile * with communications ports. * */ @@ -1507,7 +1507,7 @@ async_end: * FILE_ReadFileEx (INTERNAL) */ static BOOL FILE_ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, - LPOVERLAPPED overlapped, + LPOVERLAPPED overlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, HANDLE hEvent) { @@ -1565,7 +1565,7 @@ error: * ReadFileEx (KERNEL32.@) */ BOOL WINAPI ReadFileEx(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, - LPOVERLAPPED overlapped, + LPOVERLAPPED overlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) { overlapped->InternalHigh = 0; @@ -1600,7 +1600,7 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead, int unix_handle, result, flags; enum fd_type type; - TRACE("%d %p %ld %p %p\n", hFile, buffer, bytesToRead, + TRACE("%d %p %ld %p %p\n", hFile, buffer, bytesToRead, bytesRead, overlapped ); if (bytesRead) *bytesRead = 0; /* Do this before anything else */ @@ -1618,10 +1618,10 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead, SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - + close(unix_handle); overlapped->InternalHigh = 0; - + if(!FILE_ReadFileEx(hFile, buffer, bytesToRead, overlapped, NULL, overlapped->hEvent)) return FALSE; @@ -1649,7 +1649,7 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead, default: /* normal unix files */ if (unix_handle == -1) - return FALSE; + return FALSE; if (overlapped) { close(unix_handle); @@ -1787,11 +1787,11 @@ error: * WriteFileEx (KERNEL32.@) */ BOOL WINAPI WriteFileEx(HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite, - LPOVERLAPPED overlapped, + LPOVERLAPPED overlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) { overlapped->InternalHigh = 0; - + return FILE_WriteFileEx(hFile, buffer, bytesToWrite, overlapped, lpCompletionRoutine, INVALID_HANDLE_VALUE); } @@ -1804,7 +1804,7 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite, int unix_handle, result, flags; enum fd_type type; - TRACE("%d %p %ld %p %p\n", hFile, buffer, bytesToWrite, + TRACE("%d %p %ld %p %p\n", hFile, buffer, bytesToWrite, bytesWritten, overlapped ); if (bytesWritten) *bytesWritten = 0; /* Do this before anything else */ @@ -1842,7 +1842,7 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite, switch(type) { case FD_TYPE_CONSOLE: - TRACE("%d %s %ld %p %p\n", hFile, debugstr_an(buffer, bytesToWrite), bytesToWrite, + TRACE("%d %s %ld %p %p\n", hFile, debugstr_an(buffer, bytesToWrite), bytesToWrite, bytesWritten, overlapped ); return WriteConsoleA(hFile, buffer, bytesToWrite, bytesWritten, NULL); default: @@ -1867,7 +1867,7 @@ BOOL WINAPI WriteFile( HANDLE hFile, LPCVOID buffer, DWORD bytesToWrite, return TRUE; } - + /*********************************************************************** * _hread (KERNEL.349) */ @@ -2060,11 +2060,11 @@ LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count ) * _hwrite (KERNEL32.@) * * experimentation yields that _lwrite: - * o truncates the file at the current position with + * o truncates the file at the current position with * a 0 len write * o returns 0 on a 0 length write * o works with console handles - * + * */ LONG WINAPI _hwrite( HFILE handle, LPCSTR buffer, LONG count ) { @@ -2323,7 +2323,7 @@ BOOL WINAPI MoveFileExA( LPCSTR fn1, LPCSTR fn2, DWORD flag ) /* FIXME: sparhawk@gmx.at In case of W9x and lesser this function should return 120 (ERROR_CALL_NOT_IMPLEMENTED) to be really compatible. Most programs wont have any problems though. In case - you encounter one, this is what you should return here. I don't know what's up + you encounter one, this is what you should return here. I don't know what's up with NT 3.5. Is this function available there or not? Does anybody really care about 3.5? :) */ @@ -2377,7 +2377,7 @@ BOOL WINAPI MoveFileExA( LPCSTR fn1, LPCSTR fn2, DWORD flag ) if (flag & MOVEFILE_DELAY_UNTIL_REBOOT) { /* FIXME: (bon@elektron.ikp.physik.th-darmstadt.de 970706) - Perhaps we should queue these command and execute it + Perhaps we should queue these command and execute it when exiting... What about using on_exit(2) */ FIXME("Please move existing file '%s' to file '%s' when Wine has finished\n", @@ -2420,13 +2420,13 @@ BOOL WINAPI MoveFileExA( LPCSTR fn1, LPCSTR fn2, DWORD flag ) { if (flag & MOVEFILE_DELAY_UNTIL_REBOOT) { - if (flag & MOVEFILE_COPY_ALLOWED) { + if (flag & MOVEFILE_COPY_ALLOWED) { WARN("Illegal flag\n"); SetLastError( ERROR_GEN_FAILURE ); return FALSE; } /* FIXME: (bon@elektron.ikp.physik.th-darmstadt.de 970706) - Perhaps we should queue these command and execute it + Perhaps we should queue these command and execute it when exiting... What about using on_exit(2) */ FIXME("Please delete file '%s' when Wine has finished\n", fn1); @@ -2951,12 +2951,12 @@ BOOL WINAPI GetFileAttributesExA( { DOS_FULL_NAME full_name; BY_HANDLE_FILE_INFORMATION info; - + if (lpFileName == NULL) return FALSE; if (lpFileInformation == NULL) return FALSE; if (fInfoLevelId == GetFileExInfoStandard) { - LPWIN32_FILE_ATTRIBUTE_DATA lpFad = + LPWIN32_FILE_ATTRIBUTE_DATA lpFad = (LPWIN32_FILE_ATTRIBUTE_DATA) lpFileInformation; if (!DOSFS_GetFullName( lpFileName, TRUE, &full_name )) return FALSE; if (!FILE_Stat( full_name.long_name, &info )) return FALSE; @@ -2985,7 +2985,7 @@ BOOL WINAPI GetFileAttributesExW( LPVOID lpFileInformation) { LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpFileName ); - BOOL res = + BOOL res = GetFileAttributesExA( nameA, fInfoLevelId, lpFileInformation); HeapFree( GetProcessHeap(), 0, nameA ); return res; diff --git a/files/profile.c b/files/profile.c index cb68ae7a90e..455e1b0c680 100644 --- a/files/profile.c +++ b/files/profile.c @@ -465,7 +465,7 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, const char *section_n p = section_name + strlen(section_name) - 1; while ((p > section_name) && PROFILE_isspace(*p)) p--; seclen = p - section_name + 1; - + while (PROFILE_isspace(*key_name)) key_name++; p = key_name + strlen(key_name) - 1; while ((p > key_name) && PROFILE_isspace(*p)) p--; @@ -552,7 +552,7 @@ static BOOL PROFILE_FlushFile(void) file = fopen( buffer, "w" ); unix_name = buffer; } - + if (!file) { WARN("could not save profile file %s\n", CurProfile->dos_name); @@ -622,7 +622,7 @@ static BOOL PROFILE_Open( LPCSTR filename ) /* Check for a match */ - if (strchr( filename, '/' ) || strchr( filename, '\\' ) || + if (strchr( filename, '/' ) || strchr( filename, '\\' ) || strchr( filename, ':' )) { if (!DOSFS_GetFullName( filename, FALSE, &full_name )) return FALSE; @@ -759,7 +759,7 @@ static INT PROFILE_GetSection( PROFILESECTION *section, LPCSTR section_name, *buffer = '\0'; if (len <= 1) /*If either lpszSection or lpszKey is NULL and the supplied - destination buffer is too small to hold all the strings, + destination buffer is too small to hold all the strings, the last string is truncated and followed by two null characters. In this case, the return value is equal to cchReturnBuffer minus two. */ @@ -834,8 +834,8 @@ static INT PROFILE_GetSectionNames( LPSTR buffer, UINT len ) * NULL "1" "x" 0 "" (!) * "" "1" "x" 1 "x" * NULL NULL "" 0 "" - * - * + * + * */ static INT PROFILE_GetString( LPCSTR section, LPCSTR key_name, LPCSTR def_val, LPSTR buffer, UINT len ) @@ -904,7 +904,7 @@ static BOOL PROFILE_SetString( LPCSTR section_name, LPCSTR key_name, if (!key) return FALSE; if (key->value) { - /* strip the leading spaces. We can safely strip \n\r and + /* strip the leading spaces. We can safely strip \n\r and * friends too, they should not happen here anyway. */ while (PROFILE_isspace(*value)) value++; @@ -1145,7 +1145,7 @@ static int PROFILE_GetPrivateProfileString( LPCSTR section, LPCSTR entry, int ret; LPSTR pDefVal = NULL; - if (!filename) + if (!filename) filename = "win.ini"; /* strip any trailing ' ' of def_val. */ @@ -1187,7 +1187,7 @@ static int PROFILE_GetPrivateProfileString( LPCSTR section, LPCSTR entry, if (pDefVal != def_val) /* allocated */ HeapFree(GetProcessHeap(), 0, pDefVal); - + return ret; } @@ -1327,7 +1327,7 @@ UINT WINAPI GetPrivateProfileIntA( LPCSTR section, LPCSTR entry, if (!buffer[0]) return (UINT)def_val; /* Don't use strtol() here ! - * (returns LONG_MAX/MIN on overflow instead of "proper" overflow) + * (returns LONG_MAX/MIN on overflow instead of "proper" overflow) YES, scan for unsigned format ! (otherwise compatibility error) */ if (!sscanf(buffer, "%lu", &result)) return 0; return (UINT)result; @@ -1371,7 +1371,7 @@ INT WINAPI GetPrivateProfileSectionA( LPCSTR section, LPSTR buffer, if (PROFILE_Open( filename )) ret = PROFILE_GetSection(CurProfile->section, section, buffer, len, FALSE, TRUE); - + LeaveCriticalSection( &PROFILE_CritSect ); return ret; @@ -1388,7 +1388,7 @@ INT WINAPI GetPrivateProfileSectionW (LPCWSTR section, LPWSTR buffer, LPSTR sectionA = HEAP_strdupWtoA( GetProcessHeap(), 0, section ); LPSTR filenameA = HEAP_strdupWtoA( GetProcessHeap(), 0, filename ); LPSTR bufferA = HeapAlloc( GetProcessHeap(), 0, len ); - INT ret = GetPrivateProfileSectionA( sectionA, bufferA, len, + INT ret = GetPrivateProfileSectionA( sectionA, bufferA, len, filenameA ); MultiByteToWideChar(CP_ACP,0,bufferA,ret,buffer,len); HeapFree( GetProcessHeap(), 0, sectionA ); @@ -1480,7 +1480,7 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry, /*********************************************************************** * WritePrivateProfileSection (KERNEL.416) */ -BOOL16 WINAPI WritePrivateProfileSection16( LPCSTR section, +BOOL16 WINAPI WritePrivateProfileSection16( LPCSTR section, LPCSTR string, LPCSTR filename ) { return WritePrivateProfileSectionA( section, string, filename ); @@ -1489,7 +1489,7 @@ BOOL16 WINAPI WritePrivateProfileSection16( LPCSTR section, /*********************************************************************** * WritePrivateProfileSectionA (KERNEL32.@) */ -BOOL WINAPI WritePrivateProfileSectionA( LPCSTR section, +BOOL WINAPI WritePrivateProfileSectionA( LPCSTR section, LPCSTR string, LPCSTR filename ) { BOOL ret = FALSE; @@ -1551,7 +1551,7 @@ BOOL16 WINAPI WriteProfileSection16( LPCSTR section, LPCSTR keys_n_values) * WriteProfileSectionA (KERNEL32.@) */ BOOL WINAPI WriteProfileSectionA( LPCSTR section, LPCSTR keys_n_values) - + { return WritePrivateProfileSectionA( section, keys_n_values, "win.ini"); } @@ -1589,36 +1589,36 @@ WORD WINAPI GetProfileSectionNames16(LPSTR buffer, WORD size) * * Returns the section names contained in the specified file. * FIXME: Where do we find this file when the path is relative? - * The section names are returned as a list of strings with an extra - * '\0' to mark the end of the list. Except for that the behavior + * The section names are returned as a list of strings with an extra + * '\0' to mark the end of the list. Except for that the behavior * depends on the Windows version. * * Win95: - * - if the buffer is 0 or 1 character long then it is as if it was of + * - if the buffer is 0 or 1 character long then it is as if it was of * infinite length. - * - otherwise, if the buffer is to small only the section names that fit + * - otherwise, if the buffer is to small only the section names that fit * are returned. - * - note that this means if the buffer was to small to return even just + * - note that this means if the buffer was to small to return even just * the first section name then a single '\0' will be returned. - * - the return value is the number of characters written in the buffer, + * - the return value is the number of characters written in the buffer, * except if the buffer was too smal in which case len-2 is returned * * Win2000: - * - if the buffer is 0, 1 or 2 characters long then it is filled with + * - if the buffer is 0, 1 or 2 characters long then it is filled with * '\0' and the return value is 0 - * - otherwise if the buffer is too small then the first section name that - * does not fit is truncated so that the string list can be terminated + * - otherwise if the buffer is too small then the first section name that + * does not fit is truncated so that the string list can be terminated * correctly (double '\0') - * - the return value is the number of characters written in the buffer - * except for the trailing '\0'. If the buffer is too small, then the + * - the return value is the number of characters written in the buffer + * except for the trailing '\0'. If the buffer is too small, then the * return value is len-2 - * - Win2000 has a bug that triggers when the section names and the - * trailing '\0' fit exactly in the buffer. In that case the trailing + * - Win2000 has a bug that triggers when the section names and the + * trailing '\0' fit exactly in the buffer. In that case the trailing * '\0' is missing. * * Wine implements the observed Win2000 behavior (except for the bug). * - * Note that when the buffer is big enough then the return value may be any + * Note that when the buffer is big enough then the return value may be any * value between 1 and len-1 (or len in Win95), including len-2. */ DWORD WINAPI GetPrivateProfileSectionNamesA( LPSTR buffer, DWORD size, @@ -1660,7 +1660,7 @@ DWORD WINAPI GetPrivateProfileSectionNamesW( LPWSTR buffer, DWORD size, /*********************************************************************** * GetPrivateProfileStruct (KERNEL.407) */ -BOOL16 WINAPI GetPrivateProfileStruct16(LPCSTR section, LPCSTR key, +BOOL16 WINAPI GetPrivateProfileStruct16(LPCSTR section, LPCSTR key, LPVOID buf, UINT16 len, LPCSTR filename) { return GetPrivateProfileStructA( section, key, buf, len, filename ); @@ -1671,7 +1671,7 @@ BOOL16 WINAPI GetPrivateProfileStruct16(LPCSTR section, LPCSTR key, * * Should match Win95's behaviour pretty much */ -BOOL WINAPI GetPrivateProfileStructA (LPCSTR section, LPCSTR key, +BOOL WINAPI GetPrivateProfileStructA (LPCSTR section, LPCSTR key, LPVOID buf, UINT len, LPCSTR filename) { BOOL ret = FALSE; @@ -1706,7 +1706,7 @@ BOOL WINAPI GetPrivateProfileStructA (LPCSTR section, LPCSTR key, BOOL highnibble = TRUE; BYTE b = 0, val; LPBYTE binbuf = (LPBYTE)buf; - + end -= 2; /* don't include checksum in output data */ /* translate ASCII hex format into binary data */ for (p=k->value; p < end; p++) @@ -1769,7 +1769,7 @@ BOOL WINAPI GetPrivateProfileStructW (LPCWSTR section, LPCWSTR key, /*********************************************************************** * WritePrivateProfileStruct (KERNEL.406) */ -BOOL16 WINAPI WritePrivateProfileStruct16 (LPCSTR section, LPCSTR key, +BOOL16 WINAPI WritePrivateProfileStruct16 (LPCSTR section, LPCSTR key, LPVOID buf, UINT16 bufsize, LPCSTR filename) { return WritePrivateProfileStructA( section, key, buf, bufsize, filename ); @@ -1778,7 +1778,7 @@ BOOL16 WINAPI WritePrivateProfileStruct16 (LPCSTR section, LPCSTR key, /*********************************************************************** * WritePrivateProfileStructA (KERNEL32.@) */ -BOOL WINAPI WritePrivateProfileStructA (LPCSTR section, LPCSTR key, +BOOL WINAPI WritePrivateProfileStructA (LPCSTR section, LPCSTR key, LPVOID buf, UINT bufsize, LPCSTR filename) { BOOL ret = FALSE; @@ -1804,7 +1804,7 @@ BOOL WINAPI WritePrivateProfileStructA (LPCSTR section, LPCSTR key, EnterCriticalSection( &PROFILE_CritSect ); - if (PROFILE_Open( filename )) + if (PROFILE_Open( filename )) ret = PROFILE_SetString( section, key, outstring, FALSE); LeaveCriticalSection( &PROFILE_CritSect ); diff --git a/files/smb.c b/files/smb.c index 881106e9414..5e092e79538 100644 --- a/files/smb.c +++ b/files/smb.c @@ -125,7 +125,7 @@ static DWORD NB_NameReq(LPCSTR host, unsigned char *buffer, int len) NBR_ADDWORD(&buffer[i],0x0000); i+=2; i += netbios_name(host,&buffer[i]); - + NBR_ADDWORD(&buffer[i],0x0020); i+=2; NBR_ADDWORD(&buffer[i],0x0001); i+=2; @@ -415,7 +415,7 @@ static int SMB_Header(unsigned char *buffer, unsigned char command, USHORT tree_ DWORD id; /* 0 */ - SMB_ADDHEADER(buffer,len); + SMB_ADDHEADER(buffer,len); /* 4 */ buffer[len++] = command; @@ -455,7 +455,7 @@ static BOOL SMB_NegotiateProtocol(int fd, USHORT *dialect) memset(buffer,0,sizeof buffer); len = SMB_Header(buffer, SMB_COM_NEGOTIATE, 0, 0); - + /* parameters */ buffer[len++] = 0; /* no parameters */ @@ -574,7 +574,7 @@ static BOOL SMB_TreeConnect(int fd, USHORT user_id, LPCSTR share_name, USHORT *t SMB_ADDWORD(&buffer[len],0); len += 2; /* AndXOffset */ SMB_ADDWORD(&buffer[len],0); len += 2; /* Flags */ SMB_ADDWORD(&buffer[len],1); len += 2; /* Password length */ - + /* SMB command buffer */ SMB_ADDWORD(&buffer[len],3); len += 2; /* command buffer len */ buffer[len++] = 0; /* null terminated password */ @@ -585,7 +585,7 @@ static BOOL SMB_TreeConnect(int fd, USHORT user_id, LPCSTR share_name, USHORT *t else return FALSE; len += slen+1; - + /* name of the service */ buffer[len++] = 0; @@ -638,21 +638,21 @@ static BOOL SMB_NtCreateOpen(int fd, USHORT tree_id, USHORT user_id, USHORT dial /* 0x1c */ SMB_ADDDWORD(&buffer[len],0); len += 4; /* initial allocation */ - SMB_ADDDWORD(&buffer[len],0); len += 4; - + SMB_ADDDWORD(&buffer[len],0); len += 4; + /* 0x24 */ SMB_ADDDWORD(&buffer[len],attributes); len += 4; /* ExtFileAttributes*/ /* 0x28 */ SMB_ADDDWORD(&buffer[len],sharing); len += 4; /* ShareAccess */ - + /* 0x2c */ ERR("creation = %08lx\n",creation); SMB_ADDDWORD(&buffer[len],creation); len += 4; /* CreateDisposition */ - + /* 0x30 */ SMB_ADDDWORD(&buffer[len],creation); len += 4; /* CreateOptions */ - + /* 0x34 */ SMB_ADDDWORD(&buffer[len],0); len += 4; /* Impersonation */ @@ -667,7 +667,7 @@ static BOOL SMB_NtCreateOpen(int fd, USHORT tree_id, USHORT user_id, USHORT dial else return FALSE; len += slen+1; - + /* name of the file */ buffer[len++] = 0; @@ -811,7 +811,7 @@ static BOOL SMB_Read(int fd, USHORT tree_id, USHORT user_id, USHORT dialect, USH unsigned char *buffer; int len,buf_size,n,i; - ERR("user %04x tree %04x file %04x count %04x offset %08lx\n", + ERR("user %04x tree %04x file %04x count %04x offset %08lx\n", user_id, tree_id, file_id, count, offset); buf_size = count+0x100; @@ -865,7 +865,7 @@ static BOOL SMB_Read(int fd, USHORT tree_id, USHORT user_id, USHORT dialect, USH *read = n; HeapFree(GetProcessHeap(),0,buffer); - + return TRUE; } @@ -1001,7 +1001,7 @@ HANDLE WINAPI SMB_CreateFileA( LPCSTR uncname, DWORD access, DWORD sharing, goto done; #if 0 - if(!SMB_NtCreateOpen(fd, tree_id, user_id, dialect, file, + if(!SMB_NtCreateOpen(fd, tree_id, user_id, dialect, file, access, sharing, sa, creation, attributes, template, &file_id )) { close(fd); @@ -1009,7 +1009,7 @@ HANDLE WINAPI SMB_CreateFileA( LPCSTR uncname, DWORD access, DWORD sharing, goto done; } #endif - if(!SMB_Open(fd, tree_id, user_id, dialect, file, + if(!SMB_Open(fd, tree_id, user_id, dialect, file, access, sharing, creation, attributes, &file_id )) { close(fd); @@ -1023,7 +1023,7 @@ HANDLE WINAPI SMB_CreateFileA( LPCSTR uncname, DWORD access, DWORD sharing, ERR("register failed\n"); close(fd); } - + done: HeapFree(GetProcessHeap(),0,name); return handle; diff --git a/files/tape.c b/files/tape.c index fe1ad048197..ab0f383c736 100644 --- a/files/tape.c +++ b/files/tape.c @@ -18,7 +18,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * TODO: + * TODO: * Everything, all functions are stubs. */ @@ -39,7 +39,7 @@ BOOL WINAPI BackupRead( HANDLE hFile, LPBYTE lpBuffer, DWORD nNumberOfBytesToRea FIXME("(%04x, %p, %ld, %p, %d, %d, %p) stub!\n", hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, bAbort, bProcessSecurity, lpContext); - + SetLastError( ERROR_NOT_SUPPORTED ); return FALSE; @@ -58,8 +58,8 @@ BOOL WINAPI BackupSeek( HANDLE hFile, DWORD dwLowBytesToSeek, DWORD dwHighBytesT SetLastError( ERROR_NOT_SUPPORTED ); - return FALSE; -} + return FALSE; +} /************************************************************************ @@ -128,7 +128,7 @@ DWORD WINAPI GetTapeParameters( HANDLE hDevice, DWORD dwOperation, DWORD WINAPI GetTapePosition( HANDLE hDevice, DWORD dwPositionType, LPDWORD lpdwPartition, LPDWORD lpdwOffsetLow, LPDWORD lpdwOffsetHigh ) -{ +{ FIXME("(%04x, %ld, %p, %p, %p) stub!\n", hDevice, dwPositionType, lpdwPartition, lpdwOffsetLow, lpdwOffsetHigh); @@ -155,7 +155,7 @@ DWORD WINAPI GetTapeStatus( HANDLE hDevice ) * PrepareTape (KERNEL32.@) */ DWORD WINAPI PrepareTape( HANDLE hDevice, DWORD dwOperation, BOOL bImmediate ) -{ +{ FIXME("(%04x, %ld, %d) stub!\n", hDevice, dwOperation, bImmediate); SetLastError( ERROR_NOT_SUPPORTED ); diff --git a/graphics/bitblt.c b/graphics/bitblt.c index d876fc64f94..818c8fb0754 100644 --- a/graphics/bitblt.c +++ b/graphics/bitblt.c @@ -112,7 +112,7 @@ BOOL16 WINAPI StretchBlt16( HDC16 hdcDst, INT16 xDst, INT16 yDst, BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst, INT widthDst, INT heightDst, HDC hdcSrc, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, + INT widthSrc, INT heightSrc, DWORD rop ) { BOOL ret = FALSE; @@ -176,7 +176,7 @@ BOOL WINAPI MaskBlt(HDC hdcDest, INT nXDest, INT nYDest, hbmMask,xMask,yMask,dwRop); return 1; } - + /********************************************************************* * PlgBlt [GDI32.@] * @@ -188,4 +188,4 @@ BOOL WINAPI PlgBlt( HDC hdcDest, const POINT *lpPoint, FIXME("PlgBlt, stub\n"); return 1; } - + diff --git a/graphics/dispdib.c b/graphics/dispdib.c index 8c1989f8001..8036f36a832 100644 --- a/graphics/dispdib.c +++ b/graphics/dispdib.c @@ -1,6 +1,6 @@ /* * DISPDIB.dll - * + * * Copyright 1998 Ove Kåven (with some help from Marcus Meissner) * * This library is free software; you can redistribute it and/or diff --git a/graphics/env.c b/graphics/env.c index 727affe7f87..eab4107fbe1 100644 --- a/graphics/env.c +++ b/graphics/env.c @@ -1,4 +1,4 @@ -/* +/* * Driver Environment functions * * Note: This has NOTHING to do with the task/process environment! @@ -41,7 +41,7 @@ static ENVTABLE EnvTable[20]; static ENVTABLE *SearchEnvTable(ATOM atom) { INT16 i; - + for (i = 19; i >= 0; i--) { if (EnvTable[i].atom == atom) return &EnvTable[i]; @@ -55,7 +55,7 @@ static ATOM GDI_GetNullPortAtom(void) if (!NullPortAtom) { char NullPort[256]; - + GetProfileStringA( "windows", "nullport", "none", NullPort, sizeof(NullPort) ); NullPortAtom = AddAtomA( NullPort ); @@ -113,7 +113,7 @@ INT16 WINAPI GetEnvironment16(LPCSTR lpPortName, LPDEVMODEA lpdev, UINT16 nMaxSi */ INT16 WINAPI SetEnvironment16(LPCSTR lpPortName, LPDEVMODEA lpdev, UINT16 nCount) { - ATOM atom; + ATOM atom; BOOL16 nullport = FALSE; LPSTR p; ENVTABLE *env; diff --git a/graphics/fontengine.c b/graphics/fontengine.c index ade4d8a8a60..606eefda567 100644 --- a/graphics/fontengine.c +++ b/graphics/fontengine.c @@ -23,14 +23,14 @@ #include #include "winbase.h" #include "font.h" -#include "wine/debug.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(font); /*********************************************************************** * EngineEnumerateFont (GDI.300) */ -WORD WINAPI +WORD WINAPI EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data ) { FIXME("(%s,%p,%lx),stub\n",fontname,proc,data); @@ -46,7 +46,7 @@ WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo) /* untested, don't know if it works. We seem to access some structure that is located after the - FONTINFO. The FONTINFO documentation says that there may + FONTINFO. The FONTINFO documentation says that there may follow some char-width table or font bitmap or vector info. I think it is some kind of font bitmap that begins at offset 0x52, as FONTINFO goes up to 0x51. @@ -69,7 +69,7 @@ WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo) WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo) { FIXME("(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo); - + return 0; } @@ -79,7 +79,7 @@ WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform WORD WINAPI EngineRealizeFontExt16(LONG l1, LONG l2, LONG l3, LONG l4) { FIXME("(%08lx,%08lx,%08lx,%08lx),stub\n",l1,l2,l3,l4); - + return 0; } @@ -121,5 +121,5 @@ DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string) { FIXME(" stub! (always fails)\n"); return -1; /* error */ - + } diff --git a/graphics/painting.c b/graphics/painting.c index e75ca264742..20ac608bfcb 100644 --- a/graphics/painting.c +++ b/graphics/painting.c @@ -151,8 +151,8 @@ BOOL WINAPI Arc( HDC hdc, INT left, INT top, INT right, /*********************************************************************** * ArcTo (GDI32.@) */ -BOOL WINAPI ArcTo( HDC hdc, - INT left, INT top, +BOOL WINAPI ArcTo( HDC hdc, + INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) @@ -169,7 +169,7 @@ BOOL WINAPI ArcTo( HDC hdc, return result; } GDI_ReleaseObj( hdc ); - /* + /* * Else emulate it. * According to the documentation, a line is drawn from the current * position to the starting point of the arc. @@ -212,7 +212,7 @@ BOOL WINAPI Pie( HDC hdc, INT left, INT top, if (!dc) return FALSE; if(PATH_IsPathOpen(dc->path)) - ret = PATH_Arc(dc,left,top,right,bottom,xstart,ystart,xend,yend,2); + ret = PATH_Arc(dc,left,top,right,bottom,xstart,ystart,xend,yend,2); else if(dc->funcs->pPie) ret = dc->funcs->pPie(dc->physDev,left,top,right,bottom,xstart,ystart,xend,yend); @@ -302,7 +302,7 @@ BOOL WINAPI Rectangle( HDC hdc, INT left, INT top, BOOL ret = FALSE; DC * dc = DC_GetDCUpdate( hdc ); if (dc) - { + { if(PATH_IsPathOpen(dc->path)) ret = PATH_Rectangle(dc, left, top, right, bottom); else if (dc->funcs->pRectangle) @@ -434,13 +434,13 @@ INT WINAPI ChoosePixelFormat( HDC hdc, const LPPIXELFORMATDESCRIPTOR ppfd ) DC * dc = DC_GetDCPtr( hdc ); TRACE("(%08x,%p)\n",hdc,ppfd); - + if (!dc) return 0; if (!dc->funcs->pChoosePixelFormat) FIXME(" :stub\n"); else ret = dc->funcs->pChoosePixelFormat(dc->physDev,ppfd); - GDI_ReleaseObj( hdc ); + GDI_ReleaseObj( hdc ); return ret; } @@ -469,7 +469,7 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat, if (!dc->funcs->pSetPixelFormat) FIXME(" :stub\n"); else bRet = dc->funcs->pSetPixelFormat(dc->physDev,iPixelFormat,ppfd); - GDI_ReleaseObj( hdc ); + GDI_ReleaseObj( hdc ); return bRet; } @@ -497,7 +497,7 @@ INT WINAPI GetPixelFormat( HDC hdc ) if (!dc->funcs->pGetPixelFormat) FIXME(" :stub\n"); else ret = dc->funcs->pGetPixelFormat(dc->physDev); - GDI_ReleaseObj( hdc ); + GDI_ReleaseObj( hdc ); return ret; } @@ -535,7 +535,7 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes, } else ret = dc->funcs->pDescribePixelFormat(dc->physDev,iPixelFormat,nBytes,ppfd); - GDI_ReleaseObj( hdc ); + GDI_ReleaseObj( hdc ); return ret; } @@ -565,7 +565,7 @@ BOOL WINAPI SwapBuffers( HDC hdc ) } else bRet = dc->funcs->pSwapBuffers(dc->physDev); - GDI_ReleaseObj( hdc ); + GDI_ReleaseObj( hdc ); return bRet; } @@ -603,7 +603,7 @@ BOOL16 WINAPI FillRgn16( HDC16 hdc, HRGN16 hrgn, HBRUSH16 hbrush ) return FillRgn( hdc, hrgn, hbrush ); } - + /*********************************************************************** * FillRgn (GDI32.@) */ @@ -829,7 +829,7 @@ BOOL16 WINAPI PolyPolygon16( HDC16 hdc, const POINT16* pt, const INT16* counts, return FALSE; } for (i=polygons;i--;) counts32[i]=counts[i]; - + ret = PolyPolygon(hdc,pt32,counts32,polygons); HeapFree( GetProcessHeap(), 0, counts32 ); HeapFree( GetProcessHeap(), 0, pt32 ); @@ -981,7 +981,7 @@ BOOL WINAPI PolyBezier( HDC hdc, const POINT* lppt, DWORD cPoints ) HeapFree( GetProcessHeap(), 0, Pts ); } } - + GDI_ReleaseObj( hdc ); return ret; } @@ -1035,12 +1035,12 @@ BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, F BOOL result; DC *dc; - if( (signed int)dwRadius < 0 ) + if( (signed int)dwRadius < 0 ) return FALSE; dc = DC_GetDCUpdate( hdc ); - if(!dc) return FALSE; - + if(!dc) return FALSE; + if(dc->funcs->pAngleArc) { result = dc->funcs->pAngleArc( dc->physDev, x, y, dwRadius, eStartAngle, eSweepAngle ); @@ -1049,27 +1049,27 @@ BOOL WINAPI AngleArc(HDC hdc, INT x, INT y, DWORD dwRadius, FLOAT eStartAngle, F return result; } GDI_ReleaseObj( hdc ); - + /* AngleArc always works counterclockwise */ arcdir = GetArcDirection( hdc ); - SetArcDirection( hdc, AD_COUNTERCLOCKWISE ); + SetArcDirection( hdc, AD_COUNTERCLOCKWISE ); x1 = x + cos(eStartAngle*M_PI/180) * dwRadius; y1 = y - sin(eStartAngle*M_PI/180) * dwRadius; x2 = x + cos((eStartAngle+eSweepAngle)*M_PI/180) * dwRadius; y2 = x - sin((eStartAngle+eSweepAngle)*M_PI/180) * dwRadius; - + LineTo( hdc, x1, y1 ); if( eSweepAngle >= 0 ) - result = Arc( hdc, x-dwRadius, y-dwRadius, x+dwRadius, y+dwRadius, + result = Arc( hdc, x-dwRadius, y-dwRadius, x+dwRadius, y+dwRadius, x1, y1, x2, y2 ); else - result = Arc( hdc, x-dwRadius, y-dwRadius, x+dwRadius, y+dwRadius, + result = Arc( hdc, x-dwRadius, y-dwRadius, x+dwRadius, y+dwRadius, x2, y2, x1, y1 ); - + if( result ) MoveToEx( hdc, x2, y2, NULL ); SetArcDirection( hdc, arcdir ); - return result; + return result; } /*********************************************************************** @@ -1084,7 +1084,7 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes, int i; dc = DC_GetDCUpdate( hdc ); - if(!dc) return FALSE; + if(!dc) return FALSE; if(dc->funcs->pPolyDraw) { @@ -1114,7 +1114,7 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes, { if( lpbTypes[i] == PT_MOVETO ) { - MoveToEx( hdc, lppt[i].x, lppt[i].y, NULL ); + MoveToEx( hdc, lppt[i].x, lppt[i].y, NULL ); lastmove.x = dc->CursPosX; lastmove.y = dc->CursPosY; } @@ -1125,24 +1125,24 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes, PolyBezierTo( hdc, &lppt[i], 3 ); i += 2; } - else - return FALSE; + else + return FALSE; if( lpbTypes[i] & PT_CLOSEFIGURE ) { if( PATH_IsPathOpen( dc->path ) ) CloseFigure( hdc ); - else + else LineTo( hdc, lastmove.x, lastmove.y ); } } - return TRUE; + return TRUE; } /****************************************************************** - * - * *Very* simple bezier drawing code, + * + * *Very* simple bezier drawing code, * * It uses a recursive algorithm to divide the curve in a series * of straight line segements. Not ideal but for me sufficient. @@ -1152,7 +1152,7 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes, * 7 July 1998 Rein Klazes */ - /* + /* * some macro definitions for bezier drawing * * to avoid trucation errors the coordinates are @@ -1161,12 +1161,12 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes, * and avoiding floating point arithmatic * 4 bits should allow 27 bits coordinates which I saw * somewere in the win32 doc's - * + * */ #define BEZIERSHIFTBITS 4 #define BEZIERSHIFTUP(x) ((x)<>BEZIERSHIFTBITS) /* maximum depth of recursion */ #define BEZIERMAXDEPTH 8 @@ -1175,14 +1175,14 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes, /* enough for one curve */ #define BEZIER_INITBUFSIZE (150) -/* calculate Bezier average, in this case the middle +/* calculate Bezier average, in this case the middle * correctly rounded... * */ #define BEZIERMIDDLE(Mid, P1, P2) \ (Mid).x=((P1).x+(P2).x + 1)/2;\ (Mid).y=((P1).y+(P2).y + 1)/2; - + /********************************************************** * BezierCheck helper function to check * that recursion can be terminated @@ -1192,7 +1192,7 @@ BOOL WINAPI PolyDraw(HDC hdc, const POINT *lppt, const BYTE *lpbTypes, * returns true if the recusion can be terminated */ static BOOL BezierCheck( int level, POINT *Points) -{ +{ INT dx, dy; dx=Points[3].x-Points[0].x; dy=Points[3].y-Points[0].y; @@ -1244,7 +1244,7 @@ static BOOL BezierCheck( int level, POINT *Points) return TRUE; } } - + /* Helper for GDI_Bezier. * Just handles one Bezier, so Points should point to four POINTs */ @@ -1286,7 +1286,7 @@ static void GDI_InternalBezier( POINT *Points, POINT **PtsOut, INT *dwOut, } - + /*********************************************************************** * GDI_Bezier [INTERNAL] * Calculate line segments that approximate -what microsoft calls- a bezier @@ -1301,7 +1301,7 @@ static void GDI_InternalBezier( POINT *Points, POINT **PtsOut, INT *dwOut, * count [I] Number of Points. Must be 3n+1. * nPtsOut [O] Will contain no of points that have been produced (i.e. no. of * lines+1). - * + * * RETURNS * * Ptr to an array of POINTs that contain the lines that approximinate the diff --git a/graphics/path.c b/graphics/path.c index 694bf4ae579..522066d0958 100644 --- a/graphics/path.c +++ b/graphics/path.c @@ -111,7 +111,7 @@ BOOL WINAPI BeginPath(HDC hdc) { BOOL ret = TRUE; DC *dc = DC_GetDCPtr( hdc ); - + if(!dc) return FALSE; if(dc->funcs->pBeginPath) @@ -150,7 +150,7 @@ BOOL WINAPI EndPath(HDC hdc) { BOOL ret = TRUE; DC *dc = DC_GetDCPtr( hdc ); - + if(!dc) return FALSE; if(dc->funcs->pEndPath) @@ -196,7 +196,7 @@ BOOL WINAPI AbortPath( HDC hdc ) { BOOL ret = TRUE; DC *dc = DC_GetDCPtr( hdc ); - + if(!dc) return FALSE; if(dc->funcs->pAbortPath) @@ -220,13 +220,13 @@ BOOL16 WINAPI CloseFigure16(HDC16 hdc) /*********************************************************************** * CloseFigure (GDI32.@) * - * FIXME: Check that SetLastError is being called correctly + * FIXME: Check that SetLastError is being called correctly */ BOOL WINAPI CloseFigure(HDC hdc) { BOOL ret = TRUE; DC *dc = DC_GetDCPtr( hdc ); - + if(!dc) return FALSE; if(dc->funcs->pCloseFigure) @@ -277,18 +277,18 @@ INT WINAPI GetPath(HDC hdc, LPPOINT pPoints, LPBYTE pTypes, INT ret = -1; GdiPath *pPath; DC *dc = DC_GetDCPtr( hdc ); - + if(!dc) return -1; - + pPath = &dc->path; - + /* Check that path is closed */ if(pPath->state!=PATH_Closed) { SetLastError(ERROR_CAN_NOT_COMPLETE); goto done; } - + if(nSize==0) ret = pPath->numEntriesUsed; else if(nSizenumEntriesUsed) @@ -326,8 +326,8 @@ HRGN16 WINAPI PathToRegion16(HDC16 hdc) /*********************************************************************** * PathToRegion (GDI32.@) * - * FIXME - * Check that SetLastError is being called correctly + * FIXME + * Check that SetLastError is being called correctly * * The documentation does not state this explicitly, but a test under Windows * shows that the region which is returned should be in device coordinates. @@ -340,9 +340,9 @@ HRGN WINAPI PathToRegion(HDC hdc) /* Get pointer to path */ if(!dc) return -1; - + pPath = &dc->path; - + /* Check that path is closed */ if(pPath->state!=PATH_Closed) SetLastError(ERROR_CAN_NOT_COMPLETE); else @@ -374,7 +374,7 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath) SetLastError(ERROR_CAN_NOT_COMPLETE); return FALSE; } - + /* Construct a region from the path and fill it */ if(PATH_PathToRegion(pPath, dc->polyFillMode, &hrgn)) { @@ -385,14 +385,14 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath) * transform would be easier but would require more overhead, especially * now that SaveDC saves the current path. */ - + /* Save the information about the old mapping mode */ mapMode=GetMapMode(dc->hSelf); GetViewportExtEx(dc->hSelf, &ptViewportExt); GetViewportOrgEx(dc->hSelf, &ptViewportOrg); GetWindowExtEx(dc->hSelf, &ptWindowExt); GetWindowOrgEx(dc->hSelf, &ptWindowOrg); - + /* Save world transform * NB: The Windows documentation on world transforms would lead one to * believe that this has to be done only in GM_ADVANCED; however, my @@ -400,7 +400,7 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath) * not reset the world transform. */ GetWorldTransform(dc->hSelf, &xform); - + /* Set MM_TEXT */ SetMapMode(dc->hSelf, MM_TEXT); SetViewportOrgEx(dc->hSelf, 0, 0, NULL); @@ -431,20 +431,20 @@ static BOOL PATH_FillPath(DC *dc, GdiPath *pPath) */ BOOL16 WINAPI FillPath16(HDC16 hdc) { - return (BOOL16) FillPath((HDC) hdc); + return (BOOL16) FillPath((HDC) hdc); } /*********************************************************************** * FillPath (GDI32.@) * * FIXME - * Check that SetLastError is being called correctly + * Check that SetLastError is being called correctly */ BOOL WINAPI FillPath(HDC hdc) { DC *dc = DC_GetDCPtr( hdc ); BOOL bRet = FALSE; - + if(!dc) return FALSE; if(dc->funcs->pFillPath) @@ -473,8 +473,8 @@ BOOL16 WINAPI SelectClipPath16(HDC16 hdc, INT16 iMode) /*********************************************************************** * SelectClipPath (GDI32.@) - * FIXME - * Check that SetLastError is being called correctly + * FIXME + * Check that SetLastError is being called correctly */ BOOL WINAPI SelectClipPath(HDC hdc, INT iMode) { @@ -482,7 +482,7 @@ BOOL WINAPI SelectClipPath(HDC hdc, INT iMode) HRGN hrgnPath; BOOL success = FALSE; DC *dc = DC_GetDCPtr( hdc ); - + if(!dc) return FALSE; if(dc->funcs->pSelectClipPath) @@ -490,7 +490,7 @@ BOOL WINAPI SelectClipPath(HDC hdc, INT iMode) else { pPath = &dc->path; - + /* Check that path is closed */ if(pPath->state!=PATH_Closed) SetLastError(ERROR_CAN_NOT_COMPLETE); @@ -582,7 +582,7 @@ BOOL PATH_AssignGdiPath(GdiPath *pPathDest, const GdiPath *pPathSrc) BOOL PATH_MoveTo(DC *dc) { GdiPath *pPath = &dc->path; - + /* Check that path is open */ if(pPath->state!=PATH_Open) /* FIXME: Do we have to call SetLastError? */ @@ -605,7 +605,7 @@ BOOL PATH_LineTo(DC *dc, INT x, INT y) { GdiPath *pPath = &dc->path; POINT point, pointCurPos; - + /* Check that path is open */ if(pPath->state!=PATH_Open) return FALSE; @@ -615,7 +615,7 @@ BOOL PATH_LineTo(DC *dc, INT x, INT y) point.y=y; if(!LPtoDP(dc->hSelf, &point, 1)) return FALSE; - + /* Add a PT_MOVETO if necessary */ if(pPath->newStroke) { @@ -627,7 +627,7 @@ BOOL PATH_LineTo(DC *dc, INT x, INT y) if(!PATH_AddEntry(pPath, &pointCurPos, PT_MOVETO)) return FALSE; } - + /* Add a PT_LINETO entry */ return PATH_AddEntry(pPath, &point, PT_LINETO); } @@ -637,7 +637,7 @@ BOOL PATH_LineTo(DC *dc, INT x, INT y) * Should be called when a call to RoundRect is performed on a DC that has * an open path. Returns TRUE if successful, else FALSE. * - * FIXME: it adds the same entries to the path as windows does, but there + * FIXME: it adds the same entries to the path as windows does, but there * is an error in the bezier drawing code so that there are small pixel-size * gaps when the resulting path is drawn by StrokePath() */ @@ -646,7 +646,7 @@ BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT e GdiPath *pPath = &dc->path; POINT corners[2], pointTemp; FLOAT_POINT ellCorners[2]; - + /* Check that path is open */ if(pPath->state!=PATH_Open) return FALSE; @@ -654,11 +654,11 @@ BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT e if(!PATH_CheckCorners(dc,corners,x1,y1,x2,y2)) return FALSE; - /* Add points to the roundrect path */ + /* Add points to the roundrect path */ ellCorners[0].x = corners[1].x-ell_width; - ellCorners[0].y = corners[0].y; - ellCorners[1].x = corners[1].x; - ellCorners[1].y = corners[0].y+ell_height; + ellCorners[0].y = corners[0].y; + ellCorners[1].x = corners[1].x; + ellCorners[1].y = corners[0].y+ell_height; if(!PATH_DoArcPart(pPath, ellCorners, 0, -M_PI_2, TRUE)) return FALSE; pointTemp.x = corners[0].x+ell_width/2; @@ -684,8 +684,8 @@ BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT e ellCorners[0].x = corners[1].x-ell_width; ellCorners[1].x = corners[1].x; if(!PATH_DoArcPart(pPath, ellCorners, M_PI_2, 0, FALSE)) - return FALSE; - + return FALSE; + /* Close the roundrect figure */ if(!CloseFigure(dc->hSelf)) return FALSE; @@ -744,14 +744,14 @@ BOOL PATH_Rectangle(DC *dc, INT x1, INT y1, INT x2, INT y2) } /* PATH_Ellipse - * + * * Should be called when a call to Ellipse is performed on a DC that has * an open path. This adds four Bezier splines representing the ellipse * to the path. Returns TRUE if successful, else FALSE. */ BOOL PATH_Ellipse(DC *dc, INT x1, INT y1, INT x2, INT y2) { - return( PATH_Arc(dc, x1, y1, x2, y2, x1, (y1+y2)/2, x1, (y1+y2)/2,0) && + return( PATH_Arc(dc, x1, y1, x2, y2, x1, (y1+y2)/2, x1, (y1+y2)/2,0) && CloseFigure(dc->hSelf) ); } @@ -777,7 +777,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2, /* FIXME: This function should check for all possible error returns */ /* FIXME: Do we have to respect newStroke? */ - + /* Check that path is open */ if(pPath->state!=PATH_Open) return FALSE; @@ -786,7 +786,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2, /* FIXME: Only in GM_COMPATIBLE? */ if(x1==x2 || y1==y2) return TRUE; - + /* Convert points to device coordinates */ corners[0].x=(FLOAT)x1; corners[0].y=(FLOAT)y1; @@ -845,7 +845,7 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2, corners[1].x--; corners[1].y--; } - + /* Add the arc to the path with one Bezier spline per quadrant that the * arc spans */ start=TRUE; @@ -895,12 +895,12 @@ BOOL PATH_Arc(DC *dc, INT x1, INT y1, INT x2, INT y2, } else if(lines==2) { - centre.x = (corners[0].x+corners[1].x)/2; + centre.x = (corners[0].x+corners[1].x)/2; centre.y = (corners[0].y+corners[1].y)/2; if(!PATH_AddEntry(pPath, ¢re, PT_LINETO | PT_CLOSEFIGURE)) return FALSE; } - + return TRUE; } @@ -934,7 +934,7 @@ BOOL PATH_PolyBezierTo(DC *dc, const POINT *pts, DWORD cbPoints) } return TRUE; } - + BOOL PATH_PolyBezier(DC *dc, const POINT *pts, DWORD cbPoints) { GdiPath *pPath = &dc->path; @@ -972,7 +972,7 @@ BOOL PATH_Polyline(DC *dc, const POINT *pts, DWORD cbPoints) } return TRUE; } - + BOOL PATH_PolylineTo(DC *dc, const POINT *pts, DWORD cbPoints) { GdiPath *pPath = &dc->path; @@ -1073,14 +1073,14 @@ BOOL PATH_PolyPolyline( DC *dc, const POINT* pts, const DWORD* counts, } return TRUE; } - + /*********************************************************************** * Internal functions */ /* PATH_CheckCorners * - * Helper function for PATH_RoundRect() and PATH_Rectangle() + * Helper function for PATH_RoundRect() and PATH_Rectangle() */ static BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, INT y2) { @@ -1093,7 +1093,7 @@ static BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, I corners[1].y=y2; if(!LPtoDP(dc->hSelf, corners, 2)) return FALSE; - + /* Make sure first corner is top left and second corner is bottom right */ if(corners[0].x>corners[1].x) { @@ -1107,7 +1107,7 @@ static BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, I corners[0].y=corners[1].y; corners[1].y=temp; } - + /* In GM_COMPATIBLE, don't include bottom and right edges */ if(dc->GraphicsMode==GM_COMPATIBLE) { @@ -1129,7 +1129,7 @@ static BOOL PATH_AddFlatBezier(GdiPath *pPath, POINT *pt, BOOL closed) if(!pts) return FALSE; for(i = 1; i < no; i++) - PATH_AddEntry(pPath, &pts[i], + PATH_AddEntry(pPath, &pts[i], (i == no-1 && closed) ? PT_LINETO | PT_CLOSEFIGURE : PT_LINETO); HeapFree( GetProcessHeap(), 0, pts ); return TRUE; @@ -1166,7 +1166,7 @@ static BOOL PATH_FlattenPath(GdiPath *pPath) PATH_EmptyPath(&newPath); return TRUE; } - + /* PATH_PathToRegion * * Creates a region from the specified path using the specified polygon @@ -1188,7 +1188,7 @@ static BOOL PATH_PathToRegion(GdiPath *pPath, INT nPolyFillMode, PATH_FlattenPath(pPath); /* FIXME: What happens when number of points is zero? */ - + /* First pass: Find out how many strokes there are in the path */ /* FIXME: We could eliminate this with some bookkeeping in GdiPath */ numStrokes=0; @@ -1197,14 +1197,14 @@ static BOOL PATH_PathToRegion(GdiPath *pPath, INT nPolyFillMode, numStrokes++; /* Allocate memory for number-of-points-in-stroke array */ - pNumPointsInStroke=(int *)HeapAlloc( GetProcessHeap(), 0, + pNumPointsInStroke=(int *)HeapAlloc( GetProcessHeap(), 0, sizeof(int) * numStrokes ); if(!pNumPointsInStroke) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return FALSE; } - + /* Second pass: remember number of points in each polygon */ iStroke=-1; /* Will get incremented to 0 at beginning of first stroke */ for(i=0; inumEntriesUsed; i++) @@ -1257,7 +1257,7 @@ static void PATH_EmptyPath(GdiPath *pPath) BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) { assert(pPath!=NULL); - + /* FIXME: If newStroke is true, perhaps we want to check that we're * getting a PT_MOVETO */ @@ -1266,7 +1266,7 @@ BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags) /* Check that path is open */ if(pPath->state!=PATH_Open) return FALSE; - + /* Reserve enough memory for an extra path entry */ if(!PATH_ReserveEntries(pPath, pPath->numEntriesUsed+1)) return FALSE; @@ -1296,7 +1296,7 @@ static BOOL PATH_ReserveEntries(GdiPath *pPath, INT numEntries) INT numEntriesToAllocate; POINT *pPointsNew; BYTE *pFlagsNew; - + assert(pPath!=NULL); assert(numEntries>=0); @@ -1317,11 +1317,11 @@ static BOOL PATH_ReserveEntries(GdiPath *pPath, INT numEntries) numEntriesToAllocate=numEntries; /* Allocate new arrays */ - pPointsNew=(POINT *)HeapAlloc( GetProcessHeap(), 0, + pPointsNew=(POINT *)HeapAlloc( GetProcessHeap(), 0, numEntriesToAllocate * sizeof(POINT) ); if(!pPointsNew) return FALSE; - pFlagsNew=(BYTE *)HeapAlloc( GetProcessHeap(), 0, + pFlagsNew=(BYTE *)HeapAlloc( GetProcessHeap(), 0, numEntriesToAllocate * sizeof(BYTE) ); if(!pFlagsNew) { @@ -1391,7 +1391,7 @@ static BOOL PATH_DoArcPart(GdiPath *pPath, FLOAT_POINT corners[], xNorm[i]=cos(angleStart); yNorm[i]=sin(angleStart); } - + /* Add starting point to path if desired */ if(addMoveTo) { @@ -1465,7 +1465,7 @@ BOOL WINAPI FlattenPath(HDC hdc) if(!dc) return FALSE; if(dc->funcs->pFlattenPath) ret = dc->funcs->pFlattenPath(dc->physDev); - else + else { GdiPath *pPath = &dc->path; if(pPath->state != PATH_Closed) @@ -1499,7 +1499,7 @@ static BOOL PATH_StrokePath(DC *dc, GdiPath *pPath) GetWindowExtEx(dc->hSelf, &szWindowExt); GetWindowOrgEx(dc->hSelf, &ptWindowOrg); GetWorldTransform(dc->hSelf, &xform); - + /* Set MM_TEXT */ SetMapMode(dc->hSelf, MM_TEXT); SetViewportOrgEx(dc->hSelf, 0, 0, NULL); @@ -1522,7 +1522,7 @@ static BOOL PATH_StrokePath(DC *dc, GdiPath *pPath) break; case PT_BEZIERTO: TRACE("Got PT_BEZIERTO\n"); - if(pPath->pFlags[i+1] != PT_BEZIERTO || + if(pPath->pFlags[i+1] != PT_BEZIERTO || (pPath->pFlags[i+2] & ~PT_CLOSEFIGURE) != PT_BEZIERTO) { ERR("Path didn't contain 3 successive PT_BEZIERTOs\n"); ret = FALSE; @@ -1647,7 +1647,7 @@ BOOL WINAPI WidenPath(HDC hdc) { DC *dc = DC_GetDCPtr( hdc ); BOOL ret = FALSE; - + if(!dc) return FALSE; if(dc->funcs->pWidenPath) diff --git a/graphics/x11drv/bitblt.c b/graphics/x11drv/bitblt.c index c4da3b231a2..5dd2904504e 100644 --- a/graphics/x11drv/bitblt.c +++ b/graphics/x11drv/bitblt.c @@ -48,7 +48,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bitblt); #define OP_ARGS(src,dst) (((src) << 2) | (dst)) #define OP_SRC(opcode) ((opcode) >> 6) -#define OP_DST(opcode) (((opcode) >> 4) & 3) +#define OP_DST(opcode) (((opcode) >> 4) & 3) #define OP_SRCDST(opcode) ((opcode) >> 4) #define OP_ROP(opcode) ((opcode) & 0x0f) @@ -786,7 +786,7 @@ static void BITBLT_StretchImage( XImage *srcImage, XImage *dstImage, ysrc += yinc; ydst++; } - } + } } else /* Shrinking */ { @@ -838,7 +838,7 @@ static void BITBLT_StretchImage( XImage *srcImage, XImage *dstImage, else if (((ydst + yinc) >> 16 == ydst >> 16) && (ysrc < visRectSrc->bottom-1)) continue; /* Restart loop for next overlapping row */ - + /* Store the destination row */ pixel = rowDst + visRectDst->right - 1; y = (ydst >> 16) - visRectDst->top; @@ -848,7 +848,7 @@ static void BITBLT_StretchImage( XImage *srcImage, XImage *dstImage, memset( rowDst, (mode == STRETCH_ANDSCANS) ? 0xff : 0x00, widthDst*sizeof(int) ); } - } + } HeapFree( GetProcessHeap(), 0, rowSrc ); } @@ -935,7 +935,7 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe /* MSDN says if StretchBlt must convert a bitmap from monochrome to color or vice versa, the forground and background color of the device context are used. In fact, it also applies to the - case when it is converted from mono to mono. */ + case when it is converted from mono to mono. */ XSetBackground( gdi_display, gc, physDevDst->textPixel ); XSetForeground( gdi_display, gc, physDevDst->backgroundPixel ); XCopyPlane( gdi_display, physDevSrc->drawable, pixmap, gc, @@ -1136,9 +1136,9 @@ static BOOL BITBLT_GetVisRectangles( DC *dcDst, INT xDst, INT yDst, rect.bottom = ySrc + heightSrc; if (widthSrc < 0) SWAP_INT32( &rect.left, &rect.right ); if (heightSrc < 0) SWAP_INT32( &rect.top, &rect.bottom ); - /* Apparently the clipping and visible regions are only for output, + /* Apparently the clipping and visible regions are only for output, so just check against totalExtent here to avoid BadMatch errors */ - if (!IntersectRect( visRectSrc, &rect, &dcSrc->totalExtent )) + if (!IntersectRect( visRectSrc, &rect, &dcSrc->totalExtent )) return FALSE; /* Intersect the rectangles */ @@ -1323,7 +1323,7 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT XSetFillStyle( gdi_display, physDevDst->gc, FillSolid ); } XFillRectangle( gdi_display, physDevDst->drawable, physDevDst->gc, - visRectDst.left, visRectDst.top, width, height ); + visRectDst.left, visRectDst.top, width, height ); wine_tsx11_unlock(); return TRUE; } diff --git a/graphics/x11drv/bitmap.c b/graphics/x11drv/bitmap.c index 9902e81b174..7ce26c74394 100644 --- a/graphics/x11drv/bitmap.c +++ b/graphics/x11drv/bitmap.c @@ -163,7 +163,7 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap ) /*********************************************************************** * GetBitmapBits (X11DRV.@) - * + * * RETURNS * Success: Number of bytes copied * Failure: 0 @@ -322,9 +322,9 @@ LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) GDI_ReleaseObj( hbitmap ); return 0; } - + /* copy 16 bit padded image buffer with real bitsperpixel to XImage */ - + startline = bits; switch (bmp->bitmap.bmBitsPixel) @@ -388,7 +388,7 @@ LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) startline += bmp->bitmap.bmWidthBytes; } break; - case 32: + case 32: for (h=0;hfuncs = X11DRV_DC_Funcs; pBmp->physBitmap = (void *)pixmap; GDI_ReleaseObj( hBmp ); @@ -493,7 +493,7 @@ HBITMAP X11DRV_BITMAP_CreateBitmapFromPixmap(Pixmap pixmap, BOOL bDeletePixmap) /* Get the bitmap dimensions */ width = pBmp->bitmap.bmWidth; height = pBmp->bitmap.bmHeight; - + hBmpCopy = CopyImage(hBmp, IMAGE_BITMAP, width, height, LR_CREATEDIBSECTION); /* We can now get rid of the HBITMAP wrapper we created earlier. @@ -501,13 +501,13 @@ HBITMAP X11DRV_BITMAP_CreateBitmapFromPixmap(Pixmap pixmap, BOOL bDeletePixmap) */ if (!bDeletePixmap) { - /* Manually clear the bitmap internals to prevent the Pixmap + /* Manually clear the bitmap internals to prevent the Pixmap * from being deleted by DeleteObject. */ pBmp->physBitmap = NULL; pBmp->funcs = NULL; } - DeleteObject(hBmp); + DeleteObject(hBmp); END: TRACE("\tReturning HBITMAP %x\n", hBmpCopy); diff --git a/graphics/x11drv/brush.c b/graphics/x11drv/brush.c index abe72d609e5..1d3955c02d1 100644 --- a/graphics/x11drv/brush.c +++ b/graphics/x11drv/brush.c @@ -44,7 +44,7 @@ static const char HatchBrushes[NB_HATCH_STYLES + 1][8] = }; /* Levels of each primary for dithering */ -#define PRIMARY_LEVELS 3 +#define PRIMARY_LEVELS 3 #define TOTAL_LEVELS (PRIMARY_LEVELS*PRIMARY_LEVELS*PRIMARY_LEVELS) /* Dithering matrix size */ @@ -142,7 +142,7 @@ static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color ) } prevColor = color; } - + pixmap = XCreatePixmap( gdi_display, root_window, MATRIX_SIZE, MATRIX_SIZE, screen_depth ); XPutImage( gdi_display, pixmap, BITMAP_colorGC, ditherImage, 0, 0, 0, 0, MATRIX_SIZE, MATRIX_SIZE ); @@ -201,7 +201,7 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap ) TSXCopyArea( gdi_display, (Pixmap)bmp->physBitmap, physDev->brush.pixmap, BITMAP_GC(bmp), 0, 0, 8, 8, 0, 0 ); } - + if (bmp->bitmap.bmBitsPixel > 1) { physDev->brush.fillStyle = FillTiled; @@ -240,7 +240,7 @@ HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) physDev->brush.pixmap = 0; } physDev->brush.style = logbrush.lbStyle; - + switch(logbrush.lbStyle) { case BS_NULL: @@ -251,7 +251,7 @@ HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) TRACE("BS_SOLID\n" ); BRUSH_SelectSolidBrush( physDev, logbrush.lbColor ); break; - + case BS_HATCHED: TRACE("BS_HATCHED\n" ); physDev->brush.pixel = X11DRV_PALETTE_ToPhysical( physDev, logbrush.lbColor ); @@ -259,7 +259,7 @@ HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) HatchBrushes[logbrush.lbHatch], 8, 8 ); physDev->brush.fillStyle = FillStippled; break; - + case BS_PATTERN: TRACE("BS_PATTERN\n"); if (!BRUSH_SelectPatternBrush( physDev, (HBITMAP)logbrush.lbHatch )) return 0; @@ -276,9 +276,9 @@ HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) (WORD)logbrush.lbColor ); BRUSH_SelectPatternBrush( physDev, hBitmap ); DeleteObject( hBitmap ); - GlobalUnlock16( (HGLOBAL16)logbrush.lbHatch ); + GlobalUnlock16( (HGLOBAL16)logbrush.lbHatch ); } - + break; } return hbrush; diff --git a/graphics/x11drv/codepage.c b/graphics/x11drv/codepage.c index d76a20ffe1a..24090eb11f6 100644 --- a/graphics/x11drv/codepage.c +++ b/graphics/x11drv/codepage.c @@ -461,19 +461,19 @@ static void X11DRV_GetTextMetricsA_normal( fontObject* pfo, LPTEXTMETRICA pTM ) ? 1 : pdf->dfUnderline; pTM->tmOverhang = 0; - if( pfo->fo_flags & FO_SYNTH_ITALIC ) + if( pfo->fo_flags & FO_SYNTH_ITALIC ) { pTM->tmOverhang += pTM->tmHeight/3; pTM->tmItalic = 1; - } else + } else pTM->tmItalic = pdf->dfItalic; pTM->tmWeight = pdf->dfWeight; - if( pfo->fo_flags & FO_SYNTH_BOLD ) + if( pfo->fo_flags & FO_SYNTH_BOLD ) { - pTM->tmOverhang++; + pTM->tmOverhang++; pTM->tmWeight += 100; - } + } pTM->tmFirstChar = pdf->dfFirstChar; pTM->tmLastChar = pdf->dfLastChar; @@ -652,19 +652,19 @@ static void X11DRV_GetTextMetricsA_cp932( fontObject* pfo, LPTEXTMETRICA pTM ) ? 1 : pdf->dfUnderline; pTM->tmOverhang = 0; - if( pfo->fo_flags & FO_SYNTH_ITALIC ) + if( pfo->fo_flags & FO_SYNTH_ITALIC ) { pTM->tmOverhang += pTM->tmHeight/3; pTM->tmItalic = 1; - } else + } else pTM->tmItalic = pdf->dfItalic; pTM->tmWeight = pdf->dfWeight; - if( pfo->fo_flags & FO_SYNTH_BOLD ) + if( pfo->fo_flags & FO_SYNTH_BOLD ) { - pTM->tmOverhang++; + pTM->tmOverhang++; pTM->tmWeight += 100; - } + } pTM->tmFirstChar = pdf_ansi->dfFirstChar; pTM->tmLastChar = pdf_ansi->dfLastChar; diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c index d3624370a5c..9d4e02382d1 100644 --- a/graphics/x11drv/dib.c +++ b/graphics/x11drv/dib.c @@ -202,7 +202,7 @@ int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping, * Build the color map from the bitmap palette. Should not be called * for a >8-bit deep bitmap. */ -int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse, WORD depth, +int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse, WORD depth, const BITMAPINFO *info, int *nColors ) { int colors; @@ -232,7 +232,7 @@ int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse, WORD dept if (coloruse == (WORD)-1) colorPtr = NULL; if (!(colorMapping = (int *)HeapAlloc(GetProcessHeap(), 0, - colors * sizeof(int) ))) + colors * sizeof(int) ))) return NULL; *nColors = colors; @@ -289,7 +289,7 @@ static INT X11DRV_DIB_GetNearestIndex(RGBQUAD *colormap, int numColors, BYTE r, * X11DRV_DIB_MaskToShift * * Helper for X11DRV_DIB_GetDIBits. - * Returns the by how many bits to shift a given color so that it is + * Returns the by how many bits to shift a given color so that it is * in the proper position. */ static INT X11DRV_DIB_MaskToShift(DWORD mask) @@ -310,10 +310,10 @@ static INT X11DRV_DIB_MaskToShift(DWORD mask) /*********************************************************************** * X11DRV_DIB_Convert_any_asis * - * All X11DRV_DIB_Convert_Xxx functions take at least the following + * All X11DRV_DIB_Convert_Xxx functions take at least the following * parameters: * - width - * This is the width in pixel of the surface to copy. This may be less + * This is the width in pixel of the surface to copy. This may be less * than the full width of the image. * - height * The number of lines to copy. This may be less than the full height @@ -332,15 +332,15 @@ static INT X11DRV_DIB_MaskToShift(DWORD mask) * Same as srclinebytes but for the destination. * * Notes: - * - The supported Dib formats are: pal1, pal4, pal8, rgb555, bgr555, + * - The supported Dib formats are: pal1, pal4, pal8, rgb555, bgr555, * rgb565, bgr565, rgb888 and any 32bit (0888) format. - * The supported XImage (Bmp) formats are: pal1, pal4, pal8, + * The supported XImage (Bmp) formats are: pal1, pal4, pal8, * rgb555, bgr555, rgb565, bgr565, rgb888, bgr888, rgb0888, bgr0888. * - Rgb formats are those for which the masks are such that: * red_mask > green_mask > blue_mask * - Bgr formats are those for which the masks sort in the other direction. * - Many conversion functions handle both rgb->bgr and bgr->rgb conversions - * so the comments use h, g, l to mean respectively the source color in the + * so the comments use h, g, l to mean respectively the source color in the * high bits, the green, and the source color in the low bits. */ static void X11DRV_DIB_Convert_any_asis(int width, int height, @@ -1373,12 +1373,12 @@ static void X11DRV_DIB_Convert_any0888_to_5x5(int width, int height, /* Here is how we proceed. Assume we have rsrc=0x0000ff00 and our pixel * contains 0x11223344. - * - first we shift 0x11223344 right by rRightShift to bring the most + * - first we shift 0x11223344 right by rRightShift to bring the most * significant bits of the red components in the bottom 5 (or 6) bits * -> 0x4488c * - then we remove non red bits by anding with the modified rdst (0x1f) * -> 0x0c - * - finally shift these bits left by rLeftShift so that they end up in + * - finally shift these bits left by rLeftShift so that they end up in * the right place * -> 0x3000 */ @@ -1620,7 +1620,7 @@ static void X11DRV_DIB_SetImageBits_1( int lines, const BYTE *srcbits, */ static void X11DRV_DIB_GetImageBits_1( int lines, BYTE *dstbits, DWORD dstwidth, DWORD srcwidth, - RGBQUAD *colors, PALETTEENTRY *srccolors, + RGBQUAD *colors, PALETTEENTRY *srccolors, XImage *bmpImage, DWORD linebytes ) { DWORD x; @@ -1992,7 +1992,7 @@ static void X11DRV_DIB_SetImageBits_4( int lines, const BYTE *srcbits, */ static void X11DRV_DIB_GetImageBits_4( int lines, BYTE *dstbits, DWORD srcwidth, DWORD dstwidth, - RGBQUAD *colors, PALETTEENTRY *srccolors, + RGBQUAD *colors, PALETTEENTRY *srccolors, XImage *bmpImage, DWORD linebytes ) { DWORD x; @@ -2566,7 +2566,7 @@ static void X11DRV_DIB_SetImageBits_8( int lines, const BYTE *srcbits, */ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, DWORD srcwidth, DWORD dstwidth, - RGBQUAD *colors, PALETTEENTRY *srccolors, + RGBQUAD *colors, PALETTEENTRY *srccolors, XImage *bmpImage, DWORD linebytes ) { DWORD x; @@ -2580,11 +2580,11 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, linebytes = -linebytes; } - /* - * Hack for now - * This condition is true when GetImageBits has been called by - * UpdateDIBSection. For now, GetNearestIndex is too slow to support - * 256 colormaps, so we'll just use for for GetDIBits calls. + /* + * Hack for now + * This condition is true when GetImageBits has been called by + * UpdateDIBSection. For now, GetNearestIndex is too slow to support + * 256 colormaps, so we'll just use for for GetDIBits calls. * (In somes cases, in a updateDIBSection, the returned colors are bad too) */ if (!srccolors) goto updatesection; @@ -2819,13 +2819,13 @@ static void X11DRV_DIB_GetImageBits_8( int lines, BYTE *dstbits, * SetDIBits for an 8-bit deep compressed DIB. * * This function rewritten 941113 by James Youngman. WINE blew out when I - * first ran it because my desktop wallpaper is a (large) RLE8 bitmap. + * first ran it because my desktop wallpaper is a (large) RLE8 bitmap. * - * This was because the algorithm assumed that all RLE8 bitmaps end with the + * This was because the algorithm assumed that all RLE8 bitmaps end with the * 'End of bitmap' escape code. This code is very much laxer in what it - * allows to end the expansion. Possibly too lax. See the note by + * allows to end the expansion. Possibly too lax. See the note by * case RleDelta. BTW, MS's documentation implies that a correct RLE8 - * bitmap should end with RleEnd, but on the other hand, software exists + * bitmap should end with RleEnd, but on the other hand, software exists * that produces ones that don't and Windows 3.1 doesn't complain a bit * about it. * @@ -2857,25 +2857,25 @@ static void X11DRV_DIB_SetImageBits_RLE8( int lines, const BYTE *bits, { length = *pIn++; - /* + /* * If the length byte is not zero (which is the escape value), - * We have a run of length pixels all the same colour. The colour - * index is stored next. + * We have a run of length pixels all the same colour. The colour + * index is stored next. * * If the length byte is zero, we need to read the next byte to * know what to do. [JAY] */ if (length != 0) { - /* - * [Run-Length] Encoded mode + /* + * [Run-Length] Encoded mode */ int color = colors[*pIn++]; while (length-- && x < dstwidth) XPutPixel(bmpImage, x++, y, color); } else { - /* + /* * Escape codes (may be an absolute sequence though) */ escape_code = (*pIn++); @@ -3164,7 +3164,7 @@ static void X11DRV_DIB_SetImageBits_16( int lines, const BYTE *srcbits, srcbits+=2*left; - /* We could split it into four separate cases to optimize + /* We could split it into four separate cases to optimize * but it is probably not worth it. */ for (h=lines-1; h>=0; h--) { @@ -4518,7 +4518,7 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) case 4: if (descr->compression) { XGetSubImage( gdi_display, descr->drawable, descr->xDest, descr->yDest, - descr->width, descr->height, AllPlanes, ZPixmap, + descr->width, descr->height, AllPlanes, ZPixmap, bmpImage, descr->xSrc, descr->ySrc ); X11DRV_DIB_SetImageBits_RLE4( descr->lines, descr->bits, @@ -4534,11 +4534,11 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) case 8: if (descr->compression) { XGetSubImage( gdi_display, descr->drawable, descr->xDest, descr->yDest, - descr->width, descr->height, AllPlanes, ZPixmap, + descr->width, descr->height, AllPlanes, ZPixmap, bmpImage, descr->xSrc, descr->ySrc ); X11DRV_DIB_SetImageBits_RLE8( descr->lines, descr->bits, descr->infoWidth, descr->width, - descr->xSrc, (int *)(descr->colorMap), + descr->xSrc, (int *)(descr->colorMap), bmpImage ); } else X11DRV_DIB_SetImageBits_8( descr->lines, descr->bits, @@ -4557,7 +4557,7 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) case 24: X11DRV_DIB_SetImageBits_24( descr->lines, descr->bits, descr->infoWidth, descr->width, - descr->xSrc, descr->physDev, + descr->xSrc, descr->physDev, descr->rMask, descr->gMask, descr->bMask, bmpImage, descr->dibpitch); break; @@ -4624,7 +4624,7 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) if (descr->useShm) { int saveRed, saveGreen, saveBlue; - + TRACE("XShmGetImage(%p, %ld, %p, %d, %d, %ld)\n", gdi_display, descr->drawable, bmpImage, descr->xSrc, descr->ySrc, AllPlanes); @@ -4632,12 +4632,12 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) /* We must save and restore the bmpImage's masks in order * to preserve them across the call to XShmGetImage, which * decides to eleminate them since it doesn't happen to know - * what the format of the image is supposed to be, even though + * what the format of the image is supposed to be, even though * we do. */ saveRed = bmpImage->red_mask; saveBlue= bmpImage->blue_mask; saveGreen = bmpImage->green_mask; - + XShmGetImage( gdi_display, descr->drawable, bmpImage, descr->xSrc, descr->ySrc, AllPlanes); @@ -4654,7 +4654,7 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) descr->width, lines, AllPlanes, ZPixmap, bmpImage, descr->xDest, descr->yDest ); } - + TRACE("Dib: depth=%2d r=%lx g=%lx b=%lx\n", descr->infoBpp,descr->rMask,descr->gMask,descr->bMask); TRACE("Bmp: depth=%2d/%2d r=%lx g=%lx b=%lx\n", @@ -4664,9 +4664,9 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) switch(descr->infoBpp) { case 1: - X11DRV_DIB_GetImageBits_1( descr->lines,(LPVOID)descr->bits, + X11DRV_DIB_GetImageBits_1( descr->lines,(LPVOID)descr->bits, descr->infoWidth, descr->width, - descr->colorMap, descr->palentry, + descr->colorMap, descr->palentry, bmpImage, descr->dibpitch ); break; @@ -4674,9 +4674,9 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) if (descr->compression) FIXME("Compression not yet supported!\n"); else - X11DRV_DIB_GetImageBits_4( descr->lines,(LPVOID)descr->bits, - descr->infoWidth, descr->width, - descr->colorMap, descr->palentry, + X11DRV_DIB_GetImageBits_4( descr->lines,(LPVOID)descr->bits, + descr->infoWidth, descr->width, + descr->colorMap, descr->palentry, bmpImage, descr->dibpitch ); break; @@ -4739,7 +4739,7 @@ INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDest, DWO int height, tmpheight; DC *dc = physDev->dc; - if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height, + if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height, &descr.infoBpp, &descr.compression ) == -1) return 0; tmpheight = height; @@ -4761,7 +4761,7 @@ INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDest, DWO case 1: case 4: case 8: - descr.colorMap = (RGBQUAD *)X11DRV_DIB_BuildColorMap( + descr.colorMap = (RGBQUAD *)X11DRV_DIB_BuildColorMap( coloruse == DIB_PAL_COLORS ? physDev : NULL, coloruse, dc->bitsPerPixel, info, &descr.nColorMap ); if (!descr.colorMap) return 0; @@ -4794,7 +4794,7 @@ INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDest, DWO descr.drawable = physDev->drawable; descr.gc = physDev->gc; descr.xSrc = xSrc; - descr.ySrc = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy) + descr.ySrc = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy) : ySrc - startscan; descr.xDest = dc->DCOrgX + XLPTODP( dc, xDest ); descr.yDest = dc->DCOrgY + YLPTODP( dc, yDest ) + @@ -4942,7 +4942,7 @@ INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, lines = 0; goto done; } - + if (DIB_GetBitmapInfo( &info->bmiHeader, &descr.infoWidth, &descr.lines, &descr.infoBpp, &descr.compression ) == -1) { @@ -4985,7 +4985,7 @@ INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, descr.xDest = 0; descr.yDest = 0; descr.xSrc = 0; - + if (descr.lines > 0) { descr.ySrc = (descr.height-1) - (startscan + (lines-1)); @@ -5058,7 +5058,7 @@ static void X11DRV_DIB_DoCopyDIBSection(BITMAPOBJ *bmp, BOOL toDIB, { X11DRV_DIBSECTION *dib = (X11DRV_DIBSECTION *) bmp->dib; X11DRV_DIB_IMAGEBITS_DESCR descr; - + if (DIB_GetBitmapInfo( &dib->dibSection.dsBmih, &descr.infoWidth, &descr.lines, &descr.infoBpp, &descr.compression ) == -1) return; @@ -5116,7 +5116,7 @@ static void X11DRV_DIB_DoCopyDIBSection(BITMAPOBJ *bmp, BOOL toDIB, } else { - TRACE("Copying from DIB bits to Pixmap\n"); + TRACE("Copying from DIB bits to Pixmap\n"); X11DRV_DIB_SetImageBits( &descr ); } } @@ -5205,7 +5205,7 @@ static BOOL X11DRV_DIB_FaultHandler( LPVOID res, LPCVOID addr ) { BITMAPOBJ *bmp; INT state; - + bmp = (BITMAPOBJ *)GDI_GetObjPtr( (HBITMAP)res, BITMAP_MAGIC ); if (!bmp) return FALSE; @@ -5635,7 +5635,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection( X11DRV_DIBSECTION *dib = NULL; int *colorMap = NULL; int nColorMap; - + /* Fill BITMAP32 structure with DIB data */ BITMAPINFOHEADER *bi = &bmi->bmiHeader; INT effHeight, totalSize; @@ -5645,7 +5645,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection( TRACE("format (%ld,%ld), planes %d, bpp %d, size %ld, colors %ld (%s)\n", bi->biWidth, bi->biHeight, bi->biPlanes, bi->biBitCount, bi->biSizeImage, bi->biClrUsed, usage == DIB_PAL_COLORS? "PAL" : "RGB"); - + effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight; bm.bmType = 0; bm.bmWidth = bi->biWidth; @@ -5655,12 +5655,12 @@ HBITMAP X11DRV_DIB_CreateDIBSection( bm.bmPlanes = bi->biPlanes; bm.bmBitsPixel = bi->biBitCount; bm.bmBits = NULL; - + /* Get storage location for DIB bits. Only use biSizeImage if it's valid and we're dealing with a compressed bitmap. Otherwise, use width * height. */ totalSize = bi->biSizeImage && bi->biCompression != BI_RGB ? bi->biSizeImage : bm.bmWidthBytes * effHeight; - + if (section) { SYSTEM_INFO SystemInfo; @@ -5671,7 +5671,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection( mapOffset = offset - (offset % SystemInfo.dwAllocationGranularity); mapSize = totalSize + (offset - mapOffset); mapBits = MapViewOfFile( section, - FILE_MAP_ALL_ACCESS, + FILE_MAP_ALL_ACCESS, 0L, mapOffset, mapSize ); @@ -5681,10 +5681,10 @@ HBITMAP X11DRV_DIB_CreateDIBSection( bm.bmBits = (LPVOID) offset; else { offset = 0; - bm.bmBits = VirtualAlloc(NULL, totalSize, + bm.bmBits = VirtualAlloc(NULL, totalSize, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); } - + /* Create Color Map */ if (bm.bmBits && bm.bmBitsPixel <= 8) colorMap = X11DRV_DIB_BuildColorMap( usage == DIB_PAL_COLORS? physDev : NULL, @@ -5722,14 +5722,14 @@ HBITMAP X11DRV_DIB_CreateDIBSection( } dib->dibSection.dshSection = section; dib->dibSection.dsOffset = offset; - + dib->status = DIB_Status_None; dib->nColorMap = nColorMap; dib->colorMap = colorMap; } - + /* Create Device Dependent Bitmap and add DIB pointer */ - if (dib) + if (dib) { res = CreateDIBitmap(physDev->hdc, bi, 0, NULL, bmi, usage); if (res) @@ -5738,7 +5738,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection( if (bmp) bmp->dib = (DIBSECTION *) dib; } } - + /* Create XImage */ if (dib && bmp) { @@ -5756,7 +5756,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection( dib->image = X11DRV_DIB_CreateXImage( bm.bmWidth, effHeight, bmp->bitmap.bmBitsPixel ); #endif } - + /* Clean up in case of errors */ if (!res || !bmp || !dib || !bm.bmBits || (bm.bmBitsPixel <= 8 && !colorMap)) { @@ -5769,7 +5769,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection( else if (!offset) VirtualFree(bm.bmBits, 0L, MEM_RELEASE), bm.bmBits = NULL; } - + if (dib && dib->image) { XDestroyImage(dib->image); dib->image = NULL; } if (colorMap) { HeapFree(GetProcessHeap(), 0, colorMap); colorMap = NULL; } if (dib) { HeapFree(GetProcessHeap(), 0, dib); dib = NULL; } @@ -5800,7 +5800,7 @@ void X11DRV_DIB_DeleteDIBSection(BITMAPOBJ *bmp) { X11DRV_DIBSECTION *dib = (X11DRV_DIBSECTION *) bmp->dib; - if (dib->image) + if (dib->image) { #ifdef HAVE_LIBXXSHM if (dib->shminfo.shmid != -1) @@ -5814,7 +5814,7 @@ void X11DRV_DIB_DeleteDIBSection(BITMAPOBJ *bmp) #endif XDestroyImage( dib->image ); } - + if (dib->colorMap) HeapFree(GetProcessHeap(), 0, dib->colorMap); @@ -5842,7 +5842,7 @@ UINT X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, c * of the bitmap object. */ X11DRV_DIB_Lock(bmp, DIB_Status_AppMod, FALSE); - X11DRV_DIB_GenColorMap( physDev, dib->colorMap, DIB_RGB_COLORS, + X11DRV_DIB_GenColorMap( physDev, dib->colorMap, DIB_RGB_COLORS, dib->dibSection.dsBm.bmBitsPixel, TRUE, colors, start, end ); X11DRV_DIB_Unlock(bmp, TRUE); @@ -5907,7 +5907,7 @@ HGLOBAL X11DRV_DIB_CreateDIBFromPixmap(Pixmap pixmap, HDC hdc, BOOL bDeletePixma * an optional color palette and the pixel data. */ hPackedDIB = DIB_CreateDIBFromBitmap(hdc, hBmp); - + /* Get a pointer to the BITMAPOBJ structure */ pBmp = (BITMAPOBJ *)GDI_GetObjPtr( hBmp, BITMAP_MAGIC ); @@ -5921,8 +5921,8 @@ HGLOBAL X11DRV_DIB_CreateDIBFromPixmap(Pixmap pixmap, HDC hdc, BOOL bDeletePixma pBmp->funcs = NULL; } GDI_ReleaseObj( hBmp ); - DeleteObject(hBmp); - + DeleteObject(hBmp); + END: TRACE("\tReturning packed DIB %x\n", hPackedDIB); return hPackedDIB; @@ -5943,16 +5943,16 @@ Pixmap X11DRV_DIB_CreatePixmapFromDIB( HGLOBAL hPackedDIB, HDC hdc ) LPBITMAPINFO pbmi = NULL; LPBITMAPINFOHEADER pbmiHeader = NULL; LPBYTE pbits = NULL; - + /* Get a pointer to the packed DIB's data */ pPackedDIB = (LPBYTE)GlobalLock(hPackedDIB); pbmiHeader = (LPBITMAPINFOHEADER)pPackedDIB; pbmi = (LPBITMAPINFO)pPackedDIB; pbits = (LPBYTE)(pPackedDIB + DIB_BitmapInfoSize( (LPBITMAPINFO)pbmiHeader, DIB_RGB_COLORS )); - + /* Create a DDB from the DIB */ - + hBmp = CreateDIBitmap(hdc, pbmiHeader, CBM_INIT, @@ -5965,7 +5965,7 @@ Pixmap X11DRV_DIB_CreatePixmapFromDIB( HGLOBAL hPackedDIB, HDC hdc ) TRACE("CreateDIBitmap returned %x\n", hBmp); /* Retrieve the internal Pixmap from the DDB */ - + pBmp = (BITMAPOBJ *) GDI_GetObjPtr( hBmp, BITMAP_MAGIC ); pixmap = (Pixmap)pBmp->physBitmap; @@ -5976,7 +5976,7 @@ Pixmap X11DRV_DIB_CreatePixmapFromDIB( HGLOBAL hPackedDIB, HDC hdc ) /* Delete the DDB we created earlier now that we have stolen its pixmap */ GDI_ReleaseObj( hBmp ); DeleteObject(hBmp); - + TRACE("\tReturning Pixmap %ld\n", pixmap); return pixmap; } diff --git a/graphics/x11drv/graphics.c b/graphics/x11drv/graphics.c index 7ea2e1398c2..2f202492665 100644 --- a/graphics/x11drv/graphics.c +++ b/graphics/x11drv/graphics.c @@ -286,7 +286,7 @@ BOOL X11DRV_SetupGCForText( X11DRV_PDEVICE *physDev ) GCFunction | GCForeground | GCBackground | GCFillStyle | GCFont, &val ); return TRUE; - } + } WARN("Physical font failure\n" ); return FALSE; } @@ -319,7 +319,7 @@ X11DRV_LineTo( X11DRV_PDEVICE *physDev, INT x, INT y ) dc->DCOrgY + end.y); /* Update the DIBSection from the pixmap */ - X11DRV_UnlockDIBSection(physDev, TRUE); + X11DRV_UnlockDIBSection(physDev, TRUE); } return TRUE; } @@ -361,8 +361,8 @@ X11DRV_DrawArc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, if( dc->ArcDirection == AD_CLOCKWISE ) { INT tmp = xstart; xstart = xend; xend = tmp; - tmp = ystart; ystart = yend; yend = tmp; } - + tmp = ystart; ystart = yend; yend = tmp; } + oldwidth = width = physDev->pen.width; oldendcap = physDev->pen.endcap; if (!width) width = 1; @@ -434,13 +434,13 @@ X11DRV_DrawArc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, cos(end_angle) * (right-left-width*2+2) / 2. + 0.5); points[1].y = (int) floor(dc->DCOrgY + (top+bottom)/2.0 - sin(end_angle) * (bottom-top-width*2+2) / 2. + 0.5); - - /* OK, this stuff is optimized for Xfree86 + + /* OK, this stuff is optimized for Xfree86 * which is probably the server most used by - * wine users. Other X servers will not + * wine users. Other X servers will not * display correctly. (eXceed for instance) * so if you feel you must make changes, make sure that - * you either use Xfree86 or separate your changes + * you either use Xfree86 or separate your changes * from these (compile switch or whatever) */ if (lines == 2) { @@ -465,7 +465,7 @@ X11DRV_DrawArc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, dy1=points[3].y-points[2].y; if(((top-bottom) | -2 ) == -2) if(dy1 < 0) points[2].y--; - if( dx1<0){ + if( dx1<0){ if( dy1>0) points[3].y--; if(((right-left) | -2) == -2 ) points[2].x--; }else { @@ -542,7 +542,7 @@ X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT botto if (right < left) { INT tmp = right; right = left; left = tmp; } if (bottom < top) { INT tmp = bottom; bottom = top; top = tmp; } - + oldwidth = width = physDev->pen.width; if (!width) width = 1; if(physDev->pen.style == PS_NULL) width = 0; @@ -579,7 +579,7 @@ X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT botto /* Update the DIBSection from the pixmap */ X11DRV_UnlockDIBSection(physDev, update); - + physDev->pen.width = oldwidth; return TRUE; } @@ -595,7 +595,7 @@ X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bott DC *dc = physDev->dc; BOOL update = FALSE; - TRACE("(%d %d %d %d)\n", + TRACE("(%d %d %d %d)\n", left, top, right, bottom); left = INTERNAL_XWPTODP( dc, left, top ); @@ -629,7 +629,7 @@ X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bott /* Update the pixmap from the DIB section */ X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE); - + if ((right > left + width) && (bottom > top + width)) if (X11DRV_SetupGCForBrush( physDev )) { @@ -649,7 +649,7 @@ X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bott /* Update the DIBSection from the pixmap */ X11DRV_UnlockDIBSection(physDev, update); - + physDev->pen.width = oldwidth; physDev->pen.linejoin = oldjoinstyle; return TRUE; @@ -666,7 +666,7 @@ X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, DC *dc = physDev->dc; BOOL update = FALSE; - TRACE("(%d %d %d %d %d %d\n", + TRACE("(%d %d %d %d %d %d\n", left, top, right, bottom, ell_width, ell_height); left = XLPTODP( dc, left ); @@ -868,7 +868,7 @@ X11DRV_SetPixel( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color ) { Pixel pixel; DC *dc = physDev->dc; - + x = dc->DCOrgX + INTERNAL_XWPTODP( dc, x, y ); y = dc->DCOrgY + INTERNAL_YWPTODP( dc, x, y ); pixel = X11DRV_PALETTE_ToPhysical( physDev, color ); @@ -993,7 +993,7 @@ X11DRV_Polyline( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ) { /* Update the pixmap from the DIB section */ X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE); - + TSXDrawLines( gdi_display, physDev->drawable, physDev->gc, points, count, CoordModeOrigin ); @@ -1032,7 +1032,7 @@ X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ) /* Update the pixmap from the DIB section */ X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE); - + if (X11DRV_SetupGCForBrush( physDev )) { TSXFillPolygon( gdi_display, physDev->drawable, physDev->gc, @@ -1045,7 +1045,7 @@ X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ) points, count+1, CoordModeOrigin ); update = TRUE; } - + /* Update the DIBSection from the pixmap */ X11DRV_UnlockDIBSection(physDev, update); @@ -1057,7 +1057,7 @@ X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ) /********************************************************************** * X11DRV_PolyPolygon */ -BOOL +BOOL X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons) { HRGN hrgn; @@ -1079,7 +1079,7 @@ X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts, /* Update the pixmap from the DIB section */ X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE); - + for (i = 0; i < polygons; i++) if (counts[i] > max) max = counts[i]; if (!(points = HeapAlloc( GetProcessHeap(), 0, sizeof(XPoint) * (max+1) ))) { @@ -1098,7 +1098,7 @@ X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts, TSXDrawLines( gdi_display, physDev->drawable, physDev->gc, points, j + 1, CoordModeOrigin ); } - + /* Update the DIBSection of the dc's bitmap */ X11DRV_UnlockDIBSection(physDev, TRUE); @@ -1111,11 +1111,11 @@ X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts, /********************************************************************** * X11DRV_PolyPolyline */ -BOOL +BOOL X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines ) { DC *dc = physDev->dc; - + if (X11DRV_SetupGCForPen ( physDev )) { int i, j, max = 0; @@ -1123,7 +1123,7 @@ X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, const DWORD* coun /* Update the pixmap from the DIB section */ X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE); - + for (i = 0; i < polylines; i++) if (counts[i] > max) max = counts[i]; if (!(points = HeapAlloc( GetProcessHeap(), 0, sizeof(XPoint) * max ))) { @@ -1141,7 +1141,7 @@ X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, const DWORD* coun TSXDrawLines( gdi_display, physDev->drawable, physDev->gc, points, j, CoordModeOrigin ); } - + /* Update the DIBSection of the dc's bitmap */ X11DRV_UnlockDIBSection(physDev, TRUE); @@ -1216,7 +1216,7 @@ static void X11DRV_InternalFloodFill(XImage *image, X11DRV_PDEVICE *physDev, xOrg, yOrg, pixel, fillType ); } } -#undef TO_FLOOD +#undef TO_FLOOD } diff --git a/graphics/x11drv/init.c b/graphics/x11drv/init.c index 72b57627280..7205b2abe46 100644 --- a/graphics/x11drv/init.c +++ b/graphics/x11drv/init.c @@ -223,7 +223,7 @@ INT X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap ) case CAPS1: FIXME("(%04x): CAPS1 is unimplemented, will return 0\n", physDev->hdc ); /* please see wingdi.h for the possible bit-flag values that need - to be returned. also, see + to be returned. also, see http://msdn.microsoft.com/library/ddkdoc/win95ddk/graphcnt_1m0p.htm */ return 0; case SIZEPALETTE: diff --git a/graphics/x11drv/opengl.c b/graphics/x11drv/opengl.c index 223637e9268..7b837890c2c 100644 --- a/graphics/x11drv/opengl.c +++ b/graphics/x11drv/opengl.c @@ -1,4 +1,4 @@ -/* +/* * X11DRV OpenGL functions * * Copyright 2000 Lionel Ulmer @@ -56,21 +56,21 @@ static void dump_PIXELFORMATDESCRIPTOR(PIXELFORMATDESCRIPTOR *ppfd) { TEST_AND_DUMP(ppfd->dwFlags, PFD_SWAP_LAYER_BUFFERS); #undef TEST_AND_DUMP DPRINTF("\n"); - + DPRINTF(" - iPixelType : "); switch (ppfd->iPixelType) { case PFD_TYPE_RGBA: DPRINTF("PFD_TYPE_RGBA"); break; case PFD_TYPE_COLORINDEX: DPRINTF("PFD_TYPE_COLORINDEX"); break; } DPRINTF("\n"); - + DPRINTF(" - Color : %d\n", ppfd->cColorBits); DPRINTF(" - Alpha : %d\n", ppfd->cAlphaBits); DPRINTF(" - Accum : %d\n", ppfd->cAccumBits); DPRINTF(" - Depth : %d\n", ppfd->cDepthBits); DPRINTF(" - Stencil : %d\n", ppfd->cStencilBits); DPRINTF(" - Aux : %d\n", ppfd->cAuxBuffers); - + DPRINTF(" - iLayerType : "); switch (ppfd->iLayerType) { case PFD_MAIN_PLANE: DPRINTF("PFD_MAIN_PLANE"); break; @@ -79,7 +79,7 @@ static void dump_PIXELFORMATDESCRIPTOR(PIXELFORMATDESCRIPTOR *ppfd) { } DPRINTF("\n"); } - + /* X11DRV_ChoosePixelFormat Equivalent of glXChooseVisual @@ -90,15 +90,15 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, #define TEST_AND_ADD2(t,a,b) if (t) { att_list[att_pos++] = a; att_list[att_pos++] = b; } #define NULL_TEST_AND_ADD2(tv,a,b) att_list[att_pos++] = a; att_list[att_pos++] = ((tv) == 0 ? 0 : b) #define ADD2(a,b) att_list[att_pos++] = a; att_list[att_pos++] = b - + int att_list[64]; int att_pos = 0; XVisualInfo *vis; int i; - + if (TRACE_ON(opengl)) { TRACE("(%p,%p)\n", physDev, ppfd); - + dump_PIXELFORMATDESCRIPTOR((PIXELFORMATDESCRIPTOR *) ppfd); } @@ -116,13 +116,13 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, NULL_TEST_AND_ADD2(ppfd->cDepthBits, GLX_DEPTH_SIZE, 8); /* These flags are not supported yet... - + NULL_TEST_AND_ADD2(ppfd->cAlphaBits, GLX_ALPHA_SIZE, 8); ADD2(GLX_ACCUM_SIZE, ppfd->cAccumBits); */ ADD2(GLX_STENCIL_SIZE, ppfd->cStencilBits); /* now suported */ /* ADD2(GLX_AUX_BUFFERS, ppfd->cAuxBuffers); */ att_list[att_pos] = None; - + ENTER_GL(); { /* This command cannot be used as we need to use the default visual... @@ -139,7 +139,7 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, TRACE("Found visual : %p - returns %d\n", vis, physDev->used_visuals + 1); } LEAVE_GL(); - + if (vis == NULL) { ERR("No visual found !\n"); /* Should SetError here... */ @@ -159,7 +159,7 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, return 0; } physDev->visuals[physDev->used_visuals++] = vis; - + return physDev->used_visuals; } @@ -174,14 +174,14 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, XVisualInfo *vis; int value; int rb,gb,bb,ab; - + TRACE("(%p,%d,%d,%p)\n", physDev, iPixelFormat, nBytes, ppfd); if (ppfd == NULL) { /* The application is only querying the number of visuals */ return MAX_PIXELFORMATS; } - + if (nBytes < sizeof(PIXELFORMATDESCRIPTOR)) { ERR("Wrong structure size !\n"); /* Should set error */ @@ -194,7 +194,7 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, /* Should set error */ return 0; } - + if (iPixelFormat == physDev->used_visuals + 1) { int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16,GLX_DOUBLEBUFFER,None}; @@ -202,7 +202,7 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, ENTER_GL(); vis = glXChooseVisual(gdi_display, DefaultScreen(gdi_display), dblBuf); LEAVE_GL(); - + WARN("Uninitialized Visual. Creating standard (%p) !\n", vis); if (vis == NULL) { @@ -210,7 +210,7 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, /* Should set error */ return 0; } - + physDev->visuals[physDev->used_visuals++] = vis; } vis = physDev->visuals[iPixelFormat - 1]; @@ -218,7 +218,7 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, memset(ppfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); ppfd->nSize = sizeof(PIXELFORMATDESCRIPTOR); ppfd->nVersion = 1; - + /* These flags are always the same... */ ppfd->dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_GENERIC_ACCELERATED; /* Now the flags extraced from the Visual */ @@ -263,7 +263,7 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, ppfd->cAlphaShift = 0; } /* Accums : to do ... */ - + /* Depth bits */ glXGetConfig(gdi_display, vis, GLX_DEPTH_SIZE, &value); ppfd->cDepthBits = value; @@ -271,17 +271,17 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, /* stencil bits */ glXGetConfig( gdi_display, vis, GLX_STENCIL_SIZE, &value ); ppfd->cStencilBits = value; - + LEAVE_GL(); /* Aux : to do ... */ ppfd->iLayerType = PFD_MAIN_PLANE; - + if (TRACE_ON(opengl)) { dump_PIXELFORMATDESCRIPTOR(ppfd); } - + return MAX_PIXELFORMATS; } @@ -305,7 +305,7 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, TRACE("(%p,%d,%p)\n", physDev, iPixelFormat, ppfd); physDev->current_pf = iPixelFormat; - + return TRUE; } @@ -319,7 +319,7 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { ENTER_GL(); glXSwapBuffers(gdi_display, physDev->drawable); LEAVE_GL(); - + return TRUE; } @@ -337,13 +337,13 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, UINT nBytes, PIXELFORMATDESCRIPTOR *ppfd) { ERR("No OpenGL support compiled in.\n"); - + return 0; } int X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev) { ERR("No OpenGL support compiled in.\n"); - + return 0; } @@ -351,13 +351,13 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) { ERR("No OpenGL support compiled in.\n"); - + return FALSE; } BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { ERR("No OpenGL support compiled in.\n"); - + return FALSE; } diff --git a/graphics/x11drv/palette.c b/graphics/x11drv/palette.c index 18508d57755..70ff116e997 100644 --- a/graphics/x11drv/palette.c +++ b/graphics/x11drv/palette.c @@ -1,4 +1,4 @@ -/* +/* * X11DRV OEM bitmap objects * * Copyright 1994, 1995 Alexandre Julliard @@ -37,15 +37,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette); /* Palette indexed mode: * logical palette -> mapping -> pixel - * * - * Windows needs contiguous color space ( from 0 to n ) but + * + * Windows needs contiguous color space ( from 0 to n ) but * it is possible only with the private colormap. Otherwise we - * have to map DC palette indices to real pixel values. With + * have to map DC palette indices to real pixel values. With * private colormaps it boils down to the identity mapping. The - * other special case is when we have a fixed color visual with - * the screendepth > 8 - we abandon palette mappings altogether - * because pixel values can be calculated without X server + * other special case is when we have a fixed color visual with + * the screendepth > 8 - we abandon palette mappings altogether + * because pixel values can be calculated without X server * assistance. * * Windows palette manager is described in the @@ -81,7 +81,7 @@ static int X11DRV_PALETTE_Graymax = 0; static int palette_size; /* First free dynamic color cell, 0 = full palette, -1 = fixed palette */ -static int X11DRV_PALETTE_firstFree = 0; +static int X11DRV_PALETTE_firstFree = 0; static unsigned char X11DRV_PALETTE_freeList[256]; /**********************************************************************/ @@ -232,7 +232,7 @@ int X11DRV_PALETTE_Init(void) X11DRV_PALETTE_FillDefaultColors(); - if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) + if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) palette_size = 0; else palette_size = visual->map_entries; @@ -248,8 +248,8 @@ int X11DRV_PALETTE_Init(void) void X11DRV_PALETTE_Cleanup(void) { if( COLOR_gapFilled ) - TSXFreeColors(gdi_display, X11DRV_PALETTE_PaletteXColormap, - (unsigned long*)(X11DRV_PALETTE_PaletteToXPixel + COLOR_gapStart), + TSXFreeColors(gdi_display, X11DRV_PALETTE_PaletteXColormap, + (unsigned long*)(X11DRV_PALETTE_PaletteToXPixel + COLOR_gapStart), COLOR_gapFilled, 0); } @@ -309,7 +309,7 @@ static BOOL X11DRV_PALETTE_BuildPrivateMap(void) /* Private colormap - identity mapping */ XColor color; - int i; + int i; if((COLOR_sysPal = (PALETTEENTRY*)HeapAlloc(GetProcessHeap(), 0, sizeof(PALETTEENTRY)*palette_size)) == NULL) { WARN("Can not allocate system palette\n"); @@ -318,7 +318,7 @@ static BOOL X11DRV_PALETTE_BuildPrivateMap(void) TRACE("Building private map - %i palette entries\n", palette_size); - /* Allocate system palette colors */ + /* Allocate system palette colors */ for( i=0; i < palette_size; i++ ) { @@ -393,11 +393,11 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) count = sizeof(buffer); if(!RegQueryValueExA(hkey, "AllocSystemColors", 0, &type, buffer, &count)) COLOR_max = atoi(buffer); - + RegCloseKey(hkey); } - /* Copy the first bunch of colors out of the default colormap to prevent + /* Copy the first bunch of colors out of the default colormap to prevent * colormap flashing as much as possible. We're likely to get the most * important Window Manager colors, etc in the first 128 colors */ defaultCM = DefaultColormap( gdi_display, DefaultScreen(gdi_display) ); @@ -407,7 +407,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) TSXQueryColors(gdi_display, defaultCM, &defaultColors[0], defaultCM_max_copy); for (i = 0; i < defaultCM_max_copy; i++) TSXAllocColor( gdi_display, X11DRV_PALETTE_PaletteXColormap, &defaultColors[i] ); - + if (COLOR_max > 256) COLOR_max = 256; else if (COLOR_max < 20) COLOR_max = 20; TRACE("%d colors configured.\n", COLOR_max); @@ -417,17 +417,17 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) /* Be nice and allocate system colors as read-only */ for( i = 0; i < NB_RESERVED_COLORS; i++ ) - { + { color.red = COLOR_sysPalTemplate[i].peRed * 65535 / 255; color.green = COLOR_sysPalTemplate[i].peGreen * 65535 / 255; color.blue = COLOR_sysPalTemplate[i].peBlue * 65535 / 255; color.flags = DoRed | DoGreen | DoBlue; if (!TSXAllocColor( gdi_display, X11DRV_PALETTE_PaletteXColormap, &color )) - { + { XColor best, c; - - if( !warn++ ) + + if( !warn++ ) { WARN("Not enough colors for the full system palette.\n"); @@ -435,7 +435,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) wp = WhitePixel(gdi_display, DefaultScreen(gdi_display)); max = (0xffffffff)>>(32 - screen_depth); - if( max > 256 ) + if( max > 256 ) { step = max/256; max = 256; @@ -453,8 +453,8 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) for( c.pixel = 0, diff = 0x7fffffff; c.pixel < max; c.pixel += step ) { TSXQueryColor(gdi_display, X11DRV_PALETTE_PaletteXColormap, &c); - r = (c.red - color.red)>>8; - g = (c.green - color.green)>>8; + r = (c.red - color.red)>>8; + g = (c.green - color.green)>>8; b = (c.blue - color.blue)>>8; r = r*r + g*g + b*b; if( r < diff ) { best = c; diff = r; } @@ -480,13 +480,13 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) /* now allocate changeable set */ - if( !(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED) ) + if( !(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED) ) { int c_min = 0, c_max = palette_size, c_val; TRACE("Dynamic colormap... \n"); - /* let's become the first client that actually follows + /* let's become the first client that actually follows * X guidelines and does binary search... */ @@ -512,7 +512,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) } } - if( c_min > COLOR_max - NB_RESERVED_COLORS) + if( c_min > COLOR_max - NB_RESERVED_COLORS) c_min = COLOR_max - NB_RESERVED_COLORS; c_min = (c_min/2) + (c_min/2); /* need even set for split palette */ @@ -531,10 +531,10 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) TRACE("adjusted size %i colorcells\n", palette_size); } - else if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) + else if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) { - /* virtual colorspace - ToPhysical takes care of - * color translations but we have to allocate full palette + /* virtual colorspace - ToPhysical takes care of + * color translations but we have to allocate full palette * to maintain compatibility */ palette_size = 256; @@ -553,8 +553,8 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) else { COLOR_gapStart = palette_size/2; COLOR_gapEnd = 255 - palette_size/2; } - X11DRV_PALETTE_firstFree = ( palette_size > NB_RESERVED_COLORS && - (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL || !(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED)) ) + X11DRV_PALETTE_firstFree = ( palette_size > NB_RESERVED_COLORS && + (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL || !(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED)) ) ? NB_RESERVED_COLORS/2 : -1; COLOR_sysPal = (PALETTEENTRY*)HeapAlloc(GetProcessHeap(),0,sizeof(PALETTEENTRY)*256); @@ -577,7 +577,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) } /* for hicolor visuals PaletteToPixel mapping is used to skip - * RGB->pixel calculation in X11DRV_PALETTE_ToPhysical(). + * RGB->pixel calculation in X11DRV_PALETTE_ToPhysical(). */ X11DRV_PALETTE_PaletteToXPixel = (int*)HeapAlloc(GetProcessHeap(),0,sizeof(int)*256); @@ -588,7 +588,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) for( i = j = 0; i < 256; i++ ) { - if( i >= COLOR_gapStart && i <= COLOR_gapEnd ) + if( i >= COLOR_gapStart && i <= COLOR_gapEnd ) { X11DRV_PALETTE_PaletteToXPixel[i] = NB_PALETTE_EMPTY_VALUE; COLOR_sysPal[i].peFlags = 0; /* mark as unused */ @@ -602,7 +602,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) } else if( i >= 256 - NB_RESERVED_COLORS/2 ) { - X11DRV_PALETTE_PaletteToXPixel[i] = sysPixel[(i + NB_RESERVED_COLORS) - 256]; + X11DRV_PALETTE_PaletteToXPixel[i] = sysPixel[(i + NB_RESERVED_COLORS) - 256]; COLOR_sysPal[i] = COLOR_sysPalTemplate[(i + NB_RESERVED_COLORS) - 256]; } else if( pixDynMapping ) @@ -626,13 +626,13 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void) */ static void X11DRV_PALETTE_FillDefaultColors(void) { - /* initialize unused entries to what Windows uses as a color - * cube - based on Greg Kreider's code. + /* initialize unused entries to what Windows uses as a color + * cube - based on Greg Kreider's code. */ int i = 0, idx = 0; int red, no_r, inc_r; - int green, no_g, inc_g; + int green, no_g, inc_g; int blue, no_b, inc_b; if (palette_size <= NB_RESERVED_COLORS) @@ -659,7 +659,7 @@ static void X11DRV_PALETTE_FillDefaultColors(void) COLOR_sysPal[idx].peRed = red; COLOR_sysPal[idx].peGreen = green; COLOR_sysPal[idx].peBlue = blue; - + /* set X color */ if( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) @@ -711,7 +711,7 @@ static void X11DRV_PALETTE_FillDefaultColors(void) if( --max <= 0 ) break; } } - COLOR_gapFilled = idx - COLOR_gapStart; + COLOR_gapFilled = idx - COLOR_gapStart; } } @@ -779,7 +779,7 @@ COLORREF X11DRV_PALETTE_ToLogical(int pixel) if ((screen_depth <= 8) && (pixel < 256) && !(X11DRV_PALETTE_PaletteFlags & (X11DRV_PALETTE_VIRTUAL | X11DRV_PALETTE_FIXED)) ) { - return ( *(COLORREF*)(COLOR_sysPal + + return ( *(COLORREF*)(COLOR_sysPal + ((X11DRV_PALETTE_XPixelToPalette)?X11DRV_PALETTE_XPixelToPalette[pixel]:pixel)) ) & 0x00ffffff; } @@ -807,7 +807,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) if ( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED ) { /* there is no colormap limitation; we are going to have to compute - * the pixel value from the visual information stored earlier + * the pixel value from the visual information stored earlier */ unsigned long red, green, blue; @@ -824,7 +824,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) return 0; } - if( palPtr->mapping ) + if( palPtr->mapping ) { int ret = palPtr->mapping[idx]; GDI_ReleaseObj( hPal ); @@ -878,10 +878,10 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) return (red << X11DRV_PALETTE_PRed.shift) | (green << X11DRV_PALETTE_PGreen.shift) | (blue << X11DRV_PALETTE_PBlue.shift); } } - else + else { - if( !palPtr->mapping ) + if( !palPtr->mapping ) WARN("Palette %04x is not realized\n", dc->hPalette); switch(spec_type) /* we have to peruse DC and system palette */ @@ -898,7 +898,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) ((color >> 8) & 0xff) + (color & 0xff) > 255*3/2) ? 1 : 0; } - index = COLOR_PaletteLookupPixel( COLOR_sysPal, 256, + index = COLOR_PaletteLookupPixel( COLOR_sysPal, 256, X11DRV_PALETTE_PaletteToXPixel, color, FALSE); /* TRACE(palette,"RGB(%lx) -> pixel %i\n", color, index); @@ -908,14 +908,14 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) index = color & 0xffff; if( index >= palPtr->logpalette.palNumEntries ) - WARN("RGB(%lx) : index %i is out of bounds\n", color, index); + WARN("RGB(%lx) : index %i is out of bounds\n", color, index); else if( palPtr->mapping ) index = palPtr->mapping[index]; /* TRACE(palette,"PALETTEINDEX(%04x) -> pixel %i\n", (WORD)color, index); */ break; case 2: /* PALETTERGB */ - index = COLOR_PaletteLookupPixel( palPtr->logpalette.palPalEntry, + index = COLOR_PaletteLookupPixel( palPtr->logpalette.palPalEntry, palPtr->logpalette.palNumEntries, palPtr->mapping, color, FALSE); /* TRACE(palette,"PALETTERGB(%lx) -> pixel %i\n", color, index); @@ -953,7 +953,7 @@ static int X11DRV_PALETTE_LookupSystemXPixel(COLORREF col) if( r < diff ) { best = i; diff = r; } } - + return (X11DRV_PALETTE_PaletteToXPixel)? X11DRV_PALETTE_PaletteToXPixel[best] : best; } @@ -963,7 +963,7 @@ static int X11DRV_PALETTE_LookupSystemXPixel(COLORREF col) static void X11DRV_PALETTE_FormatSystemPalette(void) { /* Build free list so we'd have an easy way to find - * out if there are any available colorcells. + * out if there are any available colorcells. */ int i, j = X11DRV_PALETTE_firstFree = NB_RESERVED_COLORS/2; @@ -994,7 +994,7 @@ static BOOL X11DRV_PALETTE_CheckSysColor(COLORREF c) /*********************************************************************** * X11DRV_PALETTE_SetMapping * - * Set the color-mapping table for selected palette. + * Set the color-mapping table for selected palette. * Return number of entries which mapping has changed. */ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL mapOnly ) @@ -1010,7 +1010,7 @@ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL X11DRV_PALETTE_FormatSystemPalette(); /* initialize palette mapping table */ - + mapping = HeapReAlloc( GetProcessHeap(), 0, palPtr->mapping, sizeof(int)*palPtr->logpalette.palNumEntries); if(mapping == NULL) { @@ -1028,9 +1028,9 @@ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL { case PC_EXPLICIT: /* palette entries are indices into system palette */ index = *(WORD*)(palPtr->logpalette.palPalEntry + uStart); - if( index > 255 || (index >= COLOR_gapStart && index <= COLOR_gapEnd) ) + if( index > 255 || (index >= COLOR_gapStart && index <= COLOR_gapEnd) ) { - WARN("PC_EXPLICIT: idx %d out of system palette, assuming black.\n", index); + WARN("PC_EXPLICIT: idx %d out of system palette, assuming black.\n", index); index = 0; } break; @@ -1040,10 +1040,10 @@ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL /* fall through */ default: /* try to collapse identical colors */ - index = COLOR_PaletteLookupExactIndex(COLOR_sysPal, 256, + index = COLOR_PaletteLookupExactIndex(COLOR_sysPal, 256, *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart)); /* fall through */ - case PC_NOCOLLAPSE: + case PC_NOCOLLAPSE: if( index < 0 ) { if( X11DRV_PALETTE_firstFree > 0 && !(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED) ) @@ -1066,16 +1066,16 @@ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL if( X11DRV_PALETTE_PaletteToXPixel ) index = X11DRV_PALETTE_PaletteToXPixel[index]; break; } - else if ( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) + else if ( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) { index = X11DRV_PALETTE_ToPhysical( NULL, 0x00ffffff & *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart)); - break; + break; } /* we have to map to existing entry in the system palette */ - index = COLOR_PaletteLookupPixel(COLOR_sysPal, 256, NULL, + index = COLOR_PaletteLookupPixel(COLOR_sysPal, 256, NULL, *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart), TRUE); } palPtr->logpalette.palPalEntry[uStart].peFlags |= PC_SYS_USED; @@ -1087,9 +1087,9 @@ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL if( !prevMapping || palPtr->mapping[uStart] != index ) iRemapped++; palPtr->mapping[uStart] = index; - TRACE("entry %i (%lx) -> pixel %i\n", uStart, + TRACE("entry %i (%lx) -> pixel %i\n", uStart, *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart), index); - + } return iRemapped; } @@ -1097,25 +1097,25 @@ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL /*********************************************************************** * X11DRV_PALETTE_UpdateMapping * - * Update the color-mapping table for selected palette. + * Update the color-mapping table for selected palette. * Return number of entries which mapping has changed. */ int X11DRV_PALETTE_UpdateMapping(PALETTEOBJ *palPtr) { - int i, index, realized = 0; - + int i, index, realized = 0; + if (!palette_size) return 0; for( i = 0; i < 20; i++ ) { index = X11DRV_PALETTE_LookupSystemXPixel(*(COLORREF*)(palPtr->logpalette.palPalEntry + i)); - + /* mapping is allocated in COLOR_InitPalette() */ - + if( index != palPtr->mapping[i] ) { palPtr->mapping[i]=index; realized++; } } - + return realized; } diff --git a/graphics/x11drv/text.c b/graphics/x11drv/text.c index 01de6ad1bcd..325eac0abab 100644 --- a/graphics/x11drv/text.c +++ b/graphics/x11drv/text.c @@ -57,7 +57,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, BOOL rotated = FALSE; XChar2b *str2b = NULL; BOOL dibUpdateFlag = FALSE; - BOOL result = TRUE; + BOOL result = TRUE; DC *dc = physDev->dc; if(dc->gdiFont) @@ -242,7 +242,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, } } } - + /* Draw the text (count > 0 verified) */ if (!(str2b = X11DRV_cptable[pfo->fi->cptable].punicode_to_char2b( pfo, wstr, count ))) goto FAIL; @@ -265,7 +265,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, pitem = items = HeapAlloc( GetProcessHeap(), 0, count * sizeof(XTextItem16) ); - if(items == NULL) goto FAIL; + if(items == NULL) goto FAIL; delta = i = 0; if( lpDx ) /* explicit character widths */ { @@ -321,7 +321,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, pitem->nchars++; } while ((++i < count) && !delta); pitem++; - } + } } X11DRV_cptable[pfo->fi->cptable].pDrawText( pfo, gdi_display, @@ -331,14 +331,14 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, } } else /* rotated */ - { + { /* have to render character by character. */ double offset = 0.0; int i; for (i=0; imin_char_or_byte2; int x_i = IROUND((double) (dc->DCOrgX + x) + offset * pfo->lpX11Trans->a / pfo->lpX11Trans->pixelsize ); @@ -370,7 +370,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, if (lfUnderline) { - long linePos, lineWidth; + long linePos, lineWidth; if (!TSXGetFontProperty( font, XA_UNDERLINE_POSITION, &linePos )) linePos = descent - 1; @@ -378,7 +378,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, lineWidth = 0; else if (lineWidth == 1) lineWidth = 0; TSXSetLineAttributes( gdi_display, physDev->gc, lineWidth, - LineSolid, CapRound, JoinBevel ); + LineSolid, CapRound, JoinBevel ); TSXDrawLine( gdi_display, physDev->drawable, physDev->gc, dc->DCOrgX + x, dc->DCOrgY + y + linePos, dc->DCOrgX + x + width, dc->DCOrgY + y + linePos ); @@ -391,7 +391,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, if (!TSXGetFontProperty( font, XA_STRIKEOUT_DESCENT, &lineDescent )) lineDescent = -lineAscent * 2 / 3; TSXSetLineAttributes( gdi_display, physDev->gc, lineAscent + lineDescent, - LineSolid, CapRound, JoinBevel ); + LineSolid, CapRound, JoinBevel ); TSXDrawLine( gdi_display, physDev->drawable, physDev->gc, dc->DCOrgX + x, dc->DCOrgY + y - lineAscent, dc->DCOrgX + x + width, dc->DCOrgY + y - lineAscent ); @@ -399,11 +399,11 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, if (flags & ETO_CLIPPED) RestoreVisRgn16( dc->hSelf ); goto END; - + FAIL: if(str2b != NULL) HeapFree( GetProcessHeap(), 0, str2b ); result = FALSE; - + END: if (dibUpdateFlag) X11DRV_UnlockDIBSection( physDev, TRUE ); return result; @@ -438,14 +438,14 @@ BOOL X11DRV_GetTextExtentPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count, float x = 0.0, y = 0.0; /* FIXME: Deal with *_char_or_byte2 != 0 situations */ for(i = 0; i < count; i++) { - x += pfo->fs->per_char ? - pfo->fs->per_char[p[i].byte2 - pfo->fs->min_char_or_byte2].attributes : + x += pfo->fs->per_char ? + pfo->fs->per_char[p[i].byte2 - pfo->fs->min_char_or_byte2].attributes : pfo->fs->min_bounds.attributes; } y = pfo->lpX11Trans->RAW_ASCENT + pfo->lpX11Trans->RAW_DESCENT; TRACE("x = %f y = %f\n", x, y); x *= pfo->lpX11Trans->pixelsize / 1000.0; - y *= pfo->lpX11Trans->pixelsize / 1000.0; + y *= pfo->lpX11Trans->pixelsize / 1000.0; size->cx = fabs((x + dc->breakRem + count * dc->charExtra) * dc->xformVport2World.eM11); size->cy = fabs(y * dc->xformVport2World.eM22); diff --git a/graphics/x11drv/xfont.c b/graphics/x11drv/xfont.c index 93a5bd7df35..563829ca0f8 100644 --- a/graphics/x11drv/xfont.c +++ b/graphics/x11drv/xfont.c @@ -127,12 +127,12 @@ static const SuffixCharset sufch_iso646[] = { static const SuffixCharset sufch_iso8859[] = { { "1", ANSI_CHARSET, 28591, X11DRV_CPTABLE_SBCS }, { "2", EE_CHARSET, 28592, X11DRV_CPTABLE_SBCS }, - { "3", ISO3_CHARSET, 28593, X11DRV_CPTABLE_SBCS }, - { "4", ISO4_CHARSET, 28594, X11DRV_CPTABLE_SBCS }, + { "3", ISO3_CHARSET, 28593, X11DRV_CPTABLE_SBCS }, + { "4", ISO4_CHARSET, 28594, X11DRV_CPTABLE_SBCS }, { "5", RUSSIAN_CHARSET, 28595, X11DRV_CPTABLE_SBCS }, { "6", ARABIC_CHARSET, 28596, X11DRV_CPTABLE_SBCS }, { "7", GREEK_CHARSET, 28597, X11DRV_CPTABLE_SBCS }, - { "8", HEBREW_CHARSET, 28598, X11DRV_CPTABLE_SBCS }, + { "8", HEBREW_CHARSET, 28598, X11DRV_CPTABLE_SBCS }, { "9", TURKISH_CHARSET, 28599, X11DRV_CPTABLE_SBCS }, { "10", ISO10_CHARSET, 28600, X11DRV_CPTABLE_SBCS }, { "11", THAI_CHARSET, 874, X11DRV_CPTABLE_SBCS }, /* FIXME */ @@ -172,8 +172,8 @@ static const SuffixCharset sufch_windows[] = { { "1251", RUSSIAN_CHARSET, 1251, X11DRV_CPTABLE_SBCS }, { "1252", ANSI_CHARSET, 1252, X11DRV_CPTABLE_SBCS }, { "1253", GREEK_CHARSET, 1253, X11DRV_CPTABLE_SBCS }, - { "1254", TURKISH_CHARSET, 1254, X11DRV_CPTABLE_SBCS }, - { "1255", HEBREW_CHARSET, 1255, X11DRV_CPTABLE_SBCS }, + { "1254", TURKISH_CHARSET, 1254, X11DRV_CPTABLE_SBCS }, + { "1255", HEBREW_CHARSET, 1255, X11DRV_CPTABLE_SBCS }, { "1256", ARABIC_CHARSET, 1256, X11DRV_CPTABLE_SBCS }, { "1257", BALTIC_CHARSET, 1257, X11DRV_CPTABLE_SBCS }, { NULL, ANSI_CHARSET, 1252, X11DRV_CPTABLE_SBCS }}; @@ -453,7 +453,7 @@ static LFD* LFD_Parse(LPSTR lpFont) lfd_fld[i] = NULL; if (*lpch) WARN("Extra ignored in font '%s'\n", lpFont); - + lfd = HeapAlloc( GetProcessHeap(), 0, sizeof(LFD) ); if (lfd) { @@ -506,7 +506,7 @@ static void LFD_UnParse(LPSTR dp, UINT buf_size, LFD* lfd) const char* sp = lfd_fld[i]; if (!sp || !buf_size) break; - + *dp++ = HYPHEN; buf_size--; while (buf_size > 0 && *sp) @@ -523,12 +523,12 @@ static void LFD_UnParse(LPSTR dp, UINT buf_size, LFD* lfd) static void LFD_GetWeight( fontInfo* fi, LPCSTR lpStr) { int j = strlen(lpStr); - if( j == 1 && *lpStr == '0') + if( j == 1 && *lpStr == '0') fi->fi_flags |= FI_POLYWEIGHT; else if( j == 4 ) { if( !strcasecmp( "bold", lpStr) ) - fi->df.dfWeight = FW_BOLD; + fi->df.dfWeight = FW_BOLD; else if( !strcasecmp( "demi", lpStr) ) { fi->fi_flags |= FI_FW_DEMI; @@ -548,9 +548,9 @@ static void LFD_GetWeight( fontInfo* fi, LPCSTR lpStr) fi->df.dfWeight = FW_BLACK; } else if( j == 6 && !strcasecmp( "medium", lpStr) ) - fi->df.dfWeight = FW_REGULAR; + fi->df.dfWeight = FW_REGULAR; else if( j == 8 && !strcasecmp( "demibold", lpStr) ) - fi->df.dfWeight = FW_DEMIBOLD; + fi->df.dfWeight = FW_DEMIBOLD; else fi->df.dfWeight = FW_DONTCARE; /* FIXME: try to get something * from the weight property */ @@ -583,18 +583,18 @@ static void LFD_GetStyle( fontInfo* fi, LPCSTR lpstr, int dec_style_check) if( j > 3 ) /* find out is there "sans" or "script" */ { j = 0; - - if( strstr(lpstr, "sans") ) - { - fi->df.dfPitchAndFamily |= FF_SWISS; - j = 1; + + if( strstr(lpstr, "sans") ) + { + fi->df.dfPitchAndFamily |= FF_SWISS; + j = 1; } - if( strstr(lpstr, "script") ) - { - fi->df.dfPitchAndFamily |= FF_SCRIPT; - j = 1; + if( strstr(lpstr, "script") ) + { + fi->df.dfPitchAndFamily |= FF_SCRIPT; + j = 1; } - if( !j && dec_style_check ) + if( !j && dec_style_check ) fi->df.dfPitchAndFamily |= FF_DECORATIVE; } } @@ -731,7 +731,7 @@ static int LFD_InitFontInfo( fontInfo* fi, const LFD* lfd, LPCSTR fullname ) /* charset registry, charset encoding - */ lpstr = lfd->charset_registry; - if( strstr(lpstr, "ksc") || + if( strstr(lpstr, "ksc") || strstr(lpstr, "gb2312") || strstr(lpstr, "big5") ) { @@ -806,7 +806,7 @@ done: */ fi->fi_encoding = 256 * (UINT16)i + (UINT16)j; - return TRUE; + return TRUE; } @@ -832,7 +832,7 @@ static void LFD_AngleMatrix( char* buffer, int h, double theta) * should be bulletproof enough to allow us to avoid hacks like * this despite LFD being so braindead. */ -static BOOL LFD_ComposeLFD( const fontObject* fo, +static BOOL LFD_ComposeLFD( const fontObject* fo, INT height, LPSTR lpLFD, UINT uRelax ) { int i, h; @@ -842,8 +842,8 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, /* Get the worst case over with first */ -/* RealizeFont() will call us repeatedly with increasing uRelax - * until XLoadFont() succeeds. +/* RealizeFont() will call us repeatedly with increasing uRelax + * until XLoadFont() succeeds. * to avoid an infinite loop; these will always match */ if (uRelax >= 5) @@ -889,7 +889,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, aLFD.slant = "o"; else aLFD.slant = "i"; - else + else aLFD.slant = (uRelax < 1) ? "r" : any; /* add width */ @@ -901,7 +901,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, /* ignore style */ aLFD.add_style = any; -/* add pixelheight +/* add pixelheight * * FIXME: fill in lpXForm and lpPixmap for rotated fonts */ @@ -911,7 +911,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, { h = (fo->fi->lfd_height * height + (fo->fi->df.dfPixHeight>>1)); h /= fo->fi->df.dfPixHeight; - } + } if (h < MIN_FONT_SIZE) /* Resist rounding down to 0 */ h = MIN_FONT_SIZE; else if (h > MAX_FONT_SIZE) /* Sanity check as huge fonts can lock up the font server */ @@ -919,12 +919,12 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, WARN("Huge font size %d pixels has been reduced to %d\n", h, MAX_FONT_SIZE); h = MAX_FONT_SIZE; } - + if (uRelax <= 2) /* handle rotated fonts */ if (fo->lf.lfEscapement) { /* escapement is in tenths of degrees, theta is in radians */ - double theta = M_PI*fo->lf.lfEscapement/1800.; + double theta = M_PI*fo->lf.lfEscapement/1800.; LFD_AngleMatrix(h_string, h, theta); } else @@ -948,11 +948,11 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, aLFD.resolution_x = resx_string; strcpy(resy_string, resx_string); - if( uRelax == 0 && text_caps & TC_SF_X_YINDEP ) + if( uRelax == 0 && text_caps & TC_SF_X_YINDEP ) { if( fo->lf.lfWidth && !(fo->fo_flags & FO_SYNTH_WIDTH)) { - int resy = 0.5 + fo->fi->lfd_resolution * + int resy = 0.5 + fo->fi->lfd_resolution * (fo->fi->df.dfAvgWidth * height) / (fo->lf.lfWidth * fo->fi->df.dfPixHeight) ; sprintf(resy_string, "%d", resy); @@ -961,7 +961,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, { /* FIXME - synth width */ } - } + } aLFD.resolution_y = resy_string; } else @@ -973,11 +973,11 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, { char* w; - if( fo->fi->fi_flags & FI_FIXEDPITCH ) + if( fo->fi->fi_flags & FI_FIXEDPITCH ) w = ( fo->fi->fi_flags & FI_FIXEDEX ) ? "c" : "m"; - else - w = ( fo->fi->fi_flags & FI_VARIABLEPITCH ) ? "p" : any; - + else + w = ( fo->fi->fi_flags & FI_VARIABLEPITCH ) ? "p" : any; + aLFD.spacing = (uRelax <= 1) ? w : any; } @@ -989,18 +989,18 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, for(i = fo->fi->fi_encoding >> 8; i; i--) boba = boba->next; aLFD.charset_registry = boba->prefix ? boba->prefix : any; - + i = fo->fi->fi_encoding & 255; switch( i ) { default: aLFD.charset_encoding = boba->sufch[i].psuffix; break; - + case 254: aLFD.charset_encoding = any; break; - + case 255: /* no suffix - it ends eg "-ascii" */ aLFD.charset_encoding = NULL; break; @@ -1011,7 +1011,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, aLFD.charset_registry = any; aLFD.charset_encoding = any; } - + LFD_UnParse(lpLFD, MAX_LFD_LENGTH, &aLFD); TRACE("\tLFD(uRelax=%d): %s\n", uRelax, lpLFD ); @@ -1025,7 +1025,7 @@ static BOOL LFD_ComposeLFD( const fontObject* fo, * font info - http://www.microsoft.com/kb/articles/q65/1/23.htm * Windows font metrics - http://www.microsoft.com/kb/articles/q32/6/67.htm */ -static void XFONT_GetLeading( const LPIFONTINFO16 pFI, const XFontStruct* x_fs, +static void XFONT_GetLeading( const LPIFONTINFO16 pFI, const XFontStruct* x_fs, INT16* pIL, INT16* pEL, const XFONTTRANS *XFT ) { unsigned long height; @@ -1037,13 +1037,13 @@ static void XFONT_GetLeading( const LPIFONTINFO16 pFI, const XFontStruct* x_fs, if(XFT) { Atom RAW_CAP_HEIGHT = TSXInternAtom(gdi_display, "RAW_CAP_HEIGHT", TRUE); if(TSXGetFontProperty((XFontStruct*)x_fs, RAW_CAP_HEIGHT, &height)) - *pIL = XFT->ascent - + *pIL = XFT->ascent - (INT)(XFT->pixelsize / 1000.0 * height); else *pIL = 0; return; } - + if( TSXGetFontProperty((XFontStruct*)x_fs, XA_CAP_HEIGHT, &height) == FALSE ) { if( x_fs->per_char ) @@ -1058,7 +1058,7 @@ static void XFONT_GetLeading( const LPIFONTINFO16 pFI, const XFontStruct* x_fs, if( pEL ) *pEL = x_fs->max_bounds.ascent - height; } - else + else height = x_fs->min_bounds.ascent; } @@ -1070,7 +1070,7 @@ static void XFONT_GetLeading( const LPIFONTINFO16 pFI, const XFontStruct* x_fs, */ static int XFONT_CharWidth(const XFontStruct* x_fs, const XFONTTRANS *XFT, int ch) -{ +{ if(!XFT) return x_fs->per_char[ch].width; else @@ -1097,7 +1097,7 @@ static INT XFONT_GetAvgCharWidth( LPIFONTINFO16 pFI, const XFontStruct* x_fs, /* FIXME - should use a weighted average */ for( j = 0; j < 26; j++ ) width += XFONT_CharWidth(x_fs, XFT, 'a' + j - min) + - XFONT_CharWidth(x_fs, XFT, 'A' + j - min); + XFONT_CharWidth(x_fs, XFT, 'A' + j - min); chars = 52; } else /* unweighted average of everything */ @@ -1110,7 +1110,7 @@ static INT XFONT_GetAvgCharWidth( LPIFONTINFO16 pFI, const XFontStruct* x_fs, } } if (chars) avg = (width + (chars-1))/ chars; /* always round up*/ - else avg = 0; /* No characters exist at all */ + else avg = 0; /* No characters exist at all */ } else /* uniform width */ avg = x_fs->min_bounds.width; @@ -1135,7 +1135,7 @@ static INT XFONT_GetMaxCharWidth(const XFontStruct* xfs, const XFONTTRANS *XFT) if( !CI_NONEXISTCHAR(xfs->per_char + j) ) if(maxwidth < xfs->per_char[j].attributes) maxwidth = xfs->per_char[j].attributes; - + maxwidth *= XFT->pixelsize / 1000.0; return maxwidth; } @@ -1165,11 +1165,11 @@ static void XFONT_SetFontMetric(fontInfo* fi, const fontResource* fr, XFontStruc if( xfs->min_bounds.width != xfs->max_bounds.width ) fi->df.dfPitchAndFamily |= TMPF_FIXED_PITCH; /* au contraire! */ - if( fi->fi_flags & FI_SCALABLE ) + if( fi->fi_flags & FI_SCALABLE ) { fi->df.dfType = DEVICE_FONTTYPE; fi->df.dfPitchAndFamily |= TMPF_DEVICE; - } + } else if( fi->fi_flags & FI_TRUETYPE ) fi->df.dfType = TRUETYPE_FONTTYPE; else @@ -1229,7 +1229,7 @@ static UINT XFONT_GetFontMetric( const fontInfo* pfi, ptm->tmLastChar = pfi->df.dfLastChar; ptm->tmDefaultChar = pfi->df.dfDefaultChar; ptm->tmBreakChar = pfi->df.dfBreakChar; - + TRACE("Calling Enum proc with FaceName %s FullName %s\n", debugstr_w(pLF->elfLogFont.lfFaceName), debugstr_w(pLF->elfFullName)); @@ -1245,7 +1245,7 @@ static UINT XFONT_GetFontMetric( const fontInfo* pfi, * XFONT_FixupFlags * * INIT ONLY - * + * * dfPitchAndFamily flags for some common typefaces. */ static BYTE XFONT_FixupFlags( LPCSTR lfFaceName ) @@ -1263,7 +1263,7 @@ static BYTE XFONT_FixupFlags( LPCSTR lfFaceName ) case 'c': case 'C': if(!strncasecmp(lfFaceName, "Courier", 7)) return FF_MODERN; - + if (!strcasecmp(lfFaceName, "Charter") ) return FF_ROMAN; break; @@ -1293,7 +1293,7 @@ static BYTE XFONT_FixupFlags( LPCSTR lfFaceName ) */ static BOOL XFONT_SameFoundryAndFamily( const LFD* lfd1, const LFD* lfd2 ) { - return ( !strcasecmp( lfd1->foundry, lfd2->foundry ) && + return ( !strcasecmp( lfd1->foundry, lfd2->foundry ) && !strcasecmp( lfd1->family, lfd2->family ) ); } @@ -1312,7 +1312,7 @@ static void XFONT_InitialCapitals(LPSTR lpch) for( i = 0, up = TRUE; *lpch; lpch++, i++ ) { - if( isspace(*lpch) ) + if( isspace(*lpch) ) { if (!up) /* Not already got one */ { @@ -1321,11 +1321,11 @@ static void XFONT_InitialCapitals(LPSTR lpch) } } else if( isalpha(*lpch) && up ) - { - *lpstr++ = toupper(*lpch); + { + *lpstr++ = toupper(*lpch); up = FALSE; } - else + else { *lpstr++ = *lpch; up = FALSE; @@ -1382,9 +1382,9 @@ static void XFONT_WindowsNames(void) fi->df.dfPitchAndFamily |= bFamilyStyle; } } - + TRACE("typeface '%s'\n", fr->lfFaceName); - + fr->fr_flags |= FR_NAMESET; } } @@ -1413,7 +1413,7 @@ static void XFONT_LoadDefaultLFD(LFD* lfd, LPCSTR fonttype) fr = pfr; } if (!pfr) - WARN("Default %sfont '-%s-%s-' not available\n", fonttype, + WARN("Default %sfont '-%s-%s-' not available\n", fonttype, lfd->foundry, lfd->family); } } @@ -1438,7 +1438,7 @@ static void XFONT_LoadDefault(LPCSTR ini, LPCSTR fonttype) LFD* lfd; char* pch = buffer; while( *pch && isspace(*pch) ) pch++; - + TRACE("Using '%s' as default %sfont\n", pch, fonttype); lfd = LFD_Parse(pch); if (lfd && lfd->foundry && lfd->family) @@ -1472,7 +1472,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias ) /* check if we already got one */ if( !strcasecmp( pfa->faTypeFace, lpAlias ) ) { - TRACE("redundant alias '%s' -> '%s'\n", + TRACE("redundant alias '%s' -> '%s'\n", lpAlias, lpTypeFace ); return NULL; } @@ -1488,7 +1488,7 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias ) aliasTable = pfa; else prev->next = pfa; - + pfa->next = NULL; pfa->faTypeFace = (LPSTR)(pfa + 1); strcpy( pfa->faTypeFace, lpTypeFace ); @@ -1554,9 +1554,9 @@ static void XFONT_LoadAlias(const LFD* lfd, LPCSTR lpAlias, BOOL bSubst) } prev = pfa; } - + TRACE("\tsubstituted '%s' with '%s'\n", frMatch->lfFaceName, lpAlias ); - + lstrcpynA( frMatch->lfFaceName, lpAlias, LF_FACESIZE ); frMatch->fr_flags |= FR_NAMESET; } @@ -1570,12 +1570,12 @@ static void XFONT_LoadAlias(const LFD* lfd, LPCSTR lpAlias, BOOL bSubst) { WARN("Font alias '-%s-%s-' is not available\n", lfd->foundry, lfd->family); } -} +} /*********************************************************************** * Just a copy of PROFILE_GetStringItem * - * Convenience function that turns a string 'xxx, yyy, zzz' into + * Convenience function that turns a string 'xxx, yyy, zzz' into * the 'xxx\0 yyy, zzz' and returns a pointer to the 'yyy, zzz'. */ static char *XFONT_GetStringItem( char *start ) @@ -1602,7 +1602,7 @@ static char *XFONT_GetStringItem( char *start ) /*********************************************************************** * XFONT_LoadAliases * - * INIT ONLY + * INIT ONLY * * Create font aliases for some standard windows fonts using user's * default choice of (sans-)serif fonts @@ -1612,7 +1612,7 @@ static char *XFONT_GetStringItem( char *start ) * Alias# = [Windows font name],[LFD font name], * * Example: - * Alias0 = Arial, -adobe-helvetica- + * Alias0 = Arial, -adobe-helvetica- * Alias1 = Times New Roman, -bitstream-courier-, 1 * ... * @@ -1653,7 +1653,7 @@ static void XFONT_LoadAliases(void) XFONT_LoadDefaultLFD( lfd, "serif "); HeapFree(GetProcessHeap(), 0, lfd); } - + strcpy(buffer, "-adobe-helvetica-"); if(!RegOpenKeyA(HKEY_LOCAL_MACHINE, INIFontSection, &hkey)) { @@ -1723,10 +1723,10 @@ static LPCSTR XFONT_UnAlias(char* font) { fontAlias* fa; XFONT_InitialCapitals(font); /* to remove extra white space */ - + for( fa = aliasTable; fa; fa = fa->next ) /* use case insensitive matching to handle eg "MS Sans Serif" */ - if( !strcasecmp( fa->faAlias, font ) ) + if( !strcasecmp( fa->faAlias, font ) ) { TRACE("found alias '%s'->%s'\n", font, fa->faTypeFace ); strcpy(font, fa->faTypeFace); @@ -1765,7 +1765,7 @@ void XFONT_RemoveFontResource( fontResource** ppfr ) /*********************************************************************** * XFONT_LoadIgnores * - * INIT ONLY + * INIT ONLY * * Removes specified fonts from the font table to prevent Wine from * using it. @@ -1791,7 +1791,7 @@ static void XFONT_LoadIgnore(char* lfdname) { TRACE("Ignoring '-%s-%s-'\n", (*ppfr)->resource->foundry, (*ppfr)->resource->family ); - + XFONT_RemoveFontResource( ppfr ); break; } @@ -1799,7 +1799,7 @@ static void XFONT_LoadIgnore(char* lfdname) } else WARN("Malformed font resource\n"); - + HeapFree(GetProcessHeap(), 0, lfd); } @@ -1833,7 +1833,7 @@ static void XFONT_LoadIgnores(void) while( *pch && isspace(*pch) ) pch++; XFONT_LoadIgnore(pch); } - else + else break; } while(TRUE); } @@ -1841,7 +1841,7 @@ static void XFONT_LoadIgnores(void) /*********************************************************************** * XFONT_UserMetricsCache - * + * * Returns expanded name for the cachedmetrics file. * Now it also appends the current value of the $DISPLAY variable. */ @@ -1939,7 +1939,7 @@ static void XFONT_CheckFIList( fontResource* fr, fontInfo* fi, int action) } else pfi->fi_flags &= ~FI_SUBSET; - prev = pfi; + prev = pfi; pfi = pfi->next; } @@ -1987,7 +1987,7 @@ static void XFONT_FixupPointSize(fontInfo* fi) /*********************************************************************** * XFONT_BuildMetrics - * + * * Build font metrics from X font */ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, int x_count) @@ -2019,30 +2019,30 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in } /* find a family to insert into */ - + for( pfr = NULL, fr = fontList; fr; fr = fr->next ) { if( XFONT_SameFoundryAndFamily(fr->resource, lfd)) break; pfr = fr; - } - + } + if( !fi ) fi = (fontInfo*) HeapAlloc(GetProcessHeap(), 0, sizeof(fontInfo)); - + if( !LFD_InitFontInfo( fi, lfd, x_pattern[i]) ) goto nextfont; - + if( !fr ) /* add new family */ { n_ff++; - fr = (fontResource*) HeapAlloc(GetProcessHeap(), 0, sizeof(fontResource)); + fr = (fontResource*) HeapAlloc(GetProcessHeap(), 0, sizeof(fontResource)); if (fr) { memset(fr, 0, sizeof(fontResource)); - - fr->resource = (LFD*) HeapAlloc(GetProcessHeap(), 0, sizeof(LFD)); + + fr->resource = (LFD*) HeapAlloc(GetProcessHeap(), 0, sizeof(LFD)); memset(fr->resource, 0, sizeof(LFD)); - + TRACE("family: -%s-%s-\n", lfd->foundry, lfd->family ); fr->resource->foundry = HeapAlloc(GetProcessHeap(), 0, strlen(lfd->foundry)+1); strcpy( (char *)fr->resource->foundry, lfd->foundry ); @@ -2058,18 +2058,18 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in } /* check if we already have something better than "fi" */ - - for( pfi = fr->fi, j = 0; pfi && j <= 0; pfi = pfi->next ) - if( (j = XFONT_IsSubset( pfi, fi )) < 0 ) + + for( pfi = fr->fi, j = 0; pfi && j <= 0; pfi = pfi->next ) + if( (j = XFONT_IsSubset( pfi, fi )) < 0 ) pfi->fi_flags |= FI_SUBSET; /* superseded by "fi" */ if( j > 0 ) goto nextfont; - + /* add new font instance "fi" to the "fr" font resource */ - + if( fi->fi_flags & FI_SCALABLE ) { LFD lfd1; - char pxl_string[4], res_string[4]; + char pxl_string[4], res_string[4]; /* set scalable font height to get an basis for extrapolation */ fi->lfd_height = DEF_SCALABLE_HEIGHT; @@ -2077,7 +2077,7 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in sprintf(pxl_string, "%d", fi->lfd_height); sprintf(res_string, "%d", fi->lfd_resolution); - + lfd1 = *lfd; lfd1.pixel_size = pxl_string; lfd1.point_size = "*"; @@ -2085,20 +2085,20 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in lfd1.resolution_y = res_string; LFD_UnParse(buffer, sizeof buffer, &lfd1); - + lpstr = buffer; } else lpstr = x_pattern[i]; if( (x_fs = TSXLoadQueryFont(gdi_display, lpstr)) ) - { + { XFONT_SetFontMetric( fi, fr, x_fs ); TSXFreeFont( gdi_display, x_fs ); XFONT_FixupPointSize(fi); TRACE("\t[% 2ipt] '%s'\n", fi->df.dfPoints, x_pattern[i] ); - + XFONT_CheckFIList( fr, fi, REMOVE_SUBSETS ); fi = NULL; /* preventing reuse */ } @@ -2114,45 +2114,45 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in } if( fi ) HeapFree(GetProcessHeap(), 0, fi); - /* Scan through the font list and remove FontResource(s) (fr) - * that have no associated Fontinfo(s) (fi). + /* Scan through the font list and remove FontResource(s) (fr) + * that have no associated Fontinfo(s) (fi). * This code is necessary because XFONT_ReadCachedMetrics - * assumes that there is at least one fi associated with a fr. + * assumes that there is at least one fi associated with a fr. * This assumption is invalid for TT font * -altsys-ms outlook-medium-r-normal--0-0-0-0-p-0-microsoft-symbol. */ - + fr = fontList; - - while (!fr->fi_count) + + while (!fr->fi_count) { fontList = fr->next; - + HeapFree(GetProcessHeap(), 0, fr->resource); HeapFree(GetProcessHeap(), 0, fr); - + fr = fontList; n_ff--; } - + fr = fontList; - + while (fr->next) { if (!fr->next->fi_count) { pfr = fr->next; fr->next = fr->next->next; - + HeapFree(GetProcessHeap(), 0, pfr->resource); HeapFree(GetProcessHeap(), 0, pfr); - + n_ff--; } - else - fr = fr->next; - } - + else + fr = fr->next; + } + return n_ff; } @@ -2232,7 +2232,7 @@ static BOOL XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int x { pfr->next = (fontResource*)(pfi + 1); pfr = pfr->next; - } + } else break; } if( pfr->next == NULL && @@ -2302,7 +2302,7 @@ static BOOL XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count, write( fd, &x_checksum, sizeof(unsigned) ); write( fd, &x_count, sizeof(int) ); - for( j = i = 0, pfr = fontList; pfr; pfr = pfr->next ) + for( j = i = 0, pfr = fontList; pfr; pfr = pfr->next ) { LFD_UnParse(buffer, sizeof buffer, pfr->resource); i += strlen( buffer) + 1; @@ -2320,7 +2320,7 @@ static BOOL XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count, TRACE("\t-%s-%s-, %i instances\n", pfr->resource->foundry, pfr->resource->family, pfr->fi_count ); i = write( fd, pfr, sizeof(fontResource) ); - if( i == sizeof(fontResource) ) + if( i == sizeof(fontResource) ) { for( k = 1, pfi = pfr->fi; pfi; pfi = pfi->next ) { @@ -2364,7 +2364,7 @@ static BOOL XFONT_WriteCachedMetrics( int fd, unsigned x_checksum, int x_count, */ static int XFONT_GetPointResolution( int *log_pixels_x, int *log_pixels_y ) { - int i, j, point_resolution, num = 3; + int i, j, point_resolution, num = 3; int allowed_xfont_resolutions[3] = { 72, 75, 100 }; int best = 0, best_diff = 65536; HKEY hkey; @@ -2536,7 +2536,7 @@ static UINT XFONT_Match( fontMatch* pfm ) if( plf->lfWidth ) { int h; - if( bR6 || bScale ) h = 0; + if( bR6 || bScale ) h = 0; else { /* FIXME: not complete */ @@ -2564,11 +2564,11 @@ static UINT XFONT_Match( fontMatch* pfm ) /* Underline */ if( plf->lfUnderline ) pfm->flags |= FO_SYNTH_UNDERLINE; -/* Strikeout */ +/* Strikeout */ if( plf->lfStrikeOut ) pfm->flags |= FO_SYNTH_STRIKEOUT; - if( penalty && !bScale && pfi->lfd_resolution != DefResolution ) + if( penalty && !bScale && pfi->lfd_resolution != DefResolution ) penalty++; TRACE(" returning %i\n", penalty ); @@ -2624,9 +2624,9 @@ static void XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm) fontMatch fm = *pfm; UINT current_score, score = (UINT)(-1); fontResource** ppfr; - + TRACE("(%u) '%s' h=%i weight=%i %s\n", - pfm->plf->lfCharSet, pfm->plf->lfFaceName, pfm->plf->lfHeight, + pfm->plf->lfCharSet, pfm->plf->lfFaceName, pfm->plf->lfHeight, pfm->plf->lfWeight, (pfm->plf->lfItalic) ? "Italic" : "" ); pfm->pfi = NULL; @@ -2661,7 +2661,7 @@ static void XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm) if( fm.pfr ) /* match family */ { TRACE("found facename '%s'\n", fm.pfr->lfFaceName ); - + if( fm.pfr->fr_flags & FR_REMOVED ) fm.pfr = 0; else @@ -2703,11 +2703,11 @@ static void XFONT_MatchDeviceFont( fontResource* start, fontMatch* pfm) XFONT_RemoveFontResource( ppfr ); continue; } - + fm.pfr = *ppfr; - + TRACE("%s\n", fm.pfr->lfFaceName ); - + current_score = XFONT_MatchFIList( &fm ); if( current_score < score ) { @@ -2735,14 +2735,14 @@ static void XFONT_GrowFreeList(int start, int end) fontCache[start].count = -1; fontCache[start].lru = start + 1; start++; - } + } } static fontObject* XFONT_LookupCachedFont( const LPLOGFONT16 plf, UINT16* checksum ) { UINT16 cs = __lfCheckSum( plf ); int i = fontMRU, prev = -1; - + *checksum = cs; while( i >= 0 ) { @@ -2758,7 +2758,7 @@ static fontObject* XFONT_LookupCachedFont( const LPLOGFONT16 plf, UINT16* checks /* remove temporarily from the lru list */ if( prev >= 0 ) fontCache[prev].lru = fontCache[i].lru; - else + else fontMRU = (INT16)fontCache[i].lru; return (fontCache + i); } @@ -2821,14 +2821,14 @@ static fontObject* XFONT_GetCacheEntry(void) TRACE("\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i ); - if( (newCache = (fontObject*)HeapReAlloc(GetProcessHeap(), 0, + if( (newCache = (fontObject*)HeapReAlloc(GetProcessHeap(), 0, fontCache, prev_i)) ) { i = fontCacheSize; fontCacheSize = prev_i; fontCache = newCache; XFONT_GrowFreeList( i, fontCacheSize - 1); - } + } else return NULL; } } @@ -2882,7 +2882,7 @@ void X11DRV_FONT_InitX11Metrics( void ) x_pattern = TSXListFonts(gdi_display, "*", MAX_FONTS, &x_count ); TRACE("Font Mapper: initializing %i x11 fonts\n", x_count); - if (x_count == MAX_FONTS) + if (x_count == MAX_FONTS) MESSAGE("There may be more fonts available - try increasing the value of MAX_FONTS\n"); for( i = x_checksum = 0; i < x_count; i++ ) @@ -3067,14 +3067,14 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf, if(abs(plf->lfHeight) > MAX_FONT_SIZE) { ERR( - "plf->lfHeight = %d, Creating a 100 pixel font and rescaling metrics \n", + "plf->lfHeight = %d, Creating a 100 pixel font and rescaling metrics \n", plf->lfHeight); pfo->rescale = fabs(plf->lfHeight / 100.0); if(plf->lfHeight > 0) plf->lfHeight = 100; else plf->lfHeight = -100; } else pfo->rescale = 1.0; - + XFONT_MatchDeviceFont( fontList, &fm ); pfo->fr = fm.pfr; pfo->fi = fm.pfi; @@ -3090,7 +3090,7 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf, if( (pfo->fs = TSXLoadQueryFont( gdi_display, lpLFD )) ) break; } while( uRelaxLevel ); - + if(pfo->lf.lfEscapement != 0) { pfo->lpX11Trans = HeapAlloc(GetProcessHeap(), 0, sizeof(XFONTTRANS)); if(!XFONT_SetX11Trans( pfo )) { @@ -3102,7 +3102,7 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf, &pfo->foInternalLeading, NULL, pfo->lpX11Trans ); pfo->foAvgCharWidth = (INT16)XFONT_GetAvgCharWidth(&pfo->fi->df, pfo->fs, pfo->lpX11Trans ); pfo->foMaxCharWidth = (INT16)XFONT_GetMaxCharWidth(pfo->fs, pfo->lpX11Trans); - + /* FIXME: If we've got a soft font or * there are FO_SYNTH_... flags for the * non PROOF_QUALITY request, the engine @@ -3110,7 +3110,7 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf, * pixmaps and store them in the pfo->lpPixmap * array (pfo->fs should be updated as well). * array (pfo->fs should be updated as well). - * X11DRV_ExtTextOut() must be heavily modified + * X11DRV_ExtTextOut() must be heavily modified * to support pixmap blitting and FO_SYNTH_... * styles. */ @@ -3155,7 +3155,7 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf, { UINT current_score, score = (UINT)(-1); - i = index = fontMRU; + i = index = fontMRU; fm.flags |= FO_MATCH_PAF; do { @@ -3175,7 +3175,7 @@ static X_PHYSFONT XFONT_RealizeFont( const LPLOGFONT16 plf, /* attach at the head of the lru list */ pfo->lru = fontMRU; index = fontMRU = (pfo - fontCache); - + END: pfo->count++; @@ -3244,7 +3244,7 @@ HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont ) if(fontList == NULL) X11DRV_FONT_InitX11Metrics(); - if( CHECK_PFONT(physDev->font) ) + if( CHECK_PFONT(physDev->font) ) XFONT_ReleaseCacheEntry( __PFONT(physDev->font) ); FONT_LogFontWTo16(&logfont, &lf); @@ -3284,7 +3284,7 @@ HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont ) FALSE, lf.lfCharSet, &charsetMatched ); - /* set face to the requested facename if it matched + /* set face to the requested facename if it matched * so that GetTextFace can get the correct face name */ if (alias && !strcmp(faceMatched, lf.lfFaceName)) @@ -3343,7 +3343,7 @@ BOOL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf, if(lf16.lfCharSet == DEFAULT_CHARSET || lf16.lfCharSet == pfi->df.dfCharSet) { - if( (b = (*proc)( &lf, &tm, + if( (b = (*proc)( &lf, &tm, XFONT_GetFontMetric( pfi, &lf, &tm ), lp )) ) bRet = b; else break; @@ -3356,7 +3356,7 @@ BOOL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf, { if(pfr->fi) { - if( (b = (*proc)( &lf, &tm, + if( (b = (*proc)( &lf, &tm, XFONT_GetFontMetric( pfr->fi, &lf, &tm ), lp )) ) bRet = b; else break; @@ -3418,11 +3418,11 @@ BOOL X11DRV_GetCharWidth( X11DRV_PDEVICE *physDev, UINT firstChar, UINT lastChar UINT ch_f; /* character code in the font encoding */ WideCharToMultiByte( pfo->fi->codepage, 0, &wch, 1, &ch, 1, NULL, NULL ); ch_f = ch; - if (ch_f >= pfo->fs->min_char_or_byte2 && + if (ch_f >= pfo->fs->min_char_or_byte2 && ch_f <= pfo->fs->max_char_or_byte2) { - cs = &pfo->fs->per_char[(ch_f - pfo->fs->min_char_or_byte2)]; - if (CI_NONEXISTCHAR(cs)) cs = def; + cs = &pfo->fs->per_char[(ch_f - pfo->fs->min_char_or_byte2)]; + if (CI_NONEXISTCHAR(cs)) cs = def; } else cs = def; if(pfo->lpX11Trans) *buffer++ = max(cs->attributes, 0) * diff --git a/if1632/relay.c b/if1632/relay.c index 3f8bbec4fe7..1263cc24b59 100644 --- a/if1632/relay.c +++ b/if1632/relay.c @@ -61,11 +61,11 @@ BOOL RELAY_Init(void) /* Patch the return addresses for CallTo16 routines */ CallTo16_DataSelector = wine_get_ds(); - CallTo16_RetAddr = + CallTo16_RetAddr = MAKESEGPTR( codesel, (char*)CallTo16_Ret - (char*)Call16_Ret_Start ); - CALL32_CBClient_RetAddr = + CALL32_CBClient_RetAddr = MAKESEGPTR( codesel, (char*)CALL32_CBClient_Ret - (char*)Call16_Ret_Start ); - CALL32_CBClientEx_RetAddr = + CALL32_CBClientEx_RetAddr = MAKESEGPTR( codesel, (char*)CALL32_CBClientEx_Ret - (char*)Call16_Ret_Start ); #endif return TRUE; @@ -164,7 +164,7 @@ static const CALLFROM16 *get_entry_point( STACK16FRAME *frame, LPSTR name, WORD max_offset = 0; *pOrd = 0; bundle = (ET_BUNDLE *)((BYTE *)pModule + pModule->entry_table); - do + do { entry = (ET_ENTRY *)((BYTE *)bundle+6); for (i = bundle->first + 1; i <= bundle->last; i++) @@ -183,7 +183,7 @@ static const CALLFROM16 *get_entry_point( STACK16FRAME *frame, LPSTR name, WORD /* Search for the name in the resident names table */ /* (built-in modules have no non-resident table) */ - + p = (BYTE *)pModule + pModule->name_table; while (*p) { @@ -360,7 +360,7 @@ void RELAY_DebugCallFrom16Ret( CONTEXT86 *context, int ret_val ) * * 'target' contains either the function to call (normal CallTo16) * or a pointer to the CONTEXT86 struct (register CallTo16). - * 'nb_args' is the number of argument bytes on the 16-bit stack; + * 'nb_args' is the number of argument bytes on the 16-bit stack; * 'reg_func' specifies whether we have a register CallTo16 or not. */ void RELAY_DebugCallTo16( LPVOID target, int nb_args, BOOL reg_func ) diff --git a/if1632/snoop.c b/if1632/snoop.c index a61917d70a9..74f40db4199 100644 --- a/if1632/snoop.c +++ b/if1632/snoop.c @@ -295,7 +295,7 @@ void WINAPI SNOOP16_Return(FARPROC proc, LPBYTE args, CONTEXT86 *context) { SNOOP16_RETURNENTRY *ret = (SNOOP16_RETURNENTRY*)((char *) MapSL( MAKESEGPTR(context->SegCs,LOWORD(context->Eip)) )-5); /* We haven't found out the nrofargs yet. If we called a cdecl - * function it is too late anyway and we can just set '0' (which + * function it is too late anyway and we can just set '0' (which * will be the difference between orig and current SP * If pascal -> everything ok. */ @@ -311,7 +311,7 @@ void WINAPI SNOOP16_Return(FARPROC proc, LPBYTE args, CONTEXT86 *context) { max = ret->dll->funs[ret->ordinal].nrofargs; if (max>16) max=16; - if (max<0) + if (max<0) max=0; for (i=max;i--;) diff --git a/include/commctrl.h b/include/commctrl.h index 46e74a7b364..893a20fa353 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -247,7 +247,7 @@ typedef struct tagNMCUSTOMDRAWINFO DWORD dwDrawStage; HDC hdc; RECT rc; - DWORD dwItemSpec; + DWORD dwItemSpec; UINT uItemState; LPARAM lItemlParam; } NMCUSTOMDRAW, *LPNMCUSTOMDRAW; @@ -513,7 +513,7 @@ typedef struct _IMAGELISTDRAWPARAMS DWORD dwRop; } IMAGELISTDRAWPARAMS, *LPIMAGELISTDRAWPARAMS; - + INT WINAPI ImageList_Add(HIMAGELIST,HBITMAP,HBITMAP); INT WINAPI ImageList_AddIcon (HIMAGELIST, HICON); INT WINAPI ImageList_AddMasked(HIMAGELIST,HBITMAP,COLORREF); @@ -522,13 +522,13 @@ BOOL WINAPI ImageList_Copy(HIMAGELIST,INT,HIMAGELIST,INT,INT); HIMAGELIST WINAPI ImageList_Create(INT,INT,UINT,INT,INT); BOOL WINAPI ImageList_Destroy(HIMAGELIST); BOOL WINAPI ImageList_DragEnter(HWND,INT,INT); -BOOL WINAPI ImageList_DragLeave(HWND); +BOOL WINAPI ImageList_DragLeave(HWND); BOOL WINAPI ImageList_DragMove(INT,INT); BOOL WINAPI ImageList_DragShowNolock (BOOL); BOOL WINAPI ImageList_Draw(HIMAGELIST,INT,HDC,INT,INT,UINT); BOOL WINAPI ImageList_DrawEx(HIMAGELIST,INT,HDC,INT,INT,INT, INT,COLORREF,COLORREF,UINT); -BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS*); +BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS*); HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST); BOOL WINAPI ImageList_EndDrag(VOID); COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST); @@ -641,17 +641,17 @@ HRESULT WINAPI UninitializeFlatSB(HWND); /* Header control */ -#define WC_HEADER16 "SysHeader" -#define WC_HEADERA "SysHeader32" +#define WC_HEADER16 "SysHeader" +#define WC_HEADERA "SysHeader32" static const WCHAR WC_HEADERW[] = { 'S','y','s','H','e','a','d','e','r','3','2',0 }; #define WC_HEADER WINELIB_NAME_AW(WC_HEADER) - -#define HDS_HORZ 0x0000 -#define HDS_BUTTONS 0x0002 -#define HDS_HOTTRACK 0x0004 -#define HDS_HIDDEN 0x0008 -#define HDS_DRAGDROP 0x0040 -#define HDS_FULLDRAG 0x0080 + +#define HDS_HORZ 0x0000 +#define HDS_BUTTONS 0x0002 +#define HDS_HOTTRACK 0x0004 +#define HDS_HIDDEN 0x0008 +#define HDS_DRAGDROP 0x0040 +#define HDS_FULLDRAG 0x0080 #define HDI_WIDTH 0x0001 #define HDI_HEIGHT HDI_WIDTH @@ -887,7 +887,7 @@ typedef struct tagNMHDDISPINFOW /* Toolbar */ -#define TOOLBARCLASSNAME16 "ToolbarWindow" +#define TOOLBARCLASSNAME16 "ToolbarWindow" #define TOOLBARCLASSNAMEA "ToolbarWindow32" static const WCHAR TOOLBARCLASSNAMEW[] = { 'T','o','o','l','b','a','r', 'W','i','n','d','o','w','3','2',0 }; @@ -905,7 +905,7 @@ static const WCHAR TOOLBARCLASSNAMEW[] = { 'T','o','o','l','b','a','r', #define TBSTATE_MARKED 0x80 -/* as of _WIN32_IE >= 0x0500 the following symbols are obsolete, +/* as of _WIN32_IE >= 0x0500 the following symbols are obsolete, * "everyone" should use the BTNS_... stuff below */ #define TBSTYLE_BUTTON 0x00 @@ -932,7 +932,7 @@ static const WCHAR TOOLBARCLASSNAMEW[] = { 'T','o','o','l','b','a','r', #define TBSTYLE_ALTDRAG 0x0400 #define TBSTYLE_FLAT 0x0800 #define TBSTYLE_LIST 0x1000 -#define TBSTYLE_CUSTOMERASE 0x2000 +#define TBSTYLE_CUSTOMERASE 0x2000 #define TBSTYLE_REGISTERDROP 0x4000 #define TBSTYLE_TRANSPARENT 0x8000 #define TBSTYLE_EX_DRAWDDARROWS 0x00000001 @@ -949,7 +949,7 @@ static const WCHAR TOOLBARCLASSNAMEW[] = { 'T','o','o','l','b','a','r', #define TBIF_COMMAND 0x00000020 #define TBIF_SIZE 0x00000040 -#define TBBF_LARGE 0x0001 +#define TBBF_LARGE 0x0001 #define TB_ENABLEBUTTON (WM_USER+1) #define TB_CHECKBUTTON (WM_USER+2) @@ -957,9 +957,9 @@ static const WCHAR TOOLBARCLASSNAMEW[] = { 'T','o','o','l','b','a','r', #define TB_HIDEBUTTON (WM_USER+4) #define TB_INDETERMINATE (WM_USER+5) #define TB_MARKBUTTON (WM_USER+6) -#define TB_ISBUTTONENABLED (WM_USER+9) -#define TB_ISBUTTONCHECKED (WM_USER+10) -#define TB_ISBUTTONPRESSED (WM_USER+11) +#define TB_ISBUTTONENABLED (WM_USER+9) +#define TB_ISBUTTONCHECKED (WM_USER+10) +#define TB_ISBUTTONPRESSED (WM_USER+11) #define TB_ISBUTTONHIDDEN (WM_USER+12) #define TB_ISBUTTONINDETERMINATE (WM_USER+13) #define TB_ISBUTTONHIGHLIGHTED (WM_USER+14) @@ -981,8 +981,8 @@ static const WCHAR TOOLBARCLASSNAMEW[] = { 'T','o','o','l','b','a','r', #define TB_SAVERESTOREW (WM_USER+76) #define TB_SAVERESTORE WINELIB_NAME_AW(TB_SAVERESTORE) #define TB_CUSTOMIZE (WM_USER+27) -#define TB_ADDSTRINGA (WM_USER+28) -#define TB_ADDSTRINGW (WM_USER+77) +#define TB_ADDSTRINGA (WM_USER+28) +#define TB_ADDSTRINGW (WM_USER+77) #define TB_ADDSTRING WINELIB_NAME_AW(TB_ADDSTRING) #define TB_GETITEMRECT (WM_USER+29) #define TB_BUTTONSTRUCTSIZE (WM_USER+30) @@ -1352,7 +1352,7 @@ typedef struct #define HICF_LMOUSE 0x00000080 /* left mouse button selected */ #define HICF_TOGGLEDROPDOWN 0x00000100 /* Toggle button's dropdown state */ -typedef struct +typedef struct { int iButton; DWORD dwFlags; @@ -1362,15 +1362,15 @@ typedef struct HWND WINAPI CreateToolbar(HWND, DWORD, UINT, INT, HINSTANCE, - UINT, LPCOLDTBBUTTON, INT); - + UINT, LPCOLDTBBUTTON, INT); + HWND WINAPI CreateToolbarEx(HWND, DWORD, UINT, INT, - HINSTANCE, UINT, LPCTBBUTTON, - INT, INT, INT, INT, INT, UINT); + HINSTANCE, UINT, LPCTBBUTTON, + INT, INT, INT, INT, INT, UINT); HBITMAP WINAPI -CreateMappedBitmap (HINSTANCE, INT, UINT, LPCOLORMAP, INT); +CreateMappedBitmap (HINSTANCE, INT, UINT, LPCOLORMAP, INT); /* Tool tips */ @@ -1382,7 +1382,7 @@ static const WCHAR TOOLTIPS_CLASSW[] = { 't','o','o','l','t','i','p','s','_', #define TOOLTIPS_CLASS WINELIB_NAME_AW(TOOLTIPS_CLASS) #define INFOTIPSIZE 1024 - + #define TTS_ALWAYSTIP 0x01 #define TTS_NOPREFIX 0x02 @@ -2098,7 +2098,7 @@ static const WCHAR WC_TREEVIEWW[] = { 'S','y','s', #define TVS_FULLROWSELECT 0x1000 #define TVS_NOSCROLL 0x2000 #define TVS_NONEVENHEIGHT 0x4000 -#define TVS_NOHSCROLL 0x8000 +#define TVS_NOHSCROLL 0x8000 #define TVS_SHAREDIMAGELISTS 0x0000 #define TVS_PRIVATEIMAGELISTS 0x0400 @@ -2341,7 +2341,7 @@ typedef struct tagTVKEYDOWN #define TreeView_InsertItemW(hwnd,phdi) \ (HTREEITEM)SendMessageW((hwnd), TVM_INSERTITEMW, 0, \ (LPARAM)(LPTVINSERTSTRUCTW)(phdi)) -#define TreeView_InsertItem WINELIB_NAME_AW(TreeView_InsertItem) +#define TreeView_InsertItem WINELIB_NAME_AW(TreeView_InsertItem) #define TreeView_DeleteItem(hwnd, hItem) \ (BOOL)SendMessageA((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hItem)) @@ -2416,12 +2416,12 @@ typedef struct tagTVKEYDOWN (BOOL)SendMessageA((hwnd), TVM_GETITEMA, 0, (LPARAM) (TVITEMA *)(pitem)) #define TreeView_GetItemW(hwnd, pitem) \ (BOOL)SendMessageW((hwnd), TVM_GETITEMA, 0, (LPARAM) (TVITEMA *)(pitem)) -#define TreeView_GetItem WINELIB_NAME_AW(TreeView_GetItem) +#define TreeView_GetItem WINELIB_NAME_AW(TreeView_GetItem) #define TreeView_SetItemA(hwnd, pitem) \ - (BOOL)SendMessageA((hwnd), TVM_SETITEMA, 0, (LPARAM)(const TVITEMA *)(pitem)) + (BOOL)SendMessageA((hwnd), TVM_SETITEMA, 0, (LPARAM)(const TVITEMA *)(pitem)) #define TreeView_SetItemW(hwnd, pitem) \ - (BOOL)SendMessageW((hwnd), TVM_SETITEMA, 0, (LPARAM)(const TVITEMA *)(pitem)) + (BOOL)SendMessageW((hwnd), TVM_SETITEMA, 0, (LPARAM)(const TVITEMA *)(pitem)) #define TreeView_SetItem WINELIB_NAME_AW(TreeView_SetItem) #define TreeView_EditLabel(hwnd, hitem) \ @@ -2597,7 +2597,7 @@ static const WCHAR WC_LISTVIEWW[] = { 'S','y','s', #define LVFI_PARAM 0X0001 #define LVFI_STRING 0X0002 #define LVFI_PARTIAL 0X0008 -#define LVFI_WRAP 0X0020 +#define LVFI_WRAP 0X0020 #define LVFI_NEARESTXY 0X0040 #define LVIF_TEXT 0x0001 @@ -2611,7 +2611,7 @@ static const WCHAR WC_LISTVIEWW[] = { 'S','y','s', #define LVIR_BOUNDS 0x0000 #define LVIR_LABEL 0x0002 #define LVIR_ICON 0x0001 -#define LVIR_SELECTBOUNDS 0x0003 +#define LVIR_SELECTBOUNDS 0x0003 #define LVIS_FOCUSED 0x0001 #define LVIS_SELECTED 0x0002 @@ -3181,10 +3181,10 @@ typedef struct tagNMLVODSTATECHANGE #define ListView_SetItemTextA(hwndLV, i, _iSubItem, _pszText) \ { LVITEMA _LVi; _LVi.iSubItem = _iSubItem; _LVi.pszText = _pszText;\ - SendMessageA(hwndLV, LVM_SETITEMTEXTA, (WPARAM)i, (LPARAM) (LVITEMA*)&_LVi);} + SendMessageA(hwndLV, LVM_SETITEMTEXTA, (WPARAM)i, (LPARAM) (LVITEMA*)&_LVi);} #define ListView_SetItemTextW(hwndLV, i, _iSubItem, _pszText) \ { LVITEMW _LVi; _LVi.iSubItem = _iSubItem; _LVi.pszText = _pszText;\ - SendMessageW(hwndLV, LVM_SETITEMTEXTW, (WPARAM)i, (LPARAM) (LVITEMW*)& _LVi);} + SendMessageW(hwndLV, LVM_SETITEMTEXTW, (WPARAM)i, (LPARAM) (LVITEMW*)& _LVi);} #define ListView_SetItemText WINELIB_NAME_AW(ListView_SetItemText) #define ListView_DeleteItem(hwndLV, i) \ @@ -3755,12 +3755,12 @@ static const WCHAR MONTHCAL_CLASSW[] = { 'S','y','s', #define MCN_GETDAYSTATE (MCN_FIRST + 3) #define MCN_SELECT (MCN_FIRST + 4) -#define MCSC_BACKGROUND 0 -#define MCSC_TEXT 1 -#define MCSC_TITLEBK 2 +#define MCSC_BACKGROUND 0 +#define MCSC_TEXT 1 +#define MCSC_TITLEBK 2 #define MCSC_TITLETEXT 3 -#define MCSC_MONTHBK 4 -#define MCSC_TRAILINGTEXT 5 +#define MCSC_MONTHBK 4 +#define MCSC_TRAILINGTEXT 5 #define MCS_DAYSTATE 0x0001 #define MCS_MULTISELECT 0x0002 @@ -3772,8 +3772,8 @@ static const WCHAR MONTHCAL_CLASSW[] = { 'S','y','s', #define MCHT_CALENDAR 0x00020000 #define MCHT_TODAYLINK 0x00030000 -#define MCHT_NEXT 0x01000000 -#define MCHT_PREV 0x02000000 +#define MCHT_NEXT 0x01000000 +#define MCHT_PREV 0x02000000 #define MCHT_NOWHERE 0x00000000 #define MCHT_TITLEBK (MCHT_TITLE) #define MCHT_TITLEMONTH (MCHT_TITLE | 0x0001) @@ -3790,8 +3790,8 @@ static const WCHAR MONTHCAL_CLASSW[] = { 'S','y','s', -#define GMR_VISIBLE 0 -#define GMR_DAYSTATE 1 +#define GMR_VISIBLE 0 +#define GMR_DAYSTATE 1 /* Month calendar's structures */ @@ -3800,13 +3800,13 @@ static const WCHAR MONTHCAL_CLASSW[] = { 'S','y','s', typedef struct { UINT cbSize; POINT pt; - UINT uHit; + UINT uHit; SYSTEMTIME st; } MCHITTESTINFO, *PMCHITTESTINFO; typedef struct tagNMSELCHANGE { - NMHDR nmhdr; + NMHDR nmhdr; SYSTEMTIME stSelStart; SYSTEMTIME stSelEnd; } NMSELCHANGE, *LPNMSELCHANGE; @@ -3816,7 +3816,7 @@ typedef DWORD MONTHDAYSTATE, *LPMONTHDAYSTATE; typedef struct tagNMDAYSTATE { - NMHDR nmhdr; + NMHDR nmhdr; SYSTEMTIME stStart; int cDayState; LPMONTHDAYSTATE prgDayState; @@ -3903,13 +3903,13 @@ static const WCHAR DATETIMEPICK_CLASSW[] = { 'S','y','s', /* Datetime Notifications */ -#define DTN_DATETIMECHANGE (DTN_FIRST + 1) -#define DTN_USERSTRINGA (DTN_FIRST + 2) -#define DTN_WMKEYDOWNA (DTN_FIRST + 3) -#define DTN_FORMATA (DTN_FIRST + 4) -#define DTN_FORMATQUERYA (DTN_FIRST + 5) +#define DTN_DATETIMECHANGE (DTN_FIRST + 1) +#define DTN_USERSTRINGA (DTN_FIRST + 2) +#define DTN_WMKEYDOWNA (DTN_FIRST + 3) +#define DTN_FORMATA (DTN_FIRST + 4) +#define DTN_FORMATQUERYA (DTN_FIRST + 5) #define DTN_DROPDOWN (DTN_FIRST + 6) -#define DTN_CLOSEUP (DTN_FIRST + 7) +#define DTN_CLOSEUP (DTN_FIRST + 7) #define DTN_USERSTRINGW (DTN_FIRST + 15) #define DTN_WMKEYDOWNW (DTN_FIRST + 16) #define DTN_FORMATW (DTN_FIRST + 17) @@ -3920,35 +3920,35 @@ static const WCHAR DATETIMEPICK_CLASSW[] = { 'S','y','s', #define DTN_FORMAT WINELIB_NAME_AW(DTN_FORMAT) #define DTN_FORMATQUERY WINELIB_NAME_AW(DTN_FORMATQUERY) -#define DTS_SHORTDATEFORMAT 0x0000 -#define DTS_UPDOWN 0x0001 -#define DTS_SHOWNONE 0x0002 -#define DTS_LONGDATEFORMAT 0x0004 -#define DTS_TIMEFORMAT 0x0009 -#define DTS_APPCANPARSE 0x0010 -#define DTS_RIGHTALIGN 0x0020 +#define DTS_SHORTDATEFORMAT 0x0000 +#define DTS_UPDOWN 0x0001 +#define DTS_SHOWNONE 0x0002 +#define DTS_LONGDATEFORMAT 0x0004 +#define DTS_TIMEFORMAT 0x0009 +#define DTS_APPCANPARSE 0x0010 +#define DTS_RIGHTALIGN 0x0020 typedef struct tagNMDATETIMECHANGE { NMHDR nmhdr; - DWORD dwFlags; - SYSTEMTIME st; + DWORD dwFlags; + SYSTEMTIME st; } NMDATETIMECHANGE, *LPNMDATETIMECHANGE; typedef struct tagNMDATETIMESTRINGA { NMHDR nmhdr; - LPCSTR pszUserString; - SYSTEMTIME st; - DWORD dwFlags; + LPCSTR pszUserString; + SYSTEMTIME st; + DWORD dwFlags; } NMDATETIMESTRINGA, *LPNMDATETIMESTRINGA; typedef struct tagNMDATETIMESTRINGW { NMHDR nmhdr; LPCWSTR pszUserString; - SYSTEMTIME st; - DWORD dwFlags; + SYSTEMTIME st; + DWORD dwFlags; } NMDATETIMESTRINGW, *LPNMDATETIMESTRINGW; DECL_WINELIB_TYPE_AW(NMDATETIMESTRING) @@ -3957,17 +3957,17 @@ DECL_WINELIB_TYPE_AW(LPNMDATETIMESTRING) typedef struct tagNMDATETIMEWMKEYDOWNA { NMHDR nmhdr; - int nVirtKey; - LPCSTR pszFormat; - SYSTEMTIME st; + int nVirtKey; + LPCSTR pszFormat; + SYSTEMTIME st; } NMDATETIMEWMKEYDOWNA, *LPNMDATETIMEWMKEYDOWNA; typedef struct tagNMDATETIMEWMKEYDOWNW { NMHDR nmhdr; - int nVirtKey; - LPCWSTR pszFormat; - SYSTEMTIME st; + int nVirtKey; + LPCWSTR pszFormat; + SYSTEMTIME st; } NMDATETIMEWMKEYDOWNW, *LPNMDATETIMEWMKEYDOWNW; DECL_WINELIB_TYPE_AW(NMDATETIMEWMKEYDOWN) @@ -3976,18 +3976,18 @@ DECL_WINELIB_TYPE_AW(LPNMDATETIMEWMKEYDOWN) typedef struct tagNMDATETIMEFORMATA { NMHDR nmhdr; - LPCSTR pszFormat; - SYSTEMTIME st; - LPCSTR pszDisplay; - CHAR szDisplay[64]; + LPCSTR pszFormat; + SYSTEMTIME st; + LPCSTR pszDisplay; + CHAR szDisplay[64]; } NMDATETIMEFORMATA, *LPNMDATETIMEFORMATA; typedef struct tagNMDATETIMEFORMATW { NMHDR nmhdr; - LPCWSTR pszFormat; - SYSTEMTIME st; + LPCWSTR pszFormat; + SYSTEMTIME st; LPCWSTR pszDisplay; WCHAR szDisplay[64]; } NMDATETIMEFORMATW, *LPNMDATETIMEFORMATW; @@ -3998,15 +3998,15 @@ DECL_WINELIB_TYPE_AW(LPNMDATETIMEFORMAT) typedef struct tagNMDATETIMEFORMATQUERYA { NMHDR nmhdr; - LPCSTR pszFormat; - SIZE szMax; + LPCSTR pszFormat; + SIZE szMax; } NMDATETIMEFORMATQUERYA, *LPNMDATETIMEFORMATQUERYA; typedef struct tagNMDATETIMEFORMATQUERYW { NMHDR nmhdr; - LPCWSTR pszFormat; - SIZE szMax; + LPCWSTR pszFormat; + SIZE szMax; } NMDATETIMEFORMATQUERYW, *LPNMDATETIMEFORMATQUERYW; DECL_WINELIB_TYPE_AW(NMDATETIMEFORMATQUERY) @@ -4023,11 +4023,11 @@ DECL_WINELIB_TYPE_AW(LPNMDATETIMEFORMATQUERY) #define DateTime_GetSystemtime(hdp, pst) \ - (DWORD)SendMessageA (hdp, DTM_GETSYSTEMTIME , 0, (LPARAM)(pst)) + (DWORD)SendMessageA (hdp, DTM_GETSYSTEMTIME , 0, (LPARAM)(pst)) #define DateTime_SetSystemtime(hdp, gd, pst) \ (BOOL)SendMessageA (hdp, DTM_SETSYSTEMTIME, (LPARAM)(gd), (LPARAM)(pst)) #define DateTime_GetRange(hdp, rgst) \ - (DWORD)SendMessageA (hdp, DTM_GETRANGE, 0, (LPARAM)(rgst)) + (DWORD)SendMessageA (hdp, DTM_GETRANGE, 0, (LPARAM)(rgst)) #define DateTime_SetRange(hdp, gd, rgst) \ (BOOL)SendMessageA (hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst)) #define DateTime_SetFormat WINELIB_NAME_AW(DateTime_SetFormat) @@ -4101,7 +4101,7 @@ BOOL WINAPI DSA_DestroyCallback (const HDSA, DSAENUMPROC, LPARAM); typedef struct _DPA { INT nItemCount; - LPVOID *ptrs; + LPVOID *ptrs; HANDLE hHeap; INT nGrow; INT nMaxCount; @@ -4125,7 +4125,7 @@ BOOL WINAPI DPA_Sort (const HDPA, PFNDPACOMPARE, LPARAM); #define DPAS_SORTED 0x0001 #define DPAS_INSERTBEFORE 0x0002 #define DPAS_INSERTAFTER 0x0004 - + INT WINAPI DPA_Search (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT); #define DPAM_NOSORT 0x0001 diff --git a/include/commdlg.h b/include/commdlg.h index 0f563fae493..7a45061950c 100644 --- a/include/commdlg.h +++ b/include/commdlg.h @@ -45,7 +45,7 @@ extern "C" { #define OFN_SHAREAWARE 0x00004000 #define OFN_NOREADONLYRETURN 0x00008000 #define OFN_NOTESTFILECREATE 0x00010000 -#define OFN_NONETWORKBUTTON 0x00020000 +#define OFN_NONETWORKBUTTON 0x00020000 #define OFN_NOLONGNAMES 0x00040000 #define OFN_EXPLORER 0x00080000 #define OFN_NODEREFERENCELINKS 0x00100000 @@ -65,7 +65,7 @@ extern "C" { #define SAVE_DIALOG 1 #define OPEN_DIALOG 2 - + typedef UINT (CALLBACK *LPOFNHOOKPROC)(HWND,UINT,WPARAM,LPARAM); typedef struct { @@ -133,7 +133,7 @@ typedef struct DECL_WINELIB_TYPE_AW(OFNOTIFY) DECL_WINELIB_TYPE_AW(LPOFNOTIFY) - + typedef UINT (CALLBACK *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM); typedef struct { @@ -205,10 +205,10 @@ typedef struct { LPFRHOOKPROC lpfnHook; LPCWSTR lpTemplateName; } FINDREPLACEW, *LPFINDREPLACEW; - + DECL_WINELIB_TYPE_AW(FINDREPLACE) DECL_WINELIB_TYPE_AW(LPFINDREPLACE) - + #define FR_DOWN 0x00000001 #define FR_WHOLEWORD 0x00000002 #define FR_MATCHCASE 0x00000004 @@ -231,42 +231,42 @@ typedef UINT (CALLBACK *LPCFHOOKPROC)(HWND,UINT,WPARAM,LPARAM); typedef struct { - UINT lStructSize; - HWND hwndOwner; - HDC hDC; - LPLOGFONTA lpLogFont; - INT iPointSize; - DWORD Flags; - COLORREF rgbColors; - LPARAM lCustData; - LPCFHOOKPROC lpfnHook; - LPCSTR lpTemplateName; - HINSTANCE hInstance; - LPSTR lpszStyle; - WORD nFontType; - WORD ___MISSING_ALIGNMENT__; - INT nSizeMin; - INT nSizeMax; + UINT lStructSize; + HWND hwndOwner; + HDC hDC; + LPLOGFONTA lpLogFont; + INT iPointSize; + DWORD Flags; + COLORREF rgbColors; + LPARAM lCustData; + LPCFHOOKPROC lpfnHook; + LPCSTR lpTemplateName; + HINSTANCE hInstance; + LPSTR lpszStyle; + WORD nFontType; + WORD ___MISSING_ALIGNMENT__; + INT nSizeMin; + INT nSizeMax; } CHOOSEFONTA, *LPCHOOSEFONTA; typedef struct { - UINT lStructSize; - HWND hwndOwner; - HDC hDC; - LPLOGFONTW lpLogFont; - INT iPointSize; - DWORD Flags; - COLORREF rgbColors; - LPARAM lCustData; - LPCFHOOKPROC lpfnHook; - LPCWSTR lpTemplateName; - HINSTANCE hInstance; - LPWSTR lpszStyle; - WORD nFontType; - WORD ___MISSING_ALIGNMENT__; - INT nSizeMin; - INT nSizeMax; + UINT lStructSize; + HWND hwndOwner; + HDC hDC; + LPLOGFONTW lpLogFont; + INT iPointSize; + DWORD Flags; + COLORREF rgbColors; + LPARAM lCustData; + LPCFHOOKPROC lpfnHook; + LPCWSTR lpTemplateName; + HINSTANCE hInstance; + LPWSTR lpszStyle; + WORD nFontType; + WORD ___MISSING_ALIGNMENT__; + INT nSizeMin; + INT nSizeMax; } CHOOSEFONTW, *LPCHOOSEFONTW; DECL_WINELIB_TYPE_AW(CHOOSEFONT) @@ -627,7 +627,7 @@ BOOL WINAPI ChooseFontA(LPCHOOSEFONTA); BOOL WINAPI ChooseFontW(LPCHOOSEFONTW); #define ChooseFont WINELIB_NAME_AW(ChooseFont) -void COMDLG32_SetCommDlgExtendedError(DWORD err); +void COMDLG32_SetCommDlgExtendedError(DWORD err); #include "poppack.h" diff --git a/include/cursoricon.h b/include/cursoricon.h index 8b3944409fc..f902d340ab4 100644 --- a/include/cursoricon.h +++ b/include/cursoricon.h @@ -91,8 +91,8 @@ extern HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name, int width, int height, int colors, BOOL fCursor, UINT loadflags); -extern HGLOBAL CURSORICON_ExtCopy(HGLOBAL handle, UINT type, - INT desiredx, INT desiredy, +extern HGLOBAL CURSORICON_ExtCopy(HGLOBAL handle, UINT type, + INT desiredx, INT desiredy, UINT flags); extern void CURSORICON_FreeModuleIcons( HMODULE hModule ); diff --git a/include/d3d.h b/include/d3d.h index c65b1d68767..8d6d956407d 100644 --- a/include/d3d.h +++ b/include/d3d.h @@ -234,7 +234,7 @@ ICOM_DEFINE(IDirect3D,IUnknown) IDirect3D2_METHODS ICOM_DEFINE(IDirect3D2,IUnknown) #undef ICOM_INTERFACE - + /*** IUnknown methods ***/ #define IDirect3D2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define IDirect3D2_AddRef(p) ICOM_CALL (AddRef,p) @@ -267,7 +267,7 @@ ICOM_DEFINE(IDirect3D2,IUnknown) IDirect3D3_METHODS ICOM_DEFINE(IDirect3D3,IUnknown) #undef ICOM_INTERFACE - + /*** IUnknown methods ***/ #define IDirect3D3_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define IDirect3D3_AddRef(p) ICOM_CALL (AddRef,p) @@ -324,7 +324,7 @@ ICOM_DEFINE(IDirect3D7,IUnknown) IDirect3DLight_METHODS ICOM_DEFINE(IDirect3DLight,IUnknown) #undef ICOM_INTERFACE - + /*** IUnknown methods ***/ #define IDirect3DLight_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define IDirect3DLight_AddRef(p) ICOM_CALL (AddRef,p) @@ -387,7 +387,7 @@ ICOM_DEFINE(IDirect3DMaterial2,IUnknown) #define IDirect3DMaterial2_SetMaterial(p,a) ICOM_CALL1(SetMaterial,p,a) #define IDirect3DMaterial2_GetMaterial(p,a) ICOM_CALL1(GetMaterial,p,a) #define IDirect3DMaterial2_GetHandle(p,a,b) ICOM_CALL2(GetHandle,p,a,b) - + /***************************************************************************** * IDirect3DMaterial3 interface @@ -411,7 +411,7 @@ ICOM_DEFINE(IDirect3DMaterial3,IUnknown) #define IDirect3DMaterial3_SetMaterial(p,a) ICOM_CALL1(SetMaterial,p,a) #define IDirect3DMaterial3_GetMaterial(p,a) ICOM_CALL1(GetMaterial,p,a) #define IDirect3DMaterial3_GetHandle(p,a,b) ICOM_CALL2(GetHandle,p,a,b) - + /***************************************************************************** * IDirect3DTexture interface @@ -983,7 +983,7 @@ ICOM_DEFINE(IDirect3DVertexBuffer,IUnknown) #define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) ICOM_CALL7(ProcessVertices,p,a,b,c,d,e,f,g) #define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) ICOM_CALL1(GetVertexBufferDesc,p,a) #define IDirect3DVertexBuffer_Optimize(p,a,b) ICOM_CALL2(Optimize,p,a,b) - + /***************************************************************************** * IDirect3DVertexBuffer7 interface */ diff --git a/include/d3dtypes.h b/include/d3dtypes.h index effd5fef557..908ff24599f 100644 --- a/include/d3dtypes.h +++ b/include/d3dtypes.h @@ -696,7 +696,7 @@ typedef enum { D3DTBLEND_ADD = 8, D3DTBLEND_FORCE_DWORD = 0x7fffffff } D3DTEXTUREBLEND; - + typedef enum _D3DTEXTUREADDRESS { D3DTADDRESS_WRAP = 1, D3DTADDRESS_MIRROR = 2, diff --git a/include/dde.h b/include/dde.h index 7062c903bdf..d80888f766f 100644 --- a/include/dde.h +++ b/include/dde.h @@ -75,7 +75,7 @@ typedef struct tagDDEPOKE DDEPOKE; BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, CONST SECURITY_QUALITY_OF_SERVICE *pqosNew, PSECURITY_QUALITY_OF_SERVICE pqosPrev); - + BOOL WINAPI ImpersonateDdeClientWindow(HWND hWndClient, HWND hWndServer); /* lParam packing/unpacking API */ diff --git a/include/ddeml.h b/include/ddeml.h index b055f8f13bd..5b7a5765401 100644 --- a/include/ddeml.h +++ b/include/ddeml.h @@ -34,7 +34,7 @@ extern "C" { #define CP_WINANSI 1004 #define CP_WINUNICODE 1200 -/* DDE synchronisation constants +/* DDE synchronisation constants */ #define MSGF_DDEMGR 0x8001 @@ -348,7 +348,7 @@ BOOL WINAPI DdeFreeStringHandle(DWORD,HSZ); BOOL WINAPI DdeFreeDataHandle(HDDEDATA); BOOL WINAPI DdeKeepStringHandle(DWORD,HSZ); HDDEDATA WINAPI DdeClientTransaction(LPBYTE,DWORD,HCONV,HSZ,UINT,UINT,DWORD,LPDWORD); -BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction); +BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction); BOOL WINAPI DdeImpersonateClient(HCONV); BOOL WINAPI DdePostAdvise(DWORD,HSZ,HSZ); HDDEDATA WINAPI DdeAddData(HDDEDATA,LPBYTE,DWORD,DWORD); diff --git a/include/ddraw.h b/include/ddraw.h index 7ac35da0d42..29e7943c316 100644 --- a/include/ddraw.h +++ b/include/ddraw.h @@ -965,7 +965,7 @@ typedef struct _DDSURFACEDESC DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/ DWORD dwZBufferBitDepth;/*18: depth of Z buffer requested*/ DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/ - } DUMMYUNIONNAME2; + } DUMMYUNIONNAME2; DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/ DWORD dwReserved; /* 20:reserved*/ LPVOID lpSurface; /* 24:pointer to the associated surface memory*/ @@ -1006,7 +1006,7 @@ typedef struct _DDSURFACEDESC2 union { DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/ - DWORD dwFVF; /* 48: vertex format description of vertex buffers */ + DWORD dwFVF; /* 48: vertex format description of vertex buffers */ } DUMMYUNIONNAME4; DDSCAPS2 ddsCaps; /* 68: DDraw surface caps */ DWORD dwTextureStage; /* 78: stage in multitexture cascade */ @@ -1320,7 +1320,7 @@ ICOM_DEFINE(IDirectDraw,IUnknown) /***************************************************************************** * IDirectDraw2 interface */ -/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of +/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of * arguments of SetDisplayMode has changed ! */ #define ICOM_INTERFACE IDirectDraw2 @@ -1622,7 +1622,7 @@ ICOM_DEFINE(IDirectDrawSurface,IUnknown) /***************************************************************************** * IDirectDrawSurface2 interface */ -/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters +/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters * have been converted to LPDIRECTDRAWSURFACE2. */ #define ICOM_INTERFACE IDirectDrawSurface2 @@ -1717,7 +1717,7 @@ ICOM_DEFINE(IDirectDrawSurface2,IUnknown) /***************************************************************************** * IDirectDrawSurface3 interface */ -/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters +/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters * have been converted to LPDIRECTDRAWSURFACE3. */ #define ICOM_INTERFACE IDirectDrawSurface3 diff --git a/include/dinput.h b/include/dinput.h index d8ce8d15cf2..9eb90e1c28f 100644 --- a/include/dinput.h +++ b/include/dinput.h @@ -788,8 +788,8 @@ typedef struct DIFILEEFFECT { CHAR szFriendlyName[MAX_PATH]; } DIFILEEFFECT, *LPDIFILEEFFECT; -typedef const DIFILEEFFECT *LPCDIFILEEFFECT; -typedef BOOL (CALLBACK *LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID); +typedef const DIFILEEFFECT *LPCDIFILEEFFECT; +typedef BOOL (CALLBACK *LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID); /***************************************************************************** @@ -1092,7 +1092,7 @@ ICOM_DEFINE(IDirectInput7A,IDirectInput2A) /*** IDirectInput7A methods ***/ #define IDirectInput7A_CreateDeviceEx(p,a,b,c,d) ICOM_CALL4(CreateDeviceEx,p,a,b,c,d) -/* Export functions */ +/* Export functions */ #ifdef __cplusplus extern "C" { diff --git a/include/dispdib.h b/include/dispdib.h index aaae52c0f31..d4702e7ddba 100644 --- a/include/dispdib.h +++ b/include/dispdib.h @@ -1,6 +1,6 @@ /* * DISPDIB.dll - * + * * Copyright 1998 Ove KÅven * * This library is free software; you can redistribute it and/or diff --git a/include/dlgs.h b/include/dlgs.h index 74c57723363..0debdc6a004 100644 --- a/include/dlgs.h +++ b/include/dlgs.h @@ -204,7 +204,7 @@ #define FORMATDLGORD31 1543 #define FORMATDLGORD30 1544 #define PAGESETUPDLGORD 1546 -#define NEWFILEOPENORD 1547 +#define NEWFILEOPENORD 1547 #define PRINTDLGEXORD 1549 #define PAGESETUPDLGORDMOTIF 1550 #define COLORMGMTDLGORD 1551 diff --git a/include/docobj.h b/include/docobj.h index 7b0e54f3135..4cbdaef421c 100644 --- a/include/docobj.h +++ b/include/docobj.h @@ -60,8 +60,8 @@ typedef struct _tagOLECMDTEXT WCHAR rgwz[1]; } OLECMDTEXT; -typedef enum -{ +typedef enum +{ PRINTFLAG_MAYBOTHERUSER = 1, PRINTFLAG_PROMPTUSER = 2, PRINTFLAG_USERMAYCHANGEPRINTER = 4, @@ -93,7 +93,7 @@ typedef enum OLECMDTEXTF_STATUS = 2 } OLECMDTEXTF; -typedef enum +typedef enum { OLECMDEXECOPT_DODEFAULT = 0, OLECMDEXECOPT_PROMPTUSER = 1, @@ -144,39 +144,39 @@ typedef enum OLECMDID OLECMDID_PREREFRESH = 39 /* iexplorer uses ... 44 */ } OLECMDID; - + #define OLECMDERR_E_FIRST (OLE_E_LAST+1) #define OLECMDERR_E_NOTSUPPORTED (OLECMDERR_E_FIRST) #define OLECMDERR_E_DISABLED (OLECMDERR_E_FIRST+1) #define OLECMDERR_E_NOHELP (OLECMDERR_E_FIRST+2) #define OLECMDERR_E_CANCELED (OLECMDERR_E_FIRST+3) #define OLECMDERR_E_UNKNOWNGROUP (OLECMDERR_E_FIRST+4) - + /***************************************************************************** * Predeclare the interfaces */ DEFINE_GUID(IID_IOleDocument, 0xb722bcc5,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); typedef struct IOleDocument IOleDocument, *LPOLEDOCUMENT; - + DEFINE_GUID(IID_IOleDocumentSite, 0xb722bcc7,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); typedef struct IOleDocumentSite IOleDocumentSite, *LPOLEDOCUMENTSITE; - + DEFINE_GUID(IID_IOleDocumentView, 0xb722bcc6,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); typedef struct IOleDocumentView IOleDocumentView, *LPOLEDOCUMENTVIEW; - + DEFINE_GUID(IID_IEnumOleDocumentViews, 0xb722bcc6,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); typedef struct IEnumOleDocumentViews IEnumOleDocumentViews, *LPENUMOLEDOCUMENTVIEWS; - + DEFINE_GUID(IID_IOleCommandTarget, 0xb722bccb,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); typedef struct IOleCommandTarget IOleCommandTarget, *LPOLECOMMANDTARGET; - + DEFINE_GUID(IID_IContinueCallback, 0xb722bcca,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); typedef struct IContinueCallback IContinueCallback, *LPCONTINUECALLBACK; - + DEFINE_GUID(IID_IPrint, 0xb722bcc9,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); typedef struct IPrint IPrint, *LPPRINT; - - + + /***************************************************************************** * IOleDocument interface */ @@ -238,7 +238,7 @@ ICOM_DEFINE(IOleDocumentSite,IUnknown) ICOM_METHOD1(HRESULT,CloseView, DWORD,dwReserved) \ ICOM_METHOD1(HRESULT,SaveViewState, LPSTREAM,pstm) \ ICOM_METHOD1(HRESULT,ApplyViewState,LPSTREAM,pstm) \ - ICOM_METHOD2(HRESULT,Clone, IOleInPlaceSite*,pIPSiteNew, IOleDocumentView**,ppViewNew) + ICOM_METHOD2(HRESULT,Clone, IOleInPlaceSite*,pIPSiteNew, IOleDocumentView**,ppViewNew) #define IOleDocumentView_IMETHODS \ IUnknown_IMETHODS \ IOleDocumentView_METHODS @@ -273,7 +273,7 @@ ICOM_DEFINE(IOleDocumentView,IUnknown) ICOM_METHOD3(HRESULT,Next, ULONG,cViews, IOleDocumentView**,rgpView, ULONG*,pcFetched) \ ICOM_METHOD1(HRESULT,Skip, ULONG,cViews) \ ICOM_METHOD (HRESULT,Reset) \ - ICOM_METHOD1(HRESULT,Clone, IEnumOleDocumentViews**,ppEnum) + ICOM_METHOD1(HRESULT,Clone, IEnumOleDocumentViews**,ppEnum) #define IEnumOleDocumentViews_IMETHODS \ IUnknown_IMETHODS \ IEnumOleDocumentViews_METHODS @@ -290,7 +290,7 @@ ICOM_DEFINE(IEnumOleDocumentViews,IUnknown) #define IEnumOleDocumentViews_Reset(p) ICOM_CALL (Reset,p) #define IEnumOleDocumentViews_Clone(p,a) ICOM_CALL1(Clone,p,a) - + /***************************************************************************** * IOleCommandTarget interface */ @@ -342,13 +342,13 @@ ICOM_DEFINE(IContinueCallback,IUnknown) #define IPrint_METHODS \ ICOM_METHOD1(HRESULT,SetInitialPageNum, LONG,nFirstPage) \ ICOM_METHOD2(HRESULT,GetPageInfo, LONG*,pnFirstPage, LONG*,pcPages) \ - ICOM_METHOD8(HRESULT,Print, DWORD,grfFlags, DVTARGETDEVICE**,pptd, PAGESET**,ppPageSet, STGMEDIUM*,pstgmOptions, IContinueCallback*,pcallback, LONG,nFirstPage, LONG*,pcPagesPrinted, LONG*,pnLastPage) + ICOM_METHOD8(HRESULT,Print, DWORD,grfFlags, DVTARGETDEVICE**,pptd, PAGESET**,ppPageSet, STGMEDIUM*,pstgmOptions, IContinueCallback*,pcallback, LONG,nFirstPage, LONG*,pcPagesPrinted, LONG*,pnLastPage) #define IPrint_IMETHODS \ IUnknown_IMETHODS \ IPrint_METHODS ICOM_DEFINE(IPrint,IUnknown) #undef ICOM_INTERFACE - + /*** IUnknown methods ***/ #define IPrint_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define IPrint_AddRef(p) ICOM_CALL (AddRef,p) @@ -357,8 +357,8 @@ ICOM_DEFINE(IPrint,IUnknown) #define IPrint_SetInitialPageNum(p,a) ICOM_CALL1(SetInitialPageNum,p,a) #define IPrint_GetPageInfo(p,a,b) ICOM_CALL2(GetPageInfo,p,a,b) #define IPrint_Print(p,a,b,c,d,e,f,g) ICOM_CALL7(Print,p,a,b,c,d,e,f,g) - - + + #define LPMSODOCUMENT LPOLEDOCUMENT #define LPMSODOCUMENTSITE LPOLEDOCUMENTSITE #define LPMSOVIEW LPOLEDOCUMENTVIEW @@ -369,6 +369,6 @@ ICOM_DEFINE(IPrint,IUnknown) #define IID_IMsoView IID_IOleDocumentView #define IID_IEnumMsoView IID_IEnumOleDocumentViews #define IID_IMsoCommandTarget IID_IOleCommandTarget - + #endif /* __WINE_DOCOBJ_H */ diff --git a/include/dplay.h b/include/dplay.h index 452408476ac..882aefcde1e 100644 --- a/include/dplay.h +++ b/include/dplay.h @@ -168,12 +168,12 @@ typedef DWORD DPID, *LPDPID; typedef struct tagDPCAPS { DWORD dwSize; /* Size of structure in bytes */ - DWORD dwFlags; - DWORD dwMaxBufferSize; + DWORD dwFlags; + DWORD dwMaxBufferSize; DWORD dwMaxQueueSize; /* Obsolete. */ DWORD dwMaxPlayers; /* Maximum players/groups (local + remote) */ DWORD dwHundredBaud; /* Bandwidth in 100 bits per second units; - * i.e. 24 is 2400, 96 is 9600, etc. + * i.e. 24 is 2400, 96 is 9600, etc. */ DWORD dwLatency; /* Estimated latency; 0 = unknown */ DWORD dwMaxLocalPlayers; /* Maximum # of locally created players */ @@ -186,19 +186,19 @@ typedef struct tagDPCAPS typedef struct tagDPNAME { - DWORD dwSize; + DWORD dwSize; DWORD dwFlags; /* Not used must be 0 */ union /*playerShortName */ /* Player's Handle? */ - { - LPWSTR lpszShortName; - LPSTR lpszShortNameA; + { + LPWSTR lpszShortName; + LPSTR lpszShortNameA; } DUMMYUNIONNAME1; union /*playerLongName */ /* Player's formal/real name */ - { - LPWSTR lpszLongName; - LPSTR lpszLongNameA; + { + LPWSTR lpszLongName; + LPSTR lpszLongNameA; } DUMMYUNIONNAME2; } DPNAME, *LPDPNAME; @@ -230,31 +230,31 @@ typedef struct tagDPSESSIONDESC typedef struct tagDPSESSIONDESC2 { - DWORD dwSize; - DWORD dwFlags; - GUID guidInstance; + DWORD dwSize; + DWORD dwFlags; + GUID guidInstance; GUID guidApplication; /* GUID of the DP application, GUID_NULL if * all applications! */ - - DWORD dwMaxPlayers; + + DWORD dwMaxPlayers; DWORD dwCurrentPlayers; /* (read only value) */ union /* Session name */ - { - LPWSTR lpszSessionName; - LPSTR lpszSessionNameA; + { + LPWSTR lpszSessionName; + LPSTR lpszSessionNameA; } DUMMYUNIONNAME1; union /* Optional password */ - { - LPWSTR lpszPassword; - LPSTR lpszPasswordA; + { + LPWSTR lpszPassword; + LPSTR lpszPasswordA; } DUMMYUNIONNAME2; - DWORD dwReserved1; + DWORD dwReserved1; DWORD dwReserved2; - DWORD dwUser1; /* For use by the application */ + DWORD dwUser1; /* For use by the application */ DWORD dwUser2; DWORD dwUser3; DWORD dwUser4; @@ -279,11 +279,11 @@ typedef const DPSESSIONDESC2* LPCDPSESSIONDESC2; typedef struct tagDPLCONNECTION { - DWORD dwSize; - DWORD dwFlags; - LPDPSESSIONDESC2 lpSessionDesc; /* Ptr to session desc to use for connect */ + DWORD dwSize; + DWORD dwFlags; + LPDPSESSIONDESC2 lpSessionDesc; /* Ptr to session desc to use for connect */ LPDPNAME lpPlayerName; /* Ptr to player name structure */ - GUID guidSP; /* GUID of Service Provider to use */ + GUID guidSP; /* GUID of Service Provider to use */ LPVOID lpAddress; /* Ptr to Address of Service Provider to use */ DWORD dwAddressSize; /* Size of address data */ } DPLCONNECTION, *LPDPLCONNECTION; @@ -366,7 +366,7 @@ typedef BOOL (CALLBACK *LPDPENUMDPCALLBACKA)( LPGUID lpguidSP, LPSTR lpSPName, /* ptr to str w/ driver description */ DWORD dwMajorVersion, /* Major # of driver spec in lpguidSP */ - DWORD dwMinorVersion, /* Minor # of driver spec in lpguidSP */ + DWORD dwMinorVersion, /* Minor # of driver spec in lpguidSP */ LPVOID lpContext); /* User given */ #ifndef __LPCGUID_DEFINED__ @@ -633,7 +633,7 @@ ICOM_DEFINE(IDirectPlay3,IDirectPlay2) #define IDirectPlay3_GetPlayerFlags(p,a,b) ICOM_CALL2(GetPlayerFlags,p,a,b) /***************************************************************************** - * IDirectPlay4 and IDirectPlay4A interface + * IDirectPlay4 and IDirectPlay4A interface */ #define ICOM_INTERFACE IDirectPlay4 #define IDirectPlay4_METHODS \ @@ -646,7 +646,7 @@ ICOM_DEFINE(IDirectPlay3,IDirectPlay2) #define IDirectPlay4_IMETHODS \ IDirectPlay3_IMETHODS \ - IDirectPlay4_METHODS + IDirectPlay4_METHODS ICOM_DEFINE(IDirectPlay4,IDirectPlay3) #undef ICOM_INTERFACE @@ -732,7 +732,7 @@ ICOM_DEFINE(IDirectPlay4,IDirectPlay3) #define DPENUMGROUPS_HIDDEN 0x00001000 -/* For DirectPlay::CreatePlayer */ +/* For DirectPlay::CreatePlayer */ #define DPPLAYER_SERVERPLAYER DPENUMPLAYERS_SERVERPLAYER #define DPPLAYER_SPECTATOR DPENUMPLAYERS_SPECTATOR #define DPPLAYER_LOCAL DPENUMPLAYERS_LOCAL @@ -780,8 +780,8 @@ ICOM_DEFINE(IDirectPlay4,IDirectPlay3) #define DPSEND_MAX_PRIORITY DPSEND_MAX_PRI -/* For DirectPlay::SetGroupData, DirectPlay::SetGroupName, - * DirectPlay::SetPlayerData, DirectPlay::SetPlayerName and +/* For DirectPlay::SetGroupData, DirectPlay::SetGroupName, + * DirectPlay::SetPlayerData, DirectPlay::SetPlayerName and * DirectPlay::SetSessionDesc. */ #define DPSET_REMOTE 0x00000000 @@ -846,7 +846,7 @@ ICOM_DEFINE(IDirectPlay4,IDirectPlay3) /* An async send is done (finished normally, failed or cancelled) */ #define DPSYS_SENDCOMPLETE 0x010d -/** DirectPlay System Messages **/ +/** DirectPlay System Messages **/ #define DPPLAYERTYPE_GROUP 0x00000000 #define DPPLAYERTYPE_PLAYER 0x00000001 @@ -856,7 +856,7 @@ ICOM_DEFINE(IDirectPlay4,IDirectPlay3) typedef struct tagDPMSG_GENERIC { DWORD dwType; /* Use message type as described above */ -} DPMSG_GENERIC, *LPDPMSG_GENERIC, +} DPMSG_GENERIC, *LPDPMSG_GENERIC, DPMSG_HOST, *LPDPMSG_HOST, DPMSG_SESSIONLOST, *LPDPMSG_SESSIONLOST; @@ -871,9 +871,9 @@ typedef struct tagDPMSG_CREATEPLAYERORGROUP DPNAME dpnName; /* Name info */ /* dpIdParent and dwFlags are only valid in DirectPlay3 and later. What - * does that mean about the message size before? -PH */ + * does that mean about the message size before? -PH */ DPID dpIdParent; /* id of parent group */ - DWORD dwFlags; /* Flags for the player/group */ + DWORD dwFlags; /* Flags for the player/group */ } DPMSG_CREATEPLAYERORGROUP, *LPDPMSG_CREATEPLAYERORGROUP; typedef struct tagDPMSG_DESTROYPLAYERORGROUP @@ -899,8 +899,8 @@ typedef struct tagDPMSG_ADDPLAYERTOGROUP DWORD dwType; /* Use message type as described above */ DPID dpIdGroup; /* Group ID to add player into */ DPID dpIdPlayer; /* ID of player to add */ -} DPMSG_ADDPLAYERTOGROUP, *LPDPMSG_ADDPLAYERTOGROUP, - DPMSG_DELETEPLAYERFROMGROUP, *LPDPMSG_DELETEPLAYERFROMGROUP; +} DPMSG_ADDPLAYERTOGROUP, *LPDPMSG_ADDPLAYERTOGROUP, + DPMSG_DELETEPLAYERFROMGROUP, *LPDPMSG_DELETEPLAYERFROMGROUP; /* NOTE: DPMSG_ADDGROUPTOGROUP and DPMSG_DELETEGROUPFROMGROUP are the same */ typedef struct tagDPMSG_ADDGROUPTOGROUP @@ -914,7 +914,7 @@ typedef struct tagDPMSG_ADDGROUPTOGROUP typedef struct tagDPMSG_SETPLAYERORGROUPDATA { DWORD dwType; /* Use message type as described above */ - DWORD dwPlayerType; /* Use DPPLAYERTYPE_GROUP or DPPLAYERTYPE_PLAYER */ + DWORD dwPlayerType; /* Use DPPLAYERTYPE_GROUP or DPPLAYERTYPE_PLAYER */ DPID dpId; /* ID of player/group */ LPVOID lpData; /* Pointer to data */ DWORD dwDataSize; /* Size of data */ @@ -971,14 +971,14 @@ typedef struct { DWORD dwType; /* Use message type as described above */ DPID idFrom; /* ID from */ - DPID idTo; /* ID to */ - DWORD dwFlags; + DPID idTo; /* ID to */ + DWORD dwFlags; DWORD dwPriority; DWORD dwTimeout; LPVOID lpvContext; DWORD dwMsgID; HRESULT hr; - DWORD dwSendTime; /* When sent ? */ + DWORD dwSendTime; /* When sent ? */ } DPMSG_SENDCOMPLETE, *LPDPMSG_SENDCOMPLETE; diff --git a/include/dplobby.h b/include/dplobby.h index 289220bab9e..470b2add585 100644 --- a/include/dplobby.h +++ b/include/dplobby.h @@ -54,7 +54,7 @@ typedef struct IDirectPlayLobby3 IDirectPlayLobby3A, *LPDIRECTPLAYLOBBY3A; * DirectPlayLobby Property GUIDs used in lobby messages */ -/* DPLPROPERTY_MessagesSupported {762CCDA1-D916-11d0-BA39-00C04FD7ED67}. +/* DPLPROPERTY_MessagesSupported {762CCDA1-D916-11d0-BA39-00C04FD7ED67}. * Purpose: Request if the lobby supports standard (?). * Response: Answer is a BOOL. TRUE if supports the standard (?) and FALSE otherwise. Of course, it might not respond at all. */ @@ -62,7 +62,7 @@ DEFINE_GUID(DPLPROPERTY_MessagesSupported, 0x762ccda1, 0xd916, 0x11d0, 0xba, 0x3 /* DPLPROPERTY_LobbyGuid {F56920A0-D218-11d0-BA39-00C04FD7ED67}. * Purpose: Request the GUID that identifies the lobby version that the application is communicating with. - * Response: The GUID which identifies the lobby version + * Response: The GUID which identifies the lobby version */ DEFINE_GUID(DPLPROPERTY_LobbyGuid, 0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); @@ -199,8 +199,8 @@ typedef struct tagDPLMSG_NEWSESSIONHOST * EnumAddresses function is used to parse the address data chunks. */ -/* DPAID_TotalSize {1318F560-912C-11d0-9DAA-00A0C90A43CB} - * Chunk purpose: Chunk is a DWORD containing the size of the entire DPADDRESS struct +/* DPAID_TotalSize {1318F560-912C-11d0-9DAA-00A0C90A43CB} + * Chunk purpose: Chunk is a DWORD containing the size of the entire DPADDRESS struct */ DEFINE_GUID(DPAID_TotalSize, 0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); @@ -216,7 +216,7 @@ DEFINE_GUID(DPAID_LobbyProvider, 0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x /* DPAID_Phone {78EC89A0-E0AF-11cf-9C4E-00A0C905425E} -- ANSI * DPAID_PhoneW {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E} -- UNICODE - * Chunk purpose: Chunk is a phone number in ANSI or UNICODE format + * Chunk purpose: Chunk is a phone number in ANSI or UNICODE format */ DEFINE_GUID(DPAID_Phone, 0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); DEFINE_GUID(DPAID_PhoneW, 0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); @@ -255,7 +255,7 @@ typedef struct tagDPADDRESS /* Used for specification of a communication port. Baud rate, stop bits and - * parity bits can be found in winbase.h. These are flow control constants only. + * parity bits can be found in winbase.h. These are flow control constants only. */ #define DPCPA_NOFLOW 0 /* no flow control */ #define DPCPA_XONXOFFFLOW 1 /* software flow control */ @@ -274,18 +274,18 @@ typedef struct tagDPCOMPORTADDRESS -/**************************************************************************** +/**************************************************************************** * Miscellaneous */ typedef struct tagDPLAPPINFO { - DWORD dwSize; - GUID guidApplication; + DWORD dwSize; + GUID guidApplication; - union + union { - LPSTR lpszAppNameA; + LPSTR lpszAppNameA; LPWSTR lpszAppName; } DUMMYUNIONNAME; diff --git a/include/dsdriver.h b/include/dsdriver.h index 8426ea60aaa..bee365f1860 100644 --- a/include/dsdriver.h +++ b/include/dsdriver.h @@ -201,7 +201,7 @@ ICOM_DEFINE(IDsDriverPropertySet,IUnknown) /* Defined property sets */ DEFINE_GUID(DSPROPSETID_DirectSound3DListener, 0x6D047B40, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); -typedef enum +typedef enum { DSPROPERTY_DIRECTSOUND3DLISTENER_ALL, DSPROPERTY_DIRECTSOUND3DLISTENER_POSITION, @@ -215,7 +215,7 @@ typedef enum } DSPROPERTY_DIRECTSOUND3DLISTENER; DEFINE_GUID(DSPROPSETID_DirectSound3DBuffer, 0x6D047B41, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); -typedef enum +typedef enum { DSPROPERTY_DIRECTSOUND3DBUFFER_ALL, DSPROPERTY_DIRECTSOUND3DBUFFER_POSITION, @@ -229,7 +229,7 @@ typedef enum } DSPROPERTY_DIRECTSOUND3DBUFFER; DEFINE_GUID(DSPROPSETID_DirectSoundSpeakerConfig, 0x6D047B42, 0x7AF9, 0x11D0, 0x92, 0x94, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); -typedef enum +typedef enum { DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG_SPEAKERCONFIG } DSPROPERTY_DIRECTSOUNDSPEAKERCONFIG; diff --git a/include/dsound.h b/include/dsound.h index 6e45b052908..dd32f94bac7 100644 --- a/include/dsound.h +++ b/include/dsound.h @@ -35,7 +35,7 @@ DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x DEFINE_GUID(IID_IDirectSound, 0x279AFA83,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60); typedef struct IDirectSound IDirectSound,*LPDIRECTSOUND; -DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60); +DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60); typedef struct IDirectSoundBuffer IDirectSoundBuffer,*LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER; DEFINE_GUID(IID_IDirectSoundNotify, 0xB0210783,0x89cd,0x11d0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16); @@ -44,7 +44,7 @@ typedef struct IDirectSoundNotify IDirectSoundNotify,*LPDIRECTSOUNDNOTIFY; DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60); typedef struct IDirectSound3DListener IDirectSound3DListener,*LPDIRECTSOUND3DLISTENER; -DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60); +DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60); typedef struct IDirectSound3DBuffer IDirectSound3DBuffer,*LPDIRECTSOUND3DBUFFER; DEFINE_GUID(IID_IDirectSoundCapture, 0xB0210781,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16); @@ -52,7 +52,7 @@ typedef struct IDirectSoundCapture IDirectSoundCapture,*LPDIRECTSOUNDCAPTURE; DEFINE_GUID(IID_IDirectSoundCaptureBuffer,0xB0210782,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16); typedef struct IDirectSoundCaptureBuffer IDirectSoundCaptureBuffer,*LPDIRECTSOUNDCAPTUREBUFFER; - + DEFINE_GUID(DSDEVID_WinePlayback, 0x40316A1D,0x605B,0xD611,0x87,0xC6,0x00,0x80,0xAD,0x00,0x02,0xFE); DEFINE_GUID(IID_IKsPropertySet, 0x31EFAC30,0x515C,0x11D0,0xA9,0xAA,0x00,0xAA,0x00,0x61,0xBE,0x93); @@ -233,7 +233,7 @@ typedef const DSCBCAPS *LPCDSCBCAPS; #ifndef __LPCGUID_DEFINED__ #define __LPCGUID_DEFINED__ typedef const GUID *LPCGUID; -#endif +#endif typedef LPVOID* LPLPVOID; @@ -353,8 +353,8 @@ ICOM_DEFINE(IDirectSoundCapture,IUnknown) #undef ICOM_INTERFACE #define IDirectSoundCapture_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectSoundCapture_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectSoundCapture_Release(p) ICOM_CALL (Release,p) +#define IDirectSoundCapture_AddRef(p) ICOM_CALL (AddRef,p) +#define IDirectSoundCapture_Release(p) ICOM_CALL (Release,p) #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) ICOM_CALL3(CreateCaptureBuffer,p,a,b,c) #define IDirectSoundCapture_GetCaps(p,a) ICOM_CALL (GetCaps,p,a) #define IDirectSoundCapture_Initialize(p,a) ICOM_CALL (Initialize,p,a) @@ -372,7 +372,7 @@ ICOM_DEFINE(IDirectSoundCapture,IUnknown) ICOM_METHOD7(HRESULT,Lock, DWORD,dwReadCusor, DWORD,dwReadBytes, LPVOID*,lplpvAudioPtr1, LPDWORD,lpdwAudioBytes1, LPVOID*,lplpvAudioPtr2, LPDWORD,lpdwAudioBytes2, DWORD,dwFlags) \ ICOM_METHOD1(HRESULT,Start, DWORD,dwFlags) \ ICOM_METHOD (HRESULT,Stop) \ - ICOM_METHOD4(HRESULT,Unlock, LPVOID,lpvAudioPtr1, DWORD,dwAudioBytes1, LPVOID,lpvAudioPtr2, DWORD,dwAudioBytes2) + ICOM_METHOD4(HRESULT,Unlock, LPVOID,lpvAudioPtr1, DWORD,dwAudioBytes1, LPVOID,lpvAudioPtr2, DWORD,dwAudioBytes2) #define IDirectSoundCaptureBuffer_IMETHODS \ IUnknown_IMETHODS \ @@ -381,14 +381,14 @@ ICOM_DEFINE(IDirectSoundCaptureBuffer,IUnknown) #undef ICOM_INTERFACE #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IDirectSoundCaptureBuffer_AddRef(p) ICOM_CALL (AddRef,p) -#define IDirectSoundCaptureBuffer_Release(p) ICOM_CALL (Release,p) +#define IDirectSoundCaptureBuffer_AddRef(p) ICOM_CALL (AddRef,p) +#define IDirectSoundCaptureBuffer_Release(p) ICOM_CALL (Release,p) #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) ICOM_CALL2(GetCurrentPosition,p,a,b) -#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) ICOM_CALL3(GetFormat,p,a,b,c) -#define IDirectSoundCaptureBuffer_GetStatus(p,a) ICOM_CALL1(GetStatus,p,a) -#define IDirectSoundCaptureBuffer_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) +#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) ICOM_CALL3(GetFormat,p,a,b,c) +#define IDirectSoundCaptureBuffer_GetStatus(p,a) ICOM_CALL1(GetStatus,p,a) +#define IDirectSoundCaptureBuffer_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b) #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) ICOM_CALL7(Lock,p,a,b,c,d,e,f,g) -#define IDirectSoundCaptureBuffer_Start(p,a) ICOM_CALL1(Start,p,a) +#define IDirectSoundCaptureBuffer_Start(p,a) ICOM_CALL1(Start,p,a) #define IDirectSoundCaptureBuffer_Stop(p) ICOM_CALL (Stop,p) #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) ICOM_CALL4(Unlock,p,a,b,c,d) @@ -459,7 +459,7 @@ typedef struct _DS3DLISTENER { } DS3DLISTENER, *LPDS3DLISTENER; typedef const DS3DLISTENER *LPCDS3DLISTENER; - + #define ICOM_INTERFACE IDirectSound3DListener #define IDirectSound3DListener_METHODS \ ICOM_METHOD1(HRESULT,GetAllParameters, LPDS3DLISTENER,lpListener) \ diff --git a/include/file.h b/include/file.h index 09e1f59b9c7..25549cc1b42 100644 --- a/include/file.h +++ b/include/file.h @@ -117,8 +117,8 @@ extern int PROFILE_GetWineIniBool( char const *section, char const *key_name, in extern HANDLE DEVICE_Open( LPCSTR filename, DWORD access, LPSECURITY_ATTRIBUTES sa ); /* ntdll/cdrom.c.c */ -extern BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode, - LPVOID lpInBuffer, DWORD nInBufferSize, +extern BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode, + LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); diff --git a/include/gdi.h b/include/gdi.h index 9fd05503cd0..69af1af7827 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -273,7 +273,7 @@ typedef struct tagDC_FUNCS #define DC_MEMORY 0x0001 /* It is a memory DC */ #define DC_SAVED 0x0002 /* It is a saved DC */ #define DC_DIRTY 0x0004 /* hVisRgn has to be updated */ -#define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */ +#define DC_THUNKHOOK 0x0008 /* DC hook is in the 16-bit code */ #define GDI_HEAP_SIZE 0xffe0 @@ -303,7 +303,7 @@ static inline INT WINE_UNUSED GDI_ROUND(FLOAT val) static inline BOOL WINE_UNUSED INTERNAL_DPTOLP_FLOAT(DC *dc, FLOAT_POINT *point) { FLOAT x, y; - + /* Check that the viewport-to-world transformation is valid */ if (!dc->vport2WorldValid) return FALSE; @@ -327,13 +327,13 @@ static inline BOOL WINE_UNUSED INTERNAL_DPTOLP_FLOAT(DC *dc, FLOAT_POINT *point) static inline BOOL WINE_UNUSED INTERNAL_DPTOLP(DC *dc, LPPOINT point) { FLOAT_POINT floatPoint; - + /* Perform operation with floating point */ floatPoint.x=(FLOAT)point->x; floatPoint.y=(FLOAT)point->y; if (!INTERNAL_DPTOLP_FLOAT(dc, &floatPoint)) return FALSE; - + /* Round to integers */ point->x = GDI_ROUND(floatPoint.x); point->y = GDI_ROUND(floatPoint.y); @@ -347,7 +347,7 @@ static inline BOOL WINE_UNUSED INTERNAL_DPTOLP(DC *dc, LPPOINT point) static inline void WINE_UNUSED INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point) { FLOAT x, y; - + /* Perform the transformation */ x = point->x; y = point->y; @@ -365,12 +365,12 @@ static inline void WINE_UNUSED INTERNAL_LPTODP_FLOAT(DC *dc, FLOAT_POINT *point) static inline void WINE_UNUSED INTERNAL_LPTODP(DC *dc, LPPOINT point) { FLOAT_POINT floatPoint; - + /* Perform operation with floating point */ floatPoint.x=(FLOAT)point->x; floatPoint.y=(FLOAT)point->y; INTERNAL_LPTODP_FLOAT(dc, &floatPoint); - + /* Round to integers */ point->x = GDI_ROUND(floatPoint.x); point->y = GDI_ROUND(floatPoint.y); diff --git a/include/guiddef.h b/include/guiddef.h index 310cf61feb6..a9dbc4056cd 100644 --- a/include/guiddef.h +++ b/include/guiddef.h @@ -79,11 +79,11 @@ inline bool operator!=(const GUID& guidOne, const GUID& guidOther) { return !(guidOne == guidOther); } -#endif +#endif extern const IID GUID_NULL; #define IID_NULL GUID_NULL #define CLSID_NULL GUID_NULL #define FMTID_NULL GUID_NULL - + #endif /* _GUIDDEF_H_ */ diff --git a/include/imagehlp.h b/include/imagehlp.h index 05741716767..d0cad79a413 100644 --- a/include/imagehlp.h +++ b/include/imagehlp.h @@ -32,7 +32,7 @@ extern "C" { * Types */ -typedef PVOID DIGEST_HANDLE; +typedef PVOID DIGEST_HANDLE; /*********************************************************************** * Enums/Defines @@ -161,7 +161,7 @@ typedef struct _LOADED_IMAGE { typedef struct _WIN_CERTIFICATE { DWORD dwLength; - WORD wRevision; /* WIN_CERT_REVISON_xxx */ + WORD wRevision; /* WIN_CERT_REVISON_xxx */ WORD wCertificateType; /* WIN_CERT_TYPE_xxx */ BYTE bCertificate[ANYSIZE_ARRAY]; } WIN_CERTIFICATE, *PWIN_CERTIFICATE; @@ -182,7 +182,7 @@ typedef struct _IMAGE_DEBUG_INFORMATION { DWORD CheckSum; DWORD ImageBase; DWORD SizeOfImage; - + DWORD NumberOfSections; PIMAGE_SECTION_HEADER Sections; @@ -305,12 +305,12 @@ typedef BOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)( ); typedef BOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)( - LPSTR SymbolName, ULONG SymbolAddress, ULONG SymbolSize, + LPSTR SymbolName, ULONG SymbolAddress, ULONG SymbolSize, PVOID UserContext ); typedef BOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)( - LPSTR ModuleName, ULONG ModuleBase, ULONG ModuleSize, + LPSTR ModuleName, ULONG ModuleBase, ULONG ModuleSize, PVOID UserContext ); @@ -351,7 +351,7 @@ BOOL WINAPI BindImageEx( PIMAGEHLP_STATUS_ROUTINE StatusRoutine ); PIMAGE_NT_HEADERS WINAPI CheckSumMappedFile( - LPVOID BaseAddress, DWORD FileLength, + LPVOID BaseAddress, DWORD FileLength, LPDWORD HeaderSum, LPDWORD CheckSum ); BOOL WINAPI EnumerateLoadedModules( @@ -366,7 +366,7 @@ HANDLE WINAPI FindExecutableImage( LPSTR FileName, LPSTR SymbolPath, LPSTR ImageFilePath ); BOOL WINAPI GetImageConfigInformation( - PLOADED_IMAGE LoadedImage, + PLOADED_IMAGE LoadedImage, PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigInformation ); DWORD WINAPI GetImageUnusedHeaderBytes( @@ -418,7 +418,7 @@ BOOL WINAPI ImageUnload( PLOADED_IMAGE LoadedImage ); PAPI_VERSION WINAPI ImagehlpApiVersion( - void + void ); PAPI_VERSION WINAPI ImagehlpApiVersionEx( PAPI_VERSION AppVersion @@ -460,7 +460,7 @@ BOOL WINAPI SetImageConfigInformation( PIMAGE_LOAD_CONFIG_DIRECTORY ImageConfigInformation ); BOOL WINAPI SplitSymbols( - LPSTR ImageName, LPSTR SymbolsPath, + LPSTR ImageName, LPSTR SymbolsPath, LPSTR SymbolFilePath, DWORD Flags ); BOOL WINAPI StackWalk( diff --git a/include/initguid.h b/include/initguid.h index 53993eb426b..976dd786869 100644 --- a/include/initguid.h +++ b/include/initguid.h @@ -1,5 +1,5 @@ /* - * Defines a minimum set of macros create GUID's to keep the size + * Defines a minimum set of macros create GUID's to keep the size * small * * This file should be included into "only GUID definition *.h" like diff --git a/include/instance.h b/include/instance.h index 93d4f08ecdb..5afe987c460 100644 --- a/include/instance.h +++ b/include/instance.h @@ -30,7 +30,7 @@ typedef struct WORD null; /* Always 0 */ DWORD old_ss_sp WINE_PACKED; /* Stack pointer; used by SwitchTaskTo() */ WORD heap; /* Pointer to the local heap information (if any) */ - WORD atomtable; /* Pointer to the local atom table (if any) */ + WORD atomtable; /* Pointer to the local atom table (if any) */ WORD stacktop; /* Top of the stack */ WORD stackmin; /* Lowest stack address used so far */ WORD stackbottom; /* Bottom of the stack */ diff --git a/include/miscemu.h b/include/miscemu.h index fd10e63c814..14f9e723b7c 100644 --- a/include/miscemu.h +++ b/include/miscemu.h @@ -146,7 +146,7 @@ typedef struct #include "poppack.h" -/* Index for bios structures stored at f000:e000 */ +/* Index for bios structures stored at f000:e000 */ enum {OFF_VIDEOSTATE,OFF_VIDEOFUNCTIONALITY,OFF_VESAINFO,OFF_VESASTRING,OFF_VESAMODELIST}; extern WORD DOSMEM_AddBiosSysStruct(int,int); @@ -242,8 +242,8 @@ extern char IO_pp_init(void); #define PTR_REAL_TO_LIN(seg,off) \ ((void*)(((unsigned int)(seg) << 4) + LOWORD(off))) -/* NOTE: Interrupts might get called from three modes: real mode, 16-bit, and - * (via DeviceIoControl) 32-bit. For automatic conversion of pointer +/* NOTE: Interrupts might get called from three modes: real mode, 16-bit, and + * (via DeviceIoControl) 32-bit. For automatic conversion of pointer * parameters, interrupt handlers should use CTX_SEG_OFF_TO_LIN with * the contents of a segment register as second and the contents of * a *32-bit* general register as third parameter, e.g. diff --git a/include/mmddk.h b/include/mmddk.h index 2b98e638e71..f3f917a9763 100644 --- a/include/mmddk.h +++ b/include/mmddk.h @@ -23,7 +23,7 @@ * ***************************************************************************** */ -#ifndef __MMDDK_H +#ifndef __MMDDK_H #define __MMDDK_H #include "mmsystem.h" @@ -38,7 +38,7 @@ */ #define MAX_MIDIOUTDRV (16) -/* ================================== +/* ================================== * Multimedia DDK compatible part * ================================== */ @@ -94,7 +94,7 @@ typedef struct { #define WODM_WRITE 9 #define WODM_PAUSE 10 #define WODM_RESTART 11 -#define WODM_RESET 12 +#define WODM_RESET 12 #define WODM_GETPOS 13 #define WODM_GETPITCH 14 #define WODM_SETPITCH 15 @@ -139,8 +139,8 @@ typedef struct { #define MODM_RESET 9 #define MODM_GETVOLUME 10 #define MODM_SETVOLUME 11 -#define MODM_CACHEPATCHES 12 -#define MODM_CACHEDRUMPATCHES 13 +#define MODM_CACHEPATCHES 12 +#define MODM_CACHEDRUMPATCHES 13 #define MIDM_INIT DRVM_INIT #define MIDM_GETNUMDEVS 53 @@ -513,9 +513,9 @@ BOOL16 WINAPI mmThreadIsCurrent16(HANDLE16 hndl); #define DCB_TYPEMASK 0x0007 #define DCB_NOSWITCH 0x0008 /* don't switch stacks for callback */ -BOOL16 WINAPI DriverCallback16(DWORD dwCallBack, UINT16 uFlags, HANDLE16 hDev, +BOOL16 WINAPI DriverCallback16(DWORD dwCallBack, UINT16 uFlags, HANDLE16 hDev, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2); -BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev, +BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2); #include "poppack.h" diff --git a/include/mmreg.h b/include/mmreg.h index b8991694512..7c5c7a5a2b9 100644 --- a/include/mmreg.h +++ b/include/mmreg.h @@ -59,7 +59,7 @@ typedef struct WAVEFILTER_ECHO { DWORD dwDelay; } ECHOWAVEFILTER, *PECHOWAVEFILTER, *NPECHOWAVEFILTER, *LPECHOWAVEFILTER; #endif /* WAVEFILTER_ECHO */ - + #ifndef _WAVEFORMATEX_ #define _WAVEFORMATEX_ typedef struct _WAVEFORMATEX { @@ -122,7 +122,7 @@ typedef struct adpcmcoef_tag { short iCoef1; short iCoef2; } ADPCMCOEFSET; -typedef ADPCMCOEFSET *PADPCMCOEFSET, +typedef ADPCMCOEFSET *PADPCMCOEFSET, *NPADPCMCOEFSET, *LPADPCMCOEFSET; typedef struct adpcmwaveformat_tag { @@ -132,35 +132,35 @@ typedef struct adpcmwaveformat_tag { /* FIXME: this should be aCoef[0] */ ADPCMCOEFSET aCoef[1]; } ADPCMWAVEFORMAT; -typedef ADPCMWAVEFORMAT *PADPCMWAVEFORMAT, +typedef ADPCMWAVEFORMAT *PADPCMWAVEFORMAT, *NPADPCMWAVEFORMAT, *LPADPCMWAVEFORMAT; typedef struct dvi_adpcmwaveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } DVIADPCMWAVEFORMAT; -typedef DVIADPCMWAVEFORMAT *PDVIADPCMWAVEFORMAT, +typedef DVIADPCMWAVEFORMAT *PDVIADPCMWAVEFORMAT, *NPDVIADPCMWAVEFORMAT, *LPDVIADPCMWAVEFORMAT; typedef struct ima_adpcmwaveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } IMAADPCMWAVEFORMAT; -typedef IMAADPCMWAVEFORMAT *PIMAADPCMWAVEFORMAT, *NPIMAADPCMWAVEFORMAT, +typedef IMAADPCMWAVEFORMAT *PIMAADPCMWAVEFORMAT, *NPIMAADPCMWAVEFORMAT, *LPIMAADPCMWAVEFORMAT; typedef struct mediaspace_adpcmwaveformat_tag { WAVEFORMATEX wfx; WORD wRevision; } MEDIASPACEADPCMWAVEFORMAT; -typedef MEDIASPACEADPCMWAVEFORMAT *PMEDIASPACEADPCMWAVEFORMAT, +typedef MEDIASPACEADPCMWAVEFORMAT *PMEDIASPACEADPCMWAVEFORMAT, *NPMEDIASPACEADPCMWAVEFORMAT, *LPMEDIASPACEADPCMWAVEFORMAT; typedef struct sierra_adpcmwaveformat_tag { WAVEFORMATEX wfx; WORD wRevision; } SIERRAADPCMWAVEFORMAT; -typedef SIERRAADPCMWAVEFORMAT *PSIERRAADPCMWAVEFORMAT, +typedef SIERRAADPCMWAVEFORMAT *PSIERRAADPCMWAVEFORMAT, *NPSIERRAADPCMWAVEFORMAT, *LPSIERRAADPCMWAVEFORMAT; typedef struct g723_adpcmwaveformat_tag { @@ -168,7 +168,7 @@ typedef struct g723_adpcmwaveformat_tag { WORD cbExtraSize; WORD nAuxBlockSize; } G723_ADPCMWAVEFORMAT; -typedef G723_ADPCMWAVEFORMAT *PG723_ADPCMWAVEFORMAT, +typedef G723_ADPCMWAVEFORMAT *PG723_ADPCMWAVEFORMAT, *NPG723_ADPCMWAVEFORMAT, *LPG723_ADPCMWAVEFORMAT; typedef struct digistdwaveformat_tag { @@ -199,7 +199,7 @@ typedef struct sonarcwaveformat_tag { WAVEFORMATEX wfx; WORD wCompType; } SONARCWAVEFORMAT; -typedef SONARCWAVEFORMAT *PSONARCWAVEFORMAT, +typedef SONARCWAVEFORMAT *PSONARCWAVEFORMAT, *NPSONARCWAVEFORMAT,*LPSONARCWAVEFORMAT; typedef struct truespeechwaveformat_tag { @@ -208,31 +208,31 @@ typedef struct truespeechwaveformat_tag { WORD nSamplesPerBlock; BYTE abReserved[28]; } TRUESPEECHWAVEFORMAT; -typedef TRUESPEECHWAVEFORMAT *PTRUESPEECHWAVEFORMAT, +typedef TRUESPEECHWAVEFORMAT *PTRUESPEECHWAVEFORMAT, *NPTRUESPEECHWAVEFORMAT, *LPTRUESPEECHWAVEFORMAT; typedef struct echosc1waveformat_tag { WAVEFORMATEX wfx; } ECHOSC1WAVEFORMAT; -typedef ECHOSC1WAVEFORMAT *PECHOSC1WAVEFORMAT, +typedef ECHOSC1WAVEFORMAT *PECHOSC1WAVEFORMAT, *NPECHOSC1WAVEFORMAT, *LPECHOSC1WAVEFORMAT; typedef struct audiofile_af36waveformat_tag { WAVEFORMATEX wfx; } AUDIOFILE_AF36WAVEFORMAT; -typedef AUDIOFILE_AF36WAVEFORMAT *PAUDIOFILE_AF36WAVEFORMAT, +typedef AUDIOFILE_AF36WAVEFORMAT *PAUDIOFILE_AF36WAVEFORMAT, *NPAUDIOFILE_AF36WAVEFORMAT, *LPAUDIOFILE_AF36WAVEFORMAT; typedef struct aptxwaveformat_tag { WAVEFORMATEX wfx; } APTXWAVEFORMAT; -typedef APTXWAVEFORMAT *PAPTXWAVEFORMAT, +typedef APTXWAVEFORMAT *PAPTXWAVEFORMAT, *NPAPTXWAVEFORMAT, *LPAPTXWAVEFORMAT; typedef struct audiofile_af10waveformat_tag { WAVEFORMATEX wfx; } AUDIOFILE_AF10WAVEFORMAT; -typedef AUDIOFILE_AF10WAVEFORMAT *PAUDIOFILE_AF10WAVEFORMAT, +typedef AUDIOFILE_AF10WAVEFORMAT *PAUDIOFILE_AF10WAVEFORMAT, *NPAUDIOFILE_AF10WAVEFORMAT, *LPAUDIOFILE_AF10WAVEFORMAT; typedef struct dolbyac2waveformat_tag { @@ -244,49 +244,49 @@ typedef struct gsm610waveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } GSM610WAVEFORMAT; -typedef GSM610WAVEFORMAT *PGSM610WAVEFORMAT, +typedef GSM610WAVEFORMAT *PGSM610WAVEFORMAT, *NPGSM610WAVEFORMAT, *LPGSM610WAVEFORMAT; typedef struct adpcmewaveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } ADPCMEWAVEFORMAT; -typedef ADPCMEWAVEFORMAT *PADPCMEWAVEFORMAT, +typedef ADPCMEWAVEFORMAT *PADPCMEWAVEFORMAT, *NPADPCMEWAVEFORMAT, *LPADPCMEWAVEFORMAT; typedef struct contres_vqlpcwaveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } CONTRESVQLPCWAVEFORMAT; -typedef CONTRESVQLPCWAVEFORMAT *PCONTRESVQLPCWAVEFORMAT, +typedef CONTRESVQLPCWAVEFORMAT *PCONTRESVQLPCWAVEFORMAT, *NPCONTRESVQLPCWAVEFORMAT, *LPCONTRESVQLPCWAVEFORMAT; typedef struct digirealwaveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } DIGIREALWAVEFORMAT; -typedef DIGIREALWAVEFORMAT *PDIGIREALWAVEFORMAT, +typedef DIGIREALWAVEFORMAT *PDIGIREALWAVEFORMAT, *NPDIGIREALWAVEFORMAT, *LPDIGIREALWAVEFORMAT; typedef struct digiadpcmmwaveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } DIGIADPCMWAVEFORMAT; -typedef DIGIADPCMWAVEFORMAT *PDIGIADPCMWAVEFORMAT, +typedef DIGIADPCMWAVEFORMAT *PDIGIADPCMWAVEFORMAT, *NPDIGIADPCMWAVEFORMAT, *LPDIGIADPCMWAVEFORMAT; typedef struct contres_cr10waveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } CONTRESCR10WAVEFORMAT; -typedef CONTRESCR10WAVEFORMAT *PCONTRESCR10WAVEFORMAT, +typedef CONTRESCR10WAVEFORMAT *PCONTRESCR10WAVEFORMAT, *NPCONTRESCR10WAVEFORMAT, *LPCONTRESCR10WAVEFORMAT; typedef struct nms_vbxadpcmmwaveformat_tag { WAVEFORMATEX wfx; WORD wSamplesPerBlock; } NMS_VBXADPCMWAVEFORMAT; -typedef NMS_VBXADPCMWAVEFORMAT *PNMS_VBXADPCMWAVEFORMAT, +typedef NMS_VBXADPCMWAVEFORMAT *PNMS_VBXADPCMWAVEFORMAT, *NPNMS_VBXADPCMWAVEFORMAT, *LPNMS_VBXADPCMWAVEFORMAT; typedef struct g721_adpcmwaveformat_tag { @@ -300,21 +300,21 @@ typedef struct creative_adpcmwaveformat_tag { WAVEFORMATEX wfx; WORD wRevision; } CREATIVEADPCMWAVEFORMAT; -typedef CREATIVEADPCMWAVEFORMAT *PCREATIVEADPCMWAVEFORMAT, +typedef CREATIVEADPCMWAVEFORMAT *PCREATIVEADPCMWAVEFORMAT, *NPCREATIVEADPCMWAVEFORMAT, *LPCREATIVEADPCMWAVEFORMAT; typedef struct creative_fastspeech8format_tag { WAVEFORMATEX wfx; WORD wRevision; } CREATIVEFASTSPEECH8WAVEFORMAT; -typedef CREATIVEFASTSPEECH8WAVEFORMAT *PCREATIVEFASTSPEECH8WAVEFORMAT, +typedef CREATIVEFASTSPEECH8WAVEFORMAT *PCREATIVEFASTSPEECH8WAVEFORMAT, *NPCREATIVEFASTSPEECH8WAVEFORMAT, *LPCREATIVEFASTSPEECH8WAVEFORMAT; typedef struct creative_fastspeech10format_tag { WAVEFORMATEX wfx; WORD wRevision; } CREATIVEFASTSPEECH10WAVEFORMAT; -typedef CREATIVEFASTSPEECH10WAVEFORMAT *PCREATIVEFASTSPEECH10WAVEFORMAT, +typedef CREATIVEFASTSPEECH10WAVEFORMAT *PCREATIVEFASTSPEECH10WAVEFORMAT, *NPCREATIVEFASTSPEECH10WAVEFORMAT, *LPCREATIVEFASTSPEECH10WAVEFORMAT; typedef struct fmtowns_snd_waveformat_tag { @@ -327,37 +327,37 @@ typedef FMTOWNS_SND_WAVEFORMAT *PFMTOWNS_SND_WAVEFORMAT, typedef struct oligsmwaveformat_tag { WAVEFORMATEX wfx; } OLIGSMWAVEFORMAT; -typedef OLIGSMWAVEFORMAT *POLIGSMWAVEFORMAT, +typedef OLIGSMWAVEFORMAT *POLIGSMWAVEFORMAT, *NPOLIGSMWAVEFORMAT, *LPOLIGSMWAVEFORMAT; typedef struct oliadpcmwaveformat_tag { WAVEFORMATEX wfx; } OLIADPCMWAVEFORMAT; -typedef OLIADPCMWAVEFORMAT *POLIADPCMWAVEFORMAT, +typedef OLIADPCMWAVEFORMAT *POLIADPCMWAVEFORMAT, *NPOLIADPCMWAVEFORMAT, *LPOLIADPCMWAVEFORMAT; typedef struct olicelpwaveformat_tag { WAVEFORMATEX wfx; } OLICELPWAVEFORMAT; -typedef OLICELPWAVEFORMAT *POLICELPWAVEFORMAT, +typedef OLICELPWAVEFORMAT *POLICELPWAVEFORMAT, *NPOLICELPWAVEFORMAT, *LPOLICELPWAVEFORMAT; typedef struct olisbcwaveformat_tag { WAVEFORMATEX wfx; } OLISBCWAVEFORMAT; -typedef OLISBCWAVEFORMAT *POLISBCWAVEFORMAT, +typedef OLISBCWAVEFORMAT *POLISBCWAVEFORMAT, *NPOLISBCWAVEFORMAT, *LPOLISBCWAVEFORMAT; typedef struct olioprwaveformat_tag { WAVEFORMATEX wfx; } OLIOPRWAVEFORMAT; -typedef OLIOPRWAVEFORMAT *POLIOPRWAVEFORMAT, +typedef OLIOPRWAVEFORMAT *POLIOPRWAVEFORMAT, *NPOLIOPRWAVEFORMAT, *LPOLIOPRWAVEFORMAT; typedef struct csimaadpcmwaveformat_tag { WAVEFORMATEX wfx; } CSIMAADPCMWAVEFORMAT; -typedef CSIMAADPCMWAVEFORMAT *PCSIMAADPCMWAVEFORMAT, +typedef CSIMAADPCMWAVEFORMAT *PCSIMAADPCMWAVEFORMAT, *NPCSIMAADPCMWAVEFORMAT, *LPCSIMAADPCMWAVEFORMAT; typedef struct diff --git a/include/mmsystem.h b/include/mmsystem.h index 64809274685..e84a142f096 100644 --- a/include/mmsystem.h +++ b/include/mmsystem.h @@ -25,7 +25,7 @@ #ifdef __cplusplus extern "C" { -#endif +#endif typedef LPSTR HPSTR; /* a huge version of LPSTR */ typedef LPCSTR HPCSTR; /* a huge version of LPCSTR */ @@ -43,7 +43,7 @@ DECLARE_OLD_HANDLE(HMIXEROBJ); DECLARE_OLD_HANDLE(HMMIO); #include "pshpack1.h" - + typedef LRESULT (CALLBACK *DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM); #define MAXWAVEDRIVERS 10 @@ -51,11 +51,11 @@ typedef LRESULT (CALLBACK *DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM); #define MAXAUXDRIVERS 10 #define MAXMCIDRIVERS 32 #define MAXMIXERDRIVERS 10 - + #define MAXPNAMELEN 32 /* max product name length (including NULL) */ #define MAXERRORLENGTH 128 /* max error text length (including NULL) */ #define MAX_JOYSTICKOEMVXDNAME 260 - + typedef WORD VERSION; /* major (high byte), minor (low byte) */ #ifndef _MCIERROR_ @@ -250,7 +250,7 @@ typedef void (CALLBACK *LPDRVCALLBACK) (HDRVR h, UINT uMessage, DWORD dwUser, DW UINT WINAPI mmsystemGetVersion(void); BOOL WINAPI sndPlaySoundA(LPCSTR lpszSound, UINT fuSound); BOOL WINAPI sndPlaySoundW(LPCWSTR lpszSound, UINT fuSound); -#define sndPlaySound WINELIB_NAME_AW(sndPlaySound) +#define sndPlaySound WINELIB_NAME_AW(sndPlaySound) BOOL WINAPI PlaySoundA(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound); BOOL WINAPI PlaySoundW(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound); #define PlaySound WINELIB_NAME_AW(PlaySound) @@ -493,8 +493,8 @@ typedef WORD *LPKEYARRAY; /* Only on Win95 and up */ #define MIDI_IO_STATUS 0x00000020L -/* flags for wFlags parm of - midiOutCachePatches(), +/* flags for wFlags parm of + midiOutCachePatches(), midiOutCacheDrumPatches() */ #define MIDI_CACHE_ALL 1 #define MIDI_CACHE_BESTFIT 2 @@ -569,7 +569,7 @@ typedef struct midihdr_tag { DWORD dwFlags; /* assorted flags (see defines) */ struct midihdr_tag *lpNext; /* reserved for driver */ DWORD reserved; /* reserved for driver */ - DWORD dwOffset; /* offset of playback in case of + DWORD dwOffset; /* offset of playback in case of * MIDISTRM buffer */ DWORD_PTR dwReserved[8]; /* reserved for driver */ } MIDIHDR, *LPMIDIHDR; @@ -594,14 +594,14 @@ typedef struct { #define MIDIPROP_TEMPO 0x00000002 #define MIDIPROP_TIMEDIV 0x00000001 -typedef struct { - DWORD dwDeltaTime; /* Time, in MIDI ticks, between the previous +typedef struct { + DWORD dwDeltaTime; /* Time, in MIDI ticks, between the previous * event and the current event. */ - DWORD dwStreamID; /* Reserved; must be zero. */ + DWORD dwStreamID; /* Reserved; must be zero. */ DWORD dwEvent; /* event => see MEVT_XXX macros */ DWORD dwParms[1]; /* extra pmts to dwEvent if F_LONG is set */ } MIDIEVENT, *LPMIDIEVENT; - + #define MEVT_EVENTTYPE(x) ((BYTE) (((x)>>24)&0xFF)) #define MEVT_EVENTPARM(x) ((DWORD) ((x)&0x00FFFFFFL)) @@ -655,7 +655,7 @@ UINT WINAPI midiInGetID(HMIDIIN,UINT*); DWORD WINAPI midiInMessage(HMIDIIN,UINT,DWORD,DWORD); MMRESULT WINAPI midiStreamClose(HMIDISTRM hms); MMRESULT WINAPI midiStreamOpen(HMIDISTRM* phms, LPUINT uDeviceID, DWORD cMidi, - DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen); + DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen); MMRESULT WINAPI midiStreamOut(HMIDISTRM hms, LPMIDIHDR lpMidiHdr, UINT cbMidiHdr); MMRESULT WINAPI midiStreamPause(HMIDISTRM hms); MMRESULT WINAPI midiStreamPosition(HMIDISTRM hms, LPMMTIME lpmmt, UINT cbmmt); @@ -2207,6 +2207,6 @@ DECL_WINELIB_TYPE_AW(LPMCI_OVLY_LOAD_PARMS) #ifdef __cplusplus } -#endif +#endif #endif /* __WINE_MMSYSTEM_H */ diff --git a/include/module.h b/include/module.h index 1e0146abfd6..44e2df9a29e 100644 --- a/include/module.h +++ b/include/module.h @@ -106,7 +106,7 @@ typedef struct FARPROC16 BootApp; /* startup procedure */ FARPROC16 LoadAppSeg; /* procedure to load a segment */ FARPROC16 reserved2; - FARPROC16 MyAlloc; /* memory allocation procedure, + FARPROC16 MyAlloc; /* memory allocation procedure, * wine must write this field */ FARPROC16 EntryAddrProc; FARPROC16 ExitProc; /* exit procedure */ @@ -114,7 +114,7 @@ typedef struct FARPROC16 SetOwner; /* Set Owner procedure, exported by wine */ } SELFLOADHEADER; -typedef struct +typedef struct { LPSTR lpEnvAddress; LPSTR lpCmdLine; diff --git a/include/msacm.h b/include/msacm.h index d0ea9e7f68f..2eeeec819c6 100644 --- a/include/msacm.h +++ b/include/msacm.h @@ -318,7 +318,7 @@ typedef struct _ACMFILTERCHOOSEA DWORD fdwEnum; PWAVEFILTER pwfltrEnum; - + HINSTANCE hInstance; LPCSTR pszTemplateName; LPARAM lCustData; @@ -344,7 +344,7 @@ typedef struct _ACMFILTERCHOOSEW DWORD fdwEnum; PWAVEFILTER pwfltrEnum; - + HINSTANCE hInstance; LPCWSTR pszTemplateName; LPARAM lCustData; @@ -411,22 +411,22 @@ typedef struct _ACMFORMATCHOOSEA { DWORD cbStruct; DWORD fdwStyle; - + HWND hwndOwner; PWAVEFORMATEX pwfx; DWORD cbwfx; LPCSTR pszTitle; - + CHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]; - CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; + CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; LPSTR pszName; DWORD cchName; DWORD fdwEnum; PWAVEFORMATEX pwfxEnum; - + HINSTANCE hInstance; LPCSTR pszTemplateName; LPARAM lCustData; @@ -437,22 +437,22 @@ typedef struct _ACMFORMATCHOOSEW { DWORD cbStruct; DWORD fdwStyle; - + HWND hwndOwner; PWAVEFORMATEX pwfx; DWORD cbwfx; LPCWSTR pszTitle; - + WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]; - WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; + WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]; LPWSTR pszName; DWORD cchName; DWORD fdwEnum; LPWAVEFORMATEX pwfxEnum; - + HINSTANCE hInstance; LPCWSTR pszTemplateName; LPARAM lCustData; @@ -643,11 +643,11 @@ MMRESULT WINAPI acmFilterDetailsW( #define acmFilterDetails WINELIB_NAME_AW(acmFilterDetails) MMRESULT WINAPI acmFilterEnumA( - HACMDRIVER had, PACMFILTERDETAILSA pafd, + HACMDRIVER had, PACMFILTERDETAILSA pafd, ACMFILTERENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum ); MMRESULT WINAPI acmFilterEnumW( - HACMDRIVER had, PACMFILTERDETAILSW pafd, + HACMDRIVER had, PACMFILTERDETAILSW pafd, ACMFILTERENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum ); #define acmFilterEnum WINELIB_NAME_AW(acmFilterEnum) @@ -744,7 +744,7 @@ MMRESULT WINAPI acmStreamReset( HACMSTREAM has, DWORD fdwReset ); MMRESULT WINAPI acmStreamSize( - HACMSTREAM has, DWORD cbInput, + HACMSTREAM has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize ); MMRESULT WINAPI acmStreamUnprepareHeader( diff --git a/include/msdos.h b/include/msdos.h index fca4c06196b..8b50f67d57e 100644 --- a/include/msdos.h +++ b/include/msdos.h @@ -126,7 +126,7 @@ typedef struct _DOS_LISTOFLISTS #define setword(a,b) do { *(BYTE*)(a) = (b) & 0xff; \ *((BYTE*)((a)+1)) = ((b)>>8) & 0xff;\ } while(0) - + /* dos file attributes */ diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h index 5572e4d3751..97577147caa 100644 --- a/include/msvcrt/stdio.h +++ b/include/msvcrt/stdio.h @@ -26,14 +26,14 @@ #define _IORW 0x0080 #define _IOAPPEND 0x0200 #else -#define MSVCRT__IOREAD 0x0001 -#define MSVCRT__IOWRT 0x0002 -#define MSVCRT__IOMYBUF 0x0008 -#define MSVCRT__IOEOF 0x0010 -#define MSVCRT__IOERR 0x0020 -#define MSVCRT__IOSTRG 0x0040 -#define MSVCRT__IORW 0x0080 -#define MSVCRT__IOAPPEND 0x0200 +#define MSVCRT__IOREAD 0x0001 +#define MSVCRT__IOWRT 0x0002 +#define MSVCRT__IOMYBUF 0x0008 +#define MSVCRT__IOEOF 0x0010 +#define MSVCRT__IOERR 0x0020 +#define MSVCRT__IOSTRG 0x0040 +#define MSVCRT__IORW 0x0080 +#define MSVCRT__IOAPPEND 0x0200 #endif /* USE_MSVCRT_PREFIX */ diff --git a/include/msvcrt/wctype.h b/include/msvcrt/wctype.h index ff0cc4ed433..fce0b11805b 100644 --- a/include/msvcrt/wctype.h +++ b/include/msvcrt/wctype.h @@ -22,7 +22,7 @@ #define __WINE_USE_MSVCRT -/* FIXME: winnt.h includes 'ctype.h' which includes 'wctype.h'. So we get +/* FIXME: winnt.h includes 'ctype.h' which includes 'wctype.h'. So we get * there but WCHAR is not defined. */ /* Some systems might have wchar_t, but we really need 16 bit characters */ diff --git a/include/netspi.h b/include/netspi.h index a1e9e188b73..acecf465a94 100644 --- a/include/netspi.h +++ b/include/netspi.h @@ -32,7 +32,7 @@ #define HPROVIDER LPVOID typedef HPROVIDER *PHPROVIDER; -typedef struct +typedef struct { DWORD cbStructure; HWND hwndOwner; @@ -94,7 +94,7 @@ enum NOTIFYTYPE { NotifyAddConnection, #define NOTIFY_PRE 0x00 #define NOTIFY_POST 0x01 -typedef struct +typedef struct { DWORD cbStructure; DWORD dwNotifyStatus; @@ -103,7 +103,7 @@ typedef struct } NOTIFYINFO, *LPNOTIFYINFO; -typedef struct +typedef struct { DWORD cbStructure; HWND hwndOwner; @@ -121,7 +121,7 @@ typedef struct #define CONNECT_CTXT_PROVIDER 0x00000004 #define CONNECT_CTXT_SINGLE 0x00000008 -typedef struct +typedef struct { DWORD cbStructure; LPSTR lpName; @@ -131,7 +131,7 @@ typedef struct } NOTIFYCANCELA, *LPNOTIFYCANCELA; -typedef struct +typedef struct { DWORD cbStructure; LPSTR lpRemoteName; diff --git a/include/nspapi.h b/include/nspapi.h index 64c1b8ff3c1..92e81a15038 100644 --- a/include/nspapi.h +++ b/include/nspapi.h @@ -47,7 +47,7 @@ extern "C" { /* * structures */ -typedef struct _PROTOCOL_INFOA +typedef struct _PROTOCOL_INFOA { DWORD dwServiceFlags; INT iAddressFamily; @@ -59,7 +59,7 @@ typedef struct _PROTOCOL_INFOA LPSTR lpProtocol; } PROTOCOL_INFOA; -typedef struct _PROTOCOL_INFOW +typedef struct _PROTOCOL_INFOW { DWORD dwServiceFlags; INT iAddressFamily; diff --git a/include/ntddk.h b/include/ntddk.h index 42a354c2942..00500b50ab9 100644 --- a/include/ntddk.h +++ b/include/ntddk.h @@ -31,24 +31,24 @@ extern "C" { #endif -/****************** - * asynchronous I/O +/****************** + * asynchronous I/O */ #undef Status /* conflict with X11-includes*/ -typedef struct _IO_STATUS_BLOCK +typedef struct _IO_STATUS_BLOCK { union { NTSTATUS Status; PVOID Pointer; } DUMMYUNIONNAME; ULONG_PTR Information; -} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; +} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; typedef VOID (NTAPI *PIO_APC_ROUTINE) ( PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved ); /* - registry + registry */ /* key information */ @@ -59,7 +59,7 @@ typedef struct _KEY_BASIC_INFORMATION { WCHAR Name[1]; } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION; -typedef struct _KEY_NODE_INFORMATION +typedef struct _KEY_NODE_INFORMATION { LARGE_INTEGER LastWriteTime; ULONG TitleIndex; @@ -70,7 +70,7 @@ typedef struct _KEY_NODE_INFORMATION /* Class[1]; */ } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION; -typedef struct _KEY_FULL_INFORMATION +typedef struct _KEY_FULL_INFORMATION { LARGE_INTEGER LastWriteTime; ULONG TitleIndex; @@ -85,14 +85,14 @@ typedef struct _KEY_FULL_INFORMATION WCHAR Class[1]; } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION; -typedef enum _KEY_INFORMATION_CLASS +typedef enum _KEY_INFORMATION_CLASS { KeyBasicInformation, KeyNodeInformation, KeyFullInformation } KEY_INFORMATION_CLASS; -typedef struct _KEY_VALUE_ENTRY +typedef struct _KEY_VALUE_ENTRY { PUNICODE_STRING ValueName; ULONG DataLength; @@ -101,7 +101,7 @@ typedef struct _KEY_VALUE_ENTRY } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY; /* value information */ -typedef struct _KEY_VALUE_BASIC_INFORMATION +typedef struct _KEY_VALUE_BASIC_INFORMATION { ULONG TitleIndex; ULONG Type; @@ -109,7 +109,7 @@ typedef struct _KEY_VALUE_BASIC_INFORMATION WCHAR Name[1]; } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION; -typedef struct _KEY_VALUE_FULL_INFORMATION +typedef struct _KEY_VALUE_FULL_INFORMATION { ULONG TitleIndex; ULONG Type; @@ -120,7 +120,7 @@ typedef struct _KEY_VALUE_FULL_INFORMATION /* UCHAR Data[1];*/ } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION; -typedef struct _KEY_VALUE_PARTIAL_INFORMATION +typedef struct _KEY_VALUE_PARTIAL_INFORMATION { ULONG TitleIndex; ULONG Type; @@ -128,7 +128,7 @@ typedef struct _KEY_VALUE_PARTIAL_INFORMATION UCHAR Data[1]; } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION; -typedef enum _KEY_VALUE_INFORMATION_CLASS +typedef enum _KEY_VALUE_INFORMATION_CLASS { KeyValueBasicInformation, KeyValueFullInformation, @@ -142,7 +142,7 @@ NTSTATUS WINAPI RtlFormatCurrentUserKeyPath( /* thread information */ -typedef enum _THREADINFOCLASS +typedef enum _THREADINFOCLASS { ThreadBasicInformation, ThreadTimes, ThreadPriority, @@ -232,13 +232,13 @@ typedef enum _FSINFOCLASS { FileFsMaximumInformation } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS; -typedef enum _SECTION_INHERIT +typedef enum _SECTION_INHERIT { ViewShare = 1, ViewUnmap = 2 } SECTION_INHERIT; - + /* object information */ typedef enum _OBJECT_INFORMATION_CLASS @@ -440,11 +440,11 @@ typedef struct _SYSTEM_TIME_ADJUSTMENT } SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT; -typedef struct _SYSTEM_CONFIGURATION_INFO +typedef struct _SYSTEM_CONFIGURATION_INFO { - union + union { ULONG OemId; - struct + struct { WORD ProcessorArchitecture; WORD Reserved; } tag1; @@ -468,7 +468,7 @@ typedef struct _SYSTEM_CONFIGURATION_INFO /* parameter ProcessInformationClass */ -typedef enum _PROCESSINFOCLASS +typedef enum _PROCESSINFOCLASS { ProcessBasicInformation, ProcessQuotaLimits, ProcessIoCounters, @@ -501,7 +501,7 @@ typedef enum _PROCESSINFOCLASS /* parameter ProcessInformation (depending on ProcessInformationClass) */ -typedef struct _PROCESS_BASIC_INFORMATION +typedef struct _PROCESS_BASIC_INFORMATION { DWORD ExitStatus; DWORD PebBaseAddress; DWORD AffinityMask; @@ -523,7 +523,7 @@ NTSTATUS WINAPI NtQueryInformationProcess( * timer */ -typedef enum _TIMER_TYPE +typedef enum _TIMER_TYPE { NotificationTimer, SynchronizationTimer @@ -531,15 +531,15 @@ typedef enum _TIMER_TYPE } TIMER_TYPE; /* token functions */ - + NTSTATUS WINAPI NtOpenProcessToken( HANDLE ProcessHandle, - DWORD DesiredAccess, + DWORD DesiredAccess, HANDLE *TokenHandle); - + NTSTATUS WINAPI NtOpenThreadToken( HANDLE ThreadHandle, - DWORD DesiredAccess, + DWORD DesiredAccess, BOOLEAN OpenAsSelf, HANDLE *TokenHandle); @@ -553,7 +553,7 @@ NTSTATUS WINAPI NtAdjustPrivilegesToken( NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, - DWORD tokeninfoclass, + DWORD tokeninfoclass, LPVOID tokeninfo, DWORD tokeninfolength, LPDWORD retlen ); @@ -568,19 +568,19 @@ BOOLEAN WINAPI RtlAllocateAndInitializeSid ( DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid ); - + BOOL WINAPI RtlInitializeSid( PSID pSid, PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount); - + DWORD WINAPI RtlFreeSid( PSID pSid); BOOL WINAPI RtlEqualSid( PSID pSid1, PSID pSid2 ); - + DWORD WINAPI RtlLengthRequiredSid( DWORD nrofsubauths); @@ -598,7 +598,7 @@ DWORD WINAPI RtlCopySid( DWORD len, PSID to, PSID from); - + BOOL WINAPI RtlValidSid( PSID pSid); @@ -692,7 +692,7 @@ NTSTATUS WINAPI RtlAddAce( DWORD xnrofaces, PACE_HEADER acestart, DWORD acelen); - + BOOL WINAPI RtlAddAccessAllowedAce( IN OUT PACL pAcl, IN DWORD dwAceRevision, @@ -775,25 +775,25 @@ typedef struct _RTL_RWLOCK { VOID WINAPI RtlInitializeResource( LPRTL_RWLOCK); - + VOID WINAPI RtlDeleteResource( LPRTL_RWLOCK); - + BYTE WINAPI RtlAcquireResourceExclusive( LPRTL_RWLOCK, BYTE fWait); - + BYTE WINAPI RtlAcquireResourceShared( LPRTL_RWLOCK, BYTE fWait); - + VOID WINAPI RtlReleaseResource( LPRTL_RWLOCK); - + VOID WINAPI RtlDumpResource( LPRTL_RWLOCK); /* time functions */ -typedef struct _TIME_FIELDS +typedef struct _TIME_FIELDS { CSHORT Year; CSHORT Month; CSHORT Day; @@ -817,11 +817,11 @@ VOID WINAPI RtlTimeToTimeFields( BOOLEAN WINAPI RtlTimeFieldsToTime( PTIME_FIELDS tfTimeFields, PLARGE_INTEGER Time); - + VOID WINAPI RtlTimeToElapsedTimeFields( PLARGE_INTEGER liTime, PTIME_FIELDS TimeFields); - + void WINAPI NtQuerySystemTime( LARGE_INTEGER *time ); BOOLEAN WINAPI RtlTimeToSecondsSince1980( const FILETIME *time, LPDWORD res ); @@ -920,8 +920,8 @@ DWORD WINAPI RtlNewSecurityObject( DWORD WINAPI RtlDeleteSecurityObject( DWORD x1); - -NTSTATUS WINAPI + +NTSTATUS WINAPI NtQuerySecurityObject( IN HANDLE Object, IN SECURITY_INFORMATION RequestedInformation, @@ -1056,7 +1056,7 @@ DWORD WINAPI RtlOpenCurrentUser( BOOLEAN WINAPI RtlDosPathNameToNtPathName_U( LPWSTR from,PUNICODE_STRING us,DWORD x2,DWORD x3); BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel); -NTSTATUS WINAPI +NTSTATUS WINAPI NtAccessCheck( IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN HANDLE ClientToken, diff --git a/include/ntddstor.h b/include/ntddstor.h index 1f8f1340498..7c0894071a0 100644 --- a/include/ntddstor.h +++ b/include/ntddstor.h @@ -131,7 +131,7 @@ typedef enum _STORAGE_MEDIA_TYPE { SYQUEST_EZFLYER, SYQUEST_SYJET, AVATAR_F2, - MP2_8mm + MP2_8mm } STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE; #define MEDIA_ERASEABLE 0x00000001 @@ -179,7 +179,7 @@ typedef enum _STORAGE_QUERY_TYPE { PropertyStandardQuery = 0, PropertyExistsQuery, PropertyMaskQuery, - PropertyQueryMaxDefined + PropertyQueryMaxDefined } STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE; typedef enum _STORAGE_PROPERTY_ID { diff --git a/include/ntdef.h b/include/ntdef.h index 21f3e0bbb79..61d5b58eeb4 100644 --- a/include/ntdef.h +++ b/include/ntdef.h @@ -26,7 +26,7 @@ extern "C" { #endif -#define NTAPI __stdcall +#define NTAPI __stdcall #ifndef IN #define IN @@ -48,7 +48,7 @@ typedef LONG NTSTATUS; typedef NTSTATUS *PNTSTATUS; typedef short CSHORT; -typedef CSHORT *PCSHORT; +typedef CSHORT *PCSHORT; /* NT lowlevel Strings (handled by Rtl* functions in NTDLL) @@ -86,7 +86,7 @@ typedef struct _UNICODE_STRING { #define OBJ_KERNEL_HANDLE 0x00000200L #define OBJ_VALID_ATTRIBUTES 0x000003F2L -typedef struct _OBJECT_ATTRIBUTES +typedef struct _OBJECT_ATTRIBUTES { ULONG Length; HANDLE RootDirectory; PUNICODE_STRING ObjectName; diff --git a/include/ntsecapi.h b/include/ntsecapi.h index b7765e2bac6..3c548b40168 100644 --- a/include/ntsecapi.h +++ b/include/ntsecapi.h @@ -33,7 +33,7 @@ typedef PVOID LSA_HANDLE, *PLSA_HANDLE; NTSTATUS WINAPI LsaOpenPolicy(PLSA_UNICODE_STRING,PLSA_OBJECT_ATTRIBUTES,ACCESS_MASK,PLSA_HANDLE); -typedef enum +typedef enum { PolicyAuditLogInformation = 1, PolicyAuditEventsInformation, diff --git a/include/objbase.h b/include/objbase.h index 9484adb06a3..4aa2c455c33 100644 --- a/include/objbase.h +++ b/include/objbase.h @@ -60,7 +60,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid); #endif #ifndef __WINE__ -/* These macros are msdev's way of defining COM objects. +/* These macros are msdev's way of defining COM objects. * They are provided here for use by Winelib developpers. */ #define FARSTRUCT diff --git a/include/ole.h b/include/ole.h index 8f00d262838..d9ef4cbb5f5 100644 --- a/include/ole.h +++ b/include/ole.h @@ -207,9 +207,9 @@ typedef struct _OLESERVERVTBL { OLESTATUS (CALLBACK *CreateFromTemplate)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *); OLESTATUS (CALLBACK *Edit)(LPOLESERVER,LHSERVERDOC,LPCOLESTR16,LPCOLESTR16,LPOLESERVERDOC *); OLESTATUS (CALLBACK *Exit)(LPOLESERVER); - OLESTATUS (CALLBACK *Release)(LPOLESERVER); - OLESTATUS (CALLBACK *Execute)(LPOLESERVER); -} OLESERVERVTBL; + OLESTATUS (CALLBACK *Release)(LPOLESERVER); + OLESTATUS (CALLBACK *Execute)(LPOLESERVER); +} OLESERVERVTBL; typedef OLESERVERVTBL *LPOLESERVERVTBL; typedef struct _OLESERVER { LPOLESERVERVTBL lpvtbl; diff --git a/include/ole2.h b/include/ole2.h index 582fe319d8b..6bed8ee17c2 100644 --- a/include/ole2.h +++ b/include/ole2.h @@ -73,11 +73,11 @@ HRESULT WINAPI ReadClassStm(IStream *pStm,CLSID *pclsid); HRESULT WINAPI OleSave(LPPERSISTSTORAGE pPS, LPSTORAGE pStg, BOOL fSameAsLoad); -HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, +HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD dwFormOfType, LPOLESTR* pszUserType); HRESULT WINAPI OleRegGetMiscStatus (REFCLSID clsid, DWORD dwAspect, DWORD* pdwStatus); -HRESULT WINAPI OleRegEnumFormatEtc (REFCLSID clsid, +HRESULT WINAPI OleRegEnumFormatEtc (REFCLSID clsid, DWORD dwDirection, LPENUMFORMATETC* ppenumFormatetc); HRESULT WINAPI CreateStreamOnHGlobal (HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM* ppstm); @@ -97,7 +97,7 @@ HRESULT WINAPI OleGetClipboard(IDataObject** ppDataObj); HRESULT WINAPI OleIsCurrentClipboard(LPDATAOBJECT); HRESULT WINAPI OleSetClipboard(LPDATAOBJECT); HRESULT WINAPI OleCreateStaticFromData(LPDATAOBJECT pSrcDataObj, REFIID iid, - DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, + DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID* ppvObj); HRESULT WINAPI ReadFmtUserTypeStg(LPSTORAGE pstg, CLIPFORMAT* pcf, LPOLESTR* lplpszUserType); HRESULT WINAPI OleLoad(LPSTORAGE pStg, REFIID riid, LPOLECLIENTSITE pClientSite, LPVOID* ppvObj); diff --git a/include/ole2ver.h b/include/ole2ver.h index 037ab190b2c..8c2f57d953c 100644 --- a/include/ole2ver.h +++ b/include/ole2ver.h @@ -31,7 +31,7 @@ * Win98 SE original files: * COMPOBJ: CoBuildVersion 23/700 * OLE2: OleBuildVersion -> COMPOBJ.CoBuildVersion - * OLE32: CoBuildVersion and Ole~ 23/824 + * OLE32: CoBuildVersion and Ole~ 23/824 * * We probably should reorganize the OLE version stuff, i.e. * use different values for every *BuildVersion function and Win version. diff --git a/include/oleauto.h b/include/oleauto.h index 0badc6dc0ec..0cae376fc62 100644 --- a/include/oleauto.h +++ b/include/oleauto.h @@ -66,64 +66,64 @@ HRESULT WINAPI CreateErrorInfo(ICreateErrorInfo **pperrinfo); HRESULT WINAPI SafeArrayAllocDescriptor(UINT cDims, struct tagSAFEARRAY **ppsaOut); -HRESULT WINAPI +HRESULT WINAPI SafeArrayAllocData(struct tagSAFEARRAY *psa); struct tagSAFEARRAY * WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, struct tagSAFEARRAYBOUND *rgsabound); -HRESULT WINAPI +HRESULT WINAPI SafeArrayDestroyDescriptor(struct tagSAFEARRAY *psa); -HRESULT WINAPI +HRESULT WINAPI SafeArrayPutElement(struct tagSAFEARRAY *psa, LONG *rgIndices, void *pv); -HRESULT WINAPI +HRESULT WINAPI SafeArrayGetElement(struct tagSAFEARRAY *psa, LONG *rgIndices, void *pv); -HRESULT WINAPI +HRESULT WINAPI SafeArrayLock(struct tagSAFEARRAY *psa); -HRESULT WINAPI +HRESULT WINAPI SafeArrayUnlock(struct tagSAFEARRAY *psa); -HRESULT WINAPI +HRESULT WINAPI SafeArrayGetUBound(struct tagSAFEARRAY *psa, UINT nDim, LONG *plUbound); -HRESULT WINAPI +HRESULT WINAPI SafeArrayGetLBound(struct tagSAFEARRAY *psa, UINT nDim, LONG *plLbound); -UINT WINAPI +UINT WINAPI SafeArrayGetDim(struct tagSAFEARRAY *psa); -UINT WINAPI +UINT WINAPI SafeArrayGetElemsize(struct tagSAFEARRAY *psa); -HRESULT WINAPI +HRESULT WINAPI SafeArrayAccessData(struct tagSAFEARRAY *psa, void **ppvData); -HRESULT WINAPI +HRESULT WINAPI SafeArrayUnaccessData(struct tagSAFEARRAY *psa); -HRESULT WINAPI +HRESULT WINAPI SafeArrayPtrOfIndex(struct tagSAFEARRAY *psa, LONG *rgIndices, void **ppvData); -HRESULT WINAPI +HRESULT WINAPI SafeArrayCopyData(struct tagSAFEARRAY *psaSource, struct tagSAFEARRAY **psaTarget); -HRESULT WINAPI +HRESULT WINAPI SafeArrayDestroyData(struct tagSAFEARRAY *psa); -HRESULT WINAPI +HRESULT WINAPI SafeArrayDestroy(struct tagSAFEARRAY *psa); -HRESULT WINAPI +HRESULT WINAPI SafeArrayCopy(struct tagSAFEARRAY *psa, struct tagSAFEARRAY **ppsaOut); struct tagSAFEARRAY * WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements); -HRESULT WINAPI +HRESULT WINAPI SafeArrayRedim(struct tagSAFEARRAY *psa, struct tagSAFEARRAYBOUND *psaboundNew); @@ -626,7 +626,7 @@ HRESULT WINAPI UnRegisterTypeLib(REFGUID,WORD,WORD,LCID,SYSKIND); #ifdef __cplusplus } /* extern "C" */ -#endif +#endif #endif /*__WINE_OLEAUTO_H*/ diff --git a/include/olectl.h b/include/olectl.h index 83d78ba9af9..5cb11842b4b 100644 --- a/include/olectl.h +++ b/include/olectl.h @@ -68,7 +68,7 @@ DEFINE_GUID(GUID_XSIZE, 0x66504308,0xBE0F,0x101A,0x8B,0xBB,0x00,0xAA,0x00,0x30,0x0C,0xAB); DEFINE_GUID(GUID_YSIZE, 0x66504309,0xBE0F,0x101A,0x8B,0xBB,0x00,0xAA,0x00,0x30,0x0C,0xAB); - + typedef struct tagOCPFIPARAMS { ULONG cbStructSize; @@ -154,18 +154,18 @@ HCURSOR WINAPI OleIconToCursor( HINSTANCE hinstExe, HICON hicon); HRESULT WINAPI OleCreatePropertyFrameIndirect( LPOCPFIPARAMS lpParams); HRESULT WINAPI OleCreatePropertyFrame( - HWND hwndOwner, UINT x, UINT y, - LPCOLESTR lpszCaption, ULONG cObjects, LPUNKNOWN* ppUnk, - ULONG cPages, LPCLSID pPageClsID, LCID lcid, DWORD dwReserved, + HWND hwndOwner, UINT x, UINT y, + LPCOLESTR lpszCaption, ULONG cObjects, LPUNKNOWN* ppUnk, + ULONG cPages, LPCLSID pPageClsID, LCID lcid, DWORD dwReserved, LPVOID pvReserved ); -HRESULT WINAPI OleLoadPicture( LPSTREAM lpstream, LONG lSize, BOOL fRunmode, +HRESULT WINAPI OleLoadPicture( LPSTREAM lpstream, LONG lSize, BOOL fRunmode, REFIID reed, LPVOID *lplpvObj ); -HRESULT WINAPI OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid, +HRESULT WINAPI OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid, BOOL fOwn, LPVOID * lplpvObj ); -HRESULT WINAPI OleCreateFontIndirect(LPFONTDESC lpFontDesc, REFIID riid, +HRESULT WINAPI OleCreateFontIndirect(LPFONTDESC lpFontDesc, REFIID riid, LPVOID* lplpvObj); HRESULT WINAPI OleTranslateColor( OLE_COLOR clr, HPALETTE hpal, @@ -253,7 +253,7 @@ HRESULT WINAPI OleTranslateColor( OLE_COLOR clr, HPALETTE hpal, #define DISPID_PICT_WIDTH 4 #define DISPID_PICT_HEIGHT 5 #define DISPID_PICT_RENDER 6 - + /* Reflected Window Message IDs */ #define OCM__BASE (WM_USER+0x1c00) #define OCM_COMMAND (OCM__BASE + WM_COMMAND) diff --git a/include/oledlg.h b/include/oledlg.h index 5ef5ea1e88a..97a089cb86f 100644 --- a/include/oledlg.h +++ b/include/oledlg.h @@ -102,7 +102,7 @@ typedef struct IOleUIObjInfoW IOleUIObjInfoW, *POLEUIOBJINFOW, *LPOLEUIOBJINFOW; #define OLEUI_FALSE 0 #define OLEUI_SUCCESS 1 /* Same as OLEUI_OK */ -#define OLEUI_OK 1 /* OK button pressed */ +#define OLEUI_OK 1 /* OK button pressed */ #define OLEUI_CANCEL 2 /* Cancel button pressed */ #define OPF_OBJECTISLINK 0x00000001L @@ -117,54 +117,54 @@ typedef UINT (CALLBACK *LPFNOLEUIHOOK)(HWND, UINT, WPARAM, LPARAM); */ typedef struct tagOLEUIINSERTOBJECTA { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCSTR lpszTemplate; - HRSRC hResource; - CLSID clsid; - LPSTR lpszFile; - UINT cchFile; - UINT cClsidExclude; - LPCLSID lpClsidExclude; - IID iid; - DWORD oleRender; - LPFORMATETC lpFormatEtc; - LPOLECLIENTSITE lpIOleClientSite; - LPSTORAGE lpIStorage; - LPVOID *ppvObj; - SCODE sc; - HGLOBAL hMetaPict; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCSTR lpszTemplate; + HRSRC hResource; + CLSID clsid; + LPSTR lpszFile; + UINT cchFile; + UINT cClsidExclude; + LPCLSID lpClsidExclude; + IID iid; + DWORD oleRender; + LPFORMATETC lpFormatEtc; + LPOLECLIENTSITE lpIOleClientSite; + LPSTORAGE lpIStorage; + LPVOID *ppvObj; + SCODE sc; + HGLOBAL hMetaPict; } OLEUIINSERTOBJECTA, *POLEUIINSERTOBJECTA, *LPOLEUIINSERTOBJECTA; typedef struct tagOLEUIINSERTOBJECTW { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCWSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCWSTR lpszTemplate; - HRSRC hResource; - CLSID clsid; - LPWSTR lpszFile; - UINT cchFile; - UINT cClsidExclude; - LPCLSID lpClsidExclude; - IID iid; - DWORD oleRender; - LPFORMATETC lpFormatEtc; - LPOLECLIENTSITE lpIOleClientSite; - LPSTORAGE lpIStorage; - LPVOID *ppvObj; - SCODE sc; - HGLOBAL hMetaPict; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCWSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCWSTR lpszTemplate; + HRSRC hResource; + CLSID clsid; + LPWSTR lpszFile; + UINT cchFile; + UINT cClsidExclude; + LPCLSID lpClsidExclude; + IID iid; + DWORD oleRender; + LPFORMATETC lpFormatEtc; + LPOLECLIENTSITE lpIOleClientSite; + LPSTORAGE lpIStorage; + LPVOID *ppvObj; + SCODE sc; + HGLOBAL hMetaPict; } OLEUIINSERTOBJECTW, *POLEUIINSERTOBJECTW, *LPOLEUIINSERTOBJECTW; DECL_WINELIB_TYPE_AW(OLEUIINSERTOBJECT) @@ -177,54 +177,54 @@ DECL_WINELIB_TYPE_AW(LPOLEUIINSERTOBJECT) */ typedef struct tagOLEUICONVERTA { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCSTR lpszTemplate; - HRSRC hResource; - CLSID clsid; - CLSID clsidConvertDefault; - CLSID clsidActivateDefault; - CLSID clsidNew; - DWORD dvAspect; - WORD wFormat; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCSTR lpszTemplate; + HRSRC hResource; + CLSID clsid; + CLSID clsidConvertDefault; + CLSID clsidActivateDefault; + CLSID clsidNew; + DWORD dvAspect; + WORD wFormat; BOOL fIsLinkedObject; - HGLOBAL hMetaPict; - LPSTR lpszUserType; - BOOL fObjectsIconChanged; - LPSTR lpszDefLabel; - UINT cClsidExclude; - LPCLSID lpClsidExclude; + HGLOBAL hMetaPict; + LPSTR lpszUserType; + BOOL fObjectsIconChanged; + LPSTR lpszDefLabel; + UINT cClsidExclude; + LPCLSID lpClsidExclude; } OLEUICONVERTA, *POLEUICONVERTA, *LPOLEUICONVERTA; typedef struct tagOLEUICONVERTW { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCWSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCWSTR lpszTemplate; - HRSRC hResource; - CLSID clsid; - CLSID clsidConvertDefault; - CLSID clsidActivateDefault; - CLSID clsidNew; - DWORD dvAspect; - WORD wFormat; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCWSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCWSTR lpszTemplate; + HRSRC hResource; + CLSID clsid; + CLSID clsidConvertDefault; + CLSID clsidActivateDefault; + CLSID clsidNew; + DWORD dvAspect; + WORD wFormat; BOOL fIsLinkedObject; - HGLOBAL hMetaPict; - LPWSTR lpszUserType; - BOOL fObjectsIconChanged; - LPWSTR lpszDefLabel; - UINT cClsidExclude; - LPCLSID lpClsidExclude; + HGLOBAL hMetaPict; + LPWSTR lpszUserType; + BOOL fObjectsIconChanged; + LPWSTR lpszDefLabel; + UINT cClsidExclude; + LPCLSID lpClsidExclude; } OLEUICONVERTW, *POLEUICONVERTW, *LPOLEUICONVERTW; DECL_WINELIB_TYPE_AW(OLEUICONVERT) @@ -236,36 +236,36 @@ DECL_WINELIB_TYPE_AW(LPOLEUICONVERT) */ typedef struct tagOLEUICHANGEICONA { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCSTR lpszTemplate; - HRSRC hResource; - HGLOBAL hMetaPict; - CLSID clsid; - CHAR szIconExe[MAX_PATH]; - INT cchIconExe; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCSTR lpszTemplate; + HRSRC hResource; + HGLOBAL hMetaPict; + CLSID clsid; + CHAR szIconExe[MAX_PATH]; + INT cchIconExe; } OLEUICHANGEICONA, *POLEUICHANGEICONA, *LPOLEUICHANGEICONA; typedef struct tagOLEUICHANGEICONW { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCWSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCWSTR lpszTemplate; - HRSRC hResource; - HGLOBAL hMetaPict; - CLSID clsid; - WCHAR szIconExe[MAX_PATH]; - INT cchIconExe; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCWSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCWSTR lpszTemplate; + HRSRC hResource; + HGLOBAL hMetaPict; + CLSID clsid; + WCHAR szIconExe[MAX_PATH]; + INT cchIconExe; } OLEUICHANGEICONW, *POLEUICHANGEICONW, *LPOLEUICHANGEICONW; DECL_WINELIB_TYPE_AW(OLEUICHANGEICON) @@ -279,7 +279,7 @@ DECL_WINELIB_TYPE_AW(LPOLEUICHANGEICON) typedef enum tagOLEUIPASTEFLAG { - OLEUIPASTE_ENABLEICON = 2048, + OLEUIPASTE_ENABLEICON = 2048, OLEUIPASTE_PASTEONLY = 0, OLEUIPASTE_PASTE = 512, OLEUIPASTE_LINKANYTYPE = 1024, @@ -291,24 +291,24 @@ typedef enum tagOLEUIPASTEFLAG OLEUIPASTE_LINKTYPE6 = 32, OLEUIPASTE_LINKTYPE7 = 64, OLEUIPASTE_LINKTYPE8 = 128 -} OLEUIPASTEFLAG; +} OLEUIPASTEFLAG; typedef struct tagOLEUIPASTEENTRYA { - FORMATETC fmtetc; + FORMATETC fmtetc; LPCSTR lpstrFormatName; LPCSTR lpstrResultText; - DWORD dwFlags; - DWORD dwScratchSpace; + DWORD dwFlags; + DWORD dwScratchSpace; } OLEUIPASTEENTRYA, *POLEUIPASTEENTRYA, *LPOLEUIPASTEENTRYA; typedef struct tagOLEUIPASTEENTRYW { - FORMATETC fmtetc; + FORMATETC fmtetc; LPCWSTR lpstrFormatName; LPCWSTR lpstrResultText; - DWORD dwFlags; - DWORD dwScratchSpace; + DWORD dwFlags; + DWORD dwScratchSpace; } OLEUIPASTEENTRYW, *POLEUIPASTEENTRYW, *LPOLEUIPASTEENTRYW; DECL_WINELIB_TYPE_AW(OLEUIPASTEENTRY) @@ -317,50 +317,50 @@ DECL_WINELIB_TYPE_AW(LPOLEUIPASTEENTRY) typedef struct tagOLEUIPASTESPECIALA { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCSTR lpszTemplate; - HRSRC hResource; - LPDATAOBJECT lpSrcDataObj; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCSTR lpszTemplate; + HRSRC hResource; + LPDATAOBJECT lpSrcDataObj; LPOLEUIPASTEENTRYA arrPasteEntries; - INT cPasteEntries; - UINT* arrLinkTypes; - INT cLinkTypes; - UINT cClsidExclude; - LPCLSID lpClsidExclude; - INT nSelectedIndex; - BOOL fLink; - HGLOBAL hMetaPict; - SIZEL sizel; + INT cPasteEntries; + UINT* arrLinkTypes; + INT cLinkTypes; + UINT cClsidExclude; + LPCLSID lpClsidExclude; + INT nSelectedIndex; + BOOL fLink; + HGLOBAL hMetaPict; + SIZEL sizel; } OLEUIPASTESPECIALA, *POLEUIPASTESPECIALA, *LPOLEUIPASTESPECIALA; typedef struct tagOLEUIPASTESPECIALW { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCWSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCWSTR lpszTemplate; - HRSRC hResource; - LPDATAOBJECT lpSrcDataObj; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCWSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCWSTR lpszTemplate; + HRSRC hResource; + LPDATAOBJECT lpSrcDataObj; LPOLEUIPASTEENTRYW arrPasteEntries; - INT cPasteEntries; - UINT* arrLinkTypes; - INT cLinkTypes; - UINT cClsidExclude; - LPCLSID lpClsidExclude; - INT nSelectedIndex; - BOOL fLink; - HGLOBAL hMetaPict; - SIZEL sizel; + INT cPasteEntries; + UINT* arrLinkTypes; + INT cLinkTypes; + UINT cClsidExclude; + LPCLSID lpClsidExclude; + INT nSelectedIndex; + BOOL fLink; + HGLOBAL hMetaPict; + SIZEL sizel; } OLEUIPASTESPECIALW, *POLEUIPASTESPECIALW, *LPOLEUIPASTESPECIALW; DECL_WINELIB_TYPE_AW(OLEUIPASTESPECIAL) @@ -391,30 +391,30 @@ DECL_WINELIB_TYPE_AW(LPOLEUIPASTESPECIAL) typedef struct tagOLEUIEDITLINKSW { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCWSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCWSTR lpszTemplate; - HRSRC hResource; - LPOLEUILINKCONTAINERW lpOleUILinkContainer; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCWSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCWSTR lpszTemplate; + HRSRC hResource; + LPOLEUILINKCONTAINERW lpOleUILinkContainer; } OLEUIEDITLINKSW, *POLEUIEDITLINKSW, *LPOLEUIEDITLINKSW; typedef struct tagOLEUIEDITLINKSA { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCSTR lpszTemplate; - HRSRC hResource; - LPOLEUILINKCONTAINERA lpOleUILinkContainer; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCSTR lpszTemplate; + HRSRC hResource; + LPOLEUILINKCONTAINERA lpOleUILinkContainer; } OLEUIEDITLINKSA, *POLEUIEDITLINKSA, *LPOLEUIEDITLINKSA; DECL_WINELIB_TYPE_AW(OLEUIEDITLINKS) @@ -427,32 +427,32 @@ DECL_WINELIB_TYPE_AW(LPOLEUIEDITLINKS) */ typedef struct tagOLEUIBUSYA { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCSTR lpszTemplate; - HRSRC hResource; - HTASK hTask; - HWND* lphWndDialog; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCSTR lpszTemplate; + HRSRC hResource; + HTASK hTask; + HWND* lphWndDialog; } OLEUIBUSYA, *POLEUIBUSYA, *LPOLEUIBUSYA; typedef struct tagOLEUIBUSYW { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCWSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCWSTR lpszTemplate; - HRSRC hResource; - HTASK hTask; - HWND* lphWndDialog; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCWSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCWSTR lpszTemplate; + HRSRC hResource; + HTASK hTask; + HWND* lphWndDialog; } OLEUIBUSYW, *POLEUIBUSYW, *LPOLEUIBUSYW; DECL_WINELIB_TYPE_AW(OLEUIBUSY) @@ -465,25 +465,25 @@ struct tagOLEUIOBJECTPROPSA; typedef struct tagOLEUIGNRLPROPSA { - DWORD cbStruct; - DWORD dwFlags; + DWORD cbStruct; + DWORD dwFlags; DWORD dwReserved1[2]; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; DWORD dwReserved2[3]; - struct tagOLEUIOBJECTPROPSA* lpOP; + struct tagOLEUIOBJECTPROPSA* lpOP; } OLEUIGNRLPROPSA, *POLEUIGNRLPROPSA, *LPOLEUIGNRLPROPSA; typedef struct tagOLEUIGNRLPROPSW { - DWORD cbStruct; - DWORD dwFlags; + DWORD cbStruct; + DWORD dwFlags; DWORD dwReserved1[2]; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; DWORD dwReserved2[3]; - struct tagOLEUIOBJECTPROPSW* lpOP; + struct tagOLEUIOBJECTPROPSW* lpOP; } OLEUIGNRLPROPSW, *POLEUIGNRLPROPSW, *LPOLEUIGNRLPROPSW; DECL_WINELIB_TYPE_AW(OLEUIGNRLPROPS) @@ -492,27 +492,27 @@ DECL_WINELIB_TYPE_AW(LPOLEUIGNRLPROPS) typedef struct tagOLEUIVIEWPROPSA { - DWORD cbStruct; - DWORD dwFlags; + DWORD cbStruct; + DWORD dwFlags; DWORD dwReserved1[2]; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; DWORD dwReserved2[3]; - struct tagOLEUIOBJECTPROPSA* lpOP; - INT nScaleMin; + struct tagOLEUIOBJECTPROPSA* lpOP; + INT nScaleMin; INT nScaleMax; } OLEUIVIEWPROPSA, *POLEUIVIEWPROPSA, *LPOLEUIVIEWPROPSA; typedef struct tagOLEUIVIEWPROPSW { - DWORD cbStruct; - DWORD dwFlags; + DWORD cbStruct; + DWORD dwFlags; DWORD dwReserved1[2]; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; DWORD dwReserved2[3]; - struct tagOLEUIOBJECTPROPSW* lpOP; - INT nScaleMin; + struct tagOLEUIOBJECTPROPSW* lpOP; + INT nScaleMin; INT nScaleMax; } OLEUIVIEWPROPSW, *POLEUIVIEWPROPSW, *LPOLEUIVIEWPROPSW; @@ -521,30 +521,30 @@ DECL_WINELIB_TYPE_AW(POLEUIVIEWPROPS) DECL_WINELIB_TYPE_AW(LPOLEUIVIEWPROPS) -#define VPF_SELECTRELATIVE 0x00000001L -#define VPF_DISABLERELATIVE 0x00000002L -#define VPF_DISABLESCALE 0x00000004L +#define VPF_SELECTRELATIVE 0x00000001L +#define VPF_DISABLERELATIVE 0x00000002L +#define VPF_DISABLESCALE 0x00000004L typedef struct tagOLEUILINKPROPSA { - DWORD cbStruct; - DWORD dwFlags; + DWORD cbStruct; + DWORD dwFlags; DWORD dwReserved1[2]; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; DWORD dwReserved2[3]; - struct tagOLEUIOBJECTPROPSA* lpOP; + struct tagOLEUIOBJECTPROPSA* lpOP; } OLEUILINKPROPSA, *POLEUILINKPROPSA, *LPOLEUILINKPROPSA; typedef struct tagOLEUILINKPROPSW { - DWORD cbStruct; - DWORD dwFlags; + DWORD cbStruct; + DWORD dwFlags; DWORD dwReserved1[2]; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; DWORD dwReserved2[3]; - struct tagOLEUIOBJECTPROPSW* lpOP; + struct tagOLEUIOBJECTPROPSW* lpOP; } OLEUILINKPROPSW, *POLEUILINKPROPSW, *LPOLEUILINKPROPSW; DECL_WINELIB_TYPE_AW(OLEUILINKPROPS) @@ -553,30 +553,30 @@ DECL_WINELIB_TYPE_AW(LPOLEUILINKPROPS) typedef struct tagOLEUIOBJECTPROPSA { - DWORD cbStruct; - DWORD dwFlags; - LPPROPSHEETHEADERA lpPS; - DWORD dwObject; - LPOLEUIOBJINFOA lpObjInfo; - DWORD dwLink; - LPOLEUILINKINFOA lpLinkInfo; - LPOLEUIGNRLPROPSA lpGP; - LPOLEUIVIEWPROPSA lpVP; - LPOLEUILINKPROPSA lpLP; + DWORD cbStruct; + DWORD dwFlags; + LPPROPSHEETHEADERA lpPS; + DWORD dwObject; + LPOLEUIOBJINFOA lpObjInfo; + DWORD dwLink; + LPOLEUILINKINFOA lpLinkInfo; + LPOLEUIGNRLPROPSA lpGP; + LPOLEUIVIEWPROPSA lpVP; + LPOLEUILINKPROPSA lpLP; } OLEUIOBJECTPROPSA, *POLEUIOBJECTPROPSA, *LPOLEUIOBJECTPROPSA; typedef struct tagOLEUIOBJECTPROPSW { - DWORD cbStruct; - DWORD dwFlags; - LPPROPSHEETHEADERW lpPS; - DWORD dwObject; - LPOLEUIOBJINFOW lpObjInfo; - DWORD dwLink; - LPOLEUILINKINFOW lpLinkInfo; - LPOLEUIGNRLPROPSW lpGP; - LPOLEUIVIEWPROPSW lpVP; - LPOLEUILINKPROPSW lpLP; + DWORD cbStruct; + DWORD dwFlags; + LPPROPSHEETHEADERW lpPS; + DWORD dwObject; + LPOLEUIOBJINFOW lpObjInfo; + DWORD dwLink; + LPOLEUILINKINFOW lpLinkInfo; + LPOLEUIGNRLPROPSW lpGP; + LPOLEUIVIEWPROPSW lpVP; + LPOLEUILINKPROPSW lpLP; } OLEUIOBJECTPROPSW, *POLEUIOBJECTPROPSW, *LPOLEUIOBJECTPROPSW; DECL_WINELIB_TYPE_AW(OLEUIOBJECTPROPS) @@ -590,45 +590,45 @@ DECL_WINELIB_TYPE_AW(LPOLEUIOBJECTPROPS) typedef struct tagOLEUICHANGESOURCEW { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCWSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCWSTR lpszTemplate; - HRSRC hResource; - OPENFILENAMEW*lpOFN; - DWORD dwReserved1[4]; - LPOLEUILINKCONTAINERW lpOleUILinkContainer; - DWORD dwLink; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCWSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCWSTR lpszTemplate; + HRSRC hResource; + OPENFILENAMEW*lpOFN; + DWORD dwReserved1[4]; + LPOLEUILINKCONTAINERW lpOleUILinkContainer; + DWORD dwLink; LPWSTR lpszDisplayName; - ULONG nFileLength; - LPWSTR lpszFrom; - LPWSTR lpszTo; + ULONG nFileLength; + LPWSTR lpszFrom; + LPWSTR lpszTo; } OLEUICHANGESOURCEW, *POLEUICHANGESOURCEW, *LPOLEUICHANGESOURCEW; typedef struct tagOLEUICHANGESOURCEA { - DWORD cbStruct; - DWORD dwFlags; - HWND hWndOwner; - LPCSTR lpszCaption; - LPFNOLEUIHOOK lpfnHook; - LPARAM lCustData; - HINSTANCE hInstance; - LPCSTR lpszTemplate; - HRSRC hResource; - OPENFILENAMEA* lpOFN; - DWORD dwReserved1[4]; - LPOLEUILINKCONTAINERA lpOleUILinkContainer; - DWORD dwLink; + DWORD cbStruct; + DWORD dwFlags; + HWND hWndOwner; + LPCSTR lpszCaption; + LPFNOLEUIHOOK lpfnHook; + LPARAM lCustData; + HINSTANCE hInstance; + LPCSTR lpszTemplate; + HRSRC hResource; + OPENFILENAMEA* lpOFN; + DWORD dwReserved1[4]; + LPOLEUILINKCONTAINERA lpOleUILinkContainer; + DWORD dwLink; LPSTR lpszDisplayName; - ULONG nFileLength; - LPSTR lpszFrom; - LPSTR lpszTo; + ULONG nFileLength; + LPSTR lpszFrom; + LPSTR lpszTo; } OLEUICHANGESOURCEA, *POLEUICHANGESOURCEA, *LPOLEUICHANGESOURCEA; @@ -678,7 +678,7 @@ ICOM_DEFINE(IOleUILinkContainerA, IUnknown) ICOM_METHOD1(HRESULT,CancelLink, DWORD,dwLink) #define IOleUILinkContainerW_IMETHODS \ IUnknown_IMETHODS \ - IOleUILinkContainerW_METHODS + IOleUILinkContainerW_METHODS ICOM_DEFINE(IOleUILinkContainerW, IUnknown) #undef ICOM_INTERFACE @@ -698,8 +698,8 @@ DECL_WINELIB_TYPE_AW(LPOLEUILINKCONTAINER) #define IOleUILinkContainer_SetLinkSource(p,a,b,c,d,e) ICOM_CALL5(SetLinkSource,p,a,b,c,d,e) #define IOleUILinkContainer_GetLinkSource(p,a,b,c,d,e,f,g) ICOM_CALL7(GetLinkSource,p,a,b,c,d,e,f,g) #define IOleUILinkContainer_OpenLinkSource(p,a) ICOM_CALL1(OpenLinkSource,p,a) -#define IOleUILinkContainer_UpdateLink(p,a,b,c) ICOM_CALL3(UpdateLink,p,a,b,c) -#define IOleUILinkContainer_CancelLink(p,a) ICOM_CALL1(CancelLink,p,a) +#define IOleUILinkContainer_UpdateLink(p,a,b,c) ICOM_CALL3(UpdateLink,p,a,b,c) +#define IOleUILinkContainer_CancelLink(p,a) ICOM_CALL1(CancelLink,p,a) #endif @@ -711,7 +711,7 @@ DECL_WINELIB_TYPE_AW(LPOLEUILINKCONTAINER) ICOM_METHOD2(HRESULT,GetLastUpdate, DWORD,dwLink, FILETIME*,lpLastUpdate) #define IOleUILinkInfoA_IMETHODS \ IOleUILinkContainerA_IMETHODS \ - IOleUILinkInfoA_METHODS + IOleUILinkInfoA_METHODS ICOM_DEFINE(IOleUILinkInfoA, IOleUILinkContainerA) #undef ICOM_INTERFACE @@ -720,7 +720,7 @@ ICOM_DEFINE(IOleUILinkInfoA, IOleUILinkContainerA) ICOM_METHOD2(HRESULT,GetLastUpdate, DWORD,dwLink, FILETIME*,lpLastUpdate) #define IOleUILinkInfoW_IMETHODS \ IOleUILinkContainerW_IMETHODS \ - IOleUILinkInfoW_METHODS + IOleUILinkInfoW_METHODS ICOM_DEFINE(IOleUILinkInfoW, IOleUILinkContainerW) #undef ICOM_INTERFACE @@ -741,8 +741,8 @@ DECL_WINELIB_TYPE_AW(LPOLEUILINKINFO) #define IOleUILinkInfo_OpenLinkSource(p,a) ICOM_CALL1(OpenLinkSource,p,a) #define IOleUILinkInfo_UpdateLink(p,a,b,c) ICOM_CALL3(UpdateLink,p,a,b,c) #define IOleUILinkInfo_CancelLink(p,a) ICOM_CALL1(CancelLink,p,a) -/*** IOleUILinkInfo methods ***/ -#define IOleUILinkInfo_GetLastUpdate(p,a,b) ICOM_CALL2(GetLastUpdate,p,a,b) +/*** IOleUILinkInfo methods ***/ +#define IOleUILinkInfo_GetLastUpdate(p,a,b) ICOM_CALL2(GetLastUpdate,p,a,b) /***************************************************************************** @@ -762,7 +762,7 @@ DECL_WINELIB_TYPE_AW(LPOLEUILINKINFO) INT,nCurrentScale, BOOL,bRelativeToOrig) #define IOleUIObjInfoA_IMETHODS \ IUnknown_IMETHODS \ - IOleUIObjInfoA_METHODS + IOleUIObjInfoA_METHODS ICOM_DEFINE(IOleUIObjInfoA, IUnknown) #undef ICOM_INTERFACE @@ -780,7 +780,7 @@ ICOM_DEFINE(IOleUIObjInfoA, IUnknown) INT,nCurrentScale, BOOL,bRelativeToOrig) #define IOleUIObjInfoW_IMETHODS \ IUnknown_IMETHODS \ - IOleUIObjInfoW_METHODS + IOleUIObjInfoW_METHODS ICOM_DEFINE(IOleUIObjInfoW, IUnknown) #undef ICOM_INTERFACE @@ -830,7 +830,7 @@ BOOL WINAPI OleUIAddVerbMenuW(LPOLEOBJECT lpOleObj, LPCWSTR lpszShortType, HMEN #define OleUIAddVerbMenu WINELIB_NAME_AW(OleUIAddVerbMenu) UINT WINAPI OleUIPasteSpecialA(LPOLEUIPASTESPECIALA lpOleUIPasteSpecial); UINT WINAPI OleUIPasteSpecialW(LPOLEUIPASTESPECIALW lpOleUIPasteSpecial); -#define OleUIPasteSpecial WINELIB_NAME_AW(OleUIPasteSpecial) +#define OleUIPasteSpecial WINELIB_NAME_AW(OleUIPasteSpecial) #ifdef __cplusplus diff --git a/include/path.h b/include/path.h index 944121e6ecd..4eba03d2962 100644 --- a/include/path.h +++ b/include/path.h @@ -75,8 +75,8 @@ extern BOOL PATH_PolyPolyline(struct tagDC *dc, const POINT *pt, const DWORD *co DWORD polylines); extern BOOL PATH_PolyPolygon(struct tagDC *dc, const POINT *pt, const INT *counts, UINT polygons); -extern BOOL PATH_RoundRect(struct tagDC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, - INT ell_height); +extern BOOL PATH_RoundRect(struct tagDC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, + INT ell_height); extern BOOL PATH_AddEntry(GdiPath *pPath, const POINT *pPoint, BYTE flags); #endif /* __WINE_PATH_H */ diff --git a/include/prsht.h b/include/prsht.h index 0f52bd6e564..0e3f9a008fc 100644 --- a/include/prsht.h +++ b/include/prsht.h @@ -58,7 +58,7 @@ typedef struct _PROPSHEETPAGEA DWORD dwSize; DWORD dwFlags; HINSTANCE hInstance; - union + union { LPCSTR pszTemplate; LPCDLGTEMPLATEA pResource; @@ -84,7 +84,7 @@ typedef struct _PROPSHEETPAGEW DWORD dwSize; DWORD dwFlags; HINSTANCE hInstance; - union + union { LPCWSTR pszTemplate; LPCDLGTEMPLATEW pResource; @@ -200,13 +200,13 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage); * Property sheet support (UNICODE-Winelib) */ -DECL_WINELIB_TYPE_AW(PROPSHEETPAGE) -DECL_WINELIB_TYPE_AW(LPPROPSHEETPAGE) -DECL_WINELIB_TYPE_AW(LPCPROPSHEETPAGE) -DECL_WINELIB_TYPE_AW(PROPSHEETHEADER) -DECL_WINELIB_TYPE_AW(LPPROPSHEETHEADER) -DECL_WINELIB_TYPE_AW(LPCPROPSHEETHEADER) -DECL_WINELIB_TYPE_AW(LPFNPSPCALLBACK) +DECL_WINELIB_TYPE_AW(PROPSHEETPAGE) +DECL_WINELIB_TYPE_AW(LPPROPSHEETPAGE) +DECL_WINELIB_TYPE_AW(LPCPROPSHEETPAGE) +DECL_WINELIB_TYPE_AW(PROPSHEETHEADER) +DECL_WINELIB_TYPE_AW(LPPROPSHEETHEADER) +DECL_WINELIB_TYPE_AW(LPCPROPSHEETHEADER) +DECL_WINELIB_TYPE_AW(LPFNPSPCALLBACK) /* @@ -247,7 +247,7 @@ DECL_WINELIB_TYPE_AW(LPFNPSPCALLBACK) #define PSH_WIZARDCONTEXTHELP 0x00001000 /* - * for below IE 5 + * for below IE 5 * PSH_WIZARD97 0x00002000 */ #define PSH_WATERMARK 0x00008000 @@ -272,7 +272,7 @@ typedef struct _PSHNOTIFY NMHDR hdr; LPARAM lParam; } PSHNOTIFY, *LPPSHNOTIFY; - + #define PSN_FIRST (0U-200U) #define PSN_LAST (0U-299U) @@ -293,7 +293,7 @@ typedef struct _PSHNOTIFY #define PSNRET_NOERROR 0 #define PSNRET_INVALID 1 #define PSNRET_INVALID_NOCHANGEPAGE 2 - + #define PSM_SETCURSEL (WM_USER + 101) #define PSM_REMOVEPAGE (WM_USER + 102) @@ -359,58 +359,58 @@ typedef struct _PSHNOTIFY #define PropSheet_SetCurSel(hDlg, hpage, index) \ SendMessageA(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage) - + #define PropSheet_RemovePage(hDlg, index, hpage) \ SNDMSG(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage) - + #define PropSheet_AddPage(hDlg, hpage) \ SNDMSG(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage) - + #define PropSheet_Changed(hDlg, hwnd) \ SNDMSG(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0L) - + #define PropSheet_RestartWindows(hDlg) \ SNDMSG(hDlg, PSM_RESTARTWINDOWS, 0, 0L) - + #define PropSheet_RebootSystem(hDlg) \ SNDMSG(hDlg, PSM_REBOOTSYSTEM, 0, 0L) - + #define PropSheet_CancelToClose(hDlg) \ PostMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0L) - + #define PropSheet_QuerySiblings(hDlg, wParam, lParam) \ SNDMSG(hDlg, PSM_QUERYSIBLINGS, wParam, lParam) - + #define PropSheet_UnChanged(hDlg, hwnd) \ SNDMSG(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0L) - + #define PropSheet_Apply(hDlg) \ SNDMSG(hDlg, PSM_APPLY, 0, 0L) - + #define PropSheet_SetTitle(hDlg, wStyle, lpszText)\ SNDMSG(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCTSTR)lpszText) - + #define PropSheet_SetWizButtons(hDlg, dwFlags) \ PostMessage(hDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)dwFlags) - + #define PropSheet_PressButton(hDlg, iButton) \ PostMessage(hDlg, PSM_PRESSBUTTON, (WPARAM)iButton, 0) - + #define PropSheet_SetCurSelByID(hDlg, id) \ SNDMSG(hDlg, PSM_SETCURSELID, 0, (LPARAM)id) #define PropSheet_SetFinishText(hDlg, lpszText) \ SNDMSG(hDlg, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText) - + #define PropSheet_GetTabControl(hDlg) \ (HWND)SNDMSG(hDlg, PSM_GETTABCONTROL, 0, 0) - + #define PropSheet_IsDialogMessage(hDlg, pMsg) \ (BOOL)SNDMSG(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg) - + #define PropSheet_GetCurrentPageHwnd(hDlg) \ (HWND)SNDMSG(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0L) - + #ifdef __cplusplus } diff --git a/include/psapi.h b/include/psapi.h index 79f57d5b10e..738e625640c 100644 --- a/include/psapi.h +++ b/include/psapi.h @@ -29,16 +29,16 @@ typedef struct _MODULEINFO { LPVOID EntryPoint; } MODULEINFO, *LPMODULEINFO; -typedef struct _PROCESS_MEMORY_COUNTERS { - DWORD cb; +typedef struct _PROCESS_MEMORY_COUNTERS { + DWORD cb; DWORD PageFaultCount; DWORD PeakWorkingSetSize; DWORD WorkingSetSize; DWORD QuotaPeakPagedPoolUsage; DWORD QuotaPagedPoolUsage; - DWORD QuotaPeakNonPagedPoolUsage; + DWORD QuotaPeakNonPagedPoolUsage; DWORD QuotaNonPagedPoolUsage; - DWORD PagefileUsage; + DWORD PagefileUsage; DWORD PeakPagefileUsage; } PROCESS_MEMORY_COUNTERS; typedef PROCESS_MEMORY_COUNTERS *PPROCESS_MEMORY_COUNTERS; diff --git a/include/queue.h b/include/queue.h index 996e1d6b59c..b53c7b77544 100644 --- a/include/queue.h +++ b/include/queue.h @@ -35,7 +35,7 @@ * It might be necessary to store a pointer to the system message queue * as well since windows 9x maintains per thread system message queues */ -typedef struct tagPERQUEUEDATA +typedef struct tagPERQUEUEDATA { HWND hWndFocus; /* Focus window */ HWND hWndActive; /* Active window */ @@ -66,7 +66,7 @@ typedef struct tagMESSAGEQUEUE HANDLE16 hooks[WH_NB_HOOKS]; /* Task hooks list */ PERQUEUEDATA *pQData; /* pointer to (shared) PERQUEUEDATA structure */ - + } MESSAGEQUEUE; diff --git a/include/ras.h b/include/ras.h index 77b864bd0c3..ea4ae72fd4d 100644 --- a/include/ras.h +++ b/include/ras.h @@ -102,11 +102,11 @@ DECL_WINELIB_TYPE_AW(LPRASDIALPARAMS) DWORD WINAPI RasEnumConnectionsA(LPRASCONNA,LPDWORD,LPDWORD); DWORD WINAPI RasEnumConnectionsW(LPRASCONNW,LPDWORD,LPDWORD); #define RasEnumConnections WINELIB_NAME_AW(RasEnumConnections) -DWORD WINAPI RasEnumEntriesA(LPCSTR,LPCSTR,LPRASENTRYNAMEA,LPDWORD,LPDWORD); -DWORD WINAPI RasEnumEntriesW(LPCWSTR,LPCWSTR,LPRASENTRYNAMEW,LPDWORD,LPDWORD); +DWORD WINAPI RasEnumEntriesA(LPCSTR,LPCSTR,LPRASENTRYNAMEA,LPDWORD,LPDWORD); +DWORD WINAPI RasEnumEntriesW(LPCWSTR,LPCWSTR,LPRASENTRYNAMEW,LPDWORD,LPDWORD); #define RasEnumEntries WINELIB_NAME_AW(RasEnumEntries) -DWORD WINAPI RasGetEntryDialParamsA(LPCSTR,LPRASDIALPARAMSA,LPBOOL); -DWORD WINAPI RasGetEntryDialParamsW(LPCWSTR,LPRASDIALPARAMSW,LPBOOL); +DWORD WINAPI RasGetEntryDialParamsA(LPCSTR,LPRASDIALPARAMSA,LPBOOL); +DWORD WINAPI RasGetEntryDialParamsW(LPCWSTR,LPRASDIALPARAMSW,LPBOOL); #define RasGetEntryDialParams WINELIB_NAME_AW(RasGetEntryDialParams) DWORD WINAPI RasHangUpA(HRASCONN); DWORD WINAPI RasHangUpW(HRASCONN); diff --git a/include/richedit.h b/include/richedit.h index 16214f08311..5f305de6e06 100644 --- a/include/richedit.h +++ b/include/richedit.h @@ -131,12 +131,12 @@ static const WCHAR RICHEDIT_CLASS20W[] = { 'R','i','c','h','E','d','i','t','2',' #define EM_GETSCROLLPOS (WM_USER + 221) #define EM_SETSCROLLPOS (WM_USER + 222) -#define EM_SETFONTSIZE (WM_USER + 223) +#define EM_SETFONTSIZE (WM_USER + 223) #define EM_GETZOOM (WM_USER + 224) #define EM_SETZOOM (WM_USER + 225) /* New notifications */ -#define EN_MSGFILTER 0x0700 +#define EN_MSGFILTER 0x0700 #define EN_REQUESTRESIZE 0x0701 #define EN_SELCHANGE 0x0702 #define EN_DROPFILES 0x0703 diff --git a/include/rpcdce.h b/include/rpcdce.h index 02912b9f6fe..f6d6b64fa3f 100644 --- a/include/rpcdce.h +++ b/include/rpcdce.h @@ -83,7 +83,7 @@ typedef struct _RPC_IF_ID typedef RPC_STATUS RPC_ENTRY RPC_IF_CALLBACK_FN( RPC_IF_HANDLE InterfaceUuid, LPVOID Context ); typedef void (__RPC_USER *RPC_AUTH_KEY_RETRIEVAL_FN)(); -typedef struct _RPC_POLICY +typedef struct _RPC_POLICY { UINT Length; ULONG EndpointFlags; @@ -120,11 +120,11 @@ RPCRTAPI RPC_STATUS RPC_ENTRY RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerRegisterIf( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv ); - + RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerRegisterIfEx( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, UINT Flags, UINT MaxCalls, RPC_IF_CALLBACK_FN* IfCallbackFn ); - + RPCRTAPI RPC_STATUS RPC_ENTRY RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, RPC_MGR_EPV* MgrEpv, UINT Flags, UINT MaxCalls, UINT MaxRpcSize, RPC_IF_CALLBACK_FN* IfCallbackFn ); diff --git a/include/shellapi.h b/include/shellapi.h index e9a8470e989..223c1383208 100644 --- a/include/shellapi.h +++ b/include/shellapi.h @@ -33,7 +33,7 @@ DECLARE_HANDLE(HDROP); * DragObject */ -typedef struct _DRAGINFOA +typedef struct _DRAGINFOA { UINT uSize; POINT pt; BOOL fNC; @@ -41,7 +41,7 @@ typedef struct _DRAGINFOA DWORD grfKeyState; } DRAGINFOA, * LPDRAGINFOA; -typedef struct _DRAGINFOW +typedef struct _DRAGINFOW { UINT uSize; POINT pt; BOOL fNC; @@ -96,7 +96,7 @@ BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p); #define ABE_RIGHT 2 #define ABE_BOTTOM 3 -typedef struct _AppBarData +typedef struct _AppBarData { DWORD cbSize; HWND hWnd; UINT uCallbackMessage; @@ -131,7 +131,7 @@ UINT WINAPI SHAppBarMessage(DWORD,PAPPBARDATA); #define SHGFI_SELECTED 0x000010000 /* show icon in selected state */ #define SHGFI_ATTR_SPECIFIED 0x000020000 /* get only specified attributes */ -typedef struct tagSHFILEINFOA +typedef struct tagSHFILEINFOA { HICON hIcon; /* icon */ int iIcon; /* icon index */ DWORD dwAttributes; /* SFGAO_ flags */ @@ -139,7 +139,7 @@ typedef struct tagSHFILEINFOA CHAR szTypeName[80]; /* type name */ } SHFILEINFOA; -typedef struct tagSHFILEINFOW +typedef struct tagSHFILEINFOW { HICON hIcon; /* icon */ int iIcon; /* icon index */ DWORD dwAttributes; /* SFGAO_ flags */ @@ -167,21 +167,21 @@ DWORD WINAPI SHGetFileInfoW(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT); #define FOF_MULTIDESTFILES 0x0001 #define FOF_CONFIRMMOUSE 0x0002 -#define FOF_SILENT 0x0004 +#define FOF_SILENT 0x0004 #define FOF_RENAMEONCOLLISION 0x0008 -#define FOF_NOCONFIRMATION 0x0010 -#define FOF_WANTMAPPINGHANDLE 0x0020 +#define FOF_NOCONFIRMATION 0x0010 +#define FOF_WANTMAPPINGHANDLE 0x0020 #define FOF_ALLOWUNDO 0x0040 -#define FOF_FILESONLY 0x0080 -#define FOF_SIMPLEPROGRESS 0x0100 -#define FOF_NOCONFIRMMKDIR 0x0200 -#define FOF_NOERRORUI 0x0400 +#define FOF_FILESONLY 0x0080 +#define FOF_SIMPLEPROGRESS 0x0100 +#define FOF_NOCONFIRMMKDIR 0x0200 +#define FOF_NOERRORUI 0x0400 typedef WORD FILEOP_FLAGS; -#define PO_DELETE 0x0013 -#define PO_RENAME 0x0014 -#define PO_PORTCHANGE 0x0020 +#define PO_DELETE 0x0013 +#define PO_RENAME 0x0014 +#define PO_PORTCHANGE 0x0020 typedef WORD PRINTEROP_FLAGS; @@ -210,7 +210,7 @@ typedef struct _SHFILEOPSTRUCTW #define SHFILEOPSTRUCT WINELIB_NAME_AW(SHFILEOPSTRUCT) #define LPSHFILEOPSTRUCT WINELIB_NAME_AW(LPSHFILEOPSTRUCT) -DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp); +DWORD WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp); DWORD WINAPI SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp); #define SHFileOperation WINELIB_NAME_AW(SHFileOperation) diff --git a/include/shlobj.h b/include/shlobj.h index 6c1891d340d..74b9d5079ce 100644 --- a/include/shlobj.h +++ b/include/shlobj.h @@ -30,7 +30,7 @@ extern "C" { #endif /* defined(__cplusplus) */ /**************************************************************************** -* SHITEMID, ITEMIDLIST, PIDL API +* SHITEMID, ITEMIDLIST, PIDL API */ #include "pshpack1.h" typedef struct @@ -194,7 +194,7 @@ typedef struct _SHELLEXECUTEINFOA LPCSTR lpClass; HKEY hkeyClass; DWORD dwHotKey; - union + union { HANDLE hIcon; HANDLE hMonitor; } DUMMYUNIONNAME; @@ -261,7 +261,7 @@ typedef struct tagBROWSEINFOW { BFFCALLBACK lpfn; LPARAM lParam; INT iImage; -} BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW; +} BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW; #define BROWSEINFO WINELIB_NAME_AW(BROWSEINFO) #define PBROWSEINFO WINELIB_NAME_AW(PBROWSEINFO) @@ -274,7 +274,7 @@ typedef struct tagBROWSEINFOW { #define BIF_RETURNFSANCESTORS 0x0008 #define BIF_EDITBOX 0x0010 #define BIF_VALIDATE 0x0020 - + #define BIF_BROWSEFORCOMPUTER 0x1000 #define BIF_BROWSEFORPRINTER 0x2000 #define BIF_BROWSEINCLUDEFILES 0x4000 @@ -324,7 +324,7 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi); #define SHDID_NET_RESTOFNET 16 #define SHDID_NET_OTHER 17 -typedef struct _SHDESCRIPTIONID +typedef struct _SHDESCRIPTIONID { DWORD dwDescriptionId; CLSID clsid; } SHDESCRIPTIONID, *LPSHDESCRIPTIONID; @@ -349,7 +349,7 @@ HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDL * we got using SHCreateShellViewEx()), to notify us of the various things that * are happening to the shellview (and ask for things too). * -* You don't have to support anything here - anything you don't want to +* You don't have to support anything here - anything you don't want to * handle, the shell will do itself if you just return E_NOTIMPL. This parameters * that the shell passes to this function are entirely undocumented. * diff --git a/include/snoop.h b/include/snoop.h index 4cb2a15dcb3..d950258b23e 100644 --- a/include/snoop.h +++ b/include/snoop.h @@ -1,4 +1,4 @@ -/* +/* * Definitions for inter-dll snooping * * Copyright 1998 Marcus Meissner diff --git a/include/spy.h b/include/spy.h index 938a77c1ff4..cbbb38f8279 100644 --- a/include/spy.h +++ b/include/spy.h @@ -2,7 +2,7 @@ * Message Logging functions * * Copyright 1994 Bob Amstadt - * Copyright 1995 Alex Korobka + * Copyright 1995 Alex Korobka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/sql.h b/include/sql.h index 5cc4192769d..82a7979a722 100644 --- a/include/sql.h +++ b/include/sql.h @@ -638,7 +638,7 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength); -#endif +#endif SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); @@ -743,4 +743,4 @@ SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, #ifdef __cplusplus } #endif -#endif +#endif diff --git a/include/sqlext.h b/include/sqlext.h index 743cfb23692..906997b68ee 100644 --- a/include/sqlext.h +++ b/include/sqlext.h @@ -60,7 +60,7 @@ extern "C" { #define SQL_CP_STRICT_MATCH 0UL #define SQL_CP_RELAXED_MATCH 1UL -#define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH +#define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH #define SQL_OV_ODBC2 2UL #define SQL_OV_ODBC3 3UL @@ -139,7 +139,7 @@ extern "C" { #define SQL_DB_DEFAULT SQL_DB_RETURN_TO_POOL #define SQL_DTC_DONE 0L -#endif +#endif #define SQL_CD_TRUE 1L #define SQL_CD_FALSE 0L @@ -187,9 +187,9 @@ extern "C" { #define SQL_ATTR_ROW_OPERATION_PTR 24 #define SQL_ATTR_ROW_STATUS_PTR 25 #define SQL_ATTR_ROWS_FETCHED_PTR 26 -#define SQL_ATTR_ROW_ARRAY_SIZE 27 +#define SQL_ATTR_ROW_ARRAY_SIZE 27 #define SQL_ATTR_SIMULATE_CURSOR SQL_SIMULATE_CURSOR -#define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS +#define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS #endif @@ -303,13 +303,13 @@ extern "C" { #if (ODBCVER >= 0x0300) #define SQL_DIAG_CURSOR_ROW_COUNT (-1249) #define SQL_DIAG_ROW_NUMBER (-1248) -#define SQL_DIAG_COLUMN_NUMBER (-1247) +#define SQL_DIAG_COLUMN_NUMBER (-1247) #endif #define SQL_DATE 9 #if (ODBCVER >= 0x0300) #define SQL_INTERVAL 10 -#endif +#endif #define SQL_TIME 10 #define SQL_TIMESTAMP 11 #define SQL_LONGVARCHAR (-1) @@ -321,7 +321,7 @@ extern "C" { #define SQL_BIT (-7) #if (ODBCVER >= 0x0350) #define SQL_GUID (-11) -#endif +#endif #if (ODBCVER >= 0x0300) #define SQL_CODE_YEAR 1 @@ -434,7 +434,7 @@ extern "C" { #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) -#define SQL_C_BOOKMARK SQL_C_ULONG +#define SQL_C_BOOKMARK SQL_C_ULONG #if (ODBCVER >= 0x0350) #define SQL_C_GUID SQL_GUID @@ -554,7 +554,7 @@ extern "C" { #endif -#define SQL_INFO_FIRST 0 +#define SQL_INFO_FIRST 0 #define SQL_ACTIVE_CONNECTIONS 0 #define SQL_ACTIVE_STATEMENTS 1 #define SQL_DRIVER_HDBC 3 @@ -682,7 +682,7 @@ extern "C" { #define SQL_DROP_VIEW 143 #define SQL_DYNAMIC_CURSOR_ATTRIBUTES1 144 #define SQL_DYNAMIC_CURSOR_ATTRIBUTES2 145 -#define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146 +#define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146 #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 147 #define SQL_INDEX_KEYWORDS 148 #define SQL_INFO_SCHEMA_VIEWS 149 @@ -695,8 +695,8 @@ extern "C" { #define SQL_SCHEMA_TERM SQL_OWNER_TERM #define SQL_SCHEMA_USAGE SQL_OWNER_USAGE #define SQL_SQL92_DATETIME_FUNCTIONS 155 -#define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156 -#define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157 +#define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156 +#define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157 #define SQL_SQL92_GRANT 158 #define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 159 #define SQL_SQL92_PREDICATES 160 @@ -706,7 +706,7 @@ extern "C" { #define SQL_SQL92_STRING_FUNCTIONS 164 #define SQL_SQL92_VALUE_EXPRESSIONS 165 #define SQL_STANDARD_CLI_CONFORMANCE 166 -#define SQL_STATIC_CURSOR_ATTRIBUTES1 167 +#define SQL_STATIC_CURSOR_ATTRIBUTES1 167 #define SQL_STATIC_CURSOR_ATTRIBUTES2 168 #define SQL_AGGREGATE_FUNCTIONS 169 @@ -720,16 +720,16 @@ extern "C" { #if (ODBCVER >= 0x0300) -#define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L +#define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L -#define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L -#define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L -#define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L +#define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L +#define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L +#define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L @@ -799,7 +799,7 @@ extern "C" { #endif #if (ODBCVER >= 0x0300) -#define SQL_SSF_CONVERT 0x00000001L +#define SQL_SSF_CONVERT 0x00000001L #define SQL_SSF_LOWER 0x00000002L #define SQL_SSF_UPPER 0x00000004L #define SQL_SSF_SUBSTRING 0x00000008L @@ -841,7 +841,7 @@ extern "C" { #define SQL_SNVF_EXTRACT 0x00000008L #define SQL_SNVF_OCTET_LENGTH 0x00000010L #define SQL_SNVF_POSITION 0x00000020L -#endif +#endif #define SQL_FN_TD_NOW 0x00000001L #define SQL_FN_TD_CURDATE 0x00000002L @@ -871,7 +871,7 @@ extern "C" { #define SQL_SDF_CURRENT_DATE 0x00000001L #define SQL_SDF_CURRENT_TIME 0x00000002L #define SQL_SDF_CURRENT_TIMESTAMP 0x00000004L -#endif +#endif #define SQL_FN_SYS_USERNAME 0x00000001L #define SQL_FN_SYS_DBNAME 0x00000002L @@ -1064,7 +1064,7 @@ extern "C" { #define SQL_AF_MIN 0x00000008L #define SQL_AF_SUM 0x00000010L #define SQL_AF_DISTINCT 0x00000020L -#define SQL_AF_ALL 0x00000040L +#define SQL_AF_ALL 0x00000040L #define SQL_SC_SQL92_ENTRY 0x00000001L #define SQL_SC_FIPS127_2_TRANSITIONAL 0x00000002L @@ -1104,7 +1104,7 @@ extern "C" { #define SQL_PARC_NO_BATCH 2 #define SQL_PAS_BATCH 1 -#define SQL_PAS_NO_BATCH 2 +#define SQL_PAS_NO_BATCH 2 #define SQL_PAS_NO_SELECT 3 #define SQL_IK_NONE 0x00000000L @@ -1140,7 +1140,7 @@ extern "C" { #define SQL_AM_CONNECTION 1 #define SQL_AM_STATEMENT 2 -#define SQL_AD_CONSTRAINT_NAME_DEFINITION 0x00000001L +#define SQL_AD_CONSTRAINT_NAME_DEFINITION 0x00000001L #define SQL_AD_ADD_DOMAIN_CONSTRAINT 0x00000002L #define SQL_AD_DROP_DOMAIN_CONSTRAINT 0x00000004L #define SQL_AD_ADD_DOMAIN_DEFAULT 0x00000008L @@ -1250,7 +1250,7 @@ extern "C" { #define SQL_SG_REFERENCES_COLUMN 0x00000200L #define SQL_SG_SELECT_TABLE 0x00000400L #define SQL_SG_UPDATE_TABLE 0x00000800L -#define SQL_SG_UPDATE_COLUMN 0x00001000L +#define SQL_SG_UPDATE_COLUMN 0x00001000L #define SQL_SP_EXISTS 0x00000001L #define SQL_SP_ISNOTNULL 0x00000002L @@ -1318,7 +1318,7 @@ extern "C" { #if (ODBCVER >= 0x0300) #define SQL_FETCH_FIRST_USER 31 #define SQL_FETCH_FIRST_SYSTEM 32 -#endif +#endif #define SQL_ENTIRE_ROWSET 0 @@ -1593,12 +1593,12 @@ SQLRETURN WINAPI SQLBindParameter( #define SQL_DAY SQL_CODE_DAY #define SQL_HOUR SQL_CODE_HOUR #define SQL_MINUTE SQL_CODE_MINUTE -#define SQL_SECOND SQL_CODE_SECOND +#define SQL_SECOND SQL_CODE_SECOND #define SQL_YEAR_TO_MONTH SQL_CODE_YEAR_TO_MONTH #define SQL_DAY_TO_HOUR SQL_CODE_DAY_TO_HOUR #define SQL_DAY_TO_MINUTE SQL_CODE_DAY_TO_MINUTE #define SQL_DAY_TO_SECOND SQL_CODE_DAY_TO_SECOND -#define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE +#define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE #define SQL_HOUR_TO_SECOND SQL_CODE_HOUR_TO_SECOND #define SQL_MINUTE_TO_SECOND SQL_CODE_MINUTE_TO_SECOND #endif @@ -1621,7 +1621,7 @@ SQLRETURN WINAPI SQLAllocHandleStd( #define SQL_CR_CLOSE SQL_CB_CLOSE #define SQL_CC_PRESERVE SQL_CB_PRESERVE #define SQL_CR_PRESERVE SQL_CB_PRESERVE -#define SQL_SCROLL_FORWARD_ONLY 0L +#define SQL_SCROLL_FORWARD_ONLY 0L #define SQL_SCROLL_KEYSET_DRIVEN (-1L) #define SQL_SCROLL_DYNAMIC (-2L) #define SQL_SCROLL_STATIC (-3L) @@ -1640,9 +1640,9 @@ VOID TraceReturn(RETCODE,RETCODE); DWORD TraceVersion(); /*#define TRACE_ON 0x00000001L*/ -#define TRACE_VS_EVENT_ON 0x00000002L +#define TRACE_VS_EVENT_ON 0x00000002L -RETCODE TraceVSControl(DWORD); +RETCODE TraceVSControl(DWORD); #define ODBC_VS_FLAG_UNICODE_ARG 0x00000001L #define ODBC_VS_FLAG_UNICODE_COR 0x00000002L @@ -1653,7 +1653,7 @@ typedef struct tagODBC_VS_ARGS { const GUID *pguidEvent; DWORD dwFlags; union { - WCHAR *wszArg; + WCHAR *wszArg; CHAR *szArg; } DUMMYUNIONNAME1; union { diff --git a/include/storage.h b/include/storage.h index 665187add62..ade3fd124f9 100644 --- a/include/storage.h +++ b/include/storage.h @@ -20,7 +20,7 @@ #define __WINE_STORAGE_H /* "storage.h" is obsolete, you should include "objbase.h" instead */ - + #include "objbase.h" #endif diff --git a/include/tapi.h b/include/tapi.h index ffc8ef56bf3..f64a911c534 100644 --- a/include/tapi.h +++ b/include/tapi.h @@ -1,6 +1,6 @@ /* * TAPI definitions - * + * * Copyright (c) 1999 Andreas Mohr * * This library is free software; you can redistribute it and/or @@ -359,7 +359,7 @@ typedef struct lineforwardlist_tag { DWORD dwNumEntries; LINEFORWARD ForwardList[1]; } LINEFORWARDLIST, *LPLINEFORWARDLIST; - + typedef struct linegeneratetone_tag { DWORD dwFrequency; DWORD dwCadenceOn; diff --git a/include/task.h b/include/task.h index 686552300c8..a4fc2007282 100644 --- a/include/task.h +++ b/include/task.h @@ -73,8 +73,8 @@ typedef void (CALLBACK *USERSIGNALPROC)(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16); /* Task database. See 'Windows Internals' p. 226. - * Note that 16-bit OLE 2 libs like to read it directly - * so we have to keep entry offsets as they are. + * Note that 16-bit OLE 2 libs like to read it directly + * so we have to keep entry offsets as they are. */ typedef struct _TDB { diff --git a/include/tchar.h b/include/tchar.h index 01de609f776..deead02c83b 100644 --- a/include/tchar.h +++ b/include/tchar.h @@ -220,9 +220,9 @@ DECL_WINELIB_TYPE_AW(_TCHAR) typedef UCHAR _TUCHARA; typedef WCHAR _TUCHARW; DECL_WINELIB_TYPE_AW(_TUCHAR) - + #ifdef __cplusplus } /* extern "C" */ #endif - + #endif /* __WINE_TCHAR_H */ diff --git a/include/thread.h b/include/thread.h index 18aa4aec3c6..44648ab9bb2 100644 --- a/include/thread.h +++ b/include/thread.h @@ -54,7 +54,7 @@ typedef struct _TEB WORD stack_sel; /* 1-- 0e 16-bit stack selector */ DWORD selman_list; /* 1-n 10 Selector manager list */ DWORD user_ptr; /* 12n 14 User pointer */ -/* end of NT_TIB */ +/* end of NT_TIB */ struct _TEB *self; /* 12- 18 Pointer to this structure */ WORD tibflags; /* 1!n 1c Flags (NT: EnvironmentPointer) */ WORD mutex_count; /* 1-n 1e Win16 mutex count */ diff --git a/include/tlhelp32.h b/include/tlhelp32.h index 14633982076..e0fa17615e1 100644 --- a/include/tlhelp32.h +++ b/include/tlhelp32.h @@ -37,54 +37,54 @@ extern "C" { HANDLE WINAPI CreateToolhelp32Snapshot(DWORD,DWORD); /* - * thread entry list as created by CreateToolHelp32Snapshot + * thread entry list as created by CreateToolHelp32Snapshot */ typedef struct tagTHREADENTRY32 { - DWORD dwSize; - DWORD cntUsage; - DWORD th32ThreadID; - DWORD th32OwnerProcessID; - LONG tpBasePri; - LONG tpDeltaPri; - DWORD dwFlags; -} THREADENTRY32, *PTHREADENTRY32, *LPTHREADENTRY32; + DWORD dwSize; + DWORD cntUsage; + DWORD th32ThreadID; + DWORD th32OwnerProcessID; + LONG tpBasePri; + LONG tpDeltaPri; + DWORD dwFlags; +} THREADENTRY32, *PTHREADENTRY32, *LPTHREADENTRY32; BOOL WINAPI Thread32First(HANDLE,LPTHREADENTRY32); BOOL WINAPI Thread32Next(HANDLE,LPTHREADENTRY32); /* - * Process entry list as created by CreateToolHelp32Snapshot + * Process entry list as created by CreateToolHelp32Snapshot */ typedef struct tagPROCESSENTRY32 { - DWORD dwSize; - DWORD cntUsage; - DWORD th32ProcessID; - DWORD th32DefaultHeapID; - DWORD th32ModuleID; - DWORD cntThreads; - DWORD th32ParentProcessID; - LONG pcPriClassBase; - DWORD dwFlags; - char szExeFile[MAX_PATH]; -} PROCESSENTRY32, *PPROCESSENTRY32, *LPPROCESSENTRY32; + DWORD dwSize; + DWORD cntUsage; + DWORD th32ProcessID; + DWORD th32DefaultHeapID; + DWORD th32ModuleID; + DWORD cntThreads; + DWORD th32ParentProcessID; + LONG pcPriClassBase; + DWORD dwFlags; + char szExeFile[MAX_PATH]; +} PROCESSENTRY32, *PPROCESSENTRY32, *LPPROCESSENTRY32; typedef struct tagPROCESSENTRY32W { - DWORD dwSize; - DWORD cntUsage; - DWORD th32ProcessID; - DWORD th32DefaultHeapID; - DWORD th32ModuleID; - DWORD cntThreads; - DWORD th32ParentProcessID; - LONG pcPriClassBase; - DWORD dwFlags; - WCHAR szExeFile[MAX_PATH]; -} PROCESSENTRY32W, *PPROCESSENTRY32W, *LPPROCESSENTRY32W; + DWORD dwSize; + DWORD cntUsage; + DWORD th32ProcessID; + DWORD th32DefaultHeapID; + DWORD th32ModuleID; + DWORD cntThreads; + DWORD th32ParentProcessID; + LONG pcPriClassBase; + DWORD dwFlags; + WCHAR szExeFile[MAX_PATH]; +} PROCESSENTRY32W, *PPROCESSENTRY32W, *LPPROCESSENTRY32W; BOOL WINAPI Process32First(HANDLE,LPPROCESSENTRY32); BOOL WINAPI Process32FirstW(HANDLE,LPPROCESSENTRY32W); @@ -100,38 +100,38 @@ BOOL WINAPI Process32NextW(HANDLE,LPPROCESSENTRY32W); #endif /* - * Module entry list as created by CreateToolHelp32Snapshot + * Module entry list as created by CreateToolHelp32Snapshot */ #define MAX_MODULE_NAME32 255 typedef struct tagMODULEENTRY32 { - DWORD dwSize; + DWORD dwSize; DWORD th32ModuleID; - DWORD th32ProcessID; + DWORD th32ProcessID; DWORD GlblcntUsage; DWORD ProccntUsage; BYTE *modBaseAddr; DWORD modBaseSize; DWORD hModule; char szModule[MAX_MODULE_NAME32 + 1]; - char szExePath[MAX_PATH]; -} MODULEENTRY32, *PMODULEENTRY32, *LPMODULEENTRY32; + char szExePath[MAX_PATH]; +} MODULEENTRY32, *PMODULEENTRY32, *LPMODULEENTRY32; typedef struct tagMODULEENTRY32W { - DWORD dwSize; + DWORD dwSize; DWORD th32ModuleID; - DWORD th32ProcessID; + DWORD th32ProcessID; DWORD GlblcntUsage; DWORD ProccntUsage; BYTE *modBaseAddr; DWORD modBaseSize; DWORD hModule; WCHAR szModule[MAX_MODULE_NAME32 + 1]; - WCHAR szExePath[MAX_PATH]; -} MODULEENTRY32W, *PMODULEENTRY32W, *LPMODULEENTRY32W; + WCHAR szExePath[MAX_PATH]; +} MODULEENTRY32W, *PMODULEENTRY32W, *LPMODULEENTRY32W; BOOL WINAPI Module32First(HANDLE,LPMODULEENTRY32); BOOL WINAPI Module32FirstW(HANDLE,LPMODULEENTRY32W); diff --git a/include/ver.h b/include/ver.h index 65ebd618606..b22460888df 100644 --- a/include/ver.h +++ b/include/ver.h @@ -1,5 +1,5 @@ /* Definitions for the VERsion infolibrary (VER.DLL) - * + * * Copyright 1996 Marcus Meissner * * This library is free software; you can redistribute it and/or diff --git a/include/vfw.h b/include/vfw.h index 4bc7ae0ed45..cb900222275 100644 --- a/include/vfw.h +++ b/include/vfw.h @@ -401,7 +401,7 @@ DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,L LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2); -inline static LRESULT VFWAPI ICDecompressEx(HIC hic, DWORD dwFlags, +inline static LRESULT VFWAPI ICDecompressEx(HIC hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiSrc, LPVOID lpSrc, int xSrc, int ySrc, int dxSrc, int dySrc, LPBITMAPINFOHEADER lpbiDst, LPVOID lpDst, @@ -501,7 +501,7 @@ inline static LRESULT VFWAPI ICDecompressExQuery(HIC hic, DWORD dwFlags, #define ICDrawOpen(fccType, fccHandler, lpbiIn) \ ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW) -HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, +HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality, LONG* plSize); @@ -625,7 +625,7 @@ DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,DWORD c inline static LRESULT VFWAPI ICDrawSuggestFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, - int dxSrc, int dySrc, + int dxSrc, int dySrc, int dxDst, int dyDst, HIC hicDecomp) { @@ -819,7 +819,7 @@ typedef struct { WORD wPriority; WORD wLanguage; DWORD dwInitialFrames; - DWORD dwScale; + DWORD dwScale; DWORD dwRate; /* dwRate / dwScale == samples/second */ DWORD dwStart; DWORD dwLength; /* In units above... */ @@ -924,7 +924,7 @@ typedef struct _AVIFILEINFOW { DWORD dwSuggestedBufferSize; DWORD dwWidth; DWORD dwHeight; - DWORD dwScale; + DWORD dwScale; DWORD dwRate; DWORD dwLength; DWORD dwEditCount; @@ -938,7 +938,7 @@ typedef struct _AVIFILEINFOA { DWORD dwSuggestedBufferSize; DWORD dwWidth; DWORD dwHeight; - DWORD dwScale; + DWORD dwScale; DWORD dwRate; DWORD dwLength; DWORD dwEditCount; @@ -1020,7 +1020,7 @@ ICOM_DEFINE(IAVIStream, IUnknown) #define IAVIStream_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c) #define IAVIStream_SetInfo(p,a,b) ICOM_CALL2(SetInfo,p,a,b) -HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *lpOptions,CLSID*pclsidHandler); +HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *lpOptions,CLSID*pclsidHandler); HRESULT WINAPI AVIStreamCreate(PAVISTREAM*,LONG,LONG,CLSID*); HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG size); @@ -1047,7 +1047,7 @@ HRESULT WINAPI AVIStreamOpenFromFileW(PAVISTREAM *ppavi, LPCWSTR szFile, #define AVIStreamOpenFromFile WINELIB_NAME_AW(AVIStreamOpenFromFile) #define AVIStreamFormatSize(pavi, lPos, plSize) \ - AVIStreamReadFormat(pavi, lPos, NULL, plSize) + AVIStreamReadFormat(pavi, lPos, NULL, plSize) /***************************************************************************** * IAVIFile interface @@ -1378,7 +1378,7 @@ BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst, LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags); BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst, - LPBITMAPINFOHEADER lpbi, LPVOID lpBits, + LPBITMAPINFOHEADER lpbi, LPVOID lpBits, INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags); /* DrawDibDraw flags */ diff --git a/include/winbase.h b/include/winbase.h index 19447c31f7d..8de1617f793 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -371,9 +371,9 @@ typedef struct #define CLRBREAK 9 /* Purge functions for Comm Port */ -#define PURGE_TXABORT 0x0001 /* Kill the pending/current writes to the +#define PURGE_TXABORT 0x0001 /* Kill the pending/current writes to the comm port */ -#define PURGE_RXABORT 0x0002 /*Kill the pending/current reads to +#define PURGE_RXABORT 0x0002 /*Kill the pending/current reads to the comm port */ #define PURGE_TXCLEAR 0x0004 /* Kill the transmit queue if there*/ #define PURGE_RXCLEAR 0x0008 /* Kill the typeahead buffer if there*/ @@ -395,7 +395,7 @@ typedef struct #define DTR_CONTROL_HANDSHAKE 2 -#define LMEM_FIXED 0 +#define LMEM_FIXED 0 #define LMEM_MOVEABLE 0x0002 #define LMEM_NOCOMPACT 0x0010 #define LMEM_NODISCARD 0x0020 @@ -694,10 +694,10 @@ typedef struct _LDT_ENTRY { struct { BYTE BaseMid; BYTE Flags1;/*Declare as bytes to avoid alignment problems */ - BYTE Flags2; + BYTE Flags2; BYTE BaseHi; } Bytes; - struct { + struct { unsigned BaseMid : 8; unsigned Type : 5; unsigned Dpl : 2; @@ -730,7 +730,7 @@ typedef struct _WIN32_FILE_ATTRIBUTES_DATA { * This one seems to be a Win32 only definition. It also is defined with * WINAPI instead of CALLBACK in the windows headers. */ -typedef DWORD (CALLBACK *LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, +typedef DWORD (CALLBACK *LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, DWORD, DWORD, HANDLE, HANDLE, LPVOID); @@ -1363,7 +1363,7 @@ BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPWSTR,LPDWORD,LPWSTR,LPDWORD, #define LookupAccountSid WINELIB_NAME_AW(LookupAccountSid) BOOL WINAPI LocalFileTimeToFileTime(const FILETIME*,LPFILETIME); BOOL WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD); -BOOL WINAPI LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED); +BOOL WINAPI LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED); BOOL WINAPI LookupPrivilegeValueA(LPCSTR,LPCSTR,LPVOID); BOOL WINAPI LookupPrivilegeValueW(LPCWSTR,LPCWSTR,LPVOID); #define LookupPrivilegeValue WINELIB_NAME_AW(LookupPrivilegeValue) diff --git a/include/windowsx.h b/include/windowsx.h index be08c7ac80d..545d081ea46 100644 --- a/include/windowsx.h +++ b/include/windowsx.h @@ -17,7 +17,7 @@ #ifndef _INC_WINDOWSX #define _INC_WINDOWSX - + #ifdef __cplusplus extern "C" { #endif @@ -239,7 +239,7 @@ extern "C" { ((int)SendMessage((hwndCtl), CB_ADDSTRING, 0L, (LPARAM)(LPCTSTR)(data))) #define ComboBox_AddString(hwndCtl, lpsz) \ - ((int)SendMessage((hwndCtl), CB_ADDSTRING, 0L, (LPARAM)(LPCTSTR)(lpsz))) + ((int)SendMessage((hwndCtl), CB_ADDSTRING, 0L, (LPARAM)(LPCTSTR)(lpsz))) #define ComboBox_DeleteString(hwndCtl, index) \ ((int)SendMessage((hwndCtl), CB_DELETESTRING, (WPARAM)(int)(index), 0L)) @@ -254,7 +254,7 @@ extern "C" { ((int)SendMessage((hwndCtl), CB_FINDSTRING, (WPARAM)(int)(indexStart), (LPARAM)(data))) #define ComboBox_FindString(hwndCtl, indexStart, lpszFind) \ - ((int)SendMessage((hwndCtl), CB_FINDSTRING, (WPARAM)(int)(indexStart), (LPARAM)(LPCTSTR)(lpszFind))) + ((int)SendMessage((hwndCtl), CB_FINDSTRING, (WPARAM)(int)(indexStart), (LPARAM)(LPCTSTR)(lpszFind))) #define ComboBox_FindStringExact(hwndCtl, indexStart, lpszFind) \ ((int)SendMessage((hwndCtl), CB_FINDSTRINGEXACT, (WPARAM)(int)(indexStart), (LPARAM)(LPCTSTR)(lpszFind))) @@ -1384,7 +1384,7 @@ extern "C" { #define FORWARD_WM_DRAWITEM(hwnd, lpDrawItem, fn) \ (void)(fn)((hwnd), WM_DRAWITEM, (WPARAM)(((const DRAWITEMSTRUCT *)lpDrawItem)->CtlID), (LPARAM)(const DRAWITEMSTRUCT *)(lpDrawItem)) - + /****** C runtime porting macros ****************************************/ #define _ncalloc calloc @@ -1432,6 +1432,6 @@ extern "C" { #ifdef __cplusplus } #endif - + #endif diff --git a/include/wine/icmpapi.h b/include/wine/icmpapi.h index 98cbf132743..ba8fab0d735 100644 --- a/include/wine/icmpapi.h +++ b/include/wine/icmpapi.h @@ -1,7 +1,7 @@ /* * Interface to the ICMP functions. * - * This header is not part of the standard headers, it is usually + * This header is not part of the standard headers, it is usually * delivered separately and this is why it is not directly in 'include'. * * Depends on ipexport.h (there is no include directive in the original) diff --git a/include/wine/ipexport.h b/include/wine/ipexport.h index 9df85fb1ca0..371404e90dd 100644 --- a/include/wine/ipexport.h +++ b/include/wine/ipexport.h @@ -1,7 +1,7 @@ /* * Defines the types and macros used by the ICMP API, see icmpapi.h. * - * This header is not part of the standard headers, it is usually + * This header is not part of the standard headers, it is usually * delivered separately and this is why it is not directly in 'include'. * * Copyright (C) 1999 Francois Gouget diff --git a/include/wine/obj_base.h b/include/wine/obj_base.h index 817f56d7614..57f2e795b53 100644 --- a/include/wine/obj_base.h +++ b/include/wine/obj_base.h @@ -1,5 +1,5 @@ /* - * This file defines the macros and types necessary to define COM interfaces, + * This file defines the macros and types necessary to define COM interfaces, * and the three most basic COM interfaces: IUnknown, IMalloc and IClassFactory. * * Copyright (C) 1999 Francois Gouget @@ -38,7 +38,7 @@ * * The preferable method for using ICOM_USE_COM_INTERFACE_ATTRIBUTE macro * would be to define it only for your Winelib application. This allows you - * to have both binary and Winelib compatibility for C and C++ at the same + * to have both binary and Winelib compatibility for C and C++ at the same * time :) */ /* #define ICOM_MSVTABLE_COMPAT 1 */ @@ -85,26 +85,26 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax); * Macros to define a COM interface */ /* - * The goal of the following set of definitions is to provide a way to use the same - * header file definitions to provide both a C interface and a C++ object oriented - * interface to COM interfaces. The type of interface is selected automatically - * depending on the language but it is always possible to get the C interface in C++ + * The goal of the following set of definitions is to provide a way to use the same + * header file definitions to provide both a C interface and a C++ object oriented + * interface to COM interfaces. The type of interface is selected automatically + * depending on the language but it is always possible to get the C interface in C++ * by defining CINTERFACE. * * It is based on the following assumptions: * - all COM interfaces derive from IUnknown, this should not be a problem. - * - the header file only defines the interface, the actual fields are defined + * - the header file only defines the interface, the actual fields are defined * separately in the C file implementing the interface. * - * The natural approach to this problem would be to make sure we get a C++ class and + * The natural approach to this problem would be to make sure we get a C++ class and * virtual methods in C++ and a structure with a table of pointer to functions in C. - * Unfortunately the layout of the virtual table is compiler specific, the layout of - * g++ virtual tables is not the same as that of an egcs virtual table which is not the - * same as that generated by Visual C+. There are workarounds to make the virtual tables + * Unfortunately the layout of the virtual table is compiler specific, the layout of + * g++ virtual tables is not the same as that of an egcs virtual table which is not the + * same as that generated by Visual C+. There are workarounds to make the virtual tables * compatible via padding but unfortunately the one which is imposed to the WINE emulator * by the Windows binaries, i.e. the Visual C++ one, is the most compact of all. * - * So the solution I finally adopted does not use virtual tables. Instead I use inline + * So the solution I finally adopted does not use virtual tables. Instead I use inline * non virtual methods that dereference the method pointer themselves and perform the call. * * Let's take Direct3D as an example: @@ -138,41 +138,41 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax); * #endif * * Comments: - * - The ICOM_INTERFACE macro is used in the ICOM_METHOD macros to define the type of the 'this' - * pointer. Defining this macro here saves us the trouble of having to repeat the interface - * name everywhere. Note however that because of the way macros work, a macro like ICOM_METHOD1 - * cannot use 'ICOM_INTERFACE##_VTABLE' because this would give 'ICOM_INTERFACE_VTABLE' and not + * - The ICOM_INTERFACE macro is used in the ICOM_METHOD macros to define the type of the 'this' + * pointer. Defining this macro here saves us the trouble of having to repeat the interface + * name everywhere. Note however that because of the way macros work, a macro like ICOM_METHOD1 + * cannot use 'ICOM_INTERFACE##_VTABLE' because this would give 'ICOM_INTERFACE_VTABLE' and not * 'IDirect3D_VTABLE'. - * - ICOM_METHODS defines the methods specific to this interface. It is then aggregated with the + * - ICOM_METHODS defines the methods specific to this interface. It is then aggregated with the * inherited methods to form ICOM_IMETHODS. - * - ICOM_IMETHODS defines the list of methods that are inheritable from this interface. It must - * be written manually (rather than using a macro to generate the equivalent code) to avoid + * - ICOM_IMETHODS defines the list of methods that are inheritable from this interface. It must + * be written manually (rather than using a macro to generate the equivalent code) to avoid * macro recursion (which compilers don't like). - * - The ICOM_DEFINE finally declares all the structures necessary for the interface. We have to + * - The ICOM_DEFINE finally declares all the structures necessary for the interface. We have to * explicitly use the interface name for macro expansion reasons again. - * Inherited methods are inherited in C by using the IDirect3D_METHODS macro and the parent's - * Xxx_IMETHODS macro. In C++ we need only use the IDirect3D_METHODS since method inheritance + * Inherited methods are inherited in C by using the IDirect3D_METHODS macro and the parent's + * Xxx_IMETHODS macro. In C++ we need only use the IDirect3D_METHODS since method inheritance * is taken care of by the language. - * - In C++ the ICOM_METHOD macros generate a function prototype and a call to a function pointer - * method. This means using once 't1 p1, t2 p2, ...' and once 'p1, p2' without the types. The - * only way I found to handle this is to have one ICOM_METHOD macro per number of parameters and + * - In C++ the ICOM_METHOD macros generate a function prototype and a call to a function pointer + * method. This means using once 't1 p1, t2 p2, ...' and once 'p1, p2' without the types. The + * only way I found to handle this is to have one ICOM_METHOD macro per number of parameters and * to have it take only the type information (with const if necessary) as parameters. - * The 'undef ICOM_INTERFACE' is here to remind you that using ICOM_INTERFACE in the following - * macros will not work. This time it's because the ICOM_CALL macro expansion is done only once - * the 'IDirect3D_Xxx' macro is expanded. And by that time ICOM_INTERFACE will be long gone + * The 'undef ICOM_INTERFACE' is here to remind you that using ICOM_INTERFACE in the following + * macros will not work. This time it's because the ICOM_CALL macro expansion is done only once + * the 'IDirect3D_Xxx' macro is expanded. And by that time ICOM_INTERFACE will be long gone * anyway. - * - You may have noticed the double commas after each parameter type. This allows you to put the - * name of that parameter which I think is good for documentation. It is not required and since - * I did not know what to put there for this example (I could only find doc about IDirect3D2), + * - You may have noticed the double commas after each parameter type. This allows you to put the + * name of that parameter which I think is good for documentation. It is not required and since + * I did not know what to put there for this example (I could only find doc about IDirect3D2), * I left them blank. - * - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access - * to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate - * the inherited method definitions there. This time I could have used a trick to use only one + * - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access + * to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate + * the inherited method definitions there. This time I could have used a trick to use only one * macro whatever the number of parameters but I prefered to have it work the same way as above. - * - You probably have noticed that we don't define the fields we need to actually implement this - * interface: reference count, pointer to other resources and miscellaneous fields. That's - * because these interfaces are just that: interfaces. They may be implemented more than once, in - * different contexts and sometimes not even in Wine. Thus it would not make sense to impose + * - You probably have noticed that we don't define the fields we need to actually implement this + * interface: reference count, pointer to other resources and miscellaneous fields. That's + * because these interfaces are just that: interfaces. They may be implemented more than once, in + * different contexts and sometimes not even in Wine. Thus it would not make sense to impose * that the interface contains some specific fields. * * @@ -191,7 +191,7 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax); * HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b); * HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b); * HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b); - * }; + * }; * * #ifdef ICOM_CINTERFACE * // *** IUnknown methods *** // @@ -208,20 +208,20 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax); * #endif * * Comments: - * - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing - * the user needs to know to use the interface. Of course the structure we will define to + * - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing + * the user needs to know to use the interface. Of course the structure we will define to * implement this interface will have more fields but the first one will match this pointer. - * - The code generated by ICOM_DEFINE defines both the structure representing the interface and - * the structure for the jump table. ICOM_DEFINE uses the parent's Xxx_IMETHODS macro to - * automatically repeat the prototypes of all the inherited methods and then uses IDirect3D_METHODS + * - The code generated by ICOM_DEFINE defines both the structure representing the interface and + * the structure for the jump table. ICOM_DEFINE uses the parent's Xxx_IMETHODS macro to + * automatically repeat the prototypes of all the inherited methods and then uses IDirect3D_METHODS * to define the IDirect3D methods. - * - Each method is declared as a pointer to function field in the jump table. The implementation - * will fill this jump table with appropriate values, probably using a static variable, and + * - Each method is declared as a pointer to function field in the jump table. The implementation + * will fill this jump table with appropriate values, probably using a static variable, and * initialize the lpVtbl field to point to this variable. - * - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer - * corresponding to the macro name. This emulates the behavior of a virtual table and should be + * - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer + * corresponding to the macro name. This emulates the behavior of a virtual table and should be * just as fast. - * - This C code should be quite compatible with the Windows headers both for code that uses COM + * - This C code should be quite compatible with the Windows headers both for code that uses COM * interfaces and for code implementing a COM interface. * * @@ -245,31 +245,31 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax); * private: HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b); * public: inline HRESULT FindDevice(LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b) * { return ((IDirect3D*)t.lpVtbl)->FindDevice(this,a,b); }; - * }; + * }; * * Comments: - * - In C++ IDirect3D does double duty as both the virtual/jump table and as the interface - * definition. The reason for this is to avoid having to duplicate the mehod definitions: once - * to have the function pointers in the jump table and once to have the methods in the interface - * class. Here one macro can generate both. This means though that the first pointer, t.lpVtbl - * defined in IUnknown, must be interpreted as the jump table pointer if we interpret the - * structure as the the interface class, and as the function pointer to the QueryInterface - * method, t.QueryInterface, if we interpret the structure as the jump table. Fortunately this + * - In C++ IDirect3D does double duty as both the virtual/jump table and as the interface + * definition. The reason for this is to avoid having to duplicate the mehod definitions: once + * to have the function pointers in the jump table and once to have the methods in the interface + * class. Here one macro can generate both. This means though that the first pointer, t.lpVtbl + * defined in IUnknown, must be interpreted as the jump table pointer if we interpret the + * structure as the the interface class, and as the function pointer to the QueryInterface + * method, t.QueryInterface, if we interpret the structure as the jump table. Fortunately this * gymnastic is entirely taken care of in the header of IUnknown. - * - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions. - * - Since IDirect3D does double duty, each ICOM_METHOD macro defines both a function pointer and - * a non-vritual inline method which dereferences it and calls it. This way this method behaves - * just like a virtual method but does not create a true C++ virtual table which would break the - * structure layout. If you look at the implementation of these methods you'll notice that they - * would not work for void functions. We have to return something and fortunately this seems to + * - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions. + * - Since IDirect3D does double duty, each ICOM_METHOD macro defines both a function pointer and + * a non-vritual inline method which dereferences it and calls it. This way this method behaves + * just like a virtual method but does not create a true C++ virtual table which would break the + * structure layout. If you look at the implementation of these methods you'll notice that they + * would not work for void functions. We have to return something and fortunately this seems to * be what all the COM methods do (otherwise we would need another set of macros). - * - Note how the ICOM_METHOD generates both function prototypes mixing types and formal parameter - * names and the method invocation using only the formal parameter name. This is the reason why + * - Note how the ICOM_METHOD generates both function prototypes mixing types and formal parameter + * names and the method invocation using only the formal parameter name. This is the reason why * we need different macros to handle different numbers of parameters. - * - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE + * - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE * macro is defined in which case we would not be here. - * - This C++ code works well for code that just uses COM interfaces. But it will not work with - * C++ code implement a COM interface. That's because such code assumes the interface methods + * - This C++ code works well for code that just uses COM interfaces. But it will not work with + * C++ code implement a COM interface. That's because such code assumes the interface methods * are declared as virtual C++ methods which is not the case here. * * @@ -305,12 +305,12 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax); * }; * * Comments: - * - We first define what the interface really contains. This is th e_IDirect3D structure. The + * - We first define what the interface really contains. This is th e_IDirect3D structure. The * first field must of course be the virtual table pointer. Everything else is free. - * - Then we predeclare our static virtual table variable, we will need its address in some + * - Then we predeclare our static virtual table variable, we will need its address in some * methods to initialize the virtual table pointer of the returned interface objects. - * - Then we implement the interface methods. To match what has been declared in the header file - * they must take a pointer to a IDirect3D structure and we must cast it to an _IDirect3D so that + * - Then we implement the interface methods. To match what has been declared in the header file + * they must take a pointer to a IDirect3D structure and we must cast it to an _IDirect3D so that * we can manipulate the fields. This is performed by the ICOM_THIS macro. * - Finally we initialize the virtual table. */ @@ -663,7 +663,7 @@ typedef struct ICOM_VTABLE(IUnknown) ICOM_VTABLE(IUnknown); struct IUnknown { ICOM_VFIELD(IUnknown); #if defined(ICOM_USE_COM_INTERFACE_ATTRIBUTE) -} __attribute__ ((com_interface)); +} __attribute__ ((com_interface)); #else }; #endif /* ICOM_US_COM_INTERFACE_ATTRIBUTE */ @@ -683,7 +683,7 @@ struct IUnknown { ICOM_METHOD (ULONG,AddRef) ICOM_METHOD (ULONG,Release) #if defined(ICOM_USE_COM_INTERFACE_ATTRIBUTE) -} __attribute__ ((com_interface)); +} __attribute__ ((com_interface)); #else }; #endif /* ICOM_US_COM_INTERFACE_ATTRIBUTE */ @@ -821,7 +821,7 @@ HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid,LPUNKNOWN pUnk,DWORD dwClsC HRESULT WINAPI CoRevokeClassObject(DWORD dwRegister); HRESULT WINAPI CoGetPSClsid(REFIID riid,CLSID *pclsid); - + /***************************************************************************** * COM Server dll - exports */ diff --git a/include/wine/obj_cache.h b/include/wine/obj_cache.h index f29d50f3ff2..6bf5ce84907 100644 --- a/include/wine/obj_cache.h +++ b/include/wine/obj_cache.h @@ -71,7 +71,7 @@ ICOM_DEFINE(IOleCache,IUnknown) #define IOleCache_EnumCache(p,a) ICOM_CALL1(EnumCache,p,a) #define IOleCache_InitCache(p,a) ICOM_CALL1(InitCache,p,a) #define IOleCache_SetData(p,a,b,c) ICOM_CALL3(SetData,p,a,b,c) - + /***************************************************************************** * IOleCache2 interface diff --git a/include/wine/obj_comcat.h b/include/wine/obj_comcat.h index bc3e45c8c76..203197c536c 100644 --- a/include/wine/obj_comcat.h +++ b/include/wine/obj_comcat.h @@ -61,7 +61,7 @@ DEFINE_GUID(CATID_PersistsToFile, 0x0DE86A56, 0x2BAA, 0x11CF, 0xA2, 0x29, 0x0 DEFINE_GUID(CATID_PersistsToPropertyBag, 0x0DE86A57, 0x2BAA, 0x11CF, 0xA2, 0x29, 0x00, 0xAA, 0x00, 0x3D, 0x73, 0x52); DEFINE_GUID(CATID_InternetAware, 0x0DE86A58, 0x2BAA, 0x11CF, 0xA2, 0x29, 0x00, 0xAA, 0x00, 0x3D, 0x73, 0x52); DEFINE_GUID(CATID_DesignTimeUIActivatableControl, 0xF2BB56D1, 0xDB07, 0x11D1, 0xAA, 0x6B, 0x00, 0x60, 0x97, 0xDB, 0x95, 0x39); - + /***************************************************************************** * Aliases for EnumGUID */ diff --git a/include/wine/obj_connection.h b/include/wine/obj_connection.h index b2f8d858884..5f761ce5b90 100644 --- a/include/wine/obj_connection.h +++ b/include/wine/obj_connection.h @@ -36,7 +36,7 @@ typedef struct tagCONNECTDATA IUnknown *pUnk; DWORD dwCookie; } CONNECTDATA, *LPCONNECTDATA; - + /***************************************************************************** * Predeclare the interfaces */ @@ -151,7 +151,7 @@ ICOM_DEFINE(IEnumConnectionPoints,IUnknown) #define IEnumConnectionPoints_Skip(p,a) ICOM_CALL1(Skip,p,a) #define IEnumConnectionPoints_Reset(p) ICOM_CALL (Reset,p) #define IEnumConnectionPoints_Clone(p,a) ICOM_CALL1(Clone,p,a) - + #ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */ diff --git a/include/wine/obj_contextmenu.h b/include/wine/obj_contextmenu.h index 94931201f0b..2ccedaa2046 100644 --- a/include/wine/obj_contextmenu.h +++ b/include/wine/obj_contextmenu.h @@ -3,7 +3,7 @@ * * Undocumented: * word95 gets a IContextMenu Interface and calls HandleMenuMsg() - * which should only a member of IContextMenu2. + * which should only a member of IContextMenu2. * * Copyright (C) 1999 Juergen Schmied * @@ -79,7 +79,7 @@ static const WCHAR CMDSTR_VIEWDETAILSW[] = {'V','i','e','w','D','e','t','a','i', #define CMIC_MASK_PTINVOKE 0x20000000 /*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */ -typedef struct tagCMINVOKECOMMANDINFO +typedef struct tagCMINVOKECOMMANDINFO { DWORD cbSize; /* sizeof(CMINVOKECOMMANDINFO) */ DWORD fMask; /* any combination of CMIC_MASK_* */ HWND hwnd; /* might be NULL (indicating no owner window) */ @@ -92,7 +92,7 @@ typedef struct tagCMINVOKECOMMANDINFO HANDLE hIcon; } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO; -typedef struct tagCMInvokeCommandInfoEx +typedef struct tagCMInvokeCommandInfoEx { DWORD cbSize; /* must be sizeof(CMINVOKECOMMANDINFOEX) */ DWORD fMask; /* any combination of CMIC_MASK_* */ HWND hwnd; /* might be NULL (indicating no owner window) */ diff --git a/include/wine/obj_control.h b/include/wine/obj_control.h index b40c21b3588..e4a4791698c 100644 --- a/include/wine/obj_control.h +++ b/include/wine/obj_control.h @@ -45,7 +45,7 @@ typedef enum tagREADYSTATE READYSTATE_INTERACTIVE = 3, READYSTATE_COMPLETE = 4 } READYSTATE; - + typedef struct tagExtentInfo { ULONG cb; @@ -118,7 +118,7 @@ typedef enum tagDVASPECT2 DVASPECT_TRANSPARENT = 32 } DVASPECT2; -typedef enum tagHITRESULT +typedef enum tagHITRESULT { HITRESULT_OUTSIDE = 0, HITRESULT_TRANSPARENT = 1, @@ -168,13 +168,13 @@ typedef struct IClassFactory2 IClassFactory2, *LPCLASSFACTORY2; DEFINE_GUID(IID_IViewObjectEx, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); /* FIXME need GUID */ typedef struct IViewObjectEx IViewObjectEx, *LPVIEWOBJECTEX; - + DEFINE_GUID(IID_IProvideClassInfo, 0xb196b283, 0xbab4, 0x101a, 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07); typedef struct IProvideClassInfo IProvideClassInfo, *LPPROVIDECLASSINFO; - + DEFINE_GUID(IID_IProvideClassInfo2, 0xa6bc3ac0, 0xdbaa, 0x11ce, 0x9d, 0xe3, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51); typedef struct IProvideClassInfo2 IProvideClassInfo2, *LPPROVIDECLASSINFO2; - + /***************************************************************************** * IOleControl interface */ @@ -199,12 +199,12 @@ ICOM_DEFINE(IOleControl,IUnknown) #define IOleControl_OnMnemonic(p,a) ICOM_CALL1(OnMnemonic,p,a) #define IOleControl_OnAmbientPropertyChange(p,a) ICOM_CALL1(OnAmbientPropertyChange,p,a) #define IOleControl_FreezeEvents(p,a) ICOM_CALL1(FreezeEvents,p,a) - + /***************************************************************************** * IOleControlSite interface */ -#define ICOM_INTERFACE IOleControlSite +#define ICOM_INTERFACE IOleControlSite #define IOleControlSite_METHODS \ ICOM_METHOD (HRESULT,OnControlInfoChanged) \ ICOM_METHOD1(HRESULT,LockInPlaceActive, BOOL,fLock) \ @@ -231,8 +231,8 @@ ICOM_DEFINE(IOleControlSite,IUnknown) #define IOleControlSite_TranslateAccelerator(p,a,b) ICOM_CALL1(TranslateAccelerator,p,a,b) #define IOleControlSite_OnFocus(p,a) ICOM_CALL1(OnFocus,p,a) #define IOleControlSite_ShowPropertyFrame(p) ICOM_CALL1(ShowPropertyFrame,p) - - + + /***************************************************************************** * IOleInPlaceSiteEx interface */ @@ -269,7 +269,7 @@ ICOM_DEFINE(IOleInPlaceSiteEx,IOleInPlaceSite) #define IOleInPlaceSiteEx_OnInPlaceActivateEx(p,a,b) ICOM_CALL2(OnInPlaceActivateEx,p,a,b) #define IOleInPlaceSiteEx_OnInPlaceDeactivateEx(p,a) ICOM_CALL1(OnInPlaceDeactivateEx,p,a) #define IOleInPlaceSiteEx_RequestUIActivate(p) ICOM_CALL (RequestUIActivate,p) - + /***************************************************************************** * IOleInPlaceSiteWindowless interface @@ -355,7 +355,7 @@ ICOM_DEFINE(IOleInPlaceObjectWindowless,IOleInPlaceObject) /*** IOleInPlaceObjectWindowless methods ***/ #define IOleInPlaceObjectWindowless_OnWindowMessage(p,a,b,c,d) ICOM_CALL4(OnWindowMessage,p,a,b,c,d) #define IOleInPlaceObjectWindowless_GetDropTarget(p,a) ICOM_CALL1(GetDropTarget,p,a) - + /***************************************************************************** * IClassFactory2 interface @@ -430,7 +430,7 @@ ICOM_DEFINE(IViewObjectEx,IViewObject2) #define ICOM_INTERFACE IProvideClassInfo #define IProvideClassInfo_METHODS \ - ICOM_METHOD1(HRESULT,GetClassInfo, ITypeInfo**,ppTI) + ICOM_METHOD1(HRESULT,GetClassInfo, ITypeInfo**,ppTI) #define IProvideClassInfo_IMETHODS \ IUnknown_IMETHODS \ IProvideClassInfo_METHODS @@ -445,7 +445,7 @@ ICOM_DEFINE(IProvideClassInfo,IUnknown) #define IProvideClassInfo_GetClassInfo(p,a) ICOM_CALL1(GetClassInfo,p,a) - + /***************************************************************************** * IProvideClassInfo2 interface */ @@ -463,7 +463,7 @@ ICOM_DEFINE(IProvideClassInfo2,IProvideClassInfo) #define IProvideClassInfo2_AddRef(p) ICOM_CALL (AddRef,p) #define IProvideClassInfo2_Release(p) ICOM_CALL (Release,p) /*** IProvideClassInfo methods ***/ -#define IProvideClassInfo2_GetClassInfo(p,a) ICOM_CALL1(GetClassInfo,p,a) +#define IProvideClassInfo2_GetClassInfo(p,a) ICOM_CALL1(GetClassInfo,p,a) /*** IProvideClassInfo2 methods ***/ #define IProvideClassInfo2_GetGUID(p,a,b) ICOM_CALL2(GetGUID,p,a,b) diff --git a/include/wine/obj_dataobject.h b/include/wine/obj_dataobject.h index 21b01a1d786..a46778fdb89 100644 --- a/include/wine/obj_dataobject.h +++ b/include/wine/obj_dataobject.h @@ -33,7 +33,7 @@ typedef enum tagDATADIR DATADIR_GET = 1, DATADIR_SET = 2 } DATADIR; - + typedef struct DVTARGETDEVICE16 DVTARGETDEVICE16, *LPDVTARGETDEVICE16; typedef struct DVTARGETDEVICE DVTARGETDEVICE, *LPDVTARGETDEVICE; @@ -107,7 +107,7 @@ typedef enum tagTYMED TYMED_ENHMF = 64, TYMED_NULL = 0 } TYMED; - + typedef struct tagRemSTGMEDIUM { DWORD tymed; @@ -132,7 +132,7 @@ struct STGMEDIUM IStorage *pstg; } DUMMYUNIONNAME; IUnknown *pUnkForRelease; -}; +}; typedef enum tagADVF { diff --git a/include/wine/obj_inplace.h b/include/wine/obj_inplace.h index fe877c0b444..663d5d44eec 100644 --- a/include/wine/obj_inplace.h +++ b/include/wine/obj_inplace.h @@ -1,6 +1,6 @@ /* * Defines the COM interfaces and APIs related to structured data storage. - * + * * Depends on 'obj_base.h'. * * Copyright (C) 1999 Paul Quinn @@ -90,7 +90,7 @@ typedef struct tagOLEVERB DWORD fuFlags; DWORD grfAttribs; } OLEVERB, *LPOLEVERB; - + typedef enum tagOLELINKBIND { OLELINKBIND_EVENIFCLASSDIFF = 1 @@ -118,12 +118,12 @@ typedef enum tagOLECONTF OLECONTF_OLNYUSER = 8, OLECONTF_ONLYIFRUNNING = 16 } OLECONTF; - + typedef HGLOBAL HOLEMENU; typedef LPRECT LPBORDERWIDTHS; typedef LPCRECT LPCBORDERWIDTHS; - - + + /***************************************************************************** * Predeclare the interfaces */ @@ -267,7 +267,7 @@ ICOM_DEFINE(IOleInPlaceUIWindow,IOleWindow) #define IOleInPlaceUIWindow_RequestBorderSpace(p,a) ICOM_CALL1(RequestBorderSpace,p,a) #define IOleInPlaceUIWindow_SetBorderSpace(p,a) ICOM_CALL1(SetBorderSpace,p,a) #define IOleInPlaceUIWindow_SetActiveObject(p,a,b) ICOM_CALL2(SetActiveObject,p,a,b) - + /***************************************************************************** * IOleInPlaceFrame interface @@ -305,7 +305,7 @@ ICOM_DEFINE(IOleInPlaceFrame,IOleInPlaceUIWindow) #define IOleInPlaceFrame_SetStatusText ICOM_CALL1(SetStatusText,p,a) #define IOleInPlaceFrame_EnableModeless ICOM_CALL1(EnableModeless,p,a) #define IOleInPlaceFrame_TranslateAccelerator ICOM_CALL2(TranslateAccelerator,p,a,b) - + /***************************************************************************** * IOleInPlaceSite interface @@ -389,15 +389,15 @@ ICOM_DEFINE(IOleClientSite,IUnknown) IParseDisplayName_METHODS ICOM_DEFINE(IParseDisplayName,IUnknown) #undef ICOM_INTERFACE - + /*** IUnknown methods ***/ #define IParseDisplayName_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define IParseDisplayName_AddRef(p) ICOM_CALL (AddRef,p) #define IParseDisplayName_Release(p) ICOM_CALL (Release,p) /*** IParseDisplayName methods ***/ #define IParseDisplayName_ParseDisplayName(p,a,b,c,d) ICOM_CALL4(ParseDisplayName,p,a,b,c,d) - - + + /***************************************************************************** * IOleContainer interface */ diff --git a/include/wine/obj_marshal.h b/include/wine/obj_marshal.h index 4d442ecee78..74e3ef70c78 100644 --- a/include/wine/obj_marshal.h +++ b/include/wine/obj_marshal.h @@ -1,5 +1,5 @@ /* - * Defines the COM interfaces and APIs that allow an interface to + * Defines the COM interfaces and APIs that allow an interface to * specify a custom marshaling for its objects. * * Copyright (C) 1999 Francois Gouget diff --git a/include/wine/obj_misc.h b/include/wine/obj_misc.h index c79ec324215..19719f3bc84 100644 --- a/include/wine/obj_misc.h +++ b/include/wine/obj_misc.h @@ -1,7 +1,7 @@ /* * Defines miscellaneous COM interfaces and APIs defined in objidl.h. - * These did not really fit into the other categories, whould have - * required their own specific category or are too rarely used to be + * These did not really fit into the other categories, whould have + * required their own specific category or are too rarely used to be * put in 'obj_base.h'. * * Copyright (C) the Wine project @@ -188,9 +188,9 @@ HRESULT WINAPI CoGetTreatAsClass(REFCLSID clsidOld, LPCLSID pClsidNew); /* FIXME: unimplemented */ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew); -HRESULT WINAPI CoCreateInstanceEx(REFCLSID rclsid, +HRESULT WINAPI CoCreateInstanceEx(REFCLSID rclsid, LPUNKNOWN pUnkOuter, - DWORD dwClsContext, + DWORD dwClsContext, COSERVERINFO* pServerInfo, ULONG cmq, MULTI_QI* pResults); diff --git a/include/wine/obj_oleaut.h b/include/wine/obj_oleaut.h index dc2921b3b03..8bfc8e1e272 100644 --- a/include/wine/obj_oleaut.h +++ b/include/wine/obj_oleaut.h @@ -71,7 +71,7 @@ DEFINE_OLEGUID(CLSID_PSOAInterface, 0x00020424,0,0); */ /***************************************************************** - * SafeArray defines and structs + * SafeArray defines and structs */ #define FADF_AUTO ( 0x1 ) @@ -87,18 +87,18 @@ DEFINE_OLEGUID(CLSID_PSOAInterface, 0x00020424,0,0); #define FADF_VARIANT ( 0x800 ) #define FADF_RESERVED ( 0xf008 ) -/* Undocumented flags */ -#define FADF_CREATEVECTOR ( 0x2000 ) /* set when the safe array is created using SafeArrayCreateVector */ +/* Undocumented flags */ +#define FADF_CREATEVECTOR ( 0x2000 ) /* set when the safe array is created using SafeArrayCreateVector */ -typedef struct tagSAFEARRAYBOUND +typedef struct tagSAFEARRAYBOUND { ULONG cElements; /* Number of elements in dimension */ LONG lLbound; /* Lower bound of dimension */ } SAFEARRAYBOUND; typedef struct tagSAFEARRAY -{ +{ USHORT cDims; /* Count of array dimension */ USHORT fFeatures; /* Flags describing the array */ ULONG cbElements; /* Size of each element */ @@ -241,7 +241,7 @@ typedef struct tagDISPPARAMS UINT cNamedArgs; } DISPPARAMS; -typedef struct tagEXCEPINFO +typedef struct tagEXCEPINFO { WORD wCode; WORD wReserved; @@ -290,7 +290,7 @@ typedef struct tagTYPEDESC } DUMMYUNIONNAME; VARTYPE vt; } TYPEDESC; - + typedef struct tagELEMDESC { TYPEDESC tdesc; @@ -658,7 +658,7 @@ ICOM_DEFINE(ITypeInfo,IUnknown) #define ITypeInfo_ReleaseTypeAttr(p,a) ICOM_CALL1(ReleaseTypeAttr,p,a) #define ITypeInfo_ReleaseFuncDesc(p,a) ICOM_CALL1(ReleaseFuncDesc,p,a) #define ITypeInfo_ReleaseVarDesc(p,a) ICOM_CALL1(ReleaseVarDesc,p,a) - + /***************************************************************************** * ITypeInfo2 interface @@ -696,10 +696,10 @@ ICOM_DEFINE(ITypeInfo,IUnknown) #define ITypeInfo2_IMETHODS \ IUnknown_IMETHODS \ ITypeInfo_METHODS \ - ITypeInfo2_METHODS + ITypeInfo2_METHODS ICOM_DEFINE(ITypeInfo2,ITypeInfo) #undef ICOM_INTERFACE - + /*** IUnknown methods ***/ #define ITypeInfo2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define ITypeInfo2_AddRef(p) ICOM_CALL (AddRef,p) @@ -822,7 +822,7 @@ ICOM_DEFINE(ITypeLib2,ITypeLib) #define ICOM_INTERFACE ITypeComp #define ITypeComp_METHODS \ ICOM_METHOD6(HRESULT,Bind, LPOLESTR,szName, ULONG,lHashVal, WORD,wFlags, ITypeInfo**,ppTInfo, DESCKIND*,pDescKind, BINDPTR*,pBindPtr) \ - ICOM_METHOD4(HRESULT,BindType, LPOLESTR,szName, ULONG,lHashVal, ITypeInfo**,ppTInfo, ITypeComp**,ppTComp) + ICOM_METHOD4(HRESULT,BindType, LPOLESTR,szName, ULONG,lHashVal, ITypeInfo**,ppTInfo, ITypeComp**,ppTComp) #define ITypeComp_IMETHODS \ IUnknown_IMETHODS \ ITypeComp_METHODS @@ -836,7 +836,7 @@ ICOM_DEFINE(ITypeComp,IUnknown) /*** ITypeComp methods ***/ #define ITypeComp_Bind(p,a,b,c,d,e,f) ICOM_CALL6(Bind,p,a,b,c,d,e,f) #define ITypeComp_BindType(p,a,b,c,d) ICOM_CALL4(BindType,p,a,b,c,d) - + /***************************************************************************** * IEnumVARIANT interface */ @@ -845,7 +845,7 @@ ICOM_DEFINE(ITypeComp,IUnknown) ICOM_METHOD3(HRESULT,Next, ULONG,celt, VARIANT*,rgVar, ULONG*,pCeltFetched) \ ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \ ICOM_METHOD (HRESULT,Reset) \ - ICOM_METHOD1(HRESULT,Clone, IEnumVARIANT**,ppEnum) + ICOM_METHOD1(HRESULT,Clone, IEnumVARIANT**,ppEnum) #define IEnumVARIANT_IMETHODS \ IUnknown_IMETHODS \ IEnumVARIANT_METHODS @@ -861,6 +861,6 @@ ICOM_DEFINE(IEnumVARIANT,IUnknown) #define IEnumVARIANT_Skip(p,a) ICOM_CALL1(Skip,p,a) #define IEnumVARIANT_Reset(p) ICOM_CALL (Reset,p) #define IEnumVARIANT_Clone(p,a) ICOM_CALL1(Clone,p,a) - + #endif /* __WINE_WINE_OBJ_OLEAUT_H */ diff --git a/include/wine/obj_olefont.h b/include/wine/obj_olefont.h index 2761d120562..14456e4bdf1 100644 --- a/include/wine/obj_olefont.h +++ b/include/wine/obj_olefont.h @@ -66,7 +66,7 @@ typedef TEXTMETRICW TEXTMETRICOLE; ICOM_METHOD1(HRESULT, QueryTextMetrics, TEXTMETRICOLE*, ptm) \ ICOM_METHOD1(HRESULT, AddRefHfont, HFONT, hfont) \ ICOM_METHOD1(HRESULT, ReleaseHfont, HFONT, hfont) \ - ICOM_METHOD1(HRESULT, SetHdc, HDC, hdc) + ICOM_METHOD1(HRESULT, SetHdc, HDC, hdc) #define IFont_IMETHODS \ IUnknown_IMEHTODS \ IFont_METHODS @@ -108,7 +108,7 @@ ICOM_DEFINE(IFont,IUnknown) * IFont interface */ #define ICOM_INTERFACE IFontDisp -#define IFontDisp_METHODS +#define IFontDisp_METHODS #define IFontDisp_IMETHODS \ IUnknown_IMETHODS \ IFontDisp_METHODS diff --git a/include/wine/obj_oleobj.h b/include/wine/obj_oleobj.h index 5727142a731..9a351dbda5f 100644 --- a/include/wine/obj_oleobj.h +++ b/include/wine/obj_oleobj.h @@ -1,6 +1,6 @@ /* * Defines IOleObject COM and other oleidl.h interfaces - * + * * Depends on 'obj_base.h'. * * Copyright (C) 1999 Paul Quinn @@ -44,7 +44,7 @@ typedef struct tagOBJECTDESCRIPTOR DWORD dwFullUserTypeName; DWORD dwSrcOfCopy; } OBJECTDESCRIPTOR, *LPOBJECTDESCRIPTOR; - + typedef enum tagOLEMISC { OLEMISC_RECOMPOSEONRESIZE = 0x1, @@ -88,7 +88,7 @@ typedef struct IOleAdviseHolder IOleAdviseHolder, *LPOLEADVISEHOLDER; DEFINE_OLEGUID(IID_IEnumOLEVERB, 0x00000104L, 0, 0); typedef struct IEnumOLEVERB IEnumOLEVERB, *LPENUMOLEVERB; - + /***************************************************************************** * IOleObject interface */ @@ -120,7 +120,7 @@ typedef struct IEnumOLEVERB IEnumOLEVERB, *LPENUMOLEVERB; IOleObject_METHODS ICOM_DEFINE(IOleObject,IUnknown) #undef ICOM_INTERFACE - + /*** IUnknown methods ***/ #define IOleObject_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define IOleObject_AddRef(p) ICOM_CALL (AddRef,p) @@ -147,7 +147,7 @@ ICOM_DEFINE(IOleObject,IUnknown) #define IOleObject_EnumAdvise(p,a,b) ICOM_CALL1(EnumAdvise,p,a) #define IOleObject_GetMiscStatus(p,a,b) ICOM_CALL2(GetMiscStatus,p,a,b) #define IOleObject_SetColorScheme(p,a,b) ICOM_CALL1(SetColorScheme,p,a) - + /***************************************************************************** * IOleAdviseHolder interface @@ -177,7 +177,7 @@ ICOM_DEFINE(IOleAdviseHolder,IUnknown) #define IOleAdviseHolder_SendOnRename(p,a) ICOM_CALL1(SendOnRename,p,a) #define IOleAdviseHolder_SendOnSave(p) ICOM_CALL (SendOnSave,p) #define IOleAdviseHolder_SendOnClose(p) ICOM_CALL (SendOnClose,p) - + /***************************************************************************** * IEnumOLEVERB interface @@ -207,6 +207,6 @@ ICOM_DEFINE(IEnumOLEVERB,IUnknown) #ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */ - + #endif /* __WINE_WINE_OBJ_OLEOBJ_H */ diff --git a/include/wine/obj_oleundo.h b/include/wine/obj_oleundo.h index db82f827ee0..62930feb9be 100644 --- a/include/wine/obj_oleundo.h +++ b/include/wine/obj_oleundo.h @@ -32,7 +32,7 @@ extern "C" { */ DEFINE_GUID(IID_IQuickActivate, 0xcf51ed10, 0x62fe, 0x11cf, 0xbf, 0x86, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0x36); typedef struct IQuickActivate IQuickActivate,*LPQUICKACTIVATE; - + DEFINE_GUID(IID_IPointerInactive, 0x55980ba0, 0x35aa, 0x11cf, 0xb6, 0x71, 0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8); typedef struct IPointerInactive IPointerInactive,*LPPOINTERINACTIVE; @@ -127,7 +127,7 @@ ICOM_DEFINE(IQuickActivate,IUnknown) #define IPointerInactive_METHODS \ ICOM_METHOD1(HRESULT,GetActivationPolicy, DWORD*,pdwPolicy) \ ICOM_METHOD4(HRESULT,OnInactiveMouseMove, LPCRECT,pRectBounds, LONG,x, LONG,y, DWORD,grfKeyState) \ - ICOM_METHOD5(HRESULT,OnInactiveSetCursor, LPCRECT,pRectBounds, LONG,x, LONG,y, DWORD,dwMouseMsg, BOOL,fSetAlways) + ICOM_METHOD5(HRESULT,OnInactiveSetCursor, LPCRECT,pRectBounds, LONG,x, LONG,y, DWORD,dwMouseMsg, BOOL,fSetAlways) #define IPointerInactive_IMETHODS \ IUnknown_IMETHODS \ IPointerInactive_METHODS @@ -140,7 +140,7 @@ ICOM_DEFINE(IPointerInactive,IUnknown) #define IPointerInactive_Release(p) ICOM_CALL (Release,p) /*** IPointerInactive methods ***/ #define IPointerInactive_GetActivationPolicy(p,a) ICOM_CALL1(GetActivationPolicy,p,a) -#define IPointerInactive_OnInactiveMoveMouse(p,a,b,c,d) ICOM_CALL4(OnInactiveMoveMouse,p,a,b,c,d) +#define IPointerInactive_OnInactiveMoveMouse(p,a,b,c,d) ICOM_CALL4(OnInactiveMoveMouse,p,a,b,c,d) #define IPointerInactive_OnInactiveSetCursor(p,a,b,c,d,e) ICOM_CALL5(OnInactiveSetCursor,p,a,b,d,e) diff --git a/include/wine/obj_oleview.h b/include/wine/obj_oleview.h index 7efda2b1a4f..2f799e2dd44 100644 --- a/include/wine/obj_oleview.h +++ b/include/wine/obj_oleview.h @@ -54,7 +54,7 @@ typedef BOOL (CALLBACK *IVO_ContCallback)(DWORD); ICOM_METHOD4(HRESULT,Freeze, DWORD,dwDrawAspect, LONG,lindex, void*,pvAspect, DWORD*,pdwFreeze) \ ICOM_METHOD1(HRESULT,Unfreeze, DWORD,dwFreeze) \ ICOM_METHOD3(HRESULT,SetAdvise, DWORD,aspects, DWORD,advf, IAdviseSink*,pAdvSink) \ - ICOM_METHOD3(HRESULT,GetAdvise, DWORD*,pAspects, DWORD*,pAdvf, IAdviseSink**,ppAdvSink) + ICOM_METHOD3(HRESULT,GetAdvise, DWORD*,pAspects, DWORD*,pAdvf, IAdviseSink**,ppAdvSink) #define IViewObject_IMETHODS \ IUnknown_IMETHODS \ IViewObject_METHODS @@ -72,7 +72,7 @@ ICOM_DEFINE(IViewObject,IUnknown) #define IViewObject_Unfreeze(p,a) ICOM_CALL1(Unfreeze,p,a) #define IViewObject_SetAdvise(p,a,b,c) ICOM_CALL3(SetAdvise,p,a,b,c) #define IViewObject_GetAdvise(p,a,b,c) ICOM_CALL3(GetAdvise,p,a,b,c) - + /***************************************************************************** @@ -80,7 +80,7 @@ ICOM_DEFINE(IViewObject,IUnknown) */ #define ICOM_INTERFACE IViewObject2 #define IViewObject2_METHODS \ - ICOM_METHOD4(HRESULT,GetExtent, DWORD,dwDrawAspect, LONG,lindex, DVTARGETDEVICE*,ptd, LPSIZEL,lpsizel) + ICOM_METHOD4(HRESULT,GetExtent, DWORD,dwDrawAspect, LONG,lindex, DVTARGETDEVICE*,ptd, LPSIZEL,lpsizel) #define IViewObject2_IMETHODS \ IViewObject_IMETHODS \ IViewObject2_METHODS diff --git a/include/wine/obj_picture.h b/include/wine/obj_picture.h index a55562450b2..90e8d2e89f9 100644 --- a/include/wine/obj_picture.h +++ b/include/wine/obj_picture.h @@ -68,7 +68,7 @@ typedef struct IPictureDisp IPictureDisp, *LPPICTUREDISP; ICOM_METHOD1(HRESULT,put_KeepOriginalFormat, BOOL,Keep) \ ICOM_METHOD (HRESULT,PictureChanged) \ ICOM_METHOD3(HRESULT,SaveAsFile, LPSTREAM,pStream, BOOL,fSaveMemCopy, LONG*,pCbSize) \ - ICOM_METHOD1(HRESULT,get_Attributes, DWORD*,pDwAttr) + ICOM_METHOD1(HRESULT,get_Attributes, DWORD*,pDwAttr) #define IPicture_IMETHODS \ IUnknown_IMETHODS \ IPicture_METHODS @@ -100,7 +100,7 @@ ICOM_DEFINE(IPicture,IUnknown) * IPictureDisp interface */ #define ICOM_INTERFACE IPictureDisp -#define IPictureDisp_METHODS +#define IPictureDisp_METHODS #define IPictureDisp_IMETHODS \ IDispatch_IMETHODS \ IPictureDisp_METHODS diff --git a/include/wine/obj_property.h b/include/wine/obj_property.h index 4dfc8837768..516fc3fb919 100644 --- a/include/wine/obj_property.h +++ b/include/wine/obj_property.h @@ -82,9 +82,9 @@ typedef struct tagPROPBAG2 DWORD dwType; VARTYPE vt; CLIPFORMAT cfType; - DWORD dwHint; - LPOLESTR pstrName; - CLSID clsid; + DWORD dwHint; + LPOLESTR pstrName; + CLSID clsid; } PROPBAG2; /***************************************************************************** @@ -110,10 +110,10 @@ typedef struct IPersistStreamInit IPersistStreamInit,*LPPERSISTSTREAMINIT; DEFINE_GUID(IID_IPersistMemory, 0xbd1ae5e0L, 0xa6ae, 0x11ce, 0xbd, 0x37, 0x50, 0x42, 0x00, 0xc1, 0x00, 0x00); typedef struct IPersistMemory IPersistMemory,*LPPERSISTMEMORY; - + DEFINE_GUID(IID_IPersistPropertyBag, 0x37d84f60, 0x42cb, 0x11ce, 0x81, 0x35, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51); typedef struct IPersistPropertyBag IPersistPropertyBag,*LPPERSISTPROPERTYBAG; - + DEFINE_GUID(IID_IPersistPropertyBag2, 0x22f55881, 0x280b, 0x11d0, 0xa8, 0xa9, 0x00, 0xa0, 0xc9, 0x0c, 0x20, 0x04); typedef struct IPersistPropertyBag2 IPersistPropertyBag2,*LPPERSISTPROPERTYBAG2; @@ -122,16 +122,16 @@ typedef struct IErrorLog IErrorLog,*LPERRORLOG; DEFINE_GUID(IID_IPropertyBag, 0x55272a00L, 0x42cb, 0x11ce, 0x81, 0x35, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51); typedef struct IPropertyBag IPropertyBag,*LPPROPERTYBAG; - + DEFINE_GUID(IID_IPropertyBag2, 0x22f55882, 0x280b, 0x11d0, 0xa8, 0xa9, 0x00, 0xa0, 0xc9, 0x0c, 0x20, 0x04); typedef struct IPropertyBag2 IPropertyBag2,*LPPROPERTYBAG2; DEFINE_GUID(IID_ISpecifyPropertyPages, 0xb196b28b, 0xbab4, 0x101a, 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07); typedef struct ISpecifyPropertyPages ISpecifyPropertyPages,*LPSPECIFYPROPERTYPAGES; - + DEFINE_GUID(IID_IPerPropertyBrowsing, 0xb196b28b, 0xbab4, 0x101a, 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07); typedef struct IPerPropertyBrowsing IPerPropertyBrowsing,*LPPERPROPERTYBROWSING; - + /***************************************************************************** * IPropertPage interface @@ -148,7 +148,7 @@ typedef struct IPerPropertyBrowsing IPerPropertyBrowsing,*LPPERPROPERTYBROWSING; ICOM_METHOD (HRESULT,IsPageDirty) \ ICOM_METHOD (HRESULT,Apply) \ ICOM_METHOD1(HRESULT,Help, LPCOLESTR,pszHelpDir) \ - ICOM_METHOD1(HRESULT,TranslateAccelerator, MSG*,pMsg) + ICOM_METHOD1(HRESULT,TranslateAccelerator, MSG*,pMsg) #define IPropertyPage_IMETHODS \ IUnknown_IMETHODS \ IPropertyPage_METHODS @@ -171,7 +171,7 @@ ICOM_DEFINE(IPropertyPage,IUnknown) #define IPropertyPage_Apply(p) ICOM_CALL (Apply,p) #define IPropertyPage_Help(p,a) ICOM_CALL1(Help,p,a) #define IPropertyPage_TranslateAccelerator(p,a) ICOM_CALL1(TranslateAccelerator,p,a) - + /***************************************************************************** * IPropertPage2 interface @@ -203,7 +203,7 @@ ICOM_DEFINE(IPropertyPage2,IPropertyPage) #define IPropertyPage2_TranslateAccelerator(p,a) ICOM_CALL1(TranslateAccelerator,p,a) /*** IPropertyPage2 methods ***/ #define IPropertyPage2_EditProperty(p,a) ICOM_CALL1(EditProperty,p,a) - + /***************************************************************************** * IPropertPageSite interface @@ -218,7 +218,7 @@ ICOM_DEFINE(IPropertyPage2,IPropertyPage) IUnknown_IMETHODS \ IPropertyPageSite_METHODS ICOM_DEFINE(IPropertyPageSite,IUnknown) -#undef ICOM_INTERFACE +#undef ICOM_INTERFACE /*** IUnknown methods ***/ #define IPropertyPageSite_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) @@ -229,7 +229,7 @@ ICOM_DEFINE(IPropertyPageSite,IUnknown) #define IPropertyPageSite_GetLocaleID(p,a) ICOM_CALL1(GetLocaleID,p,a) #define IPropertyPageSite_GetPageContainer(p,a) ICOM_CALL1(GetPageContainer,p,a) #define IPropertyPageSite_TranslateAccelerator(p,a) ICOM_CALL1(TranslateAccelerator,p,a) - + /***************************************************************************** * IPropertyNotifySink interface @@ -252,14 +252,14 @@ ICOM_DEFINE(IPropertyNotifySink,IUnknown) #define IPropertyNotifySink_OnChanged(p,a) ICOM_CALL1(OnChanged,p,a) #define IPropertyNotifySink_OnRequestEdit(p,a) ICOM_CALL1(OnRequestEdit,p,a) - + /***************************************************************************** * IPropertyNotifySink interface */ #define ICOM_INTERFACE ISimpleFrameSite #define ISimpleFrameSite_METHODS \ ICOM_METHOD6(HRESULT,PreMessageFilter, HWND,hWnd, UINT,msg, WPARAM,wp, LPARAM,lp, LRESULT*,plResult, DWORD*,pwdCookie) \ - ICOM_METHOD6(HRESULT,PostMessageFilter, HWND,hWnd, UINT,msg, WPARAM,wp, LPARAM,lp, LRESULT*,plResult, DWORD,pwdCookie) + ICOM_METHOD6(HRESULT,PostMessageFilter, HWND,hWnd, UINT,msg, WPARAM,wp, LPARAM,lp, LRESULT*,plResult, DWORD,pwdCookie) #define ISimpleFrameSite_IMETHODS \ IUnknown_IMETHODS \ ISimpleFrameSite_METHODS @@ -304,7 +304,7 @@ ICOM_DEFINE(IPersistStreamInit,IPersist) #define IPersistStreamInit_GetSizeMax(p,a) ICOM_CALL1(GetSizeMax,p,a) #define IPersistStreamInit_InitNew(p) ICOM_CALL (InitNew,p) - + /***************************************************************************** * IPersistMemory interface */ @@ -407,7 +407,7 @@ ICOM_DEFINE(IErrorLog,IUnknown) #define IErrorLog_Release(p) ICOM_CALL (Release,p) /*** IErrorLog methods ***/ #define IErrorLog_AddError(p,a,b) ICOM_CALL2(GetClassID,p,a,b) - + /***************************************************************************** * IPropertyBag interface @@ -464,7 +464,7 @@ ICOM_DEFINE(IPropertyBag2,IUnknown) */ #define ICOM_INTERFACE ISpecifyPropertyPages #define ISpecifyPropertyPages_METHODS \ - ICOM_METHOD1(HRESULT,GetPages, CAUUID*,pPages) + ICOM_METHOD1(HRESULT,GetPages, CAUUID*,pPages) #define ISpecifyPropertyPages_IMETHODS \ IUnknown_IMETHODS \ ISpecifyPropertyPages_METHODS @@ -477,7 +477,7 @@ ICOM_DEFINE(ISpecifyPropertyPages,IUnknown) #define ISpecifyPropertyPages_Release(p) ICOM_CALL (Release,p) /*** ISpecifyPropertyPages methods ***/ #define ISpecifyPropertyPages_GetPages(p,a) ICOM_CALL1(GetPages,p,a) - + /***************************************************************************** * IPerPropertyBrowsing interface @@ -487,7 +487,7 @@ ICOM_DEFINE(ISpecifyPropertyPages,IUnknown) ICOM_METHOD2(HRESULT,GetDisplayString, DISPID,dispID, BSTR*,pBstr) \ ICOM_METHOD2(HRESULT,MapPropertyToPage, DISPID,dispID, CLSID*,pClsid) \ ICOM_METHOD3(HRESULT,GetPredefinedStrings, DISPID,dispID, CALPOLESTR*,pCaStringsOut, CADWORD*,pCaCookiesOut) \ - ICOM_METHOD3(HRESULT,GetPredefinedValue, DISPID,dispID, DWORD,dwCookie, VARIANT*,pVarOut) + ICOM_METHOD3(HRESULT,GetPredefinedValue, DISPID,dispID, DWORD,dwCookie, VARIANT*,pVarOut) #define IPerPropertyBrowsing_IMETHODS \ IUnknown_IMETHODS \ IPerPropertyBrowsing_METHODS diff --git a/include/wine/obj_propertystorage.h b/include/wine/obj_propertystorage.h index 451e8bd5cb9..bbda9a04b5e 100644 --- a/include/wine/obj_propertystorage.h +++ b/include/wine/obj_propertystorage.h @@ -102,7 +102,7 @@ extern const FMTID FMTID_UserDefinedProperties; typedef struct tagPROPSPEC { ULONG ulKind; - union + union { PROPID propid; LPOLESTR lpwstr; @@ -179,7 +179,7 @@ ICOM_DEFINE(IEnumSTATPROPSETSTG,IUnknown) ICOM_METHOD1(HRESULT,Clone, IEnumSTATPROPSTG**,ppenum) #define IEnumSTATPROPSTG_IMETHODS \ IUnknown_IMETHODS \ - IEnumSTATPROPSTG_METHODS + IEnumSTATPROPSTG_METHODS ICOM_DEFINE(IEnumSTATPROPSTG,IUnknown) #undef ICOM_INTERFACE @@ -356,9 +356,9 @@ struct tagPROPVARIANT WORD wReserved1; WORD wReserved2; WORD wReserved3; - union + union { - /* Empty union arm */ + /* Empty union arm */ UCHAR bVal; short iVal; USHORT uiVal; diff --git a/include/wine/obj_queryassociations.h b/include/wine/obj_queryassociations.h index 4b660489101..ed964dc739d 100644 --- a/include/wine/obj_queryassociations.h +++ b/include/wine/obj_queryassociations.h @@ -54,16 +54,16 @@ typedef enum ASSOCSTR_DDEIFEXEC, ASSOCSTR_DDEAPPLICATION, ASSOCSTR_DDETOPIC, - ASSOCSTR_MAX + ASSOCSTR_MAX } ASSOCSTR; typedef enum { ASSOCKEY_SHELLEXECCLASS = 1, - ASSOCKEY_APP, + ASSOCKEY_APP, ASSOCKEY_CLASS, ASSOCKEY_BASECLASS, - ASSOCKEY_MAX + ASSOCKEY_MAX } ASSOCKEY; typedef enum diff --git a/include/wine/obj_shellfolder.h b/include/wine/obj_shellfolder.h index 320857a93d0..def4a9c44e5 100644 --- a/include/wine/obj_shellfolder.h +++ b/include/wine/obj_shellfolder.h @@ -35,11 +35,11 @@ extern "C" { #define STRRET_OFFSETA 0x0001 #define STRRET_OFFSETW 0x0004 -#define STRRET_OFFSET WINELIB_NAME_AW(STRRET_OFFSET) +#define STRRET_OFFSET WINELIB_NAME_AW(STRRET_OFFSET) #define STRRET_CSTRA 0x0002 #define STRRET_CSTRW 0x0005 -#define STRRET_CSTR WINELIB_NAME_AW(STRRET_CSTR) +#define STRRET_CSTR WINELIB_NAME_AW(STRRET_CSTR) typedef struct _STRRET { UINT uType; /* STRRET_xxx */ @@ -65,7 +65,7 @@ typedef struct IPersistFolder2 IPersistFolder2, *LPPERSISTFOLDER2; DEFINE_GUID(IID_IShellFolder2, 0xB82C5AA8, 0xA41B, 0x11D2, 0xBE, 0x32, 0x0, 0xc0, 0x4F, 0xB9, 0x36, 0x61); typedef struct IShellFolder2 IShellFolder2, *LPSHELLFOLDER2; -DEFINE_GUID(IID_IEnumExtraSearch, 0xE700BE1, 0x9DB6, 0x11D1, 0xA1, 0xCE, 0x0, 0xc0, 0x4F, 0xD7, 0x5D, 0x13); +DEFINE_GUID(IID_IEnumExtraSearch, 0xE700BE1, 0x9DB6, 0x11D1, 0xA1, 0xCE, 0x0, 0xc0, 0x4F, 0xD7, 0x5D, 0x13); typedef struct IEnumExtraSearch IEnumExtraSearch, *LPENUMEXTRASEARCH; /***************************************************************************** @@ -107,7 +107,7 @@ ICOM_DEFINE(IEnumExtraSearch,IUnknown) #define IEnumIDList_Clone(p,a) ICOM_CALL1(Clone,p,a) /***************************************************************************** - * IShellFolder::GetDisplayNameOf/SetNameOf uFlags + * IShellFolder::GetDisplayNameOf/SetNameOf uFlags */ typedef enum { SHGDN_NORMAL = 0, /* default (display purpose) */ @@ -116,7 +116,7 @@ typedef enum } SHGNO; /***************************************************************************** - * IShellFolder::EnumObjects + * IShellFolder::EnumObjects */ typedef enum tagSHCONTF { SHCONTF_FOLDERS = 32, /* for shell browser */ @@ -125,7 +125,7 @@ typedef enum tagSHCONTF } SHCONTF; /***************************************************************************** - * IShellFolder::GetAttributesOf flags + * IShellFolder::GetAttributesOf flags */ #define SFGAO_CANCOPY DROPEFFECT_COPY /* Objects can be copied */ #define SFGAO_CANMOVE DROPEFFECT_MOVE /* Objects can be moved */ @@ -242,7 +242,7 @@ ICOM_DEFINE(IShellFolder,IUnknown) /* IShellFolder2 */ /* GetDefaultColumnState */ -typedef enum +typedef enum { SHCOLSTATE_TYPE_STR = 0x00000001, SHCOLSTATE_TYPE_INT = 0x00000002, @@ -274,7 +274,7 @@ typedef struct STRRET str; } SHELLDETAILS, *LPSHELLDETAILS; -#define ICOM_INTERFACE IShellFolder2 +#define ICOM_INTERFACE IShellFolder2 #define IShellFolder2_METHODS \ ICOM_METHOD1( HRESULT, GetDefaultSearchGUID, LPGUID, lpguid)\ ICOM_METHOD1( HRESULT, EnumSearches, LPENUMEXTRASEARCH *, ppEnum) \ @@ -318,7 +318,7 @@ ICOM_DEFINE(IShellFolder2, IShellFolder) */ /* ClassID's */ -DEFINE_GUID (CLSID_SFMyComp,0x20D04FE0,0x3AEA,0x1069,0xA2,0xD8,0x08,0x00,0x2B,0x30,0x30,0x9D); +DEFINE_GUID (CLSID_SFMyComp,0x20D04FE0,0x3AEA,0x1069,0xA2,0xD8,0x08,0x00,0x2B,0x30,0x30,0x9D); DEFINE_GUID (CLSID_SFINet, 0x871C5380,0x42A0,0x1069,0xA2,0xEA,0x08,0x00,0x2B,0x30,0x30,0x9D); DEFINE_GUID (CLSID_SFFile, 0xF3364BA0,0x65B9,0x11CE,0xA9,0xBA,0x00,0xAA,0x00,0x4A,0xE8,0x37); @@ -332,7 +332,7 @@ ICOM_DEFINE(IPersistFolder, IPersist) #undef ICOM_INTERFACE /*** IUnknown methods ***/ -#define IPersistFolder_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IPersistFolder_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define IPersistFolder_AddRef(p) ICOM_CALL (AddRef,p) #define IPersistFolder_Release(p) ICOM_CALL (Release,p) /*** IPersist methods ***/ @@ -355,7 +355,7 @@ ICOM_DEFINE(IPersistFolder2, IPersistFolder) #undef ICOM_INTERFACE /*** IUnknown methods ***/ -#define IPersistFolder2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IPersistFolder2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) #define IPersistFolder2_AddRef(p) ICOM_CALL (AddRef,p) #define IPersistFolder2_Release(p) ICOM_CALL (Release,p) /*** IPersist methods ***/ diff --git a/include/wine/obj_shelllink.h b/include/wine/obj_shelllink.h index 4129e978170..63d51849ab1 100644 --- a/include/wine/obj_shelllink.h +++ b/include/wine/obj_shelllink.h @@ -34,18 +34,18 @@ typedef struct IShellLinkA IShellLinkA,*LPSHELLLINK; typedef struct IShellLinkW IShellLinkW,*LPSHELLLINKW; /***************************************************************************** - * + * */ -typedef enum +typedef enum { SLR_NO_UI = 0x0001, SLR_ANY_MATCH = 0x0002, SLR_UPDATE = 0x0004 } SLR_FLAGS; /***************************************************************************** - * GetPath fFlags + * GetPath fFlags */ -typedef enum +typedef enum { SLGP_SHORTPATH = 0x0001, SLGP_UNCPRIORITY = 0x0002 } SLGP_FLAGS; diff --git a/include/wine/obj_shellview.h b/include/wine/obj_shellview.h index f6a92409d84..4fcb0dd1c75 100644 --- a/include/wine/obj_shellview.h +++ b/include/wine/obj_shellview.h @@ -26,7 +26,7 @@ extern "C" { #endif /* defined(__cplusplus) */ /**************************************************************************** - * IShellBrowser is here defined because of a cyclic dependance between + * IShellBrowser is here defined because of a cyclic dependance between * IShellBrowser and IShellView */ typedef struct IShellBrowser IShellBrowser, *LPSHELLBROWSER; @@ -72,10 +72,10 @@ typedef struct IShellView IShellView, *LPSHELLVIEW; #define FCIDM_SHVIEW_BIGICON 0x7029 #define FCIDM_SHVIEW_SMALLICON 0x702A -#define FCIDM_SHVIEW_LISTVIEW 0x702B +#define FCIDM_SHVIEW_LISTVIEW 0x702B #define FCIDM_SHVIEW_REPORTVIEW 0x702C /* 0x7030-0x703f are used by the shellbrowser */ -#define FCIDM_SHVIEW_AUTOARRANGE 0x7031 +#define FCIDM_SHVIEW_AUTOARRANGE 0x7031 #define FCIDM_SHVIEW_SNAPTOGRID 0x7032 #define FCIDM_SHVIEW_HELP 0x7041 @@ -120,7 +120,7 @@ typedef struct IShellView IShellView, *LPSHELLVIEW; #define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1) /* uState values for IShellView::UIActivate */ -typedef enum +typedef enum { SVUIA_DEACTIVATE = 0, SVUIA_ACTIVATE_NOFOCUS = 1, SVUIA_ACTIVATE_FOCUS = 2, diff --git a/include/wine/unicode.h b/include/wine/unicode.h index 1d48a982b95..53cdabfbe67 100644 --- a/include/wine/unicode.h +++ b/include/wine/unicode.h @@ -177,7 +177,7 @@ static inline unsigned int strlenW( const WCHAR *str ) #endif } -static inline WCHAR *strcpyW( WCHAR *dst, const WCHAR *src ) +static inline WCHAR *strcpyW( WCHAR *dst, const WCHAR *src ) { #if defined(__i386__) && defined(__GNUC__) int dummy1, dummy2, dummy3; @@ -196,7 +196,7 @@ static inline WCHAR *strcpyW( WCHAR *dst, const WCHAR *src ) return dst; } -static inline int strcmpW( const WCHAR *str1, const WCHAR *str2 ) +static inline int strcmpW( const WCHAR *str1, const WCHAR *str2 ) { while (*str1 && (*str1 == *str2)) { str1++; str2++; } return *str1 - *str2; @@ -228,13 +228,13 @@ static inline WCHAR *strchrW( const WCHAR *str, WCHAR ch ) for ( ; *str; str++) if (*str == ch) return (WCHAR *)str; return NULL; } - + static inline WCHAR *strrchrW( const WCHAR *str, WCHAR ch ) { WCHAR *ret = NULL; for ( ; *str; str++) if (*str == ch) ret = (WCHAR *)str; return ret; -} +} static inline WCHAR *strlwrW( WCHAR *str ) { diff --git a/include/wine/windef16.h b/include/wine/windef16.h index 4870c9b06be..ff36f3a7dc1 100644 --- a/include/wine/windef16.h +++ b/include/wine/windef16.h @@ -47,7 +47,7 @@ typedef UINT16 *LPUINT16; typedef HANDLE16 a##16; \ typedef a##16 *P##a##16; \ typedef a##16 *NP##a##16; \ - typedef a##16 *LP##a##16 + typedef a##16 *LP##a##16 DECLARE_HANDLE16(HACMDRIVERID); DECLARE_HANDLE16(HACMDRIVER); diff --git a/include/wine/wingdi16.h b/include/wine/wingdi16.h index 2e9769690fc..dc9afd4d9dc 100644 --- a/include/wine/wingdi16.h +++ b/include/wine/wingdi16.h @@ -47,7 +47,7 @@ typedef struct } BITMAP16, *LPBITMAP16; typedef struct -{ +{ UINT16 lbStyle; COLORREF lbColor; INT16 lbHatch; @@ -86,7 +86,7 @@ typedef struct BYTE elfScript[LF_FACESIZE]; } ENUMLOGFONTEX16, *LPENUMLOGFONTEX16; -typedef struct +typedef struct { INT16 txfHeight; INT16 txfWidth; @@ -259,7 +259,7 @@ typedef struct typedef struct { - UINT16 lopnStyle; + UINT16 lopnStyle; POINT16 lopnWidth; COLORREF lopnColor; } LOGPEN16, *LPLOGPEN16; @@ -308,7 +308,7 @@ typedef struct { typedef INT16 (CALLBACK *MFENUMPROC16)(HDC16,HANDLETABLE16*,METARECORD*, INT16,LPARAM); -typedef struct +typedef struct { INT16 cbSize; SEGPTR lpszDocName; diff --git a/include/wine/winnet16.h b/include/wine/winnet16.h index f882451975c..63d08cebb91 100644 --- a/include/wine/winnet16.h +++ b/include/wine/winnet16.h @@ -1,4 +1,4 @@ -/* +/* * Definitions for windows network service * * Copyright 1997 Andreas Mohr @@ -31,7 +31,7 @@ * Remote printing */ -typedef struct +typedef struct { WORD pqName; WORD pqComment; @@ -47,7 +47,7 @@ typedef struct #define WNPRQ_PENDING 0x3 #define WNPRQ_PROBLEM 0x4 -typedef struct +typedef struct { WORD pjId; WORD pjUsername; diff --git a/include/wine/winuser16.h b/include/wine/winuser16.h index 794a0358eaa..9151cdc45c2 100644 --- a/include/wine/winuser16.h +++ b/include/wine/winuser16.h @@ -21,7 +21,7 @@ #include "wine/wingdi16.h" /* wingdi.h needed for COLORREF */ #include "winuser.h" /* winuser.h needed for MSGBOXCALLBACK */ - + #include "pshpack1.h" typedef struct tagCOMSTAT16 @@ -299,7 +299,7 @@ typedef struct BYTE rgbReserved[16]; } PAINTSTRUCT16, *LPPAINTSTRUCT16; -typedef struct +typedef struct { HMENU16 hWindowMenu; UINT16 idFirstChild; diff --git a/include/wine_gl.h b/include/wine_gl.h index c2b2c405158..555272e5143 100644 --- a/include/wine_gl.h +++ b/include/wine_gl.h @@ -22,9 +22,9 @@ #ifndef __WINE_WINE_GL_H #define __WINE_WINE_GL_H -#ifndef __WINE_CONFIG_H -# error You must include config.h to use this header -#endif +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif #if defined(HAVE_OPENGL) diff --git a/include/winerror.h b/include/winerror.h index 081479747a9..21eb8af2738 100644 --- a/include/winerror.h +++ b/include/winerror.h @@ -1494,7 +1494,7 @@ extern int WIN32_LastError; #define E_POINTER 0x80004003L #define E_ABORT 0x80004004L #define E_FAIL 0x80004005L -/* FIXME: E_UNSPEC is not a standard value but it is used by +/* FIXME: E_UNSPEC is not a standard value but it is used by * FileMoniker, IOleLink and DoDragDrop as a return value. */ #define E_UNSPEC E_FAIL diff --git a/include/wingdi.h b/include/wingdi.h index 0918af7fd31..59b09819cef 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -124,7 +124,7 @@ typedef struct tagCOLORADJUSTMENT #define ILLUMINANT_MAX_INDEX ILLUMINANT_F2 #define ILLUMINANT_TUNGSTEN ILLUMINANT_A -#define ILLUMINANT_DAYLIGHT ILLUMINANT_C +#define ILLUMINANT_DAYLIGHT ILLUMINANT_C #define ILLUMINANT_FLUORESCENT ILLUMINANT_F2 #define ILLUMINANT_NTSC ILLUMINANT_C @@ -405,7 +405,7 @@ DECL_WINELIB_TYPE_AW(LOGCOLORSPACE) #define WHITEONBLACK 2 #define COLORONCOLOR 3 #define HALFTONE 4 -#define MAXSTRETCHBLTMODE 4 +#define MAXSTRETCHBLTMODE 4 #define STRETCH_ANDSCANS BLACKONWHITE #define STRETCH_ORSCANS WHITEONBLACK @@ -468,7 +468,7 @@ typedef struct /* Brushes */ typedef struct -{ +{ UINT lbStyle; COLORREF lbColor; INT lbHatch; @@ -592,7 +592,7 @@ DECL_WINELIB_TYPE_AW(LPENUMLOGFONTEX) * for which the font provides glyphs. * * fsCsb 64-bit bitmap. The low 32 bits map the Windows codepages for - * which the font provides glyphs. The high 32 bits are for + * which the font provides glyphs. The high 32 bits are for * non Windows codepages. */ typedef struct @@ -601,7 +601,7 @@ typedef struct DWORD fsCsb[2]; } FONTSIGNATURE, *PFONTSIGNATURE, *LPFONTSIGNATURE; -typedef struct +typedef struct { UINT ciCharset; /* character set */ UINT ciACP; /* ANSI code page */ @@ -626,7 +626,7 @@ typedef struct #define MWT_LEFTMULTIPLY 2 #define MWT_RIGHTMULTIPLY 3 #define MWT_MIN MWT_IDENTITY -#define MWT_MAX MWT_RIGHTMULTIPLY +#define MWT_MAX MWT_RIGHTMULTIPLY /* Object Definitions for EnumObjects() */ #define OBJ_PEN 1 @@ -1239,7 +1239,7 @@ typedef struct #define GGO_GRAY4_BITMAP 5 #define GGO_GRAY8_BITMAP 6 #define GGO_GLYPH_INDEX 0x80 - + typedef struct { WORD fract; @@ -1365,7 +1365,7 @@ typedef struct #define TT_PRIM_LINE 1 #define TT_PRIM_QSPLINE 2 -#define TT_POLYGON_TYPE 24 +#define TT_POLYGON_TYPE 24 /* Get/SetSystemPaletteUse() values */ #define SYSPAL_ERROR 0 @@ -1383,7 +1383,7 @@ typedef struct tagPALETTEENTRY #define PC_NOCOLLAPSE 0x04 typedef struct tagLOGPALETTE -{ +{ WORD palVersion; WORD palNumEntries; PALETTEENTRY palPalEntry[1]; @@ -1393,7 +1393,7 @@ typedef struct tagLOGPALETTE typedef struct { - UINT lopnStyle; + UINT lopnStyle; POINT lopnWidth; COLORREF lopnColor; } LOGPEN, *LPLOGPEN; @@ -1769,7 +1769,7 @@ typedef struct #define DIB_PAL_COLORS 1 #define CBM_INIT 4 -typedef struct +typedef struct { BITMAP dsBm; BITMAPINFOHEADER dsBmih; @@ -1931,20 +1931,20 @@ typedef INT (CALLBACK *MFENUMPROC)(HDC,HANDLETABLE*,METARECORD*, /* note that ENHMETAHEADER is just a particular kind of ENHMETARECORD, ie. the header is just the first record in the metafile */ typedef struct { - DWORD iType; - DWORD nSize; - RECTL rclBounds; - RECTL rclFrame; - DWORD dSignature; - DWORD nVersion; - DWORD nBytes; - DWORD nRecords; - WORD nHandles; - WORD sReserved; - DWORD nDescription; - DWORD offDescription; - DWORD nPalEntries; - SIZEL szlDevice; + DWORD iType; + DWORD nSize; + RECTL rclBounds; + RECTL rclFrame; + DWORD dSignature; + DWORD nVersion; + DWORD nBytes; + DWORD nRecords; + WORD nHandles; + WORD sReserved; + DWORD nDescription; + DWORD offDescription; + DWORD nPalEntries; + SIZEL szlDevice; SIZEL szlMillimeters; /* Fields for winver >= win95 */ @@ -1952,16 +1952,16 @@ typedef struct { DWORD offPixelFormat; DWORD bOpenGL; - /* Fields for winver >= win98 */ + /* Fields for winver >= win98 */ SIZEL szlMicrometers; -} ENHMETAHEADER, *PENHMETAHEADER, *LPENHMETAHEADER; +} ENHMETAHEADER, *PENHMETAHEADER, *LPENHMETAHEADER; typedef struct { - DWORD iType; - DWORD nSize; - DWORD dParm[1]; -} ENHMETARECORD, *LPENHMETARECORD; + DWORD iType; + DWORD nSize; + DWORD dParm[1]; +} ENHMETARECORD, *LPENHMETARECORD; typedef struct { DWORD iType; @@ -2270,7 +2270,7 @@ typedef struct { DWORD iUsageMask; DWORD offBmiMask; DWORD cbBmiMask; - DWORD offBitsMask; + DWORD offBitsMask; DWORD cbBitsMask; } EMRPLGBLT, *PEMRPLGBLT; @@ -2291,7 +2291,7 @@ typedef struct { DWORD cptl; POINTL aptl[1]; BYTE abTypes[1]; -} EMRPOLYDRAW, *PEMRPOLYDRAW; +} EMRPOLYDRAW, *PEMRPOLYDRAW; typedef struct { EMR emr; @@ -2475,8 +2475,8 @@ typedef struct { } EMRSTRETCHDIBITS, *PEMRSTRETCHDIBITS; typedef struct { - EMR emr; - PIXELFORMATDESCRIPTOR pfd; + EMR emr; + PIXELFORMATDESCRIPTOR pfd; } EMRPIXELFORMAT, *PEMRPIXELFORMAT; typedef struct tagEMRGLSRECORD { @@ -2490,9 +2490,9 @@ typedef struct { RECTL rclBounds; DWORD cbData; BYTE Data[1]; -} EMRGLSBOUNDEDRECORD, *PEMRGLSBOUNDEDRECORD; +} EMRGLSBOUNDEDRECORD, *PEMRGLSBOUNDEDRECORD; -typedef INT (CALLBACK *ENHMFENUMPROC)(HDC, LPHANDLETABLE, +typedef INT (CALLBACK *ENHMFENUMPROC)(HDC, LPHANDLETABLE, LPENHMETARECORD, INT, LPVOID); #define EMR_HEADER 1 @@ -2931,7 +2931,7 @@ DECL_WINELIB_TYPE_AW(LPDEVMODE) #define DMDITHER_GRAYSCALE 5 #define DMDITHER_USER 256 -typedef struct +typedef struct { INT cbSize; LPCSTR lpszDocName; @@ -2940,7 +2940,7 @@ typedef struct DWORD fwType; } DOCINFOA, *LPDOCINFOA; -typedef struct +typedef struct { INT cbSize; LPCWSTR lpszDocName; @@ -2984,7 +2984,7 @@ typedef struct { DWORD StateFlags; CHAR DeviceID[128]; CHAR DeviceKey[128]; -} DISPLAY_DEVICEA,*PDISPLAY_DEVICEA,*LPDISPLAY_DEVICEA; +} DISPLAY_DEVICEA,*PDISPLAY_DEVICEA,*LPDISPLAY_DEVICEA; typedef struct { DWORD cb; @@ -2993,7 +2993,7 @@ typedef struct { DWORD StateFlags; WCHAR DeviceID[128]; WCHAR DeviceKey[128]; -} DISPLAY_DEVICEW,*PDISPLAY_DEVICEW,*LPDISPLAY_DEVICEW; +} DISPLAY_DEVICEW,*PDISPLAY_DEVICEW,*LPDISPLAY_DEVICEW; DECL_WINELIB_TYPE_AW(DISPLAY_DEVICE) DECL_WINELIB_TYPE_AW(PDISPLAY_DEVICE) DECL_WINELIB_TYPE_AW(LPDISPLAY_DEVICE) @@ -3055,7 +3055,7 @@ BOOL WINAPI AlphaBlend(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCT BOOL WINAPI AngleArc(HDC, INT, INT, DWORD, FLOAT, FLOAT); BOOL WINAPI AnimatePalette(HPALETTE,UINT,UINT,const PALETTEENTRY*); BOOL WINAPI Arc(HDC,INT,INT,INT,INT,INT,INT,INT,INT); -BOOL WINAPI ArcTo(HDC, INT, INT, INT, INT, INT, INT, INT, INT); +BOOL WINAPI ArcTo(HDC, INT, INT, INT, INT, INT, INT, INT, INT); BOOL WINAPI BeginPath(HDC); BOOL WINAPI BitBlt(HDC,INT,INT,INT,INT,HDC,INT,INT,DWORD); INT WINAPI ChoosePixelFormat(HDC,const LPPIXELFORMATDESCRIPTOR); diff --git a/include/wininet.h b/include/wininet.h index 5cb4992f82d..67752292e16 100644 --- a/include/wininet.h +++ b/include/wininet.h @@ -23,7 +23,7 @@ extern "C" { #endif -#define INTERNETAPI +#define INTERNETAPI #define BOOLAPI INTERNETAPI BOOL WINAPI typedef LPVOID HINTERNET; @@ -33,62 +33,62 @@ typedef WORD INTERNET_PORT; typedef INTERNET_PORT * LPINTERNET_PORT; -#define INTERNET_INVALID_PORT_NUMBER 0 +#define INTERNET_INVALID_PORT_NUMBER 0 -#define INTERNET_DEFAULT_FTP_PORT 21 -#define INTERNET_DEFAULT_GOPHER_PORT 70 -#define INTERNET_DEFAULT_HTTP_PORT 80 -#define INTERNET_DEFAULT_HTTPS_PORT 443 -#define INTERNET_DEFAULT_SOCKS_PORT 1080 +#define INTERNET_DEFAULT_FTP_PORT 21 +#define INTERNET_DEFAULT_GOPHER_PORT 70 +#define INTERNET_DEFAULT_HTTP_PORT 80 +#define INTERNET_DEFAULT_HTTPS_PORT 443 +#define INTERNET_DEFAULT_SOCKS_PORT 1080 #define INTERNET_MAX_HOST_NAME_LENGTH 256 #define INTERNET_MAX_USER_NAME_LENGTH 128 #define INTERNET_MAX_PASSWORD_LENGTH 128 -#define INTERNET_MAX_PORT_NUMBER_LENGTH 5 -#define INTERNET_MAX_PORT_NUMBER_VALUE 65535 +#define INTERNET_MAX_PORT_NUMBER_LENGTH 5 +#define INTERNET_MAX_PORT_NUMBER_VALUE 65535 #define INTERNET_MAX_PATH_LENGTH 2048 -#define INTERNET_MAX_SCHEME_LENGTH 32 +#define INTERNET_MAX_SCHEME_LENGTH 32 #define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH + sizeof("://")+ INTERNET_MAX_PATH_LENGTH) #define INTERNET_KEEP_ALIVE_UNKNOWN ((DWORD)-1) #define INTERNET_KEEP_ALIVE_ENABLED 1 #define INTERNET_KEEP_ALIVE_DISABLED 0 -#define INTERNET_REQFLAG_FROM_CACHE 0x00000001 -#define INTERNET_REQFLAG_ASYNC 0x00000002 -#define INTERNET_REQFLAG_VIA_PROXY 0x00000004 -#define INTERNET_REQFLAG_NO_HEADERS 0x00000008 -#define INTERNET_REQFLAG_PASSIVE 0x00000010 -#define INTERNET_REQFLAG_CACHE_WRITE_DISABLED 0x00000040 -#define INTERNET_FLAG_RELOAD 0x80000000 -#define INTERNET_FLAG_RAW_DATA 0x40000000 -#define INTERNET_FLAG_EXISTING_CONNECT 0x20000000 -#define INTERNET_FLAG_ASYNC 0x10000000 -#define INTERNET_FLAG_PASSIVE 0x08000000 -#define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 +#define INTERNET_REQFLAG_FROM_CACHE 0x00000001 +#define INTERNET_REQFLAG_ASYNC 0x00000002 +#define INTERNET_REQFLAG_VIA_PROXY 0x00000004 +#define INTERNET_REQFLAG_NO_HEADERS 0x00000008 +#define INTERNET_REQFLAG_PASSIVE 0x00000010 +#define INTERNET_REQFLAG_CACHE_WRITE_DISABLED 0x00000040 +#define INTERNET_FLAG_RELOAD 0x80000000 +#define INTERNET_FLAG_RAW_DATA 0x40000000 +#define INTERNET_FLAG_EXISTING_CONNECT 0x20000000 +#define INTERNET_FLAG_ASYNC 0x10000000 +#define INTERNET_FLAG_PASSIVE 0x08000000 +#define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 #define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE -#define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000 -#define INTERNET_FLAG_FROM_CACHE 0x01000000 +#define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000 +#define INTERNET_FLAG_FROM_CACHE 0x01000000 #define INTERNET_FLAG_OFFLINE INTERNET_FLAG_FROM_CACHE -#define INTERNET_FLAG_SECURE 0x00800000 -#define INTERNET_FLAG_KEEP_CONNECTION 0x00400000 -#define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000 -#define INTERNET_FLAG_READ_PREFETCH 0x00100000 -#define INTERNET_FLAG_NO_COOKIES 0x00080000 -#define INTERNET_FLAG_NO_AUTH 0x00040000 -#define INTERNET_FLAG_CACHE_IF_NET_FAIL 0x00010000 -#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000 -#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000 -#define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 -#define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 -#define INTERNET_FLAG_RESYNCHRONIZE 0x00000800 -#define INTERNET_FLAG_HYPERLINK 0x00000400 -#define INTERNET_FLAG_NO_UI 0x00000200 -#define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100 -#define INTERNET_FLAG_CACHE_ASYNC 0x00000080 -#define INTERNET_FLAG_FORMS_SUBMIT 0x00000040 -#define INTERNET_FLAG_NEED_FILE 0x00000010 +#define INTERNET_FLAG_SECURE 0x00800000 +#define INTERNET_FLAG_KEEP_CONNECTION 0x00400000 +#define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000 +#define INTERNET_FLAG_READ_PREFETCH 0x00100000 +#define INTERNET_FLAG_NO_COOKIES 0x00080000 +#define INTERNET_FLAG_NO_AUTH 0x00040000 +#define INTERNET_FLAG_CACHE_IF_NET_FAIL 0x00010000 +#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000 +#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000 +#define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 +#define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 +#define INTERNET_FLAG_RESYNCHRONIZE 0x00000800 +#define INTERNET_FLAG_HYPERLINK 0x00000400 +#define INTERNET_FLAG_NO_UI 0x00000200 +#define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100 +#define INTERNET_FLAG_CACHE_ASYNC 0x00000080 +#define INTERNET_FLAG_FORMS_SUBMIT 0x00000040 +#define INTERNET_FLAG_NEED_FILE 0x00000010 #define INTERNET_FLAG_MUST_CACHE_REQUEST INTERNET_FLAG_NEED_FILE -#define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII -#define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY +#define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII +#define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY #define SECURITY_INTERNET_MASK (INTERNET_FLAG_IGNORE_CERT_CN_INVALID|\ INTERNET_FLAG_IGNORE_CERT_DATE_INVALID|\ INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS|\ @@ -124,9 +124,9 @@ INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP) #define INTERNET_ERROR_MASK_INSERT_CDROM 0x1 #define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK) -#define WININET_API_FLAG_ASYNC 0x00000001 -#define WININET_API_FLAG_SYNC 0x00000004 -#define WININET_API_FLAG_USE_CONTEXT 0x00000008 +#define WININET_API_FLAG_ASYNC 0x00000001 +#define WININET_API_FLAG_SYNC 0x00000004 +#define WININET_API_FLAG_USE_CONTEXT 0x00000008 #define INTERNET_NO_CALLBACK 0 typedef enum { @@ -184,7 +184,7 @@ typedef struct { #define ISO_FORCE_DISCONNECTED 0x00000001 typedef struct { - DWORD dwStructSize; + DWORD dwStructSize; LPSTR lpszScheme; DWORD dwSchemeLength; INTERNET_SCHEME nScheme; @@ -194,29 +194,29 @@ typedef struct { LPSTR lpszUserName; DWORD dwUserNameLength; LPSTR lpszPassword; - DWORD dwPasswordLength; - LPSTR lpszUrlPath; - DWORD dwUrlPathLength; - LPSTR lpszExtraInfo; - DWORD dwExtraInfoLength; + DWORD dwPasswordLength; + LPSTR lpszUrlPath; + DWORD dwUrlPathLength; + LPSTR lpszExtraInfo; + DWORD dwExtraInfoLength; } URL_COMPONENTSA,* LPURL_COMPONENTSA; typedef struct { - DWORD dwStructSize; - LPWSTR lpszScheme; - DWORD dwSchemeLength; - INTERNET_SCHEME nScheme; - LPWSTR lpszHostName; - DWORD dwHostNameLength; - INTERNET_PORT nPort; - LPWSTR lpszUserName; - DWORD dwUserNameLength; - LPWSTR lpszPassword; - DWORD dwPasswordLength; - LPWSTR lpszUrlPath; - DWORD dwUrlPathLength; - LPWSTR lpszExtraInfo; - DWORD dwExtraInfoLength; + DWORD dwStructSize; + LPWSTR lpszScheme; + DWORD dwSchemeLength; + INTERNET_SCHEME nScheme; + LPWSTR lpszHostName; + DWORD dwHostNameLength; + INTERNET_PORT nPort; + LPWSTR lpszUserName; + DWORD dwUserNameLength; + LPWSTR lpszPassword; + DWORD dwPasswordLength; + LPWSTR lpszUrlPath; + DWORD dwUrlPathLength; + LPWSTR lpszExtraInfo; + DWORD dwExtraInfoLength; } URL_COMPONENTSW,* LPURL_COMPONENTSW; DECL_WINELIB_TYPE_AW(URL_COMPONENTS) @@ -250,28 +250,28 @@ DECL_WINELIB_TYPE_AW(INTERNET_CERTIFICATE_INFO) DECL_WINELIB_TYPE_AW(LPINTERNET_CERTIFICATE_INFO) typedef struct _INTERNET_BUFFERSA { - DWORD dwStructSize; - struct _INTERNET_BUFFERSA * Next; - LPCSTR lpcszHeader; - DWORD dwHeadersLength; - DWORD dwHeadersTotal; - LPVOID lpvBuffer; - DWORD dwBufferLength; - DWORD dwBufferTotal; - DWORD dwOffsetLow; + DWORD dwStructSize; + struct _INTERNET_BUFFERSA * Next; + LPCSTR lpcszHeader; + DWORD dwHeadersLength; + DWORD dwHeadersTotal; + LPVOID lpvBuffer; + DWORD dwBufferLength; + DWORD dwBufferTotal; + DWORD dwOffsetLow; DWORD dwOffsetHigh; } INTERNET_BUFFERSA,* LPINTERNET_BUFFERSA; typedef struct _INTERNET_BUFFERSW { - DWORD dwStructSize; - struct _INTERNET_BUFFERSW * Next; - LPCWSTR lpcszHeader; - DWORD dwHeadersLength; - DWORD dwHeadersTotal; - LPVOID lpvBuffer; - DWORD dwBufferLength; - DWORD dwBufferTotal; - DWORD dwOffsetLow; + DWORD dwStructSize; + struct _INTERNET_BUFFERSW * Next; + LPCWSTR lpcszHeader; + DWORD dwHeadersLength; + DWORD dwHeadersTotal; + LPVOID lpvBuffer; + DWORD dwBufferLength; + DWORD dwBufferTotal; + DWORD dwOffsetLow; DWORD dwOffsetHigh; } INTERNET_BUFFERSW,* LPINTERNET_BUFFERSW; @@ -304,22 +304,22 @@ BOOLAPI InternetCombineUrlA(LPCSTR ,LPCSTR ,LPSTR ,LPDWORD ,DWORD); BOOLAPI InternetCombineUrlW(LPCWSTR ,LPCWSTR ,LPWSTR ,LPDWORD ,DWORD); #define InternetCombineUrl WINELIB_NAME_AW(InternetCombineUrl) -#define ICU_ESCAPE 0x80000000 -#define ICU_USERNAME 0x40000000 -#define ICU_NO_ENCODE 0x20000000 -#define ICU_DECODE 0x10000000 -#define ICU_NO_META 0x08000000 -#define ICU_ENCODE_SPACES_ONLY 0x04000000 -#define ICU_BROWSER_MODE 0x02000000 +#define ICU_ESCAPE 0x80000000 +#define ICU_USERNAME 0x40000000 +#define ICU_NO_ENCODE 0x20000000 +#define ICU_DECODE 0x10000000 +#define ICU_NO_META 0x08000000 +#define ICU_ENCODE_SPACES_ONLY 0x04000000 +#define ICU_BROWSER_MODE 0x02000000 INTERNETAPI HINTERNET WINAPI InternetOpenA(LPCSTR ,DWORD ,LPCSTR lpszProxy ,LPCSTR lpszProxyBypass ,DWORD); INTERNETAPI HINTERNET WINAPI InternetOpenW(LPCWSTR ,DWORD ,LPCWSTR lpszProxy ,LPCWSTR lpszProxyBypass ,DWORD); #define InternetOpen WINELIB_NAME_AW(InternetOpen) -#define INTERNET_OPEN_TYPE_PRECONFIG 0 -#define INTERNET_OPEN_TYPE_DIRECT 1 -#define INTERNET_OPEN_TYPE_PROXY 3 -#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 +#define INTERNET_OPEN_TYPE_PRECONFIG 0 +#define INTERNET_OPEN_TYPE_DIRECT 1 +#define INTERNET_OPEN_TYPE_PROXY 3 +#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 #define PRE_CONFIG_INTERNET_ACCESS INTERNET_OPEN_TYPE_PRECONFIG #define LOCAL_INTERNET_ACCESS INTERNET_OPEN_TYPE_DIRECT #define CERN_PROXY_INTERNET_ACCESS INTERNET_OPEN_TYPE_PROXY @@ -352,7 +352,7 @@ INTERNETAPI HINTERNET WINAPI InternetOpenUrlA(HINTERNET ,LPCSTR ,LPCSTR lpszHead INTERNETAPI HINTERNET WINAPI InternetOpenUrlW(HINTERNET ,LPCWSTR ,LPCWSTR lpszHeaders ,DWORD ,DWORD ,DWORD); #define InternetOpenUrl WINELIB_NAME_AW(InternetOpenUrl) -BOOLAPI InternetReadFile( HINTERNET ,LPVOID ,DWORD ,LPDWORD ); +BOOLAPI InternetReadFile( HINTERNET ,LPVOID ,DWORD ,LPDWORD ); INTERNETAPI BOOL WINAPI InternetReadFileExA( HINTERNET ,LPINTERNET_BUFFERSA ,DWORD ,DWORD ); INTERNETAPI BOOL WINAPI InternetReadFileExW( HINTERNET ,LPINTERNET_BUFFERSW ,DWORD ,DWORD ); #define InternetReadFileEx WINELIB_NAME_AW(InternetReadFileEx) @@ -363,7 +363,7 @@ INTERNETAPI BOOL WINAPI InternetReadFileExW( HINTERNET ,LPINTERNET_BUFFERSW ,DWO #define IRF_NO_WAIT 0x00000008 INTERNETAPI DWORD WINAPI InternetSetFilePointer(HINTERNET ,LONG ,PVOID ,DWORD ,DWORD); -BOOLAPI InternetWriteFile(HINTERNET ,LPCVOID ,DWORD ,LPDWORD); +BOOLAPI InternetWriteFile(HINTERNET ,LPCVOID ,DWORD ,LPDWORD); BOOLAPI InternetQueryDataAvailable(HINTERNET ,LPDWORD lpdwNumberOfBytesAvailable ,DWORD ,DWORD); BOOLAPI InternetFindNextFileA(HINTERNET ,LPVOID); BOOLAPI InternetFindNextFileW(HINTERNET ,LPVOID); @@ -384,8 +384,8 @@ BOOLAPI InternetSetOptionExW(HINTERNET hInternet ,DWORD ,LPVOID ,DWORD ,DWORD); BOOLAPI InternetLockRequestFile(HINTERNET ,HANDLE *); BOOLAPI InternetUnlockRequestFile(HANDLE); -#define ISO_GLOBAL 0x00000001 -#define ISO_REGISTRY 0x00000002 +#define ISO_GLOBAL 0x00000001 +#define ISO_REGISTRY 0x00000002 #define ISO_VALID_FLAGS (ISO_GLOBAL | ISO_REGISTRY) #define INTERNET_OPTION_CALLBACK 1 @@ -460,7 +460,7 @@ BOOLAPI InternetUnlockRequestFile(HANDLE); #define INTERNET_HANDLE_TYPE_GOPHER_FILE 11 #define INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML 12 #define INTERNET_HANDLE_TYPE_HTTP_REQUEST 13 -#define SECURITY_FLAG_SECURE 0x00000001 +#define SECURITY_FLAG_SECURE 0x00000001 #define SECURITY_FLAG_STRENGTH_WEAK 0x10000000 #define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000 #define SECURITY_FLAG_STRENGTH_STRONG 0x20000000 @@ -518,11 +518,11 @@ INTERNETAPI INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallback(HINTERNET #define INTERNET_STATUS_REDIRECT 110 #define INTERNET_STATUS_INTERMEDIATE_RESPONSE 120 #define INTERNET_STATUS_STATE_CHANGE 200 -#define INTERNET_STATE_CONNECTED 0x00000001 -#define INTERNET_STATE_DISCONNECTED 0x00000002 -#define INTERNET_STATE_DISCONNECTED_BY_USER 0x00000010 -#define INTERNET_STATE_IDLE 0x00000100 -#define INTERNET_STATE_BUSY 0x00000200 +#define INTERNET_STATE_CONNECTED 0x00000001 +#define INTERNET_STATE_DISCONNECTED 0x00000002 +#define INTERNET_STATE_DISCONNECTED_BY_USER 0x00000010 +#define INTERNET_STATE_IDLE 0x00000100 +#define INTERNET_STATE_BUSY 0x00000200 #define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1L)) @@ -593,7 +593,7 @@ BOOLAPI FtpGetCurrentDirectoryW(HINTERNET ,LPWSTR ,LPDWORD); typedef struct { CHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1]; - DWORD GopherType; + DWORD GopherType; DWORD SizeLow; DWORD SizeHigh; FILETIME LastModificationTime; @@ -602,7 +602,7 @@ typedef struct { typedef struct { WCHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1]; - DWORD GopherType; + DWORD GopherType; DWORD SizeLow; DWORD SizeHigh; FILETIME LastModificationTime; @@ -820,8 +820,8 @@ DECL_WINELIB_TYPE_AW(GOPHER_UNKNOWN_ATTRIBUTE_TYPE) DECL_WINELIB_TYPE_AW(LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE) typedef struct { - DWORD CategoryId; - DWORD AttributeId; + DWORD CategoryId; + DWORD AttributeId; union { GOPHER_ADMIN_ATTRIBUTE_TYPEA Admin; GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate; @@ -844,8 +844,8 @@ typedef struct { } GOPHER_ATTRIBUTE_TYPEA, *LPGOPHER_ATTRIBUTE_TYPEA; typedef struct { - DWORD CategoryId; - DWORD AttributeId; + DWORD CategoryId; + DWORD AttributeId; union { GOPHER_ADMIN_ATTRIBUTE_TYPEW Admin; GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate; @@ -870,9 +870,9 @@ typedef struct { DECL_WINELIB_TYPE_AW(GOPHER_ATTRIBUTE_TYPE) DECL_WINELIB_TYPE_AW(LPGOPHER_ATTRIBUTE_TYPE) -#define MAX_GOPHER_CATEGORY_NAME 128 -#define MAX_GOPHER_ATTRIBUTE_NAME 128 -#define MIN_GOPHER_ATTRIBUTE_LENGTH 256 +#define MAX_GOPHER_CATEGORY_NAME 128 +#define MAX_GOPHER_ATTRIBUTE_NAME 128 +#define MIN_GOPHER_ATTRIBUTE_LENGTH 256 #define GOPHER_INFO_CATEGORY TEXT("+INFO") #define GOPHER_ADMIN_CATEGORY TEXT("+ADMIN") @@ -976,11 +976,11 @@ BOOLAPI GopherGetAttributeW(HINTERNET ,LPCWSTR ,LPCWSTR lpszAttributeName ,LPBYT #define HTTP_QUERY_COST 15 #define HTTP_QUERY_LINK 16 #define HTTP_QUERY_PRAGMA 17 -#define HTTP_QUERY_VERSION 18 -#define HTTP_QUERY_STATUS_CODE 19 -#define HTTP_QUERY_STATUS_TEXT 20 -#define HTTP_QUERY_RAW_HEADERS 21 -#define HTTP_QUERY_RAW_HEADERS_CRLF 22 +#define HTTP_QUERY_VERSION 18 +#define HTTP_QUERY_STATUS_CODE 19 +#define HTTP_QUERY_STATUS_TEXT 20 +#define HTTP_QUERY_RAW_HEADERS 21 +#define HTTP_QUERY_RAW_HEADERS_CRLF 22 #define HTTP_QUERY_CONNECTION 23 #define HTTP_QUERY_ACCEPT 24 #define HTTP_QUERY_ACCEPT_CHARSET 25 @@ -1003,7 +1003,7 @@ BOOLAPI GopherGetAttributeW(HINTERNET ,LPCWSTR ,LPCWSTR lpszAttributeName ,LPBYT #define HTTP_QUERY_ACCEPT_RANGES 42 #define HTTP_QUERY_SET_COOKIE 43 #define HTTP_QUERY_COOKIE 44 -#define HTTP_QUERY_REQUEST_METHOD 45 +#define HTTP_QUERY_REQUEST_METHOD 45 #define HTTP_QUERY_REFRESH 46 #define HTTP_QUERY_CONTENT_DISPOSITION 47 #define HTTP_QUERY_AGE 48 @@ -1039,44 +1039,44 @@ BOOLAPI GopherGetAttributeW(HINTERNET ,LPCWSTR ,LPCWSTR lpszAttributeName ,LPBYT ) #define HTTP_QUERY_HEADER_MASK (~HTTP_QUERY_MODIFIER_FLAGS_MASK) -#define HTTP_STATUS_CONTINUE 100 -#define HTTP_STATUS_SWITCH_PROTOCOLS 101 -#define HTTP_STATUS_OK 200 -#define HTTP_STATUS_CREATED 201 -#define HTTP_STATUS_ACCEPTED 202 -#define HTTP_STATUS_PARTIAL 203 -#define HTTP_STATUS_NO_CONTENT 204 -#define HTTP_STATUS_RESET_CONTENT 205 -#define HTTP_STATUS_PARTIAL_CONTENT 206 -#define HTTP_STATUS_AMBIGUOUS 300 -#define HTTP_STATUS_MOVED 301 -#define HTTP_STATUS_REDIRECT 302 -#define HTTP_STATUS_REDIRECT_METHOD 303 -#define HTTP_STATUS_NOT_MODIFIED 304 -#define HTTP_STATUS_USE_PROXY 305 -#define HTTP_STATUS_REDIRECT_KEEP_VERB 307 -#define HTTP_STATUS_BAD_REQUEST 400 -#define HTTP_STATUS_DENIED 401 -#define HTTP_STATUS_PAYMENT_REQ 402 -#define HTTP_STATUS_FORBIDDEN 403 -#define HTTP_STATUS_NOT_FOUND 404 -#define HTTP_STATUS_BAD_METHOD 405 -#define HTTP_STATUS_NONE_ACCEPTABLE 406 -#define HTTP_STATUS_PROXY_AUTH_REQ 407 -#define HTTP_STATUS_REQUEST_TIMEOUT 408 -#define HTTP_STATUS_CONFLICT 409 -#define HTTP_STATUS_GONE 410 -#define HTTP_STATUS_LENGTH_REQUIRED 411 -#define HTTP_STATUS_PRECOND_FAILED 412 -#define HTTP_STATUS_REQUEST_TOO_LARGE 413 -#define HTTP_STATUS_URI_TOO_LONG 414 -#define HTTP_STATUS_UNSUPPORTED_MEDIA 415 -#define HTTP_STATUS_SERVER_ERROR 500 -#define HTTP_STATUS_NOT_SUPPORTED 501 -#define HTTP_STATUS_BAD_GATEWAY 502 -#define HTTP_STATUS_SERVICE_UNAVAIL 503 -#define HTTP_STATUS_GATEWAY_TIMEOUT 504 -#define HTTP_STATUS_VERSION_NOT_SUP 505 +#define HTTP_STATUS_CONTINUE 100 +#define HTTP_STATUS_SWITCH_PROTOCOLS 101 +#define HTTP_STATUS_OK 200 +#define HTTP_STATUS_CREATED 201 +#define HTTP_STATUS_ACCEPTED 202 +#define HTTP_STATUS_PARTIAL 203 +#define HTTP_STATUS_NO_CONTENT 204 +#define HTTP_STATUS_RESET_CONTENT 205 +#define HTTP_STATUS_PARTIAL_CONTENT 206 +#define HTTP_STATUS_AMBIGUOUS 300 +#define HTTP_STATUS_MOVED 301 +#define HTTP_STATUS_REDIRECT 302 +#define HTTP_STATUS_REDIRECT_METHOD 303 +#define HTTP_STATUS_NOT_MODIFIED 304 +#define HTTP_STATUS_USE_PROXY 305 +#define HTTP_STATUS_REDIRECT_KEEP_VERB 307 +#define HTTP_STATUS_BAD_REQUEST 400 +#define HTTP_STATUS_DENIED 401 +#define HTTP_STATUS_PAYMENT_REQ 402 +#define HTTP_STATUS_FORBIDDEN 403 +#define HTTP_STATUS_NOT_FOUND 404 +#define HTTP_STATUS_BAD_METHOD 405 +#define HTTP_STATUS_NONE_ACCEPTABLE 406 +#define HTTP_STATUS_PROXY_AUTH_REQ 407 +#define HTTP_STATUS_REQUEST_TIMEOUT 408 +#define HTTP_STATUS_CONFLICT 409 +#define HTTP_STATUS_GONE 410 +#define HTTP_STATUS_LENGTH_REQUIRED 411 +#define HTTP_STATUS_PRECOND_FAILED 412 +#define HTTP_STATUS_REQUEST_TOO_LARGE 413 +#define HTTP_STATUS_URI_TOO_LONG 414 +#define HTTP_STATUS_UNSUPPORTED_MEDIA 415 +#define HTTP_STATUS_SERVER_ERROR 500 +#define HTTP_STATUS_NOT_SUPPORTED 501 +#define HTTP_STATUS_BAD_GATEWAY 502 +#define HTTP_STATUS_SERVICE_UNAVAIL 503 +#define HTTP_STATUS_GATEWAY_TIMEOUT 504 +#define HTTP_STATUS_VERSION_NOT_SUP 505 #define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE #define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP @@ -1110,12 +1110,12 @@ INTERNETAPI BOOL WINAPI HttpSendRequestExW(HINTERNET ,LPINTERNET_BUFFERSW lpBuff LPINTERNET_BUFFERSW lpBuffersOut ,DWORD ,DWORD); #define HttpSendRequestEx WINELIB_NAME_AW(HttpSendRequestEx) -#define HSR_ASYNC WININET_API_FLAG_ASYNC -#define HSR_SYNC WININET_API_FLAG_SYNC -#define HSR_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT -#define HSR_INITIATE 0x00000008 -#define HSR_DOWNLOAD 0x00000010 -#define HSR_CHUNKED 0x00000020 +#define HSR_ASYNC WININET_API_FLAG_ASYNC +#define HSR_SYNC WININET_API_FLAG_SYNC +#define HSR_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT +#define HSR_INITIATE 0x00000008 +#define HSR_DOWNLOAD 0x00000010 +#define HSR_CHUNKED 0x00000020 INTERNETAPI BOOL WINAPI HttpEndRequestA(HINTERNET ,LPINTERNET_BUFFERSA lpBuffersOut ,DWORD ,DWORD); INTERNETAPI BOOL WINAPI HttpEndRequestW(HINTERNET ,LPINTERNET_BUFFERSW lpBuffersOut ,DWORD ,DWORD); @@ -1151,10 +1151,10 @@ typedef DWORD (CALLBACK *PFN_AUTH_NOTIFY) (DWORD,DWORD,LPVOID); typedef struct { - DWORD cbStruct; - DWORD dwOptions; - PFN_AUTH_NOTIFY pfnNotify; - DWORD dwContext; + DWORD cbStruct; + DWORD dwOptions; + PFN_AUTH_NOTIFY pfnNotify; + DWORD dwContext; } INTERNET_AUTH_NOTIFY_DATA; @@ -1271,43 +1271,43 @@ INTERNETAPI DWORD WINAPI InternetConfirmZoneCrossingW(HWND ,LPWSTR ,LPWSTR ,BOOL typedef struct _INTERNET_CACHE_ENTRY_INFOA { - DWORD dwStructSize; - LPSTR lpszSourceUrlName; - LPSTR lpszLocalFileName; - DWORD CacheEntryType; - DWORD dwUseCount; - DWORD dwHitRate; - DWORD dwSizeLow; - DWORD dwSizeHigh; - FILETIME LastModifiedTime; - FILETIME ExpireTime; - FILETIME LastAccessTime; - FILETIME LastSyncTime; - - LPBYTE lpHeaderInfo; - DWORD dwHeaderInfoSize; - LPSTR lpszFileExtension; - union { + DWORD dwStructSize; + LPSTR lpszSourceUrlName; + LPSTR lpszLocalFileName; + DWORD CacheEntryType; + DWORD dwUseCount; + DWORD dwHitRate; + DWORD dwSizeLow; + DWORD dwSizeHigh; + FILETIME LastModifiedTime; + FILETIME ExpireTime; + FILETIME LastAccessTime; + FILETIME LastSyncTime; + + LPBYTE lpHeaderInfo; + DWORD dwHeaderInfoSize; + LPSTR lpszFileExtension; + union { DWORD dwReserved; DWORD dwExemptDelta; } u; } INTERNET_CACHE_ENTRY_INFOA,* LPINTERNET_CACHE_ENTRY_INFOA; typedef struct _INTERNET_CACHE_ENTRY_INFOW { - DWORD dwStructSize; - LPWSTR lpszSourceUrlName; - LPWSTR lpszLocalFileName; - DWORD CacheEntryType; - DWORD dwUseCount; - DWORD dwHitRate; - DWORD dwSizeLow; - DWORD dwSizeHigh; - FILETIME LastModifiedTime; - FILETIME ExpireTime; - FILETIME LastAccessTime; - FILETIME LastSyncTime; - - LPBYTE lpHeaderInfo; + DWORD dwStructSize; + LPWSTR lpszSourceUrlName; + LPWSTR lpszLocalFileName; + DWORD CacheEntryType; + DWORD dwUseCount; + DWORD dwHitRate; + DWORD dwSizeLow; + DWORD dwSizeHigh; + FILETIME LastModifiedTime; + FILETIME ExpireTime; + FILETIME LastAccessTime; + FILETIME LastSyncTime; + + LPBYTE lpHeaderInfo; DWORD dwHeaderInfoSize; LPWSTR lpszFileExtension; union { @@ -1441,11 +1441,11 @@ INTERNETAPI BOOL WINAPI InternetSetDialStateW(LPCWSTR ,DWORD ,DWORD); #define INTERNET_DIALSTATE_DISCONNECTED 1 BOOLAPI InternetCheckConnectionA(LPCSTR lpszUrl,DWORD dwFlags,DWORD dwReserved); -BOOLAPI InternetCheckConnectionW(LPCWSTR lpszUrl,DWORD dwFlags,DWORD dwReserved); +BOOLAPI InternetCheckConnectionW(LPCWSTR lpszUrl,DWORD dwFlags,DWORD dwReserved); #define InternetCheckConnection WINELIB_NAME_AW(InternetCheckConnection) #ifdef __cplusplus } #endif -#endif +#endif diff --git a/include/winioctl.h b/include/winioctl.h index f1064cd2864..d73cc3054aa 100644 --- a/include/winioctl.h +++ b/include/winioctl.h @@ -105,7 +105,7 @@ #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) /* decommissioned fsctl value 9 */ #define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) /* decommissioned fsctl value 13 */ #define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS) @@ -121,10 +121,10 @@ #define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) /* Start: _WIN32_WINNT >= 0x0400 */ #define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSCTL_GET_HFS_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS) @@ -136,28 +136,28 @@ #define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS) /* decommissioned fsctl value 36 */ #define FSCTL_DUMP_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_WRITE_DATA) -#define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_WRITE_DATA) -#define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_WRITE_DATA) -#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_WRITE_DATA) -#define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_READ_DATA) -#define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA) -#define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_READ_DATA) #define FSCTL_SET_OBJECT_ID_EXTENDED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_WRITE_DATA -#define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_WRITE_DATA) -#define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA) -#define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA) +#define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA) #define FSCTL_ENABLE_UPGRADE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA) -#define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS) #define FSCTL_ENCRYPTION_FSCTL_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_READ_DATA) -#define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_READ_DATA) -#define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_ANY_ACCESS) +#define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_READ_DATA) +#define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_READ_DATA) #define FSCTL_EXTEND_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS) /* End: _WIN32_WINNT >= 0x0500 */ @@ -173,7 +173,7 @@ #define IOCTL_STORAGE_FIND_NEW_DEVICES CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS) #define IOCTL_STORAGE_EJECTION_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_STORAGE_MCN_CONTROL CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS) - + #define IOCTL_STORAGE_GET_MEDIA_TYPES CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_STORAGE_GET_MEDIA_TYPES_EX CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -209,12 +209,12 @@ #define IOCTL_DISK_GET_MEDIA_TYPES CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS) -/* Start: For _WIN32_WINNT >= 0x0400 */ +/* Start: For _WIN32_WINNT >= 0x0400 */ #define IOCTL_DISK_CONTROLLER_NUMBER CTL_CODE(IOCTL_DISK_BASE, 0x0011, METHOD_BUFFERED, FILE_ANY_ACCESS) #define SMART_GET_VERSION CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS) #define SMART_SEND_DRIVE_COMMAND CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define SMART_RCV_DRIVE_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -/* End: For _WIN32_WINNT >= 0x0400 */ +/* End: For _WIN32_WINNT >= 0x0400 */ #define IOCTL_SERIAL_LSRMST_INSERT CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS) @@ -240,7 +240,7 @@ typedef enum _MEDIA_TYPE { Unknown, F5_1Pt2_512, F3_1Pt44_512, F3_2Pt88_512, F3_20Pt8_512, F3_720_512, F5_360_512, F5_320_512, F5_320_1024, F5_180_512, F5_160_512, RemovableMedia, FixedMedia, F3_120M_512, F3_640_512, F5_640_512, F5_720_512, F3_1Pt2_512, F3_1Pt23_1024, F5_1Pt23_1024, F3_128Mb_512, - F3_230Mb_512, F8_256_128 + F3_230Mb_512, F8_256_128 } MEDIA_TYPE, *PMEDIA_TYPE; typedef struct _FORMAT_PARAMETERS { @@ -250,10 +250,10 @@ typedef struct _FORMAT_PARAMETERS { DWORD StartHeadNumber; DWORD EndHeadNumber; } FORMAT_PARAMETERS, *PFORMAT_PARAMETERS; - + typedef WORD BAD_TRACK_NUMBER; typedef WORD *PBAD_TRACK_NUMBER; - + typedef struct _FORMAT_EX_PARAMETERS { MEDIA_TYPE MediaType; DWORD StartCylinderNumber; @@ -264,7 +264,7 @@ typedef struct _FORMAT_EX_PARAMETERS { WORD SectorsPerTrack; WORD SectorNumber[1]; } FORMAT_EX_PARAMETERS, *PFORMAT_EX_PARAMETERS; - + typedef struct _DISK_GEOMETRY { LARGE_INTEGER Cylinders; MEDIA_TYPE MediaType; @@ -272,7 +272,7 @@ typedef struct _DISK_GEOMETRY { DWORD SectorsPerTrack; DWORD BytesPerSector; } DISK_GEOMETRY, *PDISK_GEOMETRY; - + typedef struct _PARTITION_INFORMATION { LARGE_INTEGER StartingOffset; LARGE_INTEGER PartitionLength; @@ -283,28 +283,28 @@ typedef struct _PARTITION_INFORMATION { BOOLEAN RecognizedPartition; BOOLEAN RewritePartition; } PARTITION_INFORMATION, *PPARTITION_INFORMATION; - + typedef struct _SET_PARTITION_INFORMATION { BYTE PartitionType; } SET_PARTITION_INFORMATION, *PSET_PARTITION_INFORMATION; - + typedef struct _DRIVE_LAYOUT_INFORMATION { DWORD PartitionCount; DWORD Signature; PARTITION_INFORMATION PartitionEntry[1]; } DRIVE_LAYOUT_INFORMATION, *PDRIVE_LAYOUT_INFORMATION; - + typedef struct _VERIFY_INFORMATION { LARGE_INTEGER StartingOffset; DWORD Length; } VERIFY_INFORMATION, *PVERIFY_INFORMATION; - + typedef struct _REASSIGN_BLOCKS { WORD Reserved; WORD Count; DWORD BlockNumber[1]; } REASSIGN_BLOCKS, *PREASSIGN_BLOCKS; - + #if(_WIN32_WINNT >= 0x0400) typedef struct _DISK_CONTROLLER_NUMBER { DWORD ControllerNumber; @@ -317,15 +317,15 @@ typedef struct _DISK_CONTROLLER_NUMBER { */ typedef struct tagDIOCRegs { DWORD reg_EBX; - DWORD reg_EDX; - DWORD reg_ECX; + DWORD reg_EDX; + DWORD reg_ECX; DWORD reg_EAX; DWORD reg_EDI; DWORD reg_ESI; DWORD reg_Flags; -} DIOC_REGISTERS, *PDIOC_REGISTERS; +} DIOC_REGISTERS, *PDIOC_REGISTERS; -/* Start VWIN32 information: +/* Start VWIN32 information: * VWIN32 is a VxD which supports the MSDOS Io routines. */ #define VWIN32_DIOC_DOS_IOCTL 1 /* This is the specified MS-DOS device I/O ctl - Interrupt 21h Function 4400h - 4411h */ @@ -368,7 +368,7 @@ typedef struct _FILE_FS_VOLUME_INFORMATION { /* FileFsLabelInformation = 2 */ /* - unknown + unknown */ /* FileFsSizeInformation = 3 */ diff --git a/include/winnls.h b/include/winnls.h index 9d313973eb2..7cec81bcba3 100644 --- a/include/winnls.h +++ b/include/winnls.h @@ -27,12 +27,12 @@ extern "C" { #endif -#define MB_PRECOMPOSED 0x00000001 +#define MB_PRECOMPOSED 0x00000001 #define MB_COMPOSITE 0x00000002 #define MB_USEGLYPHCHARS 0x00000004 #define MB_ERR_INVALID_CHARS 0x00000008 -#define LCID_INSTALLED 0x00000001 +#define LCID_INSTALLED 0x00000001 /* flags to GetLocaleInfo */ #define LOCALE_NOUSEROVERRIDE 0x80000000 @@ -44,106 +44,106 @@ extern "C" { /* When adding new defines, don't forget to add an entry to the * locale_name2id map in ole/ole2nls.c */ -#define LOCALE_ILANGUAGE 0x00000001 -#define LOCALE_SLANGUAGE 0x00000002 -#define LOCALE_SENGLANGUAGE 0x00001001 -#define LOCALE_SABBREVLANGNAME 0x00000003 -#define LOCALE_SNATIVELANGNAME 0x00000004 -#define LOCALE_ICOUNTRY 0x00000005 -#define LOCALE_SCOUNTRY 0x00000006 -#define LOCALE_SENGCOUNTRY 0x00001002 -#define LOCALE_SABBREVCTRYNAME 0x00000007 -#define LOCALE_SNATIVECTRYNAME 0x00000008 -#define LOCALE_IDEFAULTLANGUAGE 0x00000009 -#define LOCALE_IDEFAULTCOUNTRY 0x0000000A -#define LOCALE_IDEFAULTCODEPAGE 0x0000000B -#define LOCALE_IDEFAULTANSICODEPAGE 0x00001004 +#define LOCALE_ILANGUAGE 0x00000001 +#define LOCALE_SLANGUAGE 0x00000002 +#define LOCALE_SENGLANGUAGE 0x00001001 +#define LOCALE_SABBREVLANGNAME 0x00000003 +#define LOCALE_SNATIVELANGNAME 0x00000004 +#define LOCALE_ICOUNTRY 0x00000005 +#define LOCALE_SCOUNTRY 0x00000006 +#define LOCALE_SENGCOUNTRY 0x00001002 +#define LOCALE_SABBREVCTRYNAME 0x00000007 +#define LOCALE_SNATIVECTRYNAME 0x00000008 +#define LOCALE_IDEFAULTLANGUAGE 0x00000009 +#define LOCALE_IDEFAULTCOUNTRY 0x0000000A +#define LOCALE_IDEFAULTCODEPAGE 0x0000000B +#define LOCALE_IDEFAULTANSICODEPAGE 0x00001004 #define LOCALE_IDEFAULTMACCODEPAGE 0x00001011 -#define LOCALE_SLIST 0x0000000C -#define LOCALE_IMEASURE 0x0000000D -#define LOCALE_SDECIMAL 0x0000000E -#define LOCALE_STHOUSAND 0x0000000F -#define LOCALE_SGROUPING 0x00000010 -#define LOCALE_IDIGITS 0x00000011 -#define LOCALE_ILZERO 0x00000012 -#define LOCALE_INEGNUMBER 0x00001010 -#define LOCALE_SNATIVEDIGITS 0x00000013 -#define LOCALE_SCURRENCY 0x00000014 -#define LOCALE_SINTLSYMBOL 0x00000015 -#define LOCALE_SMONDECIMALSEP 0x00000016 -#define LOCALE_SMONTHOUSANDSEP 0x00000017 -#define LOCALE_SMONGROUPING 0x00000018 -#define LOCALE_ICURRDIGITS 0x00000019 -#define LOCALE_IINTLCURRDIGITS 0x0000001A -#define LOCALE_ICURRENCY 0x0000001B -#define LOCALE_INEGCURR 0x0000001C -#define LOCALE_SDATE 0x0000001D -#define LOCALE_STIME 0x0000001E -#define LOCALE_SSHORTDATE 0x0000001F -#define LOCALE_SLONGDATE 0x00000020 -#define LOCALE_STIMEFORMAT 0x00001003 -#define LOCALE_IDATE 0x00000021 -#define LOCALE_ILDATE 0x00000022 -#define LOCALE_ITIME 0x00000023 -#define LOCALE_ITIMEMARKPOSN 0x00001005 -#define LOCALE_ICENTURY 0x00000024 -#define LOCALE_ITLZERO 0x00000025 -#define LOCALE_IDAYLZERO 0x00000026 -#define LOCALE_IMONLZERO 0x00000027 -#define LOCALE_S1159 0x00000028 -#define LOCALE_S2359 0x00000029 -#define LOCALE_ICALENDARTYPE 0x00001009 -#define LOCALE_IOPTIONALCALENDAR 0x0000100B -#define LOCALE_IFIRSTDAYOFWEEK 0x0000100C -#define LOCALE_IFIRSTWEEKOFYEAR 0x0000100D -#define LOCALE_SDAYNAME1 0x0000002A -#define LOCALE_SDAYNAME2 0x0000002B -#define LOCALE_SDAYNAME3 0x0000002C -#define LOCALE_SDAYNAME4 0x0000002D -#define LOCALE_SDAYNAME5 0x0000002E -#define LOCALE_SDAYNAME6 0x0000002F -#define LOCALE_SDAYNAME7 0x00000030 -#define LOCALE_SABBREVDAYNAME1 0x00000031 -#define LOCALE_SABBREVDAYNAME2 0x00000032 -#define LOCALE_SABBREVDAYNAME3 0x00000033 -#define LOCALE_SABBREVDAYNAME4 0x00000034 -#define LOCALE_SABBREVDAYNAME5 0x00000035 -#define LOCALE_SABBREVDAYNAME6 0x00000036 -#define LOCALE_SABBREVDAYNAME7 0x00000037 -#define LOCALE_SMONTHNAME1 0x00000038 -#define LOCALE_SMONTHNAME2 0x00000039 -#define LOCALE_SMONTHNAME3 0x0000003A -#define LOCALE_SMONTHNAME4 0x0000003B -#define LOCALE_SMONTHNAME5 0x0000003C -#define LOCALE_SMONTHNAME6 0x0000003D -#define LOCALE_SMONTHNAME7 0x0000003E -#define LOCALE_SMONTHNAME8 0x0000003F -#define LOCALE_SMONTHNAME9 0x00000040 -#define LOCALE_SMONTHNAME10 0x00000041 -#define LOCALE_SMONTHNAME11 0x00000042 -#define LOCALE_SMONTHNAME12 0x00000043 -#define LOCALE_SMONTHNAME13 0x0000100E -#define LOCALE_SABBREVMONTHNAME1 0x00000044 -#define LOCALE_SABBREVMONTHNAME2 0x00000045 -#define LOCALE_SABBREVMONTHNAME3 0x00000046 -#define LOCALE_SABBREVMONTHNAME4 0x00000047 -#define LOCALE_SABBREVMONTHNAME5 0x00000048 -#define LOCALE_SABBREVMONTHNAME6 0x00000049 -#define LOCALE_SABBREVMONTHNAME7 0x0000004A -#define LOCALE_SABBREVMONTHNAME8 0x0000004B -#define LOCALE_SABBREVMONTHNAME9 0x0000004C -#define LOCALE_SABBREVMONTHNAME10 0x0000004D -#define LOCALE_SABBREVMONTHNAME11 0x0000004E -#define LOCALE_SABBREVMONTHNAME12 0x0000004F -#define LOCALE_SABBREVMONTHNAME13 0x0000100F -#define LOCALE_SPOSITIVESIGN 0x00000050 -#define LOCALE_SNEGATIVESIGN 0x00000051 -#define LOCALE_IPOSSIGNPOSN 0x00000052 -#define LOCALE_INEGSIGNPOSN 0x00000053 -#define LOCALE_IPOSSYMPRECEDES 0x00000054 -#define LOCALE_IPOSSEPBYSPACE 0x00000055 -#define LOCALE_INEGSYMPRECEDES 0x00000056 -#define LOCALE_INEGSEPBYSPACE 0x00000057 +#define LOCALE_SLIST 0x0000000C +#define LOCALE_IMEASURE 0x0000000D +#define LOCALE_SDECIMAL 0x0000000E +#define LOCALE_STHOUSAND 0x0000000F +#define LOCALE_SGROUPING 0x00000010 +#define LOCALE_IDIGITS 0x00000011 +#define LOCALE_ILZERO 0x00000012 +#define LOCALE_INEGNUMBER 0x00001010 +#define LOCALE_SNATIVEDIGITS 0x00000013 +#define LOCALE_SCURRENCY 0x00000014 +#define LOCALE_SINTLSYMBOL 0x00000015 +#define LOCALE_SMONDECIMALSEP 0x00000016 +#define LOCALE_SMONTHOUSANDSEP 0x00000017 +#define LOCALE_SMONGROUPING 0x00000018 +#define LOCALE_ICURRDIGITS 0x00000019 +#define LOCALE_IINTLCURRDIGITS 0x0000001A +#define LOCALE_ICURRENCY 0x0000001B +#define LOCALE_INEGCURR 0x0000001C +#define LOCALE_SDATE 0x0000001D +#define LOCALE_STIME 0x0000001E +#define LOCALE_SSHORTDATE 0x0000001F +#define LOCALE_SLONGDATE 0x00000020 +#define LOCALE_STIMEFORMAT 0x00001003 +#define LOCALE_IDATE 0x00000021 +#define LOCALE_ILDATE 0x00000022 +#define LOCALE_ITIME 0x00000023 +#define LOCALE_ITIMEMARKPOSN 0x00001005 +#define LOCALE_ICENTURY 0x00000024 +#define LOCALE_ITLZERO 0x00000025 +#define LOCALE_IDAYLZERO 0x00000026 +#define LOCALE_IMONLZERO 0x00000027 +#define LOCALE_S1159 0x00000028 +#define LOCALE_S2359 0x00000029 +#define LOCALE_ICALENDARTYPE 0x00001009 +#define LOCALE_IOPTIONALCALENDAR 0x0000100B +#define LOCALE_IFIRSTDAYOFWEEK 0x0000100C +#define LOCALE_IFIRSTWEEKOFYEAR 0x0000100D +#define LOCALE_SDAYNAME1 0x0000002A +#define LOCALE_SDAYNAME2 0x0000002B +#define LOCALE_SDAYNAME3 0x0000002C +#define LOCALE_SDAYNAME4 0x0000002D +#define LOCALE_SDAYNAME5 0x0000002E +#define LOCALE_SDAYNAME6 0x0000002F +#define LOCALE_SDAYNAME7 0x00000030 +#define LOCALE_SABBREVDAYNAME1 0x00000031 +#define LOCALE_SABBREVDAYNAME2 0x00000032 +#define LOCALE_SABBREVDAYNAME3 0x00000033 +#define LOCALE_SABBREVDAYNAME4 0x00000034 +#define LOCALE_SABBREVDAYNAME5 0x00000035 +#define LOCALE_SABBREVDAYNAME6 0x00000036 +#define LOCALE_SABBREVDAYNAME7 0x00000037 +#define LOCALE_SMONTHNAME1 0x00000038 +#define LOCALE_SMONTHNAME2 0x00000039 +#define LOCALE_SMONTHNAME3 0x0000003A +#define LOCALE_SMONTHNAME4 0x0000003B +#define LOCALE_SMONTHNAME5 0x0000003C +#define LOCALE_SMONTHNAME6 0x0000003D +#define LOCALE_SMONTHNAME7 0x0000003E +#define LOCALE_SMONTHNAME8 0x0000003F +#define LOCALE_SMONTHNAME9 0x00000040 +#define LOCALE_SMONTHNAME10 0x00000041 +#define LOCALE_SMONTHNAME11 0x00000042 +#define LOCALE_SMONTHNAME12 0x00000043 +#define LOCALE_SMONTHNAME13 0x0000100E +#define LOCALE_SABBREVMONTHNAME1 0x00000044 +#define LOCALE_SABBREVMONTHNAME2 0x00000045 +#define LOCALE_SABBREVMONTHNAME3 0x00000046 +#define LOCALE_SABBREVMONTHNAME4 0x00000047 +#define LOCALE_SABBREVMONTHNAME5 0x00000048 +#define LOCALE_SABBREVMONTHNAME6 0x00000049 +#define LOCALE_SABBREVMONTHNAME7 0x0000004A +#define LOCALE_SABBREVMONTHNAME8 0x0000004B +#define LOCALE_SABBREVMONTHNAME9 0x0000004C +#define LOCALE_SABBREVMONTHNAME10 0x0000004D +#define LOCALE_SABBREVMONTHNAME11 0x0000004E +#define LOCALE_SABBREVMONTHNAME12 0x0000004F +#define LOCALE_SABBREVMONTHNAME13 0x0000100F +#define LOCALE_SPOSITIVESIGN 0x00000050 +#define LOCALE_SNEGATIVESIGN 0x00000051 +#define LOCALE_IPOSSIGNPOSN 0x00000052 +#define LOCALE_INEGSIGNPOSN 0x00000053 +#define LOCALE_IPOSSYMPRECEDES 0x00000054 +#define LOCALE_IPOSSEPBYSPACE 0x00000055 +#define LOCALE_INEGSYMPRECEDES 0x00000056 +#define LOCALE_INEGSEPBYSPACE 0x00000057 #define LOCALE_FONTSIGNATURE 0x00000058 #define LOCALE_SISO639LANGNAME 0x00000059 #define LOCALE_SISO3166CTRYNAME 0x0000005A @@ -214,7 +214,7 @@ extern "C" { IS_TEXT_UNICODE_SIGNATURE| \ IS_TEXT_UNICODE_ODD_LENGTH - + /* Character Type Flags */ #define CT_CTYPE1 0x00000001 /* usual ctype */ #define CT_CTYPE2 0x00000002 /* bidirectional layout info */ diff --git a/include/winnt.h b/include/winnt.h index 92d4d369df2..a3fa086b6a7 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -30,12 +30,12 @@ #endif -/* On Windows winnt.h depends on a few windef.h types and macros and thus - * is not self-contained. Furthermore windef.h includes winnt.h so that it +/* On Windows winnt.h depends on a few windef.h types and macros and thus + * is not self-contained. Furthermore windef.h includes winnt.h so that it * would be pointless to try to use winnt.h directly. - * But for Wine and Winelib I decided to make winnt.h self-contained by - * moving these definitions to winnt.h. It makes no difference to Winelib - * programs since they are not using winnt.h directly anyway, and it allows + * But for Wine and Winelib I decided to make winnt.h self-contained by + * moving these definitions to winnt.h. It makes no difference to Winelib + * programs since they are not using winnt.h directly anyway, and it allows * us to use winnt.h and get a minimal set of definitions. */ @@ -327,17 +327,17 @@ typedef WCHAR *PWSTR, *LPWSTR; typedef const WCHAR *PCWSTR, *LPCWSTR; /* Neutral character and string types */ -/* These are only defined for Winelib, i.e. _not_ defined for - * the emulator. The reason is they depend on the UNICODE +/* These are only defined for Winelib, i.e. _not_ defined for + * the emulator. The reason is they depend on the UNICODE * macro which only exists in the user's code. */ #ifndef __WINE__ # ifdef WINE_UNICODE_REWRITE -/* Use this if your compiler does not provide a 16bit wchar_t type. +/* Use this if your compiler does not provide a 16bit wchar_t type. * Note that you will need to specify -fwritable-strings or an option * to this effect. - * In C++ both WINE_UNICODE_TEXT('c') and WINE_UNICODE_TEXT("str") are + * In C++ both WINE_UNICODE_TEXT('c') and WINE_UNICODE_TEXT("str") are * supported, but only the string form can be supported in C. */ EXTERN_C unsigned short* wine_rewrite_s4tos2(const wchar_t* str4); @@ -358,12 +358,12 @@ inline WCHAR wine_unicode_text(wchar_t chr4) # else /* WINE_UNICODE_REWRITE */ /* Define WINE_UNICODE_NATIVE if: - * - your compiler provides a 16bit wchar_t type, e.g. gcc >= 2.96 with + * - your compiler provides a 16bit wchar_t type, e.g. gcc >= 2.96 with * -fshort-wchar option - * - or if you decide to use the native 32bit Unix wchar_t type. Be aware - * though that the Wine APIs only support 16bit WCHAR characters for + * - or if you decide to use the native 32bit Unix wchar_t type. Be aware + * though that the Wine APIs only support 16bit WCHAR characters for * binary compatibility reasons. - * - or define nothing at all if you don't use Unicode, and blissfully + * - or define nothing at all if you don't use Unicode, and blissfully * ignore the issue :-) */ # define WINE_UNICODE_TEXT(string) L##string @@ -403,15 +403,15 @@ typedef DWORD EXECUTION_STATE; * Here is the plan to convert Wine to STRICT: * * Types will be converted one at a time by volunteers who will compile - * Wine with STRICT turned on. Handles that have not been converted yet - * will be declared with DECLARE_OLD_HANDLE. Converted handles are + * Wine with STRICT turned on. Handles that have not been converted yet + * will be declared with DECLARE_OLD_HANDLE. Converted handles are * declared with DECLARE_HANDLE. * See the bug report 90 for more details: * http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=90 */ /* - * when compiling Wine we always treat HANDLE as an UINT. Then when - * we're ready we'll remove the '!defined(__WINE__)' (the equivalent + * when compiling Wine we always treat HANDLE as an UINT. Then when + * we're ready we'll remove the '!defined(__WINE__)' (the equivalent * of converting it from DECLARE_OLD_HANDLE to DECLARE_HANDLE). */ #if defined(STRICT) && !defined(__WINE__) @@ -604,11 +604,11 @@ typedef struct _FLOATING_SAVE_AREA { DWORD ControlWord; DWORD StatusWord; - DWORD TagWord; + DWORD TagWord; DWORD ErrorOffset; DWORD ErrorSelector; DWORD DataOffset; - DWORD DataSelector; + DWORD DataSelector; BYTE RegisterArea[SIZE_OF_80387_REGISTERS]; DWORD Cr0NpxState; } FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA; @@ -634,18 +634,18 @@ typedef struct _CONTEXT86 DWORD SegGs; DWORD SegFs; DWORD SegEs; - DWORD SegDs; + DWORD SegDs; /* These are selected by CONTEXT_INTEGER */ DWORD Edi; DWORD Esi; DWORD Ebx; - DWORD Edx; + DWORD Edx; DWORD Ecx; DWORD Eax; /* These are selected by CONTEXT_CONTROL */ - DWORD Ebp; + DWORD Ebp; DWORD Eip; DWORD SegCs; DWORD EFlags; @@ -684,7 +684,7 @@ typedef CONTEXT86 CONTEXT; #ifdef _ALPHA_ #define CONTEXT_ALPHA 0x00020000 - + #define CONTEXT_CONTROL (CONTEXT_ALPHA | 0x00000001L) #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L) #define CONTEXT_INTEGER (CONTEXT_ALPHA | 0x00000004L) @@ -999,10 +999,10 @@ typedef struct _STACK_FRAME_HEADER #ifdef __sparc__ -/* - * FIXME: +/* + * FIXME: * - * There is no official CONTEXT structure defined for the SPARC + * There is no official CONTEXT structure defined for the SPARC * architecture, so I just made one up. * * This structure is valid only for 32-bit SPARC architectures, @@ -1012,8 +1012,8 @@ typedef struct _STACK_FRAME_HEADER * the rest of the register window chain is not visible. * * The layout follows the Solaris 'prgregset_t' structure. - * - */ + * + */ #define CONTEXT_SPARC 0x10000000 @@ -1234,7 +1234,7 @@ typedef CONTEXT *PCONTEXT; #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)) -#define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)) +#define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)) #define LOCALE_NEUTRAL (MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT)) /* FIXME: are the symbolic names correct for LIDs: 0x17, 0x20, 0x28, @@ -1544,8 +1544,8 @@ typedef CONTEXT *PCONTEXT; #define STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE 0x40000023 #define STATUS_NO_YIELD_PERFORMED 0x40000024 #define STATUS_TIMER_RESUME_IGNORED 0x40000025 - -#define STATUS_GUARD_PAGE_VIOLATION 0x80000001 + +#define STATUS_GUARD_PAGE_VIOLATION 0x80000001 #define STATUS_DATATYPE_MISALIGNMENT 0x80000002 #define STATUS_BREAKPOINT 0x80000003 #define STATUS_SINGLE_STEP 0x80000004 @@ -1707,7 +1707,7 @@ typedef CONTEXT *PCONTEXT; #define STATUS_NO_TOKEN 0xC000007C #define STATUS_BAD_INHERITANCE_ACL 0xC000007D #define STATUS_RANGE_NOT_LOCKED 0xC000007E -#define STATUS_DISK_FULL 0xC000007F +#define STATUS_DISK_FULL 0xC000007F #define STATUS_SERVER_DISABLED 0xC0000080 #define STATUS_SERVER_NOT_DISABLED 0xC0000081 #define STATUS_TOO_MANY_GUIDS_REQUESTED 0xC0000082 @@ -2216,9 +2216,9 @@ typedef CONTEXT *PCONTEXT; #define EXCEPTION_CONTINUABLE 0 #define EXCEPTION_NONCONTINUABLE EH_NONCONTINUABLE - + /* - * The exception record used by Win32 to give additional information + * The exception record used by Win32 to give additional information * about exception to exception handlers. */ @@ -2239,8 +2239,8 @@ typedef struct __EXCEPTION_RECORD * The exception pointers structure passed to exception filters * in except() and the UnhandledExceptionFilter(). */ - -typedef struct _EXCEPTION_POINTERS + +typedef struct _EXCEPTION_POINTERS { PEXCEPTION_RECORD ExceptionRecord; PCONTEXT ContextRecord; @@ -2248,8 +2248,8 @@ typedef struct _EXCEPTION_POINTERS /* - * The exception frame, used for registering exception handlers - * Win32 cares only about this, but compilers generally emit + * The exception frame, used for registering exception handlers + * Win32 cares only about this, but compilers generally emit * larger exception frames for their own use. */ @@ -2283,7 +2283,7 @@ WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter ); #define DBG_CONTROL_BREAK 0x40010008 #define DBG_EXCEPTION_NOT_HANDLED 0x80010001 -typedef struct _NT_TIB +typedef struct _NT_TIB { struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList; PVOID StackBase; @@ -2357,7 +2357,7 @@ typedef struct _IMAGE_DOS_HEADER { * This is the Windows executable (NE) header. * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way. */ -typedef struct +typedef struct { WORD ne_magic; /* 00 NE signature 'NE' */ BYTE ne_ver; /* 02 Linker version number */ @@ -2473,7 +2473,7 @@ typedef struct _IMAGE_VXD_HEADER { #define IMAGE_FILE_MACHINE_R4000 0x166 #define IMAGE_FILE_MACHINE_R10000 0x168 #define IMAGE_FILE_MACHINE_ALPHA 0x184 -#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 +#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 #define IMAGE_SIZEOF_FILE_HEADER 20 @@ -2621,8 +2621,8 @@ typedef struct _IMAGE_SECTION_HEADER { #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 -#define IMAGE_SCN_LNK_OTHER 0x00000100 -#define IMAGE_SCN_LNK_INFO 0x00000200 +#define IMAGE_SCN_LNK_OTHER 0x00000100 +#define IMAGE_SCN_LNK_INFO 0x00000200 /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */ #define IMAGE_SCN_LNK_REMOVE 0x00000800 #define IMAGE_SCN_LNK_COMDAT 0x00001000 @@ -2877,7 +2877,7 @@ typedef struct _IMAGE_IMPORT_DESCRIPTOR { DWORD ForwarderChain; /* -1 if no forwarders */ DWORD Name; /* RVA to IAT (if bound this IAT has actual addresses) */ - PIMAGE_THUNK_DATA FirstThunk; + PIMAGE_THUNK_DATA FirstThunk; } IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR; #define IMAGE_ORDINAL_FLAG 0x80000000 @@ -3261,7 +3261,7 @@ typedef struct _IMAGE_FUNCTION_ENTRY { } IMAGE_FUNCTION_ENTRY, *PIMAGE_FUNCTION_ENTRY; #define IMAGE_DEBUG_MISC_EXENAME 1 - + typedef struct _IMAGE_DEBUG_MISC { DWORD DataType; DWORD Length; @@ -3311,7 +3311,7 @@ typedef struct tagMESSAGE_RESOURCE_DATA { /* * Here follows typedefs for security and tokens. - */ + */ /* * First a constant for the following typdefs. @@ -3327,17 +3327,17 @@ typedef PVOID PACCESS_TOKEN; */ typedef enum _TOKEN_INFORMATION_CLASS { - TokenUser = 1, - TokenGroups, - TokenPrivileges, - TokenOwner, - TokenPrimaryGroup, - TokenDefaultDacl, - TokenSource, - TokenType, - TokenImpersonationLevel, - TokenStatistics -} TOKEN_INFORMATION_CLASS; + TokenUser = 1, + TokenGroups, + TokenPrivileges, + TokenOwner, + TokenPrimaryGroup, + TokenDefaultDacl, + TokenSource, + TokenType, + TokenImpersonationLevel, + TokenStatistics +} TOKEN_INFORMATION_CLASS; #define TOKEN_TOKEN_ADJUST_DEFAULT 0x0080 #define TOKEN_ADJUST_GROUPS 0x0040 @@ -3401,8 +3401,8 @@ typedef struct _SID { #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */ -/* - * ACL +/* + * ACL */ #define ACL_REVISION1 1 @@ -3458,19 +3458,19 @@ typedef struct { PACL Dacl; } SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR; -#define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR)) +#define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR)) #endif /* _SECURITY_DEFINED */ -/* +/* * SID_AND_ATTRIBUTES */ typedef struct _SID_AND_ATTRIBUTES { - PSID Sid; - DWORD Attributes; -} SID_AND_ATTRIBUTES ; - + PSID Sid; + DWORD Attributes; +} SID_AND_ATTRIBUTES ; + /* security entities */ #define SECURITY_NULL_RID (0x00000000L) #define SECURITY_WORLD_RID (0x00000000L) @@ -3486,7 +3486,7 @@ typedef struct _SID_AND_ATTRIBUTES { /* S-1-3 */ #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} -#define SECURITY_CREATOR_OWNER_RID (0x00000000L) +#define SECURITY_CREATOR_OWNER_RID (0x00000000L) #define SECURITY_CREATOR_GROUP_RID (0x00000001L) #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L) #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L) @@ -3495,7 +3495,7 @@ typedef struct _SID_AND_ATTRIBUTES { #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} /* S-1-5 */ -#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} +#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} #define SECURITY_DIALUP_RID 0x00000001L #define SECURITY_NETWORK_RID 0x00000002L #define SECURITY_BATCH_RID 0x00000003L @@ -3530,17 +3530,17 @@ typedef struct _SID_AND_ATTRIBUTES { */ typedef struct _TOKEN_USER { - SID_AND_ATTRIBUTES User; -} TOKEN_USER; + SID_AND_ATTRIBUTES User; +} TOKEN_USER; /* * TOKEN_GROUPS */ typedef struct _TOKEN_GROUPS { - DWORD GroupCount; - SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; -} TOKEN_GROUPS; + DWORD GroupCount; + SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; +} TOKEN_GROUPS; /* * LUID_AND_ATTRIBUTES @@ -3603,63 +3603,63 @@ typedef struct _PRIVILEGE_SET { */ typedef struct _TOKEN_PRIVILEGES { - DWORD PrivilegeCount; - LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; -} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; + DWORD PrivilegeCount; + LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; +} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; /* * TOKEN_OWNER */ typedef struct _TOKEN_OWNER { - PSID Owner; -} TOKEN_OWNER; + PSID Owner; +} TOKEN_OWNER; /* * TOKEN_PRIMARY_GROUP */ typedef struct _TOKEN_PRIMARY_GROUP { - PSID PrimaryGroup; -} TOKEN_PRIMARY_GROUP; + PSID PrimaryGroup; +} TOKEN_PRIMARY_GROUP; /* * TOKEN_DEFAULT_DACL */ -typedef struct _TOKEN_DEFAULT_DACL { - PACL DefaultDacl; -} TOKEN_DEFAULT_DACL; +typedef struct _TOKEN_DEFAULT_DACL { + PACL DefaultDacl; +} TOKEN_DEFAULT_DACL; /* * TOKEN_SOURCEL */ typedef struct _TOKEN_SOURCE { - char Sourcename[8]; - LUID SourceIdentifier; -} TOKEN_SOURCE; + char Sourcename[8]; + LUID SourceIdentifier; +} TOKEN_SOURCE; /* * TOKEN_TYPE */ typedef enum tagTOKEN_TYPE { - TokenPrimary = 1, - TokenImpersonation -} TOKEN_TYPE; + TokenPrimary = 1, + TokenImpersonation +} TOKEN_TYPE; /* * SECURITY_IMPERSONATION_LEVEL */ typedef enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous, - SecurityIdentification, - SecurityImpersonation, - SecurityDelegation -} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; + SecurityAnonymous, + SecurityIdentification, + SecurityImpersonation, + SecurityDelegation +} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, @@ -3680,20 +3680,20 @@ typedef struct _SECURITY_QUALITY_OF_SERVICE { */ typedef struct _TOKEN_STATISTICS { - LUID TokenId; - LUID AuthenticationId; - LARGE_INTEGER ExpirationTime; - TOKEN_TYPE TokenType; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - DWORD DynamicCharged; - DWORD DynamicAvailable; - DWORD GroupCount; - DWORD PrivilegeCount; - LUID ModifiedId; -} TOKEN_STATISTICS; + LUID TokenId; + LUID AuthenticationId; + LARGE_INTEGER ExpirationTime; + TOKEN_TYPE TokenType; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + DWORD DynamicCharged; + DWORD DynamicAvailable; + DWORD GroupCount; + DWORD PrivilegeCount; + LUID ModifiedId; +} TOKEN_STATISTICS; -/* - * ACLs of NT +/* + * ACLs of NT */ #define ACL_REVISION 2 @@ -3725,7 +3725,7 @@ typedef struct _ACE_HEADER { #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40 #define FAILED_ACCESS_ACE_FLAG 0x80 -/* different ACEs depending on AceType +/* different ACEs depending on AceType * SidStart marks the begin of a SID * so the thing finally looks like this: * 0: ACE_HEADER @@ -3830,8 +3830,8 @@ typedef enum tagSID_NAME_USE { #define THREAD_DIRECT_IMPERSONATION 0x0200 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff) -#define THREAD_BASE_PRIORITY_LOWRT 15 -#define THREAD_BASE_PRIORITY_MAX 2 +#define THREAD_BASE_PRIORITY_LOWRT 15 +#define THREAD_BASE_PRIORITY_MAX 2 #define THREAD_BASE_PRIORITY_MIN -2 #define THREAD_BASE_PRIORITY_IDLE -15 @@ -4027,7 +4027,7 @@ typedef enum tagSID_NAME_USE { SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS ) -typedef enum _CM_SERVICE_NODE_TYPE +typedef enum _CM_SERVICE_NODE_TYPE { DriverType = SERVICE_KERNEL_DRIVER, FileSystemType = SERVICE_FILE_SYSTEM_DRIVER, @@ -4037,7 +4037,7 @@ typedef enum _CM_SERVICE_NODE_TYPE RecognizerType = SERVICE_RECOGNIZER_DRIVER } SERVICE_NODE_TYPE; -typedef enum _CM_SERVICE_LOAD_TYPE +typedef enum _CM_SERVICE_LOAD_TYPE { BootLoad = SERVICE_BOOT_START, SystemLoad = SERVICE_SYSTEM_START, @@ -4046,7 +4046,7 @@ typedef enum _CM_SERVICE_LOAD_TYPE DisableLoad = SERVICE_DISABLED } SERVICE_LOAD_TYPE; -typedef enum _CM_ERROR_CONTROL_TYPE +typedef enum _CM_ERROR_CONTROL_TYPE { IgnoreError = SERVICE_ERROR_IGNORE, NormalError = SERVICE_ERROR_NORMAL, @@ -4064,7 +4064,7 @@ typedef enum _CM_ERROR_CONTROL_TYPE #include "guiddef.h" -typedef struct _RTL_CRITICAL_SECTION_DEBUG +typedef struct _RTL_CRITICAL_SECTION_DEBUG { WORD Type; WORD CreatorBackTraceIndex; diff --git a/include/winreg.h b/include/winreg.h index 098cb556616..c5e7b634b34 100644 --- a/include/winreg.h +++ b/include/winreg.h @@ -39,7 +39,7 @@ extern "C" { /* * registry provider structs */ -typedef struct value_entA +typedef struct value_entA { LPSTR ve_valuename; DWORD ve_valuelen; DWORD_PTR ve_valueptr; diff --git a/include/winsock.h b/include/winsock.h index bc9f42a795c..e6452df18dc 100644 --- a/include/winsock.h +++ b/include/winsock.h @@ -58,10 +58,10 @@ extern "C" { */ #ifndef __WINE_USE_MSVCRT -/* Get the u_xxx types from the Unix headers. They will do and doing it - * this way will avoid redefinitions. But on FreeBSD we may get macros - * and prototypes for htonl & co. This means the functions will not be - * called because of the macros. So this should not harm us too much unless +/* Get the u_xxx types from the Unix headers. They will do and doing it + * this way will avoid redefinitions. But on FreeBSD we may get macros + * and prototypes for htonl & co. This means the functions will not be + * called because of the macros. So this should not harm us too much unless * we try to define our own prototypes (different calling convention). */ # include @@ -69,7 +69,7 @@ extern "C" { # define WS_DEFINE_HTONL # endif /* htonl */ #else -/* Since we are using the MSVCRT headers, we must define the u_xxx +/* Since we are using the MSVCRT headers, we must define the u_xxx * types ourselves. */ typedef unsigned char u_char; @@ -350,14 +350,14 @@ typedef struct WS(linger) */ #if !defined(USE_WS_PREFIX) && !defined(__WINE_USE_MSVCRT) -/* We are not using the WS_ prefix and not using the MSVCRT either so we +/* We are not using the WS_ prefix and not using the MSVCRT either so we * risk getting conflicts for everything related to select. */ # ifdef FD_CLR -/* Too late, the Unix version of stdlib.h was included before winsock.h. - * This means select and all the related stuff is already defined and we +/* Too late, the Unix version of stdlib.h was included before winsock.h. + * This means select and all the related stuff is already defined and we * cannot override types and function prototypes. - * All we can do is disable all these symbols so that they are not used + * All we can do is disable all these symbols so that they are not used * inadvertantly. */ # undef FD_SETSIZE @@ -374,8 +374,8 @@ typedef struct WS(linger) # define fd_set Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library # define select Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library # else -/* stdlib.h has not been included yet so it's not too late. Include it now - * making sure that none of the select symbols is affected. Then we can +/* stdlib.h has not been included yet so it's not too late. Include it now + * making sure that none of the select symbols is affected. Then we can * define them with our own values. */ # define fd_set unix_fd_set @@ -449,7 +449,7 @@ typedef struct WS(timeval) if (((cast*)(set))->fd_count < FD_SETSIZE) \ ((cast*)(set))->fd_array[((cast*)(set))->fd_count++]=(fd); \ } while(0) -/* This version checks if the filedesc is already in the list, and appends it +/* This version checks if the filedesc is already in the list, and appends it * only if it's not the case */ #define __WS_FD_SET2(fd, set, cast) do { \ @@ -486,8 +486,8 @@ typedef struct WS(timeval) #endif /* WS_DEFINE_SELECT */ -/* - * Internet address (old style... should be updated) +/* + * Internet address (old style... should be updated) */ #ifndef USE_WS_PREFIX @@ -879,7 +879,7 @@ typedef struct WS(WSAData) /* * Prototypes * - * Remember to keep this section in sync with the + * Remember to keep this section in sync with the * "Winsock Function Typedefs" section in winsock2.h. */ #if !defined(__WINE_WINSOCK2__) || WS_API_PROTOTYPES diff --git a/include/winsock2.h b/include/winsock2.h index 5f5eae636ef..15eb6afa650 100644 --- a/include/winsock2.h +++ b/include/winsock2.h @@ -263,7 +263,7 @@ typedef struct _FLOWSPEC { typedef struct _QUALITYOFSERVICE { FLOWSPEC SendingFlowspec; FLOWSPEC ReceivingFlowspec; - WSABUF ProviderSpecific; + WSABUF ProviderSpecific; } QOS, *LPQOS; typedef int (CALLBACK *LPCONDITIONPROC) @@ -291,7 +291,7 @@ typedef void (CALLBACK *LPWSAOVERLAPPED_COMPLETION_ROUTINE) /* * Winsock Function Typedefs * - * Remember to keep this section in sync with the + * Remember to keep this section in sync with the * "Prototypes" section in winsock.h. */ #if WS_API_TYPEDEFS @@ -351,7 +351,7 @@ typedef SOCKET (WINAPI *LPFN_SOCKET)(int,int,int)); /* * Winsock2 Prototypes * - * Remember to keep this section in sync with the + * Remember to keep this section in sync with the * "Winsock2 Function Typedefs" section below. */ #if WS_API_PROTOTYPES @@ -416,7 +416,7 @@ DWORD WINAPI WSAWaitForMultipleEvents(DWORD,const WSAEVENT*,BOOL,DWORD,BOOL); /* * Winsock2 Function Typedefs * - * Remember to keep this section in sync with the + * Remember to keep this section in sync with the * "Winsock2 Prototypes" section above. */ #if WS_API_TYPEDEFS diff --git a/include/winspool.h b/include/winspool.h index 1fece024ae0..00954df7229 100644 --- a/include/winspool.h +++ b/include/winspool.h @@ -2,7 +2,7 @@ * * Copyright 1998 Huw Davies, Andreas Mohr * - * Portions Copyright (c) 1999 Corel Corporation + * Portions Copyright (c) 1999 Corel Corporation * (Paul Quinn, Albert Den Haan) * * This library is free software; you can redistribute it and/or @@ -285,16 +285,16 @@ typedef struct _DRIVER_INFO_2A { LPSTR pName; LPSTR pEnvironment; LPSTR pDriverPath; - LPSTR pDataFile; + LPSTR pDataFile; LPSTR pConfigFile; } DRIVER_INFO_2A, *PDRIVER_INFO_2A, *LPDRIVER_INFO_2A; typedef struct _DRIVER_INFO_2W { DWORD cVersion; - LPWSTR pName; + LPWSTR pName; LPWSTR pEnvironment; LPWSTR pDriverPath; - LPWSTR pDataFile; + LPWSTR pDataFile; LPWSTR pConfigFile; } DRIVER_INFO_2W, *PDRIVER_INFO_2W, *LPDRIVER_INFO_2W; @@ -351,7 +351,7 @@ DECL_WINELIB_TYPE_AW(PPRINTER_INFO_1) DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_1) /* FIXME: winspool.h declares some structure members with the name Status. - * unfortunatly #defines Status to the type 'int' + * unfortunatly #defines Status to the type 'int' * therfore the following hack */ #ifndef Status @@ -410,7 +410,7 @@ DECL_WINELIB_TYPE_AW(LPPRINTER_INFO_2) typedef struct _PRINTER_INFO_3 { PSECURITY_DESCRIPTOR pSecurityDescriptor; } PRINTER_INFO_3, *PPRINTER_INFO_3, *LPPRINTER_INFO_3; - + typedef struct _PRINTER_INFO_4A { LPSTR pPrinterName; LPSTR pServerName; @@ -512,7 +512,7 @@ typedef struct _JOB_INFO_2A { DWORD Time; DWORD PagesPrinted; } JOB_INFO_2A, *PJOB_INFO_2A, *LPJOB_INFO_2A; - + typedef struct _JOB_INFO_2W { DWORD JobID; LPWSTR pPrinterName; @@ -538,7 +538,7 @@ typedef struct _JOB_INFO_2W { DWORD Time; DWORD PagesPrinted; } JOB_INFO_2W, *PJOB_INFO_2W, *LPJOB_INFO_2W; - + DECL_WINELIB_TYPE_AW(JOB_INFO_2) DECL_WINELIB_TYPE_AW(PJOB_INFO_2) DECL_WINELIB_TYPE_AW(LPJOB_INFO_2) @@ -765,13 +765,13 @@ typedef struct _PROVIDOR_INFO_1A { LPSTR pName; LPSTR pEnvironment; LPSTR pDLLName; -} PROVIDOR_INFO_1A, *PPROVIDOR_INFO_1A, *LPPROVIDOR_INFO_1A; +} PROVIDOR_INFO_1A, *PPROVIDOR_INFO_1A, *LPPROVIDOR_INFO_1A; typedef struct _PROVIDOR_INFO_1W { LPWSTR pName; LPWSTR pEnvironment; LPWSTR pDLLName; -} PROVIDOR_INFO_1W, *PPROVIDOR_INFO_1W, *LPPROVIDOR_INFO_1W; +} PROVIDOR_INFO_1W, *PPROVIDOR_INFO_1W, *LPPROVIDOR_INFO_1W; DECL_WINELIB_TYPE_AW(PROVIDOR_INFO_1) DECL_WINELIB_TYPE_AW(PPROVIDOR_INFO_1) @@ -879,15 +879,15 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter); BOOL WINAPI DeletePrinter(HANDLE hPrinter); BOOL WINAPI SetPrinterA(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, - DWORD Command); + DWORD Command); BOOL WINAPI SetPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, - DWORD Command); + DWORD Command); #define SetPrinter WINELIB_NAME_AW(SetPrinter) BOOL WINAPI GetPrinterA(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, - DWORD cbBuf, LPDWORD pcbNeeded); + DWORD cbBuf, LPDWORD pcbNeeded); BOOL WINAPI GetPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, - DWORD cbBuf, LPDWORD pcbNeeded); + DWORD cbBuf, LPDWORD pcbNeeded); #define GetPrinter WINELIB_NAME_AW(GetPrinter) BOOL WINAPI AddPrinterDriverA(LPSTR pName, DWORD Level, LPBYTE pDriverInfo); @@ -929,7 +929,7 @@ BOOL WINAPI EnumPrintProcessorsW(LPWSTR pName, LPWSTR pEnvironment, #define EnumPrintProcessors WINELIB_NAME_AW(EnumPrintProcessors) BOOL WINAPI GetPrintProcessorDirectoryA(LPSTR pName, LPSTR pEnvironment, - DWORD Level, + DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded); @@ -979,11 +979,11 @@ BOOL WINAPI AddJobW(HANDLE hPrinter, DWORD Level, LPBYTE pData, DWORD cbBuf, BOOL WINAPI ScheduleJob(HANDLE hPrinter, DWORD JobID); LONG WINAPI AdvancedDocumentPropertiesA(HWND hWnd, HANDLE hPrinter, - LPSTR pDeviceName, + LPSTR pDeviceName, PDEVMODEA pDevModeOutput, PDEVMODEA pDevModeInput); LONG WINAPI AdvancedDocumentPropertiesW(HWND hWnd, HANDLE hPrinter, - LPWSTR pDeviceName, + LPWSTR pDeviceName, PDEVMODEW pDevModeOutput, PDEVMODEW pDevModeInput); #define AdvancedDocumentProperties WINELIB_NAME_AW(AdvancedDocumentProperties) diff --git a/include/winuser.h b/include/winuser.h index 5de2b961b2d..b9bec444557 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -1046,7 +1046,7 @@ BOOL WINAPI SetSysColors(INT,const INT*,const COLORREF*); #define WM_IME_COMPOSITION 0x010f #define WM_IME_KEYLAST 0x010f -#define WM_INITDIALOG 0x0110 +#define WM_INITDIALOG 0x0110 #define WM_COMMAND 0x0111 #define WM_SYSCOMMAND 0x0112 #define WM_TIMER 0x0113 @@ -1103,7 +1103,7 @@ BOOL WINAPI SetSysColors(INT,const INT*,const COLORREF*); #define WM_MOUSEFIRST 0x0200 #define WM_MOUSELAST 0x020D - + #define WHEEL_DELTA 120 #define WHEEL_PAGESCROLL (UINT_MAX) #define WM_PARENTNOTIFY 0x0210 @@ -1230,7 +1230,7 @@ BOOL WINAPI SetSysColors(INT,const INT*,const COLORREF*); #define IDYES 6 #define IDNO 7 #define IDCLOSE 8 -#define IDHELP 9 +#define IDHELP 9 /****** Window classes ******/ @@ -1279,7 +1279,7 @@ typedef struct BYTE rgbReserved[32]; } PAINTSTRUCT, *PPAINTSTRUCT, *LPPAINTSTRUCT; -typedef struct +typedef struct { HMENU hWindowMenu; UINT idFirstChild; @@ -1315,7 +1315,7 @@ typedef struct DECL_WINELIB_TYPE_AW(MDICREATESTRUCT) DECL_WINELIB_TYPE_AW(LPMDICREATESTRUCT) -#define MDITILE_VERTICAL 0x0000 +#define MDITILE_VERTICAL 0x0000 #define MDITILE_HORIZONTAL 0x0001 #define MDITILE_SKIPDISABLED 0x0002 @@ -1521,7 +1521,7 @@ typedef struct #define PRF_ERASEBKGND 0x00000008L #define PRF_CHILDREN 0x00000010L #define PRF_OWNED 0x00000020L - + /* Offsets for GetClassLong() and GetClassWord() */ #define GCL_MENUNAME (-8) #define GCL_HBRBACKGROUND (-10) @@ -1760,7 +1760,7 @@ typedef struct tagMSG #define POINTSTOPOINT(pt, pts) \ { (pt).x = (LONG)(SHORT)LOWORD(*(LONG*)&pts); \ - (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); } + (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); } #define POINTTOPOINTS(pt) (MAKELONG((short)((pt).x), (short)((pt).y))) @@ -1800,7 +1800,7 @@ typedef struct #define TPM_NONOTIFY 0x0080 #define TPM_RETURNCMD 0x0100 -typedef struct +typedef struct { UINT cbSize; RECT rcExclude; @@ -1974,7 +1974,7 @@ typedef PVOID *LPMENUTEMPLATE; #define BST_CHECKED 0x0001 #define BST_INDETERMINATE 0x0002 #define BST_PUSHED 0x0004 -#define BST_FOCUS 0x0008 +#define BST_FOCUS 0x0008 /* Static Control Styles */ #define SS_LEFT 0x00000000L @@ -2043,7 +2043,7 @@ typedef struct typedef const SCROLLINFO *LPCSCROLLINFO; -/* GetScrollInfo() flags */ +/* GetScrollInfo() flags */ #define SIF_RANGE 0x0001 #define SIF_PAGE 0x0002 #define SIF_POS 0x0004 @@ -2520,7 +2520,7 @@ typedef struct #define MNC_IGNORE 0 #define MNC_CLOSE 1 #define MNC_EXECUTE 2 -#define MNC_SELECT 3 +#define MNC_SELECT 3 /* SystemParametersInfo */ /* defines below are for all win versions */ @@ -3340,7 +3340,7 @@ typedef struct #define VK_NONAME 0xFC #define VK_PA1 0xFD #define VK_OEM_CLEAR 0xFE - + /* Key status flags for mouse events */ #define MK_LBUTTON 0x0001 #define MK_RBUTTON 0x0002 diff --git a/include/winver.h b/include/winver.h index e0cca0188ac..7b8f907dd40 100644 --- a/include/winver.h +++ b/include/winver.h @@ -1,5 +1,5 @@ /* Definitions for the VERsion infolibrary (VER.DLL) - * + * * Copyright 1996 Marcus Meissner * * This library is free software; you can redistribute it and/or diff --git a/include/wnaspi32.h b/include/wnaspi32.h index 55327a571a2..9f898735bbd 100644 --- a/include/wnaspi32.h +++ b/include/wnaspi32.h @@ -219,7 +219,7 @@ typedef union tagSRB32 { SRB_GetDiskInfo diskinfo; } SRB, *PSRB, *LPSRB; -typedef struct tagASPI32BUFF { +typedef struct tagASPI32BUFF { LPBYTE AB_BufPointer; /* pointer to buffer */ DWORD AB_BufLen; /* length of buffer */ DWORD AB_ZeroFill; /* set to 1 if zeroing */ diff --git a/include/wownt32.h b/include/wownt32.h index 305b9eafe83..4d27fe59400 100644 --- a/include/wownt32.h +++ b/include/wownt32.h @@ -1,5 +1,5 @@ /* - * WOW Generic Thunk API + * WOW Generic Thunk API * * Copyright (C) 1999 Ulrich Weigand * diff --git a/include/wtypes.h b/include/wtypes.h index bc2dc4d4eef..3960a831c11 100644 --- a/include/wtypes.h +++ b/include/wtypes.h @@ -59,10 +59,10 @@ typedef __uint64 ULONGLONG, *PULONGLONG; #endif typedef enum tagDVASPECT -{ +{ DVASPECT_CONTENT = 1, DVASPECT_THUMBNAIL = 2, - DVASPECT_ICON = 4, + DVASPECT_ICON = 4, DVASPECT_DOCPRINT = 8 } DVASPECT; @@ -76,7 +76,7 @@ typedef enum tagSTGC } STGC; typedef enum tagSTGMOVE -{ +{ STGMOVE_MOVE = 0, STGMOVE_COPY = 1, STGMOVE_SHALLOWCOPY = 2 @@ -256,7 +256,7 @@ typedef struct _SID { } SID,*PSID; /* - * ACL + * ACL */ typedef struct _ACL { diff --git a/include/x11drv.h b/include/x11drv.h index 3e6cd7b8ca9..ebcefb19914 100644 --- a/include/x11drv.h +++ b/include/x11drv.h @@ -22,9 +22,9 @@ #ifndef __WINE_X11DRV_H #define __WINE_X11DRV_H -#ifndef __WINE_CONFIG_H -# error You must include config.h to use this header -#endif +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif #include #include @@ -147,9 +147,9 @@ extern COLORREF X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y); extern BOOL X11DRV_PaintRgn( X11DRV_PDEVICE *physDev, HRGN hrgn ); extern BOOL X11DRV_Polyline( X11DRV_PDEVICE *physDev,const POINT* pt,INT count); extern BOOL X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ); -extern BOOL X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, +extern BOOL X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons); -extern BOOL X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, +extern BOOL X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines); extern COLORREF X11DRV_SetBkColor( X11DRV_PDEVICE *physDev, COLORREF color ); @@ -172,7 +172,7 @@ extern BOOL X11DRV_SetDeviceGammaRamp( X11DRV_PDEVICE *physDev, LPVOID ramp ); /* OpenGL / X11 driver functions */ extern int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, const PIXELFORMATDESCRIPTOR *pppfd); -extern int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, +extern int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, int iPixelFormat, UINT nBytes, PIXELFORMATDESCRIPTOR *ppfd); extern int X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev); diff --git a/include/x11font.h b/include/x11font.h index 17e02a0457f..eb05db326f9 100644 --- a/include/x11font.h +++ b/include/x11font.h @@ -25,7 +25,7 @@ #include "x11drv.h" #include "pshpack1.h" -/* this is a part of the font resource header, should +/* this is a part of the font resource header, should * make it easier to implement dynamic softfont loading */ typedef struct diff --git a/library/port.c b/library/port.c index 96f04129c4e..def94694d34 100644 --- a/library/port.c +++ b/library/port.c @@ -629,8 +629,8 @@ unsigned short* wine_rewrite_s4tos2(const wchar_t* str4 ) return (unsigned short*)str4; } - /* Note that we can also end up here if the string has a single - * character. In such a case we will convert the string over and + /* Note that we can also end up here if the string has a single + * character. In such a case we will convert the string over and * over again. But this is harmless. */ str2=s2=(unsigned short*)str4; @@ -655,7 +655,7 @@ char *ecvt (double number, int ndigits, int *decpt, int *sign) { static char buf[40]; /* ought to be enough */ char *dec; - sprintf(buf, "%.*e", ndigits /* FIXME wrong */, number); + sprintf(buf, "%.*e", ndigits /* FIXME wrong */, number); *sign = (number < 0); dec = strchr(buf, '.'); *decpt = (dec) ? (int)dec - (int)buf : -1; @@ -727,8 +727,8 @@ __ASM_GLOBAL_FUNC(interlocked_xchg_add, /* * As the earlier Sparc processors lack necessary atomic instructions, * I'm simply falling back to the library-provided _lwp_mutex routines - * to ensure mutual exclusion in a way appropriate for the current - * architecture. + * to ensure mutual exclusion in a way appropriate for the current + * architecture. * * FIXME: If we have the compare-and-swap instruction (Sparc v9 and above) * we could use this to speed up the Interlocked operations ... diff --git a/loader/elf.c b/loader/elf.c index 8dabd901a10..c861908bd90 100644 --- a/loader/elf.c +++ b/loader/elf.c @@ -1,6 +1,6 @@ -/* +/* * UNIX dynamic loader - * + * * Currently only supports stuff using the dl* API. * * Copyright 1998 Marcus Meissner @@ -20,11 +20,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * FIXME: Small reentrancy problem. - * IDEA(s): could be used to split up shell32,comctl32... + * IDEA(s): could be used to split up shell32,comctl32... */ #include "config.h" -#include "wine/port.h" +#include "wine/port.h" #include #include @@ -70,19 +70,19 @@ static HMODULE ELF_CreateDummyModule( LPCSTR libname, LPCSTR modname ) PIMAGE_SECTION_HEADER sh; HMODULE hmod; - hmod = (HMODULE)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(IMAGE_DOS_HEADER) + + hmod = (HMODULE)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(IMAGE_DOS_HEADER) + sizeof(IMAGE_NT_HEADERS) + sizeof(IMAGE_SECTION_HEADER) + STUBSIZE ); dh = (PIMAGE_DOS_HEADER)hmod; dh->e_magic = IMAGE_DOS_SIGNATURE; dh->e_lfanew = sizeof(IMAGE_DOS_HEADER); nth = PE_HEADER(hmod); - nth->Signature = IMAGE_NT_SIGNATURE; + nth->Signature = IMAGE_NT_SIGNATURE; nth->FileHeader.Machine = IMAGE_FILE_MACHINE_I386; nth->FileHeader.NumberOfSections = 1; nth->FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER); - nth->FileHeader.Characteristics = + nth->FileHeader.Characteristics = IMAGE_FILE_RELOCS_STRIPPED|IMAGE_FILE_LINE_NUMS_STRIPPED| IMAGE_FILE_LOCAL_SYMS_STRIPPED|IMAGE_FILE_32BIT_MACHINE| IMAGE_FILE_DLL|IMAGE_FILE_DEBUG_STRIPPED; @@ -203,7 +203,7 @@ static FARPROC ELF_FindExportedFunction( WINE_MODREF *wm, LPCSTR funcName, BOOL } } if (!fun) { - /* Function@nrofargs usually marks a stdcall function + /* Function@nrofargs usually marks a stdcall function * with nrofargs bytes that are popped at the end */ LPCSTR t; @@ -218,7 +218,7 @@ static FARPROC ELF_FindExportedFunction( WINE_MODREF *wm, LPCSTR funcName, BOOL HeapFree( GetProcessHeap(), 0, fn ); } } - /* We sometimes have Win32 dlls implemented using stdcall but UNIX + /* We sometimes have Win32 dlls implemented using stdcall but UNIX * dlls using cdecl. If we find out the number of args the function * uses, we remove them from the stack using two small stubs. */ @@ -238,7 +238,7 @@ static FARPROC ELF_FindExportedFunction( WINE_MODREF *wm, LPCSTR funcName, BOOL stub->origfun=(DWORD)fun; /* just a marker */ if (fun && nrofargs) { /* we don't need it for 0 args */ - /* Selfmodifying entry/return stub for stdcall -> cdecl + /* Selfmodifying entry/return stub for stdcall -> cdecl * conversion. * - Pop returnaddress directly into our return code * popl diff --git a/loader/loadorder.c b/loader/loadorder.c index 38412be094e..6b358774837 100644 --- a/loader/loadorder.c +++ b/loader/loadorder.c @@ -520,28 +520,28 @@ void MODULE_GetLoadOrder( enum loadorder_type loadorder[], const char *path, BOO if ( ! GetSystemDirectoryA ( sysdir, MAX_PATH ) ) goto done; - /* Strip path information for 16 bit modules or if the module + /* Strip path information for 16 bit modules or if the module resides in the system directory */ if ( !win32 || !FILE_strncasecmp ( sysdir, path, strlen (sysdir) ) ) { - + cptr = strrchr(path, '\\'); if(!cptr) name = strrchr(path, '/'); else name = strrchr(cptr, '/'); - + if(!name) name = cptr ? cptr+1 : (char *)path; else name++; - + if((cptr = strchr(name, ':')) != NULL) /* Also strip drive if in format 'C:MODULE.DLL' */ name = cptr+1; } - else + else name = (char *)path; - + len = strlen(name); if(len >= sizeof(fname) || len <= 0) { diff --git a/loader/module.c b/loader/module.c index ad09e2a41aa..52e4f7e1144 100644 --- a/loader/module.c +++ b/loader/module.c @@ -73,7 +73,7 @@ static WINE_MODREF *MODULE32_LookupHMODULE( HMODULE hmod ) { WINE_MODREF *wm; - if (!hmod) + if (!hmod) return exe_modref; if (!HIWORD(hmod)) { @@ -137,7 +137,7 @@ static BOOL MODULE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved ) { BOOL retv = TRUE; - static LPCSTR typeName[] = { "PROCESS_DETACH", "PROCESS_ATTACH", + static LPCSTR typeName[] = { "PROCESS_DETACH", "PROCESS_ATTACH", "THREAD_ATTACH", "THREAD_DETACH" }; assert( wm ); @@ -160,14 +160,14 @@ static BOOL MODULE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved ) /************************************************************************* * MODULE_DllProcessAttach - * + * * Send the process attach notification to all DLLs the given module * depends on (recursively). This is somewhat complicated due to the fact that * * - we have to respect the module dependencies, i.e. modules implicitly * referenced by another module have to be initialized before the module * itself can be initialized - * + * * - the initialization routine of a DLL can itself call LoadLibrary, * thereby introducing a whole new set of dependencies (even involving * the 'old' modules) at any time during the whole process @@ -178,7 +178,7 @@ static BOOL MODULE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved ) * * Furthermore, we need to rearrange the main WINE_MODREF list to allow * the process *detach* notifications to be sent in the correct order. - * This must not only take into account module dependencies, but also + * This must not only take into account module dependencies, but also * 'hidden' dependencies created by modules calling LoadLibrary in their * attach notification routine. * @@ -247,8 +247,8 @@ BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved ) /************************************************************************* * MODULE_DllProcessDetach - * - * Send DLL process detach notifications. See the comment about calling + * + * Send DLL process detach notifications. See the comment about calling * sequence at MODULE_DllProcessAttach. Unless the bForceDetach flag * is set, only DLLs with zero refcount are notified. */ @@ -283,7 +283,7 @@ void MODULE_DllProcessDetach( BOOL bForceDetach, LPVOID lpReserved ) /************************************************************************* * MODULE_DllThreadAttach - * + * * Send DLL thread attach notifications. These are sent in the * reverse sequence of process detach notification. * @@ -319,7 +319,7 @@ void MODULE_DllThreadAttach( LPVOID lpReserved ) /************************************************************************* * MODULE_DllThreadDetach - * + * * Send DLL thread detach notifications. These are sent in the * same sequence as process detach notification. * @@ -399,7 +399,7 @@ HMODULE16 MODULE_CreateDummyModule( LPCSTR filename, HMODULE module32 ) + strlen(filename) + 1; size = sizeof(NE_MODULE) + /* loaded file info */ - ((of_size + 3) & ~3) + + ((of_size + 3) & ~3) + /* segment table: DS,CS */ 2 * sizeof(SEGTABLEENTRY) + /* name table */ @@ -826,7 +826,7 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow ) else /* yes, even valid with trailing '"' missing */ name_end = lpCmdLine+strlen(lpCmdLine); } - else + else { name_beg = lpCmdLine; args = strchr( lpCmdLine, ' ' ); @@ -934,7 +934,7 @@ UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow ) /********************************************************************** * LoadModule (KERNEL32.@) */ -HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock ) +HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock ) { LOADPARAMS *params = (LOADPARAMS *)paramBlock; PROCESS_INFORMATION info; @@ -967,7 +967,7 @@ HINSTANCE WINAPI LoadModule( LPCSTR name, LPVOID paramBlock ) startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = params->lpCmdShow[1]; } - + if (CreateProcessA( filename, cmdline, NULL, NULL, FALSE, 0, params->lpEnvAddress, NULL, &startup, &info )) { @@ -1028,7 +1028,7 @@ HMODULE WINAPI GetModuleHandleW(LPCWSTR module) * by checking if exe version >= 4.0. * (SDK docu doesn't mention this) */ -DWORD WINAPI GetModuleFileNameA( +DWORD WINAPI GetModuleFileNameA( HMODULE hModule, /* [in] module handle (32bit) */ LPSTR lpFileName, /* [out] filenamebuffer */ DWORD size ) /* [in] size of filenamebuffer */ @@ -1044,8 +1044,8 @@ DWORD WINAPI GetModuleFileNameA( RtlLeaveCriticalSection( &loader_section ); TRACE("%s\n", lpFileName ); return strlen(lpFileName); -} - +} + /*********************************************************************** * GetModuleFileNameW (KERNEL32.@) @@ -1134,7 +1134,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags) * * helper for MODULE_LoadLibraryExA. Allocate space to hold the directory * portion of the provided name and put the name in it. - * + * */ static LPCSTR allocate_lib_dir(LPCSTR libname) { @@ -1172,9 +1172,9 @@ static LPCSTR allocate_lib_dir(LPCSTR libname) * * libdir is used to support LOAD_WITH_ALTERED_SEARCH_PATH during the recursion * on this function. When first called from LoadLibraryExA it will be - * NULL but thereafter it may point to a buffer containing the path - * portion of the library name. Note that the recursion all occurs - * within a Critical section (see LoadLibraryExA) so the use of a + * NULL but thereafter it may point to a buffer containing the path + * portion of the library name. Note that the recursion all occurs + * within a Critical section (see LoadLibraryExA) so the use of a * static is acceptable. * (We have to use a static variable at some point anyway, to pass the * information from BUILTIN32_dlopen through dlopen and the builtin's @@ -1215,16 +1215,16 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags ) /* build the modules filename */ if (!found) { - if ( ! GetSystemDirectoryA ( filename, MAX_PATH ) ) + if ( ! GetSystemDirectoryA ( filename, MAX_PATH ) ) goto error; /* if the library name contains a path and can not be found, - * return an error. + * return an error. * exception: if the path is the system directory, proceed, * so that modules which are not PE modules can be loaded. * If the library name does not contain a path and can not * be found, assume the system directory is meant */ - + if ( ! FILE_strncasecmp ( filename, libname, strlen ( filename ) )) strcpy ( filename, libname ); else @@ -1233,7 +1233,7 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags ) strcat ( filename, "\\" ); strcat ( filename, libname ); } - + /* if the filename doesn't have an extension, append .DLL */ if (!(p = strrchr( filename, '.')) || strchr( p, '/' ) || strchr( p, '\\')) strcat( filename, ".dll" ); @@ -1245,7 +1245,7 @@ WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags ) LPSTR fn = HeapAlloc ( GetProcessHeap(), 0, MAX_PATH + 1 ); if (fn) { - /* since the default loading mechanism uses a more detailed algorithm + /* since the default loading mechanism uses a more detailed algorithm * than SearchPath (like using PATH, which can even be modified between * two attempts of loading the same DLL), the look-up above (with * SearchPath) can have put the file in system directory, whereas it @@ -1627,7 +1627,7 @@ FARPROC WINAPI GetProcAddress32_16( HMODULE hModule, LPCSTR function ) /*********************************************************************** * MODULE_GetProcAddress (internal) */ -FARPROC MODULE_GetProcAddress( +FARPROC MODULE_GetProcAddress( HMODULE hModule, /* [in] current module handle */ LPCSTR function, /* [in] function to be looked up */ BOOL snoop ) @@ -1671,7 +1671,7 @@ SEGPTR WINAPI HasGPHandler16( SEGPTR address ) int gpOrdinal; SEGPTR gpPtr; GPHANDLERDEF *gpHandler; - + if ( (hModule = FarGetOwner16( SELECTOROF(address) )) != 0 && (gpOrdinal = NE_GetOrdinal( hModule, "__GP" )) != 0 && (gpPtr = (SEGPTR)NE_GetEntryPointEx( hModule, gpOrdinal, FALSE )) != 0 diff --git a/loader/ne/convert.c b/loader/ne/convert.c index 13391bc3d5c..cc5c16fb2ff 100644 --- a/loader/ne/convert.c +++ b/loader/ne/convert.c @@ -59,7 +59,7 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 ) switch (*((WORD *)p)) { case 0x0000: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0; break; - case 0xffff: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0xff; + case 0xffff: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0xff; *((WORD *)dialog16)++ = *((WORD *)p)++; break; default: WideCharToMultiByte( CP_ACP, 0, (LPWSTR)p, -1, (LPSTR)dialog16, 0x7fffffff, NULL,NULL ); ((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1; @@ -71,7 +71,7 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 ) switch (*((WORD *)p)) { case 0x0000: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0; break; - case 0xffff: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0xff; + case 0xffff: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0xff; *((WORD *)dialog16)++ = *((WORD *)p)++; break; default: WideCharToMultiByte( CP_ACP, 0, (LPWSTR)p, -1, (LPSTR)dialog16, 0x7fffffff, NULL,NULL ); ((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1; @@ -133,7 +133,7 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 ) switch (*((WORD *)p)) { case 0x0000: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0; break; - case 0xffff: ((WORD *)p)++; + case 0xffff: ((WORD *)p)++; *((BYTE *)dialog16)++ = (BYTE)*((WORD *)p)++; break; default: WideCharToMultiByte( CP_ACP, 0, (LPWSTR)p, -1, (LPSTR)dialog16, 0x7fffffff, NULL,NULL ); ((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1; @@ -145,22 +145,22 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 ) switch (*((WORD *)p)) { case 0x0000: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0; break; - case 0xffff: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0xff; + case 0xffff: ((WORD *)p)++; *((BYTE *)dialog16)++ = 0xff; *((WORD *)dialog16)++ = *((WORD *)p)++; break; default: WideCharToMultiByte( CP_ACP, 0, (LPWSTR)p, -1, (LPSTR)dialog16, 0x7fffffff, NULL,NULL ); ((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1; ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; break; } - + /* Transfer data */ - data = *((WORD *)p)++; + data = *((WORD *)p)++; if (dialogEx) *((WORD *)dialog16)++ = data; else *((BYTE *)dialog16)++ = (BYTE)data; - if (data) + if (data) { memcpy( dialog16, p, data ); (LPSTR)dialog16 += data; @@ -215,7 +215,7 @@ WORD WINAPI GetDialog32Size16( LPVOID dialog32 ) } /* Skip window caption */ - ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; + ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; /* Skip font info */ if (style & DS_SETFONT) @@ -272,9 +272,9 @@ WORD WINAPI GetDialog32Size16( LPVOID dialog32 ) case 0xffff: ((WORD *)p) += 2; break; default: ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; break; } - + /* Skip data */ - data = *((WORD *)p)++; + data = *((WORD *)p)++; (LPSTR)p += data; /* Next item */ @@ -309,7 +309,7 @@ VOID WINAPI ConvertMenu32To16( LPVOID menu32, DWORD size, LPVOID menu16 ) *((WORD *)menu16)++ = *((WORD *)p)++; /* ID */ else level++; - + WideCharToMultiByte( CP_ACP, 0, (LPWSTR)p, -1, (LPSTR)menu16, 0x7fffffff, NULL,NULL ); ((LPSTR)menu16) += strlen( (LPSTR)menu16 ) + 1; ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; @@ -322,8 +322,8 @@ VOID WINAPI ConvertMenu32To16( LPVOID menu32, DWORD size, LPVOID menu16 ) *((DWORD *)menu16)++ = *((DWORD *)p)++; /* fType */ *((DWORD *)menu16)++ = *((DWORD *)p)++; /* fState */ *((WORD *)menu16)++ = (WORD)*((DWORD *)p)++; /* ID */ - flags = *((BYTE *)menu16)++ = (BYTE)*((WORD *)p)++; - + flags = *((BYTE *)menu16)++ = (BYTE)*((WORD *)p)++; + WideCharToMultiByte( CP_ACP, 0, (LPWSTR)p, -1, (LPSTR)menu16, 0x7fffffff, NULL,NULL ); ((LPSTR)menu16) += strlen( (LPSTR)menu16 ) + 1; ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; @@ -363,7 +363,7 @@ WORD WINAPI GetMenu32Size16( LPVOID menu32 ) ((WORD *)p)++; /* ID */ else level++; - + ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; if ( flags & MF_END ) @@ -374,8 +374,8 @@ WORD WINAPI GetMenu32Size16( LPVOID menu32 ) ((DWORD *)p)++; /* fType */ ((DWORD *)p)++; /* fState */ ((DWORD *)p)++; /* ID */ - flags = *((WORD *)p)++; - + flags = *((WORD *)p)++; + ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; /* align on DWORD boundary (32-bit only) */ @@ -428,7 +428,7 @@ HGLOBAL16 NE_LoadPEResource( NE_MODULE *pModule, WORD type, LPVOID bits, DWORD s if (!pModule || !bits || !size) return 0; handle = GlobalAlloc16( 0, size ); - + switch (type) { case RT_MENU16: diff --git a/loader/ne/module.c b/loader/ne/module.c index fac36ce706b..2eebe40f71e 100644 --- a/loader/ne/module.c +++ b/loader/ne/module.c @@ -19,7 +19,7 @@ */ #include "config.h" -#include "wine/port.h" +#include "wine/port.h" #include #include @@ -174,7 +174,7 @@ void NE_DumpModule( HMODULE16 hModule ) /* Dump the entry table */ DPRINTF( "---\n" ); DPRINTF( "Entry table:\n" ); - bundle = (ET_BUNDLE *)((BYTE *)pModule+pModule->entry_table); + bundle = (ET_BUNDLE *)((BYTE *)pModule+pModule->entry_table); do { entry = (ET_ENTRY *)((BYTE *)bundle+6); DPRINTF( "Bundle %d-%d: %02x\n", bundle->first, bundle->last, entry->type); @@ -476,7 +476,7 @@ static HMODULE16 NE_LoadExeHeader( HANDLE hFile, LPCSTR path ) /* resident names table */ ne_header.ne_modtab - ne_header.ne_restab + /* module ref table */ - ne_header.ne_cmod * sizeof(WORD) + + ne_header.ne_cmod * sizeof(WORD) + /* imported names table */ ne_header.ne_enttab - ne_header.ne_imptab + /* entry table length */ @@ -570,7 +570,7 @@ static HMODULE16 NE_LoadExeHeader( HANDLE hFile, LPCSTR path ) pModule->res_table = pData - (BYTE *)pModule; if (!READ(mz_header.e_lfanew + ne_header.ne_rsrctab, ne_header.ne_restab - ne_header.ne_rsrctab, - pData )) + pData )) return (HMODULE16)11; /* invalid exe */ pData += ne_header.ne_restab - ne_header.ne_rsrctab; NE_InitResourceHandler( hModule ); @@ -612,7 +612,7 @@ static HMODULE16 NE_LoadExeHeader( HANDLE hFile, LPCSTR path ) /* Get the imported names table */ pModule->import_table = pData - (BYTE *)pModule; - if (!READ( mz_header.e_lfanew + ne_header.ne_imptab, + if (!READ( mz_header.e_lfanew + ne_header.ne_imptab, ne_header.ne_enttab - ne_header.ne_imptab, pData )) { @@ -862,17 +862,17 @@ static HINSTANCE16 NE_DoLoadModule( NE_MODULE *pModule ) /********************************************************************** * NE_LoadModule * - * Load first instance of NE module. (Note: caller is responsible for + * Load first instance of NE module. (Note: caller is responsible for * ensuring the module isn't already loaded!) * - * If the module turns out to be an executable module, only a + * If the module turns out to be an executable module, only a * handle to a module stub is returned; this needs to be initialized * by calling NE_DoLoadModule later, in the context of the newly * created process. * * If lib_only is TRUE, however, the module is perforce treated * like a DLL module, even if it is an executable module. - * + * */ static HINSTANCE16 NE_LoadModule( LPCSTR name, BOOL lib_only ) { @@ -1083,8 +1083,8 @@ HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock ) * At this point, we need to create a new process. * * pModule points either to an already loaded module, whose refcount - * has already been incremented (to avoid having the module vanish - * in the meantime), or else to a stub module which contains only header + * has already been incremented (to avoid having the module vanish + * in the meantime), or else to a stub module which contains only header * information. */ params = (LOADPARAMS16 *)paramBlock; @@ -1285,7 +1285,7 @@ static BOOL16 NE_FreeModule( HMODULE16 hModule, BOOL call_wep ) else call_wep = FALSE; /* We are freeing a task -> no more WEPs */ } - + /* Clear magic number just in case */ @@ -1377,7 +1377,7 @@ WORD WINAPI GetExpWinVer16( HMODULE16 hModule ) NE_MODULE *pModule = NE_GetPtr( hModule ); if ( !pModule ) return 0; - /* + /* * For built-in modules, fake the expected version the module should * have according to the Windows version emulated by Wine */ @@ -1387,7 +1387,7 @@ WORD WINAPI GetExpWinVer16( HMODULE16 hModule ) versionInfo.dwOSVersionInfoSize = sizeof(versionInfo); if ( GetVersionExA( &versionInfo ) ) - pModule->expected_version = + pModule->expected_version = (versionInfo.dwMajorVersion & 0xff) << 8 | (versionInfo.dwMinorVersion & 0xff); } @@ -1546,7 +1546,7 @@ HMODULE16 WINAPI GetModuleHandle16( LPCSTR name ) /* If the extension of 'name' is '.EXE' and the base filename of 'name' * matches the base filename of the module filename of some 32-bit module: - * Return the corresponding 16-bit dummy module handle. + * Return the corresponding 16-bit dummy module handle. */ if (len >= 4 && !FILE_strcasecmp(name+len-4, ".EXE")) { diff --git a/loader/ne/resource.c b/loader/ne/resource.c index 5716eb133a8..b7139be4fda 100644 --- a/loader/ne/resource.c +++ b/loader/ne/resource.c @@ -21,7 +21,7 @@ */ #include "config.h" -#include "wine/port.h" +#include "wine/port.h" #include #include @@ -71,7 +71,7 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, LPCSTR typeId, LPCSTR resId { TRACE("NameTable entry: type=%04x id=%04x\n", pTypeInfo->type_id, pNameInfo->id ); - handle = LoadResource16( pModule->self, + handle = LoadResource16( pModule->self, (HRSRC16)((int)pNameInfo - (int)pModule) ); for(p = (WORD*)LockResource16(handle); p && *p; p = (WORD *)((char*)p+*p)) { @@ -94,7 +94,7 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, LPCSTR typeId, LPCSTR resId { if (!HIWORD(resId)) continue; if (strcasecmp( resId, (char*)(p+3)+strlen((char*)(p+3))+1 )) continue; - + } else if (HIWORD(resId) || (((DWORD)resId & ~0x8000) != p[2])) continue; @@ -117,7 +117,7 @@ static DWORD NE_FindNameTableId( NE_MODULE *pModule, LPCSTR typeId, LPCSTR resId * * Find header struct for a particular resource type. */ -NE_TYPEINFO *NE_FindTypeSection( LPBYTE pResTab, +NE_TYPEINFO *NE_FindTypeSection( LPBYTE pResTab, NE_TYPEINFO *pTypeInfo, LPCSTR typeId ) { /* start from pTypeInfo */ @@ -186,7 +186,7 @@ NE_NAMEINFO *NE_FindResourceFromType( LPBYTE pResTab, { WORD id = LOWORD(resId) | 0x8000; for (count = pTypeInfo->count; count > 0; count--, pNameInfo++) - if (pNameInfo->id == id) + if (pNameInfo->id == id) return pNameInfo; } return NULL; @@ -196,7 +196,7 @@ NE_NAMEINFO *NE_FindResourceFromType( LPBYTE pResTab, /*********************************************************************** * DefResourceHandler (KERNEL.456) * - * This is the default LoadProc() function. + * This is the default LoadProc() function. */ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule, HRSRC16 hRsrc ) @@ -208,7 +208,7 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule, HGLOBAL16 handle; WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table); NE_NAMEINFO* pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc); - + if ( hMemObj ) handle = GlobalReAlloc16( hMemObj, pNameInfo->length << sizeShift, 0 ); else @@ -217,7 +217,7 @@ HGLOBAL16 WINAPI NE_DefResourceHandler( HGLOBAL16 hMemObj, HMODULE16 hModule, if ( handle ) { /* NOTE: hRsrcMap points to start of built-in resource data */ - memcpy( GlobalLock16( handle ), + memcpy( GlobalLock16( handle ), (char *)pModule->hRsrcMap + (pNameInfo->offset << sizeShift), pNameInfo->length << sizeShift ); } @@ -486,7 +486,7 @@ HGLOBAL16 NE_LoadResource( NE_MODULE *pModule, HRSRC16 hRsrc ) pNameInfo = (NE_NAMEINFO *)(((char *)pModule) + hRsrc); break; } - else + else break; /* NE_NAMEINFO boundary mismatch */ } pTypeInfo = (NE_TYPEINFO *)(((char *)pModule) + d); diff --git a/loader/ne/segment.c b/loader/ne/segment.c index c0e0af9eab5..6124bf40db3 100644 --- a/loader/ne/segment.c +++ b/loader/ne/segment.c @@ -137,7 +137,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) } if (!pSeg->filepos) return TRUE; /* No file image, just return */ - + pModuleTable = NE_MODULE_TABLE( pModule ); hf = NE_OpenFile( pModule ); @@ -261,7 +261,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) NE_MODULE *pTarget = NE_GetPtr( module ); if (!pTarget) WARN_(module)("Module not found: %04x, reference %d of module %*.*s\n", - module, rep->target1, + module, rep->target1, *((BYTE *)pModule + pModule->name_table), *((BYTE *)pModule + pModule->name_table), (char *)pModule + pModule->name_table + 1 ); @@ -277,14 +277,14 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) if (TRACE_ON(fixup)) { NE_MODULE *pTarget = NE_GetPtr( module ); - TRACE_(fixup)("%d: %.*s.%d=%04x:%04x %s\n", i + 1, + TRACE_(fixup)("%d: %.*s.%d=%04x:%04x %s\n", i + 1, *((BYTE *)pTarget + pTarget->name_table), (char *)pTarget + pTarget->name_table + 1, ordinal, HIWORD(address), LOWORD(address), NE_GetRelocAddrName( rep->address_type, additive ) ); } break; - + case NE_RELTYPE_NAME: module = pModuleTable[rep->target1-1]; func_name = (char *)pModule + pModule->import_table + rep->target2; @@ -305,14 +305,14 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) if (TRACE_ON(fixup)) { NE_MODULE *pTarget = NE_GetPtr( module ); - TRACE_(fixup)("%d: %.*s.%s=%04x:%04x %s\n", i + 1, + TRACE_(fixup)("%d: %.*s.%s=%04x:%04x %s\n", i + 1, *((BYTE *)pTarget + pTarget->name_table), (char *)pTarget + pTarget->name_table + 1, func_name, HIWORD(address), LOWORD(address), NE_GetRelocAddrName( rep->address_type, additive ) ); } break; - + case NE_RELTYPE_INTERNAL: if ((rep->target1 & 0xff) == 0xff) { @@ -322,8 +322,8 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) { address = (FARPROC16)MAKESEGPTR( SEL(pSegTable[rep->target1-1].hSeg), rep->target2 ); } - - TRACE_(fixup)("%d: %04x:%04x %s\n", + + TRACE_(fixup)("%d: %04x:%04x %s\n", i + 1, HIWORD(address), LOWORD(address), NE_GetRelocAddrName( rep->address_type, additive ) ); break; @@ -420,7 +420,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) unknown: WARN_(fixup)("WARNING: %d: unknown ADDR TYPE %d, " "TYPE %d, OFFSET %04x, TARGET %04x %04x\n", - i + 1, rep->address_type, rep->relocation_type, + i + 1, rep->address_type, rep->relocation_type, rep->offset, rep->target1, rep->target2); HeapFree(GetProcessHeap(), 0, reloc_entries); return FALSE; @@ -506,7 +506,7 @@ static void NE_FixupSegmentPrologs(NE_MODULE *pModule, WORD segnum) if (!pModule->dgroup) return; if (!(dgroup = SEL(pSegTable[pModule->dgroup-1].hSeg))) return; - + pSeg = MapSL( MAKESEGPTR(sel, 0) ); bundle = (ET_BUNDLE *)((BYTE *)pModule+pModule->entry_table); @@ -587,7 +587,7 @@ DWORD WINAPI PatchCodeHandle16(HANDLE16 hSeg) /*********************************************************************** * NE_GetDLLInitParams */ -static VOID NE_GetDLLInitParams( NE_MODULE *pModule, +static VOID NE_GetDLLInitParams( NE_MODULE *pModule, WORD *hInst, WORD *ds, WORD *heap ) { SEGTABLEENTRY *pSegTable = NE_SEG_TABLE( pModule ); @@ -669,7 +669,7 @@ static BOOL NE_InitDLL( NE_MODULE *pModule ) pModule->cs = 0; /* Don't initialize it twice */ - TRACE_(dll)("Calling LibMain, cs:ip=%04lx:%04lx ds=%04lx di=%04x cx=%04x\n", + TRACE_(dll)("Calling LibMain, cs:ip=%04lx:%04lx ds=%04lx di=%04x cx=%04x\n", context.SegCs, context.Eip, context.SegDs, LOWORD(context.Edi), LOWORD(context.Ecx) ); wine_call_to_16_regs_short( &context, 0 ); @@ -679,7 +679,7 @@ static BOOL NE_InitDLL( NE_MODULE *pModule ) /*********************************************************************** * NE_InitializeDLLs * - * Recursively initialize all DLLs (according to the order in which + * Recursively initialize all DLLs (according to the order in which * they where loaded). */ void NE_InitializeDLLs( HMODULE16 hModule ) @@ -707,7 +707,7 @@ void NE_InitializeDLLs( HMODULE16 hModule ) /*********************************************************************** * NE_CallDllEntryPoint * - * Call the DllEntryPoint of DLLs with subsystem >= 4.0 + * Call the DllEntryPoint of DLLs with subsystem >= 4.0 */ typedef DWORD (WINAPI *WinNEEntryProc)(DWORD,WORD,WORD,WORD,DWORD,WORD); @@ -759,12 +759,12 @@ static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason ) /*********************************************************************** * NE_DllProcessAttach - * + * * Call the DllEntryPoint of all modules this one (recursively) * depends on, according to the order in which they were loaded. * * Note that --as opposed to the PE module case-- there is no notion - * of 'module loaded into a process' for NE modules, and hence we + * of 'module loaded into a process' for NE modules, and hence we * have no place to store the fact that the DllEntryPoint of a * given module was already called on behalf of this process (e.g. * due to some earlier LoadLibrary16 call). @@ -773,7 +773,7 @@ static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason ) * appears to behave this way as well ... * * This routine must only be called with the Win16Lock held. - * + * * FIXME: We should actually abort loading in case the DllEntryPoint * returns FALSE ... * @@ -791,7 +791,7 @@ static void add_to_init_list( struct ne_init_list *list, NE_MODULE *hModule ) if ( list->count == list->size ) { int newSize = list->size + 128; - NE_MODULE **newModule = HeapReAlloc( GetProcessHeap(), 0, + NE_MODULE **newModule = HeapReAlloc( GetProcessHeap(), 0, list->module, newSize*sizeof(NE_MODULE *) ); if ( !newModule ) { @@ -876,12 +876,12 @@ void NE_DllProcessAttach( HMODULE16 hModule ) * This function translates NE segment flags to GlobalAlloc flags */ static WORD NE_Ne2MemFlags(WORD flags) -{ +{ WORD memflags = 0; #if 1 - if (flags & NE_SEGFLAGS_DISCARDABLE) + if (flags & NE_SEGFLAGS_DISCARDABLE) memflags |= GMEM_DISCARDABLE; - if (flags & NE_SEGFLAGS_MOVEABLE || + if (flags & NE_SEGFLAGS_MOVEABLE || ( ! (flags & NE_SEGFLAGS_DATA) && ! (flags & NE_SEGFLAGS_LOADED) && ! (flags & NE_SEGFLAGS_ALLOCATED) @@ -936,7 +936,7 @@ HINSTANCE16 NE_GetInstance( NE_MODULE *pModule ) pSeg = NE_SEG_TABLE( pModule ) + pModule->dgroup - 1; return pSeg->hSeg; } -} +} /*********************************************************************** * NE_CreateSegment diff --git a/loader/pe_image.c b/loader/pe_image.c index cd2c744e83a..35a1ab11574 100644 --- a/loader/pe_image.c +++ b/loader/pe_image.c @@ -1,4 +1,4 @@ -/* +/* * Copyright 1994 Eric Youndale & Erik Bos * Copyright 1995 Martin von Löwis * Copyright 1996-98 Marcus Meissner @@ -23,12 +23,12 @@ /* Notes: * Before you start changing something in this file be aware of the following: * - * - There are several functions called recursively. In a very subtle and + * - There are several functions called recursively. In a very subtle and * obscure way. DLLs can reference each other recursively etc. * - If you want to enhance, speed up or clean up something in here, think * twice WHY it is implemented in that strange way. There is usually a reason. * Though sometimes it might just be lazyness ;) - * - In PE_MapImage, right before PE_fixup_imports() all external and internal + * - In PE_MapImage, right before PE_fixup_imports() all external and internal * state MUST be correct since this function can be called with the SAME image * AGAIN. (Thats recursion for you.) That means MODREF.module and * NE_MODULE.module32. @@ -82,7 +82,7 @@ static IMAGE_IMPORT_DESCRIPTOR *get_imports( HMODULE hmod ) #define AdjustPtr(ptr,delta) ((char *)(ptr) + (delta)) void dump_exports( HMODULE hModule ) -{ +{ char *Module; int i, j; WORD *ordinal; @@ -98,7 +98,7 @@ void dump_exports( HMODULE hModule ) Module = (char*)RVA(pe_exports->Name); TRACE("*******EXPORT DATA*******\n"); - TRACE("Module name is %s, %ld functions, %ld names\n", + TRACE("Module name is %s, %ld functions, %ld names\n", Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames); ordinal = RVA(pe_exports->AddressOfNameOrdinals); @@ -128,13 +128,13 @@ void dump_exports( HMODULE hModule ) /* Look up the specified function or ordinal in the export list: * If it is a string: - * - look up the name in the name list. + * - look up the name in the name list. * - look up the ordinal with that index. * - use the ordinal as offset into the functionlist * If it is an ordinal: * - use ordinal-pe_export->Base as offset into the function list */ -static FARPROC PE_FindExportedFunction( +static FARPROC PE_FindExportedFunction( WINE_MODREF *wm, /* [in] WINE modreference */ LPCSTR funcName, /* [in] function name */ BOOL snoop ) @@ -287,10 +287,10 @@ DWORD PE_fixup_imports( WINE_MODREF *wm ) wm->nDeps = i; wm->deps = HeapAlloc( GetProcessHeap(), 0, i*sizeof(WINE_MODREF *) ); - /* load the imported modules. They are automatically + /* load the imported modules. They are automatically * added to the modref list of the process. */ - + for (i = 0, pe_imp = imports; pe_imp->Name ; pe_imp++) { WINE_MODREF *wmImp; IMAGE_IMPORT_BY_NAME *pe_name; @@ -465,8 +465,8 @@ static int do_relocations( char *base, const IMAGE_NT_HEADERS *nt, const char *f /********************************************************************** * PE_LoadImage * Load one PE format DLL/EXE into memory - * - * Unluckily we can't just mmap the sections where we want them, for + * + * Unluckily we can't just mmap the sections where we want them, for * (at least) Linux does only support offsets which are page-aligned. * * BUT we have to map the whole image anyway, for Win32 programs sometimes @@ -629,7 +629,7 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, LPCSTR filename, DWORD flags, } wm->hDummyMod = hModule16; - if ( builtin ) + if ( builtin ) { NE_MODULE *pModule = (NE_MODULE *)GlobalLock16( hModule16 ); pModule->flags |= NE_FFLAGS_BUILTIN; @@ -702,7 +702,7 @@ WINE_MODREF *PE_CreateModule( HMODULE hModule, LPCSTR filename, DWORD flags, } /****************************************************************************** - * The PE Library Loader frontend. + * The PE Library Loader frontend. * FIXME: handle the flags. */ WINE_MODREF *PE_LoadLibraryExA (LPCSTR name, DWORD flags) @@ -710,11 +710,11 @@ WINE_MODREF *PE_LoadLibraryExA (LPCSTR name, DWORD flags) HMODULE hModule32; WINE_MODREF *wm; HANDLE hFile; - + hFile = CreateFileA( name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); if ( hFile == INVALID_HANDLE_VALUE ) return NULL; - + /* Load PE module */ hModule32 = PE_LoadImage( hFile, name, flags ); if (!hModule32) @@ -792,7 +792,7 @@ void PE_InitTls( void ) LPVOID mem; PIMAGE_TLS_DIRECTORY pdir; int delta; - + for (wm = MODULE_modref_list;wm;wm=wm->next) { peh = PE_HEADER(wm->module); delta = wm->module - peh->OptionalHeader.ImageBase; @@ -800,8 +800,8 @@ void PE_InitTls( void ) continue; pdir = (LPVOID)(wm->module + peh->OptionalHeader. DataDirectory[IMAGE_FILE_THREAD_LOCAL_STORAGE].VirtualAddress); - - + + if ( wm->tlsindex == -1 ) { LPDWORD xaddr; wm->tlsindex = TlsAlloc(); @@ -815,7 +815,7 @@ void PE_InitTls( void ) mem=VirtualAlloc(0,size,MEM_RESERVE|MEM_COMMIT,PAGE_READWRITE); memcpy(mem,_fixup_address(&(peh->OptionalHeader),delta,(LPVOID)pdir->StartAddressOfRawData),datasize); if (pdir->AddressOfCallBacks) { - PIMAGE_TLS_CALLBACK *cbs; + PIMAGE_TLS_CALLBACK *cbs; cbs = _fixup_address(&(peh->OptionalHeader),delta,pdir->AddressOfCallBacks); if (*cbs) diff --git a/loader/resource.c b/loader/resource.c index 26ee26f63e4..e4d3e853c51 100644 --- a/loader/resource.c +++ b/loader/resource.c @@ -68,7 +68,7 @@ static HRSRC16 MapHRsrc32To16( NE_MODULE *pModule, HANDLE hRsrc32, WORD type ) /* On first call, initialize HRSRC map */ if ( !map ) { - if ( !(map = (HRSRC_MAP *)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + if ( !(map = (HRSRC_MAP *)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HRSRC_MAP) ) ) ) { ERR("Cannot allocate HRSRC map\n" ); @@ -85,9 +85,9 @@ static HRSRC16 MapHRsrc32To16( NE_MODULE *pModule, HANDLE hRsrc32, WORD type ) /* If no space left, grow table */ if ( map->nUsed == map->nAlloc ) { - if ( !(newElem = (HRSRC_ELEM *)HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - map->elem, - (map->nAlloc + HRSRC_MAP_BLOCKSIZE) + if ( !(newElem = (HRSRC_ELEM *)HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + map->elem, + (map->nAlloc + HRSRC_MAP_BLOCKSIZE) * sizeof(HRSRC_ELEM) ) )) { ERR("Cannot grow HRSRC map\n" ); @@ -137,11 +137,11 @@ static WINE_EXCEPTION_FILTER(page_fault) } static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, - LPCSTR name, WORD lang, + LPCSTR name, WORD lang, BOOL bUnicode, BOOL bRet16 ) { HRSRC hRsrc = 0; - + TRACE("(%08x, %08x%s, %08x%s, %04x, %s, %s)\n", hModule, (UINT)type, HIWORD(type)? (bUnicode? debugstr_w((LPWSTR)type) : debugstr_a(type)) : "", @@ -159,7 +159,7 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, { /* 16-bit NE module */ LPSTR typeStr, nameStr; - + if ( HIWORD( type ) && bUnicode ) typeStr = HEAP_strdupWtoA( GetProcessHeap(), 0, (LPCWSTR)type ); else @@ -168,14 +168,14 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, nameStr = HEAP_strdupWtoA( GetProcessHeap(), 0, (LPCWSTR)name ); else nameStr = (LPSTR)name; - + hRsrc = NE_FindResource( pModule, nameStr, typeStr ); - - if ( HIWORD( type ) && bUnicode ) + + if ( HIWORD( type ) && bUnicode ) HeapFree( GetProcessHeap(), 0, typeStr ); - if ( HIWORD( name ) && bUnicode ) + if ( HIWORD( name ) && bUnicode ) HeapFree( GetProcessHeap(), 0, nameStr ); - + /* If we need to return 32-bit HRSRC, no conversion is necessary, we simply use the 16-bit HRSRC as 32-bit HRSRC */ } @@ -185,7 +185,7 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, hRsrc = RES_FindResource2( pModule->module32, type, name, lang, bUnicode, FALSE ); /* If we need to return 16-bit HRSRC, perform conversion */ if ( bRet16 ) - hRsrc = MapHRsrc32To16( pModule, hRsrc, + hRsrc = MapHRsrc32To16( pModule, hRsrc, HIWORD( type )? 0 : LOWORD( type ) ); } } @@ -193,7 +193,7 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, { /* 32-bit PE module */ LPWSTR typeStr, nameStr; - + if ( HIWORD( type ) && !bUnicode ) typeStr = HEAP_strdupAtoW( GetProcessHeap(), 0, type ); else @@ -211,10 +211,10 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, hRsrc = PE_FindResourceW( hModule, nameStr, typeStr ); else hRsrc = PE_FindResourceExW( hModule, nameStr, typeStr, lang ); - - if ( HIWORD( type ) && !bUnicode ) + + if ( HIWORD( type ) && !bUnicode ) HeapFree( GetProcessHeap(), 0, typeStr ); - if ( HIWORD( name ) && !bUnicode ) + if ( HIWORD( name ) && !bUnicode ) HeapFree( GetProcessHeap(), 0, nameStr ); } return hRsrc; @@ -225,7 +225,7 @@ static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type, */ static HRSRC RES_FindResource( HMODULE hModule, LPCSTR type, - LPCSTR name, WORD lang, + LPCSTR name, WORD lang, BOOL bUnicode, BOOL bRet16 ) { HRSRC hRsrc; @@ -341,27 +341,27 @@ HRSRC16 WINAPI FindResource16( HMODULE16 hModule, LPCSTR name, LPCSTR type ) */ HRSRC WINAPI FindResourceA( HMODULE hModule, LPCSTR name, LPCSTR type ) { - return RES_FindResource( hModule, type, name, + return RES_FindResource( hModule, type, name, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), FALSE, FALSE ); } /********************************************************************** * FindResourceExA (KERNEL32.@) */ -HRSRC WINAPI FindResourceExA( HMODULE hModule, +HRSRC WINAPI FindResourceExA( HMODULE hModule, LPCSTR type, LPCSTR name, WORD lang ) { - return RES_FindResource( hModule, type, name, + return RES_FindResource( hModule, type, name, lang, FALSE, FALSE ); } /********************************************************************** * FindResourceExW (KERNEL32.@) */ -HRSRC WINAPI FindResourceExW( HMODULE hModule, +HRSRC WINAPI FindResourceExW( HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang ) { - return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, + return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, lang, TRUE, FALSE ); } @@ -370,7 +370,7 @@ HRSRC WINAPI FindResourceExW( HMODULE hModule, */ HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type) { - return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, + return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), TRUE, FALSE ); } diff --git a/loader/task.c b/loader/task.c index 8826f22afe9..dce3a75b4f6 100644 --- a/loader/task.c +++ b/loader/task.c @@ -88,7 +88,7 @@ HTASK16 TASK_GetNextTask( HTASK16 hTask ) TDB* pTask = TASK_GetPtr( hTask ); if (pTask->hNext) return pTask->hNext; - return (hFirstTask != hTask) ? hFirstTask : 0; + return (hFirstTask != hTask) ? hFirstTask : 0; } @@ -470,14 +470,14 @@ HTASK16 TASK_SpawnTask( NE_MODULE *pModule, WORD cmdShow, */ void TASK_ExitTask(void) { - TDB *pTask; + TDB *pTask; DWORD lockCount; /* Enter the Win16Lock to protect global data structures */ _EnterWin16Lock(); pTask = TASK_GetCurrent(); - if ( !pTask ) + if ( !pTask ) { _LeaveWin16Lock(); return; @@ -537,7 +537,7 @@ void WINAPI InitTask16( CONTEXT86 *context ) context->Eax = 0; if (!(pTask = TASK_GetCurrent())) return; - /* Note: we need to trust that BX/CX contain the stack/heap sizes, + /* Note: we need to trust that BX/CX contain the stack/heap sizes, as some apps, notably Visual Basic apps, *modify* the heap/stack size of the instance data segment before calling InitTask() */ @@ -851,8 +851,8 @@ void WINAPI FreeProcInstance16( FARPROC16 func ) /********************************************************************** * TASK_GetCodeSegment - * - * Helper function for GetCodeHandle/GetCodeInfo: Retrieve the module + * + * Helper function for GetCodeHandle/GetCodeInfo: Retrieve the module * and logical segment number of a given code segment. * * 'proc' either *is* already a pair of module handle and segment number, @@ -865,7 +865,7 @@ void WINAPI FreeProcInstance16( FARPROC16 func ) * the function the snoop code will return to ... * */ -static BOOL TASK_GetCodeSegment( FARPROC16 proc, NE_MODULE **ppModule, +static BOOL TASK_GetCodeSegment( FARPROC16 proc, NE_MODULE **ppModule, SEGTABLEENTRY **ppSeg, int *pSegNr ) { NE_MODULE *pModule = NULL; @@ -882,7 +882,7 @@ static BOOL TASK_GetCodeSegment( FARPROC16 proc, NE_MODULE **ppModule, } /* Try thunk or function */ - else + else { BYTE *thunk = MapSL( (SEGPTR)proc ); WORD selector; @@ -1336,8 +1336,8 @@ void TASK_CallTaskSignalProc( UINT16 uCode, HANDLE16 hTaskOrModule ) TDB *pTask = TASK_GetCurrent(); if ( !pTask || !pTask->userhandler ) return; - TASK_CallTo16_word_wwwww( pTask->userhandler, - hTaskOrModule, uCode, 0, + TASK_CallTo16_word_wwwww( pTask->userhandler, + hTaskOrModule, uCode, 0, pTask->hInstance, pTask->hQueue ); } diff --git a/memory/atom.c b/memory/atom.c index 67c356f7b07..84857919b40 100644 --- a/memory/atom.c +++ b/memory/atom.c @@ -66,7 +66,7 @@ typedef struct WORD size; HANDLE16 entries[1]; } ATOMTABLE; - + static WORD ATOM_UserDS = 0; /* USER data segment */ /*********************************************************************** @@ -120,7 +120,7 @@ static WORD ATOM_Hash( WORD i, hash = 0; TRACE("%x, %s, %x\n", entries, str, len); - + for (i = 0; i < len; i++) hash ^= toupper(str[i]) + i; return hash % entries; } @@ -200,14 +200,14 @@ WORD WINAPI InitAtomTable16( WORD entries ) HANDLE16 handle; ATOMTABLE *table; - /* We consider the first table to be initialized as the global table. - * This works, as USER (both built-in and native) is the first one to - * register ... + /* We consider the first table to be initialized as the global table. + * This works, as USER (both built-in and native) is the first one to + * register ... */ if (!ATOM_UserDS) { - ATOM_UserDS = CURRENT_DS; + ATOM_UserDS = CURRENT_DS; /* return dummy local handle */ return LocalAlloc16( LMEM_FIXED, 1 ); } @@ -262,7 +262,7 @@ ATOM WINAPI AddAtom16( LPCSTR str ) if (ATOM_IsIntAtomA( str, &iatom )) return iatom; TRACE("%s\n",debugstr_a(buffer)); - + /* Make a copy of the string to be sure it doesn't move in linear memory. */ lstrcpynA( buffer, str, sizeof(buffer) ); @@ -275,7 +275,7 @@ ATOM WINAPI AddAtom16( LPCSTR str ) while (entry) { entryPtr = ATOM_MakePtr( entry ); - if ((entryPtr->length == len) && + if ((entryPtr->length == len) && (!strncasecmp( entryPtr->str, buffer, len ))) { entryPtr->refCount++; @@ -329,7 +329,7 @@ ATOM WINAPI DeleteAtom16( ATOM atom ) { ATOMENTRY * prevEntryPtr = ATOM_MakePtr( *prevEntry ); prevEntry = &prevEntryPtr->next; - } + } if (!*prevEntry) return atom; /* Delete atom */ @@ -337,7 +337,7 @@ ATOM WINAPI DeleteAtom16( ATOM atom ) { *prevEntry = entryPtr->next; LocalFree16( entry ); - } + } return 0; } @@ -364,7 +364,7 @@ ATOM WINAPI FindAtom16( LPCSTR str ) while (entry) { ATOMENTRY * entryPtr = ATOM_MakePtr( entry ); - if ((entryPtr->length == len) && + if ((entryPtr->length == len) && (!strncasecmp( entryPtr->str, str, len ))) { TRACE("-- found %x\n", entry); @@ -390,9 +390,9 @@ UINT16 WINAPI GetAtomName16( ATOM atom, LPSTR buffer, INT16 count ) char text[8]; if (CURRENT_DS == ATOM_UserDS) return GlobalGetAtomNameA( atom, buffer, count ); - + TRACE("%x\n",atom); - + if (!count) return 0; if (atom < MAXINTATOM) { @@ -573,7 +573,7 @@ ATOM WINAPI GlobalDeleteAtom( ATOM atom /* [in] Atom to delete */ ) */ ATOM WINAPI DeleteAtom( ATOM atom /* [in] Atom to delete */ ) { - return ATOM_DeleteAtom( atom, TRUE ); + return ATOM_DeleteAtom( atom, TRUE ); } diff --git a/memory/codepage.c b/memory/codepage.c index 21915ad1d54..2ed3ebb2099 100644 --- a/memory/codepage.c +++ b/memory/codepage.c @@ -163,7 +163,7 @@ BOOL WINAPI GetCPInfo( UINT codepage, LPCPINFO cpinfo ) { const union cptable *table = get_codepage_table( codepage ); - if (!table) + if (!table) { SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; diff --git a/memory/environ.c b/memory/environ.c index 8fa917a6eca..c52fcbcac08 100644 --- a/memory/environ.c +++ b/memory/environ.c @@ -312,13 +312,13 @@ static void set_library_argv( char **argv ) * Note that it does NOT necessarily include the file name. * Sometimes we don't even have any command line options at all. * - * We must quote and escape characters so that the argv array can be rebuilt + * We must quote and escape characters so that the argv array can be rebuilt * from the command line: * - spaces and tabs must be quoted * 'a b' -> '"a b"' * - quotes must be escaped * '"' -> '\"' - * - if '\'s are followed by a '"', they must be doubled and followed by '\"', + * - if '\'s are followed by a '"', they must be doubled and followed by '\"', * resulting in an odd number of '\' followed by a '"' * '\"' -> '\\\"' * '\\"' -> '\\\\\"' @@ -351,7 +351,7 @@ BOOL ENV_BuildCommandLine( char **argv ) if (*a==' ' || *a=='\t') { has_space=1; } else if (*a=='"') { - /* doubling of '\' preceeding a '"', + /* doubling of '\' preceeding a '"', * plus escaping of said '"' */ len+=2*bcount+1; @@ -448,14 +448,14 @@ BOOL ENV_BuildCommandLine( char **argv ) * whereas Windows NT only returns the full file path plus arguments * in case the program has been started with a full path. * Win9x seems to have inherited NT behaviour. - * + * * Note that both Start Menu Execute and Explorer start programs with * fully specified quoted app file paths, which is why probably the only case * where you'll see single file names is in case of direct launch * via CreateProcess or WinExec. * * Perhaps we should take care of Win3.1 programs here (Win32s "feature"). - * + * * References: MS KB article q102762.txt (special Win32s handling) */ LPSTR WINAPI GetCommandLineA(void) diff --git a/memory/global.c b/memory/global.c index ffa2b89dfcd..17e6b001fdb 100644 --- a/memory/global.c +++ b/memory/global.c @@ -181,7 +181,7 @@ BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle ) GLOBALARENA *pArena; if (!handle) return TRUE; - sel = GlobalHandleToSel16( handle ); + sel = GlobalHandleToSel16( handle ); if (!VALID_HANDLE(sel)) return FALSE; pArena = GET_ARENA_PTR(sel); @@ -199,7 +199,7 @@ BOOL16 GLOBAL_MoveBlock( HGLOBAL16 handle, const void *ptr, DWORD size ) GLOBALARENA *pArena; if (!handle) return TRUE; - sel = GlobalHandleToSel16( handle ); + sel = GlobalHandleToSel16( handle ); if (!VALID_HANDLE(sel)) return FALSE; pArena = GET_ARENA_PTR(sel); @@ -291,7 +291,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( TRACE("%04x %ld flags=%04x\n", handle, size, flags ); if (!handle) return 0; - + if (!VALID_HANDLE(handle)) { WARN("Invalid handle 0x%04x!\n", handle); return 0; @@ -308,7 +308,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( HeapFree( GetProcessHeap(), 0, (void *)pArena->base ); pArena->base = 0; - /* Note: we rely on the fact that SELECTOR_ReallocBlock won't + /* Note: we rely on the fact that SELECTOR_ReallocBlock won't * change the selector if we are shrinking the block. * FIXME: shouldn't we keep selectors until the block is deleted? */ @@ -377,7 +377,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16( return 0; } - /* Fill the new arena block + /* Fill the new arena block As we may have used HEAP_REALLOC_IN_PLACE_ONLY, areas may overlap*/ if (pNewArena != pArena) memmove( pNewArena, pArena, sizeof(GLOBALARENA) ); @@ -438,7 +438,7 @@ SEGPTR WINAPI WIN16_GlobalLock16( HGLOBAL16 handle ) WARN("Invalid handle 0x%04x passed to WIN16_GlobalLock16!\n",handle); sel = 0; } - else if (!GET_ARENA_PTR(handle)->base) + else if (!GET_ARENA_PTR(handle)->base) sel = 0; else GET_ARENA_PTR(handle)->lockCount++; @@ -462,7 +462,7 @@ SEGPTR WINAPI K32WOWGlobalLock16( HGLOBAL16 hMem ) * GlobalLock16 (KERNEL32.25) * * This is the GlobalLock16() function used by 32-bit code. - * + * * RETURNS * Pointer to first byte of memory block * NULL: Failure @@ -735,7 +735,7 @@ DWORD WINAPI GlobalDOSAlloc16( HMODULE16 hModule = GetModuleHandle16("KERNEL"); WORD wSelector; GLOBALARENA *pArena; - + wSelector = GLOBAL_CreateBlock(GMEM_FIXED, lpBlock, size, hModule, WINE_LDT_FLAGS_DATA ); pArena = GET_ARENA_PTR(wSelector); pArena->flags |= GA_DOSMEM; @@ -756,7 +756,7 @@ WORD WINAPI GlobalDOSFree16( ) { DWORD block = GetSelectorBase(sel); - if( block && block < 0x100000 ) + if( block && block < 0x100000 ) { LPVOID lpBlock = DOSMEM_MapDosToLinear( block ); if( DOSMEM_FreeBlock( lpBlock ) ) @@ -976,7 +976,7 @@ BOOL16 WINAPI MemManInfo16( MEMMANINFO *info ) MEMORYSTATUS status; /* - * Not unsurprisingly although the documention says you + * Not unsurprisingly although the documention says you * _must_ provide the size in the dwSize field, this function * (under Windows) always fills the structure and returns true. */ @@ -1007,12 +1007,12 @@ DWORD WINAPI GetFreeMemInfo16(void) /* * Win32 Global heap functions (GlobalXXX). * These functions included in Win32 for compatibility with 16 bit Windows - * Especially the moveable blocks and handles are oldish. + * Especially the moveable blocks and handles are oldish. * But the ability to directly allocate memory with GPTR and LPTR is widely * used. * * The handle stuff looks horrible, but it's implemented almost like Win95 - * does it. + * does it. * */ @@ -1051,9 +1051,9 @@ HGLOBAL WINAPI GlobalAlloc( hpflags=HEAP_ZERO_MEMORY; else hpflags=0; - + TRACE("() flags=%04x\n", flags ); - + if((flags & GMEM_MOVEABLE)==0) /* POINTER */ { palloc=HeapAlloc(GetProcessHeap(), hpflags, size); @@ -1079,9 +1079,9 @@ HGLOBAL WINAPI GlobalAlloc( pintern->Magic=MAGIC_GLOBAL_USED; pintern->Flags=flags>>8; pintern->LockCount=0; - + /* HeapUnlock(heap); */ - + return INTERN_TO_HANDLE(pintern); } } @@ -1103,7 +1103,7 @@ LPVOID WINAPI GlobalLock( return (LPVOID) hmem; /* HeapLock(GetProcessHeap()); */ - + pintern=HANDLE_TO_INTERN(hmem); if(pintern->Magic==MAGIC_GLOBAL_USED) { @@ -1396,7 +1396,7 @@ DWORD WINAPI GlobalSize( DWORD retval; PGLOBAL32_INTERN pintern; - if(ISPOINTER(hmem)) + if(ISPOINTER(hmem)) { retval=HeapSize(GetProcessHeap(), 0, (LPVOID) hmem); } @@ -1404,7 +1404,7 @@ DWORD WINAPI GlobalSize( { /* HeapLock(heap); */ pintern=HANDLE_TO_INTERN(hmem); - + if(pintern->Magic==MAGIC_GLOBAL_USED) { if (!pintern->Pointer) /* handle case of GlobalAlloc( ??,0) */ @@ -1478,7 +1478,7 @@ UINT WINAPI GlobalFlags( ) { DWORD retval; PGLOBAL32_INTERN pintern; - + if(ISPOINTER(hmem)) { retval=0; @@ -1488,7 +1488,7 @@ UINT WINAPI GlobalFlags( /* HeapLock(GetProcessHeap()); */ pintern=HANDLE_TO_INTERN(hmem); if(pintern->Magic==MAGIC_GLOBAL_USED) - { + { retval=pintern->LockCount + (pintern->Flags<<8); if(pintern->Pointer==0) retval|= GMEM_DISCARDED; @@ -1616,7 +1616,7 @@ VOID WINAPI GlobalMemoryStatus( lpmem->dwMemoryLoad = 0; } free(tmp); - + } #endif /* FIXME: should do something for other systems */ diff --git a/memory/heap.c b/memory/heap.c index 171599d2b26..cb1dacc7a10 100644 --- a/memory/heap.c +++ b/memory/heap.c @@ -314,7 +314,7 @@ HANDLE WINAPI Local32Init16( WORD segment, DWORD tableSize, if ( !(base = VirtualAlloc( NULL, totSize, MEM_RESERVE, PAGE_READWRITE )) ) return 0; - if ( !VirtualAlloc( base, segSize + HTABLE_PAGESIZE, + if ( !VirtualAlloc( base, segSize + HTABLE_PAGESIZE, MEM_COMMIT, PAGE_READWRITE ) ) { VirtualFree( base, 0, MEM_RELEASE ); @@ -329,7 +329,7 @@ HANDLE WINAPI Local32Init16( WORD segment, DWORD tableSize, /* Set up header and handle table */ - + header = (LOCAL32HEADER *)(base + segSize); header->base = base; header->limit = HTABLE_PAGESIZE-1; @@ -348,8 +348,8 @@ HANDLE WINAPI Local32Init16( WORD segment, DWORD tableSize, /* Set up selector table */ - - nrBlocks = (totSize + 0x7fff) >> 15; + + nrBlocks = (totSize + 0x7fff) >> 15; selectorTable = (LPWORD) HeapAlloc( header->heap, 0, nrBlocks * 2 ); selectorEven = SELECTOR_AllocBlock( base, totSize, WINE_LDT_FLAGS_DATA ); selectorOdd = SELECTOR_AllocBlock( base + 0x8000, totSize - 0x8000, WINE_LDT_FLAGS_DATA ); @@ -384,7 +384,7 @@ HANDLE WINAPI Local32Init16( WORD segment, DWORD tableSize, GLOBAL_MoveBlock( segment, base, totSize ); HeapFree( GetProcessHeap(), 0, oldBase ); } - + return (HANDLE)header; } @@ -409,7 +409,7 @@ static LPDWORD Local32_SearchHandle( LOCAL32HEADER *header, DWORD addr ) /*********************************************************************** * Local32_ToHandle */ -static VOID Local32_ToHandle( LOCAL32HEADER *header, INT16 type, +static VOID Local32_ToHandle( LOCAL32HEADER *header, INT16 type, DWORD addr, LPDWORD *handle, LPBYTE *ptr ) { *handle = NULL; @@ -428,8 +428,8 @@ static VOID Local32_ToHandle( LOCAL32HEADER *header, INT16 type, break; case 0: /* handle */ - if ( addr >= sizeof(LOCAL32HEADER) - && addr < header->limit && !(addr & 3) + if ( addr >= sizeof(LOCAL32HEADER) + && addr < header->limit && !(addr & 3) && *(LPDWORD)((LPBYTE)header + addr) >= HTABLE_SIZE ) { *handle = (LPDWORD)((LPBYTE)header + addr); @@ -452,7 +452,7 @@ static VOID Local32_ToHandle( LOCAL32HEADER *header, INT16 type, /*********************************************************************** * Local32_FromHandle */ -static VOID Local32_FromHandle( LOCAL32HEADER *header, INT16 type, +static VOID Local32_FromHandle( LOCAL32HEADER *header, INT16 type, DWORD *addr, LPDWORD handle, LPBYTE ptr ) { switch (type) @@ -462,7 +462,7 @@ static VOID Local32_FromHandle( LOCAL32HEADER *header, INT16 type, { WORD *selTable = (LPWORD)(header->base + header->selectorTableOffset); DWORD offset = (LPBYTE)ptr - header->base; - *addr = MAKELONG( offset & 0x7fff, selTable[offset >> 15] ); + *addr = MAKELONG( offset & 0x7fff, selTable[offset >> 15] ); } break; @@ -488,7 +488,7 @@ DWORD WINAPI Local32Alloc16( HANDLE heap, DWORD size, INT16 type, DWORD flags ) DWORD addr; /* Allocate memory */ - ptr = HeapAlloc( header->heap, + ptr = HeapAlloc( header->heap, (flags & LMEM_MOVEABLE)? HEAP_ZERO_MEMORY : 0, size ); if (!ptr) return 0; @@ -512,24 +512,24 @@ DWORD WINAPI Local32Alloc16( HANDLE heap, DWORD size, INT16 type, DWORD flags ) /* If virgin page, initialize it */ if (header->freeListFirst[page] == 0xffff) { - if ( !VirtualAlloc( (LPBYTE)header + (page << 12), + if ( !VirtualAlloc( (LPBYTE)header + (page << 12), 0x1000, MEM_COMMIT, PAGE_READWRITE ) ) { WARN("Cannot grow handle table!\n" ); HeapFree( header->heap, 0, ptr ); return 0; } - + header->limit += HTABLE_PAGESIZE; header->freeListFirst[page] = 0; header->freeListLast[page] = HTABLE_PAGESIZE - 4; header->freeListSize[page] = HTABLE_PAGESIZE / 4; - + for (i = 0; i < HTABLE_PAGESIZE; i += 4) *(DWORD *)((LPBYTE)header + i) = i+4; - if (page < HTABLE_NPAGES-1) + if (page < HTABLE_NPAGES-1) header->freeListFirst[page+1] = 0xffff; } @@ -573,8 +573,8 @@ DWORD WINAPI Local32ReAlloc16( HANDLE heap, DWORD addr, INT16 type, if (!handle) return FALSE; /* Reallocate memory block */ - ptr = HeapReAlloc( header->heap, - (flags & LMEM_MOVEABLE)? HEAP_ZERO_MEMORY : 0, + ptr = HeapReAlloc( header->heap, + (flags & LMEM_MOVEABLE)? HEAP_ZERO_MEMORY : 0, ptr, size ); if (!ptr) return 0; @@ -620,7 +620,7 @@ BOOL WINAPI Local32Free16( HANDLE heap, DWORD addr, INT16 type ) /* Shrink handle table when possible */ while (page > 0 && header->freeListSize[page] == HTABLE_PAGESIZE / 4) { - if ( VirtualFree( (LPBYTE)header + + if ( VirtualFree( (LPBYTE)header + (header->limit & ~(HTABLE_PAGESIZE-1)), HTABLE_PAGESIZE, MEM_DECOMMIT ) ) break; @@ -694,8 +694,8 @@ WORD WINAPI Local32GetSegment16( HANDLE heap ) static LOCAL32HEADER *Local32_GetHeap( HGLOBAL16 handle ) { WORD selector = GlobalHandleToSel16( handle ); - DWORD base = GetSelectorBase( selector ); - DWORD limit = GetSelectorLimit16( selector ); + DWORD base = GetSelectorBase( selector ); + DWORD limit = GetSelectorLimit16( selector ); /* Hmmm. This is a somewhat stupid heuristic, but Windows 95 does it this way ... */ diff --git a/memory/instr.c b/memory/instr.c index 78c4f4115ed..bbea64aba1f 100644 --- a/memory/instr.c +++ b/memory/instr.c @@ -64,7 +64,7 @@ inline static void *get_stack( CONTEXT86 *context ) * Try to replace an invalid selector by a valid one. * The only selector where it is allowed to do "mov ax,40;mov es,ax" * is the so called 'bimodal' selector 0x40, which points to the BIOS - * data segment. Used by (at least) Borland products (and programs compiled + * data segment. Used by (at least) Borland products (and programs compiled * using Borland products). * * See Undocumented Windows, Chapter 5, __0040. @@ -74,7 +74,7 @@ static BOOL INSTR_ReplaceSelector( CONTEXT86 *context, WORD *sel ) extern char Call16_Start, Call16_End; if (IS_SELECTOR_SYSTEM(context->SegCs)) - if ( (char *)context->Eip >= &Call16_Start + if ( (char *)context->Eip >= &Call16_Start && (char *)context->Eip < &Call16_End ) { /* Saved selector may have become invalid when the relay code */ @@ -604,7 +604,7 @@ BOOL INSTR_EmulateInstruction( CONTEXT86 *context ) if (long_addr) context->Edi += step; else ADD_LOWORD(context->Edi,step); } - + switch (typ) { case 0x6c: @@ -682,7 +682,7 @@ BOOL INSTR_EmulateInstruction( CONTEXT86 *context ) return TRUE; } break; /* Unable to emulate it */ - + case 0xcd: /* int */ if (long_op) { diff --git a/memory/local.c b/memory/local.c index 4041ea38093..a4402c09290 100644 --- a/memory/local.c +++ b/memory/local.c @@ -80,8 +80,8 @@ typedef struct /* * We make addr = 4n + 2 and set *((WORD *)addr - 1) = &addr like Windows does - * in case something actually relies on this. - * Note that if the architecture does not allow unaligned accesses, we make + * in case something actually relies on this. + * Note that if the architecture does not allow unaligned accesses, we make * addr = 4n + 4 to avoid returning unaligned pointers from LocalAlloc etc. * * An unused handle has lock = flags = 0xff. In windows addr is that of next @@ -188,7 +188,7 @@ static void LOCAL_MakeBlockFree( char *baseptr, WORD block ) pArena = ARENA_PTR( baseptr, block ); pArena->prev = (pArena->prev & ~3) | LOCAL_ARENA_FREE; pArena->size = pArena->next - block; - + /* Find the next free block (last block is always free) */ next = pArena->next; @@ -292,7 +292,7 @@ static void LOCAL_PrintHeap( HANDLE16 ds ) LOCALHEAPINFO *pInfo; WORD arena; - /* FIXME - the test should be done when calling the function! + /* FIXME - the test should be done when calling the function! plus is not clear that we should print this info only when TRACE_ON is on! */ if(!TRACE_ON(local)) return; @@ -378,7 +378,7 @@ BOOL16 WINAPI LocalInit16( HANDLE16 selector, WORD start, WORD end ) } } - if (start == 0) + if (start == 0) { /* start == 0 means: put the local heap at the end of the segment */ @@ -490,7 +490,7 @@ static BOOL16 LOCAL_GrowHeap( HANDLE16 ds ) WORD freeArena, lastArena; LOCALARENA *pArena, *pLastArena; char *ptr; - + hseg = GlobalHandle16( ds ); /* maybe mem allocated by Virtual*() ? */ if (!hseg) return FALSE; @@ -513,7 +513,7 @@ static BOOL16 LOCAL_GrowHeap( HANDLE16 ds ) freeArena = pHeapInfo->last; pHeapInfo->last = lastArena; pHeapInfo->minsize += end - oldsize; - + /* grow the old last block */ pArena = ARENA_PTR( ptr, freeArena ); pArena->size = lastArena - freeArena; @@ -528,7 +528,7 @@ static BOOL16 LOCAL_GrowHeap( HANDLE16 ds ) pLastArena->size = LALIGN(sizeof(LOCALARENA)); pLastArena->free_prev = freeArena; pLastArena->free_next = lastArena; /* this one */ - + /* If block before freeArena is also free then merge them */ if((ARENA_PTR(ptr, (pArena->prev & ~3))->prev & 3) == LOCAL_ARENA_FREE) { @@ -678,7 +678,7 @@ static WORD LOCAL_GetFreeSpace(WORD ds, WORD countdiscard) LOCALARENA *pArena; WORD arena; WORD freespace = 0; - + if (!(pInfo = LOCAL_GetHeap( ds ))) { ERR("Local heap not found\n" ); @@ -774,7 +774,7 @@ WORD LOCAL_Compact( HANDLE16 ds, UINT16 minfree, UINT16 flags ) memcpy((char *)pFinalArena + ARENA_HEADER_SIZE, (char *)pMoveArena + ARENA_HEADER_SIZE, movesize - ARENA_HEADER_SIZE ); - /* Free the old location */ + /* Free the old location */ LOCAL_FreeArena(ds, movearena); if (pInfo->notify) LOCAL_CallTo16_word_www(pInfo->notify, LN_MOVE, @@ -1080,14 +1080,14 @@ static void LOCAL_FreeHandleEntry( HANDLE16 ds, HLOCAL16 handle ) pEntry->addr = 0; /* just in case */ pEntry->lock = 0xff; - pEntry->flags = 0xff; + pEntry->flags = 0xff; /* Now check if all entries in this table are free */ table = *pTable; pEntry = (LOCALHANDLEENTRY *)(ptr + table + sizeof(WORD)); count = *(WORD *)(ptr + table); for (i = count; i > 0; i--, pEntry++) if (pEntry->lock != 0xff) return; - + /* Remove the table from the linked list and free it */ TRACE("(%04x): freeing table %04x\n", @@ -1107,7 +1107,7 @@ HLOCAL16 LOCAL_Free( HANDLE16 ds, HLOCAL16 handle ) char *ptr = MapSL( MAKESEGPTR( ds, 0 ) ); TRACE("%04x ds=%04x\n", handle, ds ); - + if (!handle) { WARN("Handle is 0.\n" ); return 0; } if (HANDLE_FIXED( handle )) { @@ -1140,7 +1140,7 @@ HLOCAL16 LOCAL_Alloc( HANDLE16 ds, WORD flags, WORD size ) { char *ptr; HLOCAL16 handle; - + TRACE("%04x %d ds=%04x\n", flags, size, ds ); if(size > 0 && size <= 4) size = 5; @@ -1211,7 +1211,7 @@ HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) TRACE("%04x %d %04x ds=%04x\n", handle, size, flags, ds ); if (!(pInfo = LOCAL_GetHeap( ds ))) return 0; - + if (HANDLE_FIXED( handle )) blockhandle = handle; else @@ -1407,7 +1407,7 @@ static HLOCAL16 LOCAL_InternalLock( LPSTR heap, HLOCAL16 handle ) if (pEntry->lock < 0xfe) pEntry->lock++; handle = pEntry->addr; } - TRACE("%04x returning %04x\n", + TRACE("%04x returning %04x\n", old_handle, handle ); return handle; } @@ -1456,7 +1456,7 @@ WORD LOCAL_Size( HANDLE16 ds, HLOCAL16 handle ) TRACE("%04x ds=%04x\n", handle, ds ); if (!handle) return 0; - if (HANDLE_MOVEABLE( handle )) + if (HANDLE_MOVEABLE( handle )) { handle = *(WORD *)(ptr + handle); if (!handle) return 0; @@ -1547,7 +1547,7 @@ WORD LOCAL_CountFree( HANDLE16 ds ) * Implementation of LocalHandle(). */ HLOCAL16 LOCAL_Handle( HANDLE16 ds, WORD addr ) -{ +{ char *ptr = MapSL( MAKESEGPTR( ds, 0 ) ); LOCALHEAPINFO *pInfo; WORD table; @@ -1639,7 +1639,7 @@ UINT16 WINAPI LocalSize16( HLOCAL16 handle ) * LocalHandle (KERNEL.11) */ HLOCAL16 WINAPI LocalHandle16( WORD addr ) -{ +{ return LOCAL_Handle( CURRENT_DS, addr ); } diff --git a/memory/registry.c b/memory/registry.c index 9bd7024713f..2010b999463 100644 --- a/memory/registry.c +++ b/memory/registry.c @@ -52,7 +52,7 @@ static inline int is_string( DWORD type ) * RegCreateKeyExA [ADVAPI32.@] */ DWORD WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR class, - DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa, + DWORD options, REGSAM access, SECURITY_ATTRIBUTES *sa, LPHKEY retkey, LPDWORD dispos ) { OBJECT_ATTRIBUTES attr; @@ -377,7 +377,7 @@ DWORD WINAPI RegSetValueA( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWOR * RegQueryValueExA [ADVAPI32.@] * * NOTES: - * the documentation is wrong: if the buffer is too small it remains untouched + * the documentation is wrong: if the buffer is too small it remains untouched */ DWORD WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count ) diff --git a/memory/selector.c b/memory/selector.c index 6ff3e13ac38..657f3b650ec 100644 --- a/memory/selector.c +++ b/memory/selector.c @@ -736,7 +736,7 @@ BOOL WINAPI GetThreadSelectorEntry( HANDLE hthread, DWORD sel, LPLDT_ENTRY ldten */ static void x_SMapLS_IP_EBP_x(CONTEXT86 *context,int argoff) { - DWORD val,ptr; + DWORD val,ptr; val =*(DWORD*)(context->Ebp + argoff); if (val<0x10000) { @@ -875,7 +875,7 @@ void WINAPI SUnMapLS_IP_EBP_40(CONTEXT86 *context) { x_SUnMapLS_IP_EBP_x(context /********************************************************************** * AllocMappedBuffer (KERNEL32.38) * - * This is a undocumented KERNEL32 function that + * This is a undocumented KERNEL32 function that * SMapLS's a GlobalAlloc'ed buffer. * * Input: EDI register: size of buffer to allocate diff --git a/memory/virtual.c b/memory/virtual.c index d41c24ad42f..afa141888ca 100644 --- a/memory/virtual.c +++ b/memory/virtual.c @@ -450,7 +450,7 @@ static void *anon_mmap_aligned( void *base, unsigned int size, int prot, int fla if ((ptr = wine_anon_mmap( base, view_size, prot, flags )) == (void *)-1) { /* KB: Q125713, 25-SEP-1995, "Common File Mapping Problems and - * Platform Differences": + * Platform Differences": * Windows NT: ERROR_INVALID_PARAMETER * Windows 95: ERROR_INVALID_ADDRESS. */ @@ -559,7 +559,7 @@ static LPVOID map_image( HANDLE hmapping, int fd, char *base, DWORD total_size, MESSAGE(")\n"); goto error; } - + /* retrieve the shared sections file */ if (shared_size) @@ -980,7 +980,7 @@ LPVOID WINAPI VirtualAllocEx( /*********************************************************************** * VirtualFree (KERNEL32.@) * Release or decommits a region of pages in virtual address space. - * + * * RETURNS * TRUE: Success * FALSE: Failure @@ -1047,7 +1047,7 @@ BOOL WINAPI VirtualFree( /*********************************************************************** * VirtualLock (KERNEL32.@) * Locks the specified region of virtual address space - * + * * NOTE * Always returns TRUE * @@ -1433,8 +1433,8 @@ HANDLE WINAPI CreateFileMappingA( * CreateFileMappingW (KERNEL32.@) * See CreateFileMappingA */ -HANDLE WINAPI CreateFileMappingW( HANDLE hFile, LPSECURITY_ATTRIBUTES sa, - DWORD protect, DWORD size_high, +HANDLE WINAPI CreateFileMappingW( HANDLE hFile, LPSECURITY_ATTRIBUTES sa, + DWORD protect, DWORD size_high, DWORD size_low, LPCWSTR name ) { HANDLE ret; diff --git a/misc/cpu.c b/misc/cpu.c index e9d8bd156cd..8f70080c829 100644 --- a/misc/cpu.c +++ b/misc/cpu.c @@ -49,11 +49,11 @@ static BYTE PF[64] = {0,}; * Identifier (CPU x86) * Note that there is a hierarchy for every processor installed, so this * supports multiprocessor systems. This is done like Win95 does it, I think. - * + * * It also creates a cached flag array for IsProcessorFeaturePresent(). * * No NULL ptr check for LPSYSTEM_INFO in Win9x. - * + * * RETURNS * nothing, really */ @@ -157,7 +157,7 @@ VOID WINAPI GetSystemInfo( } /* old 2.0 method */ if (!strncasecmp(line, "cpu",strlen("cpu"))) { - if ( isdigit (value[0]) && value[1] == '8' && + if ( isdigit (value[0]) && value[1] == '8' && value[2] == '6' && value[3] == 0 ) { switch (value[0] - '0') { diff --git a/misc/error.c b/misc/error.c index 6fe2e95a742..2f473212361 100644 --- a/misc/error.c +++ b/misc/error.c @@ -1,5 +1,5 @@ /* - * Log internal errors + * Log internal errors * * Copyright 1997 Andrew Taylor * @@ -199,7 +199,7 @@ static const struct { /*********************************************************************** * GetErrorString (internal) */ -static const char *GetErrorString(UINT16 uErr) +static const char *GetErrorString(UINT16 uErr) { static char buffer[80]; unsigned int n; @@ -270,7 +270,7 @@ void WINAPI HandleParamError( CONTEXT86 *context ) UINT16 uErr = LOWORD(context->Ebx); FARPROC16 lpfn = (FARPROC16)MAKESEGPTR( context->SegCs, context->Eip ); LPVOID lpvParam = (LPVOID)MAKELONG( LOWORD(context->Eax), LOWORD(context->Ecx) ); - + LogParamError16( uErr, lpfn, lpvParam ); if (!(uErr & ERR_WARNING)) diff --git a/misc/options.c b/misc/options.c index a181974b253..1c6c9cd7dce 100644 --- a/misc/options.c +++ b/misc/options.c @@ -142,7 +142,7 @@ static void do_debugmsg( const char *arg ) s = p + 7; /* if there are n ':', there are n+1 modules, and we need n+2 slots, last one being for the sentinel (NULL) */ - i = 2; + i = 2; while((s = strchr(s, ':'))) i++, s++; *output = malloc(sizeof(char **) * i); i = 0; diff --git a/misc/registry.c b/misc/registry.c index d4f0f01361d..d9f61917093 100644 --- a/misc/registry.c +++ b/misc/registry.c @@ -320,7 +320,7 @@ void _w31_dumptree(unsigned short idx,unsigned char *txt,struct _w31_tabent *tab memcpy(tail,&txt[key->string_off],key->length); tail[key->length]='\0'; - /* all toplevel entries AND the entries in the + /* all toplevel entries AND the entries in the * toplevel subdirectory belong to \SOFTWARE\Classes */ if (!level && !strcmp(tail,".classes")) { @@ -350,7 +350,7 @@ void _w31_dumptree(unsigned short idx,unsigned char *txt,struct _w31_tabent *tab /****************************************************************************** * _w31_loadreg [Internal] */ -void _w31_loadreg(void) +void _w31_loadreg(void) { HFILE hf; struct _w31_header head; @@ -382,7 +382,7 @@ void _w31_loadreg(void) /* read and dump index table */ tab = _xmalloc(len); if (len!=_lread(hf,tab,len)) { - ERR("couldn't read %d bytes.\n",len); + ERR("couldn't read %d bytes.\n",len); free(tab); _lclose(hf); return; @@ -391,14 +391,14 @@ void _w31_loadreg(void) /* read text */ txt = _xmalloc(head.textsize); if (-1==_llseek(hf,head.textoff,SEEK_SET)) { - ERR("couldn't seek to textblock.\n"); + ERR("couldn't seek to textblock.\n"); free(tab); free(txt); _lclose(hf); return; } if (head.textsize!=_lread(hf,txt,head.textsize)) { - ERR("textblock too short (%d instead of %ld).\n",len,head.textsize); + ERR("textblock too short (%d instead of %ld).\n",len,head.textsize); free(tab); free(txt); _lclose(hf); @@ -406,7 +406,7 @@ void _w31_loadreg(void) } if (!GetFileInformationByHandle(hf,&hfinfo)) { - ERR("GetFileInformationByHandle failed?.\n"); + ERR("GetFileInformationByHandle failed?.\n"); free(tab); free(txt); _lclose(hf); @@ -466,8 +466,8 @@ typedef struct { * The "hash"-value is a value representing the key's name. Windows will not * search for the name, but for a matching hash-value. if it finds one, it * will compare the actual string info, otherwise continue with the next key. - * To calculate the hash initialize a D-Word with 0 and add all ASCII-values - * of the string which are smaller than 0x80 (128) to this D-Word. + * To calculate the hash initialize a D-Word with 0 and add all ASCII-values + * of the string which are smaller than 0x80 (128) to this D-Word. * * If you want to modify key names, also modify the hash-values, since they * cannot be found again (although they would be displayed in REGEDIT) @@ -664,7 +664,7 @@ static int _w95_dump_dke(LPSTR key_name,_w95creg *creg,_w95rgkn *rgkn,_w95dke *d } } - /* write the key path (something like [Software\\Microsoft\\..]) only if: + /* write the key path (something like [Software\\Microsoft\\..]) only if: 1) key has some values 2) key has no values and no subkeys */ @@ -739,7 +739,7 @@ typedef struct { DWORD uk6; /* 0x20 */ DWORD RootKeyBlock; /* 0x24 */ DWORD BlockSize; /* 0x28 */ - DWORD uk7[116]; + DWORD uk7[116]; DWORD Checksum; /* at offset 0x1FC */ } nt_regf; @@ -883,17 +883,17 @@ static int _nt_dump_nk(LPSTR key_name,char *base,nt_nk *nk,FILE *f,int level); * this structure contains the hash of a keyname and points to all * subkeys * - * exception: if the id is 'il' there are no hash values and every + * exception: if the id is 'il' there are no hash values and every * dword is a offset */ static int _nt_dump_lf(LPSTR key_name, char *base, int subkeys, nt_lf *lf, FILE *f, int level) { int i; - + if (lf->id == NT_REG_HASH_BLOCK_ID) { if (subkeys != lf->nr_keys) goto error1; - - for (i=0; inr_keys; i++) + + for (i=0; inr_keys; i++) if (!_nt_dump_nk(key_name, base, (nt_nk*)(base+lf->hash_rec[i].off_nk+4), f, level)) goto error; } else if (lf->id == NT_REG_NOHASH_BLOCK_ID) { nt_li * li = (nt_li*)lf; @@ -966,7 +966,7 @@ static int _nt_dump_nk(LPSTR key_name,char *base,nt_nk *nk,FILE *f,int level) if (strcmp(new_key_name,"") != 0) strcat(new_key_name,"\\"); strncat(new_key_name,nk->name,nk->name_len); - /* write the key path (something like [Software\\Microsoft\\..]) only if: + /* write the key path (something like [Software\\Microsoft\\..]) only if: 1) key has some values 2) key has no values and no subkeys */ @@ -1067,7 +1067,7 @@ static void _init_registry_saving( HKEY hkey_users_default ) /****************************************************************************** * _allocate_default_keys [Internal] - * Registry initialisation, allocates some default keys. + * Registry initialisation, allocates some default keys. */ static void _allocate_default_keys(void) { HKEY hkey; diff --git a/misc/system.c b/misc/system.c index 4196aa3b455..a5d2d2a1456 100644 --- a/misc/system.c +++ b/misc/system.c @@ -192,7 +192,7 @@ WORD WINAPI WIN16_CreateSystemTimer( WORD rate, FARPROC16 proc ) */ WORD WINAPI SYSTEM_KillSystemTimer( WORD timer ) { - if ( !timer || timer > NB_SYS_TIMERS || !SYS_Timers[timer-1].callback ) + if ( !timer || timer > NB_SYS_TIMERS || !SYS_Timers[timer-1].callback ) return timer; /* Error */ SYS_Timers[timer-1].callback = NULL; if (!--SYS_NbTimers) SYSTEM_StopTicks(); diff --git a/misc/version.c b/misc/version.c index 1d86a82b807..a02d9ddec2b 100644 --- a/misc/version.c +++ b/misc/version.c @@ -53,7 +53,7 @@ typedef enum typedef struct { - LONG getVersion16; + LONG getVersion16; LONG getVersion32; OSVERSIONINFOEXA getVersionEx; } VERSION_DATA; @@ -345,7 +345,7 @@ static void VERSION_Init(void) * VERSION_GetSystemDLLVersion * * This function tries to figure out if a given (native) dll comes from - * win95/98 or winnt. Since all values in the OptionalHeader are not a + * win95/98 or winnt. Since all values in the OptionalHeader are not a * usable hint, we test if a dll imports the ntdll. * This is at least working for all system dlls like comctl32, comdlg32 and * shell32. @@ -362,7 +362,7 @@ static DWORD VERSION_GetSystemDLLVersion( HMODULE hmod ) { char * name = (char *)hmod + (unsigned int)pe_imp->Name; TRACE("%s\n", name); - + if (!strncasecmp(name, "ntdll", 5)) { switch(PE_HEADER(hmod)->OptionalHeader.MajorOperatingSystemVersion) { @@ -389,8 +389,8 @@ static DWORD VERSION_GetSystemDLLVersion( HMODULE hmod ) * * x.xx/1.00/0.00/3.10 Win32s (any version ?) * 2.39/1.00/0.00/3.10 Win32s freecell.exe (any version) - * 2.50/1.00/4.00/4.00 Win32s 1.30 winhlp32.exe - * 2.60/3.51/3.51/3.51 NT351SP5 system dlls + * 2.50/1.00/4.00/4.00 Win32s 1.30 winhlp32.exe + * 2.60/3.51/3.51/3.51 NT351SP5 system dlls * 2.60/3.51/3.51/4.00 NT351SP5 comctl32 dll * 2.xx/1.00/0.00/4.00 Win95 system files * x.xx/4.00/0.00/4.00 Win95 most applications @@ -430,7 +430,7 @@ DWORD VERSION_GetLinkedDllVersion(void) if (!strncasecmp(wm->modname, special_dlls[i], strlen(special_dlls[i]) )) { DWORD DllVersion = VERSION_GetSystemDLLVersion(wm->module); - if (WinVersion == NB_WINDOWS_VERSIONS) + if (WinVersion == NB_WINDOWS_VERSIONS) WinVersion = DllVersion; else { if (WinVersion != DllVersion) { @@ -446,12 +446,12 @@ DWORD VERSION_GetLinkedDllVersion(void) } } } - + if(WinVersion != NB_WINDOWS_VERSIONS) return WinVersion; - + /* we are using no external system dlls, look at the exe */ ophd = &(PE_HEADER(GetModuleHandleA(NULL))->OptionalHeader); - + TRACE("%02x.%02x/%02x.%02x/%02x.%02x/%02x.%02x\n", ophd->MajorLinkerVersion, ophd->MinorLinkerVersion, ophd->MajorOperatingSystemVersion, ophd->MinorOperatingSystemVersion, @@ -467,17 +467,17 @@ DWORD VERSION_GetLinkedDllVersion(void) /* the MajorSubsystemVersion is the only usable sign */ if (ophd->MajorSubsystemVersion < 4) { - if ( ophd->MajorOperatingSystemVersion == 1 + if ( ophd->MajorOperatingSystemVersion == 1 && ophd->MinorOperatingSystemVersion == 0) { return WIN31; /* win32s */ } - + if (ophd->Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI) return NT351; /* FIXME: NT 3.1, not tested */ else return WIN95; - } + } return WIN95; } diff --git a/miscemu/main.c b/miscemu/main.c index e248d8ab2cc..e21685937a9 100644 --- a/miscemu/main.c +++ b/miscemu/main.c @@ -62,7 +62,7 @@ int WINAPI wine_initial_task( HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, INT } MESSAGE( "%s: can't exec '%s': ", argv0, GetCommandLineA() ); - switch (instance) + switch (instance) { case 2: MESSAGE("file not found\n" ); break; case 11: MESSAGE("invalid exe file\n" ); break; diff --git a/msdos/dosconf.c b/msdos/dosconf.c index 03a214aafee..96127110846 100644 --- a/msdos/dosconf.c +++ b/msdos/dosconf.c @@ -1,7 +1,7 @@ /* * DOS CONFIG.SYS parser * - * Copyright 1998 Andreas Mohr + * Copyright 1998 Andreas Mohr * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -54,7 +54,7 @@ static int DOSCONF_Stacks(char **confline); static int DOSCONF_Buffers(char **confline); static void DOSCONF_Parse(char *menuname); -DOSCONF DOSCONF_config = +DOSCONF DOSCONF_config = { 'E', /* lastdrive */ 0, /* brk_flag */ @@ -97,7 +97,7 @@ static const TAG_ENTRY tag_entries[] = { "FCBS", DOSCONF_Fcbs }, { "BREAK", DOSCONF_Break }, { "FILES", DOSCONF_Files }, - { "SHELL", DOSCONF_Shell }, + { "SHELL", DOSCONF_Shell }, { "STACKS", DOSCONF_Stacks }, { "BUFFERS", DOSCONF_Buffers }, { "COUNTRY", DOSCONF_Country }, @@ -116,16 +116,16 @@ static int menu_skip = 0; /* the current menu gets skipped */ static void DOSCONF_skip(char **pconfline) { char *p; - + p = *pconfline; while ( (*p == ' ') || (*p == '\t') ) p++; *pconfline = p; } - + static int DOSCONF_JumpToEntry(char **pconfline, char separator) { char *p; - + p = *pconfline; while ( (*p != separator) && (*p != '\0') ) p++; @@ -364,7 +364,7 @@ static int DOSCONF_Include(char **confline) { fpos_t oldpos; char *temp; - + *confline += 7; /* strlen("INCLUDE") */ if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; fgetpos(cfg_fd, &oldpos); @@ -383,7 +383,7 @@ static void DOSCONF_Parse(char *menuname) char confline[256]; char *p, *trail; int i; - + if (menuname != NULL) /* we need to jump to a certain sub menu */ { while (fgets(confline, 255, cfg_fd)) diff --git a/msdos/dosmem.c b/msdos/dosmem.c index 94f57f482b9..ca173f5d05c 100644 --- a/msdos/dosmem.c +++ b/msdos/dosmem.c @@ -161,17 +161,17 @@ static void DOSMEM_FillIsrTable(void) { SEGPTR *isr = (SEGPTR*)DOSMEM_sysmem; int x; - + for (x=0; x<256; x++) isr[x]=MAKESEGPTR(VM_STUB_SEGMENT,x*4); -} +} static void DOSMEM_MakeIsrStubs(void) { DWORD *stub = (DWORD*)(DOSMEM_dosmem + (VM_STUB_SEGMENT << 4)); int x; - + for (x=0; x<256; x++) stub[x]=VM_STUB(x); -} +} /*********************************************************************** * DOSMEM_InitDPMI @@ -243,16 +243,16 @@ BYTE * DOSMEM_BiosSys() } /* Add a structure in the BiosSys area (with size and index) and - return its offset */ + return its offset */ WORD DOSMEM_AddBiosSysStruct(int size,int index) { int Offset = CurrentStructOffset; - StructOffset[index]= CurrentStructOffset; + StructOffset[index]= CurrentStructOffset; CurrentStructOffset += size; return Offset; } -/* Return the offset of a structure specified by the index */ +/* Return the offset of a structure specified by the index */ WORD DOSMEM_GetBiosSysStructOffset(int index) { return StructOffset[index]; @@ -344,7 +344,7 @@ static void DOSMEM_FillBiosSegments(void) pVidFunc->SavePointerFlags = 0x3f; /* FIXME: always real mode ? */ - pVidState->StaticFuncTable = (0xf000<<16)+DOSMEM_GetBiosSysStructOffset(OFF_VIDEOFUNCTIONALITY); + pVidState->StaticFuncTable = (0xf000<<16)+DOSMEM_GetBiosSysStructOffset(OFF_VIDEOFUNCTIONALITY); pVidState->VideoMode = pBiosData->VideoMode; /* needs updates! */ pVidState->NumberColumns = pBiosData->VideoColumns; /* needs updates! */ pVidState->RegenBufLen = 0; @@ -432,7 +432,7 @@ static void DOSMEM_InitErrorTable() /* FIXME - There is still something wrong... */ /* FIXME - Find hex values for opcodes... - + (On call, AX contains message number DI contains 'offset' (??) Resturn, ES:DI points to counted string ) @@ -445,9 +445,9 @@ static void DOSMEM_InitErrorTable() RET */ - - const int code = 4; - const int buffer = 80; + + const int code = 4; + const int buffer = 80; const int SIZE_TO_ALLOCATE = code + buffer; /* FIXME - Complete rewrite of the table system to save */ @@ -456,8 +456,8 @@ static void DOSMEM_InitErrorTable() /* as a special case and programs will use the alternate */ /* interface (a farcall returned with INT 24 (AX = 0x122e, DL = */ /* 0x08) which lets us have a smaller memory footprint anyway. */ - - x = GlobalDOSAlloc16(SIZE_TO_ALLOCATE); + + x = GlobalDOSAlloc16(SIZE_TO_ALLOCATE); DOSMEM_ErrorCall = MAKELONG(0,(x>>16)); DOSMEM_ErrorBuffer = DOSMEM_ErrorCall + code; @@ -466,7 +466,7 @@ static void DOSMEM_InitErrorTable() memset(call, 0, SIZE_TO_ALLOCATE); #endif - /* FIXME - Copy assembly into buffer here */ + /* FIXME - Copy assembly into buffer here */ } /*********************************************************************** @@ -490,7 +490,7 @@ static void DOSMEM_InitMemory(void) dm = NEXT_BLOCK(root_block); dm->size = DM_BLOCK_TERMINAL; - root_block->size |= DM_BLOCK_FREE + root_block->size |= DM_BLOCK_FREE #ifdef __DOSMEM_DEBUG__ | DM_BLOCK_DEBUG #endif @@ -623,7 +623,7 @@ LPVOID DOSMEM_GetBlock(UINT size, UINT16* pseg) #ifdef __DOSMEM_DEBUG_ dosmem_entry *prev = NULL; #endif - + if( size > info_block->free ) return NULL; dm = DOSMEM_RootBlock(); @@ -659,10 +659,10 @@ LPVOID DOSMEM_GetBlock(UINT size, UINT16* pseg) dm->size = (((size + 0xf + sizeof(dosmem_entry)) & ~0xf) - sizeof(dosmem_entry)); - next = (dosmem_entry*)(((char*)dm) + + next = (dosmem_entry*)(((char*)dm) + sizeof(dosmem_entry) + dm->size); - next->size = (blocksize - (dm->size + - sizeof(dosmem_entry))) | DM_BLOCK_FREE + next->size = (blocksize - (dm->size + + sizeof(dosmem_entry))) | DM_BLOCK_FREE #ifdef __DOSMEM_DEBUG__ | DM_BLOCK_DEBUG #endif @@ -753,10 +753,10 @@ LPVOID DOSMEM_ResizeBlock(void* ptr, UINT size, UINT16* pseg) dm->size = (((size + 0xf + sizeof(dosmem_entry)) & ~0xf) - sizeof(dosmem_entry)); - next = (dosmem_entry*)(((char*)dm) + + next = (dosmem_entry*)(((char*)dm) + sizeof(dosmem_entry) + dm->size); - next->size = (blocksize - (dm->size + - sizeof(dosmem_entry))) | DM_BLOCK_FREE + next->size = (blocksize - (dm->size + + sizeof(dosmem_entry))) | DM_BLOCK_FREE ; } else dm->size &= DM_BLOCK_MASK; @@ -785,10 +785,10 @@ LPVOID DOSMEM_ResizeBlock(void* ptr, UINT size, UINT16* pseg) dm->size = (((orgsize + 0xf + sizeof(dosmem_entry)) & ~0xf) - sizeof(dosmem_entry)); - next = (dosmem_entry*)(((char*)dm) + + next = (dosmem_entry*)(((char*)dm) + sizeof(dosmem_entry) + dm->size); - next->size = (blocksize - (dm->size + - sizeof(dosmem_entry))) | DM_BLOCK_FREE + next->size = (blocksize - (dm->size + + sizeof(dosmem_entry))) | DM_BLOCK_FREE ; } else dm->size &= DM_BLOCK_MASK; } @@ -806,7 +806,7 @@ UINT DOSMEM_Available(void) { UINT blocksize, available = 0; dosmem_entry *dm; - + dm = DOSMEM_RootBlock(); while (dm && dm->size != DM_BLOCK_TERMINAL) diff --git a/msdos/dpmi.c b/msdos/dpmi.c index 598b0ccb757..6ea5340ce7a 100644 --- a/msdos/dpmi.c +++ b/msdos/dpmi.c @@ -93,14 +93,14 @@ DPMI_xalloc(int len) { ret=VirtualAlloc(lastvalloced,len,MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE); if (!ret) lastvalloced = (char *) lastvalloced + 0x10000; - /* we failed to allocate one in the first round. + /* we failed to allocate one in the first round. * try non-linear */ if (!xflag && (lastvalloced= oldlastv)) @@ -214,26 +214,26 @@ static void RawModeSwitch( CONTEXT86 *context ) /* * After this function returns to relay code, protected mode - * 16 bit stack will contain STACK16FRAME and single WORD + * 16 bit stack will contain STACK16FRAME and single WORD * (EFlags, see next comment). */ - NtCurrentTeb()->cur_stack = - MAKESEGPTR( context->SegSs, + NtCurrentTeb()->cur_stack = + MAKESEGPTR( context->SegSs, context->Esp - sizeof(STACK16FRAME) - sizeof(WORD) ); /* * After relay code returns to glue function, protected * mode 16 bit stack will contain interrupt return record: - * IP, CS and EFlags. Since EFlags is ignored, it won't + * IP, CS and EFlags. Since EFlags is ignored, it won't * need to be initialized. */ context->Esp -= 3 * sizeof(WORD); /* * Restore stack frame so that relay code won't be confused. - * It should be noted that relay code overwrites IP and CS + * It should be noted that relay code overwrites IP and CS * in STACK16FRAME with values taken from current CONTEXT86. - * These values are what is returned to glue function + * These values are what is returned to glue function * (see previous comment). */ *CURRENT_STACK16 = frame; @@ -256,7 +256,7 @@ void WINAPI INT_Int31Handler( CONTEXT86 *context ) DWORD dw; BYTE *ptr; - if (context->SegCs == DOSMEM_dpmi_sel) { + if (context->SegCs == DOSMEM_dpmi_sel) { RawModeSwitch( context ); return; } @@ -312,7 +312,7 @@ void WINAPI INT_Int31Handler( CONTEXT86 *context ) context->Eax = DOSMEM_AllocSelector(BX_reg(context)); break; } - if (entryPoint) + if (entryPoint) context->Eax = LOWORD(GetProcAddress16( GetModuleHandle16( "KERNEL" ), (LPCSTR)(ULONG_PTR)entryPoint )); } @@ -585,7 +585,7 @@ void WINAPI INT_Int31Handler( CONTEXT86 *context ) FIXME("map real to linear (0x%08lx)\n",MAKELONG(CX_reg(context),BX_reg(context))); if(!(ptr=DOSMEM_MapRealToLinear(MAKELONG(CX_reg(context),BX_reg(context))))) { - AX_reg(context) = 0x8021; + AX_reg(context) = 0x8021; SET_CFLAG(context); } else diff --git a/msdos/int11.c b/msdos/int11.c index c07b396cfed..d7ac9d70e54 100644 --- a/msdos/int11.c +++ b/msdos/int11.c @@ -42,7 +42,7 @@ void WINAPI INT_Int11Handler( CONTEXT86 *context ) int serialports = 0; int x; -/* borrowed from Ralph Brown's interrupt lists +/* borrowed from Ralph Brown's interrupt lists bits 15-14: number of parallel devices bit 13: [Conv] Internal modem @@ -62,7 +62,7 @@ void WINAPI INT_Int11Handler( CONTEXT86 *context ) bit 0: =1 if diskette available for boot */ /* Currently the only of these bits correctly set are: - bits 15-14 } Added by William Owen Smith, + bits 15-14 } Added by William Owen Smith, bits 11-9 } wos@dcs.warwick.ac.uk bits 7-6 bit 2 (always set) @@ -71,7 +71,7 @@ void WINAPI INT_Int11Handler( CONTEXT86 *context ) if (GetDriveTypeA("A:\\") == DRIVE_REMOVABLE) diskdrives++; if (GetDriveTypeA("B:\\") == DRIVE_REMOVABLE) diskdrives++; if (diskdrives) diskdrives--; - + for (x=0; x < 9; x++) { char temp[16],name[16]; @@ -90,7 +90,7 @@ void WINAPI INT_Int11Handler( CONTEXT86 *context ) serialports=7; if (parallelports > 3) /* 2 bits -- maximum value = 3 */ parallelports=3; - - AX_reg(context) = (diskdrives << 6) | (serialports << 9) | + + AX_reg(context) = (diskdrives << 6) | (serialports << 9) | (parallelports << 14) | 0x02; } diff --git a/msdos/int15.c b/msdos/int15.c index c0d5c58bfa7..dd17a1f0b5a 100644 --- a/msdos/int15.c +++ b/msdos/int15.c @@ -77,7 +77,7 @@ void WINAPI INT_Int15Handler( CONTEXT86 *context ) { case 0x00: /* Enable-Disable Pointing Device (mouse) */ /* BH = newstate, 00h = disabled 01h = enabled */ - switch(BH_reg(context)) + switch(BH_reg(context)) { case 0x00: FIXME("Disable Pointing Device - not implemented\n"); diff --git a/msdos/int1a.c b/msdos/int1a.c index 596244bedcf..3c4a10d27aa 100644 --- a/msdos/int1a.c +++ b/msdos/int1a.c @@ -56,10 +56,10 @@ DWORD INT1A_GetTicksSinceMidnight(void) /********************************************************************** * INT_Int1aHandler (WPROCS.126) * - * Handler for int 1ah + * Handler for int 1ah * 0x00 - 0x07 - date and time * 0x?? - 0x?? - Microsoft Real Time Compression Interface - */ + */ void WINAPI INT_Int1aHandler( CONTEXT86 *context ) { time_t ltime; @@ -75,11 +75,11 @@ void WINAPI INT_Int1aHandler( CONTEXT86 *context ) AX_reg(context) = 0; /* No midnight rollover */ TRACE("int1a: AH=00 -- ticks=%ld\n", ticks); break; - - case 0x02: + + case 0x02: ltime = time(NULL); bdtime = localtime(<ime); - + CX_reg(context) = (BIN_TO_BCD(bdtime->tm_hour)<<8) | BIN_TO_BCD(bdtime->tm_min); DX_reg(context) = (BIN_TO_BCD(bdtime->tm_sec)<<8); @@ -96,7 +96,7 @@ void WINAPI INT_Int1aHandler( CONTEXT86 *context ) /* setting the time,date or RTC is not allow -EB */ case 0x01: /* set system time */ - case 0x03: + case 0x03: /* set RTC time */ case 0x05: /* set RTC date */ @@ -116,7 +116,7 @@ void WINAPI INT_Int1aHandler( CONTEXT86 *context ) INT_BARF(context, 0x1a); } break; - + default: INT_BARF( context, 0x1a ); } diff --git a/msdos/int21.c b/msdos/int21.c index 09e3b6a3d6c..9e4b37c35b5 100644 --- a/msdos/int21.c +++ b/msdos/int21.c @@ -156,7 +156,7 @@ static BYTE *GetCurrentDTA( CONTEXT86 *context ) TDB *pTask = TASK_GetCurrent(); /* FIXME: This assumes DTA was set correctly! */ - return (BYTE *)CTX_SEG_OFF_TO_LIN( context, SELECTOROF(pTask->dta), + return (BYTE *)CTX_SEG_OFF_TO_LIN( context, SELECTOROF(pTask->dta), (DWORD)OFFSETOF(pTask->dta) ); } @@ -198,7 +198,7 @@ void CreateBPB(int drive, BYTE *data, BOOL16 limited) data[0x21] = 7; setword(&data[0x22], 2); } - } + } } static int INT21_GetFreeDiskSpace( CONTEXT86 *context ) @@ -260,7 +260,7 @@ static int FillInDrivePB( int drive ) heap->dpb.free_search = 0; heap->dpb.free_clusters = 0xFFFF; /* unknown */ return 1; - } + } return 0; } @@ -286,7 +286,7 @@ static void ioctlGetDeviceInfo( CONTEXT86 *context ) const DOS_DEVICE *dev; TRACE("(%d)\n", BX_reg(context)); - + RESET_CFLAG(context); /* DOS device ? */ @@ -298,7 +298,7 @@ static void ioctlGetDeviceInfo( CONTEXT86 *context ) /* it seems to be a file */ curr_drive = DRIVE_GetCurrentDrive(); - DX_reg(context) = 0x0140 + curr_drive + ((curr_drive > 1) ? 0x0800 : 0); + DX_reg(context) = 0x0140 + curr_drive + ((curr_drive > 1) ? 0x0800 : 0); /* no floppy */ /* bits 0-5 are current drive * bit 6 - file has NOT been written..FIXME: correct? @@ -326,7 +326,7 @@ static BOOL ioctlGenericBlkDevReq( CONTEXT86 *context ) return FALSE; } - switch (CL_reg(context)) + switch (CL_reg(context)) { case 0x4a: /* lock logical volume */ TRACE("lock logical volume (%d) level %d mode %d\n",drive,BH_reg(context),DX_reg(context)); @@ -337,7 +337,7 @@ static BOOL ioctlGenericBlkDevReq( CONTEXT86 *context ) memset(dataptr, 0, 0x20); /* DOS 6.22 uses 0x20 bytes */ dataptr[0] = 0x04; dataptr[6] = 0; /* media type */ - if (drive > 1) + if (drive > 1) { dataptr[1] = 0x05; /* fixed disk */ setword(&dataptr[2], 0x01); /* non removable */ @@ -357,7 +357,7 @@ static BOOL ioctlGenericBlkDevReq( CONTEXT86 *context ) case 0x61: /* read logical device track */ { BYTE drive = BL_reg(context) ? - BL_reg(context) : DRIVE_GetCurrentDrive(); + BL_reg(context) : DRIVE_GetCurrentDrive(); WORD head = *(WORD *)dataptr+1; WORD cyl = *(WORD *)dataptr+3; WORD sect = *(WORD *)dataptr+5; @@ -378,7 +378,7 @@ static BOOL ioctlGenericBlkDevReq( CONTEXT86 *context ) } break; case 0x66:/* get disk serial number */ - { + { char label[12],fsname[9],path[4]; DWORD serial; @@ -399,7 +399,7 @@ static BOOL ioctlGenericBlkDevReq( CONTEXT86 *context ) case 0x6f: memset(dataptr+1, '\0', dataptr[0]-1); - dataptr[1] = dataptr[0]; + dataptr[1] = dataptr[0]; dataptr[2] = 0x07; /* protected mode driver; no eject; no notification */ dataptr[3] = 0xFF; /* no physical drive */ break; @@ -473,7 +473,7 @@ static void INT21_GetSystemTime( CONTEXT86 *context ) /* Many calls translate a drive argument like this: drive number (00h = default, 01h = A:, etc) - */ + */ static char drivestring[]="default"; char *INT21_DriveName(int drive) @@ -538,10 +538,10 @@ static BOOL INT21_ExtendedOpenCreateFile(CONTEXT86 *context ) SET_CFLAG(context); WARN("extended open/create: failed because file exists \n"); } - else if ((action & 0x07) == 2) + else if ((action & 0x07) == 2) { /* Truncate it, but first check if opened for write */ - if ((BL_reg(context) & 0x0007)== 0) + if ((BL_reg(context) & 0x0007)== 0) { _lclose16( AX_reg(context) ); WARN("extended open/create: failed, trunc on ro file\n"); @@ -573,7 +573,7 @@ static BOOL INT21_ExtendedOpenCreateFile(CONTEXT86 *context ) } uReturnCX = 0x3; } - } + } else uReturnCX = 0x1; CX_reg(context) = uReturnCX; @@ -708,7 +708,7 @@ static BOOL INT21_CreateTempFile( CONTEXT86 *context ) char *name = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx ); char *p = name + strlen(name); - /* despite what Ralf Brown says, some programs seem to call without + /* despite what Ralf Brown says, some programs seem to call without * ending backslash (DOS accepts that, so we accept it too) */ if ((p == name) || (p[-1] != '\\')) *p++ = '\\'; @@ -727,7 +727,7 @@ static BOOL INT21_CreateTempFile( CONTEXT86 *context ) } -static BOOL INT21_GetCurrentDirectory( CONTEXT86 *context ) +static BOOL INT21_GetCurrentDirectory( CONTEXT86 *context ) { int drive = DOS_GET_DRIVE( DL_reg(context) ); char *ptr = (char *)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Esi ); @@ -762,13 +762,13 @@ static int INT21_GetDiskSerialNumber( CONTEXT86 *context ) { BYTE *dataptr = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx); int drive = DOS_GET_DRIVE( BL_reg(context) ); - + if (!DRIVE_IsValid(drive)) { SetLastError( ERROR_INVALID_DRIVE ); return 0; } - + *(WORD *)dataptr = 0; *(DWORD *)(dataptr + 2) = DRIVE_GetSerialNumber( drive ); memcpy( dataptr + 6, DRIVE_GetLabel( drive ), 11 ); @@ -936,7 +936,7 @@ static void fLock( CONTEXT86 * context ) SET_CFLAG(context); return; } -} +} static BOOL INT21_networkfunc (CONTEXT86 *context) @@ -1131,7 +1131,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) } RESET_CFLAG(context); /* Not sure if this is a good idea */ - switch(AH_reg(context)) + switch(AH_reg(context)) { case 0x01: /* READ CHARACTER FROM STANDARD INPUT, WITH ECHO */ case 0x02: /* WRITE CHARACTER TO STANDARD OUTPUT */ @@ -1144,7 +1144,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x0b: /* GET STDIN STATUS */ case 0x0f: /* OPEN FILE USING FCB */ case 0x10: /* CLOSE FILE USING FCB */ - case 0x14: /* SEQUENTIAL READ FROM FCB FILE */ + case 0x14: /* SEQUENTIAL READ FROM FCB FILE */ case 0x15: /* SEQUENTIAL WRITE TO FCB FILE */ case 0x16: /* CREATE OR TRUNCATE FILE USING FCB */ case 0x21: /* READ RANDOM RECORD FROM FCB FILE */ @@ -1181,10 +1181,10 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x0a: /* BUFFERED INPUT */ { - char *buffer = ((char *)CTX_SEG_OFF_TO_LIN(context, context->SegDs, + char *buffer = ((char *)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx )); int res; - + TRACE("BUFFERED INPUT (size=%d)\n",buffer[0]); if (buffer[1]) TRACE("Handle old chars in buffer!\n"); @@ -1207,7 +1207,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x6b: /* NULL FUNCTION */ AL_reg(context) = 0; break; - + case 0x5c: /* "FLOCK" - RECORD LOCKING */ fLock(context); break; @@ -1224,7 +1224,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) break; case 0x11: /* FIND FIRST MATCHING FILE USING FCB */ - TRACE("FIND FIRST MATCHING FILE USING FCB %p\n", + TRACE("FIND FIRST MATCHING FILE USING FCB %p\n", CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); if (!INT21_FindFirstFCB(context)) { @@ -1240,7 +1240,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x13: /* DELETE FILE USING FCB */ DeleteFileFCB(context); break; - + case 0x17: /* RENAME FILE USING FCB */ RenameFileFCB(context); break; @@ -1261,7 +1261,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) DL_reg(context) = 0; if (!INT21_GetDriveAllocInfo(context)) AX_reg(context) = 0xffff; break; - + case 0x1c: /* GET ALLOCATION INFORMATION FOR SPECIFIC DRIVE */ if (!INT21_GetDriveAllocInfo(context)) AX_reg(context) = 0xffff; break; @@ -1269,7 +1269,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x1f: /* GET DRIVE PARAMETER BLOCK FOR DEFAULT DRIVE */ GetDrivePB(context, DRIVE_GetCurrentDrive()); break; - + case 0x25: /* SET INTERRUPT VECTOR */ INT_SetPMHandler( AL_reg(context), (FARPROC16)MAKESEGPTR( context->SegDs, DX_reg(context))); break; @@ -1307,7 +1307,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) BX_reg(context) = OFFSETOF( pTask->dta ); } break; - + case 0x30: /* GET DOS VERSION */ TRACE("GET DOS VERSION %s requested\n", (AL_reg(context) == 0x00)?"OEM number":"version flag"); @@ -1345,8 +1345,8 @@ void WINAPI DOS3Call( CONTEXT86 *context ) TRACE("SET CURRENT EXTENDED BREAK STATE\n"); INT21_ReadConfigSys(); DOSCONF_config.brk_flag = (DL_reg(context) > 0); - break; - + break; + case 0x02: /* GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE*/ TRACE("GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE\n"); INT21_ReadConfigSys(); @@ -1368,7 +1368,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) DL_reg(context) = 3; /* c: is Wine's bootdrive (a: is 1)*/ break; - + case 0x06: /* GET TRUE VERSION NUMBER */ TRACE("GET TRUE VERSION NUMBER\n"); BX_reg(context) = (HIWORD(GetVersion16() >> 8)) | @@ -1378,10 +1378,10 @@ void WINAPI DOS3Call( CONTEXT86 *context ) default: INT_BARF( context, 0x21 ); - break; + break; } - break; - + break; + case 0x34: /* GET ADDRESS OF INDOS FLAG */ TRACE("GET ADDRESS OF INDOS FLAG\n"); if (!heap) INT21_CreateHeap(); @@ -1404,7 +1404,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) if (!INT21_GetFreeDiskSpace(context)) AX_reg(context) = 0xffff; break; - case 0x37: + case 0x37: { unsigned char switchchar='/'; switch (AL_reg(context)) @@ -1454,7 +1454,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) } } break; - + case 0x3a: /* "RMDIR" - REMOVE SUBDIRECTORY */ TRACE("RMDIR %s\n", (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); @@ -1467,7 +1467,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); bSetDOSExtendedError = !INT21_ChangeDir(context); break; - + case 0x3c: /* "CREAT" - CREATE OR TRUNCATE FILE */ TRACE("CREAT flag 0x%02x %s\n",CX_reg(context), (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); @@ -1546,7 +1546,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) switch (AL_reg(context)) { case 0x00: - TRACE("GET FILE ATTRIBUTES for %s\n", + TRACE("GET FILE ATTRIBUTES for %s\n", (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); AX_reg(context) = (WORD)GetFileAttributesA( CTX_SEG_OFF_TO_LIN(context, context->SegDs, @@ -1558,8 +1558,8 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x01: TRACE("SET FILE ATTRIBUTES 0x%02x for %s\n", CX_reg(context), (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); - bSetDOSExtendedError = - (!SetFileAttributesA( CTX_SEG_OFF_TO_LIN(context, context->SegDs, + bSetDOSExtendedError = + (!SetFileAttributesA( CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx), CX_reg(context) )); break; @@ -1568,7 +1568,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); } break; - + case 0x44: /* IOCTL */ switch (AL_reg(context)) { @@ -1619,7 +1619,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x09: /* CHECK IF BLOCK DEVICE REMOTE */ TRACE("IOCTL - CHECK IF BLOCK DEVICE REMOTE for drive %s\n", - INT21_DriveName( BL_reg(context))); + INT21_DriveName( BL_reg(context))); switch(GetDriveType16( DOS_GET_DRIVE( BL_reg(context) ))) { case DRIVE_UNKNOWN: @@ -1660,7 +1660,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) { int drive; TRACE("IOCTL - SET LOGICAL DRIVE MAP for drive %s\n", - INT21_DriveName( BL_reg(context))); + INT21_DriveName( BL_reg(context))); drive = DOS_GET_DRIVE ( BL_reg(context) ); if ( ! DRIVE_SetLogicalMapping ( drive, drive+1 ) ) { @@ -1673,7 +1673,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0xe0: /* Sun PC-NFS API */ /* not installed */ break; - + case 0x52: /* DR-DOS version */ /* This is not DR-DOS */ @@ -1683,7 +1683,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) SET_CFLAG(context); /* Error */ SetLastError( ERROR_INVALID_FUNCTION ); break; - + default: INT_BARF( context, 0x21 ); break; @@ -1719,7 +1719,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x48: /* ALLOCATE MEMORY */ TRACE("ALLOCATE MEMORY for %d paragraphs\n", BX_reg(context)); { - LPVOID *mem; + LPVOID *mem; if (ISV86(context)) { mem= DOSMEM_GetBlock((DWORD)BX_reg(context)<<4,NULL); @@ -1836,7 +1836,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) TRACE("RENAME %s to %s\n", (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs,context->Edx), (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegEs,context->Edi)); - bSetDOSExtendedError = + bSetDOSExtendedError = (!MoveFileA( CTX_SEG_OFF_TO_LIN(context, context->SegDs,context->Edx), CTX_SEG_OFF_TO_LIN(context, context->SegEs,context->Edi))); break; @@ -1863,7 +1863,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) BX_reg(context)); DosDateTimeToFileTime( DX_reg(context), CX_reg(context), &filetime ); - bSetDOSExtendedError = + bSetDOSExtendedError = (!SetFileTime( DosFileHandleToWin32Handle(BX_reg(context)), NULL, NULL, &filetime )); } @@ -1897,7 +1897,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x5b: /* CREATE NEW FILE */ TRACE("CREATE NEW FILE 0x%02x for %s\n", CX_reg(context), (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); - bSetDOSExtendedError = ((AX_reg(context) = + bSetDOSExtendedError = ((AX_reg(context) = _lcreat16_uniq( CTX_SEG_OFF_TO_LIN(context, context->SegDs,context->Edx), CX_reg(context) )) == (WORD)HFILE_ERROR16); break; @@ -1931,7 +1931,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) { SetLastError( ERROR_INVALID_DRIVE ); bSetDOSExtendedError = TRUE; - } + } break; default: @@ -2000,10 +2000,10 @@ void WINAPI DOS3Call( CONTEXT86 *context ) while (len--) { *ptr = toupper(*ptr); ptr++; } } break; - case 0x22: + case 0x22: TRACE("\tConvert ASCIIZ string to uppercase\n"); _strupr( (LPSTR)CTX_SEG_OFF_TO_LIN(context,context->SegDs,context->Edx) ); - break; + break; default: TRACE("\tunimplemented function %d\n",AL_reg(context)); INT_BARF( context, 0x21 ); @@ -2019,8 +2019,8 @@ void WINAPI DOS3Call( CONTEXT86 *context ) TRACE("GET GLOBAL CODE PAGE TABLE\n"); DX_reg(context) = BX_reg(context) = CodePage; RESET_CFLAG(context); - break; - case 0x02: + break; + case 0x02: TRACE("SET GLOBAL CODE PAGE TABLE active page %d system page %d\n", BX_reg(context),DX_reg(context)); CodePage = BX_reg(context); @@ -2039,8 +2039,8 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x6a: /* COMMIT FILE */ TRACE("FFLUSH/COMMIT handle %d\n",BX_reg(context)); bSetDOSExtendedError = (!FlushFileBuffers( DosFileHandleToWin32Handle(BX_reg(context)) )); - break; - + break; + case 0x69: /* DISK SERIAL NUMBER */ switch (AL_reg(context)) { @@ -2059,13 +2059,13 @@ void WINAPI DOS3Call( CONTEXT86 *context ) break; } break; - + case 0x6C: /* Extended Open/Create*/ TRACE("EXTENDED OPEN/CREATE %s\n", (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edi)); bSetDOSExtendedError = INT21_ExtendedOpenCreateFile(context); break; - + case 0x71: /* MS-DOS 7 (Windows95) - LONG FILENAME FUNCTIONS */ if ((GetVersion()&0xC0000004)!=0xC0000004) { /* not supported on anything but Win95 */ @@ -2078,7 +2078,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x39: /* Create directory */ TRACE("LONG FILENAME - MAKE DIRECTORY %s\n", (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs,context->Edx)); - bSetDOSExtendedError = (!CreateDirectoryA( + bSetDOSExtendedError = (!CreateDirectoryA( CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx ), NULL)); /* FIXME: CreateDirectory's LastErrors will clash with the ones @@ -2100,7 +2100,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) case 0x3a: /* Remove directory */ TRACE("LONG FILENAME - REMOVE DIRECTORY %s\n", (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs,context->Edx)); - bSetDOSExtendedError = (!RemoveDirectoryA( + bSetDOSExtendedError = (!RemoveDirectoryA( CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx ))); break; @@ -2118,7 +2118,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) break; case 0x01: TRACE("\tset attributes 0x%04x\n",CX_reg(context)); - bSetDOSExtendedError = (!SetFileAttributesA( + bSetDOSExtendedError = (!SetFileAttributesA( CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx), CX_reg(context) ) ); @@ -2181,7 +2181,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) BX_reg(context)); bSetDOSExtendedError = (!FindClose16( BX_reg(context) )); break; - case 0x60: + case 0x60: switch(CL_reg(context)) { case 0x01: /* Get short filename or path */ @@ -2212,15 +2212,15 @@ void WINAPI DOS3Call( CONTEXT86 *context ) break; case 0x6c: /* Create or open file */ TRACE("LONG FILENAME - CREATE OR OPEN FILE %s\n", - (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Esi)); + (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Esi)); /* translate Dos 7 action to Dos 6 action */ bSetDOSExtendedError = INT21_ExtendedOpenCreateFile(context); break; case 0x3b: /* Change directory */ TRACE("LONG FILENAME - CHANGE DIRECTORY %s\n", - (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); - if (!SetCurrentDirectoryA(CTX_SEG_OFF_TO_LIN(context, + (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); + if (!SetCurrentDirectoryA(CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx )) @@ -2231,8 +2231,8 @@ void WINAPI DOS3Call( CONTEXT86 *context ) break; case 0x41: /* Delete file */ TRACE("LONG FILENAME - DELETE FILE %s\n", - (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); - if (!DeleteFileA(CTX_SEG_OFF_TO_LIN(context, + (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx)); + if (!DeleteFileA(CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx) )) { @@ -2310,7 +2310,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) edpb->edpb_flags = 0; edpb->next_edpb = 0; edpb->free_cluster = edpb->free_cluster2 = 0; - + /* determine free disk space */ *root += DOS_GET_DRIVE( DX_reg(context) ); GetDiskFreeSpaceA( root, &cluster_sectors, §or_bytes, @@ -2326,9 +2326,9 @@ void WINAPI DOS3Call( CONTEXT86 *context ) edpb->max_cluster = total_clusters; edpb->fat_clusters = 32; /* made-up value */ edpb->root_cluster = 0; - + RESET_CFLAG(context); /* clear carry */ - AX_reg(context) = 0; + AX_reg(context) = 0; } else { @@ -2346,7 +2346,7 @@ void WINAPI DOS3Call( CONTEXT86 *context ) AL_reg(context) = 0; break; } - + break; @@ -2361,14 +2361,14 @@ void WINAPI DOS3Call( CONTEXT86 *context ) } /* END OF SWITCH */ if( bSetDOSExtendedError ) /* set general error condition */ - { + { AX_reg(context) = GetLastError(); SET_CFLAG(context); } if ((context->EFlags & 0x0001)) TRACE("failed, error %ld\n", GetLastError() ); - + TRACE("returning: AX=%04x BX=%04x CX=%04x DX=%04x " "SI=%04x DI=%04x DS=%04x ES=%04x EFL=%08lx\n", AX_reg(context), BX_reg(context), CX_reg(context), diff --git a/msdos/int26.c b/msdos/int26.c index 31fc7961b15..3a473c4c773 100644 --- a/msdos/int26.c +++ b/msdos/int26.c @@ -57,7 +57,7 @@ void WINAPI INT_Int26Handler( CONTEXT86 *context ) begin = LOWORD(context->Edx); length = LOWORD(context->Ecx); } - + TRACE("int26: abs diskwrite, drive %d, sector %ld, " "count %ld, buffer %p\n", AL_reg(context), begin, length, dataptr ); diff --git a/msdos/int2a.c b/msdos/int2a.c index c9a1efa839d..a170a567af2 100644 --- a/msdos/int2a.c +++ b/msdos/int2a.c @@ -20,7 +20,7 @@ void WINAPI INT_Int2aHandler( CONTEXT86 *context ) { case 0x00: /* NETWORK INSTALLATION CHECK */ break; - + default: INT_BARF( context, 0x2a ); } diff --git a/msdos/int2f.c b/msdos/int2f.c index 9f83b674351..5f3fa6a7c05 100644 --- a/msdos/int2f.c +++ b/msdos/int2f.c @@ -84,14 +84,14 @@ void WINAPI INT_Int2fHandler( CONTEXT86 *context ) case 0x05: case 0x07: case 0x09: - break; + break; /* Instead of having a message table in DOS-space, */ /* we can use a special case for MS-DOS to force */ /* the secondary interface. */ case 0x00: case 0x02: case 0x04: - case 0x06: + case 0x06: context->SegEs = 0x0001; DI_reg(context) = 0x0000; break; @@ -104,9 +104,9 @@ void WINAPI INT_Int2fHandler( CONTEXT86 *context ) break; default: INT_BARF(context, 0x2f); - } + } break; - + case 0x15: /* mscdex */ MSCDEX_Handler(context); break; @@ -143,7 +143,7 @@ void WINAPI INT_Int2fHandler( CONTEXT86 *context ) break; case 0x45: - switch (LOBYTE(context->Eax)) + switch (LOBYTE(context->Eax)) { case 0x00: case 0x01: @@ -204,7 +204,7 @@ void WINAPI INT_Int2fHandler( CONTEXT86 *context ) switch (LOBYTE(context->Eax)) { case 0x0: /* Low-level Netware installation check AL=0 not installed.*/ - AL_reg(context) = 0; + AL_reg(context) = 0; break; case 0x20: /* Get VLM Call Address */ /* return nothing -> NetWare not installed */ @@ -246,7 +246,7 @@ void WINAPI INT_Int2fHandler( CONTEXT86 *context ) switch(LOBYTE(context->Eax)) { case 0x01: /* Quarterdeck RPCI - QEMM/QRAM - PCL-838.EXE functions */ - if(BX_reg(context) == 0x5145 && CX_reg(context) == 0x4D4D + if(BX_reg(context) == 0x5145 && CX_reg(context) == 0x4D4D && DX_reg(context) == 0x3432) TRACE("Check for QEMM v5.0+ (not installed)\n"); break; @@ -270,7 +270,7 @@ void WINAPI INT_Int2fHandler( CONTEXT86 *context ) switch(LOBYTE(context->Eax)) { case 0x01: /* Quarterdeck QDPMI.SYS - DESQview */ - if(BX_reg(context) == 0x4450 && CX_reg(context) == 0x4d49 + if(BX_reg(context) == 0x4450 && CX_reg(context) == 0x4d49 && DX_reg(context) == 0x8f4f) TRACE("Check for QDPMI.SYS (not installed)\n"); break; @@ -301,7 +301,7 @@ static void do_int2f_16( CONTEXT86 *context ) AX_reg(context) = (GetWinFlags16() & WF_ENHANCED) ? LOWORD(GetVersion16()) : 0; break; - + case 0x0a: /* Get Windows version and type */ AX_reg(context) = 0; BX_reg(context) = (LOWORD(GetVersion16()) << 8) | @@ -314,8 +314,8 @@ static void do_int2f_16( CONTEXT86 *context ) break; case 0x11: /* Get Shell Parameters - (SHELL= in CONFIG.SYS) */ - /* We can mock this up. But not today... */ - FIXME("Get Shell Parameters\n"); + /* We can mock this up. But not today... */ + FIXME("Get Shell Parameters\n"); break; case 0x80: /* Release time-slice */ @@ -377,7 +377,7 @@ static void do_int2f_16( CONTEXT86 *context ) } } -/* FIXME: this macro may have to be changed on architectures where reads/writes +/* FIXME: this macro may have to be changed on architectures where reads/writes * must be aligned * could be WORD, DWORD... * in this case, we would need two macros, one for read, the other one for write @@ -398,7 +398,7 @@ static void MSCDEX_Dump(char* pfx, BYTE* req, int dorealmode) BYTE buf[2048]; BYTE* ptr; BYTE* ios; - + ptr = buf; ptr += sprintf(ptr, "%s\tCommand => ", pfx); for (i = 0; i < req[0]; i++) { @@ -428,7 +428,7 @@ static void MSCDEX_Dump(char* pfx, BYTE* req, int dorealmode) #endif #define CDFRAMES_PERSEC 75 -#define CDFRAMES_PERMIN (CDFRAMES_PERSEC * 60) +#define CDFRAMES_PERMIN (CDFRAMES_PERSEC * 60) #define FRAME_OF_ADDR(a) ((a)[1] * CDFRAMES_PERMIN + (a)[2] * CDFRAMES_PERSEC + (a)[3]) #define FRAME_OF_TOC(toc, idx) FRAME_OF_ADDR((toc).TrackData[idx - (toc).FirstTrack].Address) #define CTRL_OF_TOC(toc, idx) (((toc).TrackData[idx - (toc).FirstTrack].Control << 4) | \ @@ -468,17 +468,17 @@ static void MSCDEX_Handler(CONTEXT86* context) BX_reg(context) = count; CX_reg(context) = (drive < 26) ? drive : 0; break; - + case 0x0B: /* drive check */ AX_reg(context) = is_cdrom(CX_reg(context)); BX_reg(context) = 0xADAD; break; - + case 0x0C: /* get version */ BX_reg(context) = 0x020a; TRACE("Version number => %04x\n", BX_reg(context)); break; - + case 0x0D: /* get drive letters */ p = CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Ebx); memset(p, 0, 26); @@ -487,12 +487,12 @@ static void MSCDEX_Handler(CONTEXT86* context) } TRACE("Get drive letters\n"); break; - + case 0x10: /* direct driver access */ { BYTE* driver_request; - BYTE* io_stru; - BYTE Error = 255; /* No Error */ + BYTE* io_stru; + BYTE Error = 255; /* No Error */ int dorealmode = ISV86(context); char devName[] = "\\\\.\\@:"; HANDLE h; @@ -503,7 +503,7 @@ static void MSCDEX_Handler(CONTEXT86* context) DWORD present = TRUE; driver_request = CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Ebx); - + if (!driver_request) { /* FIXME - to be deleted ?? */ ERR("ES:BX==0 ! SEGFAULT ?\n"); @@ -518,7 +518,7 @@ static void MSCDEX_Handler(CONTEXT86* context) * tray to be closed with a CD inside */ TRACE("CDROM device driver -> command <%d>\n", (unsigned char)driver_request[2]); - + if (!is_cdrom(CX_reg(context))) { WARN("Request made doesn't match a CD ROM drive (%d)\n", CX_reg(context)); driver_request[4] |= 0x80; @@ -527,7 +527,7 @@ static void MSCDEX_Handler(CONTEXT86* context) } MSCDEX_Dump("Beg", driver_request, dorealmode); - + /* set status to 0 */ PTR_AT(driver_request, 3, WORD) = 0; devName[4] = 'A' + CX_reg(context); @@ -541,7 +541,7 @@ static void MSCDEX_Handler(CONTEXT86* context) fmt.Format = IOCTL_CDROM_CURRENT_POSITION; if (!DeviceIoControl(h, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL) || - !DeviceIoControl(h, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + !DeviceIoControl(h, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { if (GetLastError() == STATUS_NO_MEDIA_IN_DEVICE) { @@ -562,14 +562,14 @@ static void MSCDEX_Handler(CONTEXT86* context) return; } } - + switch (driver_request[2]) { case 3: - io_stru = (dorealmode) ? + io_stru = (dorealmode) ? PTR_REAL_TO_LIN( PTR_AT(driver_request, 16, WORD), PTR_AT(driver_request, 14, WORD) ) : MapSL( MAKESEGPTR(PTR_AT(driver_request, 16, WORD), PTR_AT(driver_request, 14, WORD))); - - TRACE(" --> IOCTL INPUT <%d>\n", io_stru[0]); + + TRACE(" --> IOCTL INPUT <%d>\n", io_stru[0]); switch (io_stru[0]) { #if 0 case 0: /* Get device Header */ @@ -597,24 +597,24 @@ static void MSCDEX_Handler(CONTEXT86* context) } break; #endif - + case 1: /* location of head */ switch (io_stru[1]) { case 0: - PTR_AT(io_stru, 2, DWORD) = + PTR_AT(io_stru, 2, DWORD) = FRAME_OF_ADDR(data.CurrentPosition.AbsoluteAddress); break; case 1: - MSCDEX_StoreMSF(FRAME_OF_ADDR(data.CurrentPosition.AbsoluteAddress), + MSCDEX_StoreMSF(FRAME_OF_ADDR(data.CurrentPosition.AbsoluteAddress), io_stru + 2); break; default: ERR("CD-ROM driver: unsupported addressing mode !!\n"); Error = 0x0c; - } - TRACE(" ----> HEAD LOCATION <%ld>\n", PTR_AT(io_stru, 2, DWORD)); + } + TRACE(" ----> HEAD LOCATION <%ld>\n", PTR_AT(io_stru, 2, DWORD)); break; - + case 4: /* Audio channel info */ io_stru[1] = 0; io_stru[2] = 0xff; @@ -624,16 +624,16 @@ static void MSCDEX_Handler(CONTEXT86* context) io_stru[6] = 0; io_stru[7] = 3; io_stru[8] = 0; - TRACE(" ----> AUDIO CHANNEL INFO\n"); + TRACE(" ----> AUDIO CHANNEL INFO\n"); break; - + case 6: /* device status */ PTR_AT(io_stru, 1, DWORD) = 0x00000290; - /* 290 => - * 1 Supports HSG and Red Book addressing modes - * 0 Supports audio channel manipulation + /* 290 => + * 1 Supports HSG and Red Book addressing modes + * 0 Supports audio channel manipulation * - * 1 Supports prefetching requests + * 1 Supports prefetching requests * 0 Reserved * 0 No interleaving * 1 Data read and plays audio/video tracks @@ -646,29 +646,29 @@ static void MSCDEX_Handler(CONTEXT86* context) if (!present) PTR_AT(io_stru, 1, DWORD) |= 1; TRACE(" ----> DEVICE STATUS <0x%08lx>\n", PTR_AT(io_stru, 1, DWORD)); break; - + case 8: /* Volume size */ PTR_AT(io_stru, 1, DWORD) = FRAME_OF_TOC(toc, toc.LastTrack + 1) - FRAME_OF_TOC(toc, toc.FirstTrack) - 1; TRACE(" ----> VOLUME SIZE <%ld>\n", PTR_AT(io_stru, 1, DWORD)); break; - + case 9: /* media changed ? */ /* answers don't know... -1/1 for yes/no would be better */ io_stru[1] = 0; /* FIXME? 1? */ - TRACE(" ----> MEDIA CHANGED <%d>\n", io_stru[1]); + TRACE(" ----> MEDIA CHANGED <%d>\n", io_stru[1]); break; - + case 10: /* audio disk info */ io_stru[1] = toc.FirstTrack; /* starting track of the disc */ io_stru[2] = toc.LastTrack; /* ending track */ MSCDEX_StoreMSF(FRAME_OF_TOC(toc, toc.LastTrack + 1) - FRAME_OF_TOC(toc, toc.FirstTrack) - 1, io_stru + 3); - + TRACE(" ----> AUDIO DISK INFO <%d-%d/%08lx>\n", io_stru[1], io_stru[2], PTR_AT(io_stru, 3, DWORD)); break; - + case 11: /* audio track info */ if (io_stru[1] >= toc.FirstTrack && io_stru[1] <= toc.LastTrack) { MSCDEX_StoreMSF(FRAME_OF_TOC(toc, io_stru[1]), io_stru + 2); @@ -679,13 +679,13 @@ static void MSCDEX_Handler(CONTEXT86* context) io_stru[6] = 0; } TRACE(" ----> AUDIO TRACK INFO[%d] = [%08lx:%d]\n", - io_stru[1], PTR_AT(io_stru, 2, DWORD), io_stru[6]); + io_stru[1], PTR_AT(io_stru, 2, DWORD), io_stru[6]); break; - + case 12: /* get Q-Channel info */ io_stru[1] = CTRL_OF_TOC(toc, data.CurrentPosition.TrackNumber); io_stru[2] = data.CurrentPosition.TrackNumber; - io_stru[3] = 0; /* FIXME ?? */ + io_stru[3] = 0; /* FIXME ?? */ /* why the heck did MS use another format for 0MSF information... sigh */ { @@ -702,15 +702,15 @@ static void MSCDEX_Handler(CONTEXT86* context) io_stru[ 9] = bTmp[1]; io_stru[10] = bTmp[0]; io_stru[11] = 0; - } + } TRACE("Q-Channel info: Ctrl/adr=%02x TNO=%02x X=%02x rtt=%02x:%02x:%02x rtd=%02x:%02x:%02x (cf=%08x, tp=%08x)\n", - io_stru[ 1], io_stru[ 2], io_stru[ 3], - io_stru[ 4], io_stru[ 5], io_stru[ 6], + io_stru[ 1], io_stru[ 2], io_stru[ 3], + io_stru[ 4], io_stru[ 5], io_stru[ 6], io_stru[ 8], io_stru[ 9], io_stru[10], - FRAME_OF_ADDR(data.CurrentPosition.AbsoluteAddress), + FRAME_OF_ADDR(data.CurrentPosition.AbsoluteAddress), FRAME_OF_TOC(toc, data.CurrentPosition.TrackNumber)); break; - + case 15: /* Audio status info */ /* !!!! FIXME FIXME FIXME !! */ PTR_AT(io_stru, 1, WORD) = 2 | ((data.CurrentPosition.Header.AudioStatus == AUDIO_STATUS_PAUSED) ? 1 : 0); @@ -724,46 +724,46 @@ static void MSCDEX_Handler(CONTEXT86* context) TRACE("Audio status info: status=%04x startLoc=%ld endLoc=%ld\n", PTR_AT(io_stru, 1, WORD), PTR_AT(io_stru, 3, DWORD), PTR_AT(io_stru, 7, DWORD)); break; - + default: - FIXME("IOCTL INPUT: Unimplemented <%d>!!\n", io_stru[0]); - Error = 0x0c; - break; - } + FIXME("IOCTL INPUT: Unimplemented <%d>!!\n", io_stru[0]); + Error = 0x0c; + break; + } break; - + case 12: - io_stru = (dorealmode) ? + io_stru = (dorealmode) ? PTR_REAL_TO_LIN( PTR_AT(driver_request, 16, WORD), PTR_AT(driver_request, 14, WORD)) : MapSL( MAKESEGPTR(PTR_AT(driver_request, 16, WORD), PTR_AT(driver_request, 14, WORD))); - - TRACE(" --> IOCTL OUTPUT <%d>\n", io_stru[0]); + + TRACE(" --> IOCTL OUTPUT <%d>\n", io_stru[0]); switch (io_stru[0]) { - case 0: /* eject */ + case 0: /* eject */ DeviceIoControl(h, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &br, NULL); - TRACE(" ----> EJECT\n"); + TRACE(" ----> EJECT\n"); break; case 2: /* reset drive */ DeviceIoControl(h, IOCTL_STORAGE_RESET_DEVICE, NULL, 0, NULL, 0, &br, NULL); - TRACE(" ----> RESET\n"); + TRACE(" ----> RESET\n"); break; case 3: /* Audio Channel Control */ FIXME(" ----> AUDIO CHANNEL CONTROL (NIY)\n"); break; case 5: /* close tray */ DeviceIoControl(h, IOCTL_STORAGE_LOAD_MEDIA, NULL, 0, NULL, 0, &br, NULL); - TRACE(" ----> CLOSE TRAY\n"); + TRACE(" ----> CLOSE TRAY\n"); break; default: - FIXME(" IOCTL OUTPUT: Unimplemented <%d>!!\n", io_stru[0]); + FIXME(" IOCTL OUTPUT: Unimplemented <%d>!!\n", io_stru[0]); Error = 0x0c; - break; - } + break; + } break; - + case 128: /* read long */ { - LPVOID dst = MapSL(MAKESEGPTR(PTR_AT(driver_request, 16, WORD), + LPVOID dst = MapSL(MAKESEGPTR(PTR_AT(driver_request, 16, WORD), PTR_AT(driver_request, 14, WORD))); DWORD at = PTR_AT(driver_request, 20, DWORD); WORD num = PTR_AT(driver_request, 18, WORD); @@ -790,7 +790,7 @@ static void MSCDEX_Handler(CONTEXT86* context) rri.DiskOffset.s.LowPart = at << 11; rri.TrackMode = YellowMode2; rri.SectorCount = num; - DeviceIoControl(h, IOCTL_CDROM_RAW_READ, &rri, sizeof(rri), + DeviceIoControl(h, IOCTL_CDROM_RAW_READ, &rri, sizeof(rri), dst, num * 2352, &br, NULL); break; default: @@ -813,10 +813,10 @@ static void MSCDEX_Handler(CONTEXT86* context) CDROM_SEEK_AUDIO_MSF seek; at = PTR_AT(driver_request, 20, DWORD); - - TRACE(" --> SEEK AUDIO mode :<0x%02X>, [%ld]\n", + + TRACE(" --> SEEK AUDIO mode :<0x%02X>, [%ld]\n", (BYTE)driver_request[13], at); - + switch (driver_request[13]) { case 1: /* Red book addressing mode = 0:m:s:f */ /* FIXME : frame <=> msf conversion routines could be shared @@ -830,7 +830,7 @@ static void MSCDEX_Handler(CONTEXT86* context) seek.M = at / CDFRAMES_PERMIN; seek.S = (at / CDFRAMES_PERSEC) % 60; seek.F = at % CDFRAMES_PERSEC; - DeviceIoControl(h, IOCTL_CDROM_SEEK_AUDIO_MSF, &seek, sizeof(seek), + DeviceIoControl(h, IOCTL_CDROM_SEEK_AUDIO_MSF, &seek, sizeof(seek), NULL, 0, &br, NULL); break; default: @@ -848,12 +848,12 @@ static void MSCDEX_Handler(CONTEXT86* context) beg = end = PTR_AT(driver_request, 14, DWORD); end += PTR_AT(driver_request, 18, DWORD); - - TRACE(" --> PLAY AUDIO mode :<0x%02X>, [%ld-%ld]\n", + + TRACE(" --> PLAY AUDIO mode :<0x%02X>, [%ld-%ld]\n", (BYTE)driver_request[13], beg, end); - + switch (driver_request[13]) { - case 1: + case 1: /* Red book addressing mode = 0:m:s:f */ /* FIXME : frame <=> msf conversion routines could be shared * between mscdex and mcicda @@ -872,7 +872,7 @@ static void MSCDEX_Handler(CONTEXT86* context) play.EndingM = end / CDFRAMES_PERMIN; play.EndingS = (end / CDFRAMES_PERSEC) % 60; play.EndingF = end % CDFRAMES_PERSEC; - DeviceIoControl(h, IOCTL_CDROM_PLAY_AUDIO_MSF, &play, sizeof(play), + DeviceIoControl(h, IOCTL_CDROM_PLAY_AUDIO_MSF, &play, sizeof(play), NULL, 0, &br, NULL); break; default: @@ -882,7 +882,7 @@ static void MSCDEX_Handler(CONTEXT86* context) } } break; - + case 133: if (data.CurrentPosition.Header.AudioStatus == AUDIO_STATUS_IN_PROGRESS) { DeviceIoControl(h, IOCTL_CDROM_PAUSE_AUDIO, NULL, 0, NULL, 0, &br, NULL); @@ -892,17 +892,17 @@ static void MSCDEX_Handler(CONTEXT86* context) TRACE(" --> STOP AUDIO (Stopped)\n"); } break; - + case 136: TRACE(" --> RESUME AUDIO\n"); DeviceIoControl(h, IOCTL_CDROM_PAUSE_AUDIO, NULL, 0, NULL, 0, &br, NULL); break; - + default: - FIXME(" ioctl unimplemented <%d>\n", driver_request[2]); - Error = 0x0c; + FIXME(" ioctl unimplemented <%d>\n", driver_request[2]); + Error = 0x0c; } - + /* setting error codes if any */ if (Error < 255) { driver_request[4] |= 0x80; @@ -912,11 +912,11 @@ static void MSCDEX_Handler(CONTEXT86* context) CloseHandle(h); /* setting status bits * 3 == playing && done - * 1 == done + * 1 == done */ - driver_request[4] |= + driver_request[4] |= (data.CurrentPosition.Header.AudioStatus == AUDIO_STATUS_IN_PROGRESS) ? 3 : 1; - + MSCDEX_Dump("End", driver_request, dorealmode); } break; diff --git a/msdos/int41.c b/msdos/int41.c index c9ac67f8f4a..1506dad100f 100644 --- a/msdos/int41.c +++ b/msdos/int41.c @@ -1,6 +1,6 @@ /* * DOS interrupt 41h handler -- Windows Kernel Debugger - * + * * Check debugsys.inc from the DDK for docu. * * Copyright 1998 Ulrich Weigand diff --git a/msdos/int4b.c b/msdos/int4b.c index 1056ea9536a..93c59c3cf8d 100644 --- a/msdos/int4b.c +++ b/msdos/int4b.c @@ -16,10 +16,10 @@ void WINAPI INT_Int4bHandler( CONTEXT86 *context ) { switch(AH_reg(context)) { - case 0x81: /* Virtual DMA Spec (IBM SCSI interface) */ + case 0x81: /* Virtual DMA Spec (IBM SCSI interface) */ if(AL_reg(context) != 0x02) /* if not install check */ { - SET_CFLAG(context); + SET_CFLAG(context); AL_reg(context) = 0x0f; /* function is not implemented */ } break; diff --git a/msdos/int5c.c b/msdos/int5c.c index 3c30d751b72..f2073092d35 100644 --- a/msdos/int5c.c +++ b/msdos/int5c.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); * NetBIOSCall (KERNEL.103) * INT_Int5cHandler (WPROCS.192) * - * Also handler for interrupt 5c. + * Also handler for interrupt 5c. */ void WINAPI NetBIOSCall16( CONTEXT86 *context ) { diff --git a/msdos/ioports.c b/msdos/ioports.c index 46e52cb0307..69d275c1d38 100644 --- a/msdos/ioports.c +++ b/msdos/ioports.c @@ -138,14 +138,14 @@ static void set_IO_permissions(int val1, int val, char rw) { int j; if (val1 != -1) { - if (val == -1) val = 0x3ff; + if (val == -1) val = 0x3ff; for (j = val1; j <= val; j++) - port_permissions[j] |= rw; + port_permissions[j] |= rw; do_direct_port_access = 1; val1 = -1; - } else if (val != -1) { + } else if (val != -1) { do_direct_port_access = 1; port_permissions[val] |= rw; @@ -171,7 +171,7 @@ static void do_IO_port_init_read_or_write(char* temp, char rw) } else if (!(!strcmp(temp, "*") || *temp == '\0')) { len = strlen(temp); val = -1; - val1 = -1; + val1 = -1; for (i = 0; i < len; i++) { switch (temp[i]) { case '0': @@ -203,7 +203,7 @@ static void do_IO_port_init_read_or_write(char* temp, char rw) } } } - set_IO_permissions(val1, val, rw); + set_IO_permissions(val1, val, rw); } } @@ -267,7 +267,7 @@ static void IO_port_init(void) /********************************************************************** * IO_inport * - * Note: The size argument has to be handled correctly _externally_ + * Note: The size argument has to be handled correctly _externally_ * (as we always return a DWORD) */ DWORD IO_inport( int port, int size ) @@ -277,7 +277,7 @@ DWORD IO_inport( int port, int size ) TRACE("%d-byte value from port 0x%02x\n", size, port ); #ifdef HAVE_PPDEV - if (do_pp_port_access == -1) + if (do_pp_port_access == -1) do_pp_port_access =IO_pp_init(); if ((do_pp_port_access == 0 ) && (size == 1)) if (!IO_pp_inp(port,&res)) @@ -398,7 +398,7 @@ void IO_outport( int port, int size, DWORD value ) value, size, port ); #ifdef HAVE_PPDEV - if (do_pp_port_access == -1) + if (do_pp_port_access == -1) do_pp_port_access = IO_pp_init(); if ((do_pp_port_access == 0) && (size == 1)) if (!IO_pp_outp(port,&value)) @@ -469,7 +469,7 @@ void IO_outport( int port, int size, DWORD value ) (tmr_8253[chan].countmax != tmr_8253[chan].oldval)) set_timer_maxval(chan, tmr_8253[chan].countmax); } - break; + break; case 0x43: { BYTE chan = ((BYTE)value & 0xc0) >> 6; diff --git a/msdos/ppdev.c b/msdos/ppdev.c index 5444e30171b..ac333370a94 100644 --- a/msdos/ppdev.c +++ b/msdos/ppdev.c @@ -57,7 +57,7 @@ static int IO_pp_sort(const void *p1,const void *p2) return ((PPDeviceStruct*)p1)->userbase - ((PPDeviceStruct*)p2)->userbase; } -/* IO_pp_init +/* IO_pp_init * * Read the ppdev entries from wine.conf, open the device and check * for nescessary IOCTRL @@ -82,9 +82,9 @@ char IO_pp_init(void) { DWORD type, count = sizeof(buffer), name_len = sizeof(name); - if (RegEnumValueA( hkey, idx, name, &name_len, NULL, &type, buffer, &count )!= ERROR_SUCCESS) + if (RegEnumValueA( hkey, idx, name, &name_len, NULL, &type, buffer, &count )!= ERROR_SUCCESS) break; - + idx++; if(nports >4) { @@ -112,7 +112,7 @@ char IO_pp_init(void) WARN("Rejecting configuration item\n"); continue; } - if (ioctl (fd,PPCLAIM,0)) + if (ioctl (fd,PPCLAIM,0)) { ERR("PPCLAIM rejected %s\n",buffer); ERR("Perhaps the device is already in use or non-existant\n"); @@ -141,7 +141,7 @@ char IO_pp_init(void) ERR("PPUSER IOCTL not available for parport device %s\n",temp); continue; } - if (ioctl (fd,PPRELEASE,0)) + if (ioctl (fd,PPRELEASE,0)) { ERR("PPRELEASE rejected %s\n",buffer); ERR("Perhaps the device is already in use or non-existant\n"); @@ -178,7 +178,7 @@ char IO_pp_init(void) if (nports > 1) /* sort in accending order for userbase for faster access*/ qsort (PPDeviceList,PPDeviceNum,sizeof(PPDeviceStruct),IO_pp_sort); - + if (nports) ret=0; for (idx= 0;idxEcx = 0; /* maximum size of paging file */ + context->Ecx = 0; /* maximum size of paging file */ /* FIXME: do I touch DS:SI or DS:DI? */ RESET_CFLAG(context); break; @@ -230,7 +230,7 @@ void WINAPI VXD_VXDLoader( CONTEXT86 *context ) AX_reg(context) = 0x000B; /* invalid function number */ SET_CFLAG(context); break; - } + } } /*********************************************************************** @@ -487,20 +487,20 @@ void WINAPI VXD_APM ( CONTEXT86 *context ) * * This is an implementation of the services of the Win32s VxD. * Since official documentation of these does not seem to be available, - * certain arguments of some of the services remain unclear. + * certain arguments of some of the services remain unclear. * - * FIXME: The following services are currently unimplemented: + * FIXME: The following services are currently unimplemented: * Exception handling (0x01, 0x1C) * Debugger support (0x0C, 0x14, 0x17) * Low-level memory access (0x02, 0x03, 0x0A, 0x0B) * Memory Statistics (0x1B) - * + * * * We have a specific problem running Win32s on Linux (and probably also * the other x86 unixes), since Win32s tries to allocate its main 'flat * code/data segment' selectors with a base of 0xffff0000 (and limit 4GB). - * The rationale for this seems to be that they want one the one hand to - * be able to leave the Win 3.1 memory (starting with the main DOS memory) + * The rationale for this seems to be that they want one the one hand to + * be able to leave the Win 3.1 memory (starting with the main DOS memory) * at linear address 0, but want at other hand to have offset 0 of the * flat data/code segment point to an unmapped page (to catch NULL pointer * accesses). Hence they allocate the flat segments with a base of 0xffff0000 @@ -532,7 +532,7 @@ void WINAPI VXD_APM ( CONTEXT86 *context ) * * The offset is set the first time any application calls the GetVersion() * service of the Win32s VxD. (Note that the offset is never reset.) - * + * */ void WINAPI VXD_Win32s( CONTEXT86 *context ) @@ -552,25 +552,25 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) * * EDX: Debugging Flags * - * EDI: Error Flag + * EDI: Error Flag * 0 if OK, * 1 if VMCPD VxD not found */ TRACE("GetVersion()\n"); - + context->Eax = VXD_WinVersion() | (200 << 16); context->Ebx = 0; context->Ecx = 0; context->Edx = 0; context->Edi = 0; - /* + /* * If this is the first time we are called for this process, * hack the memory image of WIN32S16 so that it doesn't try * to access the GDT directly ... * - * The first code segment of WIN32S16 (version 1.30) contains + * The first code segment of WIN32S16 (version 1.30) contains * an unexported function somewhere between the exported functions * SetFS and StackLinearToSegmented that tries to find a selector * in the LDT that maps to the memory image of the LDT itself. @@ -615,7 +615,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) SEGPTR func1 = (SEGPTR)GetProcAddress16(hModule, "SetFS"); SEGPTR func2 = (SEGPTR)GetProcAddress16(hModule, "StackLinearToSegmented"); - if ( hModule && func1 && func2 + if ( hModule && func1 && func2 && SELECTOROF(func1) == SELECTOROF(func2)) { BYTE *start = MapSL(func1); @@ -634,7 +634,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) { TRACE("PERF130 hack: " "Replacing byte %02X at offset %04X:%04X\n", - *(retv+1), SELECTOROF(func1), + *(retv+1), SELECTOROF(func1), OFFSETOF(func1) + retv+1-start); *(retv+1) = (BYTE)0xCB; @@ -642,7 +642,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) } } - /* + /* * Mark process as Win32s, so that subsequent DPMI calls * will perform the W32S_APP2WINE/W32S_WINE2APP address shift. */ @@ -657,7 +657,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) * ECX: LoWord: Flat Code Selector * HiWord: Flat Data Selector * - * EDX: Flat address of W32SKRNL Exception Handler + * EDX: Flat address of W32SKRNL Exception Handler * (this is equal to W32S_BackTo32 + 0x40) * * ESI: SEGPTR KERNEL.HASGPHANDLER @@ -667,7 +667,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) * Output: EAX: 0 if OK */ - TRACE("[0001] EBX=%lx ECX=%lx EDX=%lx ESI=%lx EDI=%lx\n", + TRACE("[0001] EBX=%lx ECX=%lx EDX=%lx ESI=%lx EDI=%lx\n", context->Ebx, context->Ecx, context->Edx, context->Esi, context->Edi); @@ -690,7 +690,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) * Output: EAX: Size of area changed */ - TRACE("[0002] EBX=%lx ECX=%lx EDX=%lx\n", + TRACE("[0002] EBX=%lx ECX=%lx EDX=%lx\n", context->Ebx, context->Ecx, context->Edx); /* FIXME */ @@ -747,14 +747,14 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD relocDelta; }; - /* - * Note: This function should set up a demand-paged memory image + /* + * Note: This function should set up a demand-paged memory image * of the given module. Since mmap does not allow file offsets * not aligned at 1024 bytes, we simply load the image fully * into memory. */ - struct Win32sModule *moduleTable = + struct Win32sModule *moduleTable = (struct Win32sModule *)W32S_APP2WINE(context->Edx); struct Win32sModule *module = moduleTable + context->Ecx; @@ -767,8 +767,8 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) TRACE("MapModule: Loading %s\n", module->pathName); - for (i = 0; - !error && i < nt_header->FileHeader.NumberOfSections; + for (i = 0; + !error && i < nt_header->FileHeader.NumberOfSections; i++, pe_seg++) if(!(pe_seg->Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)) { @@ -777,14 +777,14 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) LPBYTE addr = module->baseAddr + pe_seg->VirtualAddress; TRACE("MapModule: " - "Section %d at %08lx from %08lx len %08lx\n", + "Section %d at %08lx from %08lx len %08lx\n", i, (DWORD)addr, off, len); if ( _llseek(image, off, SEEK_SET) != off || _lread(image, addr, len) != len) error = TRUE; } - + _lclose(image); if (error) @@ -805,7 +805,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) WORD *TypeOffset = (WORD *)(r + 1); int count = (r->SizeOfBlock - sizeof(*r)) / sizeof(*TypeOffset); - TRACE("MapModule: %d relocations for page %08lx\n", + TRACE("MapModule: %d relocations for page %08lx\n", count, (DWORD)page); for(i = 0; i < count; i++) @@ -814,7 +814,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) int type = TypeOffset[i] >> 12; switch(type) { - case IMAGE_REL_BASED_ABSOLUTE: + case IMAGE_REL_BASED_ABSOLUTE: break; case IMAGE_REL_BASED_HIGH: *(WORD *)(page+offset) += HIWORD(module->relocDelta); @@ -843,11 +843,11 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0005: /* UnMap Module */ /* - * Input: EDX: Flat address of module image + * Input: EDX: Flat address of module image * * Output: EAX: 1 if OK */ - + TRACE("UnMapModule: %lx\n", (DWORD)W32S_APP2WINE(context->Edx)); /* As we didn't map anything, there's nothing to unmap ... */ @@ -857,11 +857,11 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0006: /* VirtualAlloc */ - /* + /* * Input: ECX: Current Process * * EDX: Flat address of arguments on stack - * + * * DWORD *retv [out] Flat base address of allocated region * LPVOID base [in] Flat address of region to reserve/commit * DWORD size [in] Size of region @@ -879,7 +879,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD prot = stack[4]; DWORD result; - TRACE("VirtualAlloc(%lx, %lx, %lx, %lx, %lx)\n", + TRACE("VirtualAlloc(%lx, %lx, %lx, %lx, %lx)\n", (DWORD)retv, (DWORD)base, size, type, prot); if (type & 0x80000000) @@ -907,11 +907,11 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0007: /* VirtualFree */ - /* + /* * Input: ECX: Current Process * * EDX: Flat address of arguments on stack - * + * * DWORD *retv [out] TRUE if success, FALSE if failure * LPVOID base [in] Flat address of region * DWORD size [in] Size of region @@ -927,7 +927,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD type = stack[3]; DWORD result; - TRACE("VirtualFree(%lx, %lx, %lx, %lx)\n", + TRACE("VirtualFree(%lx, %lx, %lx, %lx)\n", (DWORD)retv, (DWORD)base, size, type); result = VirtualFree(base, size, type); @@ -943,11 +943,11 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0008: /* VirtualProtect */ - /* + /* * Input: ECX: Current Process * * EDX: Flat address of arguments on stack - * + * * DWORD *retv [out] TRUE if success, FALSE if failure * LPVOID base [in] Flat address of region * DWORD size [in] Size of region @@ -965,7 +965,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD *old_prot = (DWORD *)W32S_APP2WINE(stack[4]); DWORD result; - TRACE("VirtualProtect(%lx, %lx, %lx, %lx, %lx)\n", + TRACE("VirtualProtect(%lx, %lx, %lx, %lx, %lx)\n", (DWORD)retv, (DWORD)base, size, new_prot, (DWORD)old_prot); result = VirtualProtect(base, size, new_prot, old_prot); @@ -981,11 +981,11 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0009: /* VirtualQuery */ - /* + /* * Input: ECX: Current Process * * EDX: Flat address of arguments on stack - * + * * DWORD *retv [out] Nr. bytes returned * LPVOID base [in] Flat address of region * LPMEMORY_BASIC_INFORMATION info [out] Info buffer @@ -997,12 +997,12 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD *stack = (DWORD *)W32S_APP2WINE(context->Edx); DWORD *retv = (DWORD *)W32S_APP2WINE(stack[0]); LPVOID base = (LPVOID) W32S_APP2WINE(stack[1]); - LPMEMORY_BASIC_INFORMATION info = + LPMEMORY_BASIC_INFORMATION info = (LPMEMORY_BASIC_INFORMATION)W32S_APP2WINE(stack[2]); DWORD len = stack[3]; DWORD result; - TRACE("VirtualQuery(%lx, %lx, %lx, %lx)\n", + TRACE("VirtualQuery(%lx, %lx, %lx, %lx)\n", (DWORD)retv, (DWORD)base, (DWORD)info, len); result = VirtualQuery(base, info, len); @@ -1062,9 +1062,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x000D: /* NtCreateSection */ - /* + /* * Input: EDX: Flat address of arguments on stack - * + * * HANDLE32 *retv [out] Handle of Section created * DWORD flags1 [in] (?? unknown ??) * DWORD atom [in] Name of Section to create @@ -1098,9 +1098,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) { TRACE("NtCreateSection: name=%s\n", atom? name : NULL); - result = CreateFileMappingA(hFile, NULL, protect, - size? size->s.HighPart : 0, - size? size->s.LowPart : 0, + result = CreateFileMappingA(hFile, NULL, protect, + size? size->s.HighPart : 0, + size? size->s.LowPart : 0, atom? name : NULL); } @@ -1120,9 +1120,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x000E: /* NtOpenSection */ - /* + /* * Input: EDX: Flat address of arguments on stack - * + * * HANDLE32 *retv [out] Handle of Section opened * DWORD protect [in] Access protection * DWORD atom [in] Name of Section to create @@ -1138,7 +1138,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) HANDLE result = INVALID_HANDLE_VALUE; char name[128]; - TRACE("NtOpenSection(%lx, %lx, %lx)\n", + TRACE("NtOpenSection(%lx, %lx, %lx)\n", (DWORD)retv, protect, atom); if (atom && GlobalGetAtomNameA(atom, name, sizeof(name))) @@ -1164,9 +1164,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x000F: /* NtCloseSection */ - /* + /* * Input: EDX: Flat address of arguments on stack - * + * * HANDLE32 handle [in] Handle of Section to close * DWORD *id [out] Unique ID (?? unclear ??) * @@ -1188,9 +1188,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0010: /* NtDupSection */ - /* + /* * Input: EDX: Flat address of arguments on stack - * + * * HANDLE32 handle [in] Handle of Section to duplicate * * Output: EAX: NtStatus @@ -1201,7 +1201,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) HANDLE new_handle; TRACE("NtDupSection(%lx)\n", (DWORD)handle); - + DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(), &new_handle, 0, FALSE, DUPLICATE_SAME_ACCESS ); @@ -1211,9 +1211,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0011: /* NtMapViewOfSection */ - /* + /* * Input: EDX: Flat address of arguments on stack - * + * * HANDLE32 SectionHandle [in] Section to be mapped * DWORD ProcessHandle [in] Process to be mapped into * DWORD * BaseAddress [in/out] Address to be mapped at @@ -1257,16 +1257,16 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) TRACE("NtMapViewOfSection" "(%lx, %lx, %lx, %lx, %lx, %lx, %lx, %lx, %lx, %lx)\n", - (DWORD)SectionHandle, ProcessHandle, (DWORD)BaseAddress, + (DWORD)SectionHandle, ProcessHandle, (DWORD)BaseAddress, ZeroBits, CommitSize, (DWORD)SectionOffset, (DWORD)ViewSize, InheritDisposition, AllocationType, Protect); TRACE("NtMapViewOfSection: " - "base=%lx, offset=%lx, size=%lx, access=%lx\n", - (DWORD)address, SectionOffset? SectionOffset->s.LowPart : 0, + "base=%lx, offset=%lx, size=%lx, access=%lx\n", + (DWORD)address, SectionOffset? SectionOffset->s.LowPart : 0, ViewSize? *ViewSize : 0, access); - result = (DWORD)MapViewOfFileEx(SectionHandle, access, - SectionOffset? SectionOffset->s.HighPart : 0, + result = (DWORD)MapViewOfFileEx(SectionHandle, access, + SectionOffset? SectionOffset->s.HighPart : 0, SectionOffset? SectionOffset->s.LowPart : 0, ViewSize? *ViewSize : 0, address); @@ -1284,9 +1284,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0012: /* NtUnmapViewOfSection */ - /* + /* * Input: EDX: Flat address of arguments on stack - * + * * DWORD ProcessHandle [in] Process (defining address space) * LPBYTE BaseAddress [in] Base address of view to be unmapped * @@ -1297,7 +1297,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD ProcessHandle = stack[0]; /* ignored */ LPBYTE BaseAddress = (LPBYTE)W32S_APP2WINE(stack[1]); - TRACE("NtUnmapViewOfSection(%lx, %lx)\n", + TRACE("NtUnmapViewOfSection(%lx, %lx)\n", ProcessHandle, (DWORD)BaseAddress); UnmapViewOfFile(BaseAddress); @@ -1308,9 +1308,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0013: /* NtFlushVirtualMemory */ - /* + /* * Input: EDX: Flat address of arguments on stack - * + * * DWORD ProcessHandle [in] Process (defining address space) * LPBYTE *BaseAddress [in?] Base address of range to be flushed * DWORD *ViewSize [in?] Number of bytes to be flushed @@ -1324,14 +1324,14 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD *BaseAddress = (DWORD *)W32S_APP2WINE(stack[1]); DWORD *ViewSize = (DWORD *)W32S_APP2WINE(stack[2]); DWORD *unknown = (DWORD *)W32S_APP2WINE(stack[3]); - + LPBYTE address = (LPBYTE)(BaseAddress? W32S_APP2WINE(*BaseAddress) : 0); DWORD size = ViewSize? *ViewSize : 0; - TRACE("NtFlushVirtualMemory(%lx, %lx, %lx, %lx)\n", - ProcessHandle, (DWORD)BaseAddress, (DWORD)ViewSize, + TRACE("NtFlushVirtualMemory(%lx, %lx, %lx, %lx)\n", + ProcessHandle, (DWORD)BaseAddress, (DWORD)ViewSize, (DWORD)unknown); - TRACE("NtFlushVirtualMemory: base=%lx, size=%lx\n", + TRACE("NtFlushVirtualMemory: base=%lx, size=%lx\n", (DWORD)address, size); FlushViewOfFile(address, size); @@ -1352,7 +1352,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) * Output: None */ - FIXME("[0014] ECX=%lx EDX=%lx\n", + FIXME("[0014] ECX=%lx EDX=%lx\n", context->Ecx, context->Edx); /* FIXME */ @@ -1385,7 +1385,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) * HiWord: Paragraph of Win32s VxD PSP (DOSMEM) * Output: None */ - + if (context->Ebx == 0) context->Edx = 0x80; else @@ -1406,7 +1406,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) * Output: None */ - FIXME("[0017] EBX=%lx CX=%x\n", + FIXME("[0017] EBX=%lx CX=%x\n", context->Ebx, CX_reg(context)); /* FIXME */ @@ -1414,11 +1414,11 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0018: /* VirtualLock */ - /* + /* * Input: ECX: Current Process * * EDX: Flat address of arguments on stack - * + * * DWORD *retv [out] TRUE if success, FALSE if failure * LPVOID base [in] Flat address of range to lock * DWORD size [in] Size of range @@ -1432,7 +1432,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD size = stack[2]; DWORD result; - TRACE("VirtualLock(%lx, %lx, %lx)\n", + TRACE("VirtualLock(%lx, %lx, %lx)\n", (DWORD)retv, (DWORD)base, size); result = VirtualLock(base, size); @@ -1448,11 +1448,11 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x0019: /* VirtualUnlock */ - /* + /* * Input: ECX: Current Process * * EDX: Flat address of arguments on stack - * + * * DWORD *retv [out] TRUE if success, FALSE if failure * LPVOID base [in] Flat address of range to unlock * DWORD size [in] Size of range @@ -1466,7 +1466,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD size = stack[2]; DWORD result; - TRACE("VirtualUnlock(%lx, %lx, %lx)\n", + TRACE("VirtualUnlock(%lx, %lx, %lx)\n", (DWORD)retv, (DWORD)base, size); result = VirtualUnlock(base, size); @@ -1490,10 +1490,10 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) */ TRACE("KGetSystemInfo()\n"); - + /* - * Note: Win32s reserves 0GB - 2GB for Win 3.1 and uses 2GB - 4GB as - * sparse memory arena. We do it the other way around, since + * Note: Win32s reserves 0GB - 2GB for Win 3.1 and uses 2GB - 4GB as + * sparse memory arena. We do it the other way around, since * we have to reserve 3GB - 4GB for Linux, and thus use * 0GB - 3GB as sparse memory arena. * @@ -1523,7 +1523,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD SparseFree; /* Free size of sparse arena (bytes ?) */ }; - struct Win32sMemoryInfo *info = + struct Win32sMemoryInfo *info = (struct Win32sMemoryInfo *)W32S_APP2WINE(context->Esi); FIXME("KGlobalMemStat(%lx)\n", (DWORD)info); @@ -1547,9 +1547,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x001D: /* VirtualAlloc called from 16-bit code */ - /* + /* * Input: EDX: Segmented address of arguments on stack - * + * * LPVOID base [in] Flat address of region to reserve/commit * DWORD size [in] Size of region * DWORD type [in] Type of allocation @@ -1566,7 +1566,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD prot = stack[3]; DWORD result; - TRACE("VirtualAlloc16(%lx, %lx, %lx, %lx)\n", + TRACE("VirtualAlloc16(%lx, %lx, %lx, %lx)\n", (DWORD)base, size, type, prot); if (type & 0x80000000) @@ -1589,9 +1589,9 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) case 0x001E: /* VirtualFree called from 16-bit code */ - /* + /* * Input: EDX: Segmented address of arguments on stack - * + * * LPVOID base [in] Flat address of region * DWORD size [in] Size of region * DWORD type [in] Type of operation @@ -1606,7 +1606,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) DWORD type = stack[2]; DWORD result; - TRACE("VirtualFree16(%lx, %lx, %lx)\n", + TRACE("VirtualFree16(%lx, %lx, %lx)\n", (DWORD)base, size, type); result = VirtualFree(base, size, type); @@ -1633,7 +1633,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) { DWORD *ptr = (DWORD *)W32S_APP2WINE(context->Ecx); BOOL set = context->Edx; - + TRACE("FWorkingSetSize(%lx, %lx)\n", (DWORD)ptr, (DWORD)set); if (set) diff --git a/objects/bitmap.c b/objects/bitmap.c index 7b5e0a9183f..b57baed6087 100644 --- a/objects/bitmap.c +++ b/objects/bitmap.c @@ -93,7 +93,7 @@ HBITMAP16 WINAPI CreateUserBitmap16( INT16 width, INT16 height, UINT16 planes, /*********************************************************************** * CreateUserDiscardableBitmap (GDI.409) */ -HBITMAP16 WINAPI CreateUserDiscardableBitmap16( WORD dummy, +HBITMAP16 WINAPI CreateUserDiscardableBitmap16( WORD dummy, INT16 width, INT16 height ) { HDC hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL ); @@ -215,9 +215,9 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height) width, height ); } else { /* MS doc says if width or height is 0, return 1-by-1 pixel, monochrome bitmap */ - if (!width || !height) + if (!width || !height) hbmpRet = CreateBitmap( 1, 1, 1, 1, NULL ); - else + else hbmpRet = CreateBitmap( width, height, 1, dc->bitsPerPixel, NULL ); if (!BITMAP_SetOwnerDC( hbmpRet, dc )) @@ -268,7 +268,7 @@ LONG WINAPI GetBitmapBits16( HBITMAP16 hbitmap, LONG count, LPVOID buffer ) /*********************************************************************** * GetBitmapBits [GDI32.@] Copies bitmap bits of bitmap to buffer - * + * * RETURNS * Success: Number of bytes copied * Failure: 0 @@ -280,9 +280,9 @@ LONG WINAPI GetBitmapBits( { BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); LONG height, ret; - + if (!bmp) return 0; - + /* If the bits vector is null, the function should return the read size */ if(bits == NULL) { @@ -361,7 +361,7 @@ LONG WINAPI SetBitmapBits( { BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); LONG height, ret; - + if ((!bmp) || (!bits)) return 0; @@ -609,7 +609,7 @@ static INT BITMAP_GetObject16( HGDIOBJ handle, void *obj, INT count, LPVOID buff return count; } } - + /*********************************************************************** * BITMAP_GetObject @@ -639,7 +639,7 @@ static INT BITMAP_GetObject( HGDIOBJ handle, void *obj, INT count, LPVOID buffer return count; } } - + /*********************************************************************** * CreateDiscardableBitmap (GDI.156) diff --git a/objects/brush.c b/objects/brush.c index 16e107b3533..d46bd07751f 100644 --- a/objects/brush.c +++ b/objects/brush.c @@ -267,22 +267,22 @@ HBRUSH16 WINAPI CreateDIBPatternBrush16( HGLOBAL16 hbitmap, UINT16 coloruse ) * * Create a logical brush which has the pattern specified by the DIB * - * Function call is for compatibility only. CreateDIBPatternBrushPt should be used. + * Function call is for compatibility only. CreateDIBPatternBrushPt should be used. * * RETURNS * * Handle to a logical brush on success, NULL on failure. * * BUGS - * + * */ -HBRUSH WINAPI CreateDIBPatternBrush( +HBRUSH WINAPI CreateDIBPatternBrush( HGLOBAL hbitmap, /* [in] Global object containg BITMAPINFO structure */ UINT coloruse /* [in] Specifies color format, if provided */ ) { LOGBRUSH logbrush; - + TRACE("%04x\n", hbitmap ); logbrush.lbStyle = BS_DIBPATTERN; @@ -304,16 +304,16 @@ HBRUSH WINAPI CreateDIBPatternBrush( * Handle to a logical brush on success, NULL on failure. * * BUGS - * + * */ HBRUSH WINAPI CreateDIBPatternBrushPt( - const void* data, /* [in] Pointer to a BITMAPINFO structure followed by more data */ + const void* data, /* [in] Pointer to a BITMAPINFO structure followed by more data */ UINT coloruse /* [in] Specifies color format, if provided */ ) { BITMAPINFO *info=(BITMAPINFO*)data; LOGBRUSH logbrush; - + TRACE("%p %ldx%ld %dbpp\n", info, info->bmiHeader.biWidth, info->bmiHeader.biHeight, info->bmiHeader.biBitCount); diff --git a/objects/clipping.c b/objects/clipping.c index 00511190034..d9af64c40e2 100644 --- a/objects/clipping.c +++ b/objects/clipping.c @@ -107,12 +107,12 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode ) } else { - FIXME("Unimplemented: hrgn NULL in mode: %d\n", fnMode); + FIXME("Unimplemented: hrgn NULL in mode: %d\n", fnMode); GDI_ReleaseObj( hdc ); return ERROR; } } - else + else { if (!dc->hClipRgn) { @@ -194,7 +194,7 @@ INT16 WINAPI OffsetVisRgn16( HDC16 hdc, INT16 x, INT16 y ) { INT16 retval; DC * dc = DC_GetDCUpdate( hdc ); - if (!dc) return ERROR; + if (!dc) return ERROR; TRACE("%04x %d,%d\n", hdc, x, y ); retval = OffsetRgn( dc->hVisRgn, x, y ); CLIPPING_UpdateGCRegion( dc ); @@ -388,7 +388,7 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y ) if (!dc) return FALSE; if (dc->hGCClipRgn) { - ret = PtInRegion( dc->hGCClipRgn, XLPTODP(dc,x) + dc->DCOrgX, + ret = PtInRegion( dc->hGCClipRgn, XLPTODP(dc,x) + dc->DCOrgX, YLPTODP(dc,y) + dc->DCOrgY ); } GDI_ReleaseObj( hdc ); @@ -484,7 +484,7 @@ INT WINAPI GetClipRgn( HDC hdc, HRGN hRgn ) if (hRgn && (dc = DC_GetDCPtr( hdc ))) { if( dc->hClipRgn ) - { + { /* this assumes that dc->hClipRgn is in coordinates relative to the device (not DC origin) */ @@ -522,7 +522,7 @@ HRGN16 WINAPI SaveVisRgn16( HDC16 hdc ) GDI_ReleaseObj( dc->hVisRgn ); GDI_ReleaseObj( hdc ); return 0; - } + } CombineRgn( copy, dc->hVisRgn, 0, RGN_COPY ); if (!(copyObj = GDI_GetObjPtr( copy, REGION_MAGIC ))) { diff --git a/objects/color.c b/objects/color.c index 311a926773c..2df9d01c952 100644 --- a/objects/color.c +++ b/objects/color.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette); /*********************************************************************** - * System color space. + * System color space. * * First 10 and last 10 colors in COLOR_sysPalette are * "guarded". RealizePalette changes only the rest of colorcells. For @@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette); PALETTEENTRY *COLOR_sysPal = NULL; /* current system palette */ -const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] = +const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] = { /* first 10 entries in the system palette */ /* red green blue flags */ @@ -148,7 +148,7 @@ COLORREF COLOR_LookupNearestColor( PALETTEENTRY* palPalEntry, int size, COLORREF else if( spec_type == 1 ) /* PALETTEINDEX */ { - if( (i = color & 0x0000ffff) >= size ) + if( (i = color & 0x0000ffff) >= size ) { WARN("RGB(%lx) : idx %d is out of bounds, assuming NULL\n", color, i); color = *(COLORREF*)palPalEntry; diff --git a/objects/dc.c b/objects/dc.c index 6a0e78831b3..e06d67eced6 100644 --- a/objects/dc.c +++ b/objects/dc.c @@ -212,7 +212,7 @@ void DC_InitDC( DC* dc ) static BOOL DC_InvertXform( const XFORM *xformSrc, XFORM *xformDest ) { FLOAT determinant; - + determinant = xformSrc->eM11*xformSrc->eM22 - xformSrc->eM12*xformSrc->eM21; if (determinant > -1e-12 && determinant < 1e-12) @@ -245,7 +245,7 @@ void DC_UpdateXforms( DC *dc ) { XFORM xformWnd2Vport; FLOAT scaleX, scaleY; - + /* Construct a transformation to do the window-to-viewport conversion */ scaleX = (FLOAT)dc->vportExtX / (FLOAT)dc->wndExtX; scaleY = (FLOAT)dc->vportExtY / (FLOAT)dc->wndExtY; @@ -275,7 +275,7 @@ HDC16 WINAPI GetDCState16( HDC16 hdc ) { DC * newdc, * dc; HGDIOBJ handle; - + if (!(dc = DC_GetDCPtr( hdc ))) return 0; if (!(newdc = GDI_AllocObject( sizeof(DC), DC_MAGIC, &handle, &dc_funcs ))) { @@ -285,12 +285,12 @@ HDC16 WINAPI GetDCState16( HDC16 hdc ) TRACE("(%04x): returning %04x\n", hdc, handle ); newdc->flags = dc->flags | DC_SAVED; - newdc->hPen = dc->hPen; - newdc->hBrush = dc->hBrush; - newdc->hFont = dc->hFont; - newdc->hBitmap = dc->hBitmap; + newdc->hPen = dc->hPen; + newdc->hBrush = dc->hBrush; + newdc->hFont = dc->hFont; + newdc->hBitmap = dc->hBitmap; newdc->hDevice = dc->hDevice; - newdc->hPalette = dc->hPalette; + newdc->hPalette = dc->hPalette; newdc->totalExtent = dc->totalExtent; newdc->bitsPerPixel = dc->bitsPerPixel; newdc->ROPmode = dc->ROPmode; @@ -335,7 +335,7 @@ HDC16 WINAPI GetDCState16( HDC16 hdc ) newdc->saveLevel = 0; PATH_InitGdiPath( &newdc->path ); - + newdc->pAbortProc = NULL; newdc->hookThunk = NULL; newdc->hookProc = 0; @@ -538,7 +538,7 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level ) } if (level == -1) level = dc->saveLevel; - if ((level < 1) + if ((level < 1) /* This pair of checks disagrees with MSDN "Platform SDK: Windows GDI" July 2000 which says all negative values for level will be interpreted as an instance relative @@ -549,7 +549,7 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level ) GDI_ReleaseObj( hdc ); return FALSE; } - + success=TRUE; while (dc->saveLevel >= level) { @@ -558,7 +558,7 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level ) { GDI_ReleaseObj( hdc ); return FALSE; - } + } dc->header.hNext = dcs->header.hNext; if (--dc->saveLevel < level) { @@ -646,7 +646,7 @@ HDC WINAPI CreateDCA( LPCSTR driver, LPCSTR device, LPCSTR output, */ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output, const DEVMODEW *initData ) -{ +{ LPSTR driverA = HEAP_strdupWtoA( GetProcessHeap(), 0, driver ); LPSTR deviceA = HEAP_strdupWtoA( GetProcessHeap(), 0, device ); LPSTR outputA = HEAP_strdupWtoA( GetProcessHeap(), 0, output ); @@ -811,7 +811,7 @@ BOOL WINAPI DeleteDC( HDC hdc ) PATH_DestroyGdiPath(&dcs->path); GDI_FreeObject( hdcs, dcs ); } - + if (!(dc->flags & DC_SAVED)) { SelectObject( hdc, GetStockObject(BLACK_PEN) ); @@ -1017,7 +1017,7 @@ DWORD WINAPI GetDCOrg16( HDC16 hdc ) { POINT pt; if( GetDCOrgEx( hdc, &pt) ) - return MAKELONG( (WORD)pt.x, (WORD)pt.y ); + return MAKELONG( (WORD)pt.x, (WORD)pt.y ); return 0; } @@ -1215,7 +1215,7 @@ BOOL WINAPI CombineTransform( LPXFORM xformResult, const XFORM *xform1, const XFORM *xform2 ) { XFORM xformTemp; - + /* Check for illegal parameters */ if (!xformResult || !xform1 || !xform2) return FALSE; @@ -1387,7 +1387,7 @@ HCOLORSPACE WINAPI GetColorSpace(HDC hdc) HCOLORSPACE WINAPI CreateColorSpaceA( LPLOGCOLORSPACEA lpLogColorSpace ) { FIXME( "stub\n" ); - return 0; + return 0; } /*********************************************************************** @@ -1405,7 +1405,7 @@ HCOLORSPACE WINAPI CreateColorSpaceW( LPLOGCOLORSPACEW lpLogColorSpace ) BOOL WINAPI DeleteColorSpace( HCOLORSPACE hColorSpace ) { FIXME( "stub\n" ); - + return TRUE; } @@ -1435,7 +1435,7 @@ UINT WINAPI GetBoundsRect(HDC hdc, LPRECT rect, UINT flags) FIXME("(): stub\n"); return DCB_RESET; /* bounding rectangle always empty */ } - + /*********************************************************************** * SetBoundsRect (GDI.193) */ diff --git a/objects/dib.c b/objects/dib.c index e4962efb526..b8490aca9a9 100644 --- a/objects/dib.c +++ b/objects/dib.c @@ -191,7 +191,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, /* when RLE compression is used, there may be some gaps (ie the DIB doesn't * contain all the rectangle described in bmiHeader, but only part of it. * This mean that those undescribed pixels must be left untouched. - * So, we first copy on a memory bitmap the current content of the + * So, we first copy on a memory bitmap the current content of the * destination rectangle, blit the DIB bits on top of it - hence leaving * the gaps untouched -, and blitting the rectangle back. * This insure that gaps are untouched on the destination rectangle @@ -202,17 +202,17 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, * pStretchDIBits function shall be implemented. * ericP (2000/09/09) */ - hBitmap = CreateCompatibleBitmap(hdc, info->bmiHeader.biWidth, + hBitmap = CreateCompatibleBitmap(hdc, info->bmiHeader.biWidth, info->bmiHeader.biHeight); hOldBitmap = SelectObject( hdcMem, hBitmap ); - + /* copy existing bitmap from destination dc */ StretchBlt( hdcMem, xSrc, abs(info->bmiHeader.biHeight) - heightSrc - ySrc, widthSrc, heightSrc, hdc, xDst, yDst, widthDst, heightDst, dwRop ); - SetDIBits(hdcMem, hBitmap, 0, info->bmiHeader.biHeight, bits, - info, DIB_RGB_COLORS); - + SetDIBits(hdcMem, hBitmap, 0, info->bmiHeader.biHeight, bits, + info, DIB_RGB_COLORS); + } else { hBitmap = CreateDIBitmap( hdc, &info->bmiHeader, CBM_INIT, bits, info, wUsage ); @@ -222,7 +222,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, /* Origin for DIBitmap may be bottom left (positive biHeight) or top left (negative biHeight) */ StretchBlt( hdc, xDst, yDst, widthDst, heightDst, - hdcMem, xSrc, abs(info->bmiHeader.biHeight) - heightSrc - ySrc, + hdcMem, xSrc, abs(info->bmiHeader.biHeight) - heightSrc - ySrc, widthSrc, heightSrc, dwRop ); SelectObject( hdcMem, hOldBitmap ); DeleteDC( hdcMem ); @@ -388,7 +388,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col NB. RGBQUAD and PALETTEENTRY have different orderings of red, green and blue - sigh */ -static RGBQUAD EGAColors[16] = { +static RGBQUAD EGAColors[16] = { /* rgbBlue, rgbGreen, rgbRed, rgbReserverd */ { 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x80, 0x00 }, @@ -706,7 +706,7 @@ INT WINAPI GetDIBits( for( y = 0; y < lines; y++) { for( x = 0; x < srcwidth; x++, srcbits+=3 ) - *dstbits++ = ((DWORD)*srcbits) & 0x00ffffff; + *dstbits++ = ((DWORD)*srcbits) & 0x00ffffff; dstbits=(LPDWORD)(dbits+=dstwidthb); srcbits=(sbits+=srcwidthb); } @@ -748,7 +748,7 @@ INT WINAPI GetDIBits( } } } - else if( info->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER) ) + else if( info->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER) ) { /* fill in struct members */ @@ -758,7 +758,7 @@ INT WINAPI GetDIBits( info->bmiHeader.biHeight = bmp->bitmap.bmHeight; info->bmiHeader.biPlanes = 1; info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel; - info->bmiHeader.biSizeImage = + info->bmiHeader.biSizeImage = DIB_GetDIBImageBytes( bmp->bitmap.bmWidth, bmp->bitmap.bmHeight, bmp->bitmap.bmBitsPixel ); @@ -828,7 +828,7 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, RGBQUAD *rgb = data->bmiColors; DWORD col = RGB( rgb->rgbRed, rgb->rgbGreen, rgb->rgbBlue ); - /* Check if the first color of the colormap is black */ + /* Check if the first color of the colormap is black */ if ((col == RGB(0,0,0))) { rgb++; @@ -836,9 +836,9 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, /* If the second color is white, create a monochrome bitmap */ fColor = (col != RGB(0xff,0xff,0xff)); } - /* Note : If the first color of the colormap is white - followed by black, we have to create a color bitmap. - If we don't the white will be displayed in black later on!*/ + /* Note : If the first color of the colormap is white + followed by black, we have to create a color bitmap. + If we don't the white will be displayed in black later on!*/ else fColor = TRUE; } else if (data->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) @@ -858,7 +858,7 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, RGBQUAD *rgb = data->bmiColors; DWORD col = RGB( rgb->rgbRed, rgb->rgbGreen, rgb->rgbBlue ); - /* Check if the first color of the colormap is black */ + /* Check if the first color of the colormap is black */ if ((col == RGB(0,0,0))) { rgb++; @@ -866,9 +866,9 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, /* If the second color is white, create a monochrome bitmap */ fColor = (col != RGB(0xff,0xff,0xff)); } - /* Note : If the first color of the colormap is white - followed by black, we have to create a color bitmap. - If we don't the white will be displayed in black later on!*/ + /* Note : If the first color of the colormap is white + followed by black, we have to create a color bitmap. + If we don't the white will be displayed in black later on!*/ else fColor = TRUE; } else @@ -1003,7 +1003,7 @@ HGLOBAL DIB_CreateDIBFromBitmap(HDC hdc, HBITMAP hBmp) width = pBmp->bitmap.bmWidth; height = pBmp->bitmap.bmHeight; depth = pBmp->bitmap.bmBitsPixel; - + /* * A packed DIB contains a BITMAPINFO structure followed immediately by * an optional color palette and the pixel data. @@ -1026,7 +1026,7 @@ HGLOBAL DIB_CreateDIBFromBitmap(HDC hdc, HBITMAP hBmp) WARN("Could not allocate packed DIB!\n"); goto END; } - + /* A packed DIB starts with a BITMAPINFOHEADER */ pPackedDIB = (LPBYTE)GlobalLock(hPackedDIB); pbmiHeader = (LPBITMAPINFOHEADER)pPackedDIB; @@ -1045,7 +1045,7 @@ HGLOBAL DIB_CreateDIBFromBitmap(HDC hdc, HBITMAP hBmp) /* Retrieve the DIB bits from the bitmap and fill in the * DIB color table if present */ - + nLinesCopied = GetDIBits(hdc, /* Handle to device context */ hBmp, /* Handle to bitmap */ 0, /* First scan line to set in dest bitmap */ diff --git a/objects/enhmetafile.c b/objects/enhmetafile.c index 065d1f1e9e1..aa4d9fbc2c7 100644 --- a/objects/enhmetafile.c +++ b/objects/enhmetafile.c @@ -1,7 +1,7 @@ /* * Enhanced metafile functions * Copyright 1998 Douglas Ridgway - * 1999 Huw D M Davies + * 1999 Huw D M Davies * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,17 +19,17 @@ * * NOTES: * - * The enhanced format consists of the following elements: + * The enhanced format consists of the following elements: * - * A header - * A table of handles to GDI objects - * An array of metafile records - * A private palette + * A header + * A table of handles to GDI objects + * An array of metafile records + * A private palette * - * - * The standard format consists of a header and an array of metafile records. * - */ + * The standard format consists of a header and an array of metafile records. + * + */ #include "config.h" #include "wine/port.h" @@ -112,7 +112,7 @@ static HENHMETAFILE EMF_GetEnhMetaFile( HANDLE hFile ) { ENHMETAHEADER *emh; HANDLE hMapping; - + hMapping = CreateFileMappingA( hFile, NULL, PAGE_READONLY, 0, 0, NULL ); emh = MapViewOfFile( hMapping, FILE_MAP_READ, 0, 0, 0 ); CloseHandle( hMapping ); @@ -134,7 +134,7 @@ static HENHMETAFILE EMF_GetEnhMetaFile( HANDLE hFile ) * * */ -HENHMETAFILE WINAPI GetEnhMetaFileA( +HENHMETAFILE WINAPI GetEnhMetaFileA( LPCSTR lpszMetaFile /* [in] filename of enhanced metafile */ ) { @@ -156,7 +156,7 @@ HENHMETAFILE WINAPI GetEnhMetaFileA( * GetEnhMetaFileW (GDI32.@) */ HENHMETAFILE WINAPI GetEnhMetaFileW( - LPCWSTR lpszMetaFile) /* [in] filename of enhanced metafile */ + LPCWSTR lpszMetaFile) /* [in] filename of enhanced metafile */ { HENHMETAFILE hmf; HANDLE hFile; @@ -176,13 +176,13 @@ HENHMETAFILE WINAPI GetEnhMetaFileW( * GetEnhMetaFileHeader (GDI32.@) * * If buf is NULL, returns the size of buffer required. - * Otherwise, copy up to bufsize bytes of enhanced metafile header into + * Otherwise, copy up to bufsize bytes of enhanced metafile header into * buf. */ -UINT WINAPI GetEnhMetaFileHeader( +UINT WINAPI GetEnhMetaFileHeader( HENHMETAFILE hmf, /* [in] enhanced metafile */ UINT bufsize, /* [in] size of buffer */ - LPENHMETAHEADER buf /* [out] buffer */ + LPENHMETAHEADER buf /* [out] buffer */ ) { LPENHMETAHEADER emh; @@ -201,9 +201,9 @@ UINT WINAPI GetEnhMetaFileHeader( /***************************************************************************** * GetEnhMetaFileDescriptionA (GDI32.@) */ -UINT WINAPI GetEnhMetaFileDescriptionA( +UINT WINAPI GetEnhMetaFileDescriptionA( HENHMETAFILE hmf, /* [in] enhanced metafile */ - UINT size, /* [in] size of buf */ + UINT size, /* [in] size of buf */ LPSTR buf /* [out] buffer to receive description */ ) { @@ -226,15 +226,15 @@ UINT WINAPI GetEnhMetaFileDescriptionA( /***************************************************************************** * GetEnhMetaFileDescriptionW (GDI32.@) * - * Copies the description string of an enhanced metafile into a buffer + * Copies the description string of an enhanced metafile into a buffer * _buf_. * * If _buf_ is NULL, returns size of _buf_ required. Otherwise, returns * number of characters copied. */ -UINT WINAPI GetEnhMetaFileDescriptionW( +UINT WINAPI GetEnhMetaFileDescriptionW( HENHMETAFILE hmf, /* [in] enhanced metafile */ - UINT size, /* [in] size of buf */ + UINT size, /* [in] size of buf */ LPWSTR buf /* [out] buffer to receive description */ ) { @@ -265,10 +265,10 @@ HENHMETAFILE WINAPI SetEnhMetaFileBits(UINT bufsize, const BYTE *buf) * */ UINT WINAPI GetEnhMetaFileBits( - HENHMETAFILE hmf, - UINT bufsize, - LPBYTE buf -) + HENHMETAFILE hmf, + UINT bufsize, + LPBYTE buf +) { LPENHMETAHEADER emh = EMF_GetEnhMetaHeader( hmf ); UINT size; @@ -294,23 +294,23 @@ UINT WINAPI GetEnhMetaFileBits( * Many unimplemented records. * No error handling on record play failures (ie checking return codes) */ -BOOL WINAPI PlayEnhMetaFileRecord( +BOOL WINAPI PlayEnhMetaFileRecord( HDC hdc, /* [in] device context in which to render EMF record */ LPHANDLETABLE handletable, /* [in] array of handles to be used in rendering record */ const ENHMETARECORD *mr, /* [in] EMF record to render */ UINT handles /* [in] size of handle array */ - ) + ) { int type; TRACE( - "hdc = %08x, handletable = %p, record = %p, numHandles = %d\n", + "hdc = %08x, handletable = %p, record = %p, numHandles = %d\n", hdc, handletable, mr, handles); if (!mr) return FALSE; type = mr->iType; TRACE(" type=%d\n", type); - switch(type) + switch(type) { case EMR_HEADER: break; @@ -322,7 +322,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( /* In an enhanced metafile, there can be both public and private GDI comments */ GdiComment( hdc, lpGdiComment->cbData, lpGdiComment->Data ); break; - } + } case EMR_SETMAPMODE: { PEMRSETMAPMODE pSetMapMode = (PEMRSETMAPMODE) mr; @@ -451,7 +451,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_CREATEPEN: { PEMRCREATEPEN pCreatePen = (PEMRCREATEPEN) mr; - (handletable->objectHandle)[pCreatePen->ihPen] = + (handletable->objectHandle)[pCreatePen->ihPen] = CreatePenIndirect(&pCreatePen->lopn); break; } @@ -466,22 +466,22 @@ BOOL WINAPI PlayEnhMetaFileRecord( if(pPen->offBmi || pPen->offBits) FIXME("EMR_EXTCREATEPEN: Need to copy brush bitmap\n"); - (handletable->objectHandle)[pPen->ihPen] = - ExtCreatePen(pPen->elp.elpPenStyle, pPen->elp.elpWidth, &lb, + (handletable->objectHandle)[pPen->ihPen] = + ExtCreatePen(pPen->elp.elpPenStyle, pPen->elp.elpWidth, &lb, pPen->elp.elpNumEntries, pPen->elp.elpStyleEntry); break; } case EMR_CREATEBRUSHINDIRECT: { PEMRCREATEBRUSHINDIRECT pBrush = (PEMRCREATEBRUSHINDIRECT) mr; - (handletable->objectHandle)[pBrush->ihBrush] = + (handletable->objectHandle)[pBrush->ihBrush] = CreateBrushIndirect(&pBrush->lb); break; } case EMR_EXTCREATEFONTINDIRECTW: { PEMREXTCREATEFONTINDIRECTW pFont = (PEMREXTCREATEFONTINDIRECTW) mr; - (handletable->objectHandle)[pFont->ihFont] = + (handletable->objectHandle)[pFont->ihFont] = CreateFontIndirectW(&pFont->elfw.elfLogFont); break; } @@ -667,7 +667,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( { PEMRCREATEPALETTE lpCreatePal = (PEMRCREATEPALETTE)mr; - (handletable->objectHandle)[ lpCreatePal->ihPal ] = + (handletable->objectHandle)[ lpCreatePal->ihPal ] = CreatePalette( &lpCreatePal->lgpl ); break; @@ -717,7 +717,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_POLYBEZIER: { - PEMRPOLYBEZIER lpPolyBez = (PEMRPOLYBEZIER)mr; + PEMRPOLYBEZIER lpPolyBez = (PEMRPOLYBEZIER)mr; PolyBezier(hdc, (const LPPOINT)lpPolyBez->aptl, (UINT)lpPolyBez->cptl); break; } @@ -733,7 +733,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( { PEMRPOLYLINE lpPolyLine = (PEMRPOLYLINE)mr; Polyline(hdc, (const LPPOINT)lpPolyLine->aptl, (UINT)lpPolyLine->cptl); - break; + break; } case EMR_POLYBEZIERTO: @@ -741,7 +741,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( PEMRPOLYBEZIERTO lpPolyBezierTo = (PEMRPOLYBEZIERTO)mr; PolyBezierTo( hdc, (const LPPOINT)lpPolyBezierTo->aptl, (UINT)lpPolyBezierTo->cptl ); - break; + break; } case EMR_POLYLINETO: @@ -758,9 +758,9 @@ BOOL WINAPI PlayEnhMetaFileRecord( /* NB Points at pPolyPolyline->aPolyCounts + pPolyPolyline->nPolys */ PolyPolyline(hdc, (LPPOINT)(pPolyPolyline->aPolyCounts + - pPolyPolyline->nPolys), - pPolyPolyline->aPolyCounts, - pPolyPolyline->nPolys ); + pPolyPolyline->nPolys), + pPolyPolyline->aPolyCounts, + pPolyPolyline->nPolys ); break; } @@ -781,21 +781,21 @@ BOOL WINAPI PlayEnhMetaFileRecord( { PEMRSETBRUSHORGEX lpSetBrushOrgEx = (PEMRSETBRUSHORGEX)mr; - SetBrushOrgEx( hdc, - (INT)lpSetBrushOrgEx->ptlOrigin.x, - (INT)lpSetBrushOrgEx->ptlOrigin.y, + SetBrushOrgEx( hdc, + (INT)lpSetBrushOrgEx->ptlOrigin.x, + (INT)lpSetBrushOrgEx->ptlOrigin.y, NULL ); break; } - + case EMR_SETPIXELV: { PEMRSETPIXELV lpSetPixelV = (PEMRSETPIXELV)mr; - SetPixelV( hdc, - (INT)lpSetPixelV->ptlPixel.x, - (INT)lpSetPixelV->ptlPixel.y, + SetPixelV( hdc, + (INT)lpSetPixelV->ptlPixel.x, + (INT)lpSetPixelV->ptlPixel.y, lpSetPixelV->crColor ); break; @@ -804,7 +804,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_SETMAPPERFLAGS: { PEMRSETMAPPERFLAGS lpSetMapperFlags = (PEMRSETMAPPERFLAGS)mr; - + SetMapperFlags( hdc, lpSetMapperFlags->dwFlags ); break; @@ -812,7 +812,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_SETCOLORADJUSTMENT: { - PEMRSETCOLORADJUSTMENT lpSetColorAdjust = (PEMRSETCOLORADJUSTMENT)mr; + PEMRSETCOLORADJUSTMENT lpSetColorAdjust = (PEMRSETCOLORADJUSTMENT)mr; SetColorAdjustment( hdc, &lpSetColorAdjust->ColorAdjustment ); @@ -823,21 +823,21 @@ BOOL WINAPI PlayEnhMetaFileRecord( { PEMROFFSETCLIPRGN lpOffsetClipRgn = (PEMROFFSETCLIPRGN)mr; - OffsetClipRgn( hdc, + OffsetClipRgn( hdc, (INT)lpOffsetClipRgn->ptlOffset.x, (INT)lpOffsetClipRgn->ptlOffset.y ); break; - } + } case EMR_EXCLUDECLIPRECT: { PEMREXCLUDECLIPRECT lpExcludeClipRect = (PEMREXCLUDECLIPRECT)mr; - ExcludeClipRect( hdc, - lpExcludeClipRect->rclClip.left, - lpExcludeClipRect->rclClip.top, - lpExcludeClipRect->rclClip.right, + ExcludeClipRect( hdc, + lpExcludeClipRect->rclClip.left, + lpExcludeClipRect->rclClip.top, + lpExcludeClipRect->rclClip.right, lpExcludeClipRect->rclClip.bottom ); break; @@ -847,16 +847,16 @@ BOOL WINAPI PlayEnhMetaFileRecord( { PEMRSCALEVIEWPORTEXTEX lpScaleViewportExtEx = (PEMRSCALEVIEWPORTEXTEX)mr; - ScaleViewportExtEx( hdc, + ScaleViewportExtEx( hdc, lpScaleViewportExtEx->xNum, lpScaleViewportExtEx->xDenom, lpScaleViewportExtEx->yNum, lpScaleViewportExtEx->yDenom, NULL ); - + break; } - + case EMR_SCALEWINDOWEXTEX: { PEMRSCALEWINDOWEXTEX lpScaleWindowExtEx = (PEMRSCALEWINDOWEXTEX)mr; @@ -865,7 +865,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( lpScaleWindowExtEx->xNum, lpScaleWindowExtEx->xDenom, lpScaleWindowExtEx->yNum, - lpScaleWindowExtEx->yDenom, + lpScaleWindowExtEx->yDenom, NULL ); break; @@ -883,21 +883,21 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_ANGLEARC: { - PEMRANGLEARC lpAngleArc = (PEMRANGLEARC)mr; + PEMRANGLEARC lpAngleArc = (PEMRANGLEARC)mr; - AngleArc( hdc, + AngleArc( hdc, (INT)lpAngleArc->ptlCenter.x, (INT)lpAngleArc->ptlCenter.y, - lpAngleArc->nRadius, lpAngleArc->eStartAngle, + lpAngleArc->nRadius, lpAngleArc->eStartAngle, lpAngleArc->eSweepAngle ); break; } - - case EMR_ROUNDRECT: + + case EMR_ROUNDRECT: { PEMRROUNDRECT lpRoundRect = (PEMRROUNDRECT)mr; - RoundRect( hdc, + RoundRect( hdc, lpRoundRect->rclBox.left, lpRoundRect->rclBox.top, lpRoundRect->rclBox.right, @@ -905,24 +905,24 @@ BOOL WINAPI PlayEnhMetaFileRecord( lpRoundRect->szlCorner.cx, lpRoundRect->szlCorner.cy ); - break; + break; } case EMR_ARC: { PEMRARC lpArc = (PEMRARC)mr; - Arc( hdc, + Arc( hdc, (INT)lpArc->rclBox.left, (INT)lpArc->rclBox.top, (INT)lpArc->rclBox.right, (INT)lpArc->rclBox.bottom, - (INT)lpArc->ptlStart.x, + (INT)lpArc->ptlStart.x, (INT)lpArc->ptlStart.y, (INT)lpArc->ptlEnd.x, (INT)lpArc->ptlEnd.y ); - break; + break; } case EMR_CHORD: @@ -959,7 +959,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( break; } - case EMR_ARCTO: + case EMR_ARCTO: { PEMRARC lpArcTo = (PEMRARC)mr; @@ -980,7 +980,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( { PEMREXTFLOODFILL lpExtFloodFill = (PEMREXTFLOODFILL)mr; - ExtFloodFill( hdc, + ExtFloodFill( hdc, (INT)lpExtFloodFill->ptlStart.x, (INT)lpExtFloodFill->ptlStart.y, lpExtFloodFill->crColor, @@ -992,13 +992,13 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_POLYDRAW: { PEMRPOLYDRAW lpPolyDraw = (PEMRPOLYDRAW)mr; - PolyDraw( hdc, + PolyDraw( hdc, (const LPPOINT)lpPolyDraw->aptl, lpPolyDraw->abTypes, (INT)lpPolyDraw->cptl ); - + break; - } + } case EMR_SETARCDIRECTION: { @@ -1012,7 +1012,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( PEMRSETMITERLIMIT lpSetMiterLimit = (PEMRSETMITERLIMIT)mr; SetMiterLimit( hdc, lpSetMiterLimit->eMiterLimit, NULL ); break; - } + } case EMR_BEGINPATH: { @@ -1020,7 +1020,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( break; } - case EMR_ENDPATH: + case EMR_ENDPATH: { EndPath( hdc ); break; @@ -1055,7 +1055,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_FLATTENPATH: { - FlattenPath( hdc ); + FlattenPath( hdc ); break; } @@ -1071,7 +1071,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( SelectClipPath( hdc, (INT)lpSelectClipPath->iMode ); break; } - + case EMR_ABORTPATH: { AbortPath( hdc ); @@ -1081,15 +1081,15 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_CREATECOLORSPACE: { PEMRCREATECOLORSPACE lpCreateColorSpace = (PEMRCREATECOLORSPACE)mr; - (handletable->objectHandle)[lpCreateColorSpace->ihCS] = - CreateColorSpaceA( &lpCreateColorSpace->lcs ); + (handletable->objectHandle)[lpCreateColorSpace->ihCS] = + CreateColorSpaceA( &lpCreateColorSpace->lcs ); break; } case EMR_SETCOLORSPACE: { - PEMRSETCOLORSPACE lpSetColorSpace = (PEMRSETCOLORSPACE)mr; - SetColorSpace( hdc, + PEMRSETCOLORSPACE lpSetColorSpace = (PEMRSETCOLORSPACE)mr; + SetColorSpace( hdc, (handletable->objectHandle)[lpSetColorSpace->ihCS] ); break; } @@ -1098,7 +1098,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( { PEMRDELETECOLORSPACE lpDeleteColorSpace = (PEMRDELETECOLORSPACE)mr; DeleteColorSpace( (handletable->objectHandle)[lpDeleteColorSpace->ihCS] ); - break; + break; } case EMR_SETICMMODE: @@ -1108,26 +1108,26 @@ BOOL WINAPI PlayEnhMetaFileRecord( break; } - case EMR_PIXELFORMAT: + case EMR_PIXELFORMAT: { INT iPixelFormat; PEMRPIXELFORMAT lpPixelFormat = (PEMRPIXELFORMAT)mr; iPixelFormat = ChoosePixelFormat( hdc, &lpPixelFormat->pfd ); - SetPixelFormat( hdc, iPixelFormat, &lpPixelFormat->pfd ); - + SetPixelFormat( hdc, iPixelFormat, &lpPixelFormat->pfd ); + break; } - case EMR_SETPALETTEENTRIES: + case EMR_SETPALETTEENTRIES: { PEMRSETPALETTEENTRIES lpSetPaletteEntries = (PEMRSETPALETTEENTRIES)mr; SetPaletteEntries( (handletable->objectHandle)[lpSetPaletteEntries->ihPal], (UINT)lpSetPaletteEntries->iStart, (UINT)lpSetPaletteEntries->cEntries, - lpSetPaletteEntries->aPalEntries ); - + lpSetPaletteEntries->aPalEntries ); + break; } @@ -1146,22 +1146,22 @@ BOOL WINAPI PlayEnhMetaFileRecord( PEMRCREATEDIBPATTERNBRUSHPT lpCreate = (PEMRCREATEDIBPATTERNBRUSHPT)mr; /* This is a BITMAPINFO struct followed directly by bitmap bits */ - LPVOID lpPackedStruct = HeapAlloc( GetProcessHeap(), - 0, + LPVOID lpPackedStruct = HeapAlloc( GetProcessHeap(), + 0, lpCreate->cbBmi + lpCreate->cbBits ); /* Now pack this structure */ - memcpy( lpPackedStruct, + memcpy( lpPackedStruct, ((BYTE*)lpCreate) + lpCreate->offBmi, - lpCreate->cbBmi ); + lpCreate->cbBmi ); memcpy( ((BYTE*)lpPackedStruct) + lpCreate->cbBmi, ((BYTE*)lpCreate) + lpCreate->offBits, lpCreate->cbBits ); - (handletable->objectHandle)[lpCreate->ihBrush] = + (handletable->objectHandle)[lpCreate->ihBrush] = CreateDIBPatternBrushPt( lpPackedStruct, - (UINT)lpCreate->iUsage ); + (UINT)lpCreate->iUsage ); - break; + break; } case EMR_CREATEMONOBRUSH: @@ -1490,7 +1490,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( case EMR_GLSRECORD: case EMR_GLSBOUNDEDRECORD: default: - /* From docs: If PlayEnhMetaFileRecord doesn't recognize a + /* From docs: If PlayEnhMetaFileRecord doesn't recognize a record then ignore and return TRUE. */ FIXME("type %d is unimplemented\n", type); break; @@ -1505,7 +1505,7 @@ BOOL WINAPI PlayEnhMetaFileRecord( * * Walk an enhanced metafile, calling a user-specified function _EnhMetaFunc_ * for each - * record. Returns when either every record has been used or + * record. Returns when either every record has been used or * when _EnhMetaFunc_ returns FALSE. * * @@ -1516,10 +1516,10 @@ BOOL WINAPI PlayEnhMetaFileRecord( * BUGS * Ignores rect. */ -BOOL WINAPI EnumEnhMetaFile( +BOOL WINAPI EnumEnhMetaFile( HDC hdc, /* [in] device context to pass to _EnhMetaFunc_ */ HENHMETAFILE hmf, /* [in] EMF to walk */ - ENHMFENUMPROC callback, /* [in] callback function */ + ENHMFENUMPROC callback, /* [in] callback function */ LPVOID data, /* [in] optional data for callback function */ const RECT *lpRect /* [in] bounding rectangle for rendered metafile */ ) @@ -1633,7 +1633,7 @@ static INT CALLBACK EMF_PlayEnhMetaFileCallback(HDC hdc, HANDLETABLE *ht, { return PlayEnhMetaFileRecord(hdc, ht, emr, handles); } - + /************************************************************************** * PlayEnhMetaFile (GDI32.@) * @@ -1641,7 +1641,7 @@ static INT CALLBACK EMF_PlayEnhMetaFileCallback(HDC hdc, HANDLETABLE *ht, * in device context hdc. * */ -BOOL WINAPI PlayEnhMetaFile( +BOOL WINAPI PlayEnhMetaFile( HDC hdc, /* [in] DC to render into */ HENHMETAFILE hmf, /* [in] metafile to render */ const RECT *lpRect /* [in] rectangle to place metafile inside */ @@ -1664,10 +1664,10 @@ BOOL WINAPI DeleteEnhMetaFile(HENHMETAFILE hmf) /***************************************************************************** * CopyEnhMetaFileA (GDI32.@) Duplicate an enhanced metafile * - * + * */ HENHMETAFILE WINAPI CopyEnhMetaFileA( - HENHMETAFILE hmfSrc, + HENHMETAFILE hmfSrc, LPCSTR file) { ENHMETAHEADER *emrSrc = EMF_GetEnhMetaHeader( hmfSrc ), *emrDst; @@ -1697,10 +1697,10 @@ typedef struct tagEMF_PaletteCopy LPPALETTEENTRY lpPe; } EMF_PaletteCopy; -/*************************************************************** +/*************************************************************** * Find the EMR_EOF record and then use it to find the - * palette entries for this enhanced metafile. - * The lpData is actually a pointer to a EMF_PaletteCopy struct + * palette entries for this enhanced metafile. + * The lpData is actually a pointer to a EMF_PaletteCopy struct * which contains the max number of elements to copy and where * to copy them to. * @@ -1712,7 +1712,7 @@ INT CALLBACK cbEnhPaletteCopy( HDC a, INT c, LPVOID lpData ) { - + if ( lpEMR->iType == EMR_EOF ) { PEMREOF lpEof = (PEMREOF)lpEMR; @@ -1721,25 +1721,25 @@ INT CALLBACK cbEnhPaletteCopy( HDC a, TRACE( "copying 0x%08lx palettes\n", dwNumPalToCopy ); - memcpy( (LPVOID)info->lpPe, - (LPVOID)(((LPSTR)lpEof) + lpEof->offPalEntries), + memcpy( (LPVOID)info->lpPe, + (LPVOID)(((LPSTR)lpEof) + lpEof->offPalEntries), sizeof( *(info->lpPe) ) * dwNumPalToCopy ); /* Update the passed data as a return code */ info->lpPe = NULL; /* Palettes were copied! */ - info->cEntries = (UINT)dwNumPalToCopy; + info->cEntries = (UINT)dwNumPalToCopy; return FALSE; /* That's all we need */ } - + return TRUE; } /***************************************************************************** - * GetEnhMetaFilePaletteEntries (GDI32.@) - * - * Copy the palette and report size - * + * GetEnhMetaFilePaletteEntries (GDI32.@) + * + * Copy the palette and report size + * * BUGS: Error codes (SetLastError) are not set on failures */ UINT WINAPI GetEnhMetaFilePaletteEntries( HENHMETAFILE hEmf, @@ -1747,9 +1747,9 @@ UINT WINAPI GetEnhMetaFilePaletteEntries( HENHMETAFILE hEmf, LPPALETTEENTRY lpPe ) { ENHMETAHEADER* enhHeader = EMF_GetEnhMetaHeader( hEmf ); - EMF_PaletteCopy infoForCallBack; + EMF_PaletteCopy infoForCallBack; - TRACE( "(%04x,%d,%p)\n", hEmf, cEntries, lpPe ); + TRACE( "(%04x,%d,%p)\n", hEmf, cEntries, lpPe ); /* First check if there are any palettes associated with this metafile. */ @@ -1760,9 +1760,9 @@ UINT WINAPI GetEnhMetaFilePaletteEntries( HENHMETAFILE hEmf, /* Copy cEntries worth of PALETTEENTRY structs into the buffer */ infoForCallBack.cEntries = cEntries; - infoForCallBack.lpPe = lpPe; + infoForCallBack.lpPe = lpPe; - if ( !EnumEnhMetaFile( 0, hEmf, cbEnhPaletteCopy, + if ( !EnumEnhMetaFile( 0, hEmf, cbEnhPaletteCopy, &infoForCallBack, NULL ) ) return GDI_ERROR; @@ -1779,7 +1779,7 @@ UINT WINAPI GetEnhMetaFilePaletteEntries( HENHMETAFILE hEmf, /****************************************************************** * SetWinMetaFileBits (GDI32.@) - * + * * Translate from old style to new style. * * BUGS: - This doesn't take the DC and scaling into account @@ -1790,7 +1790,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, CONST BYTE *lpbBuffer, HDC hdcRef, CONST METAFILEPICT *lpmfp - ) + ) { HENHMETAFILE hMf; LPVOID lpNewEnhMetaFileBuffer = NULL; @@ -1802,15 +1802,15 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, /* 1. Get the header - skip over this and get straight to the records */ uNewEnhMetaFileBufferSize = sizeof( ENHMETAHEADER ); - lpNewEnhMetaFileBuffer = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + lpNewEnhMetaFileBuffer = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, uNewEnhMetaFileBufferSize ); if( lpNewEnhMetaFileBuffer == NULL ) { - goto error; + goto error; } - /* Fill in the header record */ + /* Fill in the header record */ { LPENHMETAHEADER lpNewEnhMetaFileHeader = (LPENHMETAHEADER)lpNewEnhMetaFileBuffer; @@ -1840,7 +1840,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, lpNewEnhMetaFileHeader->nHandles = 0; /* No handles yet */ lpNewEnhMetaFileHeader->nRecords = 0; - + /* I am pretty sure this starts at 0 and grows as entries are added */ lpNewEnhMetaFileHeader->nPalEntries = 0; @@ -1858,13 +1858,13 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, /* cbPixelFormat offPixelFormat, bOpenGL */ - } + } - (char*)lpbBuffer += ((METAHEADER*)lpbBuffer)->mtHeaderSize * 2; /* Point past the header - FIXME: metafile quirk? */ + (char*)lpbBuffer += ((METAHEADER*)lpbBuffer)->mtHeaderSize * 2; /* Point past the header - FIXME: metafile quirk? */ /* 2. Enum over individual records and convert them to the new type of records */ while( !bFoundEOF ) - { + { LPMETARECORD lpMetaRecord = (LPMETARECORD)lpbBuffer; @@ -1882,18 +1882,18 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, switch( lpMetaRecord->rdFunction ) { - case META_EOF: - { + case META_EOF: + { PEMREOF lpRecord; size_t uRecord = sizeof(*lpRecord); EMF_ReAllocAndAdjustPointers(PEMREOF,uRecord); - + /* Fill the new record - FIXME: This is not right */ - lpRecord->emr.iType = EMR_EOF; + lpRecord->emr.iType = EMR_EOF; lpRecord->emr.nSize = sizeof( *lpRecord ); lpRecord->nPalEntries = 0; /* FIXME */ - lpRecord->offPalEntries = 0; /* FIXME */ + lpRecord->offPalEntries = 0; /* FIXME */ lpRecord->nSizeLast = 0; /* FIXME */ /* No more records after this one */ @@ -1904,7 +1904,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, } case META_SETMAPMODE: - { + { PEMRSETMAPMODE lpRecord; size_t uRecord = sizeof(*lpRecord); @@ -1919,7 +1919,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, } case META_DELETEOBJECT: /* Select and Delete structures are the same */ - case META_SELECTOBJECT: + case META_SELECTOBJECT: { PEMRDELETEOBJECT lpRecord; size_t uRecord = sizeof(*lpRecord); @@ -1943,7 +1943,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, case META_POLYGON: /* This is just plain busted. I don't know what I'm doing */ { - PEMRPOLYGON16 lpRecord; /* FIXME: Should it be a poly or poly16? */ + PEMRPOLYGON16 lpRecord; /* FIXME: Should it be a poly or poly16? */ size_t uRecord = sizeof(*lpRecord); EMF_ReAllocAndAdjustPointers(PEMRPOLYGON16,uRecord); @@ -1977,7 +1977,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, lpRecord->emr.nSize = sizeof( *lpRecord ); lpRecord->iMode = lpMetaRecord->rdParm[0]; - + break; } @@ -2032,10 +2032,10 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, lpRecord->emr.nSize = sizeof( *lpRecord ); lpRecord->ihBrush = ((LPENHMETAHEADER)lpNewEnhMetaFileBuffer)->nHandles; - lpRecord->lb.lbStyle = ((LPLOGBRUSH16)lpMetaRecord->rdParm)->lbStyle; - lpRecord->lb.lbColor = ((LPLOGBRUSH16)lpMetaRecord->rdParm)->lbColor; - lpRecord->lb.lbHatch = ((LPLOGBRUSH16)lpMetaRecord->rdParm)->lbHatch; - + lpRecord->lb.lbStyle = ((LPLOGBRUSH16)lpMetaRecord->rdParm)->lbStyle; + lpRecord->lb.lbColor = ((LPLOGBRUSH16)lpMetaRecord->rdParm)->lbColor; + lpRecord->lb.lbHatch = ((LPLOGBRUSH16)lpMetaRecord->rdParm)->lbHatch; + ((LPENHMETAHEADER)lpNewEnhMetaFileBuffer)->nHandles += 1; /* New handle */ break; @@ -2116,7 +2116,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, case META_TEXTOUT: case META_POLYPOLYGON: case META_POLYLINE: - case META_RESTOREDC: + case META_RESTOREDC: case META_CHORD: case META_CREATEPATTERNBRUSH: case META_CREATEPENINDIRECT: @@ -2156,7 +2156,7 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, case META_ENDDOC: case META_CREATEBRUSH: case META_CREATEBITMAPINDIRECT: - case META_CREATEBITMAP: + case META_CREATEBITMAP: /* Fall through to unimplemented */ default: { @@ -2167,16 +2167,16 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, } /* Move to the next record */ - (char*)lpbBuffer += ((LPMETARECORD)lpbBuffer)->rdSize * 2; /* FIXME: Seem to be doing this in metafile.c */ + (char*)lpbBuffer += ((LPMETARECORD)lpbBuffer)->rdSize * 2; /* FIXME: Seem to be doing this in metafile.c */ #undef ReAllocAndAdjustPointers - } + } /* We know the last of the header information now */ ((LPENHMETAHEADER)lpNewEnhMetaFileBuffer)->nBytes = uNewEnhMetaFileBufferSize; /* Create the enhanced metafile */ - hMf = SetEnhMetaFileBits( uNewEnhMetaFileBufferSize, (const BYTE*)lpNewEnhMetaFileBuffer ); + hMf = SetEnhMetaFileBits( uNewEnhMetaFileBufferSize, (const BYTE*)lpNewEnhMetaFileBuffer ); if( !hMf ) ERR( "Problem creating metafile. Did the conversion fail somewhere?\n" ); @@ -2185,9 +2185,9 @@ HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, error: /* Free the data associated with our copy since it's been copied */ - HeapFree( GetProcessHeap(), 0, lpNewEnhMetaFileBuffer ); + HeapFree( GetProcessHeap(), 0, lpNewEnhMetaFileBuffer ); - return 0; + return 0; } diff --git a/objects/font.c b/objects/font.c index e26bdaae0eb..096b10abcc6 100644 --- a/objects/font.c +++ b/objects/font.c @@ -76,7 +76,7 @@ typedef struct DC *dc; PHYSDEV physDev; } fontEnum32; - + /* * For TranslateCharsetInfo */ @@ -107,7 +107,7 @@ static CHARSETINFO FONT_tci[MAXTCIINDEX] = { { GB2312_CHARSET, 936, FS(18)}, { HANGEUL_CHARSET, 949, FS(19)}, { CHINESEBIG5_CHARSET, 950, FS(20)}, - { JOHAB_CHARSET, 1361, FS(21)}, + { JOHAB_CHARSET, 1361, FS(21)}, /* reserved for alternate ANSI and OEM */ { DEFAULT_CHARSET, 0, FS(0)}, { DEFAULT_CHARSET, 0, FS(0)}, @@ -493,7 +493,7 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf ) memcpy( &fontPtr->logfont, plf, sizeof(LOGFONTW) ); TRACE("(%ld %ld %ld %ld %x) %s %s %s => %04x\n", - plf->lfHeight, plf->lfWidth, + plf->lfHeight, plf->lfWidth, plf->lfEscapement, plf->lfOrientation, plf->lfPitchAndFamily, debugstr_w(plf->lfFaceName), @@ -504,7 +504,7 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf ) /* this should really depend on whether GM_ADVANCED is set */ fontPtr->logfont.lfOrientation = fontPtr->logfont.lfEscapement; WARN("orientation angle %f set to " - "escapement angle %f for new font %04x\n", + "escapement angle %f for new font %04x\n", plf->lfOrientation/10., plf->lfEscapement/10., hFont); } GDI_ReleaseObj( hFont ); @@ -539,10 +539,10 @@ HFONT16 WINAPI CreateFont16(INT16 height, INT16 width, INT16 esc, INT16 orient, logfont.lfClipPrecision = clippres; logfont.lfQuality = quality; logfont.lfPitchAndFamily = pitch; - - if (name) + + if (name) lstrcpynA(logfont.lfFaceName,name,sizeof(logfont.lfFaceName)); - else + else logfont.lfFaceName[0] = '\0'; return CreateFontIndirect16( &logfont ); @@ -572,10 +572,10 @@ HFONT WINAPI CreateFontA( INT height, INT width, INT esc, logfont.lfClipPrecision = clippres; logfont.lfQuality = quality; logfont.lfPitchAndFamily = pitch; - - if (name) + + if (name) lstrcpynA(logfont.lfFaceName,name,sizeof(logfont.lfFaceName)); - else + else logfont.lfFaceName[0] = '\0'; return CreateFontIndirectA( &logfont ); @@ -605,11 +605,11 @@ HFONT WINAPI CreateFontW( INT height, INT width, INT esc, logfont.lfClipPrecision = clippres; logfont.lfQuality = quality; logfont.lfPitchAndFamily = pitch; - - if (name) - lstrcpynW(logfont.lfFaceName, name, + + if (name) + lstrcpynW(logfont.lfFaceName, name, sizeof(logfont.lfFaceName) / sizeof(WCHAR)); - else + else logfont.lfFaceName[0] = '\0'; return CreateFontIndirectW( &logfont ); @@ -721,7 +721,7 @@ static INT FONT_EnumInstance16( LPENUMLOGFONTEXW plf, LPNEWTEXTMETRICEXW ptm, INT ret = 1; DC *dc; - if( pfe->lpLogFontParam->lfCharSet == DEFAULT_CHARSET || + if( pfe->lpLogFontParam->lfCharSet == DEFAULT_CHARSET || pfe->lpLogFontParam->lfCharSet == plf->elfLogFont.lfCharSet ) { FONT_EnumLogFontExWTo16(plf, pfe->lpLogFont); @@ -753,7 +753,7 @@ static INT FONT_EnumInstance( LPENUMLOGFONTEXW plf, LPNEWTEXTMETRICEXW ptm, DC *dc; /* lfCharSet is at the same offset in both LOGFONTA and LOGFONTW */ - if( pfe->lpLogFontParam->lfCharSet == DEFAULT_CHARSET || + if( pfe->lpLogFontParam->lfCharSet == DEFAULT_CHARSET || pfe->lpLogFontParam->lfCharSet == plf->elfLogFont.lfCharSet ) { /* convert font metrics */ @@ -828,7 +828,7 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf, * FONT_EnumFontFamiliesEx */ static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, - FONTENUMPROCEXW efproc, + FONTENUMPROCEXW efproc, LPARAM lParam, DWORD dwUnicode) { INT ret = 1, ret2; @@ -873,7 +873,7 @@ static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, * EnumFontFamiliesExW (GDI32.@) */ INT WINAPI EnumFontFamiliesExW( HDC hDC, LPLOGFONTW plf, - FONTENUMPROCEXW efproc, + FONTENUMPROCEXW efproc, LPARAM lParam, DWORD dwFlags ) { return FONT_EnumFontFamiliesEx( hDC, plf, efproc, lParam, ENUM_UNICODE ); @@ -883,7 +883,7 @@ INT WINAPI EnumFontFamiliesExW( HDC hDC, LPLOGFONTW plf, * EnumFontFamiliesExA (GDI32.@) */ INT WINAPI EnumFontFamiliesExA( HDC hDC, LPLOGFONTA plf, - FONTENUMPROCEXA efproc, + FONTENUMPROCEXA efproc, LPARAM lParam, DWORD dwFlags) { LOGFONTW lfW; @@ -1077,7 +1077,7 @@ INT WINAPI GetTextFaceA( HDC hdc, INT count, LPSTR name ) INT res = GetTextFaceW(hdc, 0, NULL); LPWSTR nameW = HeapAlloc( GetProcessHeap(), 0, res * 2 ); GetTextFaceW( hdc, res, nameW ); - + if (name) res = WideCharToMultiByte( CP_ACP, 0, nameW, -1, name, count, NULL, NULL); @@ -1285,7 +1285,7 @@ BOOL WINAPI GetTextExtentExPointA( HDC hdc, LPCSTR str, INT count, * - kerning? see below * * Kerning. Since kerning would be carried out by the rendering code it should - * be done by the driver. However they don't support it yet. Also I am not + * be done by the driver. However they don't support it yet. Also I am not * yet persuaded that (certainly under Win95) any kerning is actually done. * * str: According to MSDN this should be null-terminated. That is not true; a @@ -1392,7 +1392,7 @@ BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ) #define HDPTOLP(y) ((y<0)? \ (-abs((y)*dc->wndExtY/dc->vportExtY)): \ (abs((y)*dc->wndExtY/dc->vportExtY))) - + metrics->tmHeight = HDPTOLP(metrics->tmHeight); metrics->tmAscent = HDPTOLP(metrics->tmAscent); metrics->tmDescent = HDPTOLP(metrics->tmDescent); @@ -1478,19 +1478,19 @@ UINT WINAPI GetOutlineTextMetricsA( needed = sizeof(OUTLINETEXTMETRICA); if(lpOTMW->otmpFamilyName) needed += WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFamilyName), -1, + (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFamilyName), -1, NULL, 0, NULL, NULL); if(lpOTMW->otmpFaceName) needed += WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFaceName), -1, + (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFaceName), -1, NULL, 0, NULL, NULL); if(lpOTMW->otmpStyleName) needed += WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpStyleName), -1, + (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpStyleName), -1, NULL, 0, NULL, NULL); if(lpOTMW->otmpFullName) needed += WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFullName), -1, + (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFullName), -1, NULL, 0, NULL, NULL); if(!lpOTM) { @@ -1540,7 +1540,7 @@ UINT WINAPI GetOutlineTextMetricsA( if(lpOTMW->otmpFamilyName) { lpOTM->otmpFamilyName = (LPSTR)(ptr - (char*)lpOTM); len = WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFamilyName), -1, + (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFamilyName), -1, ptr, left, NULL, NULL); left -= len; ptr += len; @@ -1550,7 +1550,7 @@ UINT WINAPI GetOutlineTextMetricsA( if(lpOTMW->otmpFaceName) { lpOTM->otmpFaceName = (LPSTR)(ptr - (char*)lpOTM); len = WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFaceName), -1, + (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFaceName), -1, ptr, left, NULL, NULL); left -= len; ptr += len; @@ -1560,7 +1560,7 @@ UINT WINAPI GetOutlineTextMetricsA( if(lpOTMW->otmpStyleName) { lpOTM->otmpStyleName = (LPSTR)(ptr - (char*)lpOTM); len = WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpStyleName), -1, + (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpStyleName), -1, ptr, left, NULL, NULL); left -= len; ptr += len; @@ -1570,14 +1570,14 @@ UINT WINAPI GetOutlineTextMetricsA( if(lpOTMW->otmpFullName) { lpOTM->otmpFullName = (LPSTR)(ptr - (char*)lpOTM); len = WideCharToMultiByte(CP_ACP, 0, - (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFullName), -1, + (WCHAR*)((char*)lpOTMW + (ptrdiff_t)lpOTMW->otmpFullName), -1, ptr, left, NULL, NULL); left -= len; } else lpOTM->otmpFullName = 0; - + assert(left == 0); - + ret = needed; end: @@ -1708,7 +1708,7 @@ BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar, BOOL ret = TRUE; if(count <= 0) return FALSE; - + str = HeapAlloc(GetProcessHeap(), 0, count); for(i = 0; i < count; i++) str[i] = (BYTE)(firstChar + i); @@ -1733,7 +1733,7 @@ BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar, /* FIXME: all following APIs ******************************************/ - + /*********************************************************************** * SetMapperFlags (GDI.349) @@ -1750,7 +1750,7 @@ DWORD WINAPI SetMapperFlags16( HDC16 hDC, DWORD dwFlag ) DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag ) { DC *dc = DC_GetDCPtr( hDC ); - DWORD ret = 0; + DWORD ret = 0; if(!dc) return 0; if(dc->funcs->pSetMapperFlags) ret = dc->funcs->pSetMapperFlags( dc->physDev, dwFlag ); @@ -1814,7 +1814,7 @@ BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar, BOOL ret = TRUE; if(count <= 0) return FALSE; - + str = HeapAlloc(GetProcessHeap(), 0, count); for(i = 0; i < count; i++) str[i] = (BYTE)(firstChar + i); @@ -2012,7 +2012,7 @@ INT16 WINAPI GetKerningPairs16( HDC16 hDC, INT16 cPairs, int i; FIXME("(%x,%d,%p): almost empty stub!\n", hDC, cPairs, lpKerningPairs); if (lpKerningPairs) - for (i = 0; i < cPairs; i++) + for (i = 0; i < cPairs; i++) lpKerningPairs[i].iKernAmount = 0; /* FIXME: Should this function call SetLastError (0)? This is yet another * Microsoft function that can return 0 on success or failure @@ -2030,7 +2030,7 @@ DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs, { int i; FIXME("(%x,%ld,%p): almost empty stub!\n", hDC, cPairs, lpKerningPairs); - for (i = 0; i < cPairs; i++) + for (i = 0; i < cPairs; i++) lpKerningPairs[i].iKernAmount = 0; return 0; } @@ -2051,7 +2051,7 @@ DWORD WINAPI GetKerningPairsW( HDC hDC, DWORD cPairs, * * Fills a CHARSETINFO structure for a character set, code page, or * font. This allows making the correspondance between different labelings - * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges) + * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges) * of the same encoding. * * Only one codepage will be set in lpCs->fs. If TCI_SRCFONTSIG is used, @@ -2112,15 +2112,15 @@ DWORD WINAPI GetFontLanguageInfo16(HDC16 hdc) { * * RETURNS * - * success: Number of bytes returned + * success: Number of bytes returned * failure: GDI_ERROR * * NOTES * - * Calls SetLastError() + * Calls SetLastError() * */ -DWORD WINAPI GetFontData(HDC hdc, DWORD table, DWORD offset, +DWORD WINAPI GetFontData(HDC hdc, DWORD table, DWORD offset, LPVOID buffer, DWORD length) { DC *dc = DC_GetDCPtr(hdc); @@ -2274,7 +2274,7 @@ GetCharacterPlacementW(HDC hdc, LPCWSTR lpString, INT uCount, { int c; for (i = 0; i < nSet; i++) - { + { if (GetCharWidth32W(hdc, lpString[i], lpString[i], &c)) lpResults->lpDx[i]= c; } @@ -2328,7 +2328,7 @@ BOOL WINAPI GetCharWidthFloatW(HDC hdc, UINT iFirstChar, FIXME_(gdi)("GetCharWidthFloatW, stub\n"); return 0; } - + /*********************************************************************** * * @@ -2344,8 +2344,8 @@ BOOL WINAPI GetCharWidthFloatW(HDC hdc, UINT iFirstChar, * fixup dfPoints if all metrics are identical, otherwise create * new fontAlias. When soft font support is ready this will * simply create a new fontResource ('filename' will go into - * the pfr->resource field) with FR_SOFTFONT/FR_SOFTRESOURCE - * flag set. + * the pfr->resource field) with FR_SOFTFONT/FR_SOFTRESOURCE + * flag set. */ INT16 WINAPI AddFontResource16( LPCSTR filename ) { diff --git a/objects/gdiobj.c b/objects/gdiobj.c index 45fcf9e0ebd..7e8b30f378e 100644 --- a/objects/gdiobj.c +++ b/objects/gdiobj.c @@ -44,7 +44,7 @@ extern WORD CALLBACK GDI_CallTo16_word_ll(GOBJENUMPROC16,LONG,LONG); /* ### stop build ### */ /*********************************************************************** - * GDI stock objects + * GDI stock objects */ static const LOGBRUSH WhiteBrush = { BS_SOLID, RGB(255,255,255), 0 }; @@ -688,7 +688,7 @@ void *GDI_AllocObject( WORD size, WORD magic, HGDIOBJ *handle, const struct gdi_ case METAFILE_DC_MAGIC: case ENHMETAFILE_MAGIC: case ENHMETAFILE_DC_MAGIC: - case BITMAP_MAGIC: + case BITMAP_MAGIC: if (!(obj = alloc_large_heap( size, handle ))) goto error; break; default: @@ -734,7 +734,7 @@ void *GDI_ReallocObject( WORD size, HGDIOBJ handle, void *object ) assert( new_handle == handle ); /* moveable handle cannot change */ return LOCAL_Lock( GDI_HeapSel, handle ); } - + /*********************************************************************** * GDI_FreeObject @@ -983,16 +983,16 @@ DWORD WINAPI GetObjectType( HANDLE handle ) TRACE("%08x\n", handle ); if (!(ptr = GDI_GetObjPtr( handle, MAGIC_DONTCARE ))) return 0; - + switch(GDIMAGIC(ptr->wMagic)) { case PEN_MAGIC: result = OBJ_PEN; break; - case BRUSH_MAGIC: + case BRUSH_MAGIC: result = OBJ_BRUSH; break; - case BITMAP_MAGIC: + case BITMAP_MAGIC: result = OBJ_BITMAP; break; case FONT_MAGIC: @@ -1038,7 +1038,7 @@ HANDLE WINAPI GetCurrentObject(HDC hdc,UINT type) HANDLE ret = 0; DC * dc = DC_GetDCPtr( hdc ); - if (dc) + if (dc) { switch (type) { case OBJ_PEN: ret = dc->hPen; break; @@ -1134,7 +1134,7 @@ RGB(0x80,0x80,0x00), RGB(0x00,0x00,0x80), RGB(0x80,0x00,0x80), RGB(0x00,0x80,0x80), RGB(0x80,0x80,0x80), RGB(0xc0,0xc0,0xc0) }; - + /*********************************************************************** * EnumObjects (GDI.71) */ @@ -1266,7 +1266,7 @@ INT WINAPI EnumObjects( HDC hdc, INT nObjType, /*********************************************************************** * IsGDIObject (GDI.462) - * + * * returns type of object if valid (W95 system programming secrets p. 264-5) */ BOOL16 WINAPI IsGDIObject16( HGDIOBJ16 handle ) @@ -1418,7 +1418,7 @@ WORD WINAPI GdiFreeResources16( DWORD reserve ) * MulDiv (GDI.128) */ INT16 WINAPI MulDiv16( - INT16 nMultiplicand, + INT16 nMultiplicand, INT16 nMultiplier, INT16 nDivisor) { @@ -1430,7 +1430,7 @@ INT16 WINAPI MulDiv16( nMultiplicand = - nMultiplicand; nDivisor = -nDivisor; } - /* If the result is positive, we "add" to round. else, + /* If the result is positive, we "add" to round. else, * we subtract to round. */ if ( ( (nMultiplicand < 0) && (nMultiplier < 0) ) || ( (nMultiplicand >= 0) && (nMultiplier >= 0) ) ) @@ -1495,4 +1495,4 @@ BOOL WINAPI SetColorAdjustment(HDC hdc, const COLORADJUSTMENT* lpca) FIXME("SetColorAdjustment, stub\n"); return 0; } - + diff --git a/objects/metafile.c b/objects/metafile.c index 2953e982e99..cc9b6d35cc8 100644 --- a/objects/metafile.c +++ b/objects/metafile.c @@ -24,7 +24,7 @@ * that touches a HMETAFILE. * For recording of metafiles look in graphics/metafiledrv/ * - * Note that (32 bit) HMETAFILEs are GDI objects, while HMETAFILE16s are + * Note that (32 bit) HMETAFILEs are GDI objects, while HMETAFILE16s are * global memory handles so these cannot be interchanged. * * Memory-based metafiles are just stored as a continuous block of memory with @@ -41,7 +41,7 @@ * the file (METAHEADERDISK). I've copied this for 16bit compatibility. * * HDMD - 14/4/1999 - */ + */ #include "config.h" @@ -243,7 +243,7 @@ HMETAFILE16 WINAPI GetMetaFile16( LPCSTR lpFilename ) { METAHEADER *mh; HANDLE hFile; - + TRACE("%s\n", lpFilename); if(!lpFilename) @@ -268,7 +268,7 @@ HMETAFILE WINAPI GetMetaFileA( LPCSTR lpFilename ) { METAHEADER *mh; HANDLE hFile; - + TRACE("%s\n", lpFilename); if(!lpFilename) @@ -293,7 +293,7 @@ HMETAFILE WINAPI GetMetaFileW( LPCWSTR lpFilename ) { METAHEADER *mh; HANDLE hFile; - + TRACE("%s\n", debugstr_w(lpFilename)); if(!lpFilename) @@ -341,7 +341,7 @@ static METAHEADER *MF_LoadDiskBasedMetaFile(METAHEADER *mh) * MF_CreateMetaHeaderDisk * * Take a memory based METAHEADER and change it to a disk based METAHEADER - * assosiated with filename. Note: Trashes contents of old one. + * assosiated with filename. Note: Trashes contents of old one. */ METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mh, LPCSTR filename) { @@ -367,9 +367,9 @@ HMETAFILE16 WINAPI CopyMetaFile16( HMETAFILE16 hSrcMetaFile, LPCSTR lpFilename) HANDLE hFile; TRACE("(%08x,%s)\n", hSrcMetaFile, lpFilename); - + if(!mh) return 0; - + if(mh->mtType == METAFILE_DISK) mh2 = MF_LoadDiskBasedMetaFile(mh); else { @@ -417,9 +417,9 @@ HMETAFILE WINAPI CopyMetaFileA( HANDLE hFile; TRACE("(%08x,%s)\n", hSrcMetaFile, lpFilename); - + if(!mh) return 0; - + if(mh->mtType == METAFILE_DISK) mh2 = MF_LoadDiskBasedMetaFile(mh); else { @@ -481,14 +481,14 @@ BOOL16 WINAPI IsValidMetaFile16(HMETAFILE16 hmf) BOOL16 res=FALSE; METAHEADER *mh = MF_GetMetaHeader16(hmf); if (mh) { - if (mh->mtType == METAFILE_MEMORY || mh->mtType == METAFILE_DISK) + if (mh->mtType == METAFILE_MEMORY || mh->mtType == METAFILE_DISK) if (mh->mtHeaderSize == MFHEADERSIZE/sizeof(INT16)) if (mh->mtVersion == MFVERSION) res=TRUE; MF_ReleaseMetaHeader16(hmf); } TRACE("IsValidMetaFile %x => %d\n",hmf,res); - return res; + return res; } @@ -525,7 +525,7 @@ static BOOL MF_PlayMetaFile( HDC hdc, METAHEADER *mh) ht = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HANDLETABLE16) * mh->mtNoObjects); if(!ht) return FALSE; - + /* loop through metafile playing records */ offset = mh->mtHeaderSize * 2; while (offset < mh->mtSize * 2) @@ -551,7 +551,7 @@ static BOOL MF_PlayMetaFile( HDC hdc, METAHEADER *mh) for(i = 0; i < mh->mtNoObjects; i++) if(*(ht->objectHandle + i) != 0) DeleteObject(*(ht->objectHandle + i)); - + /* free handle table */ HeapFree( GetProcessHeap(), 0, ht ); if(loaded) @@ -578,7 +578,7 @@ BOOL16 WINAPI PlayMetaFile16( HDC16 hdc, HMETAFILE16 hmf ) * Renders the metafile specified by hmf in the DC specified by * hdc. Returns FALSE on failure, TRUE on success. */ -BOOL WINAPI PlayMetaFile( +BOOL WINAPI PlayMetaFile( HDC hdc, /* [in] handle of DC to render in */ HMETAFILE hmf /* [in] handle of metafile to render */ ) @@ -624,16 +624,16 @@ BOOL16 WINAPI EnumMetaFile16( HDC16 hdc, HMETAFILE16 hmf, hFont = GetCurrentObject(hdc, OBJ_FONT); /* create the handle table */ - + hHT = GlobalAlloc16(GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof(HANDLETABLE16) * mh->mtNoObjects); spht = K32WOWGlobalLock16(hHT); - + seg = hmf | 7; offset = mh->mtHeaderSize * 2; - + /* loop through metafile records */ - + while (offset < (mh->mtSize * 2)) { mr = (METARECORD *)((char *)mh + offset); @@ -645,7 +645,7 @@ BOOL16 WINAPI EnumMetaFile16( HDC16 hdc, HMETAFILE16 hmf, result = FALSE; break; } - + offset += (mr->rdSize * 2); } @@ -675,19 +675,19 @@ BOOL16 WINAPI EnumMetaFile16( HDC16 hdc, HMETAFILE16 hmf, * Loop through the metafile records in hmf, calling the user-specified * function for each one, stopping when the user's function returns FALSE * (which is considered to be failure) - * or when no records are left (which is considered to be success). + * or when no records are left (which is considered to be success). * * RETURNS * TRUE on success, FALSE on failure. - * + * * HISTORY * Niels de carpentier, april 1996 */ -BOOL WINAPI EnumMetaFile( - HDC hdc, +BOOL WINAPI EnumMetaFile( + HDC hdc, HMETAFILE hmf, - MFENUMPROC lpEnumFunc, - LPARAM lpData + MFENUMPROC lpEnumFunc, + LPARAM lpData ) { METAHEADER *mhTemp = NULL, *mh = MF_GetMetaHeader(hmf); METARECORD *mr; @@ -713,12 +713,12 @@ BOOL WINAPI EnumMetaFile( hBrush = GetCurrentObject(hdc, OBJ_BRUSH); hFont = GetCurrentObject(hdc, OBJ_FONT); - ht = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + ht = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HANDLETABLE) * mh->mtNoObjects); /* loop through metafile records */ offset = mh->mtHeaderSize * 2; - + while (offset < (mh->mtSize * 2)) { mr = (METARECORD *)((char *)mh + offset); @@ -733,7 +733,7 @@ BOOL WINAPI EnumMetaFile( result = FALSE; break; } - + offset += (mr->rdSize * 2); } @@ -760,7 +760,7 @@ static BOOL MF_Play_MetaExtTextOut(HDC16 hdc, METARECORD *mr); * PlayMetaFileRecord (GDI.176) * * Render a single metafile record specified by *mr in the DC hdc, while - * using the handle table *ht, of length nHandles, + * using the handle table *ht, of length nHandles, * to store metafile objects. * * BUGS @@ -771,7 +771,7 @@ static BOOL MF_Play_MetaExtTextOut(HDC16 hdc, METARECORD *mr); * ABORTDOC, ENDDOC, CREATEBRUSH, CREATEBITMAPINDIRECT, and CREATEBITMAP. * */ -void WINAPI PlayMetaFileRecord16( +void WINAPI PlayMetaFileRecord16( HDC16 hdc, /* [in] DC to render metafile into */ HANDLETABLE16 *ht, /* [in] pointer to handle table for metafile objects */ METARECORD *mr, /* [in] pointer to metafile record to render */ @@ -784,7 +784,7 @@ void WINAPI PlayMetaFileRecord16( TRACE("(%04x %08lx %08lx %04x) function %04x\n", hdc,(LONG)ht, (LONG)mr, nHandles, mr->rdFunction); - + switch (mr->rdFunction) { case META_EOF: @@ -936,7 +936,7 @@ void WINAPI PlayMetaFileRecord16( case META_TEXTOUT: s1 = *(mr->rdParm); TextOut16(hdc, *(mr->rdParm + ((s1 + 1) >> 1) + 2), - *(mr->rdParm + ((s1 + 1) >> 1) + 1), + *(mr->rdParm + ((s1 + 1) >> 1) + 1), (char *)(mr->rdParm + 1), s1); break; @@ -946,7 +946,7 @@ void WINAPI PlayMetaFileRecord16( case META_POLYPOLYGON: PolyPolygon16(hdc, (LPPOINT16)(mr->rdParm + *(mr->rdParm) + 1), - (LPINT16)(mr->rdParm + 1), *(mr->rdParm)); + (LPINT16)(mr->rdParm + 1), *(mr->rdParm)); break; case META_POLYLINE: @@ -974,11 +974,11 @@ void WINAPI PlayMetaFileRecord16( case BS_PATTERN: infohdr = (BITMAPINFOHEADER *)(mr->rdParm + 2); MF_AddHandle(ht, nHandles, - CreatePatternBrush(CreateBitmap(infohdr->biWidth, - infohdr->biHeight, - infohdr->biPlanes, + CreatePatternBrush(CreateBitmap(infohdr->biWidth, + infohdr->biHeight, + infohdr->biPlanes, infohdr->biBitCount, - (LPSTR)(mr->rdParm + + (LPSTR)(mr->rdParm + (sizeof(BITMAPINFOHEADER) / 2) + 4)))); break; @@ -999,24 +999,24 @@ void WINAPI PlayMetaFileRecord16( break; } break; - + case META_CREATEPENINDIRECT: - MF_AddHandle(ht, nHandles, + MF_AddHandle(ht, nHandles, CreatePenIndirect16((LOGPEN16 *)(&(mr->rdParm)))); break; case META_CREATEFONTINDIRECT: - MF_AddHandle(ht, nHandles, + MF_AddHandle(ht, nHandles, CreateFontIndirect16((LOGFONT16 *)(&(mr->rdParm)))); break; case META_CREATEBRUSHINDIRECT: - MF_AddHandle(ht, nHandles, + MF_AddHandle(ht, nHandles, CreateBrushIndirect16((LOGBRUSH16 *)(&(mr->rdParm)))); break; case META_CREATEPALETTE: - MF_AddHandle(ht, nHandles, + MF_AddHandle(ht, nHandles, CreatePalette16((LPLOGPALETTE)mr->rdParm)); break; @@ -1044,7 +1044,7 @@ void WINAPI PlayMetaFileRecord16( case META_EXTTEXTOUT: MF_Play_MetaExtTextOut( hdc, mr ); break; - + case META_STRETCHDIB: { LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[11]); @@ -1058,14 +1058,14 @@ void WINAPI PlayMetaFileRecord16( case META_DIBSTRETCHBLT: { - LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[10]); + LPBITMAPINFO info = (LPBITMAPINFO) &(mr->rdParm[10]); LPSTR bits = (LPSTR)info + DIB_BitmapInfoSize( info, mr->rdParm[2] ); StretchDIBits16(hdc,mr->rdParm[9],mr->rdParm[8],mr->rdParm[7], mr->rdParm[6],mr->rdParm[5],mr->rdParm[4], mr->rdParm[3],mr->rdParm[2],bits,info, DIB_RGB_COLORS,MAKELONG(mr->rdParm[0],mr->rdParm[1])); } - break; + break; case META_STRETCHBLT: { @@ -1081,7 +1081,7 @@ void WINAPI PlayMetaFileRecord16( hdcSrc,mr->rdParm[5],mr->rdParm[4], mr->rdParm[3],mr->rdParm[2], MAKELONG(mr->rdParm[0],mr->rdParm[1])); - DeleteDC(hdcSrc); + DeleteDC(hdcSrc); } break; @@ -1098,14 +1098,14 @@ void WINAPI PlayMetaFileRecord16( (INT16)mr->rdParm[4],(INT16)mr->rdParm[3], hdcSrc, (INT16)mr->rdParm[2],(INT16)mr->rdParm[1], MAKELONG(0,mr->rdParm[0])); - DeleteDC(hdcSrc); + DeleteDC(hdcSrc); } break; case META_CREATEREGION: { HRGN hrgn = CreateRectRgn(0,0,0,0); - + MF_Play_MetaCreateRegion(mr, hrgn); MF_AddHandle(ht, nHandles, hrgn); } @@ -1124,7 +1124,7 @@ void WINAPI PlayMetaFileRecord16( case META_INVERTREGION: InvertRgn16(hdc, *(ht->objectHandle + *(mr->rdParm))); - break; + break; case META_PAINTREGION: PaintRgn16(hdc, *(ht->objectHandle + *(mr->rdParm))); @@ -1172,8 +1172,8 @@ void WINAPI PlayMetaFileRecord16( mr->rdParm[6], mr->rdParm[5], MAKELONG(mr->rdParm[0], mr->rdParm[1])); } - break; - + break; + case META_SETTEXTCHAREXTRA: SetTextCharacterExtra16(hdc, (INT16)*(mr->rdParm)); break; @@ -1227,18 +1227,18 @@ break; /****************************************************************** * PlayMetaFileRecord (GDI32.@) */ -BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *handletable, +BOOL WINAPI PlayMetaFileRecord( HDC hdc, HANDLETABLE *handletable, METARECORD *metarecord, UINT handles ) { - HANDLETABLE16 * ht = (void *)GlobalAlloc(GPTR, + HANDLETABLE16 * ht = (void *)GlobalAlloc(GPTR, handles*sizeof(HANDLETABLE16)); unsigned int i = 0; TRACE("(%08x,%p,%p,%d)\n", hdc, handletable, metarecord, - handles); - for (i=0; iobjectHandle[i] = handletable->objectHandle[i]; PlayMetaFileRecord16(hdc, ht, metarecord, handles); - for (i=0; iobjectHandle[i] = ht->objectHandle[i]; GlobalFree((HGLOBAL)ht); return TRUE; @@ -1267,8 +1267,8 @@ HGLOBAL16 WINAPI GetMetaFileBits16( * problems will occur when it is used. Validity of the memory is not * checked. The function is essentially just the identity function. */ -HMETAFILE16 WINAPI SetMetaFileBits16( - HGLOBAL16 hMem +HMETAFILE16 WINAPI SetMetaFileBits16( + HGLOBAL16 hMem /* [in] handle to a memory region holding a metafile */ ) { @@ -1290,20 +1290,20 @@ HMETAFILE16 WINAPI SetMetaFileBits16( HMETAFILE16 WINAPI SetMetaFileBitsBetter16( HMETAFILE16 hMeta ) { if( IsValidMetaFile16( hMeta ) ) - return (HMETAFILE16)GlobalReAlloc16( hMeta, 0, + return (HMETAFILE16)GlobalReAlloc16( hMeta, 0, GMEM_SHARE | GMEM_NODISCARD | GMEM_MODIFY); return (HMETAFILE16)0; } /****************************************************************** * SetMetaFileBitsEx (GDI32.@) - * + * * Create a metafile from raw data. No checking of the data is performed. * Use _GetMetaFileBitsEx_ to get raw data from a metafile. */ -HMETAFILE WINAPI SetMetaFileBitsEx( +HMETAFILE WINAPI SetMetaFileBitsEx( UINT size, /* [in] size of metafile, in bytes */ - const BYTE *lpData /* [in] pointer to metafile data */ + const BYTE *lpData /* [in] pointer to metafile data */ ) { METAHEADER *mh = HeapAlloc( GetProcessHeap(), 0, size ); @@ -1314,15 +1314,15 @@ HMETAFILE WINAPI SetMetaFileBitsEx( /***************************************************************** * GetMetaFileBitsEx (GDI32.@) Get raw metafile data - * + * * Copies the data from metafile _hmf_ into the buffer _buf_. * If _buf_ is zero, returns size of buffer required. Otherwise, * returns number of bytes copied. */ -UINT WINAPI GetMetaFileBitsEx( +UINT WINAPI GetMetaFileBitsEx( HMETAFILE hmf, /* [in] metafile */ - UINT nSize, /* [in] size of buf */ - LPVOID buf /* [out] buffer to receive raw metafile data */ + UINT nSize, /* [in] size of buf */ + LPVOID buf /* [out] buffer to receive raw metafile data */ ) { METAHEADER *mh = MF_GetMetaHeader(hmf); UINT mfSize; @@ -1361,7 +1361,7 @@ UINT WINAPI GetWinMetaFileBits(HENHMETAFILE hemf, /* * The layout of the record looks something like this: - * + * * rdParm meaning * 0 Always 0? * 1 Always 6? @@ -1424,7 +1424,7 @@ static BOOL MF_Play_MetaCreateRegion( METARECORD *mr, HRGN hrgn ) DeleteObject( hrgn2 ); return TRUE; } - + /****************************************************************** * MF_Play_MetaExtTextOut @@ -1435,24 +1435,24 @@ static BOOL MF_Play_MetaCreateRegion( METARECORD *mr, HRGN hrgn ) static BOOL MF_Play_MetaExtTextOut(HDC16 hdc, METARECORD *mr) { LPINT16 dxx; - LPSTR sot; + LPSTR sot; DWORD len; WORD s1; s1 = mr->rdParm[2]; /* String length */ len = sizeof(METARECORD) + (((s1 + 1) >> 1) * 2) + 2 * sizeof(short) - + sizeof(UINT16) + (mr->rdParm[3] ? sizeof(RECT16) : 0); + + sizeof(UINT16) + (mr->rdParm[3] ? sizeof(RECT16) : 0); /* rec len without dx array */ sot = (LPSTR)&mr->rdParm[4]; /* start_of_text */ if (mr->rdParm[3]) sot += sizeof(RECT16); /* there is a rectangle, so add offset */ - + if (mr->rdSize == len / 2) dxx = NULL; /* determine if array present */ - else + else if (mr->rdSize == (len + s1 * sizeof(INT16)) / 2) - dxx = (LPINT16)(sot+(((s1+1)>>1)*2)); + dxx = (LPINT16)(sot+(((s1+1)>>1)*2)); else { TRACE("%s len: %ld\n", sot, mr->rdSize); WARN( @@ -1463,11 +1463,11 @@ static BOOL MF_Play_MetaExtTextOut(HDC16 hdc, METARECORD *mr) ExtTextOut16( hdc, mr->rdParm[1], /* X position */ mr->rdParm[0], /* Y position */ mr->rdParm[3], /* options */ - mr->rdParm[3] ? (LPRECT16) &mr->rdParm[4]:NULL, + mr->rdParm[3] ? (LPRECT16) &mr->rdParm[4]:NULL, /* rectangle */ sot, /* string */ s1, dxx); /* length, dx array */ - if (dxx) + if (dxx) TRACE("%s len: %ld dx0: %d\n", sot, mr->rdSize, dxx[0]); return TRUE; } diff --git a/objects/palette.c b/objects/palette.c index e577f5766d5..a5060565677 100644 --- a/objects/palette.c +++ b/objects/palette.c @@ -139,7 +139,7 @@ HPALETTE WINAPI CreatePalette( PALETTEOBJ * palettePtr; HPALETTE hpalette; int size; - + if (!palette) return 0; TRACE("entries=%i\n", palette->palNumEntries); @@ -148,7 +148,7 @@ HPALETTE WINAPI CreatePalette( if (!(palettePtr = GDI_AllocObject( size + sizeof(int*) +sizeof(GDIOBJHDR), PALETTE_MAGIC, &hpalette, &palette_funcs ))) return 0; memcpy( &palettePtr->logpalette, palette, size ); - PALETTE_ValidateFlags(palettePtr->logpalette.palPalEntry, + PALETTE_ValidateFlags(palettePtr->logpalette.palPalEntry, palettePtr->logpalette.palNumEntries); palettePtr->mapping = NULL; GDI_ReleaseObj( hpalette ); @@ -171,7 +171,7 @@ HPALETTE16 WINAPI CreateHalftonePalette16( return CreateHalftonePalette(hdc); } - + /*********************************************************************** * CreateHalftonePalette [GDI32.@] Creates a halftone palette * @@ -219,7 +219,7 @@ HPALETTE WINAPI CreateHalftonePalette( Palette.aEntries[i].peGreen=(i==2)?0x80:(i==3)?0x80:(i==6)?0x80:0; Palette.aEntries[i].peBlue=(i>3)?0x80:0; } - + for (i=7; i <= 12; i++) { switch(i) @@ -239,7 +239,7 @@ HPALETTE WINAPI CreateHalftonePalette( Palette.aEntries[i].peGreen=0xca; Palette.aEntries[i].peBlue=0xf0; break; - case 10: + case 10: Palette.aEntries[i].peRed=0xff; Palette.aEntries[i].peGreen=0xfb; Palette.aEntries[i].peBlue=0xf0; @@ -294,13 +294,13 @@ UINT WINAPI GetPaletteEntries( UINT numEntries; TRACE("hpal = %04x, count=%i\n", hpalette, count ); - + palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); if (!palPtr) return 0; - + /* NOTE: not documented but test show this to be the case */ if (count == 0) - { + { int rc = palPtr->logpalette.palNumEntries; GDI_ReleaseObj( hpalette ); return rc; @@ -309,8 +309,8 @@ UINT WINAPI GetPaletteEntries( numEntries = palPtr->logpalette.palNumEntries; if (start+count > numEntries) count = numEntries - start; if (entries) - { - if (start >= numEntries) + { + if (start >= numEntries) { GDI_ReleaseObj( hpalette ); return 0; @@ -359,7 +359,7 @@ UINT WINAPI SetPaletteEntries( if (!palPtr) return 0; numEntries = palPtr->logpalette.palNumEntries; - if (start >= numEntries) + if (start >= numEntries) { GDI_ReleaseObj( hpalette ); return 0; @@ -367,7 +367,7 @@ UINT WINAPI SetPaletteEntries( if (start+count > numEntries) count = numEntries - start; memcpy( &palPtr->logpalette.palPalEntry[start], entries, count * sizeof(PALETTEENTRY) ); - PALETTE_ValidateFlags(palPtr->logpalette.palPalEntry, + PALETTE_ValidateFlags(palPtr->logpalette.palPalEntry, palPtr->logpalette.palNumEntries); HeapFree( GetProcessHeap(), 0, palPtr->mapping ); palPtr->mapping = NULL; @@ -411,14 +411,14 @@ BOOL WINAPI ResizePalette( sizeof(int*) + sizeof(GDIOBJHDR); size += sizeof(int*) + sizeof(GDIOBJHDR); mapping = palPtr->mapping; - + if (!(palPtr = GDI_ReallocObject( size, hPal, palPtr ))) return FALSE; - if( mapping ) + if( mapping ) { - int *newMap = (int*) HeapReAlloc(GetProcessHeap(), 0, + int *newMap = (int*) HeapReAlloc(GetProcessHeap(), 0, mapping, cEntries * sizeof(int) ); - if(newMap == NULL) + if(newMap == NULL) { ERR("Can not resize mapping -- out of memory!\n"); GDI_ReleaseObj( hPal ); @@ -427,12 +427,12 @@ BOOL WINAPI ResizePalette( palPtr->mapping = newMap; } - if( cEntries > cPrevEnt ) + if( cEntries > cPrevEnt ) { if( mapping ) memset(palPtr->mapping + cPrevEnt, 0, (cEntries - cPrevEnt)*sizeof(int)); memset( (BYTE*)palPtr + prevsize, 0, size - prevsize ); - PALETTE_ValidateFlags((PALETTEENTRY*)((BYTE*)palPtr + prevsize), + PALETTE_ValidateFlags((PALETTEENTRY*)((BYTE*)palPtr + prevsize), cEntries - cPrevEnt ); } palPtr->logpalette.palNumEntries = cEntries; @@ -611,7 +611,7 @@ UINT WINAPI GetNearestPaletteIndex( if( palObj ) { - index = COLOR_PaletteLookupPixel(palObj->logpalette.palPalEntry, + index = COLOR_PaletteLookupPixel(palObj->logpalette.palPalEntry, palObj->logpalette.palNumEntries, NULL, color, FALSE ); @@ -731,7 +731,7 @@ HPALETTE16 WINAPI GDISelectPalette16( HDC16 hdc, HPALETTE16 hpal, WORD wBkg) prev = dc->hPalette; dc->hPalette = hpal; GDI_ReleaseObj( hdc ); - if (!wBkg) hPrimaryPalette = hpal; + if (!wBkg) hPrimaryPalette = hpal; return prev; } @@ -748,7 +748,7 @@ UINT16 WINAPI GDIRealizePalette16( HDC16 hdc ) if (!dc) return 0; TRACE("%04x...\n", hdc ); - + if(dc->hPalette != hLastRealizedPalette ) { if( dc->hPalette == GetStockObject( DEFAULT_PALETTE )) { @@ -814,7 +814,7 @@ UINT16 WINAPI RealizeDefaultPalette16( HDC16 hdc ) BOOL16 WINAPI IsDCCurrentPalette16(HDC16 hDC) { DC *dc = DC_GetDCPtr( hDC ); - if (dc) + if (dc) { BOOL bRet = dc->hPalette == hPrimaryPalette; GDI_ReleaseObj( hDC ); @@ -951,9 +951,9 @@ BOOL WINAPI GetICMProfileA(HDC hDC, LPDWORD lpcbName, LPSTR lpszFilename) /* behavior 1: if lpszFilename is NULL, return size of string and no error */ if ((DWORD)lpszFilename == (DWORD)0x00000000) return TRUE; - + /* behavior 2: if buffer size too small, return size of string and error */ - if (callerLen < strlen(WINEICM)) + if (callerLen < strlen(WINEICM)) { SetLastError(ERROR_INSUFFICIENT_BUFFER); return FALSE; diff --git a/objects/pen.c b/objects/pen.c index 9e73a133c87..fdb758040bf 100644 --- a/objects/pen.c +++ b/objects/pen.c @@ -61,7 +61,7 @@ HPEN16 WINAPI CreatePen16( INT16 style, INT16 width, COLORREF color ) TRACE("%d %d %06lx\n", style, width, color ); - logpen.lopnStyle = style; + logpen.lopnStyle = style; logpen.lopnWidth.x = width; logpen.lopnWidth.y = 0; logpen.lopnColor = color; @@ -79,7 +79,7 @@ HPEN WINAPI CreatePen( INT style, INT width, COLORREF color ) TRACE("%d %d %06lx\n", style, width, color ); - logpen.lopnStyle = style; + logpen.lopnStyle = style; logpen.lopnWidth.x = width; logpen.lopnWidth.y = 0; logpen.lopnColor = color; @@ -142,14 +142,14 @@ HPEN WINAPI ExtCreatePen( DWORD style, DWORD width, FIXME("Hatches not implemented\n"); if (!(penPtr = GDI_AllocObject( sizeof(PENOBJ), PEN_MAGIC, &hpen, &pen_funcs ))) return 0; - penPtr->logpen.lopnStyle = style & ~PS_TYPE_MASK; - - /* PS_USERSTYLE workaround */ + penPtr->logpen.lopnStyle = style & ~PS_TYPE_MASK; + + /* PS_USERSTYLE workaround */ if((penPtr->logpen.lopnStyle & PS_STYLE_MASK) == PS_USERSTYLE) - penPtr->logpen.lopnStyle = + penPtr->logpen.lopnStyle = (penPtr->logpen.lopnStyle & ~PS_STYLE_MASK) | PS_SOLID; - penPtr->logpen.lopnWidth.x = (style & PS_GEOMETRIC) ? width : 1; + penPtr->logpen.lopnWidth.x = (style & PS_GEOMETRIC) ? width : 1; penPtr->logpen.lopnWidth.y = 0; penPtr->logpen.lopnColor = brush->lbColor; GDI_ReleaseObj( hpen ); diff --git a/objects/region.c b/objects/region.c index ea220e11035..6b4cfe7aa53 100644 --- a/objects/region.c +++ b/objects/region.c @@ -51,13 +51,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -320,7 +320,7 @@ typedef struct { * the polygon by incrementing the y coordinate. We * keep a list of edges which the current scanline crosses, * sorted by x. This list is called the Active Edge Table (AET) - * As we change the y-coordinate, we update each entry in + * As we change the y-coordinate, we update each entry in * in the active edge table to reflect the edges new xcoord. * This list must be sorted at each scanline in case * two edges intersect. @@ -347,7 +347,7 @@ typedef struct { * for the winding number rule */ #define CLOCKWISE 1 -#define COUNTERCLOCKWISE -1 +#define COUNTERCLOCKWISE -1 typedef struct _EdgeTableEntry { INT ymax; /* ycoord at which we exit this edge. */ @@ -576,7 +576,7 @@ INT WINAPI OffsetRgn( HRGN hrgn, INT x, INT y ) if(x || y) { int nbox = obj->rgn->numRects; RECT *pbox = obj->rgn->rects; - + if(nbox) { while(nbox--) { pbox->left += x; @@ -706,9 +706,9 @@ BOOL WINAPI SetRectRgn( HRGN hrgn, INT left, INT top, { RGNOBJ * obj; - TRACE(" %04x %d,%d-%d,%d\n", + TRACE(" %04x %d,%d-%d,%d\n", hrgn, left, top, right, bottom ); - + if (!(obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ))) return FALSE; if (left > right) { INT tmp = left; left = right; right = tmp; } @@ -735,7 +735,7 @@ BOOL WINAPI SetRectRgn( HRGN hrgn, INT left, INT top, * * If either ellipse dimension is zero we call CreateRectRgn16 for its * `special' behaviour. -ve ellipse dimensions can result in GPFs under win3.1 - * we just let CreateRoundRectRgn convert them to +ve values. + * we just let CreateRoundRectRgn convert them to +ve values. */ HRGN16 WINAPI CreateRoundRectRgn16( INT16 left, INT16 top, @@ -902,7 +902,7 @@ HRGN WINAPI CreateEllipticRgnIndirect( const RECT *rect ) /*********************************************************************** * GetRegionData (GDI32.@) - * + * * MSDN: GetRegionData, Return Values: * * "If the function succeeds and dwCount specifies an adequate number of bytes, @@ -916,7 +916,7 @@ DWORD WINAPI GetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata) { DWORD size; RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ); - + TRACE(" %04x count = %ld, rgndata = %p\n", hrgn, count, rgndata); @@ -958,7 +958,7 @@ DWORD WINAPI GetRegionData16(HRGN16 hrgn, DWORD count, LPRGNDATA rgndata) /*********************************************************************** * ExtCreateRegion (GDI32.@) - * + * */ HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA* rgndata) { @@ -968,7 +968,7 @@ HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA* if( lpXform ) WARN("(Xform not implemented - ignored)\n"); - + if( rgndata->rdh.iType != RDH_RECTANGLES ) { /* FIXME: We can use CreatePolyPolygonRgn() here @@ -1015,7 +1015,7 @@ BOOL WINAPI PtInRegion( HRGN hrgn, INT x, INT y ) { RGNOBJ * obj; BOOL ret = FALSE; - + if ((obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ))) { int i; @@ -1055,11 +1055,11 @@ BOOL WINAPI RectInRegion( HRGN hrgn, const RECT *rect ) { RGNOBJ * obj; BOOL ret = FALSE; - + if ((obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ))) { RECT *pCurRect, *pRectEnd; - + /* this is (just) a useful optimization */ if ((obj->rgn->numRects > 0) && EXTENTCHECK(&obj->rgn->extents, rect)) @@ -1106,9 +1106,9 @@ BOOL WINAPI EqualRgn( HRGN hrgn1, HRGN hrgn2 ) RGNOBJ *obj1, *obj2; BOOL ret = FALSE; - if ((obj1 = (RGNOBJ *) GDI_GetObjPtr( hrgn1, REGION_MAGIC ))) + if ((obj1 = (RGNOBJ *) GDI_GetObjPtr( hrgn1, REGION_MAGIC ))) { - if ((obj2 = (RGNOBJ *) GDI_GetObjPtr( hrgn2, REGION_MAGIC ))) + if ((obj2 = (RGNOBJ *) GDI_GetObjPtr( hrgn2, REGION_MAGIC ))) { int i; @@ -1117,7 +1117,7 @@ BOOL WINAPI EqualRgn( HRGN hrgn1, HRGN hrgn2 ) { ret = TRUE; goto done; - + } if (obj1->rgn->extents.left != obj2->rgn->extents.left) goto done; if (obj1->rgn->extents.right != obj2->rgn->extents.right) goto done; @@ -1167,18 +1167,18 @@ BOOL REGION_FrameRgn( HRGN hDest, HRGN hSrc, INT x, INT y ) RGNOBJ *srcObj = (RGNOBJ*) GDI_GetObjPtr( hSrc, REGION_MAGIC ); if (!srcObj) return FALSE; - if (srcObj->rgn->numRects != 0) + if (srcObj->rgn->numRects != 0) { RGNOBJ* destObj = (RGNOBJ*) GDI_GetObjPtr( hDest, REGION_MAGIC ); RECT *pRect, *pEndRect; RECT tempRect; EMPTY_REGION( destObj->rgn ); - + pEndRect = srcObj->rgn->rects + srcObj->rgn->numRects; for(pRect = srcObj->rgn->rects; pRect < pEndRect; pRect++) { - tempRect.left = pRect->left - x; + tempRect.left = pRect->left - x; tempRect.top = pRect->top - y; tempRect.right = pRect->right + x; tempRect.bottom = pRect->bottom + y; @@ -1214,7 +1214,7 @@ INT WINAPI CombineRgn(HRGN hDest, HRGN hSrc1, HRGN hSrc2, INT mode) RGNOBJ *destObj = (RGNOBJ *) GDI_GetObjPtr( hDest, REGION_MAGIC); INT result = ERROR; - TRACE(" %04x,%04x -> %04x mode=%x\n", + TRACE(" %04x,%04x -> %04x mode=%x\n", hSrc1, hSrc2, hDest, mode ); if (destObj) { @@ -1223,7 +1223,7 @@ INT WINAPI CombineRgn(HRGN hDest, HRGN hSrc1, HRGN hSrc2, INT mode) if (src1Obj) { TRACE("dump src1Obj:\n"); - if(TRACE_ON(region)) + if(TRACE_ON(region)) REGION_DumpRegion(src1Obj->rgn); if (mode == RGN_COPY) { @@ -1237,7 +1237,7 @@ INT WINAPI CombineRgn(HRGN hDest, HRGN hSrc1, HRGN hSrc2, INT mode) if (src2Obj) { TRACE("dump src2Obj:\n"); - if(TRACE_ON(region)) + if(TRACE_ON(region)) REGION_DumpRegion(src2Obj->rgn); switch (mode) { @@ -1261,7 +1261,7 @@ INT WINAPI CombineRgn(HRGN hDest, HRGN hSrc1, HRGN hSrc2, INT mode) GDI_ReleaseObj( hSrc1 ); } TRACE("dump destObj:\n"); - if(TRACE_ON(region)) + if(TRACE_ON(region)) REGION_DumpRegion(destObj->rgn); GDI_ReleaseObj( hDest ); @@ -1320,7 +1320,7 @@ static void REGION_SetExtents (WINEREGION *pReg) static void REGION_CopyRegion(WINEREGION *dst, WINEREGION *src) { if (dst != src) /* don't want to copy to itself */ - { + { if (dst->size < src->numRects) { if (! (dst->rects = HeapReAlloc( GetProcessHeap(), 0, dst->rects, @@ -1385,7 +1385,7 @@ static INT REGION_Coalesce ( { pCurRect++; } - + if (pCurRect != pRegEnd) { /* @@ -1402,7 +1402,7 @@ static INT REGION_Coalesce ( curStart = pRegEnd - pReg->rects; pRegEnd = pReg->rects + pReg->numRects; } - + if ((curNumRects == prevNumRects) && (curNumRects != 0)) { pCurRect -= curNumRects; /* @@ -1470,7 +1470,7 @@ static INT REGION_Coalesce ( *pPrevRect++ = *pCurRect++; } while (pCurRect != pRegEnd); } - + } } return (curStart); @@ -1524,7 +1524,7 @@ static void REGION_RegionOp( RECT *r2BandEnd; /* End of current band in r2 */ INT top; /* Top of non-overlapping band */ INT bot; /* Bottom of non-overlapping band */ - + /* * Initialization: * set r1, r2, r1End and r2End appropriately, preserve the important @@ -1536,12 +1536,12 @@ static void REGION_RegionOp( r2 = reg2->rects; r1End = r1 + reg1->numRects; r2End = r2 + reg2->numRects; - + /* - * newReg may be one of the src regions so we can't empty it. We keep a + * newReg may be one of the src regions so we can't empty it. We keep a * note of its rects pointer (so that we can free them later), preserve its - * extents and simply set numRects to zero. + * extents and simply set numRects to zero. */ oldRects = newReg->rects; @@ -1556,13 +1556,13 @@ static void REGION_RegionOp( */ newReg->size = max(reg1->numRects,reg2->numRects) * 2; - if (! (newReg->rects = HeapAlloc( GetProcessHeap(), 0, + if (! (newReg->rects = HeapAlloc( GetProcessHeap(), 0, sizeof(RECT) * newReg->size ))) { newReg->size = 0; return; } - + /* * Initialize ybot and ytop. * In the upcoming loop, ybot and ytop serve different functions depending @@ -1580,7 +1580,7 @@ static void REGION_RegionOp( ybot = reg1->extents.top; else ybot = reg2->extents.top; - + /* * prevBand serves to mark the start of the previous band so rectangles * can be coalesced into larger rectangles. qv. miCoalesce, above. @@ -1591,7 +1591,7 @@ static void REGION_RegionOp( * array of rectangles. */ prevBand = 0; - + do { curBand = newReg->numRects; @@ -1608,13 +1608,13 @@ static void REGION_RegionOp( { r1BandEnd++; } - + r2BandEnd = r2; while ((r2BandEnd != r2End) && (r2BandEnd->top == r2->top)) { r2BandEnd++; } - + /* * First handle the band that doesn't intersect, if any. * @@ -1674,7 +1674,7 @@ static void REGION_RegionOp( (* overlapFunc) (newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot); } - + if (newReg->numRects != curBand) { prevBand = REGION_Coalesce (newReg, prevBand, curBand); @@ -1851,9 +1851,9 @@ static void REGION_IntersectRegion(WINEREGION *newReg, WINEREGION *reg1, (!EXTENTCHECK(®1->extents, ®2->extents))) newReg->numRects = 0; else - REGION_RegionOp (newReg, reg1, reg2, + REGION_RegionOp (newReg, reg1, reg2, (voidProcp) REGION_IntersectO, (voidProcp) NULL, (voidProcp) NULL); - + /* * Can't alter newReg's extents before we call miRegionOp because * it might be one of the source regions and miRegionOp depends @@ -1922,7 +1922,7 @@ static void REGION_UnionO (WINEREGION *pReg, RECT *r1, RECT *r1End, RECT *r2, RECT *r2End, INT top, INT bottom) { RECT *pNextRect; - + pNextRect = &pReg->rects[pReg->numRects]; #define MERGERECT(r) \ @@ -1947,7 +1947,7 @@ static void REGION_UnionO (WINEREGION *pReg, RECT *r1, RECT *r1End, pNextRect += 1; \ } \ r++; - + while ((r1 != r1End) && (r2 != r2End)) { if (r1->left < r2->left) @@ -1959,7 +1959,7 @@ static void REGION_UnionO (WINEREGION *pReg, RECT *r1, RECT *r1End, MERGERECT(r2); } } - + if (r1 != r1End) { do @@ -2005,7 +2005,7 @@ static void REGION_UnionRegion(WINEREGION *newReg, WINEREGION *reg1, /* * Region 1 completely subsumes region 2 */ - if ((reg1->numRects == 1) && + if ((reg1->numRects == 1) && (reg1->extents.left <= reg2->extents.left) && (reg1->extents.top <= reg2->extents.top) && (reg1->extents.right >= reg2->extents.right) && @@ -2019,7 +2019,7 @@ static void REGION_UnionRegion(WINEREGION *newReg, WINEREGION *reg1, /* * Region 2 completely subsumes region 1 */ - if ((reg2->numRects == 1) && + if ((reg2->numRects == 1) && (reg2->extents.left <= reg1->extents.left) && (reg2->extents.top <= reg1->extents.top) && (reg2->extents.right >= reg1->extents.right) && @@ -2030,7 +2030,7 @@ static void REGION_UnionRegion(WINEREGION *newReg, WINEREGION *reg1, return; } - REGION_RegionOp (newReg, reg1, reg2, (voidProcp) REGION_UnionO, + REGION_RegionOp (newReg, reg1, reg2, (voidProcp) REGION_UnionO, (voidProcp) REGION_UnionNonO, (voidProcp) REGION_UnionNonO); newReg->extents.left = min(reg1->extents.left, reg2->extents.left); @@ -2056,13 +2056,13 @@ static void REGION_UnionRegion(WINEREGION *newReg, WINEREGION *reg1, * pReg may be affected. * */ -static void REGION_SubtractNonO1 (WINEREGION *pReg, RECT *r, RECT *rEnd, +static void REGION_SubtractNonO1 (WINEREGION *pReg, RECT *r, RECT *rEnd, INT top, INT bottom) { RECT *pNextRect; - + pNextRect = &pReg->rects[pReg->numRects]; - + while (r != rEnd) { MEMCHECK(pReg, pNextRect, pReg->rects); @@ -2091,12 +2091,12 @@ static void REGION_SubtractNonO1 (WINEREGION *pReg, RECT *r, RECT *rEnd, * pReg may have rectangles added to it. * */ -static void REGION_SubtractO (WINEREGION *pReg, RECT *r1, RECT *r1End, +static void REGION_SubtractO (WINEREGION *pReg, RECT *r1, RECT *r1End, RECT *r2, RECT *r2End, INT top, INT bottom) { RECT *pNextRect; INT left; - + left = r1->left; pNextRect = &pReg->rects[pReg->numRects]; @@ -2205,7 +2205,7 @@ static void REGION_SubtractO (WINEREGION *pReg, RECT *r1, RECT *r1End, } return; } - + /*********************************************************************** * REGION_SubtractRegion * @@ -2229,8 +2229,8 @@ static void REGION_SubtractRegion(WINEREGION *regD, WINEREGION *regM, REGION_CopyRegion(regD, regM); return; } - - REGION_RegionOp (regD, regM, regS, (voidProcp) REGION_SubtractO, + + REGION_RegionOp (regD, regM, regS, (voidProcp) REGION_SubtractO, (voidProcp) REGION_SubtractNonO1, (voidProcp) NULL); /* @@ -2251,7 +2251,7 @@ static void REGION_XorRegion(WINEREGION *dr, WINEREGION *sra, { WINEREGION *tra, *trb; - if ((! (tra = REGION_AllocWineRegion(sra->numRects + 1))) || + if ((! (tra = REGION_AllocWineRegion(sra->numRects + 1))) || (! (trb = REGION_AllocWineRegion(srb->numRects + 1)))) return; REGION_SubtractRegion(tra,sra,srb); @@ -2265,7 +2265,7 @@ static void REGION_XorRegion(WINEREGION *dr, WINEREGION *sra, /************************************************************************** * * Poly Regions - * + * *************************************************************************/ #define LARGE_COORDINATE 0x7fffffff /* FIXME */ @@ -2293,7 +2293,7 @@ static void REGION_InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, */ pPrevSLL = &ET->scanlines; pSLL = pPrevSLL->next; - while (pSLL && (pSLL->scanline < scanline)) + while (pSLL && (pSLL->scanline < scanline)) { pPrevSLL = pSLL; pSLL = pSLL->next; @@ -2302,9 +2302,9 @@ static void REGION_InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, /* * reassign pSLL (pointer to ScanLineList) if necessary */ - if ((!pSLL) || (pSLL->scanline > scanline)) + if ((!pSLL) || (pSLL->scanline > scanline)) { - if (*iSLLBlock > SLLSPERBLOCK-1) + if (*iSLLBlock > SLLSPERBLOCK-1) { tmpSLLBlock = HeapAlloc( GetProcessHeap(), 0, sizeof(ScanLineListBlock)); if(!tmpSLLBlock) @@ -2330,7 +2330,7 @@ static void REGION_InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, */ prev = (EdgeTableEntry *)NULL; start = pSLL->edgelist; - while (start && (start->bres.minor_axis < ETE->bres.minor_axis)) + while (start && (start->bres.minor_axis < ETE->bres.minor_axis)) { prev = start; start = start->next; @@ -2347,7 +2347,7 @@ static void REGION_InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, * REGION_CreateEdgeTable * * This routine creates the edge table for - * scan converting polygons. + * scan converting polygons. * The Edge Table (ET) looks like: * * EdgeTable @@ -2367,7 +2367,7 @@ static void REGION_InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, * which an edge is initially entered. * */ -static void REGION_CreateETandAET(const INT *Count, INT nbpolygons, +static void REGION_CreateETandAET(const INT *Count, INT nbpolygons, const POINT *pts, EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock) { @@ -2377,7 +2377,7 @@ static void REGION_CreateETandAET(const INT *Count, INT nbpolygons, int iSLLBlock = 0; int dy; - + /* * initialize the Active Edge Table */ @@ -2401,7 +2401,7 @@ static void REGION_CreateETandAET(const INT *Count, INT nbpolygons, EndPt += count; if(count < 2) continue; - + PrevPt = EndPt; /* @@ -2409,19 +2409,19 @@ static void REGION_CreateETandAET(const INT *Count, INT nbpolygons, * In this loop we are dealing with two vertices at * a time -- these make up one edge of the polygon. */ - while (count--) + while (count--) { CurrPt = pts++; /* * find out which point is above and which is below. */ - if (PrevPt->y > CurrPt->y) + if (PrevPt->y > CurrPt->y) { bottom = PrevPt, top = CurrPt; pETEs->ClockWise = 0; } - else + else { bottom = CurrPt, top = PrevPt; pETEs->ClockWise = 1; @@ -2430,7 +2430,7 @@ static void REGION_CreateETandAET(const INT *Count, INT nbpolygons, /* * don't add horizontal edges to the Edge table. */ - if (bottom->y != top->y) + if (bottom->y != top->y) { pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */ @@ -2441,7 +2441,7 @@ static void REGION_CreateETandAET(const INT *Count, INT nbpolygons, dy = bottom->y - top->y; BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres); - REGION_InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, + REGION_InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock); if (PrevPt->y > ET->ymax) @@ -2471,9 +2471,9 @@ static void REGION_loadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) pPrevAET = AET; AET = AET->next; - while (ETEs) + while (ETEs) { - while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis)) + while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis)) { pPrevAET = AET; AET = AET->next; @@ -2495,13 +2495,13 @@ static void REGION_loadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) * * This routine links the AET by the * nextWETE (winding EdgeTableEntry) link for - * use by the winding number rule. The final + * use by the winding number rule. The final * Active Edge Table (AET) might look something * like: * * AET * ---------- --------- --------- - * |ymax | |ymax | |ymax | + * |ymax | |ymax | |ymax | * | ... | |... | |... | * |next |->|next |->|next |->... * |nextWETE| |nextWETE| |nextWETE| @@ -2519,7 +2519,7 @@ static void REGION_computeWAET(EdgeTableEntry *AET) AET->nextWETE = (EdgeTableEntry *)NULL; pWETE = AET; AET = AET->next; - while (AET) + while (AET) { if (AET->ClockWise) isInside++; @@ -2527,7 +2527,7 @@ static void REGION_computeWAET(EdgeTableEntry *AET) isInside--; if ((!inside && !isInside) || - ( inside && isInside)) + ( inside && isInside)) { pWETE->nextWETE = AET; pWETE = AET; @@ -2554,7 +2554,7 @@ static BOOL REGION_InsertionSort(EdgeTableEntry *AET) BOOL changed = FALSE; AET = AET->next; - while (AET) + while (AET) { pETEinsert = AET; pETEchase = AET; @@ -2562,7 +2562,7 @@ static BOOL REGION_InsertionSort(EdgeTableEntry *AET) pETEchase = pETEchase->back; AET = AET->next; - if (pETEchase != pETEinsert) + if (pETEchase != pETEinsert) { pETEchaseBackTMP = pETEchase->back; pETEinsert->back->next = AET; @@ -2587,7 +2587,7 @@ static void REGION_FreeStorage(ScanLineListBlock *pSLLBlock) { ScanLineListBlock *tmpSLLBlock; - while (pSLLBlock) + while (pSLLBlock) { tmpSLLBlock = pSLLBlock->next; HeapFree( GetProcessHeap(), 0, pSLLBlock ); @@ -2601,7 +2601,7 @@ static void REGION_FreeStorage(ScanLineListBlock *pSLLBlock) * * Create an array of rectangles from a list of points. */ -static int REGION_PtsToRegion(int numFullPtBlocks, int iCurPtBlock, +static int REGION_PtsToRegion(int numFullPtBlocks, int iCurPtBlock, POINTBLOCK *FirstPtBlock, WINEREGION *reg) { RECT *rects; @@ -2610,21 +2610,21 @@ static int REGION_PtsToRegion(int numFullPtBlocks, int iCurPtBlock, int i; RECT *extents; INT numRects; - + extents = ®->extents; - + numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1; - - if (!(reg->rects = HeapReAlloc( GetProcessHeap(), 0, reg->rects, + + if (!(reg->rects = HeapReAlloc( GetProcessHeap(), 0, reg->rects, sizeof(RECT) * numRects ))) return(0); - + reg->size = numRects; CurPtBlock = FirstPtBlock; rects = reg->rects - 1; numRects = 0; extents->left = LARGE_COORDINATE, extents->right = SMALL_COORDINATE; - + for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) { /* the loop uses 2 points per iteration */ i = NUMPTSTOBUFFER >> 1; @@ -2662,14 +2662,14 @@ static int REGION_PtsToRegion(int numFullPtBlocks, int iCurPtBlock, extents->bottom = 0; } reg->numRects = numRects; - + return(TRUE); } /*********************************************************************** * CreatePolyPolygonRgn (GDI32.@) */ -HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, +HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, INT nbpolygons, INT mode) { HRGN hrgn; @@ -2710,12 +2710,12 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, (Pts[2].x == Pts[3].x) && (Pts[3].y == Pts[0].y)))) { - SetRectRgn( hrgn, min(Pts[0].x, Pts[2].x), min(Pts[0].y, Pts[2].y), + SetRectRgn( hrgn, min(Pts[0].x, Pts[2].x), min(Pts[0].y, Pts[2].y), max(Pts[0].x, Pts[2].x), max(Pts[0].y, Pts[2].y) ); GDI_ReleaseObj( hrgn ); return hrgn; } - + for(poly = total = 0; poly < nbpolygons; poly++) total += Count[poly]; if (! (pETEs = HeapAlloc( GetProcessHeap(), 0, sizeof(EdgeTableEntry) * total ))) @@ -2727,7 +2727,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, REGION_CreateETandAET(Count, nbpolygons, Pts, &ET, &AET, pETEs, &SLLBlock); pSLL = ET.scanlines.next; curPtBlock = &FirstPtBlock; - + if (mode != WINDING) { /* * for each scanline @@ -2743,14 +2743,14 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, } pPrevAET = &AET; pAET = AET.next; - + /* * for each active edge */ while (pAET) { pts->x = pAET->bres.minor_axis, pts->y = y; pts++, iPts++; - + /* * send out the buffer */ @@ -2788,7 +2788,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, pPrevAET = &AET; pAET = AET.next; pWETE = pAET; - + /* * for each active edge */ @@ -2800,7 +2800,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, if (pWETE == pAET) { pts->x = pAET->bres.minor_axis, pts->y = y; pts++, iPts++; - + /* * send out the buffer */ @@ -2821,7 +2821,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, } EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); } - + /* * recompute the winding active edge table if * we just resorted or have exited an edge. @@ -2832,7 +2832,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, } } } - REGION_FreeStorage(SLLBlock.next); + REGION_FreeStorage(SLLBlock.next); REGION_PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region); for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) { @@ -2912,7 +2912,7 @@ INT WINAPI GetRandomRgn(HDC hDC, HRGN hRgn, DWORD dwCode) /* * On Windows NT/2000, * the region returned is in screen coordinates. - * On Windows 95/98, + * On Windows 95/98, * the region returned is in window coordinates */ vi.dwOSVersionInfoSize = sizeof(vi); @@ -2950,7 +2950,7 @@ static BOOL REGION_CropAndOffsetRegion(const POINT* off, const RECT *rect, WINER { if( off->x || off->y ) xrect = rgnDst->rects; - else + else return TRUE; } else @@ -3020,7 +3020,7 @@ empty: if((rgnDst != rgnSrc) && (rgnDst->size < (i = (clipb - clipa)))) { - rgnDst->rects = HeapReAlloc( GetProcessHeap(), 0, + rgnDst->rects = HeapReAlloc( GetProcessHeap(), 0, rgnDst->rects, i * sizeof(RECT)); if( !rgnDst->rects ) return FALSE; rgnDst->size = i; @@ -3103,9 +3103,9 @@ HRGN REGION_CropRgn( HRGN hDst, HRGN hSrc, const RECT *lpRect, const POINT *lpPt { /* Optimization of the following generic code: - HRGN h; + HRGN h; - if( lpRect ) + if( lpRect ) h = CreateRectRgn( lpRect->left, lpRect->top, lpRect->right, lpRect->bottom ); else h = CreateRectRgn( 0, 0, 0, 0 ); @@ -3157,7 +3157,7 @@ HRGN REGION_CropRgn( HRGN hDst, HRGN hSrc, const RECT *lpRect, const POINT *lpPt TRACE("src %p -> dst %p (%i,%i)-(%i,%i) by (%li,%li)\n", objSrc->rgn, rgnDst, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, lpPt->x, lpPt->y ); else - TRACE("src %p -> dst %p by (%li,%li)\n", objSrc->rgn, rgnDst, lpPt->x, lpPt->y ); + TRACE("src %p -> dst %p by (%li,%li)\n", objSrc->rgn, rgnDst, lpPt->x, lpPt->y ); if( REGION_CropAndOffsetRegion( lpPt, lpRect, objSrc->rgn, rgnDst ) == FALSE ) { diff --git a/objects/text.c b/objects/text.c index 79e6a4c272b..fae786dc852 100644 --- a/objects/text.c +++ b/objects/text.c @@ -115,7 +115,7 @@ BOOL16 WINAPI ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags, lpdx32 = (LPINT)HeapAlloc( GetProcessHeap(),0, sizeof(INT)*count ); if(lpdx32 == NULL) return FALSE; for (i=count;i--;) lpdx32[i]=lpDx[i]; - } + } if (lprect) CONV_RECT16TO32(lprect,&rect32); ret = ExtTextOutA(hdc,x,y,flags,lprect?&rect32:NULL,str,count,lpdx32); if (lpdx32) HeapFree( GetProcessHeap(), 0, lpdx32 ); @@ -273,7 +273,7 @@ UINT WINAPI GetTextCharsetInfo( * Draw several Strings */ BOOL WINAPI PolyTextOutA ( - HDC hdc, /* [in] Handle to device context */ + HDC hdc, /* [in] Handle to device context */ PPOLYTEXTA pptxt, /* [in] Array of strings */ INT cStrings /* [in] Number of strings in array */ ) @@ -290,8 +290,8 @@ BOOL WINAPI PolyTextOutA ( * * Draw several Strings */ -BOOL WINAPI PolyTextOutW ( - HDC hdc, /* [in] Handle to device context */ +BOOL WINAPI PolyTextOutW ( + HDC hdc, /* [in] Handle to device context */ PPOLYTEXTW pptxt, /* [in] Array of strings */ INT cStrings /* [in] Number of strings in array */ ) diff --git a/ole/ole2nls.c b/ole/ole2nls.c index fc969da4a67..c63aa42e57d 100644 --- a/ole/ole2nls.c +++ b/ole/ole2nls.c @@ -42,10 +42,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(string); -/* Locale name to id map. used by EnumSystemLocales, GetLocaleInfoA +/* Locale name to id map. used by EnumSystemLocales, GetLocaleInfoA * MUST contain all #defines from winnls.h * last entry has NULL name, 0 id. - */ + */ #define LOCALE_ENTRY(x) {#x,LOCALE_##x} static const struct tagLOCALE_NAME2ID { const char *name; @@ -368,17 +368,17 @@ LANGID WINAPI GetUserDefaultLangID(void) ok: if (!strcmp(buf,"POSIX") || !strcmp(buf,"C")) return userLCID = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); - + lang=buf; - + do { next=strchr(lang,':'); if (next) *next++='\0'; dialect=strchr(lang,'@'); if (dialect) *dialect++='\0'; charset=strchr(lang,'.'); if (charset) *charset++='\0'; country=strchr(lang,'_'); if (country) *country++='\0'; - + userLCID = NLS_GetLanguageID(lang, country, charset, dialect); - + lang=next; } while (lang && !userLCID); @@ -411,7 +411,7 @@ LCID WINAPI ConvertDefaultLocale (LCID lcid) return GetUserDefaultLCID(); case LOCALE_NEUTRAL: return MAKELCID (LANG_NEUTRAL, SUBLANG_NEUTRAL); - } + } return MAKELANGID( PRIMARYLANGID(lcid), SUBLANG_NEUTRAL); } @@ -438,14 +438,14 @@ static INT NLS_LoadStringExW(HMODULE hModule, LANGID lang_id, UINT res_id, LPWST if(!hrsrc) return 0; hmem = LoadResource(hModule, hrsrc); if(!hmem) return 0; - + p = LockResource(hmem); string_num = res_id & 0x000f; for(i = 0; i < string_num; i++) p += *p + 1; - + TRACE("strlen = %d\n", (int)*p ); - + if (buffer == NULL) return *p; i = min(buflen - 1, *p); if (i > 0) { @@ -464,7 +464,7 @@ static INT NLS_LoadStringExW(HMODULE hModule, LANGID lang_id, UINT res_id, LPWST /****************************************************************************** * GetLocaleInfoA (KERNEL32.@) * - * NOTES + * NOTES * LANG_NEUTRAL is equal to LOCALE_SYSTEM_DEFAULT * * MS online documentation states that the string returned is NULL terminated @@ -490,7 +490,7 @@ INT WINAPI GetLocaleInfoA(LCID lcid,LCTYPE LCType,LPSTR buf,INT len) if (lcid == LOCALE_NEUTRAL || lcid == LANG_SYSTEM_DEFAULT) { lcid = GetSystemDefaultLCID(); - } + } else if (lcid == LANG_USER_DEFAULT) /*0x800*/ { lcid = GetUserDefaultLCID(); @@ -511,10 +511,10 @@ INT WINAPI GetLocaleInfoA(LCID lcid,LCTYPE LCType,LPSTR buf,INT len) sprintf( acRealKey, "Control Panel\\International\\%s", pacKey ); - if ( RegOpenKeyExA( HKEY_CURRENT_USER, acRealKey, + if ( RegOpenKeyExA( HKEY_CURRENT_USER, acRealKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS ) { - if ( RegQueryValueExA( hKey, NULL, NULL, NULL, (LPBYTE)acBuffer, + if ( RegQueryValueExA( hKey, NULL, NULL, NULL, (LPBYTE)acBuffer, &dwBufferSize ) == ERROR_SUCCESS ) { retString = acBuffer; @@ -559,7 +559,7 @@ INT WINAPI GetLocaleInfoA(LCID lcid,LCTYPE LCType,LPSTR buf,INT len) "and submit patch for inclusion into the next Wine release.\n", retString, LOWORD(lcid)); SetLastError(ERROR_INVALID_PARAMETER); - return 0; + return 0; } /* a FONTSIGNATURE is not a string, just 6 DWORDs */ @@ -592,7 +592,7 @@ INT WINAPI GetLocaleInfoA(LCID lcid,LCTYPE LCType,LPSTR buf,INT len) INT WINAPI GetLocaleInfoW(LCID lcid,LCTYPE LCType,LPWSTR wbuf,INT len) { WORD wlen; LPSTR abuf; - + if (len && (! wbuf) ) { SetLastError(ERROR_INSUFFICIENT_BUFFER); return 0; @@ -713,7 +713,7 @@ static char *GetLocaleSubkeyName( DWORD lctype ) pacKey = "sCurrency"; break; - /* The following are not listed under MSDN as supported, + /* The following are not listed under MSDN as supported, * but seem to be used and also stored in the registry. */ @@ -749,10 +749,10 @@ BOOL WINAPI SetLocaleInfoA(LCID lcid, LCTYPE lctype, LPCSTR data) if ( (pacKey = GetLocaleSubkeyName(lctype)) ) { sprintf( acRealKey, "Control Panel\\International\\%s", pacKey ); - if ( RegCreateKeyA( HKEY_CURRENT_USER, acRealKey, + if ( RegCreateKeyA( HKEY_CURRENT_USER, acRealKey, &hKey ) == ERROR_SUCCESS ) { - if ( RegSetValueExA( hKey, NULL, 0, REG_SZ, + if ( RegSetValueExA( hKey, NULL, 0, REG_SZ, data, strlen(data)+1 ) != ERROR_SUCCESS ) { ERR("SetLocaleInfoA: %s did not work\n", pacKey ); @@ -851,39 +851,39 @@ DWORD WINAPI VerLanguageNameW( UINT wLang, LPWSTR szLang, UINT nSize ) return GetLocaleInfoW(MAKELCID(wLang, SORT_DEFAULT), LOCALE_SENGLANGUAGE, szLang, nSize); } - + static const unsigned char LCM_Unicode_LUT[] = { - 6 , 3, /* - 1 */ - 6 , 4, /* - 2 */ - 6 , 5, /* - 3 */ - 6 , 6, /* - 4 */ - 6 , 7, /* - 5 */ - 6 , 8, /* - 6 */ - 6 , 9, /* - 7 */ - 6 , 10, /* - 8 */ - 7 , 5, /* - 9 */ - 7 , 6, /* - 10 */ - 7 , 7, /* - 11 */ - 7 , 8, /* - 12 */ - 7 , 9, /* - 13 */ - 6 , 11, /* - 14 */ - 6 , 12, /* - 15 */ - 6 , 13, /* - 16 */ - 6 , 14, /* - 17 */ - 6 , 15, /* - 18 */ - 6 , 16, /* - 19 */ - 6 , 17, /* - 20 */ - 6 , 18, /* - 21 */ - 6 , 19, /* - 22 */ - 6 , 20, /* - 23 */ - 6 , 21, /* - 24 */ - 6 , 22, /* - 25 */ - 6 , 23, /* - 26 */ - 6 , 24, /* - 27 */ - 6 , 25, /* - 28 */ - 6 , 26, /* - 29 */ - 6 , 27, /* - 30 */ - 6 , 28, /* - 31 */ + 6 , 3, /* - 1 */ + 6 , 4, /* - 2 */ + 6 , 5, /* - 3 */ + 6 , 6, /* - 4 */ + 6 , 7, /* - 5 */ + 6 , 8, /* - 6 */ + 6 , 9, /* - 7 */ + 6 , 10, /* - 8 */ + 7 , 5, /* - 9 */ + 7 , 6, /* - 10 */ + 7 , 7, /* - 11 */ + 7 , 8, /* - 12 */ + 7 , 9, /* - 13 */ + 6 , 11, /* - 14 */ + 6 , 12, /* - 15 */ + 6 , 13, /* - 16 */ + 6 , 14, /* - 17 */ + 6 , 15, /* - 18 */ + 6 , 16, /* - 19 */ + 6 , 17, /* - 20 */ + 6 , 18, /* - 21 */ + 6 , 19, /* - 22 */ + 6 , 20, /* - 23 */ + 6 , 21, /* - 24 */ + 6 , 22, /* - 25 */ + 6 , 23, /* - 26 */ + 6 , 24, /* - 27 */ + 6 , 25, /* - 28 */ + 6 , 26, /* - 29 */ + 6 , 27, /* - 30 */ + 6 , 28, /* - 31 */ 7 , 2, /* - 32 */ 7 , 28, /* ! - 33 */ 7 , 29, /* " - 34 */ /* " */ @@ -1113,7 +1113,7 @@ static const unsigned char LCM_Unicode_LUT_2[] = { 33, 44, 145 }; #define LCM_Diacritic_Start 131 -static const unsigned char LCM_Diacritic_LUT[] = { +static const unsigned char LCM_Diacritic_LUT[] = { 123, /* ƒ - 131 */ 2, /* „ - 132 */ 2, /* … - 133 */ @@ -1244,11 +1244,11 @@ static const unsigned char LCM_Diacritic_LUT[] = { /****************************************************************************** * OLE2NLS_isPunctuation [INTERNAL] */ -static int OLE2NLS_isPunctuation(unsigned char c) +static int OLE2NLS_isPunctuation(unsigned char c) { - /* "punctuation character" in this context is a character which is + /* "punctuation character" in this context is a character which is considered "less important" during word sort comparison. - See LCMapString implementation for the precise definition + See LCMapString implementation for the precise definition of "less important". */ return (LCM_Unicode_LUT[-2+2*c]==6); @@ -1257,9 +1257,9 @@ static int OLE2NLS_isPunctuation(unsigned char c) /****************************************************************************** * OLE2NLS_isNonSpacing [INTERNAL] */ -static int OLE2NLS_isNonSpacing(unsigned char c) +static int OLE2NLS_isNonSpacing(unsigned char c) { - /* This function is used by LCMapStringA. Characters + /* This function is used by LCMapStringA. Characters for which it returns true are ignored when mapping a string with NORM_IGNORENONSPACE */ return ((c==136) || (c==170) || (c==186)); @@ -1269,9 +1269,9 @@ static int OLE2NLS_isNonSpacing(unsigned char c) * OLE2NLS_isSymbol [INTERNAL] * FIXME: handle current locale */ -static int OLE2NLS_isSymbol(unsigned char c) +static int OLE2NLS_isSymbol(unsigned char c) { - /* This function is used by LCMapStringA. Characters + /* This function is used by LCMapStringA. Characters for which it returns true are ignored when mapping a string with NORM_IGNORESYMBOLS */ return ( (c!=0) && !(isalpha(c) || isdigit(c)) ); @@ -1300,20 +1300,20 @@ static int identity(int c) * * NOTES * If called with scrlen = -1, the function will compute the length - * of the 0-terminated string strsrc by itself. - * - * If called with dstlen = 0, returns the buffer length that + * of the 0-terminated string strsrc by itself. + * + * If called with dstlen = 0, returns the buffer length that * would be required. * * NORM_IGNOREWIDTH means to compare ASCII and wide characters - * as if they are equal. + * as if they are equal. * In the only code page implemented so far, there may not be * wide characters in strings passed to LCMapStringA, * so there is nothing to be done for this flag. */ INT WINAPI LCMapStringA( - LCID lcid, /* [in] locale identifier created with MAKELCID; - LOCALE_SYSTEM_DEFAULT and LOCALE_USER_DEFAULT are + LCID lcid, /* [in] locale identifier created with MAKELCID; + LOCALE_SYSTEM_DEFAULT and LOCALE_USER_DEFAULT are predefined values. */ DWORD mapflags, /* [in] flags */ LPCSTR srcstr, /* [in] source buffer */ @@ -1333,7 +1333,7 @@ INT WINAPI LCMapStringA( SetLastError(ERROR_INVALID_PARAMETER); return 0; } - if (srclen == -1) + if (srclen == -1) srclen = strlen(srcstr) + 1 ; /* (include final '\0') */ #define LCMAPSTRINGA_SUPPORTED_FLAGS (LCMAP_UPPERCASE | \ @@ -1344,7 +1344,7 @@ INT WINAPI LCMapStringA( SORT_STRINGSORT | \ NORM_IGNOREWIDTH | \ NORM_IGNOREKANATYPE) - /* FIXME: as long as we don't support Katakana nor Hiragana + /* FIXME: as long as we don't support Katakana nor Hiragana * characters, we can support NORM_IGNOREKANATYPE */ if (mapflags & ~LCMAPSTRINGA_SUPPORTED_FLAGS) @@ -1364,13 +1364,13 @@ INT WINAPI LCMapStringA( if ( !(mapflags & LCMAP_SORTKEY) ) { int i,j; - int (*f)(int) = identity; + int (*f)(int) = identity; int flag_ignorenonspace = mapflags & NORM_IGNORENONSPACE; int flag_ignoresymbols = mapflags & NORM_IGNORESYMBOLS; if (flag_ignorenonspace || flag_ignoresymbols) { - /* For some values of mapflags, the length of the resulting + /* For some values of mapflags, the length of the resulting string is not known at this point. Windows does map the string and does not SetLastError ERROR_INSUFFICIENT_BUFFER in these cases. */ @@ -1389,8 +1389,8 @@ INT WINAPI LCMapStringA( else { if (dstlen==0) - return srclen; - if (dstlen=0) && (LCM_Diacritic_LUT[ofs]!=2)) @@ -1454,7 +1454,7 @@ INT WINAPI LCMapStringA( } if (mapflags & NORM_IGNORECASE) - case_len=0; + case_len=0; if (mapflags & NORM_IGNORENONSPACE) diacritic_len=0; @@ -1465,7 +1465,7 @@ INT WINAPI LCMapStringA( + 4 /* four '\1' separators */ + 1 ; /* terminal '\0' */ if (dstlen==0) - return room; + return room; else if (dstlen> 4; type &= 15; - if (!flag_stringsort && OLE2NLS_isPunctuation(source_char)) + if (!flag_stringsort && OLE2NLS_isPunctuation(source_char)) { WORD encrypted_location = (1<<15) + 7 + 4*count; *delayed_punctuation_component++ = (unsigned char) (encrypted_location>>8); @@ -1508,14 +1508,14 @@ INT WINAPI LCMapStringA( compatible with numerical comparison */ *delayed_punctuation_component++ = type; - *delayed_punctuation_component++ = LCM_Unicode_LUT[-1+2*source_char]; - /* assumption : a punctuation character is never a + *delayed_punctuation_component++ = LCM_Unicode_LUT[-1+2*source_char]; + /* assumption : a punctuation character is never a double or accented letter */ } else { dststr[2*count] = type; - dststr[2*count+1] = LCM_Unicode_LUT[-1+2*source_char]; + dststr[2*count+1] = LCM_Unicode_LUT[-1+2*source_char]; if (longcode) { if (count longcode = 1 - 32 in the first column of LCM_Unicode_LUT --> longcode = 2 + dststr[2*count+1] = *(LCM_Unicode_LUT_2 - 1 + longcode); + /* 16 in the first column of LCM_Unicode_LUT --> longcode = 1 + 32 in the first column of LCM_Unicode_LUT --> longcode = 2 48 in the first column of LCM_Unicode_LUT --> longcode = 3 */ } @@ -1547,7 +1547,7 @@ INT WINAPI LCMapStringA( return room; } } - + /************************************************************************* * LCMapStringW [KERNEL32.@] * @@ -1562,24 +1562,24 @@ INT WINAPI LCMapStringW( INT dstlen) { int i; - + TRACE("(0x%04lx,0x%08lx,%p,%d,%p,%d)\n", lcid, mapflags, srcstr, srclen, dststr, dstlen); - + if ( ((dstlen!=0) && (dststr==NULL)) || (srcstr==NULL) ) { ERR("(src=%p,dst=%p): Invalid NULL string\n", srcstr, dststr); SetLastError(ERROR_INVALID_PARAMETER); return 0; } - if (srclen==-1) + if (srclen==-1) srclen = strlenW(srcstr)+1; /* FIXME: Both this function and it's companion LCMapStringA() * completely ignore the "lcid" parameter. In place of the "lcid" * parameter the application must set the "LC_COLLATE" or "LC_ALL" * environment variable prior to invoking this function. */ - if (mapflags & LCMAP_SORTKEY) + if (mapflags & LCMAP_SORTKEY) { /* Possible values of LC_COLLATE. */ char *lc_collate_default = 0; /* value prior to this function */ @@ -1636,7 +1636,7 @@ INT WINAPI LCMapStringW( /* FIXME: Prior to to setting the LC_COLLATE locale category the * current value is backed up so it can be restored after the * last LC_COLLATE sensitive function returns. - * + * * Even though the locale is adjusted for a minimum amount of * time a race condition exists where other threads may be * affected if they invoke LC_COLLATE sensitive functions. One @@ -1686,7 +1686,7 @@ INT WINAPI LCMapStringW( else if(returned_len > src_native_len) { src_native[src_native_len - 1] = 0; - ERR("wcstombs returned a string (%s) that was longer (%d bytes) " + ERR("wcstombs returned a string (%s) that was longer (%d bytes) " "than expected (%d bytes).\n", src_native, returned_len, dst_native_len); @@ -1728,11 +1728,11 @@ INT WINAPI LCMapStringW( * various tables as it is done in LCMapStringA(). However, I'm * not sure what those tables are. */ returned_len = strxfrm(dst_native, src_native, dst_native_len) + 1; - + if(returned_len > dst_native_len) { dst_native[dst_native_len - 1] = 0; - ERR("strxfrm returned a string (%s) that was longer (%d bytes) " + ERR("strxfrm returned a string (%s) that was longer (%d bytes) " "than expected (%d bytes).\n", dst_native, returned_len, dst_native_len); @@ -1747,7 +1747,7 @@ INT WINAPI LCMapStringW( return 0; } dst_native_len = returned_len; - + TRACE("dst_native = %s dst_native_len = %d\n", dst_native, dst_native_len); @@ -1770,7 +1770,7 @@ INT WINAPI LCMapStringW( /* Restore LC_COLLATE now that the last LC_COLLATE sensitive * function has returned. */ - setlocale(LC_COLLATE, lc_collate_default); + setlocale(LC_COLLATE, lc_collate_default); if(returned_len == 0) { @@ -1787,7 +1787,7 @@ INT WINAPI LCMapStringW( { if(returned_len > dstlen) { - ERR("mbstowcs returned a string that was longer (%d chars) " + ERR("mbstowcs returned a string that was longer (%d chars) " "than the buffer provided (%d chars).\n", returned_len, dstlen); SetLastError(ERROR_INSUFFICIENT_BUFFER); @@ -1795,7 +1795,7 @@ INT WINAPI LCMapStringW( if(src_native) HeapFree(GetProcessHeap(), 0, src_native); if(dst_native) HeapFree(GetProcessHeap(), 0, dst_native); if(dststr_libc) HeapFree(GetProcessHeap(), 0, dststr_libc); - return 0; + return 0; } dstlen = returned_len; @@ -1823,11 +1823,11 @@ INT WINAPI LCMapStringW( } else { - int (*f)(int)=identity; + int (*f)(int)=identity; if (dstlen==0) - return srclen; - if (dstlenwYear,xtime->wMonth,xtime->wDayOfWeek,xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond, _format, _format, date, datelen); - + if(datelen == 0) { FIXME("datelen = 0, returning 255\n"); return 255; @@ -2049,11 +2049,11 @@ static INT OLE_GetFormatA(LCID locale, count = 0; inquote = 0; Overflow = 0; type = '\0'; date[0] = buf[0] = '\0'; - + strcpy(format,_format); /* alter the formatstring, while it works for all languages now in wine - its possible that it fails when the time looks like ss:mm:hh as example*/ + its possible that it fails when the time looks like ss:mm:hh as example*/ if (tflags & (TIME_NOMINUTESORSECONDS)) { if ((pos = strstr ( format, ":mm"))) { memcpy ( pos, pos+3, strlen(format)-(pos-format)-2 ); @@ -2064,7 +2064,7 @@ static INT OLE_GetFormatA(LCID locale, { memcpy ( pos, pos+3, strlen(format)-(pos-format)-2 ); } } - + for (inpos = 0;; inpos++) { /* TRACE("STATE inpos=%2d outpos=%2d count=%d inquote=%d type=%c buf,date = %c,%c\n", inpos, outpos, count, inquote, type, buf[inpos], date[outpos]); */ if (inquote) { @@ -2100,8 +2100,8 @@ static INT OLE_GetFormatA(LCID locale, + (xtime->wDayOfWeek+6)%7, buf, sizeof(buf)); } else if (count == 3) { - GetLocaleInfoA(locale, - LOCALE_SABBREVDAYNAME1 + GetLocaleInfoA(locale, + LOCALE_SABBREVDAYNAME1 + (xtime->wDayOfWeek+6)%7, buf, sizeof(buf)); } else { @@ -2109,7 +2109,7 @@ static INT OLE_GetFormatA(LCID locale, } } else if (type == 'M') { if (count == 3) { - GetLocaleInfoA(locale, + GetLocaleInfoA(locale, LOCALE_SABBREVMONTHNAME1 + xtime->wMonth - 1, buf, sizeof(buf)); @@ -2156,16 +2156,16 @@ static INT OLE_GetFormatA(LCID locale, } else if (count == 2) { /* sprintf(buf, "%s", (xtime->wHour < 12) ? "AM" : "PM"); */ GetLocaleInfoA(locale, - (xtime->wHour<12) + (xtime->wHour<12) ? LOCALE_S1159 : LOCALE_S2359, buf, sizeof(buf)); } }; - /* we need to check the next char in the format string + /* we need to check the next char in the format string again, no matter what happened */ inpos--; - + /* add the contents of buf to the output */ buflen = strlen(buf); if (outpos + buflen < datelen) { @@ -2210,7 +2210,7 @@ static INT OLE_GetFormatA(LCID locale, return 0; } } - + if (Overflow) { SetLastError(ERROR_INSUFFICIENT_BUFFER); }; @@ -2220,7 +2220,7 @@ static INT OLE_GetFormatA(LCID locale, /* sanity check */ if (outpos > datelen-1) outpos = datelen-1; date[outpos] = '\0'; - + TRACE("returns string '%s', len %d\n", date, outpos); return outpos; } @@ -2254,7 +2254,7 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, locale, flags, tflags, xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond, debugstr_w(format), format, output, outlen); - + if(outlen == 0) { FIXME("outlen = 0, returning 255\n"); return 255; @@ -2266,7 +2266,7 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, inquote = Overflow = 0; /* this is really just a sanity check */ output[0] = buf[0] = 0; - + /* this loop is the core of the function */ for (inpos = 0; /* we have several break points */ ; inpos++) { if (inquote) { @@ -2286,7 +2286,7 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, output[outpos++] = format[inpos]; /* copy input */ if (outpos > outlen) { Overflow = 1; - output[outpos-1] = 0; + output[outpos-1] = 0; break; } } @@ -2385,7 +2385,7 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, break; } - /* no matter what happened, we need to check this next + /* no matter what happened, we need to check this next character the next time we loop through */ inpos--; @@ -2404,8 +2404,8 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, count = 0; type = '\0'; } else if (format[inpos] == 0) { - /* we can't check for this at the beginning, because that - would keep us from printing a format spec that ended the + /* we can't check for this at the beginning, because that + would keep us from printing a format spec that ended the string */ output[outpos] = 0; break; /* NORMAL EXIT */ @@ -2445,9 +2445,9 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, output[outpos] = '0'; TRACE(" returning %s\n", debugstr_w(output)); - + return (!Overflow) ? outlen : 0; - + } @@ -2475,9 +2475,9 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, */ INT WINAPI GetDateFormatA(LCID locale,DWORD flags, const SYSTEMTIME* xtime, - LPCSTR format, LPSTR date,INT datelen) + LPCSTR format, LPSTR date,INT datelen) { - + char format_buf[40]; LPCSTR thisformat; SYSTEMTIME t; @@ -2489,11 +2489,11 @@ INT WINAPI GetDateFormatA(LCID locale,DWORD flags, TRACE("(0x%04lx,0x%08lx,%p,%s,%p,%d)\n", locale,flags,xtime,format,date,datelen); - + if (!locale) { locale = LOCALE_SYSTEM_DEFAULT; }; - + if (locale == LOCALE_SYSTEM_DEFAULT) { thislocale = GetSystemDefaultLCID(); } else if (locale == LOCALE_USER_DEFAULT) { @@ -2514,13 +2514,13 @@ INT WINAPI GetDateFormatA(LCID locale,DWORD flags, SetLastError(ERROR_INVALID_PARAMETER); return 0; } - FileTimeToSystemTime(&ft,&t); - + FileTimeToSystemTime(&ft,&t); + }; thistime = &t; if (format == NULL) { - GetLocaleInfoA(thislocale, ((flags&DATE_LONGDATE) + GetLocaleInfoA(thislocale, ((flags&DATE_LONGDATE) ? LOCALE_SLONGDATE : LOCALE_SSHORTDATE), format_buf, sizeof(format_buf)); @@ -2529,10 +2529,10 @@ INT WINAPI GetDateFormatA(LCID locale,DWORD flags, thisformat = format; }; - - ret = OLE_GetFormatA(thislocale, flags, 0, thistime, thisformat, + + ret = OLE_GetFormatA(thislocale, flags, 0, thistime, thisformat, date, datelen); - + TRACE( "GetDateFormatA() returning %d, with data=%s\n", @@ -2555,11 +2555,11 @@ INT WINAPI GetDateFormatW(LCID locale,DWORD flags, { unsigned short datearr[] = {'1','9','9','4','-','1','-','1',0}; - FIXME("STUB (should call OLE_GetFormatW)\n"); + FIXME("STUB (should call OLE_GetFormatW)\n"); lstrcpynW(date, datearr, datelen); return ( datelen < 9) ? datelen : 9; - - + + } /************************************************************************** @@ -2568,7 +2568,7 @@ INT WINAPI GetDateFormatW(LCID locale,DWORD flags, BOOL WINAPI EnumDateFormatsA( DATEFMT_ENUMPROCA lpDateFmtEnumProc, LCID Locale, DWORD dwFlags) { - LCID Loc = GetUserDefaultLCID(); + LCID Loc = GetUserDefaultLCID(); if(!lpDateFmtEnumProc) { SetLastError(ERROR_INVALID_PARAMETER); @@ -2594,11 +2594,11 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("d. MMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - } + } case 0x0000040c: /* (Loc,"fr_FR") */ { @@ -2616,7 +2616,7 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } @@ -2637,14 +2637,14 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("d MMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } - case 0x00000809: /* (Loc,"en_UK") */ - { + case 0x00000809: /* (Loc,"en_UK") */ + { switch(dwFlags) { case DATE_SHORTDATE: @@ -2658,14 +2658,14 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } - case 0x00000c09: /* (Loc,"en_AU") */ - { + case 0x00000c09: /* (Loc,"en_AU") */ + { switch(dwFlags) { case DATE_SHORTDATE: @@ -2678,14 +2678,14 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } - case 0x00001009: /* (Loc,"en_CA") */ - { + case 0x00001009: /* (Loc,"en_CA") */ + { switch(dwFlags) { case DATE_SHORTDATE: @@ -2699,14 +2699,14 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("MMMM d, yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } - case 0x00001409: /* (Loc,"en_NZ") */ - { + case 0x00001409: /* (Loc,"en_NZ") */ + { switch(dwFlags) { case DATE_SHORTDATE: @@ -2719,14 +2719,14 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("dddd, d MMMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } - case 0x00001809: /* (Loc,"en_IE") */ - { + case 0x00001809: /* (Loc,"en_IE") */ + { switch(dwFlags) { case DATE_SHORTDATE: @@ -2739,14 +2739,14 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } - case 0x00001c09: /* (Loc,"en_ZA") */ - { + case 0x00001c09: /* (Loc,"en_ZA") */ + { switch(dwFlags) { case DATE_SHORTDATE: @@ -2756,14 +2756,14 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("dd MMMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } - case 0x00002009: /* (Loc,"en_JM") */ - { + case 0x00002009: /* (Loc,"en_JM") */ + { switch(dwFlags) { case DATE_SHORTDATE: @@ -2776,15 +2776,15 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("dd MMMM,yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } case 0x00002809: /* (Loc,"en_BZ") */ - case 0x00002c09: /* (Loc,"en_TT") */ - { + case 0x00002c09: /* (Loc,"en_TT") */ + { switch(dwFlags) { case DATE_SHORTDATE: @@ -2794,7 +2794,7 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("dddd,dd MMMM yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } @@ -2819,7 +2819,7 @@ BOOL WINAPI EnumDateFormatsA( if(!(*lpDateFmtEnumProc)("dd MMMM, yyyy")) return TRUE; return TRUE; default: - FIXME("Unknown date format (%ld)\n", dwFlags); + FIXME("Unknown date format (%ld)\n", dwFlags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } @@ -2844,7 +2844,7 @@ BOOL WINAPI EnumDateFormatsW( BOOL WINAPI EnumTimeFormatsA( TIMEFMT_ENUMPROCA lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags) { - LCID Loc = GetUserDefaultLCID(); + LCID Loc = GetUserDefaultLCID(); if(!lpTimeFmtEnumProc) { SetLastError(ERROR_INVALID_PARAMETER); @@ -2852,20 +2852,20 @@ BOOL WINAPI EnumTimeFormatsA( } if(dwFlags) { - FIXME("Unknown time format (%ld)\n", dwFlags); + FIXME("Unknown time format (%ld)\n", dwFlags); } switch( Loc ) { case 0x00000407: /* (Loc,"de_DE") */ { - if(!(*lpTimeFmtEnumProc)("HH.mm")) return TRUE; + if(!(*lpTimeFmtEnumProc)("HH.mm")) return TRUE; if(!(*lpTimeFmtEnumProc)("HH:mm:ss")) return TRUE; if(!(*lpTimeFmtEnumProc)("H:mm:ss")) return TRUE; if(!(*lpTimeFmtEnumProc)("H.mm")) return TRUE; if(!(*lpTimeFmtEnumProc)("H.mm'Uhr'")) return TRUE; return TRUE; - } + } case 0x0000040c: /* (Loc,"fr_FR") */ case 0x00000c0c: /* (Loc,"fr_CA") */ @@ -2879,9 +2879,9 @@ BOOL WINAPI EnumTimeFormatsA( } case 0x00000809: /* (Loc,"en_UK") */ - case 0x00000c09: /* (Loc,"en_AU") */ + case 0x00000c09: /* (Loc,"en_AU") */ case 0x00001409: /* (Loc,"en_NZ") */ - case 0x00001809: /* (Loc,"en_IE") */ + case 0x00001809: /* (Loc,"en_IE") */ { if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; if(!(*lpTimeFmtEnumProc)("HH:mm:ss")) return TRUE; @@ -2889,16 +2889,16 @@ BOOL WINAPI EnumTimeFormatsA( return TRUE; } - case 0x00001c09: /* (Loc,"en_ZA") */ + case 0x00001c09: /* (Loc,"en_ZA") */ case 0x00002809: /* (Loc,"en_BZ") */ - case 0x00002c09: /* (Loc,"en_TT") */ + case 0x00002c09: /* (Loc,"en_TT") */ { if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)("hh:mm:ss tt")) return TRUE; - return TRUE; + if(!(*lpTimeFmtEnumProc)("hh:mm:ss tt")) return TRUE; + return TRUE; } - default: /* default to US style "en_US" */ + default: /* default to US style "en_US" */ { if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; if(!(*lpTimeFmtEnumProc)("hh:mm:ss tt")) return TRUE; @@ -2923,9 +2923,9 @@ BOOL WINAPI EnumTimeFormatsW( /************************************************************************** * This function is used just locally ! * Description: Inverts a string. - */ + */ static void OLE_InvertString(char* string) -{ +{ char sTmpArray[128]; INT counter, i = 0; @@ -2942,12 +2942,12 @@ static void OLE_InvertString(char* string) * This function is used just locally ! * Description: Test if the given string (psNumber) is valid or not. * The valid characters are the following: - * - Characters '0' through '9'. - * - One decimal point (dot) if the number is a floating-point value. - * - A minus sign in the first character position if the number is + * - Characters '0' through '9'. + * - One decimal point (dot) if the number is a floating-point value. + * - A minus sign in the first character position if the number is * a negative value. * If the function succeeds, psBefore/psAfter will point to the string - * on the right/left of the decimal symbol. pbNegative indicates if the + * on the right/left of the decimal symbol. pbNegative indicates if the * number is negative. */ static INT OLE_GetNumberComponents(char* pInput, char* psBefore, char* psAfter, BOOL* pbNegative) @@ -2961,7 +2961,7 @@ BOOL bInDecimal = FALSE; *pbNegative = TRUE; pInput++; /* Jump to the next character. */ } - + while(*pInput != '\0') { /* Do we have a valid numeric character */ @@ -2993,17 +2993,17 @@ BOOL bInDecimal = FALSE; } pInput++; } - + /* Add an End of Line character to the output buffers */ *psBefore = '\0'; *psAfter = '\0'; - return 0; + return 0; } /************************************************************************** * This function is used just locally ! - * Description: A number could be formatted using different numbers + * Description: A number could be formatted using different numbers * of "digits in group" (example: 4;3;2;0). * The first parameter of this function is an array * containing the rule to be used. Its format is the following: @@ -3026,16 +3026,16 @@ static INT OLE_GetGrouping(char* sRule, INT index) { memcpy(sData, sRule+index, 1); memcpy(sData+1, "\0", 1); - nData = atoi(sData); + nData = atoi(sData); } - + else { memcpy(sData, sRule+nRuleSize-1, 1); memcpy(sData+1, "\0", 1); - nData = atoi(sData); + nData = atoi(sData); } - + return nData; } @@ -3049,11 +3049,11 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags, char sNumberDigits[3], sDecimalSymbol[5], sDigitsInGroup[11], sDigitGroupSymbol[5], sILZero[2]; INT nNumberDigits, nNumberDecimal, i, j, nCounter, nStep, nRuleIndex, nGrouping, nDigits, retVal, nLZ; char sNumber[128], sDestination[128], sDigitsAfterDecimal[10], sDigitsBeforeDecimal[128]; - char sRule[10], sSemiColumn[]=";", sBuffer[5], sNegNumber[2]; + char sRule[10], sSemiColumn[]=";", sBuffer[5], sNegNumber[2]; char *pStr = NULL, *pTmpStr = NULL; LCID systemDefaultLCID; BOOL bNegative = FALSE; - enum Operations + enum Operations { USE_PARAMETER, USE_LOCALEINFO, @@ -3084,7 +3084,7 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags, if (lpFormat != NULL) { if (dwflags == 0) - used_operation = USE_PARAMETER; + used_operation = USE_PARAMETER; } else { @@ -3128,7 +3128,7 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags, } nNumberDigits = atoi(sNumberDigits); - + /* Remove the ";" */ i=0; j = 1; @@ -3144,9 +3144,9 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags, sprintf(sBuffer, "%d", i); memcpy(sRule, sBuffer, 1); /* Number of digits in the groups ( used by OLE_GetGrouping() ) */ memcpy(sRule + j, "\0", 1); - + /* First, format the digits before the decimal. */ - if ((nNumberDecimal>0) && (atoi(sDigitsBeforeDecimal) != 0)) + if ((nNumberDecimal>0) && (atoi(sDigitsBeforeDecimal) != 0)) { /* Working on an inverted string is easier ! */ OLE_InvertString(sDigitsBeforeDecimal); @@ -3154,9 +3154,9 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags, nStep = nCounter = i = j = 0; nRuleIndex = 1; nGrouping = OLE_GetGrouping(sRule, nRuleIndex); - + /* Here, we will loop until we reach the end of the string. - * An internal counter (j) is used in order to know when to + * An internal counter (j) is used in order to know when to * insert the "digit group symbol". */ while (nNumberDecimal > 0) @@ -3186,7 +3186,7 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags, { nLZ = atoi(sILZero); if (nLZ != 0) - { + { /* Use 0.xxx instead of .xxx */ memcpy(sDestination, "0", 1); memcpy(sDestination+1, "\0", 1); @@ -3201,29 +3201,29 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags, nCounter = nNumberDigits; if ( (nDigits>0) && (pStr = strstr (sNumber, ".")) ) { - i = strlen(sNumber) - strlen(pStr) + 1; + i = strlen(sNumber) - strlen(pStr) + 1; strncpy ( sDigitsAfterDecimal, sNumber + i, nNumberDigits); j = strlen(sDigitsAfterDecimal); if (j < nNumberDigits) - nCounter = nNumberDigits-j; + nCounter = nNumberDigits-j; } for (i=0;iNegativeOrder; nPosOrder = lpFormat->PositiveOrder; strcpy(sCurrencySymbol, lpFormat->lpCurrencySymbol); break; case USE_SYSTEMDEFAULT: - systemDefaultLCID = GetSystemDefaultLCID(); + systemDefaultLCID = GetSystemDefaultLCID(); /* Specific to CURRENCYFMTA */ GetLocaleInfoA(systemDefaultLCID, LOCALE_INEGCURR, sNegOrder, sizeof(sNegOrder)); GetLocaleInfoA(systemDefaultLCID, LOCALE_ICURRENCY, sPosOrder, sizeof(sPosOrder)); GetLocaleInfoA(systemDefaultLCID, LOCALE_SCURRENCY, sCurrencySymbol, sizeof(sCurrencySymbol)); - + nPosOrder = atoi(sPosOrder); nNegOrder = atoi(sNegOrder); break; @@ -3366,7 +3366,7 @@ INT WINAPI GetCurrencyFormatA(LCID locale, DWORD dwflags, SetLastError(ERROR_INVALID_PARAMETER); return 0; } - + /* Construct a temporary number format structure */ if (lpFormat != NULL) { @@ -3390,7 +3390,7 @@ INT WINAPI GetCurrencyFormatA(LCID locale, DWORD dwflags, bIsPositive = TRUE; retVal = GetNumberFormatA(locale,0,lpvalue,(bValidFormat)?&numberFmt:NULL,pNumberFormated,128); } - + if (retVal == 0) return 0; @@ -3505,14 +3505,14 @@ INT WINAPI GetCurrencyFormatA(LCID locale, DWORD dwflags, strcat (pDestination, sCurrencySymbol); break; case 14: /* format: ($ 1.1) */ - strcpy (pDestination, "("); + strcpy (pDestination, "("); strcat (pDestination, sCurrencySymbol); strcat (pDestination, " "); strcat (pDestination, pNumberFormated); strcat (pDestination, ")"); break; case 15: /* format: (1.1 $) */ - strcpy (pDestination, "("); + strcpy (pDestination, "("); strcat (pDestination, pNumberFormated); strcat (pDestination, " "); strcat (pDestination, sCurrencySymbol); @@ -3547,17 +3547,17 @@ INT WINAPI GetCurrencyFormatW(LCID locale, DWORD dwflags, /****************************************************************************** * OLE2NLS_CheckLocale [intern] - */ + */ static LCID OLE2NLS_CheckLocale (LCID locale) { - if (!locale) + if (!locale) { locale = LOCALE_SYSTEM_DEFAULT; } - - if (locale == LOCALE_SYSTEM_DEFAULT) + + if (locale == LOCALE_SYSTEM_DEFAULT) { return GetSystemDefaultLCID(); - } - else if (locale == LOCALE_USER_DEFAULT) + } + else if (locale == LOCALE_USER_DEFAULT) { return GetUserDefaultLCID(); } else @@ -3583,13 +3583,13 @@ static LCID OLE2NLS_CheckLocale (LCID locale) * tt time marker (AM, PM) * */ -INT WINAPI +INT WINAPI GetTimeFormatA(LCID locale, /* [in] */ DWORD flags, /* [in] */ const SYSTEMTIME* xtime, /* [in] */ LPCSTR format, /* [in] */ LPSTR timestr, /* [out] */ - INT timelen /* [in] */) + INT timelen /* [in] */) { char format_buf[40]; LPCSTR thisformat; SYSTEMTIME t; @@ -3597,26 +3597,26 @@ GetTimeFormatA(LCID locale, /* [in] */ LCID thislocale=0; DWORD thisflags=LOCALE_STIMEFORMAT; /* standard timeformat */ INT ret; - + TRACE("GetTimeFormat(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",locale,flags,xtime,format,timestr,timelen); thislocale = OLE2NLS_CheckLocale ( locale ); - if (format == NULL) + if (format == NULL) { if (flags & LOCALE_NOUSEROVERRIDE) /* use system default */ { thislocale = GetSystemDefaultLCID(); } GetLocaleInfoA(thislocale, thisflags, format_buf, sizeof(format_buf)); thisformat = format_buf; } - else + else { thisformat = format; } - + if (xtime == NULL) /* NULL means use the current local time */ { GetLocalTime(&t); thistime = &t; - } + } else { thistime = xtime; /* Check that hour,min and sec is in range */ @@ -3631,13 +3631,13 @@ GetTimeFormatA(LCID locale, /* [in] */ * GetTimeFormatW [KERNEL32.@] * Makes a Unicode string of the time */ -INT WINAPI +INT WINAPI GetTimeFormatW(LCID locale, /* [in] */ DWORD flags, /* [in] */ const SYSTEMTIME* xtime, /* [in] */ LPCWSTR format, /* [in] */ LPWSTR timestr, /* [out] */ - INT timelen /* [in] */) + INT timelen /* [in] */) { WCHAR format_buf[40]; LPCWSTR thisformat; SYSTEMTIME t; @@ -3645,27 +3645,27 @@ GetTimeFormatW(LCID locale, /* [in] */ LCID thislocale=0; DWORD thisflags=LOCALE_STIMEFORMAT; /* standard timeformat */ INT ret; - + TRACE("GetTimeFormat(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",locale,flags, xtime,debugstr_w(format),timestr,timelen); thislocale = OLE2NLS_CheckLocale ( locale ); - if (format == NULL) + if (format == NULL) { if (flags & LOCALE_NOUSEROVERRIDE) /* use system default */ { thislocale = GetSystemDefaultLCID(); } GetLocaleInfoW(thislocale, thisflags, format_buf, 40); thisformat = format_buf; - } - else + } + else { thisformat = format; } - + if (xtime == NULL) /* NULL means use the current local time */ { GetLocalTime(&t); thistime = &t; - } + } else { thistime = xtime; } diff --git a/programs/avitools/aviinfo.c b/programs/avitools/aviinfo.c index 1f717f8735c..fca40ac9ffc 100644 --- a/programs/avitools/aviinfo.c +++ b/programs/avitools/aviinfo.c @@ -62,7 +62,7 @@ HRESULT (WINAPI *fnAVIStreamInfo)(PAVISTREAM iface,AVISTREAMINFO *afi,LONG size) XXT(AVIStreamInfo); #undef XX #undef XXT - + fnAVIFileInit(); if (-1==GetFileAttributes(cmdline)) { fprintf(stderr,"Usage: aviinfo \n"); @@ -139,7 +139,7 @@ HRESULT (WINAPI *fnAVIStreamInfo)(PAVISTREAM iface,AVISTREAMINFO *afi,LONG size) case streamtypeVIDEO: vids = ast; break; - case streamtypeAUDIO: + case streamtypeAUDIO: auds = ast; break; default: { @@ -154,5 +154,5 @@ HRESULT (WINAPI *fnAVIStreamInfo)(PAVISTREAM iface,AVISTREAMINFO *afi,LONG size) } fnAVIFileRelease(avif); fnAVIFileExit(); - return 0; + return 0; } diff --git a/programs/avitools/aviplay.c b/programs/avitools/aviplay.c index b013ff32f26..64e857d1288 100644 --- a/programs/avitools/aviplay.c +++ b/programs/avitools/aviplay.c @@ -1,6 +1,6 @@ /* * Very simple AVIPLAYER - * + * * Copyright 1999 Marcus Meissner * * This library is free software; you can redistribute it and/or @@ -16,7 +16,7 @@ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * * Status: * - plays .avi streams, video only * - requires MicroSoft avifil32.dll and builtin msvfw32.dll. @@ -25,9 +25,9 @@ * - audio support (including synchronization etc) * - replace DirectDraw by a 'normal' window, including dithering, controls * etc. - * + * * Bugs: - * - no time scheduling, video plays too fast using DirectDraw/XF86DGA + * - no time scheduling, video plays too fast using DirectDraw/XF86DGA * - requires DirectDraw with all disadvantages. */ @@ -98,7 +98,7 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg); #undef XX #undef XXT - + fnAVIFileInit(); if (-1==GetFileAttributes(cmdline)) { fprintf(stderr,"Usage: aviplay \n"); @@ -137,7 +137,7 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg); case streamtypeVIDEO: vids = ast; break; - case streamtypeAUDIO: + case streamtypeAUDIO: auds = ast; break; default: { @@ -277,5 +277,5 @@ HRESULT (WINAPI *fnAVIStreamGetFrameClose)(PGETFRAME pg); fprintf(stderr,"%d frames at %g frames/s\n",pos,pos*1.0/(tend-tstart)); fnAVIFileRelease(avif); fnAVIFileExit(); - return 0; + return 0; } diff --git a/programs/avitools/icinfo.c b/programs/avitools/icinfo.c index 64b9b7e594c..7bad5ac1095 100644 --- a/programs/avitools/icinfo.c +++ b/programs/avitools/icinfo.c @@ -89,6 +89,6 @@ LRESULT (VFWAPI *fnICSendMessage)(HIC hic, UINT msg, DWORD dw1, DWORD dw2); ICConfigure(hic,0); fnICClose(hic); } - return 0; + return 0; } diff --git a/programs/clock/language.c b/programs/clock/language.c index 54f2af0e0f3..5495680fa9e 100644 --- a/programs/clock/language.c +++ b/programs/clock/language.c @@ -30,9 +30,9 @@ CHAR STRING_MENU_Xx[] = "MENU_Xx"; VOID LANGUAGE_UpdateMenuCheckmarks(VOID) { if(Globals.bAnalog == TRUE) { - + /* analog clock */ - + CheckMenuItem(Globals.hPropertiesMenu, 0x100, \ MF_BYCOMMAND | MF_CHECKED); CheckMenuItem(Globals.hPropertiesMenu, 0x101, \ @@ -40,20 +40,20 @@ VOID LANGUAGE_UpdateMenuCheckmarks(VOID) { EnableMenuItem(Globals.hPropertiesMenu, 0x103, \ MF_BYCOMMAND | MF_GRAYED); } - else + else { - + /* digital clock */ - + CheckMenuItem(Globals.hPropertiesMenu, 0x100, \ MF_BYCOMMAND | MF_UNCHECKED); CheckMenuItem(Globals.hPropertiesMenu, 0x101, \ MF_BYCOMMAND | MF_CHECKED); EnableMenuItem(Globals.hPropertiesMenu, 0x103, \ MF_BYCOMMAND); - + } - + CheckMenuItem(Globals.hPropertiesMenu, 0x105, MF_BYCOMMAND | \ (Globals.bWithoutTitle ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(Globals.hSystemMenu, 0x10D, MF_BYCOMMAND | \ @@ -68,9 +68,9 @@ VOID LANGUAGE_UpdateWindowCaption(VOID) { CHAR szCaption[MAX_STRING_LEN]; CHAR szDate[MAX_STRING_LEN]; - + LPSTR date = szDate; - + SYSTEMTIME st; LPSYSTEMTIME lpst = &st; @@ -110,7 +110,7 @@ VOID LANGUAGE_LoadMenus(VOID) /* specific for Clock: */ LANGUAGE_UpdateMenuCheckmarks(); - LANGUAGE_UpdateWindowCaption(); + LANGUAGE_UpdateWindowCaption(); Globals.hSystemMenu = GetSystemMenu(Globals.hMainWnd, TRUE); diff --git a/programs/clock/license.h b/programs/clock/license.h index 6dac3b2979f..94dd3e8baec 100644 --- a/programs/clock/license.h +++ b/programs/clock/license.h @@ -21,7 +21,7 @@ /* function prototypes */ - + VOID WineLicense(HWND hWnd); VOID WineWarranty(HWND hWnd); @@ -37,7 +37,7 @@ typedef struct /* external references */ -/* +/* extern LICENSE WineLicense_Ca; extern LICENSE WineLicense_Cz; extern LICENSE WineLicense_Da; diff --git a/programs/clock/main.c b/programs/clock/main.c index 9b39a7024ce..c439676fa4e 100644 --- a/programs/clock/main.c +++ b/programs/clock/main.c @@ -43,23 +43,23 @@ CLOCK_GLOBALS Globals; */ int CLOCK_MenuCommand (WPARAM wParam) -{ +{ CHAR szApp[MAX_STRING_LEN]; CHAR szAppRelease[MAX_STRING_LEN]; switch (wParam) { /* switch to analog */ - case 0x100: { + case 0x100: { Globals.bAnalog = TRUE; LANGUAGE_UpdateMenuCheckmarks(); SendMessage(Globals.hMainWnd, WM_PAINT, 0, 0); - break; - } + break; + } /* switch to digital */ case 0x101: { Globals.bAnalog = FALSE; LANGUAGE_UpdateMenuCheckmarks(); SendMessage(Globals.hMainWnd, WM_PAINT, 0, 0); - break; + break; } /* change font */ case 0x103: { @@ -67,18 +67,18 @@ CHAR szAppRelease[MAX_STRING_LEN]; break; } /* hide title bar */ - case 0x105: { + case 0x105: { Globals.bWithoutTitle = !Globals.bWithoutTitle; LANGUAGE_UpdateWindowCaption(); LANGUAGE_UpdateMenuCheckmarks(); break; - } + } /* always on top */ case 0x10D: { Globals.bAlwaysOnTop = !Globals.bAlwaysOnTop; LANGUAGE_UpdateMenuCheckmarks(); break; - } + } /* show or hide seconds */ case 0x107: { Globals.bSeconds = !Globals.bSeconds; @@ -113,7 +113,7 @@ CHAR szAppRelease[MAX_STRING_LEN]; } /* Handle languages */ /* default: - LANGUAGE_DefaultHandle(wParam); + LANGUAGE_DefaultHandle(wParam); */ } return 0; @@ -166,7 +166,7 @@ LRESULT WINAPI CLOCK_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_RBUTTONUP: { printf("WM_RBUTTONUP\n"); Globals.bWithoutTitle = !Globals.bWithoutTitle; - LANGUAGE_UpdateMenuCheckmarks(); + LANGUAGE_UpdateMenuCheckmarks(); LANGUAGE_UpdateWindowCaption(); UpdateWindow (Globals.hMainWnd); break; @@ -179,7 +179,7 @@ LRESULT WINAPI CLOCK_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) DrawFace(context); Idle(context); } - else + else { /* do nothing */ } @@ -196,11 +196,11 @@ LRESULT WINAPI CLOCK_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) OldSecond.DontRedraw = TRUE; break; } - + case WM_COMMAND: { CLOCK_MenuCommand(wParam); break; - } + } case WM_DESTROY: { printf("WM_DESTROY\n"); @@ -225,7 +225,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show { MSG msg; WNDCLASS class; - + char szClassName[] = "CLClass"; /* To make sure className >= 0x10000 */ char szWinName[] = "Clock"; @@ -236,10 +236,10 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show Globals.lpszIcoFile = "clock.ico"; Globals.hInstance = hInstance; - Globals.hMainIcon = ExtractIcon(Globals.hInstance, + Globals.hMainIcon = ExtractIcon(Globals.hInstance, Globals.lpszIcoFile, 0); - - if (!Globals.hMainIcon) Globals.hMainIcon = + + if (!Globals.hMainIcon) Globals.hMainIcon = LoadIcon(0, MAKEINTRESOURCE(DEFAULTICON)); if (!prev){ @@ -260,7 +260,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show Globals.hMainWnd = CreateWindow (szClassName, szWinName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, Globals.MaxX, Globals.MaxY, 0, LoadMenu(Globals.hInstance, STRING_MENU_Xx), Globals.hInstance, 0); - + LANGUAGE_LoadMenus(); SetMenu(Globals.hMainWnd, Globals.hMainMenu); @@ -281,6 +281,6 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show } /* We will never reach the following statement ! */ - return 0; + return 0; } diff --git a/programs/clock/main.h b/programs/clock/main.h index 79f08b08b74..7e8f8b66d23 100644 --- a/programs/clock/main.h +++ b/programs/clock/main.h @@ -50,7 +50,7 @@ typedef struct BOOL bAlwaysOnTop; BOOL bWithoutTitle; BOOL bSeconds; - BOOL bDate; + BOOL bDate; int MaxX; int MaxY; @@ -67,11 +67,11 @@ VOID MAIN_FileChooseFont(VOID); extern CHAR STRING_MENU_Xx[]; #define STRINGID(id) (0x##id + Globals.wStringTableOffset) - + #else /* RC_INVOKED */ #define STRINGID(id) id - + #endif /* string table index */ diff --git a/programs/clock/winclock.c b/programs/clock/winclock.c index b96839b01ba..16c89266a25 100644 --- a/programs/clock/winclock.c +++ b/programs/clock/winclock.c @@ -1,4 +1,4 @@ -/* +/* * Clock (winclock.c) * * Copyright 1998 by Marcel Baur @@ -45,7 +45,7 @@ HandData OldSecond,OldHour,OldMinute; int MiddleX(void) { int X, diff; - X = (Globals.MaxX/2); + X = (Globals.MaxX/2); diff = (Globals.MaxX-Globals.MaxY); if (diff>0) { X = (X-(diff/2)); } return X; @@ -53,7 +53,7 @@ int MiddleX(void) { int MiddleY(void) { int Y, diff; - + Y = (Globals.MaxY/2); diff = (Globals.MaxX-Globals.MaxY); if (diff<0) { Y = Y+(diff/2); } @@ -63,7 +63,7 @@ int MiddleY(void) { void DrawFace(HDC dc) { int MidX, MidY, t, DiffX, DiffY; - + MidX = MiddleX(); MidY = MiddleY(); DiffX = (Globals.MaxX-MidX*2)/2; @@ -119,7 +119,7 @@ BOOL UpdateHourHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos) Sx = MidX; Sy = MidY; Ex = MidX+sin(Pos*Pi/6000)*XExt; Ey = MidY-cos(Pos*Pi/6000)*YExt; - rv = ( Sx!=OldHour.StartX || Ex!=OldHour.EndX || + rv = ( Sx!=OldHour.StartX || Ex!=OldHour.EndX || Sy!=OldHour.StartY || Ey!=OldHour.EndY ); if (Globals.bAnalog && rv)DrawHourHand(dc); OldHour.StartX = Sx; OldHour.EndX = Ex; @@ -152,7 +152,7 @@ BOOL UpdateSecondHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos) BOOL rv; rv = FALSE; - + if (Globals.bSeconds) { Sx = MidX; Sy = MidY; Ex = MidX+sin(Pos*Pi/3000)*XExt; @@ -164,7 +164,7 @@ BOOL UpdateSecondHand(HDC dc,int MidX,int MidY,int XExt,int YExt,WORD Pos) OldSecond.StartY = Sy; OldSecond.EndY = Ey; OldSecond.DontRedraw=FALSE; } - + return rv; } @@ -174,23 +174,23 @@ void DigitalClock(HDC dc) { LPSTR time = szTime; static short xChar, yChar; TEXTMETRIC tm; - + SYSTEMTIME st; LPSYSTEMTIME lpst = &st; - + GetLocalTime(&st); - GetTimeFormat(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, lpst, NULL, time, + GetTimeFormat(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, lpst, NULL, time, MAX_STRING_LEN); - + SelectObject(dc,CreatePen(PS_SOLID,1,FaceColor)); xChar = tm.tmAveCharWidth; yChar = tm.tmHeight; - + xChar = 100; yChar = 100; - TextOut (dc, xChar, yChar, szTime, strlen (szTime)); + TextOut (dc, xChar, yChar, szTime, strlen (szTime)); DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN))); - + } @@ -231,8 +231,8 @@ void AnalogClock(HDC dc) { DrawMinuteHand(dc); DrawHourHand(dc); } - DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN))); - + DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN))); + } void Idle(HDC idc) @@ -250,7 +250,7 @@ void Idle(HDC idc) { AnalogClock(context); } - else + else { DigitalClock(context); } diff --git a/programs/clock/winclock.h b/programs/clock/winclock.h index 199b9abeac7..3f5e8b4901b 100644 --- a/programs/clock/winclock.h +++ b/programs/clock/winclock.h @@ -1,4 +1,4 @@ -/* +/* * Clock (winclock.h) * * Copyright 1998 by Marcel Baur @@ -22,7 +22,7 @@ */ #include - + typedef struct { int StartX,StartY,EndX,EndY; diff --git a/programs/control/control.c b/programs/control/control.c index e4de1444642..3e8261c9789 100644 --- a/programs/control/control.c +++ b/programs/control/control.c @@ -1,4 +1,4 @@ -/* +/* * Control * Copyright (C) 1998 by Marcel Baur * @@ -31,7 +31,7 @@ void launch(const char *what) exit(0); } -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc) +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc) { char szParams[255]; @@ -69,5 +69,5 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc) default: printf("Syntax error."); } - return 0; + return 0; } diff --git a/programs/control/params.h b/programs/control/params.h index e7213574723..dcdb49fe9d5 100644 --- a/programs/control/params.h +++ b/programs/control/params.h @@ -1,4 +1,4 @@ -/* +/* * Control * Copyright (C) 1998 by Marcel Baur * diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c index e92313fcbcf..7daa511e760 100644 --- a/programs/notepad/dialog.c +++ b/programs/notepad/dialog.c @@ -36,15 +36,15 @@ static LRESULT WINAPI DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wPara int AlertIDS(UINT ids_message, UINT ids_caption, WORD type) { /* - * Given some ids strings, this acts as a language-aware wrapper for + * Given some ids strings, this acts as a language-aware wrapper for * "MessageBox" */ CHAR szMessage[MAX_STRING_LEN]; CHAR szCaption[MAX_STRING_LEN]; - + LoadString(Globals.hInstance, ids_message, szMessage, sizeof(szMessage)); LoadString(Globals.hInstance, ids_caption, szCaption, sizeof(szCaption)); - + return (MessageBox(Globals.hMainWnd, szMessage, szCaption, type)); } @@ -57,7 +57,7 @@ void AlertFileNotFound(LPSTR szFileName) { /* Load and format szMessage */ LoadString(Globals.hInstance, STRING_NOTFOUND, szRessource, sizeof(szRessource)); wsprintf(szMessage, szRessource, szFileName); - + /* Load szCaption */ LoadString(Globals.hInstance, STRING_ERROR, szRessource, sizeof(szRessource)); @@ -76,7 +76,7 @@ int AlertFileNotSaved(LPSTR szFileName) { LoadString(Globals.hInstance, STRING_NOTSAVED, szRessource, sizeof(szRessource)); wsprintf(szMessage, szRessource, szFileName); - + /* Load Caption */ LoadString(Globals.hInstance, STRING_ERROR, szRessource, sizeof(szRessource)); @@ -89,7 +89,7 @@ int AlertFileNotSaved(LPSTR szFileName) { VOID AlertOutOfMemory(void) { int nResult; - + nResult = AlertIDS(STRING_OUT_OF_MEMORY, STRING_ERROR, MB_ICONEXCLAMATION); PostQuitMessage(1); } @@ -102,9 +102,9 @@ BOOL FileExists(LPCSTR szFilename) { */ WIN32_FIND_DATA entry; HANDLE hFile; - + hFile = FindFirstFile(szFilename, &entry); - + return (hFile!=INVALID_HANDLE_VALUE); } @@ -120,7 +120,7 @@ BOOL DoCloseFile(void) { /* FALSE - User cancelled close by selecting "Cancel" */ int nResult; - + if (strlen(Globals.szFileName)>0) { /* prompt user to save changes */ nResult = AlertFileNotSaved(Globals.szFileName); @@ -132,12 +132,12 @@ BOOL DoCloseFile(void) { case IDCANCEL: return(FALSE); break; - + default: return(FALSE); break; } /* switch */ } /* if */ - + /* Forget file name */ lstrcpy(Globals.szFileName, ""); LANGUAGE_UpdateWindowCaption(); @@ -211,12 +211,12 @@ VOID DIALOG_FileOpen(VOID) openfilename.lpTemplateName = 0; if (GetOpenFileName(&openfilename)) { - + if (FileExists(openfilename.lpstrFile)) DoOpenFile(openfilename.lpstrFile); - else + else AlertFileNotFound(openfilename.lpstrFile); - + } } @@ -234,7 +234,7 @@ VOID DIALOG_FileSaveAs(VOID) CHAR szDir[MAX_PATHNAME_LEN]; CHAR szDefaultExt[4]; CHAR szzFilter[2 * MAX_STRING_LEN + 100]; - + LPSTR p = szzFilter; lstrcpy(szDefaultExt, "txt"); @@ -356,7 +356,7 @@ VOID DIALOG_FilePrint(VOID) if (TRUE) { /* Remove "Print Selection" if there is no selection */ bFlags = bFlags + PD_NOSELECTION; - } + } printer.Flags = bFlags; /* @@ -414,7 +414,7 @@ VOID DIALOG_FilePrint(VOID) AlertOutOfMemory(); break; default: - MessageBox(Globals.hMainWnd, "Default", "Print", MB_ICONEXCLAMATION); + MessageBox(Globals.hMainWnd, "Default", "Print", MB_ICONEXCLAMATION); } /* switch */ nResult = EndDoc(hContext); assert(nResult>=0); @@ -454,7 +454,7 @@ VOID DIALOG_FilePrinterSetup(VOID) printer.lpSetupTemplateName = 0; printer.hPrintTemplate = 0; printer.hSetupTemplate = 0; - + if (PrintDlg(&printer)) { /* do nothing */ }; @@ -538,7 +538,7 @@ VOID DIALOG_EditTimeDate(VOID) LPSYSTEMTIME lpst = &st; CHAR szDate[MAX_STRING_LEN]; LPSTR date = szDate; - + GetLocalTime(&st); GetDateFormat(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, lpst, NULL, date, MAX_STRING_LEN); GetTimeFormat(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, lpst, NULL, date, MAX_STRING_LEN); @@ -548,7 +548,7 @@ VOID DIALOG_EditTimeDate(VOID) VOID DIALOG_EditWrap(VOID) { Globals.bWrapLongLines = !Globals.bWrapLongLines; - CheckMenuItem(Globals.hEditMenu, 0x119, MF_BYCOMMAND | + CheckMenuItem(Globals.hEditMenu, 0x119, MF_BYCOMMAND | (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED)); } diff --git a/programs/notepad/language.c b/programs/notepad/language.c index 9f239e183ce..53ac7d16232 100644 --- a/programs/notepad/language.c +++ b/programs/notepad/language.c @@ -33,12 +33,12 @@ void LANGUAGE_UpdateWindowCaption(void) { Notepad - (untitled) if no file is open Notepad - [filename] if a file is given */ - + CHAR szCaption[MAX_STRING_LEN]; CHAR szUntitled[MAX_STRING_LEN]; LoadString(Globals.hInstance, STRING_NOTEPAD, szCaption, sizeof(szCaption)); - + if (strlen(Globals.szFileName)>0) { lstrcat(szCaption, " - ["); lstrcat(szCaption, Globals.szFileName); @@ -50,9 +50,9 @@ void LANGUAGE_UpdateWindowCaption(void) { lstrcat(szCaption, " - "); lstrcat(szCaption, szUntitled); } - + SetWindowText(Globals.hMainWnd, szCaption); - + } @@ -75,7 +75,7 @@ VOID LANGUAGE_LoadMenus(VOID) /* Set frame caption */ LANGUAGE_UpdateWindowCaption(); - + /* Change Resource names */ // lstrcpyn(STRING_MENU_Xx + sizeof(STRING_MENU_Xx) - 3, lang, 3); // lstrcpyn(STRING_PAGESETUP_Xx + sizeof(STRING_PAGESETUP_Xx) - 3, lang, 3); diff --git a/programs/notepad/license.h b/programs/notepad/license.h index adbed7abe6d..418bb66f5c7 100644 --- a/programs/notepad/license.h +++ b/programs/notepad/license.h @@ -27,7 +27,7 @@ typedef struct LPCSTR Warranty, WarrantyCaption; } LICENSE; -/* +/* extern LICENSE WineLicense_Ca; extern LICENSE WineLicense_Cz; extern LICENSE WineLicense_Da; @@ -36,7 +36,7 @@ extern LICENSE WineLicense_De; extern LICENSE WineLicense_En; -/* +/* extern LICENSE WineLicense_Eo; extern LICENSE WineLicense_Es; extern LICENSE WineLicense_Fi; diff --git a/programs/notepad/main.c b/programs/notepad/main.c index 15feec1f3c1..770ab362958 100644 --- a/programs/notepad/main.c +++ b/programs/notepad/main.c @@ -106,11 +106,11 @@ DWORD CalcStringWidth(HDC hDC, DWORD x, DWORD y) if(y>dwLines) return size.cx; - if(lpBuffer == NULL) + if(lpBuffer == NULL) return size.cx; if(lpBuffer[y].lpLine == NULL) return size.cx; - len = (x - + #define CHARSETSIZE 255 - + int delta[CHARSETSIZE]; - + /* rightmostpos: return rightmost position of ch in szSP (or -1) */ int rightmostpos(char ch, LPSTR szSP, int nSPLen) { int i = nSPLen; while ((i>0) & (szSP[i]!=ch)) i--; return(i); } - + /* setup_delta: setup delta1 cache */ void setup_delta(LPSTR szSP, int nSPLen) { int i; - + for (i=0; i0 && i<=nBufLen); return(i+1); } - + diff --git a/programs/progman/grpfile.c b/programs/progman/grpfile.c index 6594e4f41fa..88c2d857e22 100644 --- a/programs/progman/grpfile.c +++ b/programs/progman/grpfile.c @@ -188,7 +188,7 @@ static HLOCAL GRPFILE_ScanGroup(LPCSTR buffer, INT size, lpszName = buffer + GET_USHORT(buffer, 22); if (lpszName >= buffer + size) return(0); - /* unknown bytes 24 - 31 ignored */ + /* unknown bytes 24 - 31 ignored */ /* Unknown bytes should be: wLogPixelsX = GET_SHORT(buffer, 24); @@ -470,14 +470,14 @@ static UINT16 GRPFILE_GetChecksum() /*********************************************************************** * * GRPFILE_WriteWithChecksum - * + * * Looks crazier than it is: - * + * * chksum = 0; * chksum = cksum - 1. word; * chksum = cksum - 2. word; * ... - * + * * if (filelen is even) * great I'm finished * else @@ -488,7 +488,7 @@ static UINT GRPFILE_WriteWithChecksum(HFILE file, LPCSTR str, UINT size) { UINT i; if (GRPFILE_checksum_half_word) { - GRPFILE_checksum -= GRPFILE_checksum_last_byte; + GRPFILE_checksum -= GRPFILE_checksum_last_byte; } for (i=0; i < size; i++) { if (GRPFILE_checksum_half_word) { @@ -498,12 +498,12 @@ static UINT GRPFILE_WriteWithChecksum(HFILE file, LPCSTR str, UINT size) } GRPFILE_checksum_half_word ^= 1; } - + if (GRPFILE_checksum_half_word) { GRPFILE_checksum_last_byte = str[size-1]; GRPFILE_checksum += GRPFILE_checksum_last_byte; } - + return _lwrite(file, str, size); } @@ -523,9 +523,9 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group) LPCSTR lpszTitle = LocalLock(group->hName); UINT16 checksum; - + GRPFILE_InitChecksum(); - + /* Calculate offsets */ NumProg = 0; Icons = 0; @@ -554,9 +554,9 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group) /* Header */ buffer[0] = 'P'; buffer[1] = 'M'; - buffer[2] = 'C'; + buffer[2] = 'C'; buffer[3] = 'C'; - + PUT_SHORT(buffer, 4, 0); /* Checksum zero for now, written later */ PUT_SHORT(buffer, 6, Extension); /* Update group->nCmdShow */ @@ -588,7 +588,7 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group) PROGRAM *program = LocalLock(hProgram); PUT_SHORT(buffer, 0, CurrProg); - if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 2)) + if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 2)) return FALSE; GRPFILE_CalculateSizes(program, &CurrProg, &CurrIcon); @@ -596,7 +596,7 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group) } /* Title */ - if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, lpszTitle, + if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, lpszTitle, lstrlen(lpszTitle) + 1)) return FALSE; @@ -675,7 +675,7 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group) PUT_SHORT(buffer, 4, 0x000a); buffer[6] = 'P', buffer[7] = 'M'; buffer[8] = 'C', buffer[9] = 'C'; - if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 10)) + if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 10)) return FALSE; seqnum = 0; diff --git a/programs/progman/progman.h b/programs/progman/progman.h index 3dd37d93ed7..4fbc9e9c520 100644 --- a/programs/progman/progman.h +++ b/programs/progman/progman.h @@ -62,7 +62,7 @@ typedef struct /* pointer to iconANDbits */ /* 16 - 17 */ /* sometimes iconXORbits ?! */ HLOCAL hName; /* 18 - 19 */ HLOCAL hCmdLine; /* 20 - 21 */ - HLOCAL hIconFile; /* 22 - 23 */ + HLOCAL hIconFile; /* 22 - 23 */ HLOCAL hWorkDir; /* Extension 0x8101 */ INT nHotKey; /* Extension 0x8102 */ /* Modifier: bit 8... */ @@ -103,7 +103,7 @@ typedef struct HLOCAL hPrograms; /* 34 ... */ /**/ /* Extensions */ - /* Extension type */ /* 0 - 1 */ + /* Extension type */ /* 0 - 1 */ /* Program number */ /* 2 - 3 */ /* Size of entry */ /* 4 - 5 */ /* Data */ /* 6 ... */ diff --git a/programs/progman/program.c b/programs/progman/program.c index 8ac63629eac..1060dd97640 100644 --- a/programs/progman/program.c +++ b/programs/progman/program.c @@ -296,7 +296,7 @@ VOID PROGRAM_DeleteProgram(HLOCAL hProgram, BOOL bUpdateGrpFile) ((PROGRAM*)LocalLock(program->hPrior))->hNext = program->hNext; else ((PROGGROUP*)LocalLock(program->hGroup))->hPrograms = program->hNext; - + if (program->hNext) ((PROGRAM*)LocalLock(program->hNext))->hPrior = program->hPrior; diff --git a/programs/regapi/regapi.c b/programs/regapi/regapi.c index 79aa54fb542..e08c727e333 100644 --- a/programs/regapi/regapi.c +++ b/programs/regapi/regapi.c @@ -32,10 +32,10 @@ /****************************************************************************** * Defines and consts */ -#define IDENTICAL 0 +#define IDENTICAL 0 #define COMMAND_COUNT 7 -#define KEY_MAX_LEN 1024 +#define KEY_MAX_LEN 1024 #define STDIN_MAX_LEN 102400 /* Return values */ @@ -56,16 +56,16 @@ static HKEY currentKeyHandle = 0; static BOOL bTheKeyIsOpen = FALSE; /* Delimiters used to parse the "value"="data" pair for setValue*/ -#define SET_VALUE_MAX_ARGS 2 +#define SET_VALUE_MAX_ARGS 2 /* Delimiters used to parse the "value" to query queryValue*/ -#define QUERY_VALUE_MAX_ARGS 1 +#define QUERY_VALUE_MAX_ARGS 1 static const char *setValueDelim[SET_VALUE_MAX_ARGS] = {"=", ""}; static const char *queryValueDelim[QUERY_VALUE_MAX_ARGS] = {""}; -/* - * Forward declaration +/* + * Forward declaration */ typedef void (*commandAPI)(LPSTR lpsLine); @@ -81,8 +81,8 @@ static void doUnregisterDLL(LPSTR lpsLine); * Currently supported api */ static const char* commandNames[COMMAND_COUNT] = { - "setValue", - "deleteValue", + "setValue", + "deleteValue", "createKey", "deleteKey", "queryValue", @@ -94,8 +94,8 @@ static const char* commandNames[COMMAND_COUNT] = { * Pointers to processing entry points */ static const commandAPI commandAPIs[COMMAND_COUNT] = { - doSetValue, - doDeleteValue, + doSetValue, + doDeleteValue, doCreateKey, doDeleteKey, doQueryValue, @@ -103,8 +103,8 @@ static const commandAPI commandAPIs[COMMAND_COUNT] = { doUnregisterDLL }; -/* - * This array controls the registry saving needs at the end of the process +/* + * This array controls the registry saving needs at the end of the process */ static const BOOL commandSaveRegistry[COMMAND_COUNT] = { TRUE, @@ -116,7 +116,7 @@ static const BOOL commandSaveRegistry[COMMAND_COUNT] = { TRUE }; -/* +/* * Generic prototypes */ static DWORD getDataType(LPSTR *lpValue, DWORD* parse_type); @@ -131,13 +131,13 @@ static LPSTR convertHexToDWORDStr( BYTE *buf, ULONG len); static HRESULT openKey(LPSTR stdInput); static void closeKey(); -/* +/* * api setValue prototypes */ static void processSetValue(LPSTR cmdline); static HRESULT setValue(LPSTR *argv); -/* +/* * api queryValue prototypes */ static void processQueryValue(LPSTR cmdline); @@ -205,8 +205,8 @@ static char helpText[] = /****************************************************************************** - * This function returns the HKEY associated with the data type encoded in the - * value. It modifies the input parameter (key value) in order to skip this + * This function returns the HKEY associated with the data type encoded in the + * value. It modifies the input parameter (key value) in order to skip this * "now useless" data type information. * * Note: Updated based on the algorithm used in 'server/registry.c' @@ -256,10 +256,10 @@ DWORD getDataType(LPSTR *lpValue, DWORD* parse_type) } /****************************************************************************** - * Extracts from a [HKEY\some\key\path] type of line the key name (what starts + * Extracts from a [HKEY\some\key\path] type of line the key name (what starts * after the first '\' and end before the ']' */ -LPSTR getRegKeyName(LPSTR lpLine) +LPSTR getRegKeyName(LPSTR lpLine) { LPSTR keyNameBeg = NULL; LPSTR keyNameEnd = NULL; @@ -274,25 +274,25 @@ LPSTR getRegKeyName(LPSTR lpLine) keyNameBeg++; /* but is not part of the key name */ keyNameEnd = strstr(lpLineCopy, "]"); /* The key name end by ']' */ *keyNameEnd = '\0'; /* Isolate the key name */ - + currentKeyName = HeapAlloc(GetProcessHeap(), 0, strlen(keyNameBeg)+1); if (currentKeyName != NULL) strcpy(currentKeyName, keyNameBeg); - + return currentKeyName; } /****************************************************************************** - * Extracts from a [HKEY/some/key/path] type of line the key class (what + * Extracts from a [HKEY/some/key/path] type of line the key class (what * starts after the '[' and ends before the first '\' */ -static HKEY getRegClass(LPSTR lpClass) +static HKEY getRegClass(LPSTR lpClass) { LPSTR classNameEnd; LPSTR classNameBeg; char lpClassCopy[KEY_MAX_LEN]; - + if (lpClass == NULL) return (HKEY)ERROR_INVALID_PARAMETER; @@ -301,7 +301,7 @@ static HKEY getRegClass(LPSTR lpClass) classNameEnd = strstr(lpClassCopy, "\\"); /* The class name end by '\' */ *classNameEnd = '\0'; /* Isolate the class name */ classNameBeg = &lpClassCopy[1]; /* Skip the '[' */ - + if (strcmp( classNameBeg, "HKEY_LOCAL_MACHINE") == IDENTICAL ) return HKEY_LOCAL_MACHINE; else if (strcmp( classNameBeg, "HKEY_USERS") == IDENTICAL ) @@ -343,7 +343,7 @@ static char* getToken(char** str, const char* delims) } /****************************************************************************** - * Returns an allocated buffer with a cleaned copy (removed the surrounding + * Returns an allocated buffer with a cleaned copy (removed the surrounding * dbl quotes) of the passed value. */ static LPSTR getArg( LPSTR arg) @@ -357,7 +357,7 @@ static LPSTR getArg( LPSTR arg) /* * Get rid of surrounding quotes */ - len = strlen(arg); + len = strlen(arg); if( arg[len-1] == '\"' ) arg[len-1] = '\0'; if( arg[0] == '\"' ) arg++; @@ -375,7 +375,7 @@ static INT getCommand(LPSTR commandName) { INT count; for (count=0; count < COMMAND_COUNT; count++) - if ( strcmp(commandName, commandNames[count]) == IDENTICAL) + if ( strcmp(commandName, commandNames[count]) == IDENTICAL) return count; return COMMAND_NOT_FOUND; @@ -397,7 +397,7 @@ static DWORD convertHexToDWord(char *str, BYTE *buf) } /****************************************************************************** - * Converts a hex buffer into a hex comma separated values + * Converts a hex buffer into a hex comma separated values */ static char* convertHexToHexCSV(BYTE *buf, ULONG bufLen) { @@ -420,7 +420,7 @@ static char* convertHexToHexCSV(BYTE *buf, ULONG bufLen) sprintf(res, "%02x", (unsigned int)*&bCur); strcat(str, res); strcat(str, ","); - } + } /* Get rid of the last comma */ str[strlen(str)-1] = '\0'; @@ -479,14 +479,14 @@ static DWORD convertHexCSVToHex(char *str, BYTE *buf, ULONG bufLen) s+=3; strPos+=3; byteCount++; - } + } return byteCount; } /****************************************************************************** - * Sets the value in argv[0] to the data in argv[1] for the currently + * Sets the value in argv[0] to the data in argv[1] for the currently * opened key. */ static HRESULT setValue(LPSTR *argv) @@ -507,7 +507,7 @@ static HRESULT setValue(LPSTR *argv) lpsCurrentValue=HeapAlloc(GetProcessHeap(), 0,KEY_MAX_LEN); /* - * Default registry values are encoded in the input stream as '@' but as + * Default registry values are encoded in the input stream as '@' but as * blank in the wine registry. */ if( (keyValue[0] == '@') && (strlen(keyValue) == 1) ) @@ -518,11 +518,11 @@ static HRESULT setValue(LPSTR *argv) memset(lpsCurrentValue, 0, KEY_MAX_LEN); hRes = RegQueryValueExA( - currentKeyHandle, - keyValue, - NULL, - &dwType, - (LPBYTE)lpsCurrentValue, + currentKeyHandle, + keyValue, + NULL, + &dwType, + (LPBYTE)lpsCurrentValue, &dwSize); while(hRes==ERROR_MORE_DATA){ @@ -532,8 +532,8 @@ static HRESULT setValue(LPSTR *argv) } if( ( strlen(lpsCurrentValue) == 0 ) || /* The value is not existing */ - ( bForce )) /* -force option */ - { + ( bForce )) /* -force option */ + { LPBYTE lpbData; BYTE convert[KEY_MAX_LEN]; DWORD dwLen; @@ -547,7 +547,7 @@ static HRESULT setValue(LPSTR *argv) keyData[dwLen]='\0'; } lpbData = keyData; - } + } else if (dwParseType == REG_DWORD) /* Convert the dword types */ { dwLen = convertHexToDWord(keyData, convert); @@ -560,7 +560,7 @@ static HRESULT setValue(LPSTR *argv) } hRes = RegSetValueEx( - currentKeyHandle, + currentKeyHandle, keyValue, 0, /* Reserved */ dwDataType, @@ -594,11 +594,11 @@ static HRESULT setValue(LPSTR *argv) */ static HRESULT openKey( LPSTR stdInput) { - DWORD dwDisp; + DWORD dwDisp; HRESULT hRes; /* Sanity checks */ - if (stdInput == NULL) + if (stdInput == NULL) return ERROR_INVALID_PARAMETER; /* Get the registry class */ @@ -610,8 +610,8 @@ static HRESULT openKey( LPSTR stdInput) currentKeyName = getRegKeyName(stdInput); /* Sets global variable */ if (currentKeyName == NULL) return ERROR_INVALID_PARAMETER; - - hRes = RegCreateKeyEx( + + hRes = RegCreateKeyEx( currentKeyClass, /* Class */ currentKeyName, /* Sub Key */ 0, /* MUST BE 0 */ @@ -630,7 +630,7 @@ static HRESULT openKey( LPSTR stdInput) } /****************************************************************************** - * This function is a wrapper for the setValue function. It prepares the + * This function is a wrapper for the setValue function. It prepares the * land and clean the area once completed. */ static void processSetValue(LPSTR cmdline) @@ -648,7 +648,7 @@ static void processSetValue(LPSTR cmdline) for (counter=0; counter * * This library is free software; you can redistribute it and/or @@ -42,7 +42,7 @@ #include #define DEBUG(x...) fprintf(stderr,x) #else -#define DEBUG(x...) +#define DEBUG(x...) #endif /* use multi-select listbox */ @@ -93,7 +93,7 @@ void UninstallProgram(void); void ListUninstallPrograms(void) { int i; - + if (! FetchUninstallInformation()) return; @@ -128,7 +128,7 @@ void RemoveSpecificProgram(char *name) int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow ) -{ +{ MSG msg; WNDCLASS wc; HWND hWnd; @@ -165,15 +165,15 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmd wc.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH ); wc.lpszMenuName = NULL; wc.lpszClassName = appname; - + if (!RegisterClass(&wc)) exit(1); - hWnd = CreateWindow( appname, appname, - WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + hWnd = CreateWindow( appname, appname, + WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL_HANDLE, NULL_HANDLE, hInst, NULL ); - + if (!hWnd) exit(1); - + ShowWindow( hWnd, cmdshow ); UpdateWindow( hWnd ); @@ -198,7 +198,7 @@ int FetchUninstallInformation(void) char key_app[1024]; char *p; - + numentries = 0; oldsel = -1; if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_UNINSTALL, @@ -207,7 +207,7 @@ int FetchUninstallInformation(void) MessageBox(0, "Uninstall registry key not available (yet), nothing to do !", appname, MB_OK); return 0; } - + strcpy(key_app, REGSTR_PATH_UNINSTALL); strcat(key_app, "\\"); p = key_app+strlen(REGSTR_PATH_UNINSTALL)+1; @@ -324,7 +324,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) cxChar * 50 + GetSystemMetrics(SM_CXVSCROLL), cyChar * 20, hWnd, (HMENU) 1, (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE), NULL); - + GetWindowRect(hwndList, &rect); y = by; maxx += (rect.right - rect.left)*1.1; @@ -402,14 +402,14 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: PostQuitMessage( 0 ); return 0; - + case WM_COMMAND: if ((HWND)lParam == hwndList) { if (HIWORD(wParam) == LBN_SELCHANGE) { int sel = SendMessage(hwndList, LB_GETCURSEL, 0, 0); - + #ifndef USE_MULTIPLESEL if (oldsel != -1) { @@ -427,7 +427,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) if ((HWND)lParam == button[0].hwnd) /* Uninstall button */ { UninstallProgram(); - + InvalidateRect(hWnd, NULL, TRUE); UpdateWindow(hWnd); @@ -440,6 +440,6 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) PostQuitMessage(0); return 0; } - + return( DefWindowProc( hWnd, msg, wParam, lParam )); } diff --git a/programs/view/globals.h b/programs/view/globals.h index 17edfc70512..eeee749b970 100644 --- a/programs/view/globals.h +++ b/programs/view/globals.h @@ -17,8 +17,8 @@ */ /* for SMALL_RECT */ -#include "wincon.h" -#include "resource.h" +#include "wincon.h" +#include "resource.h" /* Add global function prototypes here */ diff --git a/programs/view/init.c b/programs/view/init.c index 92585e56dc1..15cdfa7a5b7 100644 --- a/programs/view/init.c +++ b/programs/view/init.c @@ -31,7 +31,7 @@ BOOL InitApplication(HINSTANCE hInstance) WNDCLASSEX wc; /* Load the application name and description strings */ - + LoadString(hInstance, IDS_APPNAME, szAppName, sizeof(szAppName)); LoadString(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle)); @@ -41,7 +41,7 @@ BOOL InitApplication(HINSTANCE hInstance) wc.cbSize = sizeof(WNDCLASSEX); /* Load small icon image */ - wc.hIconSm = LoadImage(hInstance, + wc.hIconSm = LoadImage(hInstance, MAKEINTRESOURCEA(IDI_APPICON), IMAGE_ICON, 16, 16, @@ -73,7 +73,7 @@ BOOL InitApplication(HINSTANCE hInstance) BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { - HWND hwnd; + HWND hwnd; /* Save the instance handle in a global variable for later use */ hInst = hInstance; @@ -86,9 +86,9 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) CW_USEDEFAULT, 0, /* size */ NULL, /* Overlapped has no parent */ NULL, /* Use the window class menu */ - hInstance, - NULL); - + hInstance, + NULL); + if (!hwnd) return FALSE; diff --git a/programs/view/view.c b/programs/view/view.c index d8c5fc82ae5..b42bceead12 100644 --- a/programs/view/view.c +++ b/programs/view/view.c @@ -19,7 +19,7 @@ #include #include "resource.h" -/* +/* #include Wine doesn't have windowsx.h, so we use this */ @@ -28,7 +28,7 @@ /* Wine seems to need this */ #include -#include "globals.h" +#include "globals.h" #include BOOL FileIsPlaceable( LPCSTR szFileName ); @@ -44,7 +44,7 @@ BOOL isAldus; BOOL FileOpen(HWND hWnd, char *fn) { OPENFILENAME ofn = { sizeof(OPENFILENAME), - 0, 0, NULL, NULL, 0, 0, NULL, + 0, 0, NULL, NULL, 0, 0, NULL, FN_LENGTH, NULL, 0, NULL, NULL, OFN_CREATEPROMPT | OFN_SHOWHELP, 0, 0, NULL, 0, NULL }; ofn.lpstrFilter = "Metafiles\0*.wmf\0"; @@ -61,9 +61,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, { switch (uMessage) { - case WM_PAINT: + case WM_PAINT: { - PAINTSTRUCT ps; + PAINTSTRUCT ps; BeginPaint(hwnd, &ps); SetMapMode(ps.hdc, MM_ANISOTROPIC); SetViewportExtEx(ps.hdc, width, height, NULL); @@ -99,7 +99,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, } } break; - + case IDM_SET_EXT_TO_WIN: { RECT r; @@ -110,7 +110,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, } break; - + case IDM_LEFT: deltax += 100; InvalidateRect( hwnd, NULL, TRUE ); @@ -155,7 +155,7 @@ BOOL FileIsPlaceable( LPCSTR szFileName ) if( (hInFile = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR ) return FALSE; - if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) ) + if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) ) != sizeof(APMFILEHEADER) ) { _lclose( hInFile ); @@ -184,11 +184,11 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName ) checksum = 0; p = (WORD *) &APMHeader; - for(i=0; i<10; i++) + for(i=0; i<10; i++) checksum ^= *p++; if (checksum != APMHeader.checksum) { char msg[128]; - sprintf(msg, "Computed checksum %04x != stored checksum %04x\n", + sprintf(msg, "Computed checksum %04x != stored checksum %04x\n", checksum, APMHeader.checksum); MessageBox(hwnd, msg, "Checksum failed", MB_OK); return 0; @@ -207,10 +207,10 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName ) } _lclose(fh); - if (!(hmf = SetMetaFileBitsEx(mfHeader.mtSize*2, lpData))) + if (!(hmf = SetMetaFileBitsEx(mfHeader.mtSize*2, lpData))) return 0; - + width = APMHeader.bbox.Right - APMHeader.bbox.Left; height = APMHeader.bbox.Bottom - APMHeader.bbox.Top; diff --git a/programs/view/winmain.c b/programs/view/winmain.c index 7024c6d85a2..1dba678f6a9 100644 --- a/programs/view/winmain.c +++ b/programs/view/winmain.c @@ -16,25 +16,25 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include /* required for all Windows applications */ +#include /* required for all Windows applications */ #include "globals.h" /* prototypes specific to this application */ int APIENTRY WinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpCmdLine, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, int nCmdShow) { MSG msg; HANDLE hAccelTable; - + /* Other instances of app running? */ if (!hPrevInstance) { /* stuff to be done once */ if (!InitApplication(hInstance)) { - return FALSE; /* exit */ + return FALSE; /* exit */ } } @@ -56,7 +56,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessage(&msg); } } diff --git a/programs/wcmd/batch.c b/programs/wcmd/batch.c index b73e3efe05d..c92525172fe 100644 --- a/programs/wcmd/batch.c +++ b/programs/wcmd/batch.c @@ -112,8 +112,8 @@ char cmd1[1024],cmd2[1024]; char *p, *s, *t; int i; - /* Get working version of command line */ - strcpy(cmd1, line); + /* Get working version of command line */ + strcpy(cmd1, line); /* Expand environment variables in a batch file %{0-9} first */ /* Then env vars, and if any left (ie use of undefined vars,*/ @@ -122,8 +122,8 @@ int i; /* contents of fred, then the digit 1. Would need to remove */ /* ExpandEnvStrings to achieve this */ - /* Replace use of %0...%9 */ - p = cmd1; + /* Replace use of %0...%9 */ + p = cmd1; while ((p = strchr(p, '%'))) { i = *(p+1) - '0'; if ((i >= 0) && (i <= 9)) { @@ -132,8 +132,8 @@ int i; strcpy (p, t); strcat (p, s); free (s); - } else { - p++; + } else { + p++; } } @@ -146,25 +146,25 @@ int i; /* In a batch program, unknown variables are replace by nothing */ /* so remove any remaining %var% */ - p = cmd2; - while ((p = strchr(p, '%'))) { - s = strchr(p+1, '%'); - if (!s) { - *p=0x00; - } else { - t = strdup(s+1); - strcpy(p, t); - free(t); - } - } + p = cmd2; + while ((p = strchr(p, '%'))) { + s = strchr(p+1, '%'); + if (!s) { + *p=0x00; + } else { + t = strdup(s+1); + strcpy(p, t); + free(t); + } + } /* Show prompt before batch line IF echo is on */ - if (echo_mode && (line[0] != '@')) { - WCMD_show_prompt(); - WCMD_output ("%s\n", cmd2); - } + if (echo_mode && (line[0] != '@')) { + WCMD_show_prompt(); + WCMD_output ("%s\n", cmd2); + } - WCMD_process_command (cmd2); + WCMD_process_command (cmd2); } /******************************************************************* diff --git a/programs/wcmd/builtins.c b/programs/wcmd/builtins.c index ee1539600d0..95e81cc5ee9 100644 --- a/programs/wcmd/builtins.c +++ b/programs/wcmd/builtins.c @@ -227,7 +227,7 @@ int count; echo_mode = 0; return; } - WCMD_output_asis (command); + WCMD_output_asis (command); WCMD_output (newline); } @@ -628,7 +628,7 @@ void WCMD_setshow_env (char *s) { LPVOID env; char *p; int status; -char buffer[1048]; +char buffer[1048]; if (strlen(param1) == 0) { env = GetEnvironmentStrings (); @@ -642,22 +642,22 @@ char buffer[1048]; p = strchr (s, '='); if (p == NULL) { - /* FIXME: Emulate Win98 for now, ie "SET C" looks ONLY for an - environment variable C, whereas on NT it shows ALL variables - starting with C. - */ - status = GetEnvironmentVariable(s, buffer, sizeof(buffer)); - if (status) { - WCMD_output("%s=%s\n", s, buffer); - } else { - WCMD_output ("Environment variable %s not defined\n", s); - } + /* FIXME: Emulate Win98 for now, ie "SET C" looks ONLY for an + environment variable C, whereas on NT it shows ALL variables + starting with C. + */ + status = GetEnvironmentVariable(s, buffer, sizeof(buffer)); + if (status) { + WCMD_output("%s=%s\n", s, buffer); + } else { + WCMD_output ("Environment variable %s not defined\n", s); + } return; } *p++ = '\0'; - if (strlen(p) == 0) p = 0x00; - status = SetEnvironmentVariable (s, p); + if (strlen(p) == 0) p = 0x00; + status = SetEnvironmentVariable (s, p); if (!status) WCMD_print_error(); } /* WCMD_output (newline); @JED*/ diff --git a/programs/wcmd/directory.c b/programs/wcmd/directory.c index 317df7bc846..2a1faff69f8 100644 --- a/programs/wcmd/directory.c +++ b/programs/wcmd/directory.c @@ -41,7 +41,7 @@ extern int echo_mode; extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH]; extern DWORD errorlevel; -int file_total, dir_total, line_count, page_mode, recurse, wide, bare, +int file_total, dir_total, line_count, page_mode, recurse, wide, bare, max_width; __int64 byte_total; @@ -100,7 +100,7 @@ CONSOLE_SCREEN_BUFFER_INFO consoleInfo; if (recurse) { WCMD_output ("\n\n Total files listed:\n%8d files%25s bytes\n", file_total, WCMD_filesize64 (byte_total)); - WCMD_output ("%8d directories %18s bytes free\n\n", + WCMD_output ("%8d directories %18s bytes free\n\n", dir_total, WCMD_filesize64 (free.QuadPart)); } else { WCMD_output (" %18s bytes free\n\n", WCMD_filesize64 (free.QuadPart)); @@ -117,7 +117,7 @@ CONSOLE_SCREEN_BUFFER_INFO consoleInfo; * FIXME: Entries sorted by name only. Should we support DIRCMD?? * FIXME: Assumes 24-line display for the /P qualifier. * FIXME: Other command qualifiers not supported. - * FIXME: DIR /S FILENAME fails if at least one matching file is not found in the top level. + * FIXME: DIR /S FILENAME fails if at least one matching file is not found in the top level. */ void WCMD_list_directory (char *search_path, int level) { @@ -258,7 +258,7 @@ ULARGE_INTEGER byte_count, file_size; datestring, timestring, (fd+i)->cFileName); linesout++; } else { - if (!((strcmp((fd+i)->cFileName, ".") == 0) || + if (!((strcmp((fd+i)->cFileName, ".") == 0) || (strcmp((fd+i)->cFileName, "..") == 0))) { WCMD_output ("%s%s\n", recurse?real_path:"", (fd+i)->cFileName); linesout++; diff --git a/programs/wcmd/wcmd.h b/programs/wcmd/wcmd.h index 7ce15e3ea1b..8f0e29a62c1 100644 --- a/programs/wcmd/wcmd.h +++ b/programs/wcmd/wcmd.h @@ -1,5 +1,5 @@ /* - * WCMD - Wine-compatible command line interface. + * WCMD - Wine-compatible command line interface. * * Copyright (C) 1999 D A Pickles * @@ -46,7 +46,7 @@ void WCMD_goto (void); void WCMD_if (char *); void WCMD_move (void); void WCMD_output (char *format, ...); -void WCMD_output_asis (char *message); +void WCMD_output_asis (char *message); void WCMD_parse (char *s, char *q, char *p1, char *p2); void WCMD_pause (void); void WCMD_pipe (char *command); diff --git a/programs/wcmd/wcmdmain.c b/programs/wcmd/wcmdmain.c index 1bb10431859..a4b6539af89 100644 --- a/programs/wcmd/wcmdmain.c +++ b/programs/wcmd/wcmdmain.c @@ -1,5 +1,5 @@ /* - * WCMD - Wine-compatible command line interface. + * WCMD - Wine-compatible command line interface. * * Copyright (C) 1999 - 2001 D A Pickles * @@ -198,11 +198,11 @@ char *whichcmd; } if ((p = strchr(cmd,'<')) != NULL) *p = '\0'; -/* - * Strip leading whitespaces, and a '@' if supplied - */ - whichcmd = WCMD_strtrim_leading_spaces(cmd); - if (whichcmd[0] == '@') whichcmd++; +/* + * Strip leading whitespaces, and a '@' if supplied + */ + whichcmd = WCMD_strtrim_leading_spaces(cmd); + if (whichcmd[0] == '@') whichcmd++; /* * Check if the command entered is internal. If it is, pass the rest of the @@ -210,14 +210,14 @@ char *whichcmd; */ count = 0; - while (IsCharAlphaNumeric(whichcmd[count])) { + while (IsCharAlphaNumeric(whichcmd[count])) { count++; } for (i=0; i<=WCMD_EXIT; i++) { if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, - whichcmd, count, inbuilt[i], -1) == 2) break; + whichcmd, count, inbuilt[i], -1) == 2) break; } - p = WCMD_strtrim_leading_spaces (&whichcmd[count]); + p = WCMD_strtrim_leading_spaces (&whichcmd[count]); WCMD_parse (p, quals, param1, param2); switch (i) { @@ -253,11 +253,11 @@ char *whichcmd; case WCMD_ECHO: /* Use the unstripped version of the following data - step over the space */ /* but only if a parameter follows */ - if (strlen(&whichcmd[count]) > 0) - WCMD_echo(&whichcmd[count+1]); - else - WCMD_echo(&whichcmd[count]); - break; + if (strlen(&whichcmd[count]) > 0) + WCMD_echo(&whichcmd[count+1]); + else + WCMD_echo(&whichcmd[count]); + break; case WCMD_FOR: WCMD_for (p); break; @@ -309,8 +309,8 @@ char *whichcmd; WCMD_setshow_time (); break; case WCMD_TITLE: - if (strlen(&whichcmd[count]) > 0) - WCMD_title(&whichcmd[count+1]); + if (strlen(&whichcmd[count]) > 0) + WCMD_title(&whichcmd[count+1]); break; case WCMD_TYPE: WCMD_type (); @@ -327,7 +327,7 @@ char *whichcmd; case WCMD_EXIT: ExitProcess (0); default: - WCMD_run_program (whichcmd); + WCMD_run_program (whichcmd); }; if (old_stdin) { CloseHandle (GetStdHandle (STD_INPUT_HANDLE)); @@ -582,7 +582,7 @@ DWORD count; va_end(ap); } -/******************************************************************* +/******************************************************************* * WCMD_output_asis - send output to current standard output device. * without formatting eg. when message contains '%' */ diff --git a/programs/wineconsole/dialog.c b/programs/wineconsole/dialog.c index 945fb31c740..61bb8e060f8 100644 --- a/programs/wineconsole/dialog.c +++ b/programs/wineconsole/dialog.c @@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wineconsole); enum WCUSER_ApplyTo { /* Prop sheet CFG */ - WCUSER_ApplyToCursorSize, + WCUSER_ApplyToCursorSize, WCUSER_ApplyToHistorySize, WCUSER_ApplyToHistoryMode, WCUSER_ApplyToMenuMask, WCUSER_ApplyToEditMode, /* Prop sheet FNT */ @@ -38,13 +38,13 @@ enum WCUSER_ApplyTo { WCUSER_ApplyToBufferSize, WCUSER_ApplyToWindow }; -struct dialog_info +struct dialog_info { struct config_data* config; /* pointer to configuration used for dialog box */ struct inner_data* data; /* pointer to current winecon info */ HWND hDlg; /* handle to active propsheet */ int nFont; /* number of font size in size LB */ - struct font_info + struct font_info { UINT height; UINT weight; @@ -80,7 +80,7 @@ static void WCUSER_ApplyDefault(struct dialog_info* di, HWND hDlg, enum WCUSER_A LOGFONT lf; HFONT hFont; - WCUSER_FillLogFont(&lf, di->font[val].faceName, + WCUSER_FillLogFont(&lf, di->font[val].faceName, di->font[val].height, di->font[val].weight); hFont = WCUSER_CopyFont(di->config, PRIVATE(di->data)->hWnd, &lf); DeleteObject(hFont); @@ -127,7 +127,7 @@ static void WCUSER_ApplyCurrent(struct dialog_info* di, HWND hDlg, enum WCUSER_A case WCUSER_ApplyToFont: { LOGFONT lf; - WCUSER_FillLogFont(&lf, di->font[val].faceName, + WCUSER_FillLogFont(&lf, di->font[val].faceName, di->font[val].height, di->font[val].weight); WCUSER_SetFont(di->data, &lf); } @@ -156,8 +156,8 @@ static BOOL WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR { struct dialog_info* di; unsigned idc; - - switch (msg) + + switch (msg) { case WM_INITDIALOG: di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam; @@ -171,11 +171,11 @@ static BOOL WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR SetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, WINECON_GetHistorySize(di->data->hConIn), FALSE); if (WINECON_GetHistoryMode(di->data->hConIn)) SendDlgItemMessage(hDlg, IDC_OPT_HIST_DOUBLE, BM_SETCHECK, BST_CHECKED, 0L); - SendDlgItemMessage(hDlg, IDC_OPT_CONF_CTRL, BM_SETCHECK, + SendDlgItemMessage(hDlg, IDC_OPT_CONF_CTRL, BM_SETCHECK, (di->config->menu_mask & MK_CONTROL) ? BST_CHECKED : BST_UNCHECKED, 0L); - SendDlgItemMessage(hDlg, IDC_OPT_CONF_SHIFT, BM_SETCHECK, + SendDlgItemMessage(hDlg, IDC_OPT_CONF_SHIFT, BM_SETCHECK, (di->config->menu_mask & MK_SHIFT) ? BST_CHECKED : BST_UNCHECKED, 0L); - SendDlgItemMessage(hDlg, IDC_OPT_QUICK_EDIT, BM_SETCHECK, + SendDlgItemMessage(hDlg, IDC_OPT_QUICK_EDIT, BM_SETCHECK, (di->config->quick_edit) ? BST_CHECKED : BST_UNCHECKED, 0L); return FALSE; /* because we set the focus */ case WM_COMMAND: @@ -188,14 +188,14 @@ static BOOL WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); - switch (nmhdr->code) + switch (nmhdr->code) { case PSN_SETACTIVE: /* needed in propsheet to keep properly the selected radio button * otherwise, the focus would be set to the first tab stop in the * propsheet, which would always activate the first radio button */ - if (IsDlgButtonChecked(hDlg, IDC_OPT_CURSOR_SMALL) == BST_CHECKED) + if (IsDlgButtonChecked(hDlg, IDC_OPT_CURSOR_SMALL) == BST_CHECKED) idc = IDC_OPT_CURSOR_SMALL; else if (IsDlgButtonChecked(hDlg, IDC_OPT_CURSOR_MEDIUM) == BST_CHECKED) idc = IDC_OPT_CURSOR_MEDIUM; @@ -213,7 +213,7 @@ static BOOL WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR val = GetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, &done, FALSE); if (done) (di->apply)(di, hDlg, WCUSER_ApplyToHistorySize, val); - (di->apply)(di, hDlg, WCUSER_ApplyToHistoryMode, + (di->apply)(di, hDlg, WCUSER_ApplyToHistoryMode, IsDlgButtonChecked(hDlg, IDC_OPT_HIST_DOUBLE) & BST_CHECKED); val = 0; @@ -272,13 +272,13 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam, int size_idx; struct dialog_info* di; HFONT hFont, hOldFont; - + di = (struct dialog_info*)GetWindowLong(GetParent(hWnd), DWL_USER); BeginPaint(hWnd, &ps); font_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0L, 0L); size_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_GETCURSEL, 0L, 0L); - + hFont = (HFONT)GetWindowLong(hWnd, 0L); if (hFont) { @@ -286,12 +286,12 @@ static LRESULT WINAPI WCUSER_FontPreviewProc(HWND hWnd, UINT msg, WPARAM wParam, WCHAR buf2[256]; int len1, len2; - len1 = LoadString(GetModuleHandle(NULL), IDS_FNT_PREVIEW_1, + len1 = LoadString(GetModuleHandle(NULL), IDS_FNT_PREVIEW_1, buf1, sizeof(buf1) / sizeof(WCHAR)); len2 = LoadString(GetModuleHandle(NULL), IDS_FNT_PREVIEW_2, buf2, sizeof(buf2) / sizeof(WCHAR)); buf1[len1] = buf2[len2] = 0; - if (len1) + if (len1) { hOldFont = SelectObject(ps.hdc, hFont); SetBkColor(ps.hdc, WCUSER_ColorMap[GetWindowLong(GetDlgItem(di->hDlg, IDC_FNT_COLOR_BK), 0)]); @@ -326,11 +326,11 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam int i, step; RECT client, r; HBRUSH hbr; - + BeginPaint(hWnd, &ps); GetClientRect(hWnd, &client); step = client.right / 8; - + for (i = 0; i < 16; i++) { r.top = (i / 8) * (client.bottom / 2); @@ -370,7 +370,7 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam { int i, step; RECT client; - + GetClientRect(hWnd, &client); step = client.right / 8; i = (HIWORD(lParam) >= client.bottom / 2) ? 8 : 0; @@ -391,7 +391,7 @@ static LRESULT WINAPI WCUSER_ColorPreviewProc(HWND hWnd, UINT msg, WPARAM wParam * * enumerates all the font names with at least one valid font */ -static int CALLBACK font_enum_size2(const LOGFONT* lf, const TEXTMETRIC* tm, +static int CALLBACK font_enum_size2(const LOGFONT* lf, const TEXTMETRIC* tm, DWORD FontType, LPARAM lParam) { struct dialog_info* di = (struct dialog_info*)lParam; @@ -405,7 +405,7 @@ static int CALLBACK font_enum_size2(const LOGFONT* lf, const TEXTMETRIC* tm, return 1; } -static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, +static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, DWORD FontType, LPARAM lParam) { struct dialog_info* di = (struct dialog_info*)lParam; @@ -420,10 +420,10 @@ static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, } else di->nFont = 1; - + if (di->nFont) { - SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_ADDSTRING, + SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_ADDSTRING, 0, (LPARAM)lf->lfFaceName); } } @@ -436,7 +436,7 @@ static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, * * */ -static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm, +static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm, DWORD FontType, LPARAM lParam) { struct dialog_info* di = (struct dialog_info*)lParam; @@ -477,11 +477,11 @@ static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm, * do the job by hand... get where to insert the new string */ for (idx = 0; idx < di->nFont && tm->tmHeight > di->font[idx].height; idx++); - while (idx < di->nFont && - tm->tmHeight == di->font[idx].height && + while (idx < di->nFont && + tm->tmHeight == di->font[idx].height && tm->tmWeight > di->font[idx].weight) idx++; - if (idx == di->nFont || + if (idx == di->nFont || tm->tmHeight != di->font[idx].height || tm->tmWeight < di->font[idx].weight) { @@ -521,8 +521,8 @@ static BOOL select_font(struct dialog_info* di) if (font_idx < 0 || size_idx < 0 || size_idx >= di->nFont) return FALSE; - - WCUSER_FillLogFont(&lf, di->font[size_idx].faceName, + + WCUSER_FillLogFont(&lf, di->font[size_idx].faceName, di->font[size_idx].height, di->font[size_idx].weight); hFont = WCUSER_CopyFont(&config, PRIVATE(di->data)->hWnd, &lf); if (!hFont) return FALSE; @@ -555,7 +555,7 @@ static BOOL fill_list_size(struct dialog_info* di, BOOL doInit) idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0L, 0L); if (idx < 0) return FALSE; - + SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETTEXT, idx, (LPARAM)lfFaceName); SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_RESETCONTENT, 0L, 0L); if (di->font) HeapFree(GetProcessHeap(), 0, di->font); @@ -596,7 +596,7 @@ static BOOL fill_list_font(struct dialog_info* di) { SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_RESETCONTENT, 0L, 0L); EnumFontFamilies(PRIVATE(di->data)->hMemDC, NULL, font_enum, (LPARAM)di); - if (SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_SELECTSTRING, + if (SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_SELECTSTRING, (WPARAM)-1, (LPARAM)di->config->face_name) == LB_ERR) SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_SETCURSEL, 0L, 0L); fill_list_size(di, TRUE); @@ -612,7 +612,7 @@ static BOOL WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM { struct dialog_info* di; - switch (msg) + switch (msg) { case WM_INITDIALOG: di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam; @@ -626,15 +626,15 @@ static BOOL WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM break; case WM_COMMAND: di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { - case IDC_FNT_LIST_FONT: + case IDC_FNT_LIST_FONT: if (HIWORD(wParam) == LBN_SELCHANGE) { fill_list_size(di, FALSE); } break; - case IDC_FNT_LIST_SIZE: + case IDC_FNT_LIST_SIZE: if (HIWORD(wParam) == LBN_SELCHANGE) { select_font(di); @@ -648,7 +648,7 @@ static BOOL WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM DWORD val; di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); - switch (nmhdr->code) + switch (nmhdr->code) { case PSN_SETACTIVE: di->hDlg = hDlg; @@ -658,7 +658,7 @@ static BOOL WINAPI WCUSER_FontDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM if (val < di->nFont) (di->apply)(di, hDlg, WCUSER_ApplyToFont, val); - (di->apply)(di, hDlg, WCUSER_ApplyToAttribute, + (di->apply)(di, hDlg, WCUSER_ApplyToAttribute, (GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0) << 4) | GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0)); @@ -684,7 +684,7 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR { struct dialog_info* di; - switch (msg) + switch (msg) { case WM_INITDIALOG: di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam; @@ -697,7 +697,7 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR break; case WM_COMMAND: di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); - switch (LOWORD(wParam)) + switch (LOWORD(wParam)) { } break; @@ -709,7 +709,7 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR BOOL st_w, st_h; di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER); - switch (nmhdr->code) + switch (nmhdr->code) { case PSN_SETACTIVE: di->hDlg = hDlg; @@ -721,10 +721,10 @@ static BOOL WINAPI WCUSER_ConfigDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR { (di->apply)(di, hDlg, WCUSER_ApplyToBufferSize, (DWORD)&sb); } - + pos.Right = GetDlgItemInt(hDlg, IDC_CNF_WIN_WIDTH, &st_w, FALSE); pos.Bottom = GetDlgItemInt(hDlg, IDC_CNF_WIN_HEIGHT, &st_h, FALSE); - if (st_w && st_h && + if (st_w && st_h && (pos.Right != di->config->win_width || pos.Bottom != di->config->win_height)) { pos.Left = pos.Top = 0; @@ -821,8 +821,8 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current) memset(&psHead, 0, sizeof(psHead)); psHead.dwSize = sizeof(psHead); - if (!LoadString(GetModuleHandle(NULL), - (current) ? IDS_DLG_TIT_CURRENT : IDS_DLG_TIT_DEFAULT, + if (!LoadString(GetModuleHandle(NULL), + (current) ? IDS_DLG_TIT_CURRENT : IDS_DLG_TIT_DEFAULT, buff, sizeof(buff) / sizeof(buff[0]))) { buff[0] = 'S'; @@ -837,7 +837,7 @@ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current) psHead.nPages = 3; psHead.hwndParent = PRIVATE(data)->hWnd; psHead.u3.phpage = psPage; - + PropertySheet(&psHead); return TRUE; diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c index a1c9e4e187b..a74ad0b801e 100644 --- a/programs/wineconsole/registry.c +++ b/programs/wineconsole/registry.c @@ -56,63 +56,63 @@ BOOL WINECON_RegLoad(struct config_data* cfg) if (RegOpenKey(HKEY_CURRENT_USER, wszConsole, &hConKey)) hConKey = 0; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszCursorSize, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszCursorSize, 0, &type, (char*)&val, &count)) val = 25; cfg->cursor_size = val; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszCursorVisible, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszCursorVisible, 0, &type, (char*)&val, &count)) val = 1; cfg->cursor_visible = val; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszExitOnDie, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszExitOnDie, 0, &type, (char*)&val, &count)) val = 1; cfg->exit_on_die = val; - count = sizeof(cfg->face_name); + count = sizeof(cfg->face_name); if (!hConKey || RegQueryValueEx(hConKey, wszFaceName, 0, &type, (char*)&cfg->face_name, &count)) cfg->face_name[0] = 0; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszFontSize, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszFontSize, 0, &type, (char*)&val, &count)) val = 0x000C0008; cfg->cell_height = HIWORD(val); cfg->cell_width = LOWORD(val); count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszFontWeight, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszFontWeight, 0, &type, (char*)&val, &count)) val = 0; cfg->font_weight = val; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszHistoryBufferSize, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszHistoryBufferSize, 0, &type, (char*)&val, &count)) val = 0; cfg->history_size = val; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszMenuMask, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszMenuMask, 0, &type, (char*)&val, &count)) val = 0; cfg->menu_mask = val; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszQuickEdit, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszQuickEdit, 0, &type, (char*)&val, &count)) val = 0; cfg->quick_edit = val; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszScreenBufferSize, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszScreenBufferSize, 0, &type, (char*)&val, &count)) val = 0x00190050; cfg->sb_height = HIWORD(val); cfg->sb_width = LOWORD(val); count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszScreenColors, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszScreenColors, 0, &type, (char*)&val, &count)) val = 0x000F; cfg->def_attr = val; count = sizeof(val); - if (!hConKey || RegQueryValueEx(hConKey, wszWindowSize, 0, &type, (char*)&val, &count)) + if (!hConKey || RegQueryValueEx(hConKey, wszWindowSize, 0, &type, (char*)&val, &count)) val = 0x00190050; cfg->win_height = HIWORD(val); cfg->win_width = LOWORD(val); @@ -133,12 +133,12 @@ BOOL WINECON_RegSave(const struct config_data* cfg) HKEY hConKey; DWORD val; - if (RegCreateKey(HKEY_CURRENT_USER, wszConsole, &hConKey)) + if (RegCreateKey(HKEY_CURRENT_USER, wszConsole, &hConKey)) { WINE_ERR("Can't open registry for saving\n"); return FALSE; } - + val = cfg->cursor_size; RegSetValueEx(hConKey, wszCursorSize, 0, REG_DWORD, (char*)&val, sizeof(val)); diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c index 62ae7f15ccc..0e3e9a4c2ab 100644 --- a/programs/wineconsole/user.c +++ b/programs/wineconsole/user.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wineconsole); WINE_DECLARE_DEBUG_CHANNEL(wc_font); /* mapping console colors to RGB values */ -COLORREF WCUSER_ColorMap[16] = +COLORREF WCUSER_ColorMap[16] = { RGB(0x00, 0x00, 0x00), RGB(0x00, 0x00, 0x80), RGB(0x00, 0x80, 0x00), RGB(0x00, 0x80, 0x80), RGB(0x80, 0x00, 0x00), RGB(0x80, 0x00, 0x80), RGB(0x80, 0x80, 0x00), RGB(0x80, 0x80, 0x80), @@ -49,7 +49,7 @@ static void WCUSER_FillMemDC(const struct inner_data* data, int upd_tp, int upd_ WORD attr; WCHAR* line; - /* no font has been set up yet, don't worry about filling the bitmap, + /* no font has been set up yet, don't worry about filling the bitmap, * we'll do it once a font is chosen */ if (!PRIVATE(data)->hFont) return; @@ -70,7 +70,7 @@ static void WCUSER_FillMemDC(const struct inner_data* data, int upd_tp, int upd_ { line[k - i] = cell[k].Char.UnicodeChar; } - TextOut(PRIVATE(data)->hMemDC, i * data->curcfg.cell_width, j * data->curcfg.cell_height, + TextOut(PRIVATE(data)->hMemDC, i * data->curcfg.cell_width, j * data->curcfg.cell_height, line, k - i); i = k - 1; } @@ -90,11 +90,11 @@ static void WCUSER_NewBitmap(struct inner_data* data, BOOL fill) HDC hDC; HBITMAP hnew, hold; - if (!data->curcfg.sb_width || !data->curcfg.sb_height || + if (!data->curcfg.sb_width || !data->curcfg.sb_height || !PRIVATE(data)->hFont || !(hDC = GetDC(PRIVATE(data)->hWnd))) return; - hnew = CreateCompatibleBitmap(hDC, - data->curcfg.sb_width * data->curcfg.cell_width, + hnew = CreateCompatibleBitmap(hDC, + data->curcfg.sb_width * data->curcfg.cell_width, data->curcfg.sb_height * data->curcfg.cell_height); ReleaseDC(PRIVATE(data)->hWnd, hDC); hold = SelectObject(PRIVATE(data)->hMemDC, hnew); @@ -130,9 +130,9 @@ static void WCUSER_PosCursor(const struct inner_data* data) { if (PRIVATE(data)->hWnd != GetFocus() || !data->curcfg.cursor_visible) return; - SetCaretPos((data->cursor.X - data->curcfg.win_pos.X) * data->curcfg.cell_width, + SetCaretPos((data->cursor.X - data->curcfg.win_pos.X) * data->curcfg.cell_width, (data->cursor.Y - data->curcfg.win_pos.Y) * data->curcfg.cell_height); - ShowCaret(PRIVATE(data)->hWnd); + ShowCaret(PRIVATE(data)->hWnd); } /****************************************************************** @@ -164,7 +164,7 @@ void WCUSER_ShapeCursor(struct inner_data* data, int size, int vis, BOOL force) ptr[w16b * j + (i / 8)] |= 0x80 >> (i & 7); } } - PRIVATE(data)->cursor_bitmap = CreateBitmap(data->curcfg.cell_width, + PRIVATE(data)->cursor_bitmap = CreateBitmap(data->curcfg.cell_width, data->curcfg.cell_height, 1, 1, ptr); HeapFree(GetProcessHeap(), 0, ptr); } @@ -180,7 +180,7 @@ void WCUSER_ShapeCursor(struct inner_data* data, int size, int vis, BOOL force) { if (vis) { - CreateCaret(PRIVATE(data)->hWnd, PRIVATE(data)->cursor_bitmap, + CreateCaret(PRIVATE(data)->hWnd, PRIVATE(data)->cursor_bitmap, data->curcfg.cell_width, data->curcfg.cell_height); WCUSER_PosCursor(data); } @@ -219,7 +219,7 @@ void WCUSER_ComputePositions(struct inner_data* data) if (data->curcfg.sb_width > data->curcfg.win_width) { dy = GetSystemMetrics(SM_CYHSCROLL); - SetScrollRange(PRIVATE(data)->hWnd, SB_HORZ, 0, + SetScrollRange(PRIVATE(data)->hWnd, SB_HORZ, 0, data->curcfg.sb_width - data->curcfg.win_width, FALSE); SetScrollPos(PRIVATE(data)->hWnd, SB_HORZ, 0, FALSE); /* FIXME */ ShowScrollBar(PRIVATE(data)->hWnd, SB_HORZ, TRUE); @@ -232,11 +232,11 @@ void WCUSER_ComputePositions(struct inner_data* data) if (data->curcfg.sb_height > data->curcfg.win_height) { dx = GetSystemMetrics(SM_CXVSCROLL); - SetScrollRange(PRIVATE(data)->hWnd, SB_VERT, 0, + SetScrollRange(PRIVATE(data)->hWnd, SB_VERT, 0, data->curcfg.sb_height - data->curcfg.win_height, FALSE); SetScrollPos(PRIVATE(data)->hWnd, SB_VERT, 0, FALSE); /* FIXME */ ShowScrollBar(PRIVATE(data)->hWnd, SB_VERT, TRUE); - } + } else { ShowScrollBar(PRIVATE(data)->hWnd, SB_VERT, FALSE); @@ -255,7 +255,7 @@ void WCUSER_ComputePositions(struct inner_data* data) */ static void WCUSER_SetTitle(const struct inner_data* data) { - WCHAR buffer[256]; + WCHAR buffer[256]; if (WINECON_GetConsoleTitle(data->hConIn, buffer, sizeof(buffer))) SetWindowText(PRIVATE(data)->hWnd, buffer); @@ -269,13 +269,13 @@ void WCUSER_DumpLogFont(const char* pfx, const LOGFONT* lf, DWORD ft) "\tlf.lfCharSet=%u lf.lfOutPrecision=%u lf.lfClipPrecision=%u lf.lfQuality=%u\n" "\tlf->lfPitchAndFamily=%u lf.lfFaceName=%s\n", pfx, - (ft & RASTER_FONTTYPE) ? "raster" : "", - (ft & TRUETYPE_FONTTYPE) ? "truetype" : "", - ((ft & (RASTER_FONTTYPE|TRUETYPE_FONTTYPE)) == 0) ? "vector" : "", - (ft & DEVICE_FONTTYPE) ? "|device" : "", - lf->lfHeight, lf->lfWidth, lf->lfEscapement, lf->lfOrientation, + (ft & RASTER_FONTTYPE) ? "raster" : "", + (ft & TRUETYPE_FONTTYPE) ? "truetype" : "", + ((ft & (RASTER_FONTTYPE|TRUETYPE_FONTTYPE)) == 0) ? "vector" : "", + (ft & DEVICE_FONTTYPE) ? "|device" : "", + lf->lfHeight, lf->lfWidth, lf->lfEscapement, lf->lfOrientation, lf->lfWeight, lf->lfItalic, lf->lfUnderline, lf->lfStrikeOut, lf->lfCharSet, - lf->lfOutPrecision, lf->lfClipPrecision, lf->lfQuality, lf->lfPitchAndFamily, + lf->lfOutPrecision, lf->lfClipPrecision, lf->lfQuality, lf->lfPitchAndFamily, wine_dbgstr_w(lf->lfFaceName)); } @@ -287,13 +287,13 @@ void WCUSER_DumpTextMetric(const TEXTMETRIC* tm, DWORD ft) "\ttmDigitizedAspectX=%ld tmDigitizedAspectY=%ld\n" "\ttmFirstChar=%d tmLastChar=%d tmDefaultChar=%d tmBreakChar=%d\n" "\ttmItalic=%u tmUnderlined=%u tmStruckOut=%u tmPitchAndFamily=%u tmCharSet=%u\n", - (ft & RASTER_FONTTYPE) ? "raster" : "", - (ft & TRUETYPE_FONTTYPE) ? "truetype" : "", - ((ft & (RASTER_FONTTYPE|TRUETYPE_FONTTYPE)) == 0) ? "vector" : "", - (ft & DEVICE_FONTTYPE) ? "|device" : "", - tm->tmHeight, tm->tmAscent, tm->tmDescent, tm->tmInternalLeading, tm->tmExternalLeading, tm->tmAveCharWidth, - tm->tmMaxCharWidth, tm->tmWeight, tm->tmOverhang, tm->tmDigitizedAspectX, tm->tmDigitizedAspectY, - tm->tmFirstChar, tm->tmLastChar, tm->tmDefaultChar, tm->tmBreakChar, tm->tmItalic, tm->tmUnderlined, tm->tmStruckOut, + (ft & RASTER_FONTTYPE) ? "raster" : "", + (ft & TRUETYPE_FONTTYPE) ? "truetype" : "", + ((ft & (RASTER_FONTTYPE|TRUETYPE_FONTTYPE)) == 0) ? "vector" : "", + (ft & DEVICE_FONTTYPE) ? "|device" : "", + tm->tmHeight, tm->tmAscent, tm->tmDescent, tm->tmInternalLeading, tm->tmExternalLeading, tm->tmAveCharWidth, + tm->tmMaxCharWidth, tm->tmWeight, tm->tmOverhang, tm->tmDigitizedAspectX, tm->tmDigitizedAspectY, + tm->tmFirstChar, tm->tmLastChar, tm->tmDefaultChar, tm->tmBreakChar, tm->tmItalic, tm->tmUnderlined, tm->tmStruckOut, tm->tmPitchAndFamily, tm->tmCharSet); } @@ -310,7 +310,7 @@ BOOL WCUSER_AreFontsEqual(const struct config_data* config, const LOGFONT* lf) !lstrcmp(lf->lfFaceName, config->face_name); } -struct font_chooser +struct font_chooser { struct inner_data* data; int done; @@ -339,7 +339,7 @@ BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRIC* */ BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONT* lf) { - return (lf->lfPitchAndFamily & 3) == FIXED_PITCH && + return (lf->lfPitchAndFamily & 3) == FIXED_PITCH && /* (lf->lfPitchAndFamily & 0xF0) == FF_MODERN && */ (lf->lfCharSet == DEFAULT_CHARSET || lf->lfCharSet == ANSI_CHARSET); } @@ -350,7 +350,7 @@ BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONT* lf) * * Helper functions to get a decent font for the renderer */ -static int CALLBACK get_first_font_enum_2(const LOGFONT* lf, const TEXTMETRIC* tm, +static int CALLBACK get_first_font_enum_2(const LOGFONT* lf, const TEXTMETRIC* tm, DWORD FontType, LPARAM lParam) { struct font_chooser* fc = (struct font_chooser*)lParam; @@ -361,7 +361,7 @@ static int CALLBACK get_first_font_enum_2(const LOGFONT* lf, const TEXTMETRIC* t LOGFONT mlf = *lf; /* Use the default sizes for the font (this is needed, especially for - * TrueType fonts, so that we get a decent size, not the max size) + * TrueType fonts, so that we get a decent size, not the max size) */ mlf.lfWidth = fc->data->curcfg.cell_width; mlf.lfHeight = fc->data->curcfg.cell_height; @@ -369,7 +369,7 @@ static int CALLBACK get_first_font_enum_2(const LOGFONT* lf, const TEXTMETRIC* t { WCUSER_DumpLogFont("InitChoosing: ", &mlf, FontType); fc->done = 1; - /* since we've modified the current config with new font information, + /* since we've modified the current config with new font information, * set this information as the new default. */ fc->data->defcfg.cell_width = fc->data->curcfg.cell_width; @@ -385,7 +385,7 @@ static int CALLBACK get_first_font_enum_2(const LOGFONT* lf, const TEXTMETRIC* t return 1; } -static int CALLBACK get_first_font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, +static int CALLBACK get_first_font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, DWORD FontType, LPARAM lParam) { struct font_chooser* fc = (struct font_chooser*)lParam; @@ -393,7 +393,7 @@ static int CALLBACK get_first_font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, WCUSER_DumpLogFont("InitFamily: ", lf, FontType); if (WCUSER_ValidateFont(fc->data, lf)) { - EnumFontFamilies(PRIVATE(fc->data)->hMemDC, lf->lfFaceName, + EnumFontFamilies(PRIVATE(fc->data)->hMemDC, lf->lfFaceName, get_first_font_enum_2, lParam); return !fc->done; /* we just need the first matching one... */ } @@ -426,7 +426,7 @@ HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONT* lf) * - the average width * - the largest width * - the width of all characters in the font - * This isn't true in Wine. As a temporary workaound, we get as the width of the + * This isn't true in Wine. As a temporary workaound, we get as the width of the * cell, the width of the first character in the font, after checking that all * characters in the font have the same width (I hear paranoïa coming) * when this gets fixed, the should be using tm.tmAveCharWidth or tm.tmMaxCharWidth @@ -436,15 +436,15 @@ HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONT* lf) for (i = tm.tmFirstChar + 1; i <= tm.tmLastChar; i += sizeof(buf) / sizeof(buf[0])) { int j, l; - + l = min(tm.tmLastChar - i, sizeof(buf) / sizeof(buf[0]) - 1); GetCharWidth32(hDC, i, i + l, buf); - for (j = 0; j <= l; j++) + for (j = 0; j <= l; j++) { if (buf[j] != w) { WINE_WARN("Non uniform cell width: [%d]=%d [%d]=%d\n" - "This may be caused by old freetype libraries, >= 2.0.8 is recommended\n", + "This may be caused by old freetype libraries, >= 2.0.8 is recommended\n", i + j, buf[j], tm.tmFirstChar, w); goto err; } @@ -486,7 +486,7 @@ void WCUSER_FillLogFont(LOGFONT* lf, const WCHAR* name, UINT height, UINT wei lf->lfStrikeOut = FALSE; lf->lfCharSet = DEFAULT_CHARSET; lf->lfOutPrecision = OUT_DEFAULT_PRECIS; - lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; lf->lfQuality = DEFAULT_QUALITY; lf->lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; lstrcpy(lf->lfFaceName, name); @@ -501,7 +501,7 @@ BOOL WCUSER_SetFont(struct inner_data* data, const LOGFONT* logfont) { HFONT hFont; - if (PRIVATE(data)->hFont != 0 && WCUSER_AreFontsEqual(&data->curcfg, logfont)) + if (PRIVATE(data)->hFont != 0 && WCUSER_AreFontsEqual(&data->curcfg, logfont)) return TRUE; hFont = WCUSER_CopyFont(&data->curcfg, PRIVATE(data)->hWnd, logfont); @@ -535,11 +535,11 @@ static BOOL WCUSER_InitFont(struct inner_data* data) { LOGFONT lf; - WCUSER_FillLogFont(&lf, data->curcfg.face_name, + WCUSER_FillLogFont(&lf, data->curcfg.face_name, data->curcfg.cell_height, data->curcfg.font_weight); if (PRIVATE(data)->hFont != 0) WINE_FIXME("Oh strange\n"); - if (WCUSER_SetFont(data, &lf)) + if (WCUSER_SetFont(data, &lf)) { WCUSER_DumpLogFont("InitReuses: ", &lf, 0); return TRUE; @@ -668,7 +668,7 @@ static void WCUSER_CopySelectionToClipboard(const struct inner_data* data) c.X = data->curcfg.win_pos.X + min(PRIVATE(data)->selectPt1.X, PRIVATE(data)->selectPt2.X); c.Y = data->curcfg.win_pos.Y + min(PRIVATE(data)->selectPt1.Y, PRIVATE(data)->selectPt2.Y); - + for (y = 0; y < h; y++, c.Y++) { ReadConsoleOutputCharacter(data->hConOut, &p[y * w], w - 1, c, NULL); @@ -712,10 +712,10 @@ static void WCUSER_PasteFromClipboard(struct inner_data* data) ir[0].Event.KeyEvent.wVirtualKeyCode = LOBYTE(sh); ir[0].Event.KeyEvent.wVirtualScanCode = MapVirtualKey(LOBYTE(sh), 0); ir[0].Event.KeyEvent.uChar.UnicodeChar = ptr[i]; - + ir[1] = ir[0]; ir[1].Event.KeyEvent.bKeyDown = FALSE; - + WriteConsoleInput(data->hConIn, ir, 2, &n); } GlobalUnlock(h); @@ -754,11 +754,11 @@ static void WCUSER_Paint(const struct inner_data* data) PAINTSTRUCT ps; BeginPaint(PRIVATE(data)->hWnd, &ps); - BitBlt(ps.hdc, 0, 0, - data->curcfg.win_width * data->curcfg.cell_width, + BitBlt(ps.hdc, 0, 0, + data->curcfg.win_width * data->curcfg.cell_width, data->curcfg.win_height * data->curcfg.cell_height, - PRIVATE(data)->hMemDC, - data->curcfg.win_pos.X * data->curcfg.cell_width, + PRIVATE(data)->hMemDC, + data->curcfg.win_pos.X * data->curcfg.cell_width, data->curcfg.win_pos.Y * data->curcfg.cell_height, SRCCOPY); if (PRIVATE(data)->has_selection) @@ -867,10 +867,10 @@ static void WCUSER_SetMenuDetails(const struct inner_data* data, HMENU hMenu) { if (!hMenu) {WINE_ERR("Issue in getting menu bits\n");return;} - EnableMenuItem(hMenu, IDS_COPY, + EnableMenuItem(hMenu, IDS_COPY, MF_BYCOMMAND|(PRIVATE(data)->has_selection ? MF_ENABLED : MF_GRAYED)); - EnableMenuItem(hMenu, IDS_PASTE, - MF_BYCOMMAND|(IsClipboardFormatAvailable(CF_UNICODETEXT) + EnableMenuItem(hMenu, IDS_PASTE, + MF_BYCOMMAND|(IsClipboardFormatAvailable(CF_UNICODETEXT) ? MF_ENABLED : MF_GRAYED)); EnableMenuItem(hMenu, IDS_SCROLL, MF_BYCOMMAND|MF_GRAYED); EnableMenuItem(hMenu, IDS_SEARCH, MF_BYCOMMAND|MF_GRAYED); @@ -892,10 +892,10 @@ static DWORD WCUSER_GetCtrlKeyState(BYTE* keyState) if (keyState[VK_RCONTROL] & 0x80) ret |= RIGHT_CTRL_PRESSED; if (keyState[VK_LMENU] & 0x80) ret |= LEFT_ALT_PRESSED; if (keyState[VK_RMENU] & 0x80) ret |= RIGHT_ALT_PRESSED; - if (keyState[VK_CAPITAL] & 0x01) ret |= CAPSLOCK_ON; + if (keyState[VK_CAPITAL] & 0x01) ret |= CAPSLOCK_ON; if (keyState[VK_NUMLOCK] & 0x01) ret |= NUMLOCK_ON; if (keyState[VK_SCROLL] & 0x01) ret |= SCROLLLOCK_ON; - + return ret; } @@ -904,7 +904,7 @@ static DWORD WCUSER_GetCtrlKeyState(BYTE* keyState) * * Handles keys while selecting an area */ -static void WCUSER_HandleSelectionKey(struct inner_data* data, BOOL down, +static void WCUSER_HandleSelectionKey(struct inner_data* data, BOOL down, WPARAM wParam, LPARAM lParam) { BYTE keyState[256]; @@ -1010,7 +1010,7 @@ static void WCUSER_HandleSelectionKey(struct inner_data* data, BOOL down, * * generates input_record from windows WM_KEYUP/WM_KEYDOWN messages */ -static void WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down, +static void WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down, WPARAM wParam, LPARAM lParam, BOOL sys) { INPUT_RECORD ir; @@ -1023,9 +1023,9 @@ static void WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down, ir.Event.KeyEvent.bKeyDown = down; ir.Event.KeyEvent.wRepeatCount = LOWORD(lParam); ir.Event.KeyEvent.wVirtualKeyCode = wParam; - + ir.Event.KeyEvent.wVirtualScanCode = HIWORD(lParam) & 0xFF; - + ir.Event.KeyEvent.uChar.UnicodeChar = 0; ir.Event.KeyEvent.dwControlKeyState = WCUSER_GetCtrlKeyState(keyState); if (lParam & (1L << 24)) ir.Event.KeyEvent.dwControlKeyState |= ENHANCED_KEY; @@ -1040,7 +1040,7 @@ static void WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down, case 2: /* FIXME... should generate two events... */ /* fall thru */ - case 1: + case 1: last = buf[0]; break; default: @@ -1060,7 +1060,7 @@ static void WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down, * * */ -static void WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c, +static void WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c, WPARAM wParam, DWORD event) { INPUT_RECORD ir; @@ -1130,7 +1130,7 @@ static LRESULT CALLBACK WCUSER_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM PRIVATE(data)->has_selection = TRUE; } } - else + else { WCUSER_GenerateMouseInputRecord(data, WCUSER_GetCell(data, lParam), wParam, 0); } @@ -1152,7 +1152,7 @@ static LRESULT CALLBACK WCUSER_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM case WM_LBUTTONUP: if (data->curcfg.quick_edit) { - if (GetCapture() == PRIVATE(data)->hWnd && PRIVATE(data)->has_selection && + if (GetCapture() == PRIVATE(data)->hWnd && PRIVATE(data)->has_selection && (wParam& MK_LBUTTON)) { WCUSER_MoveSelection(data, PRIVATE(data)->selectPt1, WCUSER_GetCell(data, lParam), TRUE); @@ -1170,91 +1170,91 @@ static LRESULT CALLBACK WCUSER_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM GetWindowRect(hWnd, &r); WCUSER_SetMenuDetails(data, PRIVATE(data)->hPopMenu); - TrackPopupMenu(PRIVATE(data)->hPopMenu, TPM_LEFTALIGN|TPM_TOPALIGN, + TrackPopupMenu(PRIVATE(data)->hPopMenu, TPM_LEFTALIGN|TPM_TOPALIGN, r.left + LOWORD(lParam), r.top + HIWORD(lParam), 0, hWnd, NULL); } else { WCUSER_GenerateMouseInputRecord(data, WCUSER_GetCell(data, lParam), wParam, 0); } - break; + break; case WM_RBUTTONUP: /* no need to track for rbutton up when opening the popup... the event will be * swallowed by TrackPopupMenu */ WCUSER_GenerateMouseInputRecord(data, WCUSER_GetCell(data, lParam), wParam, 0); - break; + break; case WM_MOUSEWHEEL: /* FIXME: should we scroll too ? */ WCUSER_GenerateMouseInputRecord(data, WCUSER_GetCell(data, lParam), wParam, MOUSE_WHEELED); - break; + break; case WM_SETFOCUS: if (data->curcfg.cursor_visible) { - CreateCaret(PRIVATE(data)->hWnd, PRIVATE(data)->cursor_bitmap, - data->curcfg.cell_width, data->curcfg.cell_height); + CreateCaret(PRIVATE(data)->hWnd, PRIVATE(data)->cursor_bitmap, + data->curcfg.cell_width, data->curcfg.cell_height); WCUSER_PosCursor(data); } - break; - case WM_KILLFOCUS: + break; + case WM_KILLFOCUS: if (data->curcfg.cursor_visible) - DestroyCaret(); + DestroyCaret(); break; - case WM_HSCROLL: + case WM_HSCROLL: { int pos = data->curcfg.win_pos.X; - switch (LOWORD(wParam)) - { - case SB_PAGEUP: pos -= 8; break; - case SB_PAGEDOWN: pos += 8; break; + switch (LOWORD(wParam)) + { + case SB_PAGEUP: pos -= 8; break; + case SB_PAGEDOWN: pos += 8; break; case SB_LINEUP: pos--; break; case SB_LINEDOWN: pos++; break; case SB_THUMBTRACK: pos = HIWORD(wParam); break; default: break; - } + } if (pos < 0) pos = 0; - if (pos > data->curcfg.sb_width - data->curcfg.win_width) + if (pos > data->curcfg.sb_width - data->curcfg.win_width) pos = data->curcfg.sb_width - data->curcfg.win_width; if (pos != data->curcfg.win_pos.X) { - ScrollWindow(hWnd, (data->curcfg.win_pos.X - pos) * data->curcfg.cell_width, 0, + ScrollWindow(hWnd, (data->curcfg.win_pos.X - pos) * data->curcfg.cell_width, 0, NULL, NULL); data->curcfg.win_pos.X = pos; - SetScrollPos(hWnd, SB_HORZ, pos, TRUE); - UpdateWindow(hWnd); + SetScrollPos(hWnd, SB_HORZ, pos, TRUE); + UpdateWindow(hWnd); WCUSER_PosCursor(data); WINECON_NotifyWindowChange(data); } } break; - case WM_VSCROLL: + case WM_VSCROLL: { int pos = data->curcfg.win_pos.Y; - switch (LOWORD(wParam)) - { - case SB_PAGEUP: pos -= 8; break; - case SB_PAGEDOWN: pos += 8; break; + switch (LOWORD(wParam)) + { + case SB_PAGEUP: pos -= 8; break; + case SB_PAGEDOWN: pos += 8; break; case SB_LINEUP: pos--; break; case SB_LINEDOWN: pos++; break; case SB_THUMBTRACK: pos = HIWORD(wParam); break; default: break; - } + } if (pos < 0) pos = 0; - if (pos > data->curcfg.sb_height - data->curcfg.win_height) + if (pos > data->curcfg.sb_height - data->curcfg.win_height) pos = data->curcfg.sb_height - data->curcfg.win_height; if (pos != data->curcfg.win_pos.Y) { - ScrollWindow(hWnd, 0, (data->curcfg.win_pos.Y - pos) * data->curcfg.cell_height, + ScrollWindow(hWnd, 0, (data->curcfg.win_pos.Y - pos) * data->curcfg.cell_height, NULL, NULL); data->curcfg.win_pos.Y = pos; - SetScrollPos(hWnd, SB_VERT, pos, TRUE); - UpdateWindow(hWnd); + SetScrollPos(hWnd, SB_VERT, pos, TRUE); + UpdateWindow(hWnd); WCUSER_PosCursor(data); WINECON_NotifyWindowChange(data); } - } + } case WM_SYSCOMMAND: switch (wParam) { @@ -1264,7 +1264,7 @@ static LRESULT CALLBACK WCUSER_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM case IDS_PROPERTY: WCUSER_GetProperties(data, TRUE); break; - default: + default: return DefWindowProc(hWnd, uMsg, wParam, lParam); } break; @@ -1305,7 +1305,7 @@ static LRESULT CALLBACK WCUSER_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM case IDS_SEARCH: WINE_FIXME("Unhandled yet command: %x\n", wParam); break; - default: + default: return DefWindowProc(hWnd, uMsg, wParam, lParam); } break; @@ -1344,7 +1344,7 @@ static int WCUSER_MainLoop(struct inner_data* data) { MSG msg; - for (;;) + for (;;) { switch (MsgWaitForMultipleObjects(1, &data->hSynchro, FALSE, INFINITE, QS_ALLINPUT)) { @@ -1369,7 +1369,7 @@ static int WCUSER_MainLoop(struct inner_data* data) /* err */ break; } - } + } } /****************************************************************** @@ -1407,12 +1407,12 @@ BOOL WCUSER_InitBackend(struct inner_data* data) wndclass.hbrBackground = GetStockObject(BLACK_BRUSH); wndclass.lpszMenuName = NULL; wndclass.lpszClassName = wClassName; - + RegisterClass(&wndclass); CreateWindow(wndclass.lpszClassName, NULL, - WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_HSCROLL|WS_VSCROLL, - CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0, wndclass.hInstance, data); + WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_HSCROLL|WS_VSCROLL, + CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0, wndclass.hInstance, data); if (!PRIVATE(data)->hWnd) return FALSE; /* force update of current data */ diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h index 9f6e95a5cf2..bb8fd2a737d 100644 --- a/programs/wineconsole/winecon_private.h +++ b/programs/wineconsole/winecon_private.h @@ -25,7 +25,7 @@ /* this is the configuration stored & loaded into the registry */ struct config_data { - unsigned cell_width; /* width in pixels of a character */ + unsigned cell_width; /* width in pixels of a character */ unsigned cell_height; /* height in pixels of a character */ int cursor_size; /* in % of cell height */ int cursor_visible; diff --git a/programs/wineconsole/winecon_user.h b/programs/wineconsole/winecon_user.h index 7810f817043..d62e6629c10 100644 --- a/programs/wineconsole/winecon_user.h +++ b/programs/wineconsole/winecon_user.h @@ -45,12 +45,12 @@ extern COLORREF WCUSER_ColorMap[16]; extern BOOL WCUSER_GetProperties(struct inner_data*, BOOL); extern BOOL WCUSER_SetFont(struct inner_data* data, const LOGFONT* font); extern BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONT* lf); -extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, +extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRIC* tm, DWORD fontType); -extern BOOL WCUSER_AreFontsEqual(const struct config_data* config, +extern BOOL WCUSER_AreFontsEqual(const struct config_data* config, const LOGFONT* lf); extern HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONT* lf); -extern void WCUSER_FillLogFont(LOGFONT* lf, const WCHAR* name, +extern void WCUSER_FillLogFont(LOGFONT* lf, const WCHAR* name, UINT height, UINT weight); extern void WCUSER_DumpLogFont(const char* pfx, const LOGFONT* lf, DWORD ft); diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index 7f2a87d3a93..aec56d9dbec 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -194,7 +194,7 @@ int WINECON_GrabChanges(struct inner_data* data) } SERVER_END_REQ; if (!num) {WINE_WARN("hmm renderer signaled but no events available\n"); return 1;} - + /* FIXME: should do some event compression here (cursor pos, update) */ /* step 1: keep only last cursor pos event */ for (i = num - 1; i >= 0; i--) @@ -232,7 +232,7 @@ int WINECON_GrabChanges(struct inner_data* data) } } } - + WINE_TRACE("Events:"); for (i = 0; i < num; i++) { @@ -251,7 +251,7 @@ int WINECON_GrabChanges(struct inner_data* data) h = wine_server_call_err( req ) ? 0 : (HANDLE)reply->handle; } SERVER_END_REQ; - if (WINE_TRACE_ON(wineconsole)) + if (WINE_TRACE_ON(wineconsole)) WINE_DPRINTF(" active(%d)", (int)h); if (h) { @@ -260,14 +260,14 @@ int WINECON_GrabChanges(struct inner_data* data) } break; case CONSOLE_RENDERER_SB_RESIZE_EVENT: - if (data->curcfg.sb_width != evts[i].u.resize.width || + if (data->curcfg.sb_width != evts[i].u.resize.width || data->curcfg.sb_height != evts[i].u.resize.height) { - if (WINE_TRACE_ON(wineconsole)) + if (WINE_TRACE_ON(wineconsole)) WINE_DPRINTF(" resize(%d,%d)", evts[i].u.resize.width, evts[i].u.resize.height); data->curcfg.sb_width = evts[i].u.resize.width; data->curcfg.sb_height = evts[i].u.resize.height; - + data->cells = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, data->cells, data->curcfg.sb_width * data->curcfg.sb_height * sizeof(CHAR_INFO)); if (!data->cells) {WINE_ERR("OOM\n"); exit(0);} @@ -276,28 +276,28 @@ int WINECON_GrabChanges(struct inner_data* data) } break; case CONSOLE_RENDERER_UPDATE_EVENT: - if (WINE_TRACE_ON(wineconsole)) + if (WINE_TRACE_ON(wineconsole)) WINE_DPRINTF(" update(%d,%d)", evts[i].u.update.top, evts[i].u.update.bottom); WINECON_FetchCells(data, evts[i].u.update.top, evts[i].u.update.bottom); break; case CONSOLE_RENDERER_CURSOR_POS_EVENT: if (evts[i].u.cursor_pos.x != data->cursor.X || evts[i].u.cursor_pos.y != data->cursor.Y) - { + { data->cursor.X = evts[i].u.cursor_pos.x; data->cursor.Y = evts[i].u.cursor_pos.y; data->fnPosCursor(data); - if (WINE_TRACE_ON(wineconsole)) + if (WINE_TRACE_ON(wineconsole)) WINE_DPRINTF(" curs-pos(%d,%d)",evts[i].u.cursor_pos.x, evts[i].u.cursor_pos.y); } break; case CONSOLE_RENDERER_CURSOR_GEOM_EVENT: - if (evts[i].u.cursor_geom.size != data->curcfg.cursor_size || + if (evts[i].u.cursor_geom.size != data->curcfg.cursor_size || evts[i].u.cursor_geom.visible != data->curcfg.cursor_visible) { - data->fnShapeCursor(data, evts[i].u.cursor_geom.size, + data->fnShapeCursor(data, evts[i].u.cursor_geom.size, evts[i].u.cursor_geom.visible, FALSE); - if (WINE_TRACE_ON(wineconsole)) - WINE_DPRINTF(" curs-geom(%d,%d)", + if (WINE_TRACE_ON(wineconsole)) + WINE_DPRINTF(" curs-geom(%d,%d)", evts[i].u.cursor_geom.size, evts[i].u.cursor_geom.visible); } break; @@ -306,20 +306,20 @@ int WINECON_GrabChanges(struct inner_data* data) { data->fnScroll(data, evts[i].u.display.left, TRUE); data->fnPosCursor(data); - if (WINE_TRACE_ON(wineconsole)) + if (WINE_TRACE_ON(wineconsole)) WINE_DPRINTF(" h-scroll(%d)", evts[i].u.display.left); } if (evts[i].u.display.top != data->curcfg.win_pos.Y) { data->fnScroll(data, evts[i].u.display.top, FALSE); data->fnPosCursor(data); - if (WINE_TRACE_ON(wineconsole)) + if (WINE_TRACE_ON(wineconsole)) WINE_DPRINTF(" v-scroll(%d)", evts[i].u.display.top); } - if (evts[i].u.display.width != data->curcfg.win_width || + if (evts[i].u.display.width != data->curcfg.win_width || evts[i].u.display.height != data->curcfg.win_height) { - if (WINE_TRACE_ON(wineconsole)) + if (WINE_TRACE_ON(wineconsole)) WINE_DPRINTF(" win-size(%d,%d)", evts[i].u.display.width, evts[i].u.display.height); data->curcfg.win_width = evts[i].u.display.width; data->curcfg.win_height = evts[i].u.display.height; @@ -439,9 +439,9 @@ static BOOL WINECON_Spawn(struct inner_data* data, LPCSTR lpCmdLine) */ if (!DuplicateHandle(GetCurrentProcess(), data->hConIn, GetCurrentProcess(), &startup.hStdInput, GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE, TRUE, 0) || - !DuplicateHandle(GetCurrentProcess(), data->hConOut, GetCurrentProcess(), + !DuplicateHandle(GetCurrentProcess(), data->hConOut, GetCurrentProcess(), &startup.hStdOutput, GENERIC_READ|GENERIC_WRITE, TRUE, 0) || - !DuplicateHandle(GetCurrentProcess(), data->hConOut, GetCurrentProcess(), + !DuplicateHandle(GetCurrentProcess(), data->hConOut, GetCurrentProcess(), &startup.hStdError, GENERIC_READ|GENERIC_WRITE, TRUE, 0)) { WINE_ERR("Can't dup handles\n"); @@ -457,7 +457,7 @@ static BOOL WINECON_Spawn(struct inner_data* data, LPCSTR lpCmdLine) while (*ptr && *ptr++ != ' '); done = *ptr && CreateProcess(NULL, ptr, NULL, NULL, TRUE, 0L, NULL, NULL, &startup, &info); - + /* we no longer need the handles passed to the child for the console */ CloseHandle(startup.hStdInput); CloseHandle(startup.hStdOutput); diff --git a/programs/winemine/dialog.c b/programs/winemine/dialog.c index 5525efbcd3d..b7acda3fa7f 100644 --- a/programs/winemine/dialog.c +++ b/programs/winemine/dialog.c @@ -1,6 +1,6 @@ /* * WineMine (dialog.c) - * + * * Copyright 2000 Joshua Thielen * * This library is free software; you can redistribute it and/or @@ -35,7 +35,7 @@ BOOL CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam SetDlgItemInt( hDlg, IDC_EDITCOLS, p_board->cols, FALSE ); SetDlgItemInt( hDlg, IDC_EDITMINES, p_board->mines, FALSE ); return TRUE; - + case WM_COMMAND: switch( LOWORD( wParam ) ) { case IDOK: @@ -45,13 +45,13 @@ BOOL CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam CheckLevel( p_board ); EndDialog( hDlg, 0 ); return TRUE; - + case IDCANCEL: EndDialog( hDlg, 0 ); return TRUE; } break; - } + } return FALSE; } @@ -65,22 +65,22 @@ BOOL CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara SetDlgItemText( hDlg, IDC_EDITNAME, p_board->best_name[p_board->difficulty] ); return TRUE; - + case WM_COMMAND: switch( LOWORD( wParam ) ) { case IDOK: - GetDlgItemText( hDlg, IDC_EDITNAME, + GetDlgItemText( hDlg, IDC_EDITNAME, p_board->best_name[p_board->difficulty], sizeof( p_board->best_name[p_board->difficulty] ) ); EndDialog( hDlg, 0 ); return TRUE; - + case IDCANCEL: EndDialog( hDlg, 0 ); return TRUE; } break; - } + } return FALSE; } @@ -96,29 +96,29 @@ BOOL CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) /* set best names */ for( i = 0; i < 3; i++ ) SetDlgItemText( hDlg, (IDC_NAME1) + i, p_board->best_name[i] ); - + /* set best times */ for( i = 0; i < 3; i++ ) SetDlgItemInt( hDlg, (IDC_TIME1) + i, p_board->best_time[i], FALSE ); return TRUE; - - case WM_COMMAND: - switch( LOWORD( wParam ) ) { - case IDOK: - EndDialog( hDlg, 0 ); - return TRUE; - } - break; - } - return FALSE; -} -BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) -{ - switch( uMsg ) { - case WM_INITDIALOG: - return TRUE; - + case WM_COMMAND: + switch( LOWORD( wParam ) ) { + case IDOK: + EndDialog( hDlg, 0 ); + return TRUE; + } + break; + } + return FALSE; +} + +BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + switch( uMsg ) { + case WM_INITDIALOG: + return TRUE; + case WM_COMMAND: switch( LOWORD( wParam ) ) { case IDOK: diff --git a/programs/winemine/dialog.h b/programs/winemine/dialog.h index e40bf644e07..b4e0fc4a457 100644 --- a/programs/winemine/dialog.h +++ b/programs/winemine/dialog.h @@ -1,6 +1,6 @@ /* * WineMine (dialog.h) - * + * * Copyright 2000 Joshua Thielen * * This library is free software; you can redistribute it and/or diff --git a/programs/winemine/main.c b/programs/winemine/main.c index 62c253ad5d9..38f26a6b3da 100644 --- a/programs/winemine/main.c +++ b/programs/winemine/main.c @@ -1,6 +1,6 @@ /* * WineMine (main.c) - * + * * Copyright 2000 Joshua Thielen * * This library is free software; you can redistribute it and/or @@ -37,15 +37,15 @@ #include #define DEBUG(x) fprintf(stderr,x) #else -#define DEBUG(x) +#define DEBUG(x) #endif int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow ) -{ +{ MSG msg; WNDCLASS wc; HWND hWnd; - HACCEL haccel; + HACCEL haccel; char appname[9]; LoadString( hInst, IDS_APPNAME, appname, sizeof(appname)); @@ -60,15 +60,15 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmd wc.hbrBackground = (HBRUSH) GetStockObject( BLACK_BRUSH ); wc.lpszMenuName = "MENU_WINEMINE"; wc.lpszClassName = appname; - + if (!RegisterClass(&wc)) exit(1); - hWnd = CreateWindow( appname, appname, - WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + hWnd = CreateWindow( appname, appname, + WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL_HANDLE, NULL_HANDLE, hInst, NULL ); - + if (!hWnd) exit(1); - + ShowWindow( hWnd, cmdshow ); UpdateWindow( hWnd ); @@ -78,7 +78,7 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmd while( GetMessage(&msg, NULL_HANDLE, 0, 0) ) { if (!TranslateAccelerator( hWnd, haccel, &msg )) TranslateMessage( &msg ); - + DispatchMessage( &msg ); } return msg.wParam; @@ -88,11 +88,11 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; - HMENU hMenu; - static BOARD board; + HMENU hMenu; + static BOARD board; switch( msg ) { - case WM_CREATE: + case WM_CREATE: board.hInst = ((LPCREATESTRUCT) lParam)->hInstance; board.hWnd = hWnd; InitBoard( &board ); @@ -118,27 +118,27 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_MOVE: DEBUG("WM_MOVE\n"); board.pos.x = (unsigned) LOWORD(lParam); - board.pos.y = (unsigned) HIWORD(lParam); + board.pos.y = (unsigned) HIWORD(lParam); return 0; case WM_DESTROY: SaveBoard( &board ); - DestroyBoard( &board ); + DestroyBoard( &board ); PostQuitMessage( 0 ); return 0; - + case WM_TIMER: if( board.status == PLAYING ) { board.time++; - RedrawWindow( hWnd, &board.timer_rect, NULL_HANDLE, - RDW_INVALIDATE | RDW_UPDATENOW ); + RedrawWindow( hWnd, &board.timer_rect, NULL_HANDLE, + RDW_INVALIDATE | RDW_UPDATENOW ); } return 0; case WM_LBUTTONDOWN: DEBUG("WM_LBUTTONDOWN\n"); if( wParam & MK_RBUTTON ) - msg = WM_MBUTTONDOWN; + msg = WM_MBUTTONDOWN; TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); SetCapture( hWnd ); return 0; @@ -146,25 +146,25 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONUP: DEBUG("WM_LBUTTONUP\n"); if( wParam & MK_RBUTTON ) - msg = WM_MBUTTONUP; + msg = WM_MBUTTONUP; TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); ReleaseCapture(); return 0; case WM_RBUTTONDOWN: DEBUG("WM_RBUTTONDOWN\n"); - if( wParam & MK_LBUTTON ) { + if( wParam & MK_LBUTTON ) { board.press.x = 0; - board.press.y = 0; + board.press.y = 0; msg = WM_MBUTTONDOWN; - } + } TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); return 0; case WM_RBUTTONUP: DEBUG("WM_RBUTTONUP\n"); - if( wParam & MK_LBUTTON ) - msg = WM_MBUTTONUP; + if( wParam & MK_LBUTTON ) + msg = WM_MBUTTONUP; TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); return 0; @@ -192,8 +192,8 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg ); - return 0; - } + return 0; + } case WM_COMMAND: switch(LOWORD(wParam)) { @@ -202,26 +202,26 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0; case IDM_MARKQ: - hMenu = GetMenu( hWnd ); + hMenu = GetMenu( hWnd ); board.IsMarkQ = !board.IsMarkQ; if( board.IsMarkQ ) CheckMenuItem( hMenu, IDM_MARKQ, MF_CHECKED ); - else + else CheckMenuItem( hMenu, IDM_MARKQ, MF_UNCHECKED ); return 0; case IDM_BEGINNER: - SetDifficulty( &board, BEGINNER ); + SetDifficulty( &board, BEGINNER ); CreateBoard( &board ); return 0; case IDM_ADVANCED: - SetDifficulty( &board, ADVANCED ); + SetDifficulty( &board, ADVANCED ); CreateBoard( &board ); return 0; case IDM_EXPERT: - SetDifficulty( &board, EXPERT ); + SetDifficulty( &board, EXPERT ); CreateBoard( &board ); return 0; @@ -235,7 +235,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0; case IDM_TIMES: - DialogBoxParam( board.hInst, "DLG_TIMES", hWnd, + DialogBoxParam( board.hInst, "DLG_TIMES", hWnd, TimesDlgProc, (LPARAM) &board); return 0; @@ -246,7 +246,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) DEBUG("Unknown WM_COMMAND command message received\n"); break; } - } + } return( DefWindowProc( hWnd, msg, wParam, lParam )); } @@ -256,16 +256,16 @@ void InitBoard( BOARD *p_board ) p_board->hMinesBMP = LoadBitmap( p_board->hInst, "mines"); p_board->hFacesBMP = LoadBitmap( p_board->hInst, "faces"); - p_board->hLedsBMP = LoadBitmap( p_board->hInst, "leds"); - - LoadBoard( p_board ); - + p_board->hLedsBMP = LoadBitmap( p_board->hInst, "leds"); + + LoadBoard( p_board ); + if( p_board->pos.x < (unsigned) GetSystemMetrics( SM_CXFIXEDFRAME )) p_board->pos.x = GetSystemMetrics( SM_CXFIXEDFRAME ); - if( p_board->pos.x > (unsigned) (GetSystemMetrics( SM_CXSCREEN ) + if( p_board->pos.x > (unsigned) (GetSystemMetrics( SM_CXSCREEN ) - GetSystemMetrics( SM_CXFIXEDFRAME ))) { - p_board->pos.x = GetSystemMetrics( SM_CXSCREEN ) + p_board->pos.x = GetSystemMetrics( SM_CXSCREEN ) - GetSystemMetrics( SM_CXFIXEDFRAME ); } @@ -277,23 +277,23 @@ void InitBoard( BOARD *p_board ) GetSystemMetrics( SM_CYFIXEDFRAME ); } - if( p_board->pos.y > (unsigned) (GetSystemMetrics( SM_CYSCREEN ) + if( p_board->pos.y > (unsigned) (GetSystemMetrics( SM_CYSCREEN ) - GetSystemMetrics( SM_CYFIXEDFRAME ))) { p_board->pos.y = GetSystemMetrics( SM_CYSCREEN ) - GetSystemMetrics( SM_CYFIXEDFRAME ); } - + hMenu = GetMenu( p_board->hWnd ); - CheckMenuItem( hMenu, IDM_BEGINNER + (unsigned) p_board->difficulty, + CheckMenuItem( hMenu, IDM_BEGINNER + (unsigned) p_board->difficulty, MF_CHECKED ); if( p_board->IsMarkQ ) CheckMenuItem( hMenu, IDM_MARKQ, MF_CHECKED ); - else + else CheckMenuItem( hMenu, IDM_MARKQ, MF_UNCHECKED ); CheckLevel( p_board ); } -void LoadBoard( BOARD *p_board ) +void LoadBoard( BOARD *p_board ) { DWORD size; DWORD type; @@ -303,80 +303,80 @@ void LoadBoard( BOARD *p_board ) unsigned i; - RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\Wine\\WineMine", + RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\Wine\\WineMine", 0, KEY_QUERY_VALUE, &hkey ); - + size = sizeof( data ); - if( RegQueryValueEx( hkey, "Xpos", NULL, (LPDWORD) &type, + if( RegQueryValueEx( hkey, "Xpos", NULL, (LPDWORD) &type, (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) { p_board->pos.x = atoi( data ); } - else + else p_board->pos.x = GetSystemMetrics( SM_CXFIXEDFRAME ); size = sizeof( data ); - if( RegQueryValueEx( hkey, "Ypos", NULL, (LPDWORD) &type, + if( RegQueryValueEx( hkey, "Ypos", NULL, (LPDWORD) &type, (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) p_board->pos.y = atoi( data ); - else + else p_board->pos.y = GetSystemMetrics( SM_CYMENU ) - + GetSystemMetrics( SM_CYCAPTION ) + + GetSystemMetrics( SM_CYCAPTION ) + GetSystemMetrics( SM_CYFIXEDFRAME ); size = sizeof( data ); - if( RegQueryValueEx( hkey, "Rows", NULL, (LPDWORD) &type, + if( RegQueryValueEx( hkey, "Rows", NULL, (LPDWORD) &type, (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) p_board->rows = atoi( data ); else p_board->rows = BEGINNER_ROWS; size = sizeof( data ); - if( RegQueryValueEx( hkey, "Cols", NULL, (LPDWORD) &type, + if( RegQueryValueEx( hkey, "Cols", NULL, (LPDWORD) &type, (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) p_board->cols = atoi( data ); else - p_board->cols = BEGINNER_COLS; - + p_board->cols = BEGINNER_COLS; + size = sizeof( data ); - if( RegQueryValueEx( hkey, "Mines", NULL, (LPDWORD) &type, + if( RegQueryValueEx( hkey, "Mines", NULL, (LPDWORD) &type, (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) p_board->mines = atoi( data ); - else + else p_board->rows = BEGINNER_ROWS; size = sizeof( data ); - if( RegQueryValueEx( hkey, "Difficulty", NULL, (LPDWORD) &type, + if( RegQueryValueEx( hkey, "Difficulty", NULL, (LPDWORD) &type, (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) p_board->difficulty = (DIFFICULTY) atoi( data ); - else + else p_board->difficulty = BEGINNER; size = sizeof( data ); - if( RegQueryValueEx( hkey, "MarkQ", NULL, (LPDWORD) &type, + if( RegQueryValueEx( hkey, "MarkQ", NULL, (LPDWORD) &type, (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) p_board->IsMarkQ = atoi( data ); - else + else p_board->IsMarkQ = TRUE; - + for( i = 0; i < 3; i++ ) { wsprintf( key_name, "Name%d", i ); size = sizeof( data ); - if( RegQueryValueEx( hkey, key_name, NULL, (LPDWORD) &type, - (LPBYTE) data, + if( RegQueryValueEx( hkey, key_name, NULL, (LPDWORD) &type, + (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) strncpy( p_board->best_name[i], data, sizeof( data ) ); - else + else wsprintf( p_board->best_name[i], "Nobody"); } - + for( i = 0; i < 3; i++ ) { wsprintf( key_name, "Time%d", i ); size = sizeof( data ); - if( RegQueryValueEx( hkey, key_name, NULL, (LPDWORD) &type, - (LPBYTE) data, + if( RegQueryValueEx( hkey, key_name, NULL, (LPDWORD) &type, + (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) p_board->best_time[i] = atoi( data ); - else + else p_board->best_time[i] = 999; } RegCloseKey( hkey ); @@ -390,12 +390,12 @@ void SaveBoard( BOARD *p_board ) unsigned i; char data[16]; char key_name[8]; - - if( RegCreateKeyEx( HKEY_LOCAL_MACHINE, + + if( RegCreateKeyEx( HKEY_LOCAL_MACHINE, "Software\\Wine\\WineMine", 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_WRITE, &sa, + REG_OPTION_NON_VOLATILE, KEY_WRITE, &sa, &hkey, &disp ) != ERROR_SUCCESS) - return; + return; wsprintf( data, "%d", p_board->pos.x ); RegSetValueEx( hkey, "Xpos", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 ); @@ -444,17 +444,17 @@ void SetDifficulty( BOARD *p_board, DIFFICULTY difficulty ) HMENU hMenu = GetMenu( p_board->hWnd ); CheckMenuItem( hMenu, IDM_BEGINNER + p_board->difficulty, MF_UNCHECKED ); - p_board->difficulty = difficulty; + p_board->difficulty = difficulty; CheckMenuItem( hMenu, IDM_BEGINNER + difficulty, MF_CHECKED ); - + switch( difficulty ) { - case BEGINNER: + case BEGINNER: p_board->cols = BEGINNER_COLS; p_board->rows = BEGINNER_ROWS; p_board->mines = BEGINNER_MINES; break; - case ADVANCED: + case ADVANCED: p_board->cols = ADVANCED_COLS; p_board->rows = ADVANCED_ROWS; p_board->mines = ADVANCED_MINES; @@ -463,13 +463,13 @@ void SetDifficulty( BOARD *p_board, DIFFICULTY difficulty ) case EXPERT: p_board->cols = EXPERT_COLS; p_board->rows = EXPERT_ROWS; - p_board->mines = EXPERT_MINES; - break; + p_board->mines = EXPERT_MINES; + break; case CUSTOM: - DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd, + DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd, CustomDlgProc, (LPARAM) p_board); - break; + break; } } @@ -480,59 +480,59 @@ void CreateBoard( BOARD *p_board ) p_board->mb = MB_NONE; p_board->boxes_left = p_board->cols * p_board->rows - p_board->mines; p_board->num_flags = 0; - + CreateBoxes( p_board ); p_board->width = p_board->cols * MINE_WIDTH + BOARD_WMARGIN * 2; - - p_board->height = p_board->rows * MINE_HEIGHT + LED_HEIGHT + + p_board->height = p_board->rows * MINE_HEIGHT + LED_HEIGHT + BOARD_HMARGIN * 3; wnd_x = p_board->pos.x - GetSystemMetrics( SM_CXFIXEDFRAME ); - wnd_y = p_board->pos.y - GetSystemMetrics( SM_CYMENU ) - - GetSystemMetrics( SM_CYCAPTION ) + wnd_y = p_board->pos.y - GetSystemMetrics( SM_CYMENU ) + - GetSystemMetrics( SM_CYCAPTION ) - GetSystemMetrics( SM_CYFIXEDFRAME ); - wnd_width = p_board->width + wnd_width = p_board->width + GetSystemMetrics( SM_CXFIXEDFRAME ) * 2; - wnd_height = p_board->height - + GetSystemMetrics( SM_CYMENU ) - + GetSystemMetrics( SM_CYCAPTION ) + wnd_height = p_board->height + + GetSystemMetrics( SM_CYMENU ) + + GetSystemMetrics( SM_CYCAPTION ) + GetSystemMetrics( SM_CYFIXEDFRAME ) * 2; - /* setting the mines rectangle boundary */ - left = BOARD_WMARGIN; - top = BOARD_HMARGIN * 2 + LED_HEIGHT; + /* setting the mines rectangle boundary */ + left = BOARD_WMARGIN; + top = BOARD_HMARGIN * 2 + LED_HEIGHT; right = left + p_board->cols * MINE_WIDTH; bottom = top + p_board->rows * MINE_HEIGHT; SetRect( &p_board->mines_rect, left, top, right, bottom ); - /* setting the face rectangle boundary */ + /* setting the face rectangle boundary */ left = p_board->width / 2 - FACE_WIDTH / 2; top = BOARD_HMARGIN; right = left + FACE_WIDTH; - bottom = top + FACE_HEIGHT; + bottom = top + FACE_HEIGHT; SetRect( &p_board->face_rect, left, top, right, bottom ); - - /* setting the timer rectangle boundary */ + + /* setting the timer rectangle boundary */ left = BOARD_WMARGIN; top = BOARD_HMARGIN; right = left + LED_WIDTH * 3; - bottom = top + LED_HEIGHT; + bottom = top + LED_HEIGHT; SetRect( &p_board->timer_rect, left, top, right, bottom ); - - /* setting the counter rectangle boundary */ + + /* setting the counter rectangle boundary */ left = p_board->width - BOARD_WMARGIN - LED_WIDTH * 3; top = BOARD_HMARGIN; right = p_board->width - BOARD_WMARGIN; - bottom = top + LED_HEIGHT; + bottom = top + LED_HEIGHT; SetRect( &p_board->counter_rect, left, top, right, bottom ); - + p_board->status = WAITING; - p_board->face_bmp = SMILE_BMP; + p_board->face_bmp = SMILE_BMP; p_board->time = 0; MoveWindow( p_board->hWnd, wnd_x, wnd_y, wnd_width, wnd_height, TRUE ); - RedrawWindow( p_board->hWnd, NULL, NULL_HANDLE, + RedrawWindow( p_board->hWnd, NULL, NULL_HANDLE, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE ); } @@ -544,7 +544,7 @@ void CheckLevel( BOARD *p_board ) if( p_board->rows > MAX_ROWS ) p_board->rows = MAX_ROWS; - + if( p_board->cols < BEGINNER_COLS ) p_board->cols = BEGINNER_COLS; @@ -552,10 +552,10 @@ void CheckLevel( BOARD *p_board ) p_board->cols = MAX_COLS; if( p_board->mines < BEGINNER_MINES ) - p_board->mines = BEGINNER_MINES; + p_board->mines = BEGINNER_MINES; - if( p_board->mines > p_board->cols * p_board->rows - 1 ) - p_board->mines = p_board->cols * p_board->rows - 1; + if( p_board->mines > p_board->cols * p_board->rows - 1 ) + p_board->mines = p_board->cols * p_board->rows - 1; } @@ -566,14 +566,14 @@ void CreateBoxes( BOARD *p_board ) srand( (unsigned) time( NULL ) ); - /* Create the boxes... + /* Create the boxes... * We actually create them with an empty border, * so special care doesn't have to be taken on the edges */ - + for( col = 0; col <= p_board->cols + 1; col++ ) for( row = 0; row <= p_board->rows + 1; row++ ) { - p_board->box[col][row].IsPressed = FALSE; + p_board->box[col][row].IsPressed = FALSE; p_board->box[col][row].IsMine = FALSE; p_board->box[col][row].FlagType = NORMAL; p_board->box[col][row].NumMines = 0; @@ -613,9 +613,9 @@ void DrawMines ( HDC hdc, HDC hMemDC, BOARD *p_board ) unsigned col, row; hOldObj = SelectObject (hMemDC, p_board->hMinesBMP); - for( row = 1; row <= p_board->rows; row++ ) { + for( row = 1; row <= p_board->rows; row++ ) { for( col = 1; col <= p_board->cols; col++ ) { - DrawMine( hdc, hMemDC, p_board, col, row, FALSE ); + DrawMine( hdc, hMemDC, p_board, col, row, FALSE ); } } SelectObject( hMemDC, hOldObj ); @@ -626,7 +626,7 @@ void DrawMine( HDC hdc, HDC hMemDC, BOARD *p_board, unsigned col, unsigned row, MINEBMP_OFFSET offset = BOX_BMP; if( col == 0 || col > p_board->cols || row == 0 || row > p_board->rows ) - return; + return; if( p_board->status == GAMEOVER ) { if( p_board->box[col][row].IsMine ) { @@ -635,60 +635,60 @@ void DrawMine( HDC hdc, HDC hMemDC, BOARD *p_board, unsigned col, unsigned row, offset = FLAG_BMP; break; case COMPLETE: - offset = EXPLODE_BMP; + offset = EXPLODE_BMP; break; case NORMAL: offset = MINE_BMP; } } else { - switch( p_board->box[col][row].FlagType ) { + switch( p_board->box[col][row].FlagType ) { case QUESTION: - offset = QUESTION_BMP; + offset = QUESTION_BMP; break; case FLAG: offset = WRONG_BMP; break; - case NORMAL: + case NORMAL: offset = BOX_BMP; break; case COMPLETE: /* Do nothing */ break; default: - DEBUG("Unknown FlagType during game over in DrawMine\n"); + DEBUG("Unknown FlagType during game over in DrawMine\n"); break; } - } + } } else { /* WAITING or PLAYING */ switch( p_board->box[col][row].FlagType ) { case QUESTION: - if( !IsPressed ) - offset = QUESTION_BMP; + if( !IsPressed ) + offset = QUESTION_BMP; else - offset = QPRESS_BMP; + offset = QPRESS_BMP; break; case FLAG: offset = FLAG_BMP; break; - case NORMAL: + case NORMAL: if( !IsPressed ) offset = BOX_BMP; - else + else offset = MPRESS_BMP; break; case COMPLETE: /* Do nothing */ break; default: - DEBUG("Unknown FlagType while playing in DrawMine\n"); + DEBUG("Unknown FlagType while playing in DrawMine\n"); break; } - } + } - if( p_board->box[col][row].FlagType == COMPLETE + if( p_board->box[col][row].FlagType == COMPLETE && !p_board->box[col][row].IsMine ) offset = (MINEBMP_OFFSET) p_board->box[col][row].NumMines; - + BitBlt( hdc, (col - 1) * MINE_WIDTH + p_board->mines_rect.left, (row - 1) * MINE_HEIGHT + p_board->mines_rect.top, @@ -700,7 +700,7 @@ void DrawLeds( HDC hdc, HDC hMemDC, BOARD *p_board, int number, int x, int y ) { HGDIOBJ hOldObj; unsigned led[3], i; - int count; + int count; count = number; if( count < 1000 ) { @@ -724,8 +724,8 @@ void DrawLeds( HDC hdc, HDC hMemDC, BOARD *p_board, int number, int x, int y ) /* use unlit led if not playing */ if( p_board->status == WAITING ) for( i = 0; i < 3; i++ ) - led[i] = 11; - + led[i] = 11; + hOldObj = SelectObject (hMemDC, p_board->hLedsBMP); for( i = 0; i < 3; i++ ) { @@ -734,19 +734,19 @@ void DrawLeds( HDC hdc, HDC hMemDC, BOARD *p_board, int number, int x, int y ) y, LED_WIDTH, LED_HEIGHT, - hMemDC, - 0, - led[i] * LED_HEIGHT, + hMemDC, + 0, + led[i] * LED_HEIGHT, SRCCOPY); } - + SelectObject( hMemDC, hOldObj ); } void DrawFace( HDC hdc, HDC hMemDC, BOARD *p_board ) { - HGDIOBJ hOldObj; + HGDIOBJ hOldObj; hOldObj = SelectObject (hMemDC, p_board->hFacesBMP); @@ -756,96 +756,96 @@ void DrawFace( HDC hdc, HDC hMemDC, BOARD *p_board ) FACE_WIDTH, FACE_HEIGHT, hMemDC, 0, p_board->face_bmp * FACE_HEIGHT, SRCCOPY); - + SelectObject( hMemDC, hOldObj ); } void DrawBoard( HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, BOARD *p_board ) { - RECT tmp_rect; - - if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->counter_rect ) ) + RECT tmp_rect; + + if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->counter_rect ) ) DrawLeds( hdc, hMemDC, p_board, p_board->mines - p_board->num_flags, p_board->counter_rect.left, p_board->counter_rect.top ); - if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->timer_rect ) ) + if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->timer_rect ) ) DrawLeds( hdc, hMemDC, p_board, p_board->time, - p_board->timer_rect.left, + p_board->timer_rect.left, p_board->timer_rect.top ); - - if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->face_rect ) ) + + if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->face_rect ) ) DrawFace( hdc, hMemDC, p_board ); - - if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->mines_rect ) ) + + if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->mines_rect ) ) DrawMines( hdc, hMemDC, p_board ); -} +} void TestBoard( HWND hWnd, BOARD *p_board, unsigned x, unsigned y, int msg ) { POINT pt; - + pt.x = x; pt.y = y; if( PtInRect( &p_board->mines_rect, pt ) && p_board->status != GAMEOVER - && p_board->status != WON ) + && p_board->status != WON ) TestMines( p_board, pt, msg ); else { - UnpressBoxes( p_board, - p_board->press.x, - p_board->press.y ); + UnpressBoxes( p_board, + p_board->press.x, + p_board->press.y ); p_board->press.x = 0; p_board->press.y = 0; } if( p_board->boxes_left == 0 ) { p_board->status = WON; - + if( p_board->difficulty != CUSTOM && p_board->time < p_board->best_time[p_board->difficulty] ) { p_board->best_time[p_board->difficulty] = p_board->time; - - DialogBoxParam( p_board->hInst, "DLG_CONGRATS", hWnd, + + DialogBoxParam( p_board->hInst, "DLG_CONGRATS", hWnd, CongratsDlgProc, (LPARAM) p_board); - - DialogBoxParam( p_board->hInst, "DLG_TIMES", hWnd, + + DialogBoxParam( p_board->hInst, "DLG_TIMES", hWnd, TimesDlgProc, (LPARAM) p_board); } } - TestFace( p_board, pt, msg ); + TestFace( p_board, pt, msg ); } void TestMines( BOARD *p_board, POINT pt, int msg ) { BOOL draw = TRUE; - unsigned col, row; + unsigned col, row; col = (pt.x - p_board->mines_rect.left) / MINE_WIDTH + 1; row = (pt.y - p_board->mines_rect.top ) / MINE_HEIGHT + 1; - + switch ( msg ) { case WM_LBUTTONDOWN: if( p_board->press.x != col || p_board->press.y != row ) { - UnpressBox( p_board, + UnpressBox( p_board, p_board->press.x, p_board->press.y ); p_board->press.x = col; p_board->press.y = row; - PressBox( p_board, col, row ); - } - draw = FALSE; + PressBox( p_board, col, row ); + } + draw = FALSE; break; case WM_LBUTTONUP: if( p_board->press.x != col || p_board->press.y != row ) - UnpressBox( p_board, + UnpressBox( p_board, p_board->press.x, p_board->press.y ); p_board->press.x = 0; p_board->press.y = 0; if( p_board->box[col][row].FlagType != FLAG ) - p_board->status = PLAYING; + p_board->status = PLAYING; CompleteBox( p_board, col, row ); break; @@ -856,7 +856,7 @@ void TestMines( BOARD *p_board, POINT pt, int msg ) case WM_MBUTTONUP: if( p_board->press.x != col || p_board->press.y != row ) - UnpressBoxes( p_board, + UnpressBoxes( p_board, p_board->press.x, p_board->press.y ); p_board->press.x = 0; p_board->press.y = 0; @@ -865,7 +865,7 @@ void TestMines( BOARD *p_board, POINT pt, int msg ) case WM_RBUTTONDOWN: AddFlag( p_board, col, row ); - p_board->status = PLAYING; + p_board->status = PLAYING; break; default: DEBUG("Unknown message type received in TestMines\n"); @@ -874,10 +874,10 @@ void TestMines( BOARD *p_board, POINT pt, int msg ) if( draw ) { - RedrawWindow( p_board->hWnd, NULL, NULL_HANDLE, + RedrawWindow( p_board->hWnd, NULL, NULL_HANDLE, RDW_INVALIDATE | RDW_UPDATENOW ); } -} +} void TestFace( BOARD *p_board, POINT pt, int msg ) @@ -887,20 +887,20 @@ void TestFace( BOARD *p_board, POINT pt, int msg ) p_board->face_bmp = OOH_BMP; else p_board->face_bmp = SMILE_BMP; } - else if( p_board->status == GAMEOVER ) + else if( p_board->status == GAMEOVER ) p_board->face_bmp = DEAD_BMP; - else if( p_board->status == WON ) + else if( p_board->status == WON ) p_board->face_bmp = COOL_BMP; - if( PtInRect( &p_board->face_rect, pt ) ) { - if( msg == WM_LBUTTONDOWN ) + if( PtInRect( &p_board->face_rect, pt ) ) { + if( msg == WM_LBUTTONDOWN ) p_board->face_bmp = SPRESS_BMP; - - if( msg == WM_LBUTTONUP ) - CreateBoard( p_board ); + + if( msg == WM_LBUTTONUP ) + CreateBoard( p_board ); } - RedrawWindow( p_board->hWnd, &p_board->face_rect, NULL_HANDLE, + RedrawWindow( p_board->hWnd, &p_board->face_rect, NULL_HANDLE, RDW_INVALIDATE | RDW_UPDATENOW ); } @@ -909,26 +909,26 @@ void CompleteBox( BOARD *p_board, unsigned col, unsigned row ) { int i, j; - if( p_board->box[col][row].FlagType != COMPLETE && - p_board->box[col][row].FlagType != FLAG && - col > 0 && col < p_board->cols + 1 && + if( p_board->box[col][row].FlagType != COMPLETE && + p_board->box[col][row].FlagType != FLAG && + col > 0 && col < p_board->cols + 1 && row > 0 && row < p_board->rows + 1 ) { p_board->box[col][row].FlagType = COMPLETE; - + if( p_board->box[col][row].IsMine ) { - p_board->face_bmp = DEAD_BMP; + p_board->face_bmp = DEAD_BMP; p_board->status = GAMEOVER; } - else if( p_board->status != GAMEOVER ) + else if( p_board->status != GAMEOVER ) p_board->boxes_left--; - if( p_board->box[col][row].NumMines == 0 ) + if( p_board->box[col][row].NumMines == 0 ) { for( i = -1; i <= 1; i++ ) for( j = -1; j <= 1; j++ ) CompleteBox( p_board, col + i, row + j ); } - } + } } @@ -940,14 +940,14 @@ void CompleteBoxes( BOARD *p_board, unsigned col, unsigned row ) if( p_board->box[col][row].FlagType == COMPLETE ) { for( i = -1; i <= 1; i++ ) for( j = -1; j <= 1; j++ ) { - if( p_board->box[col+i][row+j].FlagType == FLAG ) + if( p_board->box[col+i][row+j].FlagType == FLAG ) numFlags++; } - + if( numFlags == p_board->box[col][row].NumMines ) { for( i = -1; i <= 1; i++ ) for( j = -1; j <= 1; j++ ) { - if( p_board->box[col+i][row+j].FlagType != FLAG ) + if( p_board->box[col+i][row+j].FlagType != FLAG ) CompleteBox( p_board, col+i, row+j ); } } @@ -962,7 +962,7 @@ void AddFlag( BOARD *p_board, unsigned col, unsigned row ) case FLAG: if( p_board->IsMarkQ ) p_board->box[col][row].FlagType = QUESTION; - else + else p_board->box[col][row].FlagType = NORMAL; p_board->num_flags--; break; @@ -970,19 +970,19 @@ void AddFlag( BOARD *p_board, unsigned col, unsigned row ) case QUESTION: p_board->box[col][row].FlagType = NORMAL; break; - + default: p_board->box[col][row].FlagType = FLAG; p_board->num_flags++; - } - } + } + } } void PressBox( BOARD *p_board, unsigned col, unsigned row ) { - HDC hdc; - HGDIOBJ hOldObj; + HDC hdc; + HGDIOBJ hOldObj; HDC hMemDC; hdc = GetDC( p_board->hWnd ); @@ -991,7 +991,7 @@ void PressBox( BOARD *p_board, unsigned col, unsigned row ) DrawMine( hdc, hMemDC, p_board, col, row, TRUE ); - SelectObject( hMemDC, hOldObj ); + SelectObject( hMemDC, hOldObj ); DeleteDC( hMemDC ); ReleaseDC( p_board->hWnd, hdc ); } @@ -1003,31 +1003,31 @@ void PressBoxes( BOARD *p_board, unsigned col, unsigned row ) for( i = -1; i <= 1; i++ ) for( j = -1; j <= 1; j++ ) { - p_board->box[col + i][row + j].IsPressed = TRUE; + p_board->box[col + i][row + j].IsPressed = TRUE; PressBox( p_board, col + i, row + j ); } for( i = -1; i <= 1; i++ ) for( j = -1; j <= 1; j++ ) { - if( !p_board->box[p_board->press.x + i][p_board->press.y + j].IsPressed ) + if( !p_board->box[p_board->press.x + i][p_board->press.y + j].IsPressed ) UnpressBox( p_board, p_board->press.x + i, p_board->press.y + j ); } for( i = -1; i <= 1; i++ ) for( j = -1; j <= 1; j++ ) { - p_board->box[col + i][row + j].IsPressed = FALSE; + p_board->box[col + i][row + j].IsPressed = FALSE; PressBox( p_board, col + i, row + j ); } p_board->press.x = col; - p_board->press.y = row; + p_board->press.y = row; } void UnpressBox( BOARD *p_board, unsigned col, unsigned row ) { - HDC hdc; - HGDIOBJ hOldObj; + HDC hdc; + HGDIOBJ hOldObj; HDC hMemDC; hdc = GetDC( p_board->hWnd ); @@ -1036,7 +1036,7 @@ void UnpressBox( BOARD *p_board, unsigned col, unsigned row ) DrawMine( hdc, hMemDC, p_board, col, row, FALSE ); - SelectObject( hMemDC, hOldObj ); + SelectObject( hMemDC, hOldObj ); DeleteDC( hMemDC ); ReleaseDC( p_board->hWnd, hdc ); } @@ -1044,8 +1044,8 @@ void UnpressBox( BOARD *p_board, unsigned col, unsigned row ) void UnpressBoxes( BOARD *p_board, unsigned col, unsigned row ) { - int i, j; - + int i, j; + for( i = -1; i <= 1; i++ ) for( j = -1; j <= 1; j++ ) { UnpressBox( p_board, col + i, row + j ); diff --git a/programs/winemine/main.h b/programs/winemine/main.h index 41741b317ed..1f8b4cca91a 100644 --- a/programs/winemine/main.h +++ b/programs/winemine/main.h @@ -69,14 +69,14 @@ typedef struct tagBOARD RECT mines_rect; RECT face_rect; RECT timer_rect; - RECT counter_rect; + RECT counter_rect; unsigned width; unsigned height; POINT pos; unsigned time; - unsigned num_flags; + unsigned num_flags; unsigned boxes_left; unsigned num_mines; @@ -89,7 +89,7 @@ typedef struct tagBOARD DIFFICULTY difficulty; POINT press; - + /* defines for mb */ #define MB_NONE 0 #define MB_LEFTDOWN 1 @@ -99,7 +99,7 @@ typedef struct tagBOARD #define MB_BOTHDOWN 5 #define MB_BOTHUP 6 unsigned mb; - + FACE_BMP face_bmp; GAME_STATUS status; struct BOX_STRUCT diff --git a/programs/winemine/resource.h b/programs/winemine/resource.h index 56ea59e9b94..6f1b600b792 100644 --- a/programs/winemine/resource.h +++ b/programs/winemine/resource.h @@ -1,6 +1,6 @@ /* * WineMine (resource.h) - * + * * Copyright 2000 Joshua Thielen * * This library is free software; you can redistribute it and/or diff --git a/programs/winepath/winepath.c b/programs/winepath/winepath.c index ef54e50d65f..6e4470908bb 100644 --- a/programs/winepath/winepath.c +++ b/programs/winepath/winepath.c @@ -26,7 +26,7 @@ #define VERSION "0.1 (" PACKAGE_STRING ")" -enum { +enum { SHORTFORMAT = 1, LONGFORMAT = 2, UNIXFORMAT = 4 @@ -69,13 +69,13 @@ int option(int shortopt, char *longopt) return SHORTFORMAT; case 'u': return UNIXFORMAT; - } + } fprintf(stderr, "%s: invalid option ", progname); if (longopt) fprintf(stderr, "'%s'\n", longopt); else - fprintf(stderr, "'-%c'\n", shortopt); + fprintf(stderr, "'-%c'\n", shortopt); fprintf(stderr, "Try '%s --help' for help\n", progname); exit(2); } @@ -112,7 +112,7 @@ int parse_options(char *argv[]) } else { /* short options */ for (j = 1; argv[i][j]; j++) - outputformats |= option(argv[i][j], NULL); + outputformats |= option(argv[i][j], NULL); } /* remove option */ diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c index a52afacaad1..76e0aa02588 100644 --- a/programs/winhelp/hlpfile.c +++ b/programs/winhelp/hlpfile.c @@ -289,7 +289,7 @@ static BOOL HLPFILE_AddPage(HLPFILE *hlpfile, BYTE *buf, BYTE *end) UINT titlesize; for (pageptr = &hlpfile->first_page; *pageptr; pageptr = &(*pageptr)->next) - /* Nothing */; + /* Nothing */; if (buf + 0x31 > end) {Report("page1"); return(FALSE);}; title = buf + GET_UINT(buf, 0x10); @@ -342,7 +342,7 @@ static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end) for (page = hlpfile->first_page; page->next; page = page->next) /* Nothing */; for (paragraphptr = &page->first_paragraph; *paragraphptr; - paragraphptr = &(*paragraphptr)->next) /* Nothing */; + paragraphptr = &(*paragraphptr)->next) /* Nothing */; if (buf + 0x19 > end) {Report("paragraph2"); return(FALSE);}; @@ -580,7 +580,7 @@ static BOOL HLPFILE_ReadFileToBuffer(HFILE hFile) if (_hread(hFile, file_buffer + 16, size - 16) != size - 16) {Report("filesize1"); return(FALSE);}; - if (_hread(hFile, dummy, 1) != 0) Report("filesize2"); + if (_hread(hFile, dummy, 1) != 0) Report("filesize2"); file_buffer[size] = '0'; diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c index 622bec22e08..9912aa90836 100644 --- a/programs/winhelp/macro.c +++ b/programs/winhelp/macro.c @@ -474,7 +474,7 @@ VOID MACRO_Prev(VOID) VOID MACRO_Print(VOID) { PRINTDLG printer; - + printer.lStructSize = sizeof(printer); printer.hwndOwner = Globals.active_win->hMainWnd; printer.hInstance = Globals.hInstance; @@ -494,7 +494,7 @@ VOID MACRO_Print(VOID) printer.lpSetupTemplateName = 0; printer.hPrintTemplate = 0; printer.hSetupTemplate = 0; - + if (PrintDlgA(&printer)) { fprintf(stderr, "Print()\n"); }; diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index be5df912e20..8dc946786f9 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -288,7 +288,7 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow, for (button = oldwin->first_button; button; button = button->next) DestroyWindow(button->hWnd); - + WINHELP_DeleteWindow(oldwin); return; } @@ -384,7 +384,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc (HWND hWnd, UINT msg, WPARAM wParam, /* Menu Info */ case 0x113: MACRO_About(); break; - case 0x114: + case 0x114: ShellAbout(hWnd, "WINE", "Help", 0); break; @@ -541,7 +541,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam, new_window_size.cx = old_window_size.cx - old_client_size.cx + new_client_size.cx; new_window_size.cy = old_window_size.cy - old_client_size.cy + new_client_size.cy; - win->hShadowWnd = + win->hShadowWnd = CreateWindow(SHADOW_WIN_CLASS_NAME, "", WS_POPUP | WS_VISIBLE, origin.x + SHADOW_DX, origin.y + SHADOW_DY, new_window_size.cx, new_window_size.cy, @@ -847,7 +847,7 @@ static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp line->rect.left = space->cx; line->rect.right = space->cx; - if (**linep) *linep = &(**linep)->next; + if (**linep) *linep = &(**linep)->next; **linep = line; space->cy = 0; } diff --git a/relay32/snoop.c b/relay32/snoop.c index bd691fb6305..59f8ba32cca 100644 --- a/relay32/snoop.c +++ b/relay32/snoop.c @@ -216,7 +216,7 @@ SNOOP_GetProcAddress(HMODULE hmod,LPCSTR name,DWORD ordinal,FARPROC origfun) { return origfun; assert(ordinal < dll->nrofordinals); fun = dll->funs+ordinal; - if (!fun->name) + if (!fun->name) { fun->name = HeapAlloc(GetProcessHeap(),0,strlen(name)+1); strcpy( fun->name, name ); diff --git a/scheduler/process.c b/scheduler/process.c index e91bd883342..84399432fa4 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -135,7 +135,7 @@ typedef WORD (WINAPI *pUserSignalProc)( UINT, DWORD, DWORD, HMODULE16 ); * * FIXME: Some of the signals aren't sent correctly! * - * The exact meaning of the USER signals is undocumented, but this + * The exact meaning of the USER signals is undocumented, but this * should cover the basic idea: * * USIG_DLL_UNLOAD_WIN16 @@ -195,7 +195,7 @@ typedef WORD (WINAPI *pUserSignalProc)( UINT, DWORD, DWORD, HMODULE16 ); * USIG_FLAGS_GUI * Current process is a (Win32) GUI process. * - * USIG_FLAGS_FEEDBACK + * USIG_FLAGS_FEEDBACK * Current process needs 'feedback' (determined from the STARTUPINFO * flags STARTF_FORCEONFEEDBACK / STARTF_FORCEOFFFEEDBACK). * @@ -397,7 +397,7 @@ static BOOL process_init( char *argv[] ) if (main_create_flags == 0 && current_startupinfo.hStdInput == 0 && - current_startupinfo.hStdOutput == 0 && + current_startupinfo.hStdOutput == 0 && current_startupinfo.hStdError == 0) { /* no parent, and no new console requested, create a simple console with bare handles to @@ -505,7 +505,7 @@ static void start_process(void) * context of the parent process. Actually, the USER signal proc * doesn't really care about that, but it *does* require that the * startup parameters are correctly set up, so that GetProcessDword - * works. Furthermore, before calling the USER signal proc the + * works. Furthermore, before calling the USER signal proc the * 16-bit stack must be set up, which it is only after TASK_Create * in the case of a 16-bit process. Thus, we send the signal here. */ @@ -709,14 +709,14 @@ static char **build_argv( char *cmdline, int reserved ) } else if (*s=='"') { /* '"' */ if ((bcount & 1)==0) { - /* Preceeded by an even number of '\', this is half that + /* Preceeded by an even number of '\', this is half that * number of '\', plus a '"' which we discard. */ d-=bcount/2; s++; in_quotes=!in_quotes; } else { - /* Preceeded by an odd number of '\', this is half that + /* Preceeded by an odd number of '\', this is half that * number of '\' followed by a '"' */ d=d-bcount/2-1; @@ -1305,7 +1305,7 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset ) return 0; } - switch ( offset ) + switch ( offset ) { case GPD_APP_COMPAT_FLAGS: return GetAppCompatFlags16(0); @@ -1380,7 +1380,7 @@ void WINAPI SetProcessDword( DWORD dwProcessID, INT offset, DWORD value ) return; } - switch ( offset ) + switch ( offset ) { case GPD_APP_COMPAT_FLAGS: case GPD_LOAD_DONE_EVENT: @@ -1400,7 +1400,7 @@ void WINAPI SetProcessDword( DWORD dwProcessID, INT offset, DWORD value ) break; case GPD_USERDATA: - current_process.process_dword = value; + current_process.process_dword = value; break; default: @@ -1707,7 +1707,7 @@ DWORD WINAPI RegisterServiceProcess(DWORD dwProcessId, DWORD dwType) * GetExitCodeProcess [KERNEL32.@] * * Gets termination status of specified process - * + * * RETURNS * Success: TRUE * Failure: FALSE @@ -1824,7 +1824,7 @@ DWORD WINAPI TlsAlloc( void ) * TlsFree [KERNEL32.@] Releases a TLS index. * * Releases a thread local storage index, making it available for reuse - * + * * RETURNS * Success: TRUE * Failure: FALSE diff --git a/scheduler/pthread.c b/scheduler/pthread.c index 0dd7330d001..9ed1513e996 100644 --- a/scheduler/pthread.c +++ b/scheduler/pthread.c @@ -89,8 +89,8 @@ void PTHREAD_init_done(void) extern pid_t LIBC_FORK(void); #define LIBC_SIGACTION __sigaction -extern int LIBC_SIGACTION(int signum, - const struct sigaction *act, +extern int LIBC_SIGACTION(int signum, + const struct sigaction *act, struct sigaction *oldact); /* NOTE: This is a truly extremely incredibly ugly hack! @@ -98,7 +98,7 @@ extern int LIBC_SIGACTION(int signum, /* assume that pthread_mutex_t has room for at least one pointer, * and hope that the users of pthread_mutex_t considers it opaque - * (never checks what's in it) + * (never checks what's in it) * also: assume that static initializer sets pointer to NULL */ typedef struct { @@ -129,11 +129,11 @@ void __pthread_initialize(void) struct pthread_thread_init { void* (*start_routine)(void*); void* arg; -}; +}; static DWORD CALLBACK pthread_thread_start(LPVOID data) { - struct pthread_thread_init init = *(struct pthread_thread_init*)data; + struct pthread_thread_init init = *(struct pthread_thread_init*)data; HeapFree(GetProcessHeap(),0,data); return (DWORD)init.start_routine(init.arg); } @@ -142,10 +142,10 @@ int pthread_create(pthread_t* thread, const pthread_attr_t* attr, void* (*start_routine)(void *), void* arg) { HANDLE hThread; - struct pthread_thread_init* idata = HeapAlloc(GetProcessHeap(), 0, + struct pthread_thread_init* idata = HeapAlloc(GetProcessHeap(), 0, sizeof(struct pthread_thread_init)); - idata->start_routine = start_routine; + idata->start_routine = start_routine; idata->arg = arg; hThread = CreateThread(NULL, 0, pthread_thread_start, idata, 0, thread); @@ -156,29 +156,29 @@ int pthread_create(pthread_t* thread, const pthread_attr_t* attr, void* HeapFree(GetProcessHeap(),0,idata); /* free idata struct on failure */ return EAGAIN; } - + return 0; } - + int pthread_cancel(pthread_t thread) { HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, thread); - + if(!TerminateThread(hThread, 0)) { CloseHandle(hThread); return EINVAL; /* return error */ } - + CloseHandle(hThread); - + return 0; /* return success */ -} +} int pthread_join(pthread_t thread, void **value_ptr) { HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, thread); - + WaitForSingleObject(hThread, INFINITE); if(!GetExitCodeThread(hThread, (LPDWORD)value_ptr)) { @@ -188,7 +188,7 @@ int pthread_join(pthread_t thread, void **value_ptr) CloseHandle(hThread); return 0; -} +} /*FIXME: not sure what to do with this one... */ int pthread_detach(pthread_t thread) @@ -211,7 +211,7 @@ int pthread_attr_setscope(pthread_attr_t *attr, int scope) P_OUTPUT("FIXME:pthread_attr_setscope\n"); return 0; /* return success */ } - + /* FIXME: no win32 equivalent for schedule param */ int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param) @@ -318,7 +318,7 @@ static void mutex_real_init( pthread_mutex_t *mutex ) int __pthread_mutex_lock(pthread_mutex_t *mutex) { if (!init_done) return 0; - if (!((wine_mutex)mutex)->critsect) + if (!((wine_mutex)mutex)->critsect) mutex_real_init( mutex ); EnterCriticalSection(((wine_mutex)mutex)->critsect); @@ -329,7 +329,7 @@ strong_alias(__pthread_mutex_lock, pthread_mutex_lock); int __pthread_mutex_trylock(pthread_mutex_t *mutex) { if (!init_done) return 0; - if (!((wine_mutex)mutex)->critsect) + if (!((wine_mutex)mutex)->critsect) mutex_real_init( mutex ); if (!TryEnterCriticalSection(((wine_mutex)mutex)->critsect)) { diff --git a/scheduler/syslevel.c b/scheduler/syslevel.c index d5d4715fe3f..9d875538d13 100644 --- a/scheduler/syslevel.c +++ b/scheduler/syslevel.c @@ -66,7 +66,7 @@ VOID WINAPI _CreateSysLevel(SYSLEVEL *lock, INT level) InitializeCriticalSection( &lock->crst ); lock->level = level; - TRACE("(%p, %d): handle is %d\n", + TRACE("(%p, %d): handle is %d\n", lock, level, lock->crst.LockSemaphore ); } @@ -79,14 +79,14 @@ VOID WINAPI _EnterSysLevel(SYSLEVEL *lock) TEB *teb = NtCurrentTeb(); int i; - TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count before %ld\n", + TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count before %ld\n", lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(), teb->sys_count[lock->level] ); for ( i = 3; i > lock->level; i-- ) if ( teb->sys_count[i] > 0 ) { - ERR("(%p, level %d): Holding %p, level %d. Expect deadlock!\n", + ERR("(%p, level %d): Holding %p, level %d. Expect deadlock!\n", lock, lock->level, teb->sys_mutex[i], i ); } @@ -96,7 +96,7 @@ VOID WINAPI _EnterSysLevel(SYSLEVEL *lock) teb->sys_mutex[lock->level] = lock; TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count after %ld\n", - lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(), + lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(), teb->sys_count[lock->level] ); if (lock == &Win16Mutex) @@ -111,14 +111,14 @@ VOID WINAPI _LeaveSysLevel(SYSLEVEL *lock) { TEB *teb = NtCurrentTeb(); - TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count before %ld\n", + TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count before %ld\n", lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(), teb->sys_count[lock->level] ); if ( teb->sys_count[lock->level] <= 0 || teb->sys_mutex[lock->level] != lock ) { ERR("(%p, level %d): Invalid state: count %ld mutex %p.\n", - lock, lock->level, teb->sys_count[lock->level], + lock, lock->level, teb->sys_count[lock->level], teb->sys_mutex[lock->level] ); } else @@ -130,7 +130,7 @@ VOID WINAPI _LeaveSysLevel(SYSLEVEL *lock) LeaveCriticalSection( &lock->crst ); TRACE("(%p, level %d): thread %p (fs %04x, pid %ld) count after %ld\n", - lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(), + lock, lock->level, teb->tid, teb->teb_sel, (long) getpid(), teb->sys_count[lock->level] ); } @@ -223,7 +223,7 @@ VOID SYSLEVEL_CheckNotLevel( INT level ) for ( i = 3; i >= level; i-- ) if ( NtCurrentTeb()->sys_count[i] > 0 ) { - ERR("(%d): Holding lock of level %d!\n", + ERR("(%d): Holding lock of level %d!\n", level, i ); DbgBreakPoint(); break; diff --git a/scheduler/thread.c b/scheduler/thread.c index a8f1407d8df..382f45c4360 100644 --- a/scheduler/thread.c +++ b/scheduler/thread.c @@ -516,11 +516,11 @@ BOOL WINAPI GetThreadPriorityBoost( /********************************************************************** * SetThreadPriorityBoost [KERNEL32.@] Sets priority boost for thread. * - * Priority boost is not implemented. Thsi function always returns + * Priority boost is not implemented. Thsi function always returns * FALSE and sets last error to ERROR_CALL_NOT_IMPLEMENTED * * RETURNS - * Always returns FALSE to indicate a failure + * Always returns FALSE to indicate a failure */ BOOL WINAPI SetThreadPriorityBoost( HANDLE hthread, /* [in] Handle to thread */ @@ -556,7 +556,7 @@ DWORD WINAPI SetThreadAffinityMask( HANDLE hThread, DWORD dwThreadAffinityMask ) * Success: Value of last call to SetThreadIdealProcessor * Failure: -1 */ -DWORD WINAPI SetThreadIdealProcessor( +DWORD WINAPI SetThreadIdealProcessor( HANDLE hThread, /* [in] Specifies the thread of interest */ DWORD dwIdealProcessor) /* [in] Specifies the new preferred processor */ { @@ -585,7 +585,7 @@ BOOL WINAPI TerminateThread( HANDLE handle, /* [in] Handle to thread */ * GetExitCodeThread (KERNEL32.@) * * Gets termination status of thread. - * + * * RETURNS * Success: TRUE * Failure: FALSE @@ -682,7 +682,7 @@ DWORD WINAPI QueueUserAPC( PAPCFUNC func, HANDLE hthread, ULONG_PTR data ) * Success: TRUE * Failure: FALSE */ -BOOL WINAPI GetThreadTimes( +BOOL WINAPI GetThreadTimes( HANDLE thread, /* [in] Specifies the thread of interest */ LPFILETIME creationtime, /* [out] When the thread was created */ LPFILETIME exittime, /* [out] When the thread was destroyed */ @@ -782,13 +782,13 @@ BOOL WINAPI ProcessIdToSessionId( DWORD procid, DWORD *sessionid_ptr ) * * Informs the system that activity is taking place for * power management purposes. - */ + */ EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE flags) { static EXECUTION_STATE current = ES_SYSTEM_REQUIRED|ES_DISPLAY_REQUIRED|ES_USER_PRESENT; EXECUTION_STATE old = current; - + if (!(current & ES_CONTINUOUS) || (flags & ES_CONTINUOUS)) current = flags; FIXME("(0x%lx): stub, harmless (power management).\n", flags); @@ -822,14 +822,14 @@ __ASM_GLOBAL_FUNC( GetLastError, ".byte 0x64\n\tmovl 0x60,%eax\n\tret" ); */ /* DWORD WINAPI GetCurrentProcessId(void) */ __ASM_GLOBAL_FUNC( GetCurrentProcessId, ".byte 0x64\n\tmovl 0x20,%eax\n\tret" ); - + /*********************************************************************** * GetCurrentThreadId (KERNEL.462) * GetCurrentThreadId (KERNEL32.@) */ /* DWORD WINAPI GetCurrentThreadId(void) */ __ASM_GLOBAL_FUNC( GetCurrentThreadId, ".byte 0x64\n\tmovl 0x24,%eax\n\tret" ); - + #else /* __i386__ */ /********************************************************************** diff --git a/server/async.h b/server/async.h index 37b528f82f3..31df5abb4e0 100644 --- a/server/async.h +++ b/server/async.h @@ -26,7 +26,7 @@ struct async_queue; -struct async +struct async { struct object *obj; struct thread *thread; @@ -49,11 +49,11 @@ void destroy_async_queue( struct async_queue *q ); void async_notify(struct async *async, int status); struct async *find_async(struct async_queue *q, struct thread *thread, void *overlapped); void async_insert(struct async_queue *q, struct async *async); -struct async *create_async(struct object *obj, struct thread *thread, +struct async *create_async(struct object *obj, struct thread *thread, void *overlapped); void async_add_timeout(struct async *async, int timeout); -static inline void init_async_queue(struct async_queue *q) -{ +static inline void init_async_queue(struct async_queue *q) +{ q->head = q->tail = NULL; } diff --git a/server/console.c b/server/console.c index 66787f88f8d..6ddd0778892 100644 --- a/server/console.c +++ b/server/console.c @@ -63,7 +63,7 @@ static void console_input_events_dump( struct object *obj, int verbose ); static void console_input_events_destroy( struct object *obj ); static int console_input_events_signaled( struct object *obj, struct thread *thread ); -struct console_input_events +struct console_input_events { struct object obj; /* object header */ int num_alloc; /* number of allocated events */ @@ -138,7 +138,7 @@ static void console_input_events_dump( struct object *obj, int verbose ) { struct console_input_events *evts = (struct console_input_events *)obj; assert( obj->ops == &console_input_events_ops ); - fprintf( stderr, "Console input events: %d/%d events\n", + fprintf( stderr, "Console input events: %d/%d events\n", evts->num_used, evts->num_alloc ); } @@ -159,7 +159,7 @@ static int console_input_events_signaled( struct object *obj, struct thread *thr } /* add an event to the console's renderer events list */ -static void console_input_events_append( struct console_input_events* evts, +static void console_input_events_append( struct console_input_events* evts, struct console_renderer_event* evt) { /* to be done even when the renderer generates the events ? */ @@ -504,7 +504,7 @@ static int set_console_input_info( const struct set_console_input_info_request * { struct screen_buffer *screen_buffer; - screen_buffer = (struct screen_buffer *)get_handle_obj( current->process, req->active_sb, + screen_buffer = (struct screen_buffer *)get_handle_obj( current->process, req->active_sb, GENERIC_READ, &screen_buffer_ops ); if (!screen_buffer || screen_buffer->input != console) { @@ -540,7 +540,7 @@ static int set_console_input_info( const struct set_console_input_info_request * { console->history_mode = req->history_mode; } - if ((req->mask & SET_CONSOLE_INPUT_INFO_HISTORY_SIZE) && + if ((req->mask & SET_CONSOLE_INPUT_INFO_HISTORY_SIZE) && console->history_size != req->history_size) { WCHAR** mem = NULL; @@ -554,7 +554,7 @@ static int set_console_input_info( const struct set_console_input_info_request * memset( mem, 0, req->history_size * sizeof(WCHAR*) ); } - delta = (console->history_index > req->history_size) ? + delta = (console->history_index > req->history_size) ? (console->history_index - req->history_size) : 0; for (i = delta; i < console->history_index; i++) @@ -642,7 +642,7 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, set_error( STATUS_INVALID_PARAMETER ); return 0; } - if (screen_buffer->cursor_size != req->cursor_size || + if (screen_buffer->cursor_size != req->cursor_size || screen_buffer->cursor_visible != req->cursor_visible) { screen_buffer->cursor_size = req->cursor_size; @@ -655,7 +655,7 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, } if (req->mask & SET_CONSOLE_OUTPUT_INFO_CURSOR_POS) { - if (req->cursor_x < 0 || req->cursor_x >= screen_buffer->width || + if (req->cursor_x < 0 || req->cursor_x >= screen_buffer->width || req->cursor_y < 0 || req->cursor_y >= screen_buffer->height) { set_error( STATUS_INVALID_PARAMETER ); @@ -681,7 +681,7 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, evt.u.resize.height = req->height; console_input_events_append( screen_buffer->input->evt, &evt ); - if (screen_buffer == screen_buffer->input->active && + if (screen_buffer == screen_buffer->input->active && screen_buffer->input->mode & ENABLE_WINDOW_INPUT) { INPUT_RECORD ir; @@ -697,9 +697,9 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, } if (req->mask & SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW) { - if (req->win_left < 0 || req->win_left > req->win_right || + if (req->win_left < 0 || req->win_left > req->win_right || req->win_right >= screen_buffer->width || - req->win_top < 0 || req->win_top > req->win_bottom || + req->win_top < 0 || req->win_top > req->win_bottom || req->win_bottom >= screen_buffer->height) { set_error( STATUS_INVALID_PARAMETER ); @@ -773,7 +773,7 @@ static void console_input_append_hist( struct console_input* console, const WCHA else { free( console->history[0]) ; - memmove( &console->history[0], &console->history[1], + memmove( &console->history[0], &console->history[1], (console->history_size - 1) * sizeof(WCHAR*) ); console->history[console->history_size - 1] = ptr; } @@ -798,7 +798,7 @@ static void console_input_dump( struct object *obj, int verbose ) { struct console_input *console = (struct console_input *)obj; assert( obj->ops == &console_input_ops ); - fprintf( stderr, "Console input active=%p evt=%p\n", + fprintf( stderr, "Console input active=%p evt=%p\n", console->active, console->evt ); } @@ -1080,7 +1080,7 @@ static void scroll_console_output( obj_handle_t handle, int xsrc, int ysrc, int for (j = 0; j < h; j++) { - /* we use memmove here because when psrc and pdst are the same, + /* we use memmove here because when psrc and pdst are the same, * copies are done on the same row, so the dst and src blocks * can overlap */ memmove( pdst, psrc, w * sizeof(*pdst) ); @@ -1287,7 +1287,7 @@ DECL_HANDLER(create_console_output) screen_buffer = create_console_output( console ); if (screen_buffer) { - /* FIXME: should store sharing and test it when opening the CONOUT$ device + /* FIXME: should store sharing and test it when opening the CONOUT$ device * see file.c on how this could be done */ reply->handle_out = alloc_handle( current->process, screen_buffer, req->access, req->inherit ); @@ -1382,6 +1382,6 @@ DECL_HANDLER(fill_console_output) /* move a rect of data in a screen buffer */ DECL_HANDLER(move_console_output) { - scroll_console_output( req->handle, req->x_src, req->y_src, req->x_dst, req->y_dst, + scroll_console_output( req->handle, req->x_src, req->y_src, req->x_dst, req->y_dst, req->w, req->h ); } diff --git a/server/named_pipe.c b/server/named_pipe.c index 68c4f204f71..a24465179f1 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -409,7 +409,7 @@ DECL_HANDLER(wait_named_pipe) set_error(STATUS_SUCCESS); if( (partner = find_partner(pipe,ps_wait_open)) ) { - /* this should use notify_waiter, + /* this should use notify_waiter, but no pipe_user object exists now... */ thread_queue_apc(current,NULL,req->func, APC_ASYNC,1,2,req->overlapped,STATUS_SUCCESS); diff --git a/server/registry.c b/server/registry.c index 1e8886737c1..573ee672391 100644 --- a/server/registry.c +++ b/server/registry.c @@ -465,7 +465,7 @@ static void free_subkey( struct key *parent, int index ) key->flags |= KEY_DELETED; key->parent = NULL; release_object( key ); - + /* try to shrink the array */ nb_subkeys = key->nb_subkeys; if (nb_subkeys > MIN_SUBKEYS && key->last_subkey < nb_subkeys / 2) @@ -1062,7 +1062,7 @@ static int get_data_type( const char *buffer, int *type, int *parse_type ) { struct data_type { const char *tag; int len; int type; int parse_type; }; - static const struct data_type data_types[] = + static const struct data_type data_types[] = { /* actual type */ /* type to assume for parsing */ { "\"", 1, REG_SZ, REG_SZ }, { "str:\"", 5, REG_SZ, REG_SZ }, diff --git a/server/smb.c b/server/smb.c index 790f50375a7..49127b0ccdb 100644 --- a/server/smb.c +++ b/server/smb.c @@ -18,7 +18,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * FIXME: if you can't find something to fix, + * FIXME: if you can't find something to fix, * you're not looking hard enough */ diff --git a/server/sock.c b/server/sock.c index 4f79d947d02..d8d6c5b1097 100644 --- a/server/sock.c +++ b/server/sock.c @@ -213,7 +213,7 @@ static void sock_wake_up( struct sock *sock, int pollev ) inline static int sock_error(int s) { unsigned int optval = 0, optlen; - + optlen = sizeof(optval); getsockopt(s, SOL_SOCKET, SO_ERROR, (void *) &optval, &optlen); return optval ? sock_get_error(optval) : 0; @@ -729,9 +729,9 @@ DECL_HANDLER(set_socket_event) if (sock->mask) sock->state |= FD_WINE_NONBLOCKING; - /* if a network event is pending, signal the event object + /* if a network event is pending, signal the event object it is possible that FD_CONNECT or FD_ACCEPT network events has happened - before a WSAEventSelect() was done on it. + before a WSAEventSelect() was done on it. (when dealing with Asynchronous socket) */ if (sock->pmask & sock->mask) sock_wake_up( sock, pollev ); diff --git a/tools/bin2res.c b/tools/bin2res.c index e88e4960e5f..49441ad3847 100644 --- a/tools/bin2res.c +++ b/tools/bin2res.c @@ -95,7 +95,7 @@ void parse_options(int argc, char **argv) { usage(); } - + } else if ( argv[i][1] == 'f') { @@ -105,7 +105,7 @@ void parse_options(int argc, char **argv) { usage(); } - } + } if( i == argc - 1 ) { g_lpstrInputFile = argv[i]; @@ -123,7 +123,7 @@ int insert_hex (char * infile, FILE * outfile) struct stat st; LPBYTE p_in_file = NULL; - if( (fd = open( infile, O_RDONLY))==-1 ) + if( (fd = open( infile, O_RDONLY))==-1 ) { fprintf(stderr, errorOpenFile ); exit(1); @@ -205,10 +205,10 @@ int convert_to_res () strcat( tmpfile, "-tmp" ); /* FIXME: should use better tmp name and create with O_EXCL */ if( (ftemp = fopen( tmpfile, "w")) == NULL ) goto error_open_file; - + if( (fin = fopen( g_lpstrInputFile, "r")) == NULL || stat(g_lpstrInputFile, &st)) goto error_open_file; tinput = st.st_ctime; - + while ( NULL != fgets(buffer, 255, fin)) { fputs(buffer, ftemp); @@ -221,7 +221,7 @@ int convert_to_res () while ( pos[len] != ' ') len++; strncpy(infile, pos, len); infile[len]=0; - + if ( (!stat(infile, &st) && st.st_ctime > tinput) || b_force_overwrite) { /* write a output file */ @@ -239,7 +239,7 @@ int convert_to_res () } } } - + fclose(fin); fclose(ftemp); if (rename(tmpfile, g_lpstrInputFile) == -1) @@ -248,13 +248,13 @@ int convert_to_res () unlink(tmpfile); return 0; } - return 1; + return 1; error_open_file: fprintf(stderr, errorOpenFile ); return 0; -error_rc_format: +error_rc_format: fprintf(stderr, errorRCFormat, line); return 0; } @@ -270,10 +270,10 @@ int convert_to_bin() struct stat st; int line = 0; time_t tinput; - + if( (fin = fopen( g_lpstrInputFile, "r")) == NULL || stat(g_lpstrInputFile, &st)) goto error_open_file; tinput = st.st_ctime; - + while ( NULL != fgets(buffer, 255, fin)) { line++; @@ -285,7 +285,7 @@ int convert_to_bin() while ( pos[len] != ' ') len++; strncpy(outfile, pos, len); outfile[len]=0; - + if ( stat(outfile, &st) || st.st_ctime < tinput || b_force_overwrite) { /* write a output file */ @@ -312,7 +312,7 @@ int convert_to_bin() if ( ! isxdigit(buffer[index])) goto error_rc_format; index += sscanf(&buffer[index], "%02x", &byte); fputc(byte, fout); - } + } } fclose(fout); } @@ -323,15 +323,15 @@ int convert_to_bin() end_of_resource: ; } } - + fclose(fin); - return 1; + return 1; error_open_file: fprintf(stderr, errorOpenFile ); return 0; -error_rc_format: +error_rc_format: fprintf(stderr, errorRCFormat, line); return 0; } diff --git a/tools/fnt2bdf.c b/tools/fnt2bdf.c index a7571cc999c..c0a855e0ffb 100644 --- a/tools/fnt2bdf.c +++ b/tools/fnt2bdf.c @@ -78,15 +78,15 @@ int return_data_value(enum data_types dtype, void * pChr) int ret_val = 0; switch(dtype) { - case (dfChar): + case (dfChar): ret_val = (int) *(unsigned char *)pChr; break; - - case(dfShort): + + case(dfShort): ret_val = *(unsigned char *)pChr; ret_val += (*((unsigned char *)pChr + 1) << 8); break; - + case(dfLong): { int i; @@ -97,7 +97,7 @@ int ret_val = 0; } case(dfString): break; - } + } return ret_val; } @@ -108,7 +108,7 @@ char* lpChar; if( !g_lpstrFileName ) { - if( !l_nameoffset || + if( !l_nameoffset || l_nameoffset > return_data_value(dfLong, &cpe_font_struct->hdr.dfSize) + 1 ) return ERROR_DATA; lpChar = (char*)(file_buffer + l_nameoffset); @@ -117,7 +117,7 @@ char* lpChar; strcpy( name, lpChar ); - while( (lpChar = strchr( name, ' ')) ) + while( (lpChar = strchr( name, ' ')) ) *lpChar = '-'; /* construct a filename from the font typeface, slant, weight, and size */ @@ -136,7 +136,7 @@ char* lpChar; int parse_fnt_data(unsigned char* file_buffer, int length) { - fnt_fontS cpe_font_struct; + fnt_fontS cpe_font_struct; int ic=0, t; memcpy((char *) &cpe_font_struct.hdr, file_buffer, sizeof(fnt_hdrS)); @@ -149,11 +149,11 @@ int parse_fnt_data(unsigned char* file_buffer, int length) t = return_data_value(dfLong, &cpe_font_struct.hdr.dfSize); if( t > length ) return ERROR_SIZE; else - { + { /* set up the charWidth/charOffset structure pairs (dfCharTable)... */ 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); + l_lchar = return_data_value(dfChar, &cpe_font_struct.hdr.fi.dfLastChar); int l_len = l_lchar - l_fchar + 1; int l_ptr = sizeof(fnt_hdrS); @@ -163,7 +163,7 @@ int parse_fnt_data(unsigned char* file_buffer, int length) /* malloc size = (# chars) * sizeof(WinCharS) */ - if((cpe_font_struct.dfCharTable = (WinCharS *) calloc(sizeof(WinCharS), l_len)) == NULL) + if((cpe_font_struct.dfCharTable = (WinCharS *) calloc(sizeof(WinCharS), l_len)) == NULL) return ERROR_MEMORY; /* NOW, convert them all to UNIX (lton) notation... */ @@ -174,12 +174,12 @@ int parse_fnt_data(unsigned char* file_buffer, int length) if( return_data_value(dfShort, &cpe_font_struct.hdr.dfVersion) == 0x200) { - cpe_font_struct.dfCharTable[ic].charOffset = + cpe_font_struct.dfCharTable[ic].charOffset = return_data_value(dfShort, &file_buffer[l_ptr]); l_ptr += 2; /* bump by sizeof(long) */ } else { /* Windows Version 3.0 type font */ - cpe_font_struct.dfCharTable[ic].charOffset = + cpe_font_struct.dfCharTable[ic].charOffset = return_data_value(dfLong, &file_buffer[l_ptr]); l_ptr += 4; /* bump by sizeof(long) */ } @@ -194,18 +194,18 @@ int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer) { FILE* fp; int ic; - 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); + 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); int l_len = l_lchar-l_fchar + 1, - l_hgt = return_data_value(dfChar, &cpe_font_struct->hdr.fi.dfPixHeight); + l_hgt = return_data_value(dfChar, &cpe_font_struct->hdr.fi.dfPixHeight); int l_ascent = return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfAscent); char l_filename[256]; if( (ic = make_bdf_filename(l_filename, cpe_font_struct, file_buffer)) ) return ic; - if((fp = fopen(l_filename, "w")) == (FILE *) 0) + if((fp = fopen(l_filename, "w")) == (FILE *) 0) { fprintf(stderr, "Couldn't open \"%s\" for output.\n", l_filename); return ERROR_FILE; @@ -220,19 +220,19 @@ int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer) int rowidx, l_span, /* how many char-cols wide is char? */ l_idx = cpe_font_struct->dfCharTable[ic].charOffset; - l_span = (int) (cpe_font_struct->dfCharTable[ic].charWidth-1)/8; + l_span = (int) (cpe_font_struct->dfCharTable[ic].charWidth-1)/8; fprintf(fp, "STARTCHAR %d \n", ic); fprintf(fp, "ENCODING %d\n", l_fchar); - fprintf(fp, "SWIDTH %d %d \n", - cpe_font_struct->dfCharTable[ic].charWidth*1000, + fprintf(fp, "SWIDTH %d %d \n", + cpe_font_struct->dfCharTable[ic].charWidth*1000, 0); - fprintf(fp, "DWIDTH %d %d \n", + fprintf(fp, "DWIDTH %d %d \n", cpe_font_struct->dfCharTable[ic].charWidth, 0); fprintf(fp, "BBX %d %d %d %d\n", - cpe_font_struct->dfCharTable[ic].charWidth, l_hgt, 0, + cpe_font_struct->dfCharTable[ic].charWidth, l_hgt, 0, l_ascent - l_hgt); fprintf(fp, "BITMAP\n"); @@ -243,10 +243,10 @@ int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer) fprintf(fp, "%02X\n", (int) file_buffer[l_idx+rowidx]); break; } - + case(1): /* 8-15 pixels wide font */ { - fprintf(fp, "%02X%02X", + fprintf(fp, "%02X%02X", (int) file_buffer[l_idx+rowidx], file_buffer[l_idx+l_hgt+rowidx]); fprintf(fp, "\n"); break; @@ -254,7 +254,7 @@ int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer) case(2): /* 16-23 pixels wide font */ { - fprintf(fp, "%02X%02X%02X", + fprintf(fp, "%02X%02X%02X", file_buffer[l_idx+rowidx], file_buffer[l_idx+l_hgt+rowidx], file_buffer[l_idx+(2*l_hgt)+rowidx]); @@ -264,7 +264,7 @@ int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer) case(3): /* 24-31 pixels wide font */ { - fprintf(fp, "%02X%02X%02X%02X", + fprintf(fp, "%02X%02X%02X%02X", file_buffer[l_idx+rowidx], file_buffer[l_idx+l_hgt+rowidx], file_buffer[l_idx+(2*l_hgt)+rowidx], @@ -301,7 +301,7 @@ return 0; 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), +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); int l_len = l_lchar - l_fchar + 1; long l_nameoffset = return_data_value(dfLong, &cpe_font_struct->hdr.fi.dfFace); @@ -312,14 +312,14 @@ int l_ascent = return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfAscent); /* Compose font name */ - if( l_nameoffset && + if( l_nameoffset && l_nameoffset < return_data_value(dfLong, &cpe_font_struct->hdr.dfSize) ) { int dpi, point_size; char* lpFace = (char*)(file_buffer + l_nameoffset), *lpChar; short tmWeight = return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfWeight); - while((lpChar = strchr(lpFace, '-')) ) + while((lpChar = strchr(lpFace, '-')) ) *lpChar = ' '; fprintf(fs, "FONT -windows-%s-", lpFace ); @@ -351,7 +351,7 @@ int l_ascent = return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfAscent); point_size = 10 * return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfPoints ); dpi = (l_cellheight * 720) / point_size; - fprintf(fs, "%d-%d-%d-%d-",l_cellheight, point_size, + fprintf(fs, "%d-%d-%d-%d-",l_cellheight, point_size, return_data_value (dfShort, &cpe_font_struct->hdr.fi.dfHorizRes), return_data_value (dfShort, &cpe_font_struct->hdr.fi.dfVertRes)); @@ -359,7 +359,7 @@ int l_ascent = return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfAscent); if( return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfPixWidth) ) fputs("c-", fs); else fputs("p-", fs); - + /* average width */ fprintf( fs, "%d-", 10 * return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfAvgWidth) ); @@ -379,20 +379,20 @@ int l_ascent = return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfAscent); case ARABIC_CHARSET: fputs("microsoft-cp1256\n", fs); break; case BALTIC_CHARSET: fputs("microsoft-cp1257\n", fs); break; case RUSSIAN_CHARSET: fputs("microsoft-cp1251\n", fs); break; - case EE_CHARSET: fputs("microsoft-cp1250\n", fs); break; + case EE_CHARSET: fputs("microsoft-cp1250\n", fs); break; case SYMBOL_CHARSET: fputs("microsoft-symbol\n", fs); break; case SHIFTJIS_CHARSET: fputs("jisx0208.1983-0\n", fs); break; case DEFAULT_CHARSET: fputs("iso8859-1\n", fs); break; default: - case OEM_CHARSET: - fputs("Undefined charset, use -c option.\n", stderr); - return ERROR_DATA; + case OEM_CHARSET: + fputs("Undefined charset, use -c option.\n", stderr); + return ERROR_DATA; } } else return ERROR_DATA; - fprintf(fs, "SIZE %d %d %d\n", + fprintf(fs, "SIZE %d %d %d\n", return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfPoints ), return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfHorizRes), return_data_value(dfShort, &cpe_font_struct->hdr.fi.dfVertRes)); /* dfVertRes[2] */ @@ -439,10 +439,10 @@ void parse_options(int argc, char **argv) if( argv[i][0] != '-' || strlen(argv[i]) != 2 ) break; - if( argv[i][1] == 'c' ) + if( argv[i][1] == 'c' ) g_lpstrCharSet = argv[i+1]; - else - if( argv[i][1] == 'f' ) + else + if( argv[i][1] == 'f' ) g_lpstrFileName = argv[i+1]; else if( argv[i][1] == 't' ) @@ -454,7 +454,7 @@ void parse_options(int argc, char **argv) usage(); i++; - } + } if( i == argc - 1 ) { g_lpstrInputFile = argv[i]; @@ -462,7 +462,7 @@ void parse_options(int argc, char **argv) } default: usage(); } - + } /* read file data and return file type */ @@ -476,7 +476,7 @@ int get_resource_table(int fd, unsigned char** lpdata, int fsize) lseek( fd, 0, SEEK_SET ); - if( read(fd, &mz_header, sizeof(mz_header)) != sizeof(mz_header) ) + if( read(fd, &mz_header, sizeof(mz_header)) != sizeof(mz_header) ) return FILE_ERROR; s = return_data_value(dfShort, &mz_header.e_magic); @@ -494,7 +494,7 @@ int get_resource_table(int fd, unsigned char** lpdata, int fsize) if( s == IMAGE_NT_SIGNATURE) { fprintf( stderr, "Do not know how to handle 32-bit Windows DLLs.\n"); - return FILE_ERROR; + return FILE_ERROR; } else if ( s != IMAGE_OS2_SIGNATURE) return FILE_ERROR; @@ -515,7 +515,7 @@ int get_resource_table(int fd, unsigned char** lpdata, int fsize) if( size != fsize ) return FILE_ERROR; offset = 0; - retval = FILE_FNT; + retval = FILE_FNT; } else return FILE_ERROR; @@ -540,7 +540,7 @@ int main(int argc, char **argv) parse_options( argc, argv); - if( (fd = open( g_lpstrInputFile, O_RDONLY)) ) + if( (fd = open( g_lpstrInputFile, O_RDONLY)) ) { int i; struct stat file_stat; @@ -557,7 +557,7 @@ int main(int argc, char **argv) NE_TYPEINFO* pTInfo = (NE_TYPEINFO*)(lpdata + 2); NE_NAMEINFO* pFontStorage = NULL; - while( (i = return_data_value(dfShort, &pTInfo->type_id)) ) + while( (i = return_data_value(dfShort, &pTInfo->type_id)) ) { j = return_data_value(dfShort, &pTInfo->count); if( i == NE_RSCTYPE_FONT ) @@ -580,7 +580,7 @@ int main(int argc, char **argv) { length = return_data_value(dfShort, &pFontStorage->length) << size_shift; offset = return_data_value(dfShort, &pFontStorage->offset) << size_shift; - + if( !(lpfont = (unsigned char*) realloc( lpfont, length )) ) { fprintf(stderr, errorMemory ); diff --git a/tools/fnt2bdf.h b/tools/fnt2bdf.h index 43bdebe7974..e8a1ea231b1 100644 --- a/tools/fnt2bdf.h +++ b/tools/fnt2bdf.h @@ -28,7 +28,7 @@ enum data_types {dfChar, dfShort, dfLong, dfString}; #define ERROR_MEMORY 4 #define ERROR_FILE 5 -typedef struct tagFontHeader +typedef struct tagFontHeader { short dfVersion; /* Version */ long dfSize; /* Total File Size */ @@ -41,7 +41,7 @@ typedef struct WinCharStruct unsigned int charWidth; long charOffset; } WinCharS; - + typedef struct fntFontStruct { fnt_hdrS hdr; diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index b9795ed5c5d..5b21bec3cdd 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -600,8 +600,8 @@ static int output_delayed_imports( FILE *outfile ) } fprintf( outfile, " }\n};\n\n" ); - /* check if there's some stub defined. if so, exception struct - * is already defined, so don't emit it twice + /* check if there's some stub defined. if so, exception struct + * is already defined, so don't emit it twice */ for (i = 0; i < nb_entry_points; i++) if (EntryPoints[i]->type == TYPE_STUB) break; diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index 802af1f0b1b..346be12a64c 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -160,7 +160,7 @@ static const struct option_descr option_table[] = static void do_output( const char *arg ) { - if ( ( unlink ( arg ) ) == -1 && ( errno != ENOENT ) ) + if ( ( unlink ( arg ) ) == -1 && ( errno != ENOENT ) ) { fprintf ( stderr, "Unable to create output file '%s'\n", arg ); exit (1); diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c index af91c3defdb..27c01061dbf 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -163,7 +163,7 @@ static void ParseVariable( ORDDEF *odp ) n_values = 0; value_array_size = 25; value_array = xmalloc(sizeof(*value_array) * value_array_size); - + for (;;) { token = GetToken(0); @@ -174,10 +174,10 @@ static void ParseVariable( ORDDEF *odp ) if (n_values == value_array_size) { value_array_size += 25; - value_array = xrealloc(value_array, + value_array = xrealloc(value_array, sizeof(*value_array) * value_array_size); } - + if (endptr == NULL || *endptr != '\0') fatal_error( "Expected number value, got '%s'\n", token ); } diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index 6332543c17e..582e54a677c 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -62,18 +62,18 @@ static void function_header( FILE *outfile, const char *name ) * * These routines are intended to be called via a far call (with 32-bit * operand size) from 16-bit code. The 16-bit code stub must push %bp, - * the 32-bit entry point to be called, and the argument conversion - * routine to be used (see stack layout below). + * the 32-bit entry point to be called, and the argument conversion + * routine to be used (see stack layout below). * * The core routine completes the STACK16FRAME on the 16-bit stack and - * switches to the 32-bit stack. Then, the argument conversion routine - * is called; it gets passed the 32-bit entry point and a pointer to the - * 16-bit arguments (on the 16-bit stack) as parameters. (You can either - * use conversion routines automatically generated by BuildCallFrom16, + * switches to the 32-bit stack. Then, the argument conversion routine + * is called; it gets passed the 32-bit entry point and a pointer to the + * 16-bit arguments (on the 16-bit stack) as parameters. (You can either + * use conversion routines automatically generated by BuildCallFrom16, * or write your own for special purposes.) - * + * * The conversion routine must call the 32-bit entry point, passing it - * the converted arguments, and return its return value to the core. + * the converted arguments, and return its return value to the core. * After the conversion routine has returned, the core switches back * to the 16-bit stack, converts the return value to the DX:AX format * (CallFrom16Long), and returns to the 16-bit call stub. All parameters, @@ -84,13 +84,13 @@ static void function_header( FILE *outfile, const char *name ) * * In the case of a 'register' function, CallFrom16Register fills a * CONTEXT86 structure with the values all registers had at the point - * the first instruction of the 16-bit call stub was about to be - * executed. A pointer to this CONTEXT86 is passed as third parameter + * the first instruction of the 16-bit call stub was about to be + * executed. A pointer to this CONTEXT86 is passed as third parameter * to the argument conversion routine, which typically passes it on * to the called 32-bit entry point. * - * CallFrom16Thunk is a special variant used by the implementation of - * the Win95 16->32 thunk functions C16ThkSL and C16ThkSL01 and is + * CallFrom16Thunk is a special variant used by the implementation of + * the Win95 16->32 thunk functions C16ThkSL and C16ThkSL01 and is * implemented as follows: * On entry, the EBX register is set up to contain a flat pointer to the * 16-bit stack such that EBX+22 points to the first argument. @@ -261,7 +261,7 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho { fprintf( outfile, "\tsubl $%d, %%esp\n", sizeof(CONTEXT86) ); - fprintf( outfile, "\tmovl %%ecx, %d(%%esp)\n", CONTEXTOFFSET(EFlags) ); + fprintf( outfile, "\tmovl %%ecx, %d(%%esp)\n", CONTEXTOFFSET(EFlags) ); fprintf( outfile, "\tmovl %%eax, %d(%%esp)\n", CONTEXTOFFSET(Eax) ); fprintf( outfile, "\tmovl %%ebx, %d(%%esp)\n", CONTEXTOFFSET(Ebx) ); @@ -413,7 +413,7 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho fprintf( outfile, "\tmovl %d(%%ebx), %%edx\n", CONTEXTOFFSET(Edx) ); fprintf( outfile, "\tmovl %d(%%ebx), %%ecx\n", CONTEXTOFFSET(Ecx) ); fprintf( outfile, "\tmovl %d(%%ebx), %%ebx\n", CONTEXTOFFSET(Ebx) ); - + fprintf( outfile, "\tpopl %%ds\n" ); fprintf( outfile, "\tpopfl\n" ); fprintf( outfile, "\tlret\n" ); @@ -443,7 +443,7 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho fprintf( outfile, "\tlret $12\n" ); } } - + /******************************************************************* * BuildCallTo16Core @@ -455,18 +455,18 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho * extern void WINAPI wine_call_to_16_regs_short( const CONTEXT86 *context, int nb_args ); * extern void WINAPI wine_call_to_16_regs_long ( const CONTEXT86 *context, int nb_args ); * - * These routines can be called directly from 32-bit code. + * These routines can be called directly from 32-bit code. * - * All routines expect that the 16-bit stack contents (arguments) were - * already set up by the caller; nb_args must contain the number of bytes + * All routines expect that the 16-bit stack contents (arguments) were + * already set up by the caller; nb_args must contain the number of bytes * to be conserved. The 16-bit SS:SP will be set accordinly. * - * All other registers are either taken from the CONTEXT86 structure + * All other registers are either taken from the CONTEXT86 structure * or else set to default values. The target routine address is either * given directly or taken from the CONTEXT86. * - * If you want to call a 16-bit routine taking only standard argument types - * (WORD and LONG), you can also have an appropriate argument conversion + * If you want to call a 16-bit routine taking only standard argument types + * (WORD and LONG), you can also have an appropriate argument conversion * stub automatically generated (see BuildCallTo16); you'd then call this * stub, which in turn would prepare the 16-bit stack and call the appropiate * core routine. @@ -556,7 +556,7 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) } else { - /* + /* * Modify CONTEXT86 structure to contain new values * * NOTE: We restore only EAX, EBX, EDX, EDX, EBP, and ESP. @@ -565,7 +565,7 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) * any case. [If necessary, we could restore them as well, * at the cost of a somewhat less efficient return path.] */ - + fprintf( outfile, "\tmovl %d(%%esp), %%edi\n", STACK32OFFSET(target)-12 ); fprintf( outfile, "\tmovl %%eax, %d(%%edi)\n", CONTEXTOFFSET(Eax) ); fprintf( outfile, "\tmovl %%ebx, %d(%%edi)\n", CONTEXTOFFSET(Ebx) ); @@ -644,13 +644,13 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) /* Add the specified offset to the new sp */ fprintf( outfile, "\tsubw %d(%%edx), %%sp\n", STACK32OFFSET(nb_args) ); - /* Push the return address + /* Push the return address * With sreg suffix, we push 16:16 address (normal lret) * With lreg suffix, we push 16:32 address (0x66 lret, for KERNEL32_45) */ if (reg_func != 2) fprintf( outfile, "\tpushl %%ecx\n" ); - else + else { fprintf( outfile, "\tshldl $16, %%ecx, %%eax\n" ); fprintf( outfile, "\tpushw $0\n" ); @@ -711,7 +711,7 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) */ static void BuildRet16Func( FILE *outfile ) { - /* + /* * Note: This must reside in the .data section to allow * run-time relocation of the SYSLEVEL_Win16CurrentTeb symbol */ @@ -764,7 +764,7 @@ static void BuildRet16Func( FILE *outfile ) * Call a CBClient relay stub from 32-bit code (KERNEL.620). * * Since the relay stub is itself 32-bit, this should not be a problem; - * unfortunately, the relay stubs are expected to switch back to a + * unfortunately, the relay stubs are expected to switch back to a * 16-bit stack (and 16-bit code) after completion :-( * * This would conflict with our 16- vs. 32-bit stack handling, so @@ -793,7 +793,7 @@ static void BuildRet16Func( FILE *outfile ) * The 32-bit side glue code accesses both the original arguments (via ebp) * and the temporary copies prepared by the 16-bit side glue (via ebx). * After completion, the stub will load ss:sp from the buffer at ebx - * and perform a far return to 16-bit code. + * and perform a far return to 16-bit code. * * To trick the relay stub into returning to us, we replace the 16-bit * return address to the glue code by a cs:ip pair pointing to our @@ -831,11 +831,11 @@ static void BuildRet16Func( FILE *outfile ) * (ebx+0) 16-bit sp (points to ebx+4) * * Note that we ensure that DS is not changed and remains the flat segment, - * and the 32-bit stack pointer our own return stub needs fits just + * and the 32-bit stack pointer our own return stub needs fits just * perfectly into the 8 bytes that are skipped by the Windows stub. * One problem is that we have to determine the number of removed arguments, - * as these have to be really removed in KERNEL.621. Thus, the BP value - * that we place in the temporary area to be restored, contains the value + * as these have to be really removed in KERNEL.621. Thus, the BP value + * that we place in the temporary area to be restored, contains the value * that SP would have if no arguments were removed. By comparing the actual * value of SP with this value in our return stub we can compute the number * of removed arguments. This is then returned to KERNEL.621. @@ -872,7 +872,7 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx ) /* Get the 16-bit stack */ fprintf( outfile, "\t.byte 0x64\n\tmovl (%d),%%ebx\n", STACKOFFSET); - + /* Convert it to a flat address */ fprintf( outfile, "\tshldl $16,%%ebx,%%eax\n" ); diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index f14ea4070d5..773c2c88326 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -288,34 +288,34 @@ static int BuildModule16( FILE *outfile, int max_code_offset, /******************************************************************* * BuildCallFrom16Func * - * Build a 16-bit-to-Wine callback glue function. + * Build a 16-bit-to-Wine callback glue function. * - * The generated routines are intended to be used as argument conversion + * The generated routines are intended to be used as argument conversion * routines to be called by the CallFrom16... core. Thus, the prototypes of * the generated routines are (see also CallFrom16): * * extern WORD WINAPI PREFIX_CallFrom16_C_word_xxx( FARPROC func, LPBYTE args ); * extern LONG WINAPI PREFIX_CallFrom16_C_long_xxx( FARPROC func, LPBYTE args ); - * extern void WINAPI PREFIX_CallFrom16_C_regs_xxx( FARPROC func, LPBYTE args, + * extern void WINAPI PREFIX_CallFrom16_C_regs_xxx( FARPROC func, LPBYTE args, * CONTEXT86 *context ); - * extern void WINAPI PREFIX_CallFrom16_C_intr_xxx( FARPROC func, LPBYTE args, + * extern void WINAPI PREFIX_CallFrom16_C_intr_xxx( FARPROC func, LPBYTE args, * CONTEXT86 *context ); * - * where 'C' is the calling convention ('p' for pascal or 'c' for cdecl), - * and each 'x' is an argument ('w'=word, 's'=signed word, 'l'=long, + * where 'C' is the calling convention ('p' for pascal or 'c' for cdecl), + * and each 'x' is an argument ('w'=word, 's'=signed word, 'l'=long, * 'p'=linear pointer, 't'=linear pointer to null-terminated string, * 'T'=segmented pointer to null-terminated string). * * The generated routines fetch the arguments from the 16-bit stack (pointed - * to by 'args'); the offsets of the single argument values are computed + * to by 'args'); the offsets of the single argument values are computed * according to the calling convention and the argument types. Then, the * 32-bit entry point is called with these arguments. - * + * * For register functions, the arguments (if present) are converted just - * the same as for normal functions, but in addition the CONTEXT86 pointer + * the same as for normal functions, but in addition the CONTEXT86 pointer * filled with the current register values is passed to the 32-bit routine. - * (An 'intr' interrupt handler routine is treated exactly like a register - * routine, except that upon return, the flags word pushed onto the stack + * (An 'intr' interrupt handler routine is treated exactly like a register + * routine, except that upon return, the flags word pushed onto the stack * by the interrupt is removed by the 16-bit call stub.) * */ @@ -435,18 +435,18 @@ static void BuildCallFrom16Func( FILE *outfile, const char *profile, const char /******************************************************************* * BuildCallTo16Func * - * Build a Wine-to-16-bit callback glue function. + * Build a Wine-to-16-bit callback glue function. * * Prototypes for the CallTo16 functions: * extern WORD CALLBACK PREFIX_CallTo16_word_xxx( FARPROC16 func, args... ); * extern LONG CALLBACK PREFIX_CallTo16_long_xxx( FARPROC16 func, args... ); - * + * * These routines are provided solely for convenience; they simply * write the arguments onto the 16-bit stack, and call the appropriate * wine_call_to_16... core routine. * * If you have more sophisticated argument conversion requirements than - * are provided by these routines, you might as well call the core + * are provided by these routines, you might as well call the core * routines by yourself. * */ diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 7e4bb4f5148..68b6e312724 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -191,15 +191,15 @@ const char *make_c_identifier( const char *str ) * provides other directives that work consistantly across * architectures, but of course we want to work on all arches with or * without gas. Hence this function. - * + * * * Parameters: * alignBoundary -- the number of bytes to align to. - * If we're on an architecture where + * If we're on an architecture where * the assembler requires a 'number * of low-order zero bits' as a * .align argument, then this number - * must be a power of 2. + * must be a power of 2. * */ int get_alignment(int alignBoundary) diff --git a/tools/winedump/cvinclude.h b/tools/winedump/cvinclude.h index 2c9deda7171..a0420ef75f8 100644 --- a/tools/winedump/cvinclude.h +++ b/tools/winedump/cvinclude.h @@ -44,13 +44,13 @@ * CodeView headers */ -typedef struct OMFSignature +typedef struct OMFSignature { char Signature[4]; long filepos; } OMFSignature; -typedef struct OMFDirHeader +typedef struct OMFDirHeader { unsigned short cbDirHeader; unsigned short cbDirEntry; @@ -59,7 +59,7 @@ typedef struct OMFDirHeader unsigned long flags; } OMFDirHeader; -typedef struct OMFDirEntry +typedef struct OMFDirEntry { unsigned short SubSection; unsigned short iMod; @@ -72,7 +72,7 @@ typedef struct OMFDirEntry * sstModule subsection */ -typedef struct OMFSegDesc +typedef struct OMFSegDesc { unsigned short Seg; unsigned short pad; @@ -84,7 +84,7 @@ typedef struct OMFSegDesc * struct out to a file. If we write the whole struct out, we'll end up * with (*OMFSegDesc), not (OMFSegDesc). See OMFModuleFull. */ -typedef struct OMFModule +typedef struct OMFModule { unsigned short ovlNumber; unsigned short iLib; @@ -113,7 +113,7 @@ typedef struct OMFModuleFull /* Header for symbol table. */ -typedef struct OMFSymHash +typedef struct OMFSymHash { unsigned short symhash; unsigned short addrhash; @@ -124,7 +124,7 @@ typedef struct OMFSymHash /* Symbol table entry. */ -typedef struct DATASYM32 +typedef struct DATASYM32 { unsigned short reclen; unsigned short rectyp; diff --git a/tools/winedump/debug.c b/tools/winedump/debug.c index 1f1ddfd6548..5fa3a41ae26 100644 --- a/tools/winedump/debug.c +++ b/tools/winedump/debug.c @@ -57,7 +57,7 @@ /* * Descriptions: * - * (hdr) IMAGE_SEPARATE_DEBUG_HEADER - .DBG-specific file header; holds info that + * (hdr) IMAGE_SEPARATE_DEBUG_HEADER - .DBG-specific file header; holds info that * applies to the file as a whole, including # of COFF sections, file offsets, etc. * (hdr) IMAGE_SECTION_HEADER - list of COFF sections copied verbatim from .EXE; * although this directory contains file offsets, these offsets are meaningless @@ -73,7 +73,7 @@ * (data) IMAGE_DEBUG_TYPE_CODEVIEW - *** THE GOOD STUFF *** * This block of data contains all the symbol tables, line number info, etc., * that the Visual C++ debugger needs. - * (hdr) OMFDirHeader (CV) - + * (hdr) OMFDirHeader (CV) - * (hdr) OMFDirEntry (CV) - list of subsections within CodeView debug data section */ @@ -106,7 +106,7 @@ static int dump_cv_sst_module(OMFDirEntry* omfde) printf(" iLib: %u\n", module->iLib); printf(" cSeg: %u\n", module->cSeg); printf(" Style: %c%c\n", module->Style[0], module->Style[1]); - printf(" Name: %.*s\n", + printf(" Name: %.*s\n", *(BYTE*)((char*)(module + 1) + sizeof(OMFSegDesc) * module->cSeg), (char*)(module + 1) + sizeof(OMFSegDesc) * module->cSeg + 1); @@ -217,7 +217,7 @@ static int dump_cv_sst_seg_map(OMFDirEntry* omfde) segMapDesc = PRD(Offset(segMap + 1), segMap->cSeg * sizeof(OMFSegDesc)); if (!segMapDesc) {printf("Can't get SegDescr array, aborting\n");return FALSE;} - + for (i = 0; i < segMap->cSeg; i++) { printf(" SegDescr #%2d\n", i + 1); @@ -256,7 +256,7 @@ static int dump_cv_sst_src_module(OMFDirEntry* omfde) /* FIXME: check ptr validity */ sourceModule = (void*)rawdata; - printf (" Module table: Found %d file(s) and %d segment(s)\n", + printf (" Module table: Found %d file(s) and %d segment(s)\n", sourceModule->cFile, sourceModule->cSeg); for (i = 0; i < sourceModule->cFile; i++) { @@ -265,16 +265,16 @@ static int dump_cv_sst_src_module(OMFDirEntry* omfde) } /* FIXME: check ptr validity */ - seg_info_dw = (void*)((char*)(sourceModule + 1) + + seg_info_dw = (void*)((char*)(sourceModule + 1) + sizeof(unsigned long) * (sourceModule->cFile - 1)); seg_info_w = (unsigned short*)(&seg_info_dw[sourceModule->cSeg * 2]); for (i = 0; i < sourceModule->cSeg; i++) { printf (" Segment #%2d start = 0x%lx, end = 0x%lx, seg index = %u\n", - i + 1, seg_info_dw[i * 2], seg_info_dw[(i * 2) + 1], + i + 1, seg_info_dw[i * 2], seg_info_dw[(i * 2) + 1], seg_info_w[i]); } - ofs = sizeof(OMFSourceModule) + sizeof(unsigned long) * (sourceModule->cFile - 1) + + ofs = sizeof(OMFSourceModule) + sizeof(unsigned long) * (sourceModule->cFile - 1) + sourceModule->cSeg * (2 * sizeof(unsigned long) + sizeof(unsigned short)); ofs = (ofs + 3) & ~3; @@ -291,12 +291,12 @@ static int dump_cv_sst_src_module(OMFDirEntry* omfde) */ /* FIXME: check ptr validity */ sourceFile = (void*)(rawdata + ofs); - seg_info_dw = (void*)((char*)sourceFile + 2 * sizeof(unsigned short) + + seg_info_dw = (void*)((char*)sourceFile + 2 * sizeof(unsigned short) + sourceFile->cSeg * sizeof(unsigned long)); ofs += 2 * sizeof(unsigned short) + 3 * sourceFile->cSeg * sizeof(unsigned long); - printf(" File table: %.*s\n", + printf(" File table: %.*s\n", *(BYTE*)((char*)sourceModule + ofs), (char*)sourceModule + ofs + 1); for (i = 0; i < sourceFile->cSeg; i++) @@ -308,21 +308,21 @@ static int dump_cv_sst_src_module(OMFDirEntry* omfde) ofs += *(BYTE*)((char*)sourceModule + ofs) + 1; ofs = (ofs + 3) & ~3; - for (i = 0; i < sourceModule->cSeg; i++) + for (i = 0; i < sourceModule->cSeg; i++) { sourceLine = (void*)(rawdata + ofs); seg_info_dw = (void*)((char*)sourceLine + 2 * sizeof(unsigned short)); seg_info_w = (void*)(&seg_info_dw[sourceLine->cLnOff]); - + printf (" Line table #%2d: Found %d line numbers for segment index %d\n", i, sourceLine->cLnOff, sourceLine->Seg); - + for (j = 0; j < sourceLine->cLnOff; j++) { printf (" Pair #%2d: offset = [0x%8lx], linenumber = %d\n", j + 1, seg_info_dw[j], seg_info_w[j]); } - ofs += 2 * sizeof(unsigned short) + + ofs += 2 * sizeof(unsigned short) + sourceLine->cLnOff * (sizeof(unsigned long) + sizeof(unsigned short)); ofs = (ofs + 3) & ~3; } @@ -399,7 +399,7 @@ static void dump_codeview_headers(unsigned long base, unsigned long len) int modulecount = 0, alignsymcount = 0, srcmodulecount = 0, librariescount = 0; int globalsymcount = 0, globalpubcount = 0, globaltypescount = 0; int segmapcount = 0, fileindexcount = 0, staticsymcount = 0; - + cv_base = PRD(base, len); if (!cv_base) {printf("Can't get full debug content, aborting\n");return;} @@ -415,12 +415,12 @@ static void dump_codeview_headers(unsigned long base, unsigned long len) struct {DWORD TimeStamp; DWORD Dunno; char Name[1];}* pdb_data; pdb_data = (void*)(signature + 1); - printf(" TimeStamp: %08lX (%s)\n", + printf(" TimeStamp: %08lX (%s)\n", pdb_data->TimeStamp, get_time_str(pdb_data->TimeStamp)); printf(" Dunno: %08lX\n", pdb_data->Dunno); printf(" Filename: %s\n", pdb_data->Name); return; - } + } if (memcmp(signature->Signature, "NB09", 4) != 0 && memcmp(signature->Signature, "NB11", 4) != 0) { @@ -456,7 +456,7 @@ static void dump_codeview_headers(unsigned long base, unsigned long len) case sstSegMap: segmapcount++; break; case sstFileIndex: fileindexcount++; break; case sstStaticSym: staticsymcount++; break; - } + } } /* This one has to be > 0 diff --git a/tools/winedump/main.c b/tools/winedump/main.c index 07fa8ad890f..1ec0b50149c 100644 --- a/tools/winedump/main.c +++ b/tools/winedump/main.c @@ -64,7 +64,7 @@ static void do_demangle (const char *arg) static void do_dump (const char *arg) { if (globals.mode != NONE) fatal("Only one mode can be specified\n"); - globals.mode = DUMP; + globals.mode = DUMP; globals.do_code = 1; } @@ -253,7 +253,7 @@ static void parse_options (char *argv[]) opt->func (arg); else opt->func (""); - + ptr++; } @@ -364,7 +364,7 @@ int main (int argc, char *argv[]) output_spec_symbol (&symbol); output_header_symbol (&symbol); output_c_symbol (&symbol); - + symbol_clear (&symbol); } diff --git a/tools/winedump/msmangle.c b/tools/winedump/msmangle.c index 283e0b2215b..8e314c5d489 100644 --- a/tools/winedump/msmangle.c +++ b/tools/winedump/msmangle.c @@ -505,7 +505,7 @@ static char *demangle_datatype (char **str, compound_type *ct, /* FIXME: P6 = Function pointer, others who knows.. */ if (isdigit (*iter)) { - if (*iter == '6') + if (*iter == '6') { /* FIXME: there are a tons of memory leaks here */ /* FIXME: this is still broken in some cases and it has to be @@ -531,7 +531,7 @@ static char *demangle_datatype (char **str, compound_type *ct, ct->expression = str_create(2, ct->expression, ")"); FREE_CT (sub_ct); } - else + else return NULL; } else diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 6ad41e4dfd2..d5611a9f4e2 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -46,8 +46,8 @@ char* get_time_str(DWORD _t) { time_t t = (time_t)_t; static char buf[128]; - - /* FIXME: I don't get the same values from MS' pedump running under Wine... + + /* FIXME: I don't get the same values from MS' pedump running under Wine... * I wonder if Wine isn't broken wrt to GMT settings... */ strncpy(buf, ctime(&t), sizeof(buf)); @@ -89,26 +89,26 @@ void* RVA(unsigned long rva, unsigned long len) { IMAGE_SECTION_HEADER* sectHead; int i; - - sectHead = (IMAGE_SECTION_HEADER*)((char*)nt_headers + sizeof(DWORD) + - sizeof(IMAGE_FILE_HEADER) + + + sectHead = (IMAGE_SECTION_HEADER*)((char*)nt_headers + sizeof(DWORD) + + sizeof(IMAGE_FILE_HEADER) + nt_headers->FileHeader.SizeOfOptionalHeader); - + if (rva == 0) return NULL; - + for (i = nt_headers->FileHeader.NumberOfSections - 1; i >= 0; i--) { if (sectHead[i].VirtualAddress <= rva && rva + len <= (DWORD)sectHead[i].VirtualAddress + sectHead[i].SizeOfRawData) break; } - - if (i < 0) + + if (i < 0) { printf("rva not found in any section (%lu)\n", rva); return NULL; } - + /* return image import directory offset */ return PRD(sectHead[i].PointerToRawData + rva - sectHead[i].VirtualAddress, len); } @@ -122,9 +122,9 @@ static void* get_dir(unsigned idx) } static const char* DirectoryNames[16] = { - "EXPORT", "IMPORT", "RESOURCE", "EXCEPTION", - "SECURITY", "BASERELOC", "DEBUG", "ARCHITECTURE", - "GLOBALPTR", "TLS", "LOAD_CONFIG", "Bound IAT", + "EXPORT", "IMPORT", "RESOURCE", "EXCEPTION", + "SECURITY", "BASERELOC", "DEBUG", "ARCHITECTURE", + "GLOBALPTR", "TLS", "LOAD_CONFIG", "Bound IAT", "IAT", "Delay IAT", "COM Descript", "" }; @@ -134,15 +134,15 @@ static void dump_pe_header(void) IMAGE_FILE_HEADER *fileHeader; IMAGE_OPTIONAL_HEADER *optionalHeader; unsigned i; - + printf("File Header\n"); fileHeader = &nt_headers->FileHeader; - - printf(" Machine: %04X (%s)\n", + + printf(" Machine: %04X (%s)\n", fileHeader->Machine, get_machine_str(fileHeader->Machine)); printf(" Number of Sections: %d\n", fileHeader->NumberOfSections); - printf(" TimeDateStamp: %08lX (%s) offset %ld\n", - fileHeader->TimeDateStamp, get_time_str(fileHeader->TimeDateStamp), + printf(" TimeDateStamp: %08lX (%s) offset %ld\n", + fileHeader->TimeDateStamp, get_time_str(fileHeader->TimeDateStamp), Offset(&(fileHeader->TimeDateStamp))); printf(" PointerToSymbolTable: %08lX\n", fileHeader->PointerToSymbolTable); printf(" NumberOfSymbols: %08lX\n", fileHeader->NumberOfSymbols); @@ -162,42 +162,42 @@ static void dump_pe_header(void) X(IMAGE_FILE_BYTES_REVERSED_HI, "BYTES_REVERSED_HI"); #undef X printf("\n"); - + /* hope we have the right size */ printf("Optional Header\n"); optionalHeader = &nt_headers->OptionalHeader; - printf(" Magic 0x%-4X %u\n", + printf(" Magic 0x%-4X %u\n", optionalHeader->Magic, optionalHeader->Magic); - printf(" linker version %u.%02u\n", + printf(" linker version %u.%02u\n", optionalHeader->MajorLinkerVersion, optionalHeader->MinorLinkerVersion); - printf(" size of code 0x%-8lx %lu\n", + printf(" size of code 0x%-8lx %lu\n", optionalHeader->SizeOfCode, optionalHeader->SizeOfCode); - printf(" size of initialized data 0x%-8lx %lu\n", + printf(" size of initialized data 0x%-8lx %lu\n", optionalHeader->SizeOfInitializedData, optionalHeader->SizeOfInitializedData); - printf(" size of uninitialized data 0x%-8lx %lu\n", + printf(" size of uninitialized data 0x%-8lx %lu\n", optionalHeader->SizeOfUninitializedData, optionalHeader->SizeOfUninitializedData); - printf(" entrypoint RVA 0x%-8lx %lu\n", + printf(" entrypoint RVA 0x%-8lx %lu\n", optionalHeader->AddressOfEntryPoint, optionalHeader->AddressOfEntryPoint); - printf(" base of code 0x%-8lx %lu\n", + printf(" base of code 0x%-8lx %lu\n", optionalHeader->BaseOfCode, optionalHeader->BaseOfCode); - printf(" base of data 0x%-8lX %lu\n", + printf(" base of data 0x%-8lX %lu\n", optionalHeader->BaseOfData, optionalHeader->BaseOfData); - printf(" image base 0x%-8lX %lu\n", + printf(" image base 0x%-8lX %lu\n", optionalHeader->ImageBase, optionalHeader->ImageBase); - printf(" section align 0x%-8lx %lu\n", + printf(" section align 0x%-8lx %lu\n", optionalHeader->SectionAlignment, optionalHeader->SectionAlignment); - printf(" file align 0x%-8lx %lu\n", + printf(" file align 0x%-8lx %lu\n", optionalHeader->FileAlignment, optionalHeader->FileAlignment); - printf(" required OS version %u.%02u\n", + printf(" required OS version %u.%02u\n", optionalHeader->MajorOperatingSystemVersion, optionalHeader->MinorOperatingSystemVersion); - printf(" image version %u.%02u\n", + printf(" image version %u.%02u\n", optionalHeader->MajorImageVersion, optionalHeader->MinorImageVersion); - printf(" subsystem version %u.%02u\n", + printf(" subsystem version %u.%02u\n", optionalHeader->MajorSubsystemVersion, optionalHeader->MinorSubsystemVersion); printf(" Win32 Version 0x%lX\n", optionalHeader->Win32VersionValue); - printf(" size of image 0x%-8lx %lu\n", + printf(" size of image 0x%-8lx %lu\n", optionalHeader->SizeOfImage, optionalHeader->SizeOfImage); - printf(" size of headers 0x%-8lx %lu\n", + printf(" size of headers 0x%-8lx %lu\n", optionalHeader->SizeOfHeaders, optionalHeader->SizeOfHeaders); printf(" checksum 0x%lX\n", optionalHeader->CheckSum); switch (optionalHeader->Subsystem) @@ -212,25 +212,25 @@ static void dump_pe_header(void) } printf(" Subsystem 0x%X (%s)\n", optionalHeader->Subsystem, str); printf(" DLL flags 0x%X\n", optionalHeader->DllCharacteristics); - printf(" stack reserve size 0x%-8lx %lu\n", + printf(" stack reserve size 0x%-8lx %lu\n", optionalHeader->SizeOfStackReserve, optionalHeader->SizeOfStackReserve); printf(" stack commit size 0x%-8lx %lu\n", optionalHeader->SizeOfStackCommit, optionalHeader->SizeOfStackCommit); - printf(" heap reserve size 0x%-8lx %lu\n", + printf(" heap reserve size 0x%-8lx %lu\n", optionalHeader->SizeOfHeapReserve, optionalHeader->SizeOfHeapReserve); - printf(" heap commit size 0x%-8lx %lu\n", + printf(" heap commit size 0x%-8lx %lu\n", optionalHeader->SizeOfHeapCommit, optionalHeader->SizeOfHeapCommit); printf(" loader flags 0x%lX\n", optionalHeader->LoaderFlags); printf(" RVAs & sizes 0x%lX\n", optionalHeader->NumberOfRvaAndSizes); printf("\n"); - + printf("Data Directory\n"); printf("%ld\n", optionalHeader->NumberOfRvaAndSizes * sizeof(IMAGE_DATA_DIRECTORY)); - + for (i = 0; i < optionalHeader->NumberOfRvaAndSizes && i < 16; i++) { - printf(" %-12s rva: 0x%-8lX size: %8lu\n", - DirectoryNames[i], optionalHeader->DataDirectory[i].VirtualAddress, + printf(" %-12s rva: 0x%-8lX size: %8lu\n", + DirectoryNames[i], optionalHeader->DataDirectory[i].VirtualAddress, optionalHeader->DataDirectory[i].Size); } printf("\n"); @@ -240,16 +240,16 @@ static void dump_sections(void* addr, unsigned num_sect) { IMAGE_SECTION_HEADER* sectHead = addr; unsigned i; - + printf("Section Table\n"); for (i = 0; i < num_sect; i++, sectHead++) { - printf(" %02d %-8s VirtSize: %-8lu VirtAddr: %-8lu 0x%08lx\n", - i + 1, sectHead->Name, sectHead->Misc.VirtualSize, sectHead->VirtualAddress, + printf(" %02d %-8s VirtSize: %-8lu VirtAddr: %-8lu 0x%08lx\n", + i + 1, sectHead->Name, sectHead->Misc.VirtualSize, sectHead->VirtualAddress, sectHead->VirtualAddress); - printf(" raw data offs: %-8lu raw data size: %-8lu\n", + printf(" raw data offs: %-8lu raw data size: %-8lu\n", sectHead->PointerToRawData, sectHead->SizeOfRawData); - printf(" relocation offs: %-8lu relocations: %-8u\n", + printf(" relocation offs: %-8lu relocations: %-8u\n", sectHead->PointerToRelocations, sectHead->NumberOfRelocations); printf(" line # offs: %-8lu line #'s: %-8u\n", sectHead->PointerToLinenumbers, sectHead->NumberOfLinenumbers); @@ -262,27 +262,27 @@ static void dump_sections(void* addr, unsigned num_sect) /* #define IMAGE_SCN_TYPE_GROUP 0x00000004 - Reserved */ /* #define IMAGE_SCN_TYPE_NO_PAD 0x00000008 - Reserved */ /* #define IMAGE_SCN_TYPE_COPY 0x00000010 - Reserved */ - + X(IMAGE_SCN_CNT_CODE, "CODE"); X(IMAGE_SCN_CNT_INITIALIZED_DATA, "INITIALIZED_DATA"); X(IMAGE_SCN_CNT_UNINITIALIZED_DATA, "UNINITIALIZED_DATA"); - + X(IMAGE_SCN_LNK_OTHER, "LNK_OTHER"); X(IMAGE_SCN_LNK_INFO, "LNK_INFO"); /* #define IMAGE_SCN_TYPE_OVER 0x00000400 - Reserved */ X(IMAGE_SCN_LNK_REMOVE, "LNK_REMOVE"); X(IMAGE_SCN_LNK_COMDAT, "LNK_COMDAT"); - + /* 0x00002000 - Reserved */ /* #define IMAGE_SCN_MEM_PROTECTED 0x00004000 - Obsolete */ X(IMAGE_SCN_MEM_FARDATA, "MEM_FARDATA"); - + /* #define IMAGE_SCN_MEM_SYSHEAP 0x00010000 - Obsolete */ X(IMAGE_SCN_MEM_PURGEABLE, "MEM_PURGEABLE"); X(IMAGE_SCN_MEM_16BIT, "MEM_16BIT"); X(IMAGE_SCN_MEM_LOCKED, "MEM_LOCKED"); X(IMAGE_SCN_MEM_PRELOAD, "MEM_PRELOAD"); - + X(IMAGE_SCN_ALIGN_1BYTES, "ALIGN_1BYTES"); X(IMAGE_SCN_ALIGN_2BYTES, "ALIGN_2BYTES"); X(IMAGE_SCN_ALIGN_4BYTES, "ALIGN_4BYTES"); @@ -291,9 +291,9 @@ static void dump_sections(void* addr, unsigned num_sect) X(IMAGE_SCN_ALIGN_32BYTES, "ALIGN_32BYTES"); X(IMAGE_SCN_ALIGN_64BYTES, "ALIGN_64BYTES"); /* 0x00800000 - Unused */ - + X(IMAGE_SCN_LNK_NRELOC_OVFL, "LNK_NRELOC_OVFL"); - + X(IMAGE_SCN_MEM_DISCARDABLE, "MEM_DISCARDABLE"); X(IMAGE_SCN_MEM_NOT_CACHED, "MEM_NOT_CACHED"); X(IMAGE_SCN_MEM_NOT_PAGED, "MEM_NOT_PAGED"); @@ -316,14 +316,14 @@ static void dump_dir_exported_functions(void) WORD* pOrdl; DWORD* map; parsed_symbol symbol; - + if (!exportDir) return; - + printf("Exports table:\n"); printf("\n"); printf(" Name: %s\n", (char*)RVA(exportDir->Name, sizeof(DWORD))); printf(" Characteristics: %08lx\n", exportDir->Characteristics); - printf(" TimeDateStamp: %08lX %s\n", + printf(" TimeDateStamp: %08lX %s\n", exportDir->TimeDateStamp, get_time_str(exportDir->TimeDateStamp)); printf(" Version: %u.%02u\n", exportDir->MajorVersion, exportDir->MinorVersion); printf(" Ordinal base: %lu\n", exportDir->Base); @@ -334,24 +334,24 @@ static void dump_dir_exported_functions(void) printf("Adresses of names: %08lX\n", exportDir->AddressOfNames); printf("\n"); printf(" Entry Pt Ordn Name\n"); - + pFunc = RVA(exportDir->AddressOfFunctions, exportDir->NumberOfFunctions * sizeof(DWORD)); if (!pFunc) {printf("Can't grab functions' address table\n"); return;} pName = RVA(exportDir->AddressOfNames, exportDir->NumberOfNames * sizeof(DWORD)); if (!pName) {printf("Can't grab functions' name table\n"); return;} pOrdl = RVA(exportDir->AddressOfNameOrdinals, exportDir->NumberOfNames * sizeof(WORD)); if (!pOrdl) {printf("Can't grab functions' ordinal table\n"); return;} - + /* bit map of used funcs */ map = calloc(((exportDir->NumberOfFunctions + 31) & ~31) / 32, sizeof(DWORD)); if (!map) fatal("no memory"); - + for (i = 0; i < exportDir->NumberOfNames; i++, pName++, pOrdl++) { char* name; - + map[*pOrdl / 32] |= 1 << (*pOrdl % 32); - + name = (char*)RVA(*pName, sizeof(DWORD)); if (name && globals.do_demangle) { @@ -389,21 +389,21 @@ static void dump_dir_imported_functions(void) { IMAGE_IMPORT_DESCRIPTOR *importDesc = get_dir(IMAGE_FILE_IMPORT_DIRECTORY); unsigned nb_imp, i; - + if (!importDesc) return; - nb_imp = nt_headers->OptionalHeader.DataDirectory[IMAGE_FILE_IMPORT_DIRECTORY].Size / + nb_imp = nt_headers->OptionalHeader.DataDirectory[IMAGE_FILE_IMPORT_DIRECTORY].Size / sizeof(*importDesc); if (!nb_imp) return; - - printf("Import Table size: %lu\n", + + printf("Import Table size: %lu\n", nt_headers->OptionalHeader.DataDirectory[IMAGE_FILE_IMPORT_DIRECTORY].Size);/* FIXME */ - + for (i = 0; i < nb_imp - 1; i++) /* the last descr is set as 0 as a sentinel */ { IMAGE_THUNK_DATA* il; IMAGE_IMPORT_BY_NAME* iibn; - - if (!importDesc->Name || + + if (!importDesc->Name || (importDesc->u.OriginalFirstThunk == NULL && importDesc->FirstThunk == NULL)) { /* FIXME */ @@ -412,32 +412,32 @@ static void dump_dir_imported_functions(void) } printf(" offset %lu %s\n", Offset(importDesc), (char*)RVA(importDesc->Name, sizeof(DWORD))); printf(" Hint/Name Table: %08lX\n", (DWORD)importDesc->u.OriginalFirstThunk); - printf(" TimeDataStamp: %08lX (%s)\n", + printf(" TimeDataStamp: %08lX (%s)\n", importDesc->TimeDateStamp, get_time_str(importDesc->TimeDateStamp)); printf(" ForwarderChain: %08lX\n", importDesc->ForwarderChain); - printf(" First thunk RVA: %08lX (delta: %u 0x%x)\n", + printf(" First thunk RVA: %08lX (delta: %u 0x%x)\n", (DWORD)importDesc->FirstThunk, -1, -1); /* FIXME */ - + printf(" Ordn Name\n"); - - il = (importDesc->u.OriginalFirstThunk != 0) ? - RVA((DWORD)importDesc->u.OriginalFirstThunk, sizeof(DWORD)) : + + il = (importDesc->u.OriginalFirstThunk != 0) ? + RVA((DWORD)importDesc->u.OriginalFirstThunk, sizeof(DWORD)) : RVA((DWORD)importDesc->FirstThunk, sizeof(DWORD)); - + if (!il) {printf("Can't grab thunk data, going to next imported DLL\n"); continue;} - + for (; il->u1.Ordinal; il++) { - if (IMAGE_SNAP_BY_ORDINAL(il->u1.Ordinal)) + if (IMAGE_SNAP_BY_ORDINAL(il->u1.Ordinal)) { printf(" %4lu \n", IMAGE_ORDINAL(il->u1.Ordinal)); } else { iibn = RVA((DWORD)il->u1.AddressOfData, sizeof(DWORD)); - if (!il) + if (!il) { - printf("Can't grab import by name info, skipping to next ordinal\n"); + printf("Can't grab import by name info, skipping to next ordinal\n"); } else { @@ -454,10 +454,10 @@ static void dump_dir_imported_functions(void) static void dump_dir_debug_dir(IMAGE_DEBUG_DIRECTORY* idd, int idx) { const char* str; - + printf("Directory %02u\n", idx + 1); printf(" Characteristics: %08lX\n", idd->Characteristics); - printf(" TimeDateStamp: %08lX %s\n", + printf(" TimeDateStamp: %08lX %s\n", idd->TimeDateStamp, get_time_str(idd->TimeDateStamp)); printf(" Version %u.%02u\n", idd->MajorVersion, idd->MinorVersion); switch (idd->Type) @@ -479,24 +479,24 @@ static void dump_dir_debug_dir(IMAGE_DEBUG_DIRECTORY* idd, int idx) printf(" SizeOfData: %lu\n", idd->SizeOfData); printf(" AddressOfRawData: %08lX\n", idd->AddressOfRawData); printf(" PointerToRawData: %08lX\n", idd->PointerToRawData); - + switch (idd->Type) { - case IMAGE_DEBUG_TYPE_UNKNOWN: + case IMAGE_DEBUG_TYPE_UNKNOWN: break; - case IMAGE_DEBUG_TYPE_COFF: + case IMAGE_DEBUG_TYPE_COFF: break; case IMAGE_DEBUG_TYPE_CODEVIEW: dump_codeview(idd->PointerToRawData, idd->SizeOfData); break; - case IMAGE_DEBUG_TYPE_FPO: + case IMAGE_DEBUG_TYPE_FPO: break; case IMAGE_DEBUG_TYPE_MISC: { IMAGE_DEBUG_MISC* misc = PRD(idd->PointerToRawData, idd->SizeOfData); if (!misc) {printf("Can't get misc debug information\n"); break;} - printf(" DataType: %lu (%s)\n", - misc->DataType, + printf(" DataType: %lu (%s)\n", + misc->DataType, (misc->DataType == IMAGE_DEBUG_MISC_EXENAME) ? "Exe name" : "Unknown"); printf(" Length: %lu\n", misc->Length); printf(" Unicode: %s\n", misc->Unicode ? "Yes" : "No"); @@ -505,13 +505,13 @@ static void dump_dir_debug_dir(IMAGE_DEBUG_DIRECTORY* idd, int idx) break; case IMAGE_DEBUG_TYPE_EXCEPTION: break; - case IMAGE_DEBUG_TYPE_FIXUP: + case IMAGE_DEBUG_TYPE_FIXUP: break; case IMAGE_DEBUG_TYPE_OMAP_TO_SRC: break; case IMAGE_DEBUG_TYPE_OMAP_FROM_SRC: break; - case IMAGE_DEBUG_TYPE_BORLAND: + case IMAGE_DEBUG_TYPE_BORLAND: break; case IMAGE_DEBUG_TYPE_RESERVED10: break; @@ -523,14 +523,14 @@ static void dump_dir_debug(void) { IMAGE_DEBUG_DIRECTORY* debugDir = get_dir(IMAGE_FILE_DEBUG_DIRECTORY); unsigned nb_dbg, i; - + if (!debugDir) return; - nb_dbg = nt_headers->OptionalHeader.DataDirectory[IMAGE_FILE_DEBUG_DIRECTORY].Size / + nb_dbg = nt_headers->OptionalHeader.DataDirectory[IMAGE_FILE_DEBUG_DIRECTORY].Size / sizeof(*debugDir); if (!nb_dbg) return; - + printf("Debug Table (%u directories)\n", nb_dbg); - + for (i = 0; i < nb_dbg; i++) { dump_dir_debug_dir(debugDir, i); @@ -545,16 +545,16 @@ static void dump_separate_dbg(void) unsigned nb_dbg; unsigned i; IMAGE_DEBUG_DIRECTORY* debugDir; - + if (!separateDebugHead) {printf("Can't grab the separate header, aborting\n"); return;} - - printf ("Signature: %.2s (0x%4X)\n", + + printf ("Signature: %.2s (0x%4X)\n", (char*)&separateDebugHead->Signature, separateDebugHead->Signature); printf ("Flags: 0x%04X\n", separateDebugHead->Flags); - printf ("Machine: 0x%04X (%s)\n", + printf ("Machine: 0x%04X (%s)\n", separateDebugHead->Machine, get_machine_str(separateDebugHead->Machine)); printf ("Characteristics: 0x%04X\n", separateDebugHead->Characteristics); - printf ("TimeDateStamp: 0x%08lX (%s)\n", + printf ("TimeDateStamp: 0x%08lX (%s)\n", separateDebugHead->TimeDateStamp, get_time_str(separateDebugHead->TimeDateStamp)); printf ("CheckSum: 0x%08lX\n", separateDebugHead->CheckSum); printf ("ImageBase: 0x%08lX\n", separateDebugHead->ImageBase); @@ -562,22 +562,22 @@ static void dump_separate_dbg(void) printf ("NumberOfSections: 0x%08lX\n", separateDebugHead->NumberOfSections); printf ("ExportedNamesSize: 0x%08lX\n", separateDebugHead->ExportedNamesSize); printf ("DebugDirectorySize: 0x%08lX\n", separateDebugHead->DebugDirectorySize); - - if (!PRD(sizeof(IMAGE_SEPARATE_DEBUG_HEADER), + + if (!PRD(sizeof(IMAGE_SEPARATE_DEBUG_HEADER), separateDebugHead->NumberOfSections * sizeof(IMAGE_SECTION_HEADER))) {printf("Can't get the sections, aborting\n"); return;} - + dump_sections(separateDebugHead + 1, separateDebugHead->NumberOfSections); - + nb_dbg = separateDebugHead->DebugDirectorySize / sizeof(IMAGE_DEBUG_DIRECTORY); - debugDir = PRD(sizeof(IMAGE_SEPARATE_DEBUG_HEADER) + + debugDir = PRD(sizeof(IMAGE_SEPARATE_DEBUG_HEADER) + separateDebugHead->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) + separateDebugHead->ExportedNamesSize, nb_dbg * sizeof(IMAGE_DEBUG_DIRECTORY)); if (!debugDir) {printf("Couldn't get the debug directory info, aborting\n");return;} - + printf("Debug Table (%u directories)\n", nb_dbg); - + for (i = 0; i < nb_dbg; i++) { dump_dir_debug_dir(debugDir, i); @@ -731,7 +731,7 @@ static void do_dump(void) { dump_pe_header(); /* FIX%E: should check ptr */ - dump_sections((char*)nt_headers + sizeof(DWORD) + + dump_sections((char*)nt_headers + sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER) + nt_headers->FileHeader.SizeOfOptionalHeader, nt_headers->FileHeader.NumberOfSections); } @@ -765,13 +765,13 @@ static enum FileSig check_headers(void) DWORD* pdw; IMAGE_DOS_HEADER* dh; enum FileSig sig; - + pw = PRD(0, sizeof(WORD)); if (!pw) {printf("Can't get main signature, aborting\n"); return 0;} - + switch (*pw) { - case IMAGE_DOS_SIGNATURE: + case IMAGE_DOS_SIGNATURE: sig = SIG_DOS; dh = PRD(0, sizeof(IMAGE_DOS_HEADER)); if (dh && dh->e_lfanew >= sizeof(*dh)) /* reasonable DOS header ? */ @@ -792,7 +792,7 @@ static enum FileSig check_headers(void) } else { - printf("Can't get the extented signature, aborting\n"); + printf("Can't get the extented signature, aborting\n"); } } break; @@ -800,10 +800,10 @@ static enum FileSig check_headers(void) sig = SIG_DBG; break; default: - printf("No known main signature (%.2s/%x), aborting\n", (char*)pw, *pw); + printf("No known main signature (%.2s/%x), aborting\n", (char*)pw, *pw); sig = SIG_UNKNOWN; } - + return sig; } @@ -818,15 +818,15 @@ int pe_analysis(const char* name, void (*fn)(void), enum FileSig wanted_sig) fd = open(name, O_RDONLY); if (fd == -1) fatal("Can't open file"); - + if (fstat(fd, &s) < 0) fatal("Can't get size"); total_len = s.st_size; - + base = mmap(NULL, total_len, PROT_READ, MAP_PRIVATE, fd, 0); if (base == (void*)-1) fatal("Can't map file"); - + effective_sig = check_headers(); - + if (effective_sig == SIG_UNKNOWN) { printf("Can't get a recognized file signature, aborting\n"); @@ -854,11 +854,11 @@ int pe_analysis(const char* name, void (*fn)(void), enum FileSig wanted_sig) printf("Can't get a suitable file signature, aborting\n"); ret = 0; } - + if (ret) printf("Done dumping %s\n", name); munmap(base, total_len); close(fd); - + return ret; } @@ -901,7 +901,7 @@ static void dll_close (void) if (!dll_symbols) { fatal("No symbols"); - } + } for (ds = dll_symbols; ds->symbol; ds++) free(ds->symbol); free (dll_symbols); @@ -918,26 +918,26 @@ static void do_grab_sym(void) WORD* pOrdl; char* ptr; DWORD* map; - + if (!exportDir) return; - + pName = RVA(exportDir->AddressOfNames, exportDir->NumberOfNames * sizeof(DWORD)); if (!pName) {printf("Can't grab functions' name table\n"); return;} pOrdl = RVA(exportDir->AddressOfNameOrdinals, exportDir->NumberOfNames * sizeof(WORD)); if (!pOrdl) {printf("Can't grab functions' ordinal table\n"); return;} - + /* dll_close(); */ - - if (!(dll_symbols = (dll_symbol *) malloc((exportDir->NumberOfFunctions + 1) * + + if (!(dll_symbols = (dll_symbol *) malloc((exportDir->NumberOfFunctions + 1) * sizeof (dll_symbol)))) fatal ("Out of memory"); if (exportDir->AddressOfFunctions != exportDir->NumberOfNames || exportDir->Base > 1) globals.do_ordinals = 1; - + /* bit map of used funcs */ map = calloc(((exportDir->NumberOfFunctions + 31) & ~31) / 32, sizeof(DWORD)); if (!map) fatal("no memory"); - + for (j = 0; j < exportDir->NumberOfNames; j++, pOrdl++) { map[*pOrdl / 32] |= 1 << (*pOrdl % 32); @@ -949,7 +949,7 @@ static void do_grab_sym(void) } pFunc = RVA(exportDir->AddressOfFunctions, exportDir->NumberOfFunctions * sizeof(DWORD)); if (!pFunc) {printf("Can't grab functions' address table\n"); return;} - + for (i = 0; i < exportDir->NumberOfFunctions; i++) { if (pFunc[i] && !(map[i / 32] & (1 << (i % 32)))) @@ -968,15 +968,15 @@ static void do_grab_sym(void) } } free(map); - + if (NORMAL) - printf("%lu named symbols in DLL, %lu total\n", + printf("%lu named symbols in DLL, %lu total\n", exportDir->NumberOfNames, exportDir->NumberOfFunctions); - + qsort( dll_symbols, exportDir->NumberOfFunctions, sizeof(dll_symbol), symbol_cmp ); - + dll_symbols[exportDir->NumberOfFunctions].symbol = NULL; - + dll_current_symbol = dll_symbols; } @@ -999,9 +999,9 @@ int dll_next_symbol (parsed_symbol * sym) { if (!dll_current_symbol->symbol) return 1; - + assert (dll_symbols); - + sym->symbol = strdup (dll_current_symbol->symbol); sym->ordinal = dll_current_symbol->ordinal; dll_current_symbol++; diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h index 58371feb352..8d4dce95a97 100644 --- a/tools/winedump/winedump.h +++ b/tools/winedump/winedump.h @@ -124,7 +124,7 @@ typedef struct __globals /* Option arguments: dump mode */ const char *dumpsect; /* -j */ - + /* internal options */ int do_ordinals; } _globals; diff --git a/tools/wmc/mcl.c b/tools/wmc/mcl.c index 8e584e9b5e6..b0407110ce5 100644 --- a/tools/wmc/mcl.c +++ b/tools/wmc/mcl.c @@ -49,7 +49,7 @@ * sequence to identify the file. * -- FIXME -- * - * + * * Keywords: * Codepages * Facility @@ -669,7 +669,7 @@ int yylex(void) int t = char_table[ch]; if((t & CH_PUNCT) || !(t & CH_SHORTNAME)) break; - + push_unichar(ch); n++; ch = get_unichar(); @@ -716,7 +716,7 @@ int yylex(void) if(isspace(ch)) /* Ignore space */ continue; - + if(isdigit(ch)) return scan_number(ch); } diff --git a/tools/wmc/wmc.h b/tools/wmc/wmc.h index 154be606121..19eee29278a 100644 --- a/tools/wmc/wmc.h +++ b/tools/wmc/wmc.h @@ -33,7 +33,7 @@ #define WMC_RELEASEDATE "(12-Jun-2000)" #define WMC_STRINGIZE(a) #a -#define WMC_VERSIONIZE(a,b,c) WMC_STRINGIZE(a) "." WMC_STRINGIZE(b) "." WMC_STRINGIZE(c) +#define WMC_VERSIONIZE(a,b,c) WMC_STRINGIZE(a) "." WMC_STRINGIZE(b) "." WMC_STRINGIZE(c) #define WMC_VERSION WMC_VERSIONIZE(WMC_MAJOR_VERSION, WMC_MINOR_VERSION, WMC_MICRO_VERSION) #define WMC_FULLVERSION WMC_VERSION " " WMC_RELEASEDATE @@ -62,7 +62,7 @@ extern int rcinline; extern char *output_name; extern char *input_name; extern char *header_name; -extern char *cmdline; +extern char *cmdline; extern time_t now; extern int line_number; diff --git a/tools/wmc/write.c b/tools/wmc/write.c index b04d5eee249..4c16cddf31b 100644 --- a/tools/wmc/write.c +++ b/tools/wmc/write.c @@ -443,7 +443,7 @@ static void write_rcinline(FILE *fp) for(lbp = lanblockhead; lbp; lbp = lbp->next) { - unsigned offs = 4 * (lbp->nblk * 3 + 1); + unsigned offs = 4 * (lbp->nblk * 3 + 1); fprintf(fp, "\n1 MESSAGETABLE\n"); fprintf(fp, "LANGUAGE 0x%x, 0x%x\n", lbp->lan & 0x3ff, lbp->lan >> 10); fprintf(fp, "{\n"); diff --git a/tools/wrc/dumpres.c b/tools/wrc/dumpres.c index 3ff81373441..0a9f8b515f7 100644 --- a/tools/wrc/dumpres.c +++ b/tools/wrc/dumpres.c @@ -242,7 +242,7 @@ static void dump_raw_data(raw_data_t *d) for(n = 0; n < d->size; n++) { - if((n % 16) == 0) + if((n % 16) == 0) { if(n) { @@ -579,7 +579,7 @@ static void dump_dialog(dialog_t *dlg) assert(dlg->style != NULL); assert(dlg->style->and_mask == 0); printf("Style: %08lx\n", dlg->style->or_mask); - + } if(dlg->gotexstyle) { @@ -909,7 +909,7 @@ static void dump_toolbar_items(toolbar_item_t *items) printf(" SEPARATOR"); printf("\n"); - + items = items->next; } } diff --git a/tools/wrc/genres.c b/tools/wrc/genres.c index 9e4eaa555d5..ca5b4ef2d36 100644 --- a/tools/wrc/genres.c +++ b/tools/wrc/genres.c @@ -22,7 +22,7 @@ * extra functions also aid unaligned access, but * this is not yet implemented. * 25-May-1998 BS - Added simple unicode -> char conversion for resource - * names in .s and .h files. + * names in .s and .h files. */ #include "config.h" @@ -723,7 +723,7 @@ static res_t *dialog2res(name_id_t *name, dialog_t *dlg) /* FIXME: What is this extra byte doing here? */ put_byte(res, 0); - + nctrl++; ctrl = ctrl->next; } @@ -1742,7 +1742,7 @@ static res_t *toolbar2res(name_id_t *name, toolbar_t *toolbar) put_word(res, 1); /* Menuheader: Version */ put_word(res, toolbar->button_width); /* (in pixels?) */ put_word(res, toolbar->button_height); /* (in pixels?) */ - put_word(res, toolbar->nitems); + put_word(res, toolbar->nitems); put_pad(res); toolbaritem2res(res, toolbar->items); /* Set ResourceSize */ diff --git a/tools/wrc/newstruc.c b/tools/wrc/newstruc.c index f9991fd508c..63d55ebdc70 100644 --- a/tools/wrc/newstruc.c +++ b/tools/wrc/newstruc.c @@ -722,7 +722,7 @@ static void handle_ani_icon(riff_tag_t *rtp, enum res_e type, int isswapped) static void handle_ani_list(riff_tag_t *lst, enum res_e type, int isswapped) { riff_tag_t *rtp = lst+1; /* Skip the "LIST" tag */ - + while((char *)rtp < (char *)lst + lst->size + sizeof(*lst)) { if(!memcmp(rtp->tag, info, sizeof(info))) @@ -998,7 +998,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) yyerror("Message 0x%08lx is unicode (block %d), but has odd length (%d)", id, (int)i, mep->length); for(n = 0; n < l; n++) wp[n] = BYTESWAP_WORD(wp[n]); - + } next_mep = (msgtab_entry_t *)(((char *)mep) + mep->length); mep->length = BYTESWAP_WORD(mep->length); @@ -1051,7 +1051,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt) yyerror("Message 0x%08lx is unicode (block %d), but has odd length (%d)", id, (int)i, mep->length); for(n = 0; n < l; n++) wp[n] = BYTESWAP_WORD(wp[n]); - + } mep = (msgtab_entry_t *)(((char *)mep) + mep->length); } diff --git a/tools/wrc/utils.c b/tools/wrc/utils.c index a475e891cb2..d8db7a6fac6 100644 --- a/tools/wrc/utils.c +++ b/tools/wrc/utils.c @@ -315,7 +315,7 @@ string_t *convert_string(const string_t *str, enum str_e type) ret->size = strlenW(str->str.wstr); ret->str.wstr = xmalloc(sizeof(WCHAR)*(ret->size+1)); strcpyW(ret->str.wstr, str->str.wstr); - } + } else /* str->type == str_char */ { ret->type = str_char; diff --git a/tools/wrc/wrc.h b/tools/wrc/wrc.h index 15aa70d38db..de19d526385 100644 --- a/tools/wrc/wrc.h +++ b/tools/wrc/wrc.h @@ -34,7 +34,7 @@ #define WRC_STRINGIZE(a) #a #define WRC_EXP_STRINGIZE(a) WRC_STRINGIZE(a) -#define WRC_VERSIONIZE(a,b,c) WRC_STRINGIZE(a) "." WRC_STRINGIZE(b) "." WRC_STRINGIZE(c) +#define WRC_VERSIONIZE(a,b,c) WRC_STRINGIZE(a) "." WRC_STRINGIZE(b) "." WRC_STRINGIZE(c) #define WRC_VERSION WRC_VERSIONIZE(WRC_MAJOR_VERSION, WRC_MINOR_VERSION, WRC_MICRO_VERSION) #define WRC_FULLVERSION WRC_VERSION " " WRC_RELEASEDATE @@ -74,7 +74,7 @@ extern char *prefix; extern char *output_name; extern char *input_name; extern char *header_name; -extern char *cmdline; +extern char *cmdline; extern time_t now; extern int line_number; diff --git a/tools/wrc/wrctypes.h b/tools/wrc/wrctypes.h index fd54507e3c4..b78c54e630e 100644 --- a/tools/wrc/wrctypes.h +++ b/tools/wrc/wrctypes.h @@ -59,7 +59,7 @@ #define WRC_RT_ANIICON (22) #define WRC_RT_HTML (23) #define WRC_RT_DLGINIT (240) -#define WRC_RT_TOOLBAR (241) +#define WRC_RT_TOOLBAR (241) /* Default class type IDs */ #define CT_BUTTON 0x80 @@ -571,7 +571,7 @@ typedef struct accelerator { /* Toolbar structures */ typedef struct toolbar_item { struct toolbar_item *next; - struct toolbar_item *prev; + struct toolbar_item *prev; int id; } toolbar_item_t; diff --git a/tools/wrc/writeres.c b/tools/wrc/writeres.c index ae91caa48b8..0c7ed0a4f1f 100644 --- a/tools/wrc/writeres.c +++ b/tools/wrc/writeres.c @@ -99,7 +99,7 @@ char _ResTable[] = "_ResTable"; /* Variables used for resource sorting */ res_count_t *rcarray = NULL; /* Type-level count array */ int rccount = 0; /* Nr of entries in the type-level array */ -int n_id_entries = 0; /* win32 only: Nr of unique ids in the type-level array */ +int n_id_entries = 0; /* win32 only: Nr of unique ids in the type-level array */ int n_name_entries = 0; /* win32 only: Nr of unique namess in the type-level array */ static int direntries; /* win32 only: Total number of unique resources */ @@ -813,7 +813,7 @@ static void write_ne_segment(FILE *fp) static void write_rsc_names(FILE *fp) { int i, j; - + if(win32) { /* Write the names */ @@ -873,7 +873,7 @@ static void write_rsc_names(FILE *fp) } } /* EndNames */ - + /* This is to end the NE resource table */ if(create_dir) fprintf(fp, "\t.byte\t0\n"); @@ -932,7 +932,7 @@ void write_s_file(char *outname, resource_t *top) if(create_dir) fprintf(fo, ".LResTabEnd:\n"); - + if(!indirect_only) { /* Write the resource data */ diff --git a/win32/console.c b/win32/console.c index a0bb0fa79f7..1c218894285 100644 --- a/win32/console.c +++ b/win32/console.c @@ -90,7 +90,7 @@ static BOOL start_console_renderer(void) attr.ObjectName = NULL; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - + NtCreateEvent(&hEvent, EVENT_ALL_ACCESS, &attr, TRUE, FALSE); if (!hEvent) return FALSE; @@ -115,10 +115,10 @@ static BOOL start_console_renderer(void) goto the_end; - succeed: + succeed: if (WaitForSingleObject(hEvent, INFINITE) != WAIT_OBJECT_0) goto the_end; CloseHandle(hEvent); - + TRACE("Started wineconsole pid=%08lx tid=%08lx\n", pi.dwProcessId, pi.dwThreadId); return TRUE; @@ -143,7 +143,7 @@ BOOL WINAPI AllocConsole(void) TRACE("()\n"); - handle_in = CreateFileA( "CONIN$", GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE, + handle_in = CreateFileA( "CONIN$", GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE, 0, NULL, OPEN_EXISTING, 0, 0 ); if (handle_in != INVALID_HANDLE_VALUE) @@ -156,18 +156,18 @@ BOOL WINAPI AllocConsole(void) if (!start_console_renderer()) goto the_end; - handle_in = CreateFileA( "CONIN$", GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE, + handle_in = CreateFileA( "CONIN$", GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE, 0, NULL, OPEN_EXISTING, 0, 0 ); if (handle_in == INVALID_HANDLE_VALUE) goto the_end; - handle_out = CreateFileA( "CONOUT$", GENERIC_READ|GENERIC_WRITE, + handle_out = CreateFileA( "CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); if (handle_out == INVALID_HANDLE_VALUE) goto the_end; if (!DuplicateHandle(GetCurrentProcess(), handle_out, GetCurrentProcess(), &handle_err, 0, TRUE, DUPLICATE_SAME_ACCESS)) goto the_end; - + /* NT resets the STD_*_HANDLEs on console alloc */ SetStdHandle(STD_INPUT_HANDLE, handle_in); SetStdHandle(STD_OUTPUT_HANDLE, handle_out); @@ -269,13 +269,13 @@ BOOL WINAPI ReadConsoleW(HANDLE hConsoleInput, LPVOID lpBuffer, DWORD charsread; LPWSTR xbuf = (LPWSTR)lpBuffer; DWORD mode; - + TRACE("(%d,%p,%ld,%p,%p)\n", hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, lpReserved); - + if (!GetConsoleMode(hConsoleInput, &mode)) return FALSE; - + if (mode & ENABLE_LINE_INPUT) { if (!S_EditString || S_EditString[S_EditStrPos] == 0) @@ -294,7 +294,7 @@ BOOL WINAPI ReadConsoleW(HANDLE hConsoleInput, LPVOID lpBuffer, { INPUT_RECORD ir; DWORD count; - + /* FIXME: should we read at least 1 char? The SDK does not say */ /* wait for at least one available input record (it doesn't mean we'll have * chars stored in xbuf... @@ -325,13 +325,13 @@ BOOL WINAPI ReadConsoleInputW(HANDLE hConsoleInput, LPINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead) { DWORD count; - + if (!nLength) { if (lpNumberOfEventsRead) *lpNumberOfEventsRead = 0; return TRUE; } - + /* loop until we get at least one event */ for (;;) { @@ -361,7 +361,7 @@ BOOL WINAPI ReadConsoleInputW(HANDLE hConsoleInput, LPINPUT_RECORD lpBuffer, * RETURNS * Success: TRUE * Failure: FALSE - * + * */ BOOL WINAPI WriteConsoleOutputCharacterW( HANDLE hConsoleOutput, LPCWSTR str, DWORD length, COORD coord, LPDWORD lpNumCharsWritten ) @@ -427,7 +427,7 @@ BOOL WINAPI GetNumberOfConsoleMouseButtons(LPDWORD nrofbuttons) /****************************************************************************** * SetConsoleInputExeNameW [KERNEL32.@] - * + * * BUGS * Unimplemented */ @@ -441,7 +441,7 @@ BOOL WINAPI SetConsoleInputExeNameW(LPCWSTR name) /****************************************************************************** * SetConsoleInputExeNameA [KERNEL32.@] - * + * * BUGS * Unimplemented */ @@ -494,9 +494,9 @@ static PHANDLER_ROUTINE handlers[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,CONSOLE_Defa BOOL WINAPI SetConsoleCtrlHandler(PHANDLER_ROUTINE func, BOOL add) { int alloc_loop = sizeof(handlers)/sizeof(handlers[0]) - 1; - + FIXME("(%p,%i) - no error checking or testing yet\n", func, add); - + if (!func) { console_ignore_ctrl_c = add; @@ -565,9 +565,9 @@ BOOL WINAPI GenerateConsoleCtrlEvent(DWORD dwCtrlEvent, if (dwProcessGroupID == GetCurrentProcessId() || dwProcessGroupID == 0) { int i; - + FIXME("Attempt to send event %ld to self groupID, doing locally only\n", dwCtrlEvent); - + /* this is only meaningfull when done locally, otherwise it will have to be done on * the 'receive' side of the event generation */ @@ -616,21 +616,21 @@ BOOL WINAPI GenerateConsoleCtrlEvent(DWORD dwCtrlEvent, * Success: Handle to new console screen buffer * Failure: INVALID_HANDLE_VALUE */ -HANDLE WINAPI CreateConsoleScreenBuffer(DWORD dwDesiredAccess, DWORD dwShareMode, - LPSECURITY_ATTRIBUTES sa, DWORD dwFlags, +HANDLE WINAPI CreateConsoleScreenBuffer(DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES sa, DWORD dwFlags, LPVOID lpScreenBufferData) { HANDLE ret = INVALID_HANDLE_VALUE; - - TRACE("(%ld,%ld,%p,%ld,%p)\n", + + TRACE("(%ld,%ld,%p,%ld,%p)\n", dwDesiredAccess, dwShareMode, sa, dwFlags, lpScreenBufferData); - + if (dwFlags != CONSOLE_TEXTMODE_BUFFER || lpScreenBufferData != NULL) { SetLastError(ERROR_INVALID_PARAMETER); return INVALID_HANDLE_VALUE; } - + SERVER_START_REQ(create_console_output) { req->handle_in = 0; @@ -640,7 +640,7 @@ HANDLE WINAPI CreateConsoleScreenBuffer(DWORD dwDesiredAccess, DWORD dwShareMode if (!wine_server_call_err( req )) ret = reply->handle_out; } SERVER_END_REQ; - + return ret; } @@ -707,7 +707,7 @@ BOOL WINAPI SetConsoleActiveScreenBuffer(HANDLE hConsoleOutput) BOOL WINAPI GetConsoleMode(HANDLE hcon, LPDWORD mode) { BOOL ret; - + SERVER_START_REQ(get_console_mode) { req->handle = hcon; @@ -733,9 +733,9 @@ BOOL WINAPI GetConsoleMode(HANDLE hcon, LPDWORD mode) BOOL WINAPI SetConsoleMode(HANDLE hcon, DWORD mode) { BOOL ret; - + TRACE("(%x,%lx)\n", hcon, mode); - + SERVER_START_REQ(set_console_mode) { req->handle = hcon; @@ -785,7 +785,7 @@ static int write_char(HANDLE hCon, LPCWSTR lpBuffer, int nc, COORD* pos) */ static int next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi) { - SMALL_RECT src; + SMALL_RECT src; CHAR_INFO ci; COORD dst; @@ -794,17 +794,17 @@ static int next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi) if (csbi->dwCursorPosition.Y < csbi->dwSize.Y) return 1; - src.Top = 1; - src.Bottom = csbi->dwSize.Y - 1; - src.Left = 0; - src.Right = csbi->dwSize.X - 1; - - dst.X = 0; + src.Top = 1; + src.Bottom = csbi->dwSize.Y - 1; + src.Left = 0; + src.Right = csbi->dwSize.X - 1; + + dst.X = 0; dst.Y = 0; - + ci.Attributes = csbi->wAttributes; - ci.Char.UnicodeChar = ' '; - + ci.Char.UnicodeChar = ' '; + csbi->dwCursorPosition.Y--; if (!ScrollConsoleScreenBufferW(hCon, &src, NULL, dst, &ci)) return 0; @@ -849,7 +849,7 @@ static int write_block(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi, if (blk < len) { csbi->dwCursorPosition.X = csbi->dwSize.X - 1; - /* all remaining chars should be written on last column, + /* all remaining chars should be written on last column, * so only overwrite the last column with last char in block */ if (write_char(hCon, ptr + len - 1, 1, &csbi->dwCursorPosition) != 1) @@ -859,7 +859,7 @@ static int write_block(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi, } return 1; -} +} /*********************************************************************** * WriteConsoleW (KERNEL32.@) @@ -872,21 +872,21 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber WCHAR* psz = (WCHAR*)lpBuffer; CONSOLE_SCREEN_BUFFER_INFO csbi; int k, first = 0; - - TRACE("%d %s %ld %p %p\n", + + TRACE("%d %s %ld %p %p\n", hConsoleOutput, debugstr_wn(lpBuffer, nNumberOfCharsToWrite), nNumberOfCharsToWrite, lpNumberOfCharsWritten, lpReserved); - + if (lpNumberOfCharsWritten) *lpNumberOfCharsWritten = 0; - - if (!GetConsoleMode(hConsoleOutput, &mode) || + + if (!GetConsoleMode(hConsoleOutput, &mode) || !GetConsoleScreenBufferInfo(hConsoleOutput, &csbi)) return FALSE; - + if (mode & ENABLE_PROCESSED_OUTPUT) { int i; - + for (i = 0; i < nNumberOfCharsToWrite; i++) { switch (psz[i]) @@ -910,8 +910,8 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber case '\t': { WCHAR tmp[8] = {' ',' ',' ',' ',' ',' ',' ',' '}; - - if (!write_block(hConsoleOutput, &csbi, mode, tmp, + + if (!write_block(hConsoleOutput, &csbi, mode, tmp, ((csbi.dwCursorPosition.X + 8) & ~7) - csbi.dwCursorPosition.X)) goto the_end; } @@ -921,7 +921,7 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber break; case '\a': Beep(400, 300); - break; + break; case '\r': csbi.dwCursorPosition.X = 0; break; @@ -930,7 +930,7 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber } } } - + /* write the remaining block (if any) if processed output is enabled, or the * entire buffer otherwise */ @@ -940,7 +940,7 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber goto the_end; nw += k; } - + the_end: SetConsoleCursorPosition(hConsoleOutput, csbi.dwCursorPosition); if (lpNumberOfCharsWritten) *lpNumberOfCharsWritten = nw; @@ -957,19 +957,19 @@ BOOL WINAPI WriteConsoleA(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber BOOL ret; LPWSTR xstring; DWORD n; - + n = MultiByteToWideChar(CP_ACP, 0, lpBuffer, nNumberOfCharsToWrite, NULL, 0); - + if (lpNumberOfCharsWritten) *lpNumberOfCharsWritten = 0; xstring = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR)); if (!xstring) return 0; - + MultiByteToWideChar(CP_ACP, 0, lpBuffer, nNumberOfCharsToWrite, xstring, n); - + ret = WriteConsoleW(hConsoleOutput, xstring, n, lpNumberOfCharsWritten, 0); - + HeapFree(GetProcessHeap(), 0, xstring); - + return ret; } @@ -1012,7 +1012,7 @@ BOOL WINAPI SetConsoleCursorPosition(HANDLE hcon, COORD pos) { csbi.srWindow.Left = min(pos.X, csbi.dwSize.X - w); do_move++; - } + } else if (pos.X > csbi.srWindow.Right) { csbi.srWindow.Left = max(pos.X, w) - w + 1; @@ -1163,7 +1163,7 @@ BOOL WINAPI SetConsoleTextAttribute(HANDLE hConsoleOutput, WORD wAttr) /****************************************************************************** - * SetConsoleScreenBufferSize [KERNEL32.@] Changes size of console + * SetConsoleScreenBufferSize [KERNEL32.@] Changes size of console * * PARAMS * hConsoleOutput [I] Handle to console screen buffer @@ -1192,18 +1192,18 @@ BOOL WINAPI SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize) /****************************************************************************** * ScrollConsoleScreenBufferA [KERNEL32.@] - * + * */ -BOOL WINAPI ScrollConsoleScreenBufferA(HANDLE hConsoleOutput, LPSMALL_RECT lpScrollRect, - LPSMALL_RECT lpClipRect, COORD dwDestOrigin, +BOOL WINAPI ScrollConsoleScreenBufferA(HANDLE hConsoleOutput, LPSMALL_RECT lpScrollRect, + LPSMALL_RECT lpClipRect, COORD dwDestOrigin, LPCHAR_INFO lpFill) { CHAR_INFO ciw; - + ciw.Attributes = lpFill->Attributes; MultiByteToWideChar(CP_ACP, 0, &lpFill->Char.AsciiChar, 1, &ciw.Char.UnicodeChar, 1); - - return ScrollConsoleScreenBufferW(hConsoleOutput, lpScrollRect, lpClipRect, + + return ScrollConsoleScreenBufferW(hConsoleOutput, lpScrollRect, lpClipRect, dwDestOrigin, &ciw); } @@ -1232,11 +1232,11 @@ static void fill_line_uniform(HANDLE hConsoleOutput, int i, int j, int len, LPCH /****************************************************************************** * ScrollConsoleScreenBufferW [KERNEL32.@] - * + * */ -BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE hConsoleOutput, LPSMALL_RECT lpScrollRect, - LPSMALL_RECT lpClipRect, COORD dwDestOrigin, +BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE hConsoleOutput, LPSMALL_RECT lpScrollRect, + LPSMALL_RECT lpClipRect, COORD dwDestOrigin, LPCHAR_INFO lpFill) { SMALL_RECT dst; @@ -1246,20 +1246,20 @@ BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE hConsoleOutput, LPSMALL_RECT lpScr SMALL_RECT clip; CONSOLE_SCREEN_BUFFER_INFO csbi; BOOL inside; - + if (lpClipRect) - TRACE("(%d,(%d,%d-%d,%d),(%d,%d-%d,%d),%d-%d,%p)\n", hConsoleOutput, + TRACE("(%d,(%d,%d-%d,%d),(%d,%d-%d,%d),%d-%d,%p)\n", hConsoleOutput, lpScrollRect->Left, lpScrollRect->Top, lpScrollRect->Right, lpScrollRect->Bottom, lpClipRect->Left, lpClipRect->Top, lpClipRect->Right, lpClipRect->Bottom, dwDestOrigin.X, dwDestOrigin.Y, lpFill); else - TRACE("(%d,(%d,%d-%d,%d),(nil),%d-%d,%p)\n", hConsoleOutput, + TRACE("(%d,(%d,%d-%d,%d),(nil),%d-%d,%p)\n", hConsoleOutput, lpScrollRect->Left, lpScrollRect->Top, lpScrollRect->Right, lpScrollRect->Bottom, dwDestOrigin.X, dwDestOrigin.Y, lpFill); - + if (!GetConsoleScreenBufferInfo(hConsoleOutput, &csbi)) return FALSE; @@ -1268,7 +1268,7 @@ BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE hConsoleOutput, LPSMALL_RECT lpScr dst.Top = dwDestOrigin.Y; dst.Right = dst.Left + (lpScrollRect->Right - lpScrollRect->Left); dst.Bottom = dst.Top + (lpScrollRect->Bottom - lpScrollRect->Top); - + /* step 2a: compute the final clip rect (optional passed clip and screen buffer limits */ if (lpClipRect) { @@ -1291,7 +1291,7 @@ BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE hConsoleOutput, LPSMALL_RECT lpScr if (dst.Top < clip.Top ) dst.Top = clip.Top; if (dst.Right > clip.Right ) dst.Right = clip.Right; if (dst.Bottom > clip.Bottom) dst.Bottom = clip.Bottom; - + /* step 3: transfer the bits */ SERVER_START_REQ(move_console_output) { diff --git a/win32/device.c b/win32/device.c index 2ddc90798a9..662f3ab4186 100644 --- a/win32/device.c +++ b/win32/device.c @@ -56,17 +56,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(file); -static BOOL DeviceIo_VTDAPI(DWORD dwIoControlCode, +static BOOL DeviceIo_VTDAPI(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPOVERLAPPED lpOverlapped); -static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode, +static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPOVERLAPPED lpOverlapped); -static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode, +static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, @@ -74,13 +74,13 @@ static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode, static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ); -static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, +static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPOVERLAPPED lpOverlapped); -static BOOL DeviceIo_VCD(DWORD dwIoControlCode, +static BOOL DeviceIo_VCD(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, @@ -88,19 +88,19 @@ static BOOL DeviceIo_VCD(DWORD dwIoControlCode, static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context ); -static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, +static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPOVERLAPPED lpOverlapped); -static BOOL DeviceIo_PCCARD (DWORD dwIoControlCode, +static BOOL DeviceIo_PCCARD (DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, LPOVERLAPPED lpOverlapped); -static BOOL DeviceIo_HASP (DWORD dwIoControlCode, +static BOOL DeviceIo_HASP (DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, @@ -114,11 +114,11 @@ struct VxDInfo LPCSTR name; WORD id; DWORD (*vxdcall)(DWORD, CONTEXT86 *); - BOOL (*deviceio)(DWORD, LPVOID, DWORD, + BOOL (*deviceio)(DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPOVERLAPPED); }; -static const struct VxDInfo VxDList[] = +static const struct VxDInfo VxDList[] = { /* Standard VxD IDs */ { "VMM", 0x0001, VxDCall_VMM, NULL }, @@ -262,7 +262,7 @@ static const struct VxDInfo VxDList[] = #define N_VMM_SERVICE 41 LPCSTR VMM_Service_Name[N_VMM_SERVICE] = -{ +{ "PageReserve", /* 0x0000 */ "PageCommit", /* 0x0001 */ "PageDecommit", /* 0x0002 */ @@ -372,7 +372,7 @@ static DWORD DEVICE_GetClientID( HANDLE handle ) static const struct VxDInfo *DEVICE_GetInfo( DWORD clientID ) { const struct VxDInfo *info = NULL; - + if (clientID & 0x10000) { for (info = VxDList; info->name; info++) @@ -390,7 +390,7 @@ static const struct VxDInfo *DEVICE_GetInfo( DWORD clientID ) * A return value of FALSE indicates that something has gone wrong which * GetLastError can decipher. */ -BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, +BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, @@ -418,14 +418,14 @@ BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, } else if ( info->deviceio ) { - return info->deviceio( dwIoControlCode, - lpvInBuffer, cbInBuffer, - lpvOutBuffer, cbOutBuffer, + return info->deviceio( dwIoControlCode, + lpvInBuffer, cbInBuffer, + lpvOutBuffer, cbOutBuffer, lpcbBytesReturned, lpOverlapped ); } else { - FIXME( "Unimplemented control %ld for VxD device %s\n", + FIXME( "Unimplemented control %ld for VxD device %s\n", dwIoControlCode, info->name ? info->name : "???" ); /* FIXME: this is for invalid calls on W98SE, * but maybe we should use ERROR_CALL_NOT_IMPLEMENTED @@ -489,7 +489,7 @@ BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, } return FALSE; } - + /*********************************************************************** * DeviceIo_VTDAPI */ @@ -634,7 +634,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) LPDWORD lpdwType = (LPDWORD)stack32_pop( context ); LPBYTE lpbData = (LPBYTE) stack32_pop( context ); LPDWORD lpcbData = (LPDWORD)stack32_pop( context ); - return RegEnumValueA( hkey, iValue, lpszValue, lpcchValue, + return RegEnumValueA( hkey, iValue, lpszValue, lpcchValue, lpReserved, lpdwType, lpbData, lpcbData ); } @@ -646,7 +646,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) LPDWORD lpdwType = (LPDWORD)stack32_pop( context ); LPBYTE lpbData = (LPBYTE) stack32_pop( context ); LPDWORD lpcbData = (LPDWORD)stack32_pop( context ); - return RegQueryValueExA( hkey, lpszValue, lpReserved, + return RegQueryValueExA( hkey, lpszValue, lpReserved, lpdwType, lpbData, lpcbData ); } @@ -658,7 +658,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) DWORD dwType = (DWORD) stack32_pop( context ); LPBYTE lpbData = (LPBYTE)stack32_pop( context ); DWORD cbData = (DWORD) stack32_pop( context ); - return RegSetValueExA( hkey, lpszValue, dwReserved, + return RegSetValueExA( hkey, lpszValue, dwReserved, dwType, lpbData, cbData ); } @@ -741,7 +741,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) address-spaces we now have */ if ( page == PR_PRIVATE || page == PR_SHARED ) page = 0; /* FIXME: Handle flags in some way */ - address = (LPVOID )(page * psize); + address = (LPVOID )(page * psize); ret = VirtualAlloc ( address, ( npages * psize ), MEM_RESERVE, 0 ); TRACE("PageReserve: returning: %08lx\n", (DWORD )ret ); if ( ret == NULL ) @@ -765,7 +765,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) TRACE("PageCommit: page: %08lx, npages: %08lx, hpd: %08lx pagerdata: " "%08lx, flags: %08lx partial stub\n", page, npages, hpd, pagerdata, flags ); - + if ( flags & PC_USER ) if ( flags & PC_WRITEABLE ) virt_perm = PAGE_EXECUTE_READWRITE; @@ -774,7 +774,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) else virt_perm = PAGE_NOACCESS; - address = (LPVOID )(page * psize); + address = (LPVOID )(page * psize); ret = VirtualAlloc ( address, ( npages * psize ), MEM_COMMIT, virt_perm ); TRACE("PageCommit: Returning: %08lx\n", (DWORD )ret ); return (DWORD )ret; @@ -792,12 +792,12 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) TRACE("PageDecommit: page: %08lx, npages: %08lx, flags: %08lx partial stub\n", page, npages, flags ); address = (LPVOID )( page * psize ); - ret = VirtualFree ( address, ( npages * psize ), MEM_DECOMMIT ); + ret = VirtualFree ( address, ( npages * psize ), MEM_DECOMMIT ); TRACE("PageDecommit: Returning: %s\n", ret ? "TRUE" : "FALSE" ); return ret; } case 0x000d: /* PageModifyPermissions */ - { + { DWORD pg_old_perm; DWORD pg_new_perm; DWORD virt_old_perm; @@ -828,12 +828,12 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) case PAGE_EXECUTE_READWRITE: case PAGE_EXECUTE_WRITECOPY: pg_old_perm = PC_USER | PC_WRITEABLE; - break; + break; case PAGE_NOACCESS: default: pg_old_perm = 0; break; - } + } pg_new_perm = pg_old_perm; pg_new_perm &= permand & ~PC_STATIC; pg_new_perm |= permor & ~PC_STATIC; @@ -846,7 +846,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) else virt_new_perm |= PAGE_EXECUTE_READ; } - + if ( ! VirtualProtect ( address, ( npages * psize ), virt_new_perm, &virt_old_perm ) ) { ERR("Can't change page permissions for %08lx\n", (DWORD )address ); return 0xffffffff; @@ -859,7 +859,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) BOOL ret; LPVOID hmem = (LPVOID) stack32_pop( context ); DWORD flags = (DWORD ) stack32_pop( context ); - + TRACE("PageFree: hmem: %08lx, flags: %08lx partial stub\n", (DWORD )hmem, flags ); @@ -872,7 +872,7 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) case 0x001e: /* GetDemandPageInfo */ { DWORD dinfo = (DWORD)stack32_pop( context ); - DWORD flags = (DWORD)stack32_pop( context ); + DWORD flags = (DWORD)stack32_pop( context ); /* GetDemandPageInfo is supposed to fill out the struct at * "dinfo" with various low-level memory management information. @@ -903,10 +903,10 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) * NOTES * These ioctls are used by 'MSNET32.DLL'. * - * I have been unable to uncover any documentation about the ioctls so + * I have been unable to uncover any documentation about the ioctls so * the implementation of the cases IFS_IOCTL_21 and IFS_IOCTL_2F are * based on reasonable guesses on information found in the Windows 95 DDK. - * + * */ /* @@ -920,13 +920,13 @@ static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context ) struct win32apireq { unsigned long ar_proid; - unsigned long ar_eax; - unsigned long ar_ebx; - unsigned long ar_ecx; - unsigned long ar_edx; - unsigned long ar_esi; + unsigned long ar_eax; + unsigned long ar_ebx; + unsigned long ar_ecx; + unsigned long ar_edx; + unsigned long ar_esi; unsigned long ar_edi; - unsigned long ar_ebp; + unsigned long ar_ebp; unsigned short ar_error; unsigned short ar_pad; }; @@ -1000,8 +1000,8 @@ static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbI pIn->ar_proid, pIn->ar_eax, pIn->ar_ebx, pIn->ar_ecx, pIn->ar_edx, pIn->ar_esi, pIn->ar_edi, pIn->ar_ebp, pIn->ar_error, pIn->ar_pad - ); - + ); + win32apieq_2_CONTEXT(pIn,&cxt); if(dwIoControlCode==IFS_IOCTL_21) @@ -1010,9 +1010,9 @@ static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbI } else { INT_Int2fHandler(&cxt); /* Call int 2Fh */ } - + CONTEXT_2_win32apieq(&cxt,pOut); - + retv = TRUE; } break; case IFS_IOCTL_GET_RES:{ @@ -1022,7 +1022,7 @@ static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbI case IFS_IOCTL_GET_NETPRO_NAME_A:{ FIXME( "Control 'IFS_IOCTL_GET_NETPRO_NAME_A' not implemented\n"); retv = FALSE; - } break; + } break; default: FIXME( "Control %ld not implemented\n", dwIoControlCode); retv = FALSE; @@ -1068,11 +1068,11 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context ) { DWORD callnum = (DWORD) stack32_pop(context); DWORD parm = (DWORD) stack32_pop(context); - + TRACE("Int31/DPMI dispatch(%08lx)\n", callnum); AX_reg(context) = callnum; - CX_reg(context) = parm; + CX_reg(context) = parm; INT_Int31Handler(context); return LOWORD(context->Eax); @@ -1094,12 +1094,12 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context ) return 0xffffffff; } - + /*********************************************************************** * DeviceIo_VCD */ -static BOOL DeviceIo_VCD(DWORD dwIoControlCode, +static BOOL DeviceIo_VCD(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, @@ -1125,7 +1125,7 @@ static BOOL DeviceIo_VCD(DWORD dwIoControlCode, return retv; } - + /*********************************************************************** * DeviceIo_VWin32 */ @@ -1386,7 +1386,7 @@ static VOID VWIN32_Int13Handler( DIOC_REGISTERS *regs) } } -static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, +static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, @@ -1422,7 +1422,7 @@ static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, "edx=0x%08lx, esi=0x%08lx, edi=0x%08lx \n", (dwIoControlCode == VWIN32_DIOC_DOS_IOCTL)? "VWIN32_DIOC_DOS_IOCTL" : (dwIoControlCode == VWIN32_DIOC_DOS_INT25)? "VWIN32_DIOC_DOS_INT25" : - (dwIoControlCode == VWIN32_DIOC_DOS_INT26)? "VWIN32_DIOC_DOS_INT26" : + (dwIoControlCode == VWIN32_DIOC_DOS_INT26)? "VWIN32_DIOC_DOS_INT26" : (dwIoControlCode == VWIN32_DIOC_DOS_DRIVEINFO)? "VWIN32_DIOC_DOS_DRIVEINFO" : "???", pIn->reg_EAX, pIn->reg_EBX, pIn->reg_ECX, pIn->reg_EDX, pIn->reg_ESI, pIn->reg_EDI ); @@ -1461,7 +1461,7 @@ static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, } /* this is the main multimedia device loader */ -static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode, +static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, @@ -1484,7 +1484,7 @@ static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode, return FALSE; } /* this is used by some Origin games */ -static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode, +static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, @@ -1510,7 +1510,7 @@ static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode, return TRUE; } /* pccard */ -static BOOL DeviceIo_PCCARD (DWORD dwIoControlCode, +static BOOL DeviceIo_PCCARD (DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned, diff --git a/win32/editline.c b/win32/editline.c index a96e6ab54fb..33d4c3cc2e7 100644 --- a/win32/editline.c +++ b/win32/editline.c @@ -39,13 +39,13 @@ extern unsigned int CONSOLE_GetNumHistoryEntries(void); struct WCEL_Context; -typedef struct +typedef struct { WCHAR val; /* vk or unicode char */ void (*func)(struct WCEL_Context* ctx); } KeyEntry; -typedef struct +typedef struct { DWORD keyState; /* keyState (from INPUT_RECORD) to match */ BOOL chkChar; /* check vk or char */ @@ -73,9 +73,9 @@ typedef struct WCEL_Context { static void WCEL_Dump(WCEL_Context* ctx, const char* pfx) { MESSAGE("%s: [line=%s[alloc=%u] ofs=%u len=%u start=(%d,%d) mask=%c%c\n" - "\t\thist=(size=%u pos=%u curr=%s)\n", - pfx, debugstr_w(ctx->line), ctx->alloc, ctx->ofs, ctx->len, - ctx->csbi.dwCursorPosition.X, ctx->csbi.dwCursorPosition.Y, + "\t\thist=(size=%u pos=%u curr=%s)\n", + pfx, debugstr_w(ctx->line), ctx->alloc, ctx->ofs, ctx->len, + ctx->csbi.dwCursorPosition.X, ctx->csbi.dwCursorPosition.Y, ctx->done ? 'D' : 'd', ctx->error ? 'E' : 'e', ctx->histSize, ctx->histPos, debugstr_w(ctx->histCurr)); } @@ -91,13 +91,13 @@ static BOOL WCEL_Get(WCEL_Context* ctx, INPUT_RECORD* ir) { DWORD retv; - for (;;) + for (;;) { /* data available ? */ if (ReadConsoleInputW(ctx->hConIn, ir, 1, &retv) && retv == 1) return TRUE; /* then wait... */ - switch (WaitForSingleObject(ctx->hConIn, INFINITE)) + switch (WaitForSingleObject(ctx->hConIn, INFINITE)) { case WAIT_OBJECT_0: break; @@ -201,7 +201,7 @@ static void WCEL_InsertChar(WCEL_Context* ctx, WCHAR c) WCHAR buffer[2]; /* do not insert 0..31 control characters */ - if (c < ' ') + if (c < ' ') { if (c != '\t') return; } @@ -248,7 +248,7 @@ static WCHAR* WCEL_GetHistory(WCEL_Context* ctx, int idx) { WCHAR* ptr; - if (idx == ctx->histSize - 1) + if (idx == ctx->histSize - 1) { ptr = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(ctx->histCurr) + 1) * sizeof(WCHAR)); lstrcpyW(ptr, ctx->histCurr); @@ -256,7 +256,7 @@ static WCHAR* WCEL_GetHistory(WCEL_Context* ctx, int idx) else { int len = CONSOLE_GetHistory(idx, NULL, 0); - + if ((ptr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) { CONSOLE_GetHistory(idx, ptr, len); @@ -314,7 +314,7 @@ static void WCEL_FindPrevInHist(WCEL_Context* ctx) else ctx->histPos = (ctx->histSize-1); len = lstrlenW(data) + 1; - if ((len >= ctx->ofs) && + if ((len >= ctx->ofs) && (memcmp(ctx->line, data, ctx->ofs * sizeof(WCHAR)) == 0)) { /* need to clean also the screen if new string is shorter than old one */ @@ -332,7 +332,7 @@ static void WCEL_FindPrevInHist(WCEL_Context* ctx) } } } while (ctx->histPos != startPos); - + return; } @@ -389,7 +389,7 @@ static void WCEL_SetMark(WCEL_Context* ctx) } static void WCEL_ExchangeMark(WCEL_Context* ctx) -{ +{ unsigned tmp; if (ctx->mark > ctx->len) return; @@ -441,7 +441,7 @@ static void WCEL_LowerCaseWord(WCEL_Context* ctx) int i; for (i = ctx->ofs; i <= new_ofs; i++) ctx->line[i] = tolowerW(ctx->line[i]); - WriteConsoleOutputCharacterW(ctx->hConOut, &ctx->line[ctx->ofs], new_ofs - ctx->ofs + 1, + WriteConsoleOutputCharacterW(ctx->hConOut, &ctx->line[ctx->ofs], new_ofs - ctx->ofs + 1, WCEL_GetCoord(ctx, ctx->ofs), NULL); ctx->ofs = new_ofs; } @@ -455,7 +455,7 @@ static void WCEL_UpperCaseWord(WCEL_Context* ctx) int i; for (i = ctx->ofs; i <= new_ofs; i++) ctx->line[i] = toupperW(ctx->line[i]); - WriteConsoleOutputCharacterW(ctx->hConOut, &ctx->line[ctx->ofs], new_ofs - ctx->ofs + 1, + WriteConsoleOutputCharacterW(ctx->hConOut, &ctx->line[ctx->ofs], new_ofs - ctx->ofs + 1, WCEL_GetCoord(ctx, ctx->ofs), NULL); ctx->ofs = new_ofs; } @@ -467,11 +467,11 @@ static void WCEL_CapitalizeWord(WCEL_Context* ctx) if (new_ofs != ctx->ofs) { int i; - + ctx->line[ctx->ofs] = toupperW(ctx->line[ctx->ofs]); for (i = ctx->ofs + 1; i <= new_ofs; i++) ctx->line[i] = tolowerW(ctx->line[i]); - WriteConsoleOutputCharacterW(ctx->hConOut, &ctx->line[ctx->ofs], new_ofs - ctx->ofs + 1, + WriteConsoleOutputCharacterW(ctx->hConOut, &ctx->line[ctx->ofs], new_ofs - ctx->ofs + 1, WCEL_GetCoord(ctx, ctx->ofs), NULL); ctx->ofs = new_ofs; } @@ -569,7 +569,7 @@ static void WCEL_MoveToLastHist(WCEL_Context* ctx) * ====================================================================*/ #define CTRL(x) ((x) - '@') -static KeyEntry StdKeyMap[] = +static KeyEntry StdKeyMap[] = { {/*BACK*/0x08, WCEL_DeletePrevChar }, {/*RETURN*/0x0d, WCEL_Done }, @@ -577,14 +577,14 @@ static KeyEntry StdKeyMap[] = { 0, NULL } }; -static KeyEntry Win32ExtraStdKeyMap[] = +static KeyEntry Win32ExtraStdKeyMap[] = { {/*VK_F8*/ 0x77, WCEL_FindPrevInHist }, { 0, NULL } }; -static KeyEntry EmacsKeyMapCtrl[] = +static KeyEntry EmacsKeyMapCtrl[] = { { CTRL('@'), WCEL_SetMark }, { CTRL('A'), WCEL_MoveToBeg }, @@ -616,7 +616,7 @@ static KeyEntry EmacsKeyMapCtrl[] = { 0, NULL } }; -static KeyEntry EmacsKeyMapAlt[] = +static KeyEntry EmacsKeyMapAlt[] = { {/*DEL*/127, WCEL_DeleteLeftWord }, { '<', WCEL_MoveToFirstHist }, @@ -633,7 +633,7 @@ static KeyEntry EmacsKeyMapAlt[] = { 0, NULL } }; -static KeyEntry EmacsKeyMapExtended[] = +static KeyEntry EmacsKeyMapExtended[] = { {/*RETURN*/ 0x0d, WCEL_Done }, {/*VK_PRIOR*/0x21, WCEL_MoveToPrevHist }, @@ -645,7 +645,7 @@ static KeyEntry EmacsKeyMapExtended[] = { 0, NULL } }; -static KeyMap EmacsKeyMap[] = +static KeyMap EmacsKeyMap[] = { {0x00000000, 1, StdKeyMap}, {0x00000001, 1, EmacsKeyMapAlt}, /* left alt */ @@ -656,7 +656,7 @@ static KeyMap EmacsKeyMap[] = {0, 0, 0} }; -static KeyEntry Win32KeyMapExtended[] = +static KeyEntry Win32KeyMapExtended[] = { {/*VK_LEFT*/ 0x25, WCEL_MoveLeft }, {/*VK_RIGHT*/0x27, WCEL_MoveRight }, @@ -668,7 +668,7 @@ static KeyEntry Win32KeyMapExtended[] = { 0, NULL } }; -static KeyEntry Win32KeyMapCtrlExtended[] = +static KeyEntry Win32KeyMapCtrlExtended[] = { {/*VK_LEFT*/ 0x25, WCEL_MoveToLeftWord }, {/*VK_RIGHT*/0x27, WCEL_MoveToRightWord }, @@ -676,7 +676,7 @@ static KeyEntry Win32KeyMapCtrlExtended[] = { 0, NULL } }; -KeyMap Win32KeyMap[] = +KeyMap Win32KeyMap[] = { {0x00000000, 1, StdKeyMap}, {0x00000000, 0, Win32ExtraStdKeyMap}, @@ -706,7 +706,7 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, int use_emacs) memset(&ctx, 0, sizeof(ctx)); ctx.hConIn = hConsoleIn; WCEL_HistoryInit(&ctx); - if ((ctx.hConOut = CreateFileA("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, NULL, + if ((ctx.hConOut = CreateFileA("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 )) == INVALID_HANDLE_VALUE || !GetConsoleScreenBufferInfo(ctx.hConOut, &ctx.csbi)) return NULL; @@ -720,7 +720,7 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, int use_emacs) /* EPP WCEL_Dump(&ctx, "init"); */ while (!ctx.done && !ctx.error && WCEL_Get(&ctx, &ir)) - { + { if (ir.EventType != KEY_EVENT || !ir.Event.KeyEvent.bKeyDown) continue; TRACE("key%s repeatCount=%u, keyCode=%02x scanCode=%02x char=%02x keyState=%08lx\n", ir.Event.KeyEvent.bKeyDown ? "Down" : "Up ", ir.Event.KeyEvent.wRepeatCount, @@ -734,7 +734,7 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, int use_emacs) func = NULL; for (km = (use_emacs) ? EmacsKeyMap : Win32KeyMap; km->entries != NULL; km++) - { + { if (km->keyState != ks) continue; if (km->chkChar) @@ -765,7 +765,7 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, int use_emacs) if (ctx.ofs != ofs) SetConsoleCursorPosition(ctx.hConOut, WCEL_GetCoord(&ctx, ctx.ofs)); } - if (ctx.error) + if (ctx.error) { HeapFree(GetProcessHeap(), 0, ctx.line); ctx.line = NULL; diff --git a/win32/except.c b/win32/except.c index f1a628e15d7..c10af02aa8a 100644 --- a/win32/except.c +++ b/win32/except.c @@ -23,15 +23,15 @@ * __try{...}__except(..){....} and * __try{...}__finally{...} * statements is simply not documented by Microsoft. There could be different - * reasons for this: - * One reason could be that they try to hide the fact that exception - * handling in Win32 looks almost the same as in OS/2 2.x. + * reasons for this: + * One reason could be that they try to hide the fact that exception + * handling in Win32 looks almost the same as in OS/2 2.x. * Another reason could be that Microsoft does not want others to write - * binary compatible implementations of the Win32 API (like us). + * binary compatible implementations of the Win32 API (like us). * - * Whatever the reason, THIS SUCKS!! Ensuring portability or future - * compatibility may be valid reasons to keep some things undocumented. - * But exception handling is so basic to Win32 that it should be + * Whatever the reason, THIS SUCKS!! Ensuring portability or future + * compatibility may be valid reasons to keep some things undocumented. + * But exception handling is so basic to Win32 that it should be * documented! * */ @@ -64,8 +64,8 @@ void WINAPI RaiseException( DWORD code, DWORD flags, DWORD nbargs, const LPDWORD { EXCEPTION_RECORD record; - /* Compose an exception record */ - + /* Compose an exception record */ + record.ExceptionCode = code; record.ExceptionFlags = flags & EH_NONCONTINUABLE; record.ExceptionRecord = NULL; @@ -219,7 +219,7 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent) MESSAGE("wine: Unhandled exception, starting debugger...\n"); - if (!RegOpenKeyA(HKEY_LOCAL_MACHINE, + if (!RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", &hDbgConf)) { DWORD type; DWORD count; @@ -345,11 +345,11 @@ static int start_debugger_atomic(PEXCEPTION_POINTERS epointers) } return ret; } - + /* someone beat us here... */ CloseHandle( hEvent ); } - + /* and wait for the winner to have actually created the debugger */ WaitForSingleObject( hRunOnce, INFINITE ); /* in fact, here, we only know that someone has tried to start the debugger, @@ -373,9 +373,9 @@ DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers) status = send_debug_event( epointers->ExceptionRecord, FALSE, epointers->ContextRecord ); switch (status) { - case DBG_CONTINUE: + case DBG_CONTINUE: return EXCEPTION_CONTINUE_EXECUTION; - case DBG_EXCEPTION_NOT_HANDLED: + case DBG_EXCEPTION_NOT_HANDLED: TerminateProcess( GetCurrentProcess(), epointers->ExceptionRecord->ExceptionCode ); break; /* not reached */ case 0: /* no debugger is present */ @@ -387,7 +387,7 @@ DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers) /* second try, the debugger isn't present... */ if (loop == 1) return EXCEPTION_EXECUTE_HANDLER; break; - default: + default: FIXME("Unsupported yet debug continue value %d (please report)\n", status); return EXCEPTION_EXECUTE_HANDLER; } @@ -399,14 +399,14 @@ DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers) DWORD ret = top_filter( epointers ); if (ret != EXCEPTION_CONTINUE_SEARCH) return ret; } - + /* FIXME: Should check the current error mode */ - + if (!start_debugger_atomic( epointers )) return EXCEPTION_EXECUTE_HANDLER; /* now that we should have a debugger attached, try to resend event */ - } - + } + return EXCEPTION_EXECUTE_HANDLER; } diff --git a/win32/init.c b/win32/init.c index a9490b59a6b..f7c05bdeac7 100644 --- a/win32/init.c +++ b/win32/init.c @@ -32,7 +32,7 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(win32); - + /* filter for page-fault exceptions */ static WINE_EXCEPTION_FILTER(page_fault) { diff --git a/win32/newfns.c b/win32/newfns.c index c3e85d4cb21..80219c6ba12 100644 --- a/win32/newfns.c +++ b/win32/newfns.c @@ -52,7 +52,7 @@ static void QUERYPERF_Init(void) double cpuMHz; TRACE("()\n"); - + if (IsProcessorFeaturePresent( PF_RDTSC_INSTRUCTION_AVAILABLE )) { /* rdtsc is available. However, in order to use it @@ -97,7 +97,7 @@ static void QUERYPERF_Init(void) QUERYPERF_Initialized = TRUE; } - + /**************************************************************************** * QueryPerformanceCounter (KERNEL32.@) */ @@ -140,7 +140,7 @@ BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER frequency) return TRUE; } #endif - + frequency->s.LowPart = 1000000; frequency->s.HighPart = 0; return TRUE; @@ -201,7 +201,7 @@ HANDLE WINAPI CreateMailslotA( LPCSTR lpName, DWORD nMaxMessageSize, /****************************************************************************** * CreateMailslotW [KERNEL32.@] Creates a mailslot with specified name - * + * * PARAMS * lpName [I] Pointer to string for mailslot name * nMaxMessageSize [I] Maximum message size @@ -215,7 +215,7 @@ HANDLE WINAPI CreateMailslotA( LPCSTR lpName, DWORD nMaxMessageSize, HANDLE WINAPI CreateMailslotW( LPCWSTR lpName, DWORD nMaxMessageSize, DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa ) { - FIXME("(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName), + FIXME("(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName), nMaxMessageSize, lReadTimeout, sa); return 1; } @@ -230,7 +230,7 @@ HANDLE WINAPI CreateMailslotW( LPCWSTR lpName, DWORD nMaxMessageSize, * lpNextSize [O] Address of size of next message * lpMessageCount [O] Address of number of messages * lpReadTimeout [O] Address of read time-out - * + * * RETURNS * Success: TRUE * Failure: FALSE @@ -264,8 +264,8 @@ DWORD WINAPI GetCompressedFileSizeA( /****************************************************************************** - * GetCompressedFileSizeW [KERNEL32.@] - * + * GetCompressedFileSizeW [KERNEL32.@] + * * RETURNS * Success: Low-order doubleword of number of bytes * Failure: 0xffffffff @@ -280,7 +280,7 @@ DWORD WINAPI GetCompressedFileSizeW( /****************************************************************************** - * SetComputerNameA [KERNEL32.@] + * SetComputerNameA [KERNEL32.@] */ BOOL WINAPI SetComputerNameA( LPCSTR lpComputerName ) { @@ -300,7 +300,7 @@ BOOL WINAPI SetComputerNameA( LPCSTR lpComputerName ) * * PARAMS * lpComputerName [I] Address of new computer name - * + * * RETURNS STD */ BOOL WINAPI SetComputerNameW( LPCWSTR lpComputerName ) diff --git a/windows/caret.c b/windows/caret.c index 52ceaf9f952..1d278ab7150 100644 --- a/windows/caret.c +++ b/windows/caret.c @@ -100,7 +100,7 @@ static void CARET_DisplayCaret( DISPLAY_CARET status ) ReleaseDC( Caret.hwnd, hdc ); } - + /***************************************************************** * CARET_Callback */ @@ -128,7 +128,7 @@ static void CARET_SetTimer(void) */ static void CARET_ResetTimer(void) { - if (Caret.timerid) + if (Caret.timerid) { KillSystemTimer( (HWND)0, Caret.timerid ); Caret.timerid = SetSystemTimer( (HWND)0, 0, Caret.timeout, @@ -142,7 +142,7 @@ static void CARET_ResetTimer(void) */ static void CARET_KillTimer(void) { - if (Caret.timerid) + if (Caret.timerid) { KillSystemTimer( (HWND)0, Caret.timerid ); Caret.timerid = 0; @@ -171,8 +171,8 @@ BOOL WINAPI CreateCaret( HWND hwnd, HBITMAP bitmap, Caret.height = bmp.bmHeight; bmp.bmBits = NULL; Caret.hBmp = CreateBitmapIndirect(&bmp); - - if (Caret.hBmp) + + if (Caret.hBmp) { /* copy the bitmap */ LPBYTE buf = HeapAlloc(GetProcessHeap(), 0, bmp.bmWidthBytes * bmp.bmHeight); @@ -201,7 +201,7 @@ BOOL WINAPI CreateCaret( HWND hwnd, HBITMAP bitmap, r.left = r.top = 0; r.right = Caret.width; r.bottom = Caret.height; - + if ((Caret.hBmp = CreateCompatibleBitmap(hMemDC, Caret.width, Caret.height))) { HBITMAP hPrevBmp = SelectObject(hMemDC, Caret.hBmp); @@ -223,7 +223,7 @@ BOOL WINAPI CreateCaret( HWND hwnd, HBITMAP bitmap, Caret.timeout = GetProfileIntA( "windows", "CursorBlinkRate", 500 ); return TRUE; } - + /***************************************************************** * DestroyCaret (USER.164) diff --git a/windows/class.c b/windows/class.c index 4a2df8e6e54..6229abfff78 100644 --- a/windows/class.c +++ b/windows/class.c @@ -18,7 +18,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * FIXME: In win32 all classes are local. They are registered at + * FIXME: In win32 all classes are local. They are registered at * program start. Processes CANNOT share classes. (Source: some * win31->NT migration book) * @@ -312,8 +312,8 @@ void CLASS_FreeModuleClasses( HMODULE16 hModule ) * NOTES * 980805 a local class will be found now if registred with hInst=0 * and looed up with a hInst!=0. msmoney does it (jsch) - * - * Local class registered with a USER instance handle are found as if + * + * Local class registered with a USER instance handle are found as if * they were global classes. */ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance ) @@ -342,7 +342,7 @@ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance ) } } } - + /* Then search global classes */ for (class = firstClass; (class); class = class->next) @@ -368,7 +368,7 @@ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance ) WARN("-- found local Class registred with hInst=0\n"); return tclass; } - + TRACE("-- not found\n"); return 0; } @@ -594,10 +594,10 @@ ATOM WINAPI RegisterClassA( const WNDCLASSA* wc ) /* [in] Address of structure w wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr, HIWORD(wc->lpszClassName) ? wc->lpszClassName : "" ); - + iSmIconWidth = GetSystemMetrics(SM_CXSMICON); iSmIconHeight = GetSystemMetrics(SM_CYSMICON); - + classPtr->hIcon = wc->hIcon; classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON, iSmIconWidth, iSmIconHeight, @@ -634,7 +634,7 @@ ATOM WINAPI RegisterClassW( const WNDCLASSW* wc ) atom, (DWORD)wc->lpfnWndProc, wc->hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); - + iSmIconWidth = GetSystemMetrics(SM_CXSMICON); iSmIconHeight = GetSystemMetrics(SM_CYSMICON); @@ -673,7 +673,7 @@ ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc ) atom, (DWORD)wc->lpfnWndProc, hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); - + classPtr->hIcon = wc->hIcon; classPtr->hIconSm = wc->hIconSm; classPtr->hCursor = wc->hCursor; @@ -707,7 +707,7 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc ) atom, (DWORD)wc->lpfnWndProc, wc->hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); - + classPtr->hIcon = (HICON16)wc->hIcon; classPtr->hIconSm = (HICON16)wc->hIconSm; classPtr->hCursor = (HCURSOR16)wc->hCursor; @@ -740,7 +740,7 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc ) atom, (DWORD)wc->lpfnWndProc, wc->hInstance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); - + classPtr->hIcon = (HICON16)wc->hIcon; classPtr->hIconSm = (HICON16)wc->hIconSm; classPtr->hCursor = (HCURSOR16)wc->hCursor; @@ -1257,9 +1257,9 @@ BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name, CLASS *classPtr; TRACE("%x %p %p\n",hInstance, name, wc); - + if (!(atom = GlobalFindAtomA( name )) || - !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) + !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) /*|| (hInstance != classPtr->hInstance) */ ) return FALSE; wc->style = classPtr->style; wc->lpfnWndProc = (WNDPROC)CLASS_GetProc( classPtr, WIN_PROC_32A ); @@ -1288,7 +1288,7 @@ BOOL WINAPI GetClassInfoExW( HINSTANCE hInstance, LPCWSTR name, CLASS *classPtr; TRACE("%x %p %p\n",hInstance, name, wc); - + if (!(atom = GlobalFindAtomW( name )) || !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) || (hInstance != classPtr->hInstance)) return FALSE; @@ -1331,7 +1331,7 @@ BOOL16 WINAPI ClassNext16( CLASSENTRY *pClassEntry ) CLASS *class = firstClass; TRACE("%p\n",pClassEntry); - + if (!pClassEntry->wNext) return FALSE; for (i = 1; (i < pClassEntry->wNext) && class; i++) class = class->next; if (!class) diff --git a/windows/clipboard.c b/windows/clipboard.c index 3a8a87966e7..9927eda6a56 100644 --- a/windows/clipboard.c +++ b/windows/clipboard.c @@ -132,7 +132,7 @@ BOOL CLIPBOARD_IsLocked() */ if ( hClipLock == hTaskCur ) bIsLocked = FALSE; - + else if ( hTaskCur == hTaskClipOwner ) { /* Check if we're currently executing inside a window procedure @@ -143,7 +143,7 @@ BOOL CLIPBOARD_IsLocked() */ #if 0 MESSAGEQUEUE *queue = QUEUE_Current(); - + if ( queue && queue->smWaiting && queue->smWaiting->msg == WM_RENDERFORMAT @@ -196,7 +196,7 @@ VOID CALLBACK CLIPBOARD_GlobalFreeProc( HWND hwnd, UINT uMsg, UINT idEvent, DWOR void CLIPBOARD_DeleteRecord(LPWINE_CLIPFORMAT lpFormat, BOOL bChange) { if( (lpFormat->wFormatID >= CF_GDIOBJFIRST && - lpFormat->wFormatID <= CF_GDIOBJLAST) || lpFormat->wFormatID == CF_BITMAP + lpFormat->wFormatID <= CF_GDIOBJLAST) || lpFormat->wFormatID == CF_BITMAP || lpFormat->wFormatID == CF_PALETTE) { if (lpFormat->hData32) @@ -220,9 +220,9 @@ void CLIPBOARD_DeleteRecord(LPWINE_CLIPFORMAT lpFormat, BOOL bChange) PostMessageA(hWndClipOwner, WM_TIMER, (WPARAM)lpFormat->hDataSrc32, (LPARAM)CLIPBOARD_GlobalFreeProc); } - + if (lpFormat->hData16) - /* HMETAFILE16 and HMETAFILE32 are apparently the same thing, + /* HMETAFILE16 and HMETAFILE32 are apparently the same thing, and a shallow copy is enough to share a METAFILEPICT structure between 16bit and 32bit clipboards. The MetaFile should of course only be deleted once. */ @@ -234,7 +234,7 @@ void CLIPBOARD_DeleteRecord(LPWINE_CLIPFORMAT lpFormat, BOOL bChange) GlobalFree16(lpFormat->hData16); } } - else + else { if (lpFormat->hData32) { @@ -258,7 +258,7 @@ void CLIPBOARD_DeleteRecord(LPWINE_CLIPFORMAT lpFormat, BOOL bChange) GlobalFree16(lpFormat->hData16); } - lpFormat->wDataPresent = 0; + lpFormat->wDataPresent = 0; lpFormat->hData16 = 0; lpFormat->hData32 = 0; lpFormat->hDataSrc32 = 0; @@ -272,7 +272,7 @@ void CLIPBOARD_DeleteRecord(LPWINE_CLIPFORMAT lpFormat, BOOL bChange) */ void CLIPBOARD_EmptyCache( BOOL bChange ) { - LPWINE_CLIPFORMAT lpFormat = ClipFormats; + LPWINE_CLIPFORMAT lpFormat = ClipFormats; while(lpFormat) { @@ -312,16 +312,16 @@ BOOL CLIPBOARD_IsPresent(WORD wFormat) BOOL CLIPBOARD_IsCacheRendered() { LPWINE_CLIPFORMAT lpFormat = ClipFormats; - + /* check if all formats were rendered */ while(lpFormat) { if( lpFormat->wDataPresent && !lpFormat->hData16 && !lpFormat->hData32 ) return FALSE; - + lpFormat = lpFormat->NextFormat; } - + return TRUE; } @@ -356,7 +356,7 @@ HGLOBAL CLIPBOARD_GlobalDupMem( HGLOBAL hGlobalSrc ) HGLOBAL hGlobalDest; PVOID pGlobalSrc, pGlobalDest; DWORD cBytes; - + if ( !hGlobalSrc ) return 0; @@ -369,14 +369,14 @@ HGLOBAL CLIPBOARD_GlobalDupMem( HGLOBAL hGlobalSrc ) cBytes ); if ( !hGlobalDest ) return 0; - + pGlobalSrc = GlobalLock(hGlobalSrc); pGlobalDest = GlobalLock(hGlobalDest); if ( !pGlobalSrc || !pGlobalDest ) return 0; memcpy(pGlobalDest, pGlobalSrc, cBytes); - + GlobalUnlock(hGlobalSrc); GlobalUnlock(hGlobalDest); @@ -404,7 +404,7 @@ static BOOL CLIPBOARD_RenderFormat(LPWINE_CLIPFORMAT lpFormat) * we must ask the driver to render the data to the clipboard cache. */ TRACE("enter format=%d\n", lpFormat->wFormatID); - if ( !USER_Driver.pIsSelectionOwner() + if ( !USER_Driver.pIsSelectionOwner() && USER_Driver.pIsClipboardFormatAvailable( lpFormat->wFormatID ) ) { if ( !USER_Driver.pGetClipboardData( lpFormat->wFormatID ) ) @@ -426,7 +426,7 @@ static BOOL CLIPBOARD_RenderFormat(LPWINE_CLIPFORMAT lpFormat) } else { - WARN("\thWndClipOwner (%04x) is lost!\n", + WARN("\thWndClipOwner (%04x) is lost!\n", hWndClipOwner); CLIPBOARD_ReleaseOwner(); lpFormat->wDataPresent = 0; @@ -502,10 +502,10 @@ static INT CLIPBOARD_ConvertText(WORD src_fmt, void const *src, INT src_size, */ static LPWINE_CLIPFORMAT CLIPBOARD_RenderText( UINT wFormat ) { - LPWINE_CLIPFORMAT lpSource = ClipFormats; + LPWINE_CLIPFORMAT lpSource = ClipFormats; LPWINE_CLIPFORMAT lpTarget = NULL; BOOL foundData = FALSE; - + /* Asked for CF_TEXT */ if( wFormat == CF_TEXT) { @@ -588,7 +588,7 @@ static LPWINE_CLIPFORMAT CLIPBOARD_RenderText( UINT wFormat ) } } if (!foundData) - { + { if ((wFormat == CF_TEXT) || (wFormat == CF_OEMTEXT)) { lpSource = &ClipFormats[CF_UNICODETEXT-1]; @@ -608,9 +608,9 @@ static LPWINE_CLIPFORMAT CLIPBOARD_RenderText( UINT wFormat ) if( lpTarget != lpSource && !lpTarget->hData16 && !lpTarget->hData32 ) { INT src_chars, dst_chars, alloc_size; - LPCSTR lpstrS; + LPCSTR lpstrS; LPSTR lpstrT; - + if (lpSource->hData32) { lpstrS = (LPSTR)GlobalLock(lpSource->hData32); @@ -619,7 +619,7 @@ static LPWINE_CLIPFORMAT CLIPBOARD_RenderText( UINT wFormat ) { lpstrS = (LPSTR)GlobalLock16(lpSource->hData16); } - + if( !lpstrS ) return NULL; /* Text always NULL terminated */ @@ -678,12 +678,12 @@ static UINT CLIPBOARD_EnumClipboardFormats( UINT wFormat ) { /* walk up to the specified format record */ - if( !(lpFormat = __lookup_format( lpFormat, wFormat )) ) + if( !(lpFormat = __lookup_format( lpFormat, wFormat )) ) return 0; lpFormat = lpFormat->NextFormat; /* right */ } - while(TRUE) + while(TRUE) { if (lpFormat == NULL) return 0; @@ -721,7 +721,7 @@ static UINT CLIPBOARD_EnumClipboardFormats( UINT wFormat ) /************************************************************************** - * WIN32 Clipboard implementation + * WIN32 Clipboard implementation **************************************************************************/ /************************************************************************** @@ -800,7 +800,7 @@ BOOL WINAPI EmptyClipboard(void) WARN("Clipboard not opened by calling task!\n"); return FALSE; } - + /* destroy private objects */ if (hWndClipOwner) SendMessageW( hWndClipOwner, WM_DESTROYCLIPBOARD, 0, 0 ); @@ -813,7 +813,7 @@ BOOL WINAPI EmptyClipboard(void) /* Save the current task */ hTaskClipOwner = GetCurrentTask(); - + /* Tell the driver to acquire the selection */ USER_Driver.pAcquireClipboard(); @@ -858,7 +858,7 @@ HANDLE16 WINAPI SetClipboardData16( UINT16 wFormat, HANDLE16 hData ) /* Pass on the request to the driver */ USER_Driver.pSetClipboardData(wFormat); - if ( lpFormat->wDataPresent || lpFormat->hData16 || lpFormat->hData32 ) + if ( lpFormat->wDataPresent || lpFormat->hData16 || lpFormat->hData32 ) { CLIPBOARD_DeleteRecord(lpFormat, TRUE); @@ -950,7 +950,7 @@ HANDLE WINAPI SetClipboardData( UINT wFormat, HANDLE hData ) lpFormat->hData32 = CLIPBOARD_GlobalDupMem( hData ); else lpFormat->hData32 = hData; /* 0 is legal, see WM_RENDERFORMAT */ - + lpFormat->hData16 = 0; return lpFormat->hData32; /* Should we return lpFormat->hDataSrc32 */ @@ -962,7 +962,7 @@ HANDLE WINAPI SetClipboardData( UINT wFormat, HANDLE hData ) */ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) { - LPWINE_CLIPFORMAT lpRender = ClipFormats; + LPWINE_CLIPFORMAT lpRender = ClipFormats; TRACE("(%04X)\n", wFormat); @@ -982,7 +982,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) lpRender = __lookup_format( ClipFormats, wFormat ); if( !lpRender || !CLIPBOARD_RenderFormat(lpRender) ) return 0; } - + /* Convert between 32 -> 16 bit data, if necessary */ if( lpRender->hData32 && !lpRender->hData16 && CLIPBOARD_IsMemoryObject(wFormat) ) @@ -992,7 +992,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) size = sizeof( METAFILEPICT16 ); else size = GlobalSize(lpRender->hData32); - + lpRender->hData16 = GlobalAlloc16(GMEM_ZEROINIT, size); if( !lpRender->hData16 ) ERR("(%04X) -- not enough memory in 16b heap\n", wFormat); @@ -1003,14 +1003,14 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) FIXME("\timplement function CopyMetaFilePict32to16\n"); FIXME("\tin the appropriate file.\n"); #ifdef SOMEONE_IMPLEMENTED_ME - CopyMetaFilePict32to16( GlobalLock16(lpRender->hData16), + CopyMetaFilePict32to16( GlobalLock16(lpRender->hData16), GlobalLock(lpRender->hData32) ); #endif } else { - memcpy( GlobalLock16(lpRender->hData16), - GlobalLock(lpRender->hData32), + memcpy( GlobalLock16(lpRender->hData16), + GlobalLock(lpRender->hData32), size ); } GlobalUnlock16(lpRender->hData16); @@ -1018,7 +1018,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) } } - TRACE("\treturning %04x (type %i)\n", + TRACE("\treturning %04x (type %i)\n", lpRender->hData16, lpRender->wFormatID); return lpRender->hData16; } @@ -1029,7 +1029,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat ) */ HANDLE WINAPI GetClipboardData( UINT wFormat ) { - LPWINE_CLIPFORMAT lpRender = ClipFormats; + LPWINE_CLIPFORMAT lpRender = ClipFormats; TRACE("(%08X)\n", wFormat); @@ -1049,7 +1049,7 @@ HANDLE WINAPI GetClipboardData( UINT wFormat ) lpRender = __lookup_format( ClipFormats, wFormat ); if( !lpRender || !CLIPBOARD_RenderFormat(lpRender) ) return 0; } - + /* Convert between 16 -> 32 bit data, if necessary */ if( lpRender->hData16 && !lpRender->hData32 && CLIPBOARD_IsMemoryObject(wFormat) ) @@ -1066,21 +1066,21 @@ HANDLE WINAPI GetClipboardData( UINT wFormat ) FIXME("\timplement function CopyMetaFilePict16to32\n"); FIXME("\tin the appropriate file.\n"); #ifdef SOMEONE_IMPLEMENTED_ME - CopyMetaFilePict16to32( GlobalLock16(lpRender->hData32), + CopyMetaFilePict16to32( GlobalLock16(lpRender->hData32), GlobalLock(lpRender->hData16) ); #endif } else { - memcpy( GlobalLock(lpRender->hData32), - GlobalLock16(lpRender->hData16), + memcpy( GlobalLock(lpRender->hData32), + GlobalLock16(lpRender->hData16), size ); } GlobalUnlock(lpRender->hData32); GlobalUnlock16(lpRender->hData16); } - TRACE("\treturning %04x (type %i)\n", + TRACE("\treturning %04x (type %i)\n", lpRender->hData32, lpRender->wFormatID); return lpRender->hData32; } @@ -1101,11 +1101,11 @@ INT16 WINAPI CountClipboardFormats16(void) INT WINAPI CountClipboardFormats(void) { INT FormatCount = 0; - LPWINE_CLIPFORMAT lpFormat = ClipFormats; + LPWINE_CLIPFORMAT lpFormat = ClipFormats; TRACE("()\n"); - while(TRUE) + while(TRUE) { if (lpFormat == NULL) break; @@ -1170,8 +1170,8 @@ UINT WINAPI EnumClipboardFormats( UINT wFormat ) */ UINT WINAPI RegisterClipboardFormatA( LPCSTR FormatName ) { - LPWINE_CLIPFORMAT lpNewFormat; - LPWINE_CLIPFORMAT lpFormat = ClipFormats; + LPWINE_CLIPFORMAT lpNewFormat; + LPWINE_CLIPFORMAT lpFormat = ClipFormats; if (FormatName == NULL) return 0; @@ -1179,14 +1179,14 @@ UINT WINAPI RegisterClipboardFormatA( LPCSTR FormatName ) /* walk format chain to see if it's already registered */ - while(TRUE) + while(TRUE) { if ( !strcmp(lpFormat->Name,FormatName) ) { lpFormat->wRefCount++; return lpFormat->wFormatID; } - + if ( lpFormat->NextFormat == NULL ) break; lpFormat = lpFormat->NextFormat; @@ -1221,7 +1221,7 @@ UINT WINAPI RegisterClipboardFormatA( LPCSTR FormatName ) /* Pass on the registration request to the driver */ USER_Driver.pRegisterClipboardFormat( FormatName ); - + return LastRegFormat++; } @@ -1265,7 +1265,7 @@ INT WINAPI GetClipboardFormatNameA( UINT wFormat, LPSTR retStr, INT maxlen ) TRACE("(%04X, %p, %d) !\n", wFormat, retStr, maxlen); - if (lpFormat == NULL || lpFormat->Name == NULL || + if (lpFormat == NULL || lpFormat->Name == NULL || lpFormat->wFormatID < CF_REGFORMATBASE) return 0; TRACE("Name='%s' !\n", lpFormat->Name); @@ -1283,7 +1283,7 @@ INT WINAPI GetClipboardFormatNameW( UINT wFormat, LPWSTR retStr, INT maxlen ) INT ret; LPSTR p = HeapAlloc( GetProcessHeap(), 0, maxlen ); if(p == NULL) return 0; /* FIXME: is this the correct failure value? */ - + ret = GetClipboardFormatNameA( wFormat, p, maxlen ); if (maxlen > 0 && !MultiByteToWideChar( CP_ACP, 0, p, -1, retStr, maxlen )) diff --git a/windows/cursoricon.c b/windows/cursoricon.c index 022b7351ab8..615bdee569a 100644 --- a/windows/cursoricon.c +++ b/windows/cursoricon.c @@ -101,7 +101,7 @@ static WORD ICON_HOTSPOT = 0x4242; * map_fileW * * Helper function to map a file to memory: - * name - file name + * name - file name * [RETURN] ptr - pointer to mapped file */ static void *map_fileW( LPCWSTR name ) @@ -149,12 +149,12 @@ static HANDLE CURSORICON_FindSharedIcon( HMODULE hModule, HRSRC hRsrc ) } /************************************************************************* - * CURSORICON_FindCache + * CURSORICON_FindCache * * Given a handle, find the corresponding cache element * * PARAMS - * Handle [I] handle to an Image + * Handle [I] handle to an Image * * RETURNS * Success: The cache entry @@ -247,7 +247,7 @@ void CURSORICON_FreeModuleIcons( HMODULE hModule ) { ICONCACHE *freePtr = *ptr; *ptr = freePtr->next; - + GlobalFree16( freePtr->handle ); HeapFree( GetProcessHeap(), 0, freePtr ); continue; @@ -266,7 +266,7 @@ void CURSORICON_FreeModuleIcons( HMODULE hModule ) static CURSORICONDIRENTRY *CURSORICON_FindBestIcon( CURSORICONDIR *dir, int width, int height, int colors ) { - int i; + int i; CURSORICONDIRENTRY *entry, *bestEntry = NULL; UINT iTotalDiff, iXDiff=0, iYDiff=0, iColorDiff; UINT iTempXDiff, iTempYDiff, iTempColorDiff; @@ -393,7 +393,7 @@ BOOL CURSORICON_SimulateLoadingFromResourceW( LPWSTR filename, BOOL fCursor, if ( *(LPDWORD)bits==0x46464952 ) /* "RIFF" */ { LPBYTE pos = (LPBYTE) bits; FIXME_(cursor)("Animated icons not correctly implemented! %p \n", bits); - + for (;;) { if (*(LPDWORD)pos==0x6e6f6369) /* "icon" */ { FIXME_(cursor)("icon entry found! %p\n", bits); @@ -415,7 +415,7 @@ BOOL CURSORICON_SimulateLoadingFromResourceW( LPWSTR filename, BOOL fCursor, for (i=0; i < entries; i++) size += bits->idEntries[i].dwDIBSize + (fCursor ? sizeof(POINT16): 0); - + if (!(*ptr = HeapAlloc( GetProcessHeap(), 0, entries * sizeof (CURSORICONDIRENTRY*)))) goto fail; if (!(*res = HeapAlloc( GetProcessHeap(), 0, size))) goto fail; @@ -447,7 +447,7 @@ BOOL CURSORICON_SimulateLoadingFromResourceW( LPWSTR filename, BOOL fCursor, _free += (*res)->idEntries[i].dwBytesInRes; } UnmapViewOfFile( bits ); - return TRUE; + return TRUE; fail: if (*res) HeapFree( GetProcessHeap(), 0, *res ); if (*ptr) HeapFree( GetProcessHeap(), 0, *ptr ); @@ -459,13 +459,13 @@ fail: /********************************************************************** * CURSORICON_CreateFromResource * - * Create a cursor or icon from in-memory resource template. + * Create a cursor or icon from in-memory resource template. * * FIXME: Convert to mono when cFlag is LR_MONOCHROME. Do something * with cbSize parameter as well. */ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16 hObj, LPBYTE bits, - UINT cbSize, BOOL bIcon, DWORD dwVersion, + UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height, UINT loadflags ) { static HDC hdcMem; @@ -521,7 +521,7 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16 /* Make sure we have room for the monochrome bitmap later on. * Note that BITMAPINFOINFO and BITMAPCOREHEADER are the same - * up to and including the biBitCount. In-memory icon resource + * up to and including the biBitCount. In-memory icon resource * format is as follows: * * BITMAPINFOHEADER icHeader // DIB header @@ -530,10 +530,10 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16 * BYTE icAND[] // DIB bits for AND mask */ - if ((pInfo = (BITMAPINFO *)HeapAlloc( GetProcessHeap(), 0, + if ((pInfo = (BITMAPINFO *)HeapAlloc( GetProcessHeap(), 0, max(size, sizeof(BITMAPINFOHEADER) + 2*sizeof(RGBQUAD))))) - { - memcpy( pInfo, bmi, size ); + { + memcpy( pInfo, bmi, size ); pInfo->bmiHeader.biHeight /= 2; /* Create the XOR bitmap */ @@ -611,11 +611,11 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16 if( !hAndBits ) DeleteObject( hXorBits ); } - HeapFree( GetProcessHeap(), 0, pInfo ); + HeapFree( GetProcessHeap(), 0, pInfo ); } } - if( !hXorBits || !hAndBits ) + if( !hXorBits || !hAndBits ) { WARN_(cursor)("\tunable to create an icon bitmap.\n"); return 0; @@ -627,9 +627,9 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16 sizeXor = bmpXor.bmHeight * bmpXor.bmWidthBytes; sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes; - if (hObj) hObj = GlobalReAlloc16( hObj, + if (hObj) hObj = GlobalReAlloc16( hObj, sizeof(CURSORICONINFO) + sizeXor + sizeAnd, GMEM_MOVEABLE ); - if (!hObj) hObj = GlobalAlloc16( GMEM_MOVEABLE, + if (!hObj) hObj = GlobalAlloc16( GMEM_MOVEABLE, sizeof(CURSORICONINFO) + sizeXor + sizeAnd ); if (hObj) { @@ -669,7 +669,7 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16 HICON16 WINAPI CreateIconFromResourceEx16( LPBYTE bits, UINT16 cbSize, BOOL16 bIcon, DWORD dwVersion, INT16 width, INT16 height, UINT16 cFlag ) { - return CreateIconFromResourceEx(bits, cbSize, bIcon, dwVersion, + return CreateIconFromResourceEx(bits, cbSize, bIcon, dwVersion, width, height, cFlag); } @@ -721,7 +721,7 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name, else dirEntry = (CURSORICONDIRENTRY *)CURSORICON_FindBestIcon(dir, width, height, colors); bits = ptr[dirEntry->wResId-1]; - h = CURSORICON_CreateFromResource( 0, 0, bits, dirEntry->dwBytesInRes, + h = CURSORICON_CreateFromResource( 0, 0, bits, dirEntry->dwBytesInRes, !fCursor, 0x00030000, width, height, loadflags); HeapFree( GetProcessHeap(), 0, dir ); HeapFree( GetProcessHeap(), 0, ptr ); @@ -738,7 +738,7 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name, } /* Normalize hInstance (must be uniquely represented for icon cache) */ - + if ( HIWORD( hInstance ) ) hInstance = MapHModuleLS( hInstance ); else @@ -752,7 +752,7 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name, hGroupRsrc = hRsrc; /* Find the best entry in the directory */ - + if (!(handle = LoadResource( hInstance, hRsrc ))) return 0; if (!(dir = (CURSORICONDIR*)LockResource( handle ))) return 0; if (fCursor) @@ -770,15 +770,15 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name, if (!(hRsrc = FindResourceW(hInstance,MAKEINTRESOURCEW(wResId), fCursor ? RT_CURSORW : RT_ICONW ))) return 0; - + /* If shared icon, check whether it was already loaded */ - if ( (loadflags & LR_SHARED) + if ( (loadflags & LR_SHARED) && (h = CURSORICON_FindSharedIcon( hInstance, hRsrc ) ) != 0 ) return h; - + if (!(handle = LoadResource( hInstance, hRsrc ))) return 0; bits = (LPBYTE)LockResource( handle ); - h = CURSORICON_CreateFromResource( 0, 0, bits, dwBytesInRes, + h = CURSORICON_CreateFromResource( 0, 0, bits, dwBytesInRes, !fCursor, 0x00030000, width, height, loadflags); FreeResource( handle ); @@ -815,12 +815,12 @@ static HGLOBAL16 CURSORICON_Copy( HINSTANCE16 hInstance, HGLOBAL16 handle ) } /************************************************************************* - * CURSORICON_ExtCopy + * CURSORICON_ExtCopy * * Copies an Image from the Cache if LR_COPYFROMRESOURCE is specified * * PARAMS - * Handle [I] handle to an Image + * Handle [I] handle to an Image * nType [I] Type of Handle (IMAGE_CURSOR | IMAGE_ICON) * iDesiredCX [I] The Desired width of the Image * iDesiredCY [I] The desired height of the Image @@ -834,16 +834,16 @@ static HGLOBAL16 CURSORICON_Copy( HINSTANCE16 hInstance, HGLOBAL16 handle ) * LR_MONOCHROME should be implemented by CURSORICON_CreateFromResource. * LR_COPYFROMRESOURCE will only work if the Image is in the Cache. * - * + * */ -HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, - INT iDesiredCX, INT iDesiredCY, +HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, + INT iDesiredCX, INT iDesiredCY, UINT nFlags) { HGLOBAL16 hNew=0; - TRACE_(icon)("Handle %u, uType %u, iDesiredCX %i, iDesiredCY %i, nFlags %u\n", + TRACE_(icon)("Handle %u, uType %u, iDesiredCX %i, iDesiredCY %i, nFlags %u\n", Handle, nType, iDesiredCX, iDesiredCY, nFlags); if(Handle == 0) @@ -854,7 +854,7 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, /* Best Fit or Monochrome */ if( (nFlags & LR_COPYFROMRESOURCE && (iDesiredCX > 0 || iDesiredCY > 0)) - || nFlags & LR_MONOCHROME) + || nFlags & LR_MONOCHROME) { ICONCACHE* pIconCache = CURSORICON_FindCache(Handle); @@ -885,25 +885,25 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, if(((nFlags & LR_MONOCHROME) && !(nFlags & LR_COPYFROMRESOURCE)) || (iDesiredCX == 0 && iDesiredCY == 0)) { - iDesiredCY = GetSystemMetrics(bIsIcon ? + iDesiredCY = GetSystemMetrics(bIsIcon ? SM_CYICON : SM_CYCURSOR); - iDesiredCX = GetSystemMetrics(bIsIcon ? + iDesiredCX = GetSystemMetrics(bIsIcon ? SM_CXICON : SM_CXCURSOR); } - /* Retrieve the CURSORICONDIRENTRY + /* Retrieve the CURSORICONDIRENTRY */ - if (!(hMem = LoadResource( pIconCache->hModule , - pIconCache->hGroupRsrc))) + if (!(hMem = LoadResource( pIconCache->hModule , + pIconCache->hGroupRsrc))) { return 0; } - if (!(pDir = (CURSORICONDIR*)LockResource( hMem ))) + if (!(pDir = (CURSORICONDIR*)LockResource( hMem ))) { return 0; } - /* Find Best Fit + /* Find Best Fit */ if(bIsIcon) { @@ -912,7 +912,7 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, } else { - pDirEntry = (CURSORICONDIRENTRY *)CURSORICON_FindBestCursor( + pDirEntry = (CURSORICONDIRENTRY *)CURSORICON_FindBestCursor( pDir, iDesiredCX, iDesiredCY, 1); } @@ -920,24 +920,24 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, dwBytesInRes = pDirEntry->dwBytesInRes; FreeResource(hMem); - TRACE_(icon)("ResID %u, BytesInRes %lu, Width %d, Height %d DX %d, DY %d\n", - wResId, dwBytesInRes, pDirEntry->ResInfo.icon.bWidth, + TRACE_(icon)("ResID %u, BytesInRes %lu, Width %d, Height %d DX %d, DY %d\n", + wResId, dwBytesInRes, pDirEntry->ResInfo.icon.bWidth, pDirEntry->ResInfo.icon.bHeight, iDesiredCX, iDesiredCY); /* Get the Best Fit */ if (!(hRsrc = FindResourceW(pIconCache->hModule , - MAKEINTRESOURCEW(wResId), bIsIcon ? RT_ICONW : RT_CURSORW))) + MAKEINTRESOURCEW(wResId), bIsIcon ? RT_ICONW : RT_CURSORW))) { return 0; } - if (!(hMem = LoadResource( pIconCache->hModule , hRsrc ))) + if (!(hMem = LoadResource( pIconCache->hModule , hRsrc ))) { return 0; } pBits = (LPBYTE)LockResource( hMem ); - + if(nFlags & LR_DEFAULTSIZE) { iTargetCY = GetSystemMetrics(SM_CYICON); @@ -946,7 +946,7 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, /* Create a New Icon with the proper dimension */ - hNew = CURSORICON_CreateFromResource( 0, 0, pBits, dwBytesInRes, + hNew = CURSORICON_CreateFromResource( 0, 0, pBits, dwBytesInRes, bIsIcon, 0x00030000, iTargetCX, iTargetCY, nFlags); FreeResource(hMem); } @@ -972,11 +972,11 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent) { hRet = CURSORICON_Copy( 0, hIcon ); - + pIcon = GlobalLock16(hRet); pIcon->ptHotSpot.x = pIcon->ptHotSpot.y = 15; - + GlobalUnlock16(hRet); } else @@ -990,7 +990,7 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent) CURSORICONINFO cI; - TRACE_(icon)("[%04x] %ix%i %ibpp (bogus %ibps)\n", + TRACE_(icon)("[%04x] %ix%i %ibpp (bogus %ibps)\n", hIcon, pIcon->nWidth, pIcon->nHeight, pIcon->bBitsPerPixel, pIcon->nWidthBytes ); xor_width = BITMAP_GetWidthBytes( pIcon->nWidth, bpp ); @@ -1008,9 +1008,9 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent) for( iy = 0; iy < maxy; iy++ ) { - unsigned shift = iy % 2; + unsigned shift = iy % 2; - memcpy( pAndBits + iy * 4, (BYTE *)(pIcon + 1) + iy * and_width, + memcpy( pAndBits + iy * 4, (BYTE *)(pIcon + 1) + iy * and_width, (and_width > 4) ? 4 : and_width ); for( ix = 0; ix < maxx; ix++ ) { @@ -1146,33 +1146,33 @@ HICON16 WINAPI CreateIcon16( HINSTANCE16 hInstance, INT16 nWidth, /*********************************************************************** * CreateIcon (USER32.@) * - * Creates an icon based on the specified bitmaps. The bitmaps must be - * provided in a device dependent format and will be resized to - * (SM_CXICON,SM_CYICON) and depth converted to match the screen's color + * Creates an icon based on the specified bitmaps. The bitmaps must be + * provided in a device dependent format and will be resized to + * (SM_CXICON,SM_CYICON) and depth converted to match the screen's color * depth. The provided bitmaps must be top-down bitmaps. - * Although Windows does not support 15bpp(*) this API must support it + * Although Windows does not support 15bpp(*) this API must support it * for Winelib applications. * - * (*) Windows does not support 15bpp but it supports the 555 RGB 16bpp + * (*) Windows does not support 15bpp but it supports the 555 RGB 16bpp * format! * * BUGS * * - The provided bitmaps are not resized! - * - The documentation says the lpXORbits bitmap must be in a device - * dependent format. But we must still resize it and perform depth + * - The documentation says the lpXORbits bitmap must be in a device + * dependent format. But we must still resize it and perform depth * conversions if necessary. * - I'm a bit unsure about the how the 'device dependent format' thing works. - * I did some tests on windows and found that if you provide a 16bpp bitmap - * in lpXORbits, then its format but be 565 RGB if the screen's bit depth + * I did some tests on windows and found that if you provide a 16bpp bitmap + * in lpXORbits, then its format but be 565 RGB if the screen's bit depth * is 16bpp but it must be 555 RGB if the screen's bit depth is anything - * else. I don't know if this is part of the GDI specs or if this is a + * else. I don't know if this is part of the GDI specs or if this is a * quirk of the graphics card driver. - * - You may think that we check whether the bit depths match or not - * as an optimization. But the truth is that the conversion using - * CreateDIBitmap does not work for some bit depth (e.g. 8bpp) and I have + * - You may think that we check whether the bit depths match or not + * as an optimization. But the truth is that the conversion using + * CreateDIBitmap does not work for some bit depth (e.g. 8bpp) and I have * no idea why. - * - I'm pretty sure that all the things we do in CreateIcon should + * - I'm pretty sure that all the things we do in CreateIcon should * also be done in CreateIconIndirect... */ HICON WINAPI CreateIcon( @@ -1304,8 +1304,8 @@ HCURSOR16 WINAPI CopyCursor16( HINSTANCE16 hInstance, HCURSOR16 hCursor ) * DestroyIcon32 (USER32.@) * * This routine is actually exported from Win95 USER under the name - * DestroyIcon32 ... The behaviour implemented here should mimic - * the Win95 one exactly, especially the return values, which + * DestroyIcon32 ... The behaviour implemented here should mimic + * the Win95 one exactly, especially the return values, which * depend on the setting of various flags. */ WORD WINAPI DestroyIcon32( HGLOBAL16 handle, UINT16 flags ) @@ -1571,7 +1571,7 @@ void WINAPI GetClipCursor16( RECT16 *rect ) */ BOOL WINAPI GetClipCursor( RECT *rect ) { - if (rect) + if (rect) { CopyRect( rect, &CURSOR_ClipRect ); return TRUE; @@ -1628,7 +1628,7 @@ INT WINAPI LookupIconIdFromDirectoryEx( LPBYTE dir, BOOL bIcon, */ INT16 WINAPI LookupIconIdFromDirectory16( LPBYTE dir, BOOL16 bIcon ) { - return LookupIconIdFromDirectoryEx16( dir, bIcon, + return LookupIconIdFromDirectoryEx16( dir, bIcon, bIcon ? GetSystemMetrics(SM_CXICON) : GetSystemMetrics(SM_CXCURSOR), bIcon ? GetSystemMetrics(SM_CYICON) : GetSystemMetrics(SM_CYCURSOR), bIcon ? 0 : LR_MONOCHROME ); } @@ -1638,7 +1638,7 @@ INT16 WINAPI LookupIconIdFromDirectory16( LPBYTE dir, BOOL16 bIcon ) */ INT WINAPI LookupIconIdFromDirectory( LPBYTE dir, BOOL bIcon ) { - return LookupIconIdFromDirectoryEx( dir, bIcon, + return LookupIconIdFromDirectoryEx( dir, bIcon, bIcon ? GetSystemMetrics(SM_CXICON) : GetSystemMetrics(SM_CXCURSOR), bIcon ? GetSystemMetrics(SM_CYICON) : GetSystemMetrics(SM_CYCURSOR), bIcon ? 0 : LR_MONOCHROME ); } @@ -1656,7 +1656,7 @@ WORD WINAPI GetIconID16( HGLOBAL16 hResource, DWORD resType ) switch(resType) { case RT_CURSOR16: - return (WORD)LookupIconIdFromDirectoryEx16( lpDir, FALSE, + return (WORD)LookupIconIdFromDirectoryEx16( lpDir, FALSE, GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR), LR_MONOCHROME ); case RT_ICON16: return (WORD)LookupIconIdFromDirectoryEx16( lpDir, TRUE, @@ -1674,14 +1674,14 @@ WORD WINAPI GetIconID16( HGLOBAL16 hResource, DWORD resType ) */ HGLOBAL16 WINAPI LoadCursorIconHandler16( HGLOBAL16 hResource, HMODULE16 hModule, HRSRC16 hRsrc ) { - FIXME_(cursor)("(%04x,%04x,%04x): old 2.x resources are not supported!\n", + FIXME_(cursor)("(%04x,%04x,%04x): old 2.x resources are not supported!\n", hResource, hModule, hRsrc); return (HGLOBAL16)0; } /********************************************************************** * LoadDIBIconHandler (USER.357) - * + * * RT_ICON resource loader, installed by USER_SignalProc when module * is initialized. */ @@ -1689,7 +1689,7 @@ HGLOBAL16 WINAPI LoadDIBIconHandler16( HGLOBAL16 hMemObj, HMODULE16 hModule, HRS { /* If hResource is zero we must allocate a new memory block, if it's * non-zero but GlobalLock() returns NULL then it was discarded and - * we have to recommit some memory, otherwise we just need to check + * we have to recommit some memory, otherwise we just need to check * the block size. See LoadProc() in 16-bit SDK for more. */ @@ -1697,8 +1697,8 @@ HGLOBAL16 WINAPI LoadDIBIconHandler16( HGLOBAL16 hMemObj, HMODULE16 hModule, HRS if( hMemObj ) { LPBYTE bits = (LPBYTE)GlobalLock16( hMemObj ); - hMemObj = CURSORICON_CreateFromResource( hModule, hMemObj, bits, - SizeofResource16(hModule, hRsrc), TRUE, 0x00030000, + hMemObj = CURSORICON_CreateFromResource( hModule, hMemObj, bits, + SizeofResource16(hModule, hRsrc), TRUE, 0x00030000, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR ); } return hMemObj; @@ -1731,7 +1731,7 @@ HICON16 WINAPI LoadIconHandler16( HGLOBAL16 hResource, BOOL16 bNew ) TRACE_(cursor)("hRes=%04x\n",hResource); - return CURSORICON_CreateFromResource( 0, 0, bits, 0, TRUE, + return CURSORICON_CreateFromResource( 0, 0, bits, 0, TRUE, bNew ? 0x00030000 : 0x00020000, 0, 0, LR_DEFAULTCOLOR ); } @@ -1740,7 +1740,7 @@ HICON16 WINAPI LoadIconHandler16( HGLOBAL16 hResource, BOOL16 bNew ) */ HCURSOR WINAPI LoadCursorW(HINSTANCE hInstance, LPCWSTR name) { - return LoadImageW( hInstance, name, IMAGE_CURSOR, 0, 0, + return LoadImageW( hInstance, name, IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -1749,7 +1749,7 @@ HCURSOR WINAPI LoadCursorW(HINSTANCE hInstance, LPCWSTR name) */ HCURSOR WINAPI LoadCursorA(HINSTANCE hInstance, LPCSTR name) { - return LoadImageA( hInstance, name, IMAGE_CURSOR, 0, 0, + return LoadImageA( hInstance, name, IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -1758,7 +1758,7 @@ HCURSOR WINAPI LoadCursorA(HINSTANCE hInstance, LPCSTR name) */ HCURSOR WINAPI LoadCursorFromFileW (LPCWSTR name) { - return LoadImageW( 0, name, IMAGE_CURSOR, 0, 0, + return LoadImageW( 0, name, IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE ); } @@ -1767,16 +1767,16 @@ HCURSOR WINAPI LoadCursorFromFileW (LPCWSTR name) */ HCURSOR WINAPI LoadCursorFromFileA (LPCSTR name) { - return LoadImageA( 0, name, IMAGE_CURSOR, 0, 0, + return LoadImageA( 0, name, IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE ); } - + /*********************************************************************** * LoadIconW (USER32.@) */ HICON WINAPI LoadIconW(HINSTANCE hInstance, LPCWSTR name) { - return LoadImageW( hInstance, name, IMAGE_ICON, 0, 0, + return LoadImageW( hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -1785,7 +1785,7 @@ HICON WINAPI LoadIconW(HINSTANCE hInstance, LPCWSTR name) */ HICON WINAPI LoadIconA(HINSTANCE hInstance, LPCSTR name) { - return LoadImageA( hInstance, name, IMAGE_ICON, 0, 0, + return LoadImageA( hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -1857,7 +1857,7 @@ HICON WINAPI CreateIconIndirect(PICONINFO iconinfo) sizeXor = bmpXor.bmHeight * bmpXor.bmWidthBytes; sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes; - hObj = GlobalAlloc16( GMEM_MOVEABLE, + hObj = GlobalAlloc16( GMEM_MOVEABLE, sizeof(CURSORICONINFO) + sizeXor + sizeAnd ); if (hObj) { @@ -1927,7 +1927,7 @@ BOOL16 WINAPI DrawIconEx16 (HDC16 hdc, INT16 xLeft, INT16 yTop, HICON16 hIcon, * Failure: FALSE */ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon, - INT cxWidth, INT cyWidth, UINT istep, + INT cxWidth, INT cyWidth, UINT istep, HBRUSH hbr, UINT flags ) { CURSORICONINFO *ptr = (CURSORICONINFO *)GlobalLock16 (hIcon); @@ -2007,17 +2007,17 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon, HBITMAP hBitTemp = SelectObject( hMemDC, hAndBits ); if (flags & DI_MASK) { - if (DoOffscreen) + if (DoOffscreen) StretchBlt (hDC_off, 0, 0, cxWidth, cyWidth, hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCAND); - else + else StretchBlt (hdc, x0, y0, cxWidth, cyWidth, hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCAND); } SelectObject( hMemDC, hXorBits ); if (flags & DI_IMAGE) { - if (DoOffscreen) + if (DoOffscreen) StretchBlt (hDC_off, 0, 0, cxWidth, cyWidth, hMemDC, 0, 0, ptr->nWidth, ptr->nHeight, SRCPAINT); else @@ -2077,8 +2077,8 @@ static void DIB_FixColorsToLoadflags(BITMAPINFO * bmi, UINT loadflags, BYTE pix) case 1: pix = pix >> 7; break; case 4: pix = pix >> 4; break; case 8: break; - default: - WARN_(resource)("(%d): Unsupported depth\n", bmi->bmiHeader.biBitCount); + default: + WARN_(resource)("(%d): Unsupported depth\n", bmi->bmiHeader.biBitCount); return; } if (pix >= colors) { @@ -2095,19 +2095,19 @@ static void DIB_FixColorsToLoadflags(BITMAPINFO * bmi, UINT loadflags, BYTE pix) for (i=0; ibmiColors+i*incr); c_C = RGB(ptr->rgbRed, ptr->rgbGreen, ptr->rgbBlue); - if (c_C == RGB(128, 128, 128)) { + if (c_C == RGB(128, 128, 128)) { ptr->rgbRed = GetRValue(c_S); ptr->rgbGreen = GetGValue(c_S); ptr->rgbBlue = GetBValue(c_S); - } else if (c_C == RGB(192, 192, 192)) { + } else if (c_C == RGB(192, 192, 192)) { ptr->rgbRed = GetRValue(c_F); ptr->rgbGreen = GetGValue(c_F); ptr->rgbBlue = GetBValue(c_F); - } else if (c_C == RGB(223, 223, 223)) { + } else if (c_C == RGB(223, 223, 223)) { ptr->rgbRed = GetRValue(c_L); ptr->rgbGreen = GetGValue(c_L); ptr->rgbBlue = GetBValue(c_L); - } + } } } @@ -2187,7 +2187,7 @@ HANDLE16 WINAPI LoadImage16( HINSTANCE16 hinst, LPCSTR name, UINT16 type, /********************************************************************** * LoadImageA (USER32.@) - * + * * FIXME: implementation lacks some features, see LR_ defines in winuser.h */ diff --git a/windows/dce.c b/windows/dce.c index 4d0d41c5a55..ab395a97235 100644 --- a/windows/dce.c +++ b/windows/dce.c @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * - * Note: Visible regions of CS_OWNDC/CS_CLASSDC window DCs - * have to be updated dynamically. - * + * Note: Visible regions of CS_OWNDC/CS_CLASSDC window DCs + * have to be updated dynamically. + * * Internal DCX flags: * * DCX_DCEEMPTY - dce is uninitialized @@ -57,16 +57,16 @@ static INT DCE_ReleaseDC( DCE* ); static void DCE_DumpCache(void) { DCE *dce; - + USER_Lock(); dce = firstDCE; - + DPRINTF("DCE:\n"); while( dce ) { DPRINTF("\t[0x%08x] hWnd 0x%04x, dcx %08x, %s %s\n", - (unsigned)dce, dce->hwndCurrent, (unsigned)dce->DCXflags, - (dce->DCXflags & DCX_CACHE) ? "Cache" : "Owned", + (unsigned)dce, dce->hwndCurrent, (unsigned)dce->DCXflags, + (dce->DCXflags & DCX_CACHE) ? "Cache" : "Owned", (dce->DCXflags & DCX_DCEBUSY) ? "InUse" : "" ); dce = dce->next; } @@ -82,7 +82,7 @@ static void DCE_DumpCache(void) DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type ) { DCE * dce; - + if (!(dce = HeapAlloc( GetProcessHeap(), 0, sizeof(DCE) ))) return NULL; if (!(dce->hDC = CreateDCA( "DISPLAY", NULL, NULL, NULL ))) { @@ -110,7 +110,7 @@ DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type ) SetHookFlags16(dce->hDC,DCHF_INVALIDATEVISRGN); } else dce->DCXflags = DCX_CACHE | DCX_DCEEMPTY; - + USER_Lock(); dce->next = firstDCE; firstDCE = dce; @@ -180,10 +180,10 @@ void DCE_FreeWindowDCE( HWND hwnd ) { if( pDCE->DCXflags & DCX_DCEBUSY ) /* shared cache DCE */ { - /* FIXME: AFAICS we are doing the right thing here so - * this should be a WARN. But this is best left as an ERR - * because the 'application error' is likely to come from - * another part of Wine (i.e. it's our fault after all). + /* FIXME: AFAICS we are doing the right thing here so + * this should be a WARN. But this is best left as an ERR + * because the 'application error' is likely to come from + * another part of Wine (i.e. it's our fault after all). * We should change this to WARN when Wine is more stable * (for 1.0?). */ @@ -244,7 +244,7 @@ static INT DCE_ReleaseDC( DCE* dce ) dce->DCXflags &= ~DCX_DCEBUSY; if (dce->DCXflags & DCX_DCEDIRTY) { - /* don't keep around invalidated entries + /* don't keep around invalidated entries * because SetDCState() disables hVisRgn updates * by removing dirty bit. */ @@ -277,7 +277,7 @@ BOOL DCE_InvalidateDCE(HWND hwnd, const RECT* pRectUpdate) TRACE("scope hwnd = %04x, (%i,%i - %i,%i)\n", hwndScope, pRectUpdate->left,pRectUpdate->top, pRectUpdate->right,pRectUpdate->bottom); - if(TRACE_ON(dc)) + if(TRACE_ON(dc)) DCE_DumpCache(); /* walk all DCEs and fixup non-empty entries */ @@ -328,7 +328,7 @@ BOOL DCE_InvalidateDCE(HWND hwnd, const RECT* pRectUpdate) /*********************************************************************** * DCE_ExcludeRgn - * + * * Translate given region from the wnd client to the DC coordinates * and add it to the clipping region. */ @@ -371,7 +371,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags ) BOOL bUpdateClipOrigin = FALSE; HWND parent, full; - TRACE("hwnd %04x, hrgnClip %04x, flags %08x\n", + TRACE("hwnd %04x, hrgnClip %04x, flags %08x\n", hwnd, hrgnClip, (unsigned)flags); if (!hwnd) hwnd = GetDesktopWindow(); @@ -425,7 +425,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags ) /* find a suitable DCE */ - dcxFlags = flags & (DCX_PARENTCLIP | DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | + dcxFlags = flags & (DCX_PARENTCLIP | DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_CACHE | DCX_WINDOW); if (flags & DCX_CACHE) @@ -453,9 +453,9 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags ) ((dce->DCXflags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_CACHE | DCX_WINDOW | DCX_PARENTCLIP)) == dcxFlags)) { - TRACE("\tfound valid %08x dce [%04x], flags %08x\n", + TRACE("\tfound valid %08x dce [%04x], flags %08x\n", (unsigned)dce, hwnd, (unsigned)dcxFlags ); - bUpdateVisRgn = FALSE; + bUpdateVisRgn = FALSE; bUpdateClipOrigin = TRUE; break; } @@ -463,14 +463,14 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags ) } if (!dce) dce = (dceEmpty) ? dceEmpty : dceUnused; - + /* if there's no dce empty or unused, allocate a new one */ if (!dce) { dce = DCE_AllocDCE( 0, DCE_CACHE_DC ); } } - else + else { dce = wndPtr->dce; if (dce && dce->hwndCurrent == hwnd) @@ -545,8 +545,8 @@ HDC WINAPI GetWindowDC( HWND hwnd ) * 1: Success * 0: Failure */ -INT WINAPI ReleaseDC( - HWND hwnd /* [in] Handle of window - ignored */, +INT WINAPI ReleaseDC( + HWND hwnd /* [in] Handle of window - ignored */, HDC hdc /* [in] Handle of device context */ ) { DCE * dce; @@ -554,12 +554,12 @@ INT WINAPI ReleaseDC( USER_Lock(); dce = firstDCE; - + TRACE("%04x %04x\n", hwnd, hdc ); - + while (dce && (dce->hDC != hdc)) dce = dce->next; - if ( dce ) + if ( dce ) if ( dce->DCXflags & DCX_DCEBUSY ) nRet = DCE_ReleaseDC( dce ); @@ -571,7 +571,7 @@ INT WINAPI ReleaseDC( /*********************************************************************** * DCHook (USER.362) * - * See "Undoc. Windows" for hints (DC, SetDCHook, SetHookFlags).. + * See "Undoc. Windows" for hints (DC, SetDCHook, SetHookFlags).. */ BOOL16 WINAPI DCHook16( HDC16 hDC, WORD code, DWORD data, LPARAM lParam ) { @@ -637,12 +637,12 @@ HWND WINAPI WindowFromDC( HDC hDC ) USER_Lock(); dce = firstDCE; - + while (dce && (dce->hDC != hDC)) dce = dce->next; hwnd = dce ? dce->hwndCurrent : 0; USER_Unlock(); - + return hwnd; } diff --git a/windows/defdlg.c b/windows/defdlg.c index de1184880f7..018348d3e9e 100644 --- a/windows/defdlg.c +++ b/windows/defdlg.c @@ -134,10 +134,10 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo, { DWORD dlgcode=0; /* initialize just to avoid a warning */ if (hwndNew && - !((dlgcode=SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 )) + !((dlgcode=SendMessageW(hwndNew, WM_GETDLGCODE, 0, 0 )) & (DLGC_UNDEFPUSHBUTTON | DLGC_BUTTON))) return FALSE; /* Destination is not a push button */ - + if (dlgInfo->idResult) /* There's already a default pushbutton */ { HWND hwndOld = GetDlgItem( hwndDlg, dlgInfo->idResult ); @@ -251,14 +251,14 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam, } return DefWindowProcA( hwnd, msg, wParam, lParam ); - case WM_GETFONT: + case WM_GETFONT: return dlgInfo->hUserFont; case WM_CLOSE: PostMessageA( hwnd, WM_COMMAND, IDCANCEL, (LPARAM)GetDlgItem( hwnd, IDCANCEL ) ); return 0; - + case WM_NOTIFYFORMAT: return DefWindowProcA( hwnd, msg, wParam, lParam ); } @@ -276,7 +276,7 @@ static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, BOOL fResult) msg == WM_CTLCOLOR || msg == WM_COMPAREITEM || msg == WM_VKEYTOITEM || msg == WM_CHARTOITEM || msg == WM_QUERYDRAGICON || msg == WM_INITDIALOG) - return fResult; + return fResult; return GetWindowLongA( hwnd, DWL_MSGRESULT ); } diff --git a/windows/defwnd.c b/windows/defwnd.c index 240a7562a56..6d0b02c573d 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -160,9 +160,9 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) SetTextColor( hDC, GetSysColor(COLOR_3DFACE)); SetBkColor( hDC, bk); - /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT + /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT * we better use 0x55aa bitmap brush to make scrollbar's background - * look different from the window background. + * look different from the window background. */ if (bk == GetSysColor(COLOR_WINDOW)) { return CACHE_GetPattern55AABrush(); @@ -373,9 +373,9 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_NCRBUTTONUP: /* - * FIXME : we must NOT send WM_CONTEXTMENU on a WM_NCRBUTTONUP (checked - * in Windows), but what _should_ we do? According to MSDN : - * "If it is appropriate to do so, the system sends the WM_SYSCOMMAND + * FIXME : we must NOT send WM_CONTEXTMENU on a WM_NCRBUTTONUP (checked + * in Windows), but what _should_ we do? According to MSDN : + * "If it is appropriate to do so, the system sends the WM_SYSCOMMAND * message to the window". When is it appropriate? */ break; @@ -428,7 +428,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa { PAINTSTRUCT ps; HDC hdc = BeginPaint( hwnd, &ps ); - if( hdc ) + if( hdc ) { HICON hIcon; if (IsIconic(hwnd) && ((hIcon = GetClassLongW( hwnd, GCL_HICON))) ) @@ -467,7 +467,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa if (ret) return ret; } - /* Caption clicks are handled by the NC_HandleNCLButtonDown() */ + /* Caption clicks are handled by the NC_HandleNCLButtonDown() */ return (LOWORD(lParam) >= HTCLIENT) ? MA_ACTIVATE : MA_NOACTIVATE; case WM_ACTIVATE: @@ -516,7 +516,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_CTLCOLOR: return (LRESULT)DEFWND_ControlColor( (HDC)wParam, HIWORD(lParam) ); - + case WM_SETCURSOR: if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD) { @@ -545,7 +545,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa iMenuSysKey = 1; else iMenuSysKey = 0; - + iF10Key = 0; if( wParam == VK_F4 ) /* try to close the window */ @@ -554,7 +554,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa if (!(GetClassLongW( top, GCL_STYLE ) & CS_NOCLOSE)) PostMessageW( top, WM_SYSCOMMAND, SC_CLOSE, 0 ); } - } + } else if( wParam == VK_F10 ) iF10Key = 1; else @@ -577,7 +577,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa { PostMessageW( hwnd, WM_SYSCOMMAND, SC_RESTORE, 0L ); break; - } + } if ((HIWORD(lParam) & KEYDATA_ALT) && wParam) { if (wParam == VK_TAB || wParam == VK_ESCAPE) break; @@ -585,7 +585,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa SendMessageW( GetParent(hwnd), msg, wParam, lParam ); else SendMessageW( hwnd, WM_SYSCOMMAND, SC_KEYMENU, wParam ); - } + } else /* check for Ctrl-Esc */ if (wParam != VK_ESCAPE) MessageBeep(0); break; @@ -612,7 +612,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa return -1; case WM_DROPOBJECT: - return DRAG_FILE; + return DRAG_FILE; case WM_QUERYDROPOBJECT: return (GetWindowLongA( hwnd, GWL_EXSTYLE ) & WS_EX_ACCEPTFILES) != 0; @@ -642,7 +642,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_NOTIFYFORMAT: if (IsWindowUnicode(hwnd)) return NFR_UNICODE; else return NFR_ANSI; - + case WM_QUERYOPEN: case WM_QUERYENDSESSION: return 1; @@ -871,14 +871,14 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam /*********************************************************************** * DefWindowProcW (USER32.@) Calls default window message handler - * - * Calls default window procedure for messages not processed + * + * Calls default window procedure for messages not processed * by application. * * RETURNS * Return value is dependent upon the message. */ -LRESULT WINAPI DefWindowProcW( +LRESULT WINAPI DefWindowProcW( HWND hwnd, /* [in] window procedure receiving message */ UINT msg, /* [in] message identifier */ WPARAM wParam, /* [in] first message parameter */ diff --git a/windows/dialog.c b/windows/dialog.c index 1e31de09660..453c8f02f0d 100644 --- a/windows/dialog.c +++ b/windows/dialog.c @@ -19,7 +19,7 @@ */ #include "config.h" -#include "wine/port.h" +#include "wine/port.h" #include #include @@ -84,7 +84,7 @@ typedef struct } DLG_TEMPLATE; /* Radio button group */ -typedef struct +typedef struct { UINT firstID; UINT lastID; @@ -141,7 +141,7 @@ BOOL DIALOG_DisableOwner( HWND hOwner ) if (IsWindowEnabled( hOwner )) { EnableWindow( hOwner, FALSE ); - return TRUE; + return TRUE; } else return FALSE; @@ -166,7 +166,7 @@ static BOOL DIALOG_GetCharSizeFromDC( HDC hDC, HFONT hFont, SIZE * pSize ) pSize->cx = xBaseUnit; pSize->cy = yBaseUnit; - if(!hDC) return FALSE; + if(!hDC) return FALSE; if(hFont) hFontPrev = SelectFont(hDC, hFont); if(!GetTextMetricsA(hDC, &tm)) return FALSE; @@ -189,7 +189,7 @@ static BOOL DIALOG_GetCharSizeFromDC( HDC hDC, HFONT hFont, SIZE * pSize ) static BOOL DIALOG_GetCharSize( HFONT hFont, SIZE * pSize ) { HDC hDC = GetDC(0); - BOOL Success = DIALOG_GetCharSizeFromDC( hDC, hFont, pSize ); + BOOL Success = DIALOG_GetCharSizeFromDC( hDC, hFont, pSize ); ReleaseDC(0, hDC); return Success; } @@ -262,7 +262,7 @@ static LPCSTR DIALOG_GetControl16( LPCSTR p, DLG_CONTROL_INFO *info ) info->className = buffer; p++; } - else + else { info->className = p; p += strlen(p) + 1; @@ -377,7 +377,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info, p += strlenW( (LPCWSTR)p ) + 1; } - TRACE(" %s %s %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", + TRACE(" %s %s %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n", debugstr_w( (LPCWSTR)info->className ), debugstr_w( (LPCWSTR)info->windowName ), info->id, info->x, info->y, info->cx, info->cy, @@ -492,7 +492,7 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT hwndDefButton = hwndCtrl; dlgInfo->idResult = GetWindowLongA( hwndCtrl, GWL_ID ); } - } + } TRACE(" END\n" ); return TRUE; } @@ -790,7 +790,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate, if( !(template.style & DS_ABSALIGN) ) ClientToScreen( owner, (POINT *)&rect ); - + /* try to fit it into the desktop */ if( (dX = rect.left + rect.right + GetSystemMetrics(SM_CXDLGFRAME) @@ -872,7 +872,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate, if ((GetFocus() == hwndPreInitFocus) && (GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) { - dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); + dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE); if( dlgInfo->hwndFocus ) SetFocus( dlgInfo->hwndFocus ); } @@ -1234,7 +1234,7 @@ BOOL WINAPI EndDialog( HWND hwnd, INT retval ) | SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW); /* unblock dialog loop */ - PostMessageA(hwnd, WM_NULL, 0, 0); + PostMessageA(hwnd, WM_NULL, 0, 0); return TRUE; } @@ -1396,7 +1396,7 @@ static BOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg, return TRUE; } break; - + case VK_RIGHT: case VK_DOWN: case VK_LEFT: @@ -1404,7 +1404,7 @@ static BOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg, if (!(dlgCode & DLGC_WANTARROWS)) { BOOL fPrevious = (wParam == VK_LEFT || wParam == VK_UP); - HWND hwndNext = + HWND hwndNext = GetNextDlgGroupItem (hwndDlg, GetFocus(), fPrevious ); SendMessageA( hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndNext, 1 ); return TRUE; @@ -1421,7 +1421,7 @@ static BOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg, DWORD dw = SendMessageW( hwndDlg, DM_GETDEFID, 0, 0 ); if (HIWORD(dw) == DC_HASDEFID) { - SendMessageA( hwndDlg, WM_COMMAND, + SendMessageA( hwndDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)GetDlgItem(hwndDlg, LOWORD(dw))); } @@ -1429,7 +1429,7 @@ static BOOL DIALOG_IsDialogMessage( HWND hwnd, HWND hwndDlg, { SendMessageA( hwndDlg, WM_COMMAND, IDOK, (LPARAM)GetDlgItem( hwndDlg, IDOK ) ); - + } } return TRUE; @@ -1653,7 +1653,7 @@ UINT WINAPI GetDlgItemInt( HWND hwnd, INT id, BOOL *translated, char str[30]; char * endptr; long result = 0; - + if (translated) *translated = FALSE; if (!SendDlgItemMessageA(hwnd, id, WM_GETTEXT, sizeof(str), (LPARAM)str)) return 0; @@ -1698,8 +1698,8 @@ UINT WINAPI IsDlgButtonChecked( HWND hwnd, UINT id ) /*********************************************************************** * CheckRB - * - * Callback function used to check/uncheck radio buttons that fall + * + * Callback function used to check/uncheck radio buttons that fall * within a specific range of IDs. */ static BOOL CALLBACK CheckRB(HWND hwndChild, LPARAM lParam) @@ -1707,7 +1707,7 @@ static BOOL CALLBACK CheckRB(HWND hwndChild, LPARAM lParam) LONG lChildID = GetWindowLongA(hwndChild, GWL_ID); RADIOGROUP *lpRadioGroup = (RADIOGROUP *) lParam; - if ((lChildID >= lpRadioGroup->firstID) && + if ((lChildID >= lpRadioGroup->firstID) && (lChildID <= lpRadioGroup->lastID)) { if (lChildID == lpRadioGroup->checkID) @@ -1736,8 +1736,8 @@ BOOL WINAPI CheckRadioButton( HWND hwndDlg, UINT firstID, radioGroup.firstID = min(min(firstID, lastID), checkID); radioGroup.lastID = max(max(firstID, lastID), checkID); radioGroup.checkID = checkID; - - return EnumChildWindows(hwndDlg, (WNDENUMPROC)CheckRB, + + return EnumChildWindows(hwndDlg, (WNDENUMPROC)CheckRB, (LPARAM)&radioGroup); } @@ -1840,7 +1840,7 @@ static HWND DIALOG_GetNextTabItem( HWND hwndMain, HWND hwndDlg, HWND hwndCtrl, B HWND retWnd = 0; HWND hChildFirst = 0; - if(!hwndCtrl) + if(!hwndCtrl) { hChildFirst = GetWindow(hwndDlg,GW_CHILD); if(fPrevious) hChildFirst = GetWindow(hChildFirst,GW_HWNDLAST); @@ -1912,7 +1912,7 @@ HWND WINAPI GetNextDlgTabItem( HWND hwndDlg, HWND hwndCtrl, { hwndDlg = WIN_GetFullHandle( hwndDlg ); hwndCtrl = WIN_GetFullHandle( hwndCtrl ); - return DIALOG_GetNextTabItem(hwndDlg,hwndDlg,hwndCtrl,fPrevious); + return DIALOG_GetNextTabItem(hwndDlg,hwndDlg,hwndCtrl,fPrevious); } /********************************************************************** diff --git a/windows/driver.c b/windows/driver.c index 02d250cfb7c..ff30f293b32 100644 --- a/windows/driver.c +++ b/windows/driver.c @@ -48,7 +48,7 @@ typedef struct tagWINE_DRIVER static LPWINE_DRIVER lpDrvItemList = NULL; /* TODO list : - * - LoadModule count and clean up is not handled correctly (it's not a + * - LoadModule count and clean up is not handled correctly (it's not a * problem as long as FreeLibrary is not working correctly) */ @@ -62,7 +62,7 @@ extern LONG CALLBACK DRIVER_CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LO static void WINE_UNUSED DRIVER_LoadStartupDrivers(void) { char str[256]; - + if (GetPrivateProfileStringA("drivers", NULL, "", str, sizeof(str), "SYSTEM.INI") < 2) { ERR("Can't find drivers section in system.ini\n"); } else { @@ -87,7 +87,7 @@ static WORD DRIVER_GetNumberOfModuleRefs(LPWINE_DRIVER lpNewDrv) { LPWINE_DRIVER lpDrv; WORD count = 0; - + for (lpDrv = lpDrvItemList; lpDrv; lpDrv = lpDrv->lpNextItem) { if (lpDrv->hModule16 == lpNewDrv->hModule16) { count++; @@ -102,9 +102,9 @@ static WORD DRIVER_GetNumberOfModuleRefs(LPWINE_DRIVER lpNewDrv) * From a hDrvr being 16 bits, returns the WINE internal structure. */ static LPWINE_DRIVER DRIVER_FindFromHDrvr16(HDRVR16 hDrvr) -{ +{ LPWINE_DRIVER lpDrv; - + for (lpDrv = lpDrvItemList; lpDrv; lpDrv = lpDrv->lpNextItem) { if (lpDrv->hDriver16 == hDrvr) { break; @@ -116,10 +116,10 @@ static LPWINE_DRIVER DRIVER_FindFromHDrvr16(HDRVR16 hDrvr) /************************************************************************** * DRIVER_SendMessage [internal] */ -static LRESULT inline DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT16 msg, +static LRESULT inline DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT16 msg, LPARAM lParam1, LPARAM lParam2) { - TRACE("Before CallDriverProc proc=%p driverID=%08lx wMsg=%04x p1=%08lx p2=%08lx\n", + TRACE("Before CallDriverProc proc=%p driverID=%08lx wMsg=%04x p1=%08lx p2=%08lx\n", lpDrv->lpDrvProc, lpDrv->dwDriverID, msg, lParam1, lParam2); return DRIVER_CallTo16_long_lwwll((FARPROC16)lpDrv->lpDrvProc, lpDrv->dwDriverID, lpDrv->hDriver16, msg, lParam1, lParam2); @@ -134,15 +134,15 @@ LRESULT WINAPI SendDriverMessage16(HDRVR16 hDriver, UINT16 msg, LPARAM lParam1, { LPWINE_DRIVER lpDrv; LRESULT retval = 0; - + TRACE("(%04x, %04X, %08lX, %08lX)\n", hDriver, msg, lParam1, lParam2); - + if ((lpDrv = DRIVER_FindFromHDrvr16(hDriver)) != NULL) { retval = DRIVER_SendMessage(lpDrv, msg, lParam1, lParam2); } else { WARN("Bad driver handle %u\n", hDriver); } - + TRACE("retval = %ld\n", retval); return retval; } @@ -160,7 +160,7 @@ static BOOL DRIVER_RemoveFromList(LPWINE_DRIVER lpDrv) DRIVER_SendMessage(lpDrv, DRV_DISABLE, 0L, 0L); DRIVER_SendMessage(lpDrv, DRV_FREE, 0L, 0L); } - + if (lpDrv->lpPrevItem) lpDrv->lpPrevItem->lpNextItem = lpDrv->lpNextItem; else @@ -197,7 +197,7 @@ static BOOL DRIVER_AddToList(LPWINE_DRIVER lpNewDrv, LPARAM lParam1, LPARAM lPar LPWINE_DRIVER lpDrv = lpDrvItemList; /* find end of list */ while (lpDrv->lpNextItem != NULL) lpDrv = lpDrv->lpNextItem; - + lpDrv->lpNextItem = lpNewDrv; lpNewDrv->lpPrevItem = lpDrv; } @@ -209,7 +209,7 @@ static BOOL DRIVER_AddToList(LPWINE_DRIVER lpNewDrv, LPARAM lParam1, LPARAM lPar DRIVER_RemoveFromList(lpNewDrv); return FALSE; } - + return TRUE; } @@ -226,7 +226,7 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam2) DRIVERPROC16 lpProc; LPCSTR lpSFN; LPSTR ptr; - + TRACE("('%s', %08lX);\n", lpFileName, lParam2); if (strlen(lpFileName) < 1) return lpDrv; @@ -240,7 +240,7 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam2) while (*ptr == ' ') ptr++; if (*ptr == '\0') ptr = NULL; } - + if ((hModule = LoadLibrary16(lpFileName)) < 32) goto exit; if ((lpProc = (DRIVERPROC16)GetProcAddress16(hModule, "DRIVERPROC")) == NULL) goto exit; @@ -254,7 +254,7 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam2) lstrcpynA(lpDrv->szAliasName, lpSFN, sizeof(lpDrv->szAliasName)); lpDrv->hModule16 = hModule; lpDrv->lpDrvProc = lpProc; - + if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, lParam2)) goto exit; return lpDrv; @@ -280,13 +280,13 @@ HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lP if (lpSectionName == NULL) { strcpy(drvName, lpDriverName); - + if ((lpDrv = DRIVER_TryOpenDriver16(drvName, lParam2))) goto the_end; /* in case hDriver is NULL, search in Drivers section */ lpSectionName = "Drivers"; } - if (GetPrivateProfileStringA(lpSectionName, lpDriverName, "", + if (GetPrivateProfileStringA(lpSectionName, lpDriverName, "", drvName, sizeof(drvName), "SYSTEM.INI") > 0) { lpDrv = DRIVER_TryOpenDriver16(drvName, lParam2); } @@ -308,10 +308,10 @@ LRESULT WINAPI CloseDriver16(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2) LPWINE_DRIVER lpDrv; TRACE("(%04x, %08lX, %08lX);\n", hDrvr, lParam1, lParam2); - + if ((lpDrv = DRIVER_FindFromHDrvr16(hDrvr)) != NULL) { DRIVER_SendMessage(lpDrv, DRV_CLOSE, lParam1, lParam2); - + if (DRIVER_RemoveFromList(lpDrv)) { HeapFree(GetProcessHeap(), 0, lpDrv); return TRUE; @@ -329,9 +329,9 @@ HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDrvr) { LPWINE_DRIVER lpDrv; HMODULE16 hModule = 0; - + TRACE("(%04x);\n", hDrvr); - + if ((lpDrv = DRIVER_FindFromHDrvr16(hDrvr)) != NULL) { hModule = lpDrv->hModule16; } @@ -343,29 +343,29 @@ HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDrvr) * DefDriverProc (USER.255) * DefDriverProc16 (USER32.@) */ -LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, +LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, LPARAM lParam1, LPARAM lParam2) { TRACE("devID=0x%08lx hDrv=0x%04x wMsg=%04x lP1=0x%08lx lP2=0x%08lx\n", dwDevID, hDriv, wMsg, lParam1, lParam2); switch(wMsg) { - case DRV_LOAD: - case DRV_FREE: + case DRV_LOAD: + case DRV_FREE: case DRV_ENABLE: case DRV_DISABLE: return (LRESULT)1L; - case DRV_OPEN: - case DRV_CLOSE: + case DRV_OPEN: + case DRV_CLOSE: case DRV_QUERYCONFIGURE: return (LRESULT)0L; - case DRV_CONFIGURE: - MessageBoxA(0, "Driver isn't configurable !", "Wine Driver", MB_OK); + case DRV_CONFIGURE: + MessageBoxA(0, "Driver isn't configurable !", "Wine Driver", MB_OK); return (LRESULT)0L; - case DRV_INSTALL: - case DRV_REMOVE: + case DRV_INSTALL: + case DRV_REMOVE: return DRV_SUCCESS; - default: + default: return (LRESULT)0L; } } @@ -377,19 +377,19 @@ BOOL16 WINAPI GetDriverInfo16(HDRVR16 hDrvr, LPDRIVERINFOSTRUCT16 lpDrvInfo) { LPWINE_DRIVER lpDrv; BOOL16 ret = FALSE; - + TRACE("(%04x, %p);\n", hDrvr, lpDrvInfo); - - if (lpDrvInfo == NULL || lpDrvInfo->length != sizeof(DRIVERINFOSTRUCT16)) + + if (lpDrvInfo == NULL || lpDrvInfo->length != sizeof(DRIVERINFOSTRUCT16)) return FALSE; - + if ((lpDrv = DRIVER_FindFromHDrvr16(hDrvr)) != NULL) { lpDrvInfo->hDriver = lpDrv->hDriver16; lpDrvInfo->hModule = lpDrv->hModule16; lstrcpynA(lpDrvInfo->szAliasName, lpDrv->szAliasName, sizeof(lpDrvInfo->szAliasName)); ret = TRUE; } - + return ret; } @@ -400,16 +400,16 @@ HDRVR16 WINAPI GetNextDriver16(HDRVR16 hDrvr, DWORD dwFlags) { HDRVR16 hRetDrv = 0; LPWINE_DRIVER lpDrv; - + TRACE("(%04x, %08lX);\n", hDrvr, dwFlags); - + if (hDrvr == 0) { if (lpDrvItemList == NULL) { FIXME("drivers list empty !\n"); - /* FIXME: code was using DRIVER_LoadStartupDrivers(); before ? - * I (EPP) don't quite understand this + /* FIXME: code was using DRIVER_LoadStartupDrivers(); before ? + * I (EPP) don't quite understand this */ - if (lpDrvItemList == NULL) + if (lpDrvItemList == NULL) return 0; } lpDrv = lpDrvItemList; @@ -426,7 +426,7 @@ HDRVR16 WINAPI GetNextDriver16(HDRVR16 hDrvr, DWORD dwFlags) } } } - + hRetDrv = (lpDrv) ? lpDrv->hDriver16 : (HDRVR16)0; TRACE("return %04x !\n", hRetDrv); return hRetDrv; diff --git a/windows/focus.c b/windows/focus.c index 3d4db25f6f3..61898dae5db 100644 --- a/windows/focus.c +++ b/windows/focus.c @@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); /***************************************************************** - * FOCUS_SwitchFocus + * FOCUS_SwitchFocus * pMsgQ is the queue whose perQData focus is to be modified */ void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND hFocusFrom, HWND hFocusTo ) @@ -112,13 +112,13 @@ HWND WINAPI SetFocus( HWND hwnd ) /* Get the current focus window from the perQ data */ hWndFocus = PERQDATA_GetFocusWnd( pMsgQ->pQData ); - + if( hwnd == hWndFocus ) { bRet = 1; /* Success */ goto CLEANUP; /* Nothing to do */ } - + /* call hooks */ if( HOOK_CallHooksA( WH_CBT, HCBT_SETFOCUS, (WPARAM)hwnd, (LPARAM)hWndFocus) ) goto CLEANUP; @@ -133,7 +133,7 @@ HWND WINAPI SetFocus( HWND hwnd ) /* Get the current focus window from the perQ data */ hWndFocus = PERQDATA_GetFocusWnd( pMsgQ->pQData ); - + /* Change focus and send messages */ FOCUS_SwitchFocus( pMsgQ, hWndFocus, hwnd ); } @@ -150,7 +150,7 @@ HWND WINAPI SetFocus( HWND hwnd ) } bRet = 1; /* Success */ - + CLEANUP: /* Unlock the queues before returning */ diff --git a/windows/hook.c b/windows/hook.c index 0f8bb6a9d75..c9ab59d418f 100644 --- a/windows/hook.c +++ b/windows/hook.c @@ -77,7 +77,7 @@ inline static LRESULT call_hook_16( HOOKPROC16 proc, INT id, INT code, WPARAM wp { LRESULT ret = HOOK_CallTo16_long_wwl( proc, code, wparam, lparam ); /* Grrr. While the hook procedure is supposed to have an LRESULT return - value even in Win16, it seems that for those hook types where the + value even in Win16, it seems that for those hook types where the return value is interpreted as BOOL, Windows doesn't actually check the HIWORD ... Some buggy Win16 programs, notably WINFILE, rely on that, because they neglect to clear DX ... */ @@ -674,7 +674,7 @@ static HHOOK HOOK_SetHook( INT16 id, LPVOID proc, INT type, data->next = HOOK_systemHooks[id - WH_MINHOOK]; HOOK_systemHooks[id - WH_MINHOOK] = handle; } - TRACE("Setting hook %d: ret=%04x [next=%04x]\n", + TRACE("Setting hook %d: ret=%04x [next=%04x]\n", id, handle, data->next ); return (HHOOK)( handle? MAKELONG( handle, HOOK_MAGIC ) : 0 ); @@ -703,7 +703,7 @@ static BOOL HOOK_RemoveHook( HANDLE16 hook ) } if (data->id == WH_JOURNALPLAYBACK) EnableHardwareInput16(TRUE); - + /* Remove it from the linked list */ if (data->ownerQueue) @@ -794,7 +794,7 @@ BOOL HOOK_IsHooked( INT16 id ) LRESULT HOOK_CallHooks16( INT16 id, INT16 code, WPARAM16 wParam, LPARAM lParam ) { - HANDLE16 hook; + HANDLE16 hook; if (!(hook = HOOK_GetHook( id ))) return 0; if (!(hook = HOOK_FindValidHook(hook))) return 0; @@ -809,7 +809,7 @@ LRESULT HOOK_CallHooks16( INT16 id, INT16 code, WPARAM16 wParam, LRESULT HOOK_CallHooksA( INT id, INT code, WPARAM wParam, LPARAM lParam ) { - HANDLE16 hook; + HANDLE16 hook; if (!(hook = HOOK_GetHook( id ))) return 0; if (!(hook = HOOK_FindValidHook(hook))) return 0; @@ -824,7 +824,7 @@ LRESULT HOOK_CallHooksA( INT id, INT code, WPARAM wParam, LRESULT HOOK_CallHooksW( INT id, INT code, WPARAM wParam, LPARAM lParam ) { - HANDLE16 hook; + HANDLE16 hook; if (!(hook = HOOK_GetHook( id ))) return 0; if (!(hook = HOOK_FindValidHook(hook))) return 0; @@ -1082,7 +1082,7 @@ BOOL16 WINAPI CallMsgFilter32_16( SEGPTR msg16_32, INT16 code, BOOL16 wHaveParam if (wHaveParamHigh == FALSE) { lpmsg16_32->wParamHigh = 0; - /* WARNING: msg16_32->msg has to be the first variable in the struct */ + /* WARNING: msg16_32->msg has to be the first variable in the struct */ return CallMsgFilter16(msg16_32, code); } else diff --git a/windows/input.c b/windows/input.c index 7e876abeebc..3b0dd958b22 100644 --- a/windows/input.c +++ b/windows/input.c @@ -2,7 +2,7 @@ * USER Input processing * * Copyright 1993 Bob Amstadt - * Copyright 1996 Albrecht Kleine + * Copyright 1996 Albrecht Kleine * Copyright 1997 David Faure * Copyright 1998 Morten Welinder * Copyright 1998 Ulrich Weigand @@ -599,14 +599,14 @@ HWND WINAPI GetCapture(void) /********************************************************************** * GetAsyncKeyState (USER32.@) * - * Determine if a key is or was pressed. retval has high-order + * Determine if a key is or was pressed. retval has high-order * bit set to 1 if currently pressed, low-order bit set to 1 if key has * been pressed. * * This uses the variable AsyncMouseButtonsStates and * AsyncKeyStateTable (set in event.c) which have the mouse button * number or key number (whichever is applicable) set to true if the - * mouse or key had been depressed since the last call to + * mouse or key had been depressed since the last call to * GetAsyncKeyState. */ SHORT WINAPI GetAsyncKeyState(INT nKey) @@ -768,7 +768,7 @@ INT16 WINAPI GetKeyboardLayoutName16(LPSTR pwszKLID) /*********************************************************************** * GetKeyboardLayout (USER32.@) * - * FIXME: - device handle for keyboard layout defaulted to + * FIXME: - device handle for keyboard layout defaulted to * the language id. This is the way Windows default works. * - the thread identifier (dwLayout) is also ignored. */ @@ -886,10 +886,10 @@ HKL WINAPI ActivateKeyboardLayout(HKL hLayout, UINT flags) /*********************************************************************** * GetKeyboardLayoutList (USER32.@) * - * FIXME: Supports only the system default language and layout and + * FIXME: Supports only the system default language and layout and * returns only 1 value. * - * Return number of values available if either input parm is + * Return number of values available if either input parm is * 0, per MS documentation. * */ @@ -928,7 +928,7 @@ HKL WINAPI LoadKeyboardLayoutA(LPCSTR pwszKLID, UINT Flags) { TRACE_(keyboard)("(%s, %d)\n", pwszKLID, Flags); ERR_(keyboard)("Only default system keyboard layout supported. Call ignored.\n"); - return 0; + return 0; } /*********************************************************************** @@ -937,7 +937,7 @@ HKL WINAPI LoadKeyboardLayoutA(LPCSTR pwszKLID, UINT Flags) HKL WINAPI LoadKeyboardLayoutW(LPCWSTR pwszKLID, UINT Flags) { char buf[9]; - + WideCharToMultiByte( CP_ACP, 0, pwszKLID, -1, buf, sizeof(buf), NULL, NULL ); buf[8] = 0; return LoadKeyboardLayoutA(buf, Flags); @@ -948,7 +948,7 @@ typedef struct __TRACKINGLIST { TRACKMOUSEEVENT tme; POINT pos; /* center of hover rectangle */ INT iHoverTime; /* elapsed time the cursor has been inside of the hover rect */ -} _TRACKINGLIST; +} _TRACKINGLIST; static _TRACKINGLIST TrackingList[10]; static int iTrackMax = 0; @@ -986,8 +986,8 @@ static void CALLBACK TrackMouseEventProc(HWND hwndUnused, UINT uMsg, UINT_PTR id /* see if we are tracking hovering for this hwnd */ if(TrackingList[i].tme.dwFlags & TME_HOVER) { /* add the timer interval to the hovering time */ - TrackingList[i].iHoverTime+=iTimerInterval; - + TrackingList[i].iHoverTime+=iTimerInterval; + /* has the cursor moved outside the rectangle centered around pos? */ if((abs(pos.x - TrackingList[i].pos.x) > (hoverwidth / 2.0)) || (abs(pos.y - TrackingList[i].pos.y) > (hoverheight / 2.0))) @@ -1016,7 +1016,7 @@ static void CALLBACK TrackMouseEventProc(HWND hwndUnused, UINT uMsg, UINT_PTR id TrackingList[i] = TrackingList[--iTrackMax]; } } - + /* stop the timer if the tracking list is empty */ if(iTrackMax == 0) { KillTimer(0, timer); @@ -1068,24 +1068,24 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme) } flags = ptme->dwFlags; - + /* if HOVER_DEFAULT was specified replace this with the systems current value */ if(ptme->dwHoverTime == HOVER_DEFAULT) SystemParametersInfoA(SPI_GETMOUSEHOVERTIME, 0, &(ptme->dwHoverTime), 0); GetCursorPos(&pos); - hwnd = WindowFromPoint(pos); + hwnd = WindowFromPoint(pos); if ( flags & TME_CANCEL ) { flags &= ~ TME_CANCEL; cancel = 1; } - + if ( flags & TME_HOVER ) { flags &= ~ TME_HOVER; hover = 1; } - + if ( flags & TME_LEAVE ) { flags &= ~ TME_LEAVE; leave = 1; @@ -1107,7 +1107,7 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme) *ptme = TrackingList[i].tme; else ptme->dwFlags = 0; - + return TRUE; /* return here, TME_QUERY is retrieving information */ } @@ -1130,7 +1130,7 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme) (TrackingList[i].tme.dwFlags & TME_LEAVE))) { TrackingList[i] = TrackingList[--iTrackMax]; - + if(iTrackMax == 0) { KillTimer(0, timer); timer = 0; @@ -1151,16 +1151,16 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme) TrackingList[i].tme.dwFlags |= TME_HOVER; TrackingList[i].tme.dwHoverTime = ptme->dwHoverTime; } - + if(leave) TrackingList[i].tme.dwFlags |= TME_LEAVE; /* reset iHoverTime as per winapi specs */ - TrackingList[i].iHoverTime = 0; - + TrackingList[i].iHoverTime = 0; + return TRUE; } - } + } /* if the tracking list is full return FALSE */ if (iTrackMax == sizeof (TrackingList) / sizeof(*TrackingList)) { diff --git a/windows/keyboard.c b/windows/keyboard.c index fa1e5ffe735..50df439b89e 100644 --- a/windows/keyboard.c +++ b/windows/keyboard.c @@ -2,7 +2,7 @@ * KEYBOARD driver * * Copyright 1993 Bob Amstadt - * Copyright 1996 Albrecht Kleine + * Copyright 1996 Albrecht Kleine * Copyright 1997 David Faure * Copyright 1998 Morten Welinder * Copyright 1998 Ulrich Weigand @@ -55,14 +55,14 @@ static LPBYTE pKeyStateTable; /*********************************************************************** * Inquire (KEYBOARD.1) */ -WORD WINAPI KEYBOARD_Inquire(LPKBINFO kbInfo) +WORD WINAPI KEYBOARD_Inquire(LPKBINFO kbInfo) { kbInfo->Begin_First_Range = 0; kbInfo->End_First_Range = 0; kbInfo->Begin_Second_Range = 0; kbInfo->End_Second_Range = 0; - kbInfo->StateSize = 16; - + kbInfo->StateSize = 16; + return sizeof(KBINFO); } @@ -175,8 +175,8 @@ INT16 WINAPI GetKeyNameText16(LONG lParam, LPSTR lpBuffer, INT16 nSize) * FIXME : should do the above (return 2 for non matching deadchar+char combinations) * */ -INT16 WINAPI ToAscii16(UINT16 virtKey,UINT16 scanCode, LPBYTE lpKeyState, - LPVOID lpChar, UINT16 flags) +INT16 WINAPI ToAscii16(UINT16 virtKey,UINT16 scanCode, LPBYTE lpKeyState, + LPVOID lpChar, UINT16 flags) { return ToAscii( virtKey, scanCode, lpKeyState, lpChar, flags ); } diff --git a/windows/mdi.c b/windows/mdi.c index 7d961743ce0..bc0f87b4a51 100644 --- a/windows/mdi.c +++ b/windows/mdi.c @@ -22,7 +22,7 @@ * * Notes: Fairly complete implementation. * Also, Excel and WinWord do _not_ use MDI so if you're trying - * to fix them look elsewhere. + * to fix them look elsewhere. * * Notes on how the "More Windows..." is implemented: * @@ -110,7 +110,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mdi); #define WM_MDICALCCHILDSCROLL 0x10ac /* this is exactly what Windows uses */ /* "More Windows..." definitions */ -#define MDI_MOREWINDOWSLIMIT 9 /* after this number of windows, a "More Windows..." +#define MDI_MOREWINDOWSLIMIT 9 /* after this number of windows, a "More Windows..." option will appear under the Windows menu */ #define MDI_IDC_LISTBOX 100 #define MDI_IDS_MOREWINDOWS 13 @@ -246,10 +246,10 @@ static BOOL MDI_MenuDeleteItem( HWND client, HWND hWndChild ) id = GetWindowLongA( hWndChild, GWL_ID ); DeleteMenu(clientInfo->hWindowMenu,id,MF_BYCOMMAND); - /* walk the rest of MDI children to prevent gaps in the id + /* walk the rest of MDI children to prevent gaps in the id * sequence and in the menu child list */ - for( index = id+1; index <= clientInfo->nActiveChildren + + for( index = id+1; index <= clientInfo->nActiveChildren + clientInfo->idFirstChild; index++ ) { HWND hwnd = MDI_GetChildByID(client,index); @@ -265,12 +265,12 @@ static BOOL MDI_MenuDeleteItem( HWND client, HWND hWndChild ) n = wsprintfW(buffer, format ,index - clientInfo->idFirstChild); GetWindowTextW( hwnd, buffer + n, sizeof(buffer)/sizeof(WCHAR) - n ); - /* change menu if the current child is to be shown in the + /* change menu if the current child is to be shown in the * "Windows" menu */ - if (index <= clientInfo->idFirstChild + MDI_MOREWINDOWSLIMIT) + if (index <= clientInfo->idFirstChild + MDI_MOREWINDOWSLIMIT) ModifyMenuW(clientInfo->hWindowMenu ,index ,MF_BYCOMMAND | MF_STRING, - index - 1 , buffer ); + index - 1 , buffer ); } /* We must restore the "More Windows..." option if there are enough children @@ -335,10 +335,10 @@ static void MDI_CalcDefaultChildPos( HWND hwnd, WORD n, LPPOINT lpPos, INT delta INT nstagger; RECT rect; INT spacing = GetSystemMetrics(SM_CYCAPTION) + - GetSystemMetrics(SM_CYFRAME) - 1; + GetSystemMetrics(SM_CYFRAME) - 1; GetClientRect( hwnd, &rect ); - if( rect.bottom - rect.top - delta >= spacing ) + if( rect.bottom - rect.top - delta >= spacing ) rect.bottom -= delta; nstagger = (rect.bottom - rect.top)/(3 * spacing); @@ -365,7 +365,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame, WARN("hmenuFrame is not a menu handle\n"); return 0L; } - + if (hmenuWindow && !IsMenu(hmenuWindow)) { WARN("hmenuWindow is not a menu handle\n"); @@ -379,7 +379,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame, if( hmenuWindow && ci->hWindowMenu && hmenuWindow!=ci->hWindowMenu ) { - /* delete menu items from ci->hWindowMenu + /* delete menu items from ci->hWindowMenu * and add them to hmenuWindow */ INT i = GetMenuItemCount(ci->hWindowMenu) - 1; @@ -426,10 +426,10 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame, } /* remove separator */ - DeleteMenu(ci->hWindowMenu, i, MF_BYPOSITION); + DeleteMenu(ci->hWindowMenu, i, MF_BYPOSITION); ci->hWindowMenu = hmenuWindow; - } + } if (hmenuFrame) { @@ -489,14 +489,14 @@ static LRESULT MDIRefreshMenu( HWND hwnd, HMENU hmenuFrame, static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci, LPMDICREATESTRUCTA cs, BOOL unicode ) { - POINT pos[2]; + POINT pos[2]; DWORD style = cs->style | (WS_CHILD | WS_CLIPSIBLINGS); HWND hwnd, hwndMax = 0; UINT wIDmenu = ci->idFirstChild + ci->nActiveChildren; WND *wndParent; static const WCHAR lpstrDef[] = {'j','u','n','k','!',0}; - TRACE("origin %i,%i - dim %i,%i, style %08lx\n", + TRACE("origin %i,%i - dim %i,%i, style %08lx\n", cs->x, cs->y, cs->cx, cs->cy, cs->style); /* calculate placement */ MDI_CalcDefaultChildPos(parent, ci->nTotalCreated++, pos, 0); @@ -545,12 +545,12 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci, if(unicode) { MDICREATESTRUCTW *csW = (MDICREATESTRUCTW *)cs; - hwnd = CreateWindowW( csW->szClass, csW->szTitle, style, + hwnd = CreateWindowW( csW->szClass, csW->szTitle, style, csW->x, csW->y, csW->cx, csW->cy, parent, (HMENU)wIDmenu, csW->hOwner, csW ); } else - hwnd = CreateWindowA( cs->szClass, cs->szTitle, style, + hwnd = CreateWindowA( cs->szClass, cs->szTitle, style, cs->x, cs->y, cs->cx, cs->cy, parent, (HMENU)wIDmenu, cs->hOwner, cs ); } @@ -589,8 +589,8 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci, MDI_MenuModifyItem(parent, hwnd); - /* Have we hit the "More Windows..." limit? If so, we must - * add a "More Windows..." option + /* Have we hit the "More Windows..." limit? If so, we must + * add a "More Windows..." option */ if (ci->nActiveChildren == MDI_MOREWINDOWSLIMIT + 1) { @@ -598,9 +598,9 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci, LoadStringW(GetModuleHandleA("USER32"), MDI_IDS_MOREWINDOWS, szTmp, sizeof(szTmp)/sizeof(szTmp[0])); ModifyMenuW(ci->hWindowMenu, - ci->idFirstChild + MDI_MOREWINDOWSLIMIT, - MF_BYCOMMAND | MF_STRING, - ci->idFirstChild + MDI_MOREWINDOWSLIMIT, + ci->idFirstChild + MDI_MOREWINDOWSLIMIT, + MF_BYCOMMAND | MF_STRING, + ci->idFirstChild + MDI_MOREWINDOWSLIMIT, szTmp); } @@ -613,7 +613,7 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci, { /* WS_VISIBLE is clear if a) the MDI client has * MDIS_ALLCHILDSTYLES style and 2) the flag is cleared in the - * MDICreateStruct. If so the created window is not shown nor + * MDICreateStruct. If so the created window is not shown nor * activated. */ if (IsWindowVisible(hwnd)) ShowWindow(hwnd, SW_SHOW); @@ -627,14 +627,14 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci, if( IsWindow(hwndMax) ) ShowWindow(hwndMax, SW_SHOWMAXIMIZED); } - + return hwnd; } /********************************************************************** * MDI_ChildGetMinMaxInfo * - * Note: The rule here is that client rect of the maximized MDI child + * Note: The rule here is that client rect of the maximized MDI child * is equal to the client rect of the MDI client window. */ static void MDI_ChildGetMinMaxInfo( HWND client, HWND hwnd, MINMAXINFO* lpMinMax ) @@ -649,17 +649,17 @@ static void MDI_ChildGetMinMaxInfo( HWND client, HWND hwnd, MINMAXINFO* lpMinMax lpMinMax->ptMaxSize.y = rect.bottom -= rect.top; lpMinMax->ptMaxPosition.x = rect.left; - lpMinMax->ptMaxPosition.y = rect.top; + lpMinMax->ptMaxPosition.y = rect.top; - TRACE("max rect (%i,%i - %i, %i)\n", + TRACE("max rect (%i,%i - %i, %i)\n", rect.left,rect.top,rect.right,rect.bottom); } /********************************************************************** * MDI_SwitchActiveChild - * + * * Note: SetWindowPos sends WM_CHILDACTIVATE to the child window that is - * being activated + * being activated */ static void MDI_SwitchActiveChild( HWND clientHwnd, HWND childHwnd, BOOL bNextWindow ) @@ -678,11 +678,11 @@ static void MDI_SwitchActiveChild( HWND clientHwnd, HWND childHwnd, if ( hwndTo != hwndPrev ) { - SetWindowPos( hwndTo, HWND_TOP, 0, 0, 0, 0, + SetWindowPos( hwndTo, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE ); if( bNextWindow && hwndPrev ) - SetWindowPos( hwndPrev, HWND_BOTTOM, 0, 0, 0, 0, + SetWindowPos( hwndPrev, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ); } } @@ -741,7 +741,7 @@ static LONG MDI_ChildActivate( HWND client, HWND child ) if (child && (!IsWindowEnabled( child ))) return 0; - /* Don't activate if it is already active. Might happen + /* Don't activate if it is already active. Might happen since ShowWindow DOES activate MDI children */ if (clientInfo->hwndActiveChild == child) return 0; @@ -839,7 +839,7 @@ static HBITMAP CreateMDIMenuBitmap(void) BitBlt(hDCDest, 0, 0, GetSystemMetrics(SM_CXSIZE), GetSystemMetrics(SM_CYSIZE), hDCSrc, GetSystemMetrics(SM_CXSIZE), 0, SRCCOPY); - + SelectObject(hDCSrc, hobjSrc); DeleteObject(hbClose); DeleteDC(hDCSrc); @@ -896,7 +896,7 @@ static LONG MDICascade( HWND client, MDICLIENTINFO *ci ) /* walk the list (backwards) and move windows */ for (i = total - 1; i >= 0; i--) { - TRACE("move %04x to (%ld,%ld) size [%ld,%ld]\n", + TRACE("move %04x to (%ld,%ld) size [%ld,%ld]\n", win_array[i], pos[0].x, pos[0].y, pos[1].x, pos[1].y); MDI_CalcDefaultChildPos(client, n++, pos, delta); @@ -1063,10 +1063,10 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) if( !InsertMenuA(menu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP, hSysPopup, (LPSTR)(DWORD)hSysMenuBitmap)) - { + { TRACE("not inserted\n"); - DestroyMenu(hSysPopup); - return 0; + DestroyMenu(hSysPopup); + return 0; } /* The close button is only present in Win 95 look */ @@ -1100,7 +1100,7 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild ) TRACE("frame %04x,child %04x,nIt=%d,iId=%d\n",frame,hChild,nItems,iId); if(!(iId == SC_RESTORE || iId == SC_CLOSE) ) - return 0; + return 0; /* * Remove the system menu, If that menu is the icon of the window @@ -1111,7 +1111,7 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild ) menuInfo.fMask = MIIM_DATA | MIIM_TYPE; GetMenuItemInfoW(menu, - 0, + 0, TRUE, &menuInfo); @@ -1143,7 +1143,7 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild ) /********************************************************************** * MDI_UpdateFrameText * - * used when child window is maximized/restored + * used when child window is maximized/restored * * Note: lpTitle can be NULL */ @@ -1164,7 +1164,7 @@ static void MDI_UpdateFrameText( HWND frame, HWND hClient, } /* store new "default" title if lpTitle is not NULL */ - if (lpTitle) + if (lpTitle) { if (ci->frameTitle) HeapFree( GetProcessHeap(), 0, ci->frameTitle ); if ((ci->frameTitle = HeapAlloc( GetProcessHeap(), 0, (strlenW(lpTitle)+1)*sizeof(WCHAR)))) @@ -1241,7 +1241,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, ci->idFirstChild = ccs->idFirstChild; #undef ccs } - else + else { LPCLIENTCREATESTRUCT16 ccs = MapSL((SEGPTR)cs->lpCreateParams); ci->hWindowMenu = ccs->hWindowMenu; @@ -1322,7 +1322,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, case WM_MDINEXT: /* lParam != 0 means previous window */ MDI_SwitchActiveChild( hwnd, WIN_GetFullHandle( (HWND)wParam ), !lParam ); break; - + case WM_MDIRESTORE: SendMessageW( (HWND)wParam, WM_SYSCOMMAND, SC_RESTORE, 0); return 0; @@ -1541,7 +1541,7 @@ LRESULT WINAPI DefFrameProcW( HWND hwnd, HWND hwndMDIClient, SendMessageW(hwndMDIClient, message, wParam, lParam); break; - case WM_SETTEXT: + case WM_SETTEXT: MDI_UpdateFrameText(hwnd, hwndMDIClient, MDI_REPAINTFRAME, (LPWSTR)lParam ); return 1; /* success. FIXME: check text length */ @@ -1559,7 +1559,7 @@ LRESULT WINAPI DefFrameProcW( HWND hwnd, HWND hwndMDIClient, if (!IsIconic(hwnd) && ci->hwndActiveChild && !ci->hwndChildMaximized) { - /* control menu is between the frame system menu and + /* control menu is between the frame system menu and * the first entry of menu bar */ WND *wndPtr = WIN_GetPtr(hwnd); @@ -1981,7 +1981,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) case SB_BOTH: SCROLL_SetNCSbState( hwnd, vmin, vmax, vpos, hmin, hmax, hpos); - } + } } @@ -2017,30 +2017,30 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, switch( wParam ) { - case SB_LINEUP: + case SB_LINEUP: newPos = curPos - shift; break; - case SB_LINEDOWN: + case SB_LINEDOWN: newPos = curPos + shift; break; - case SB_PAGEUP: + case SB_PAGEUP: newPos = curPos - length; break; - case SB_PAGEDOWN: + case SB_PAGEDOWN: newPos = curPos + length; break; - case SB_THUMBPOSITION: + case SB_THUMBPOSITION: newPos = LOWORD(lParam); break; - case SB_THUMBTRACK: + case SB_THUMBTRACK: return; - case SB_TOP: + case SB_TOP: newPos = minPos; break; - case SB_BOTTOM: + case SB_BOTTOM: newPos = maxPos; break; case SB_ENDSCROLL: @@ -2050,14 +2050,14 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, if( newPos > maxPos ) newPos = maxPos; - else + else if( newPos < minPos ) newPos = minPos; SetScrollPos(hWnd, (uMsg == WM_VSCROLL)?SB_VERT:SB_HORZ , newPos, TRUE); if( uMsg == WM_VSCROLL ) - ScrollWindowEx(hWnd ,0 ,curPos - newPos, NULL, NULL, 0, NULL, + ScrollWindowEx(hWnd ,0 ,curPos - newPos, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); else ScrollWindowEx(hWnd ,curPos - newPos, 0, NULL, NULL, 0, NULL, @@ -2231,8 +2231,8 @@ static HWND MDI_MoreWindowsDialog(HWND hwnd) * * Will swap the menu IDs for the given 2 positions. * pos1 and pos2 are menu IDs - * - * + * + * */ static void MDI_SwapMenuItems(HWND parent, UINT pos1, UINT pos2) diff --git a/windows/message.c b/windows/message.c index 4e474a1a81c..856bbb10d03 100644 --- a/windows/message.c +++ b/windows/message.c @@ -202,7 +202,7 @@ static void MSG_SendParentNotify( HWND hwnd, WORD event, WORD idChild, POINT pt /*********************************************************************** * MSG_JournalPlayBackMsg * - * Get an EVENTMSG struct via call JOURNALPLAYBACK hook function + * Get an EVENTMSG struct via call JOURNALPLAYBACK hook function */ void MSG_JournalPlayBackMsg(void) { @@ -916,8 +916,8 @@ static const struct accent_char accent_chars[] = * different places :-( ), if you use turkish uncomment these and * comment out the lines in iso-8859-2 and iso-8859-3 sections * FIXME: should be dynamic according to chosen language - * if/when Wine has turkish support. - */ + * if/when Wine has turkish support. + */ /* collision whith G( from iso-8859-3 !!! */ /* {'(', 'G', '\320'}, {'(', 'g', '\360'}, */ /* breve */ /* collision whith S, from iso-8859-2 !!! */ @@ -1079,7 +1079,7 @@ LONG WINAPI DispatchMessageA( const MSG* msg ) * parameter of the WM_TIMER message is not NULL, the lParam parameter * points to the function that is called instead of the window * procedure. - * + * * The message must be valid. * * RETURNS @@ -1088,7 +1088,7 @@ LONG WINAPI DispatchMessageA( const MSG* msg ) * * CONFORMANCE * - * ECMA-234, Win32 + * ECMA-234, Win32 * */ LONG WINAPI DispatchMessageW( const MSG* msg ) diff --git a/windows/msgbox.c b/windows/msgbox.c index 788cdafac4f..7db5fc367b1 100644 --- a/windows/msgbox.c +++ b/windows/msgbox.c @@ -127,7 +127,7 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb) */ break; } - + /* Position everything */ GetWindowRect(hwnd, &rect); borheight = rect.bottom - rect.top; @@ -135,18 +135,18 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb) GetClientRect(hwnd, &rect); borheight -= rect.bottom - rect.top; borwidth -= rect.right - rect.left; - + /* Get the icon height */ GetWindowRect(GetDlgItem(hwnd, MSGBOX_IDICON), &rect); MapWindowPoints(0, hwnd, (LPPOINT)&rect, 2); iheight = rect.bottom - rect.top; ileft = rect.left; iwidth = rect.right - ileft; - + hdc = GetDC(hwnd); if (hFont) hPrevFont = SelectObject(hdc, hFont); - + /* Get the number of visible buttons and their size */ bh = bw = 1; /* Minimum button sizes */ for (buttons = 0, i = 1; i < 8; i++) @@ -172,7 +172,7 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb) bh = bh * 2; bw = bw * 2; bspace = bw/3; /* Space between buttons */ - + /* Get the text size */ GetClientRect(GetDlgItem(hwnd, MSGBOX_IDTEXT), &rect); rect.top = rect.left = rect.bottom = 0; @@ -182,15 +182,15 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb) tleft = 2 * ileft + iwidth; twidth = max((bw + bspace) * buttons + bspace - tleft, rect.right); theight = rect.bottom; - + if (hFont) SelectObject(hdc, hPrevFont); ReleaseDC(hItem, hdc); - + tiheight = 16 + max(iheight, theight); wwidth = tleft + twidth + ileft + borwidth; wheight = 8 + tiheight + bh + borheight; - + /* Resize the window */ SetWindowPos(hwnd, 0, 0, 0, wwidth, wheight, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW); @@ -198,11 +198,11 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb) /* Position the icon */ SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDICON), 0, ileft, (tiheight - iheight) / 2, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW); - + /* Position the text */ SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDTEXT), 0, tleft, (tiheight - theight) / 2, twidth, theight, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW); - + /* Position the buttons */ bpos = (wwidth - (bw + bspace) * buttons + bspace) / 2; for (buttons = i = 0; i < 7; i++) { @@ -234,7 +234,7 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb) } if (lpmb->dwStyle & MB_APPLMODAL) FIXME("app modal msgbox ! Not modal yet.\n"); - + return hFont; } @@ -246,13 +246,13 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSA lpmb) */ static LRESULT CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) -{ +{ static HFONT hFont; switch(message) { case WM_INITDIALOG: hFont = MSGBOX_OnInit(hwnd, (LPMSGBOXPARAMSA)lParam); return 0; - + case WM_COMMAND: switch (wParam) { @@ -318,7 +318,7 @@ INT WINAPI MessageBoxW( HWND hwnd, LPCWSTR text, LPCWSTR title, LPSTR titleA = HEAP_strdupWtoA( GetProcessHeap(), 0, title ); LPSTR textA = HEAP_strdupWtoA( GetProcessHeap(), 0, text ); INT ret; - + WARN("Messagebox\n"); ret = MessageBoxA( hwnd, textA, titleA, type ); diff --git a/windows/multimon.c b/windows/multimon.c index 4a4092ffade..895fe066d18 100644 --- a/windows/multimon.c +++ b/windows/multimon.c @@ -71,8 +71,8 @@ HMONITOR WINAPI MonitorFromWindow(HWND hWnd, DWORD dwFlags) if (dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) return xPRIMARY_MONITOR; - if (IsIconic(hWnd) ? - GetWindowPlacement(hWnd, &wp) : + if (IsIconic(hWnd) ? + GetWindowPlacement(hWnd, &wp) : GetWindowRect(hWnd, &wp.rcNormalPosition)) { return MonitorFromRect(&wp.rcNormalPosition, dwFlags); @@ -98,7 +98,7 @@ BOOL WINAPI GetMonitorInfoA(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo) GetSystemMetrics(SM_CYSCREEN) ); lpMonitorInfo->rcWork = rcWork; lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY; - + if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEXA)) strcpy(((MONITORINFOEXA*)lpMonitorInfo)->szDevice, "DISPLAY"); diff --git a/windows/nonclient.c b/windows/nonclient.c index 1ca2b336265..658b74138aa 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -43,13 +43,13 @@ BOOL NC_DrawGrayButton(HDC hdc, int x, int y); static HBITMAP hbitmapClose; static const BYTE lpGrayMask[] = { 0xAA, 0xA0, - 0x55, 0x50, + 0x55, 0x50, 0xAA, 0xA0, - 0x55, 0x50, + 0x55, 0x50, 0xAA, 0xA0, - 0x55, 0x50, + 0x55, 0x50, 0xAA, 0xA0, - 0x55, 0x50, + 0x55, 0x50, 0xAA, 0xA0, 0x55, 0x50}; @@ -159,7 +159,7 @@ NC_AdjustRectOuter95 (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) int adjust; if(style & WS_ICONIC) return; - if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == + if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) { adjust = 1; /* for the outer frame always present */ @@ -173,7 +173,7 @@ NC_AdjustRectOuter95 (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) if (style & WS_THICKFRAME) adjust += ( GetSystemMetrics (SM_CXFRAME) - GetSystemMetrics (SM_CXDLGFRAME)); /* The resize border */ - if ((style & (WS_BORDER|WS_DLGFRAME)) || + if ((style & (WS_BORDER|WS_DLGFRAME)) || (exStyle & WS_EX_DLGMODALFRAME)) adjust++; /* The other border */ @@ -677,9 +677,9 @@ static LONG NC_DoNCHitTest (WND *wndPtr, POINT pt ) return HTMENU; } - /* Has to return HTNOWHERE if nothing was found + /* Has to return HTNOWHERE if nothing was found Could happen when a window has a customized non client area */ - return HTNOWHERE; + return HTNOWHERE; } @@ -823,7 +823,7 @@ static LONG NC_DoNCHitTest95 (WND *wndPtr, POINT pt ) return HTMENU; } - /* Has to return HTNOWHERE if nothing was found + /* Has to return HTNOWHERE if nothing was found Could happen when a window has a customized non client area */ return HTNOWHERE; } @@ -1084,7 +1084,7 @@ static void NC_DrawFrame( HDC hdc, RECT *rect, BOOL dlgFrame, if (dlgFrame) { InflateRect( rect, -width, -height ); - } + } else { INT decYOff = GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXSIZE) - 1; @@ -1142,7 +1142,7 @@ static void NC_DrawFrame( HDC hdc, RECT *rect, BOOL dlgFrame, * you LIKE thick borders in Win95/NT4.0 -- I've been working with * them lately, but just to get this code right). Even so, it doesn't * appear to be so. It's being worked on... - * + * * Revision history * 06-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) * Original implementation (based on NC_DrawFrame) @@ -1232,7 +1232,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, { if (!(hbitmapClose = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_OLD_CLOSE) ))) return; } - + if (GetWindowLongA( hwnd, GWL_EXSTYLE) & WS_EX_DLGMODALFRAME) { HBRUSH hbrushOld = SelectObject(hdc, GetSysColorBrush(COLOR_WINDOW) ); @@ -1330,7 +1330,7 @@ static void NC_DrawCaption95( r.left += GetSystemMetrics(SM_CYCAPTION) - 1; } - if (style & WS_SYSMENU) + if (style & WS_SYSMENU) { UINT state; @@ -1339,7 +1339,7 @@ static void NC_DrawCaption95( state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */ - NC_DrawCloseButton95 (hwnd, hdc, FALSE, + NC_DrawCloseButton95 (hwnd, hdc, FALSE, ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF))); r.right -= GetSystemMetrics(SM_CYCAPTION) - 1; @@ -1350,7 +1350,7 @@ static void NC_DrawCaption95( NC_DrawMaxButton95( hwnd, hdc, FALSE, (!(style & WS_MAXIMIZEBOX))); r.right -= GetSystemMetrics(SM_CXSIZE) + 1; - + NC_DrawMinButton95( hwnd, hdc, FALSE, (!(style & WS_MINIMIZEBOX))); r.right -= GetSystemMetrics(SM_CXSIZE) + 1; } @@ -1397,7 +1397,7 @@ static void NC_DoNCPaint( HWND hwnd, HRGN clip, BOOL suppress_menupaint ) if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return; has_menu = HAS_MENU(wndPtr); dwStyle = wndPtr->dwStyle; - dwExStyle = wndPtr->dwExStyle; + dwExStyle = wndPtr->dwExStyle; flags = wndPtr->flags; rectClient = wndPtr->rectClient; rectWindow = wndPtr->rectWindow; @@ -1475,7 +1475,7 @@ static void NC_DoNCPaint( HWND hwnd, HRGN clip, BOOL suppress_menupaint ) r.top++; } FillRect( hdc, &r, GetSysColorBrush(COLOR_SCROLLBAR) ); - } + } ReleaseDC( hwnd, hdc ); } @@ -1522,7 +1522,7 @@ static void NC_DoNCPaint95( if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return; has_menu = HAS_MENU(wndPtr); dwStyle = wndPtr->dwStyle; - dwExStyle = wndPtr->dwExStyle; + dwExStyle = wndPtr->dwExStyle; flags = wndPtr->flags; rectClient = wndPtr->rectClient; rectWindow = wndPtr->rectWindow; @@ -1599,7 +1599,7 @@ static void NC_DoNCPaint95( { RECT r = rect; r.bottom = rect.top + GetSystemMetrics(SM_CYMENU); - + TRACE("Calling DrawMenuBar with rect (%d, %d)-(%d, %d)\n", r.left, r.top, r.right, r.bottom); @@ -1626,7 +1626,7 @@ static void NC_DoNCPaint95( r.left = r.right - GetSystemMetrics(SM_CXVSCROLL) + 1; r.top = r.bottom - GetSystemMetrics(SM_CYHSCROLL) + 1; FillRect( hdc, &r, GetSysColorBrush(COLOR_SCROLLBAR) ); - } + } ReleaseDC( hwnd, hdc ); } @@ -1725,7 +1725,7 @@ LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ) return (LONG)SetCursor( LoadCursorA( 0, IDC_SIZENSA ) ); case HTTOPLEFT: - case HTBOTTOMRIGHT: + case HTBOTTOMRIGHT: return (LONG)SetCursor( LoadCursorA( 0, IDC_SIZENWSEA ) ); case HTTOPRIGHT: @@ -1793,7 +1793,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) /* Check if the sysmenu item for minimize is there */ state = GetMenuState(hSysMenu, SC_MINIMIZE, MF_BYCOMMAND); - + paintButton = &NC_DrawMinButton95; } else @@ -1804,7 +1804,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) /* Check if the sysmenu item for maximize is there */ state = GetMenuState(hSysMenu, SC_MAXIMIZE, MF_BYCOMMAND); - + paintButton = &NC_DrawMaxButton95; } @@ -1841,7 +1841,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) if ((!pressed) || (state == 0xFFFFFFFF)) return; - if (wParam == HTMINBUTTON) + if (wParam == HTMINBUTTON) SendMessageA( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, MAKELONG(msg.pt.x,msg.pt.y) ); else SendMessageA( hwnd, WM_SYSCOMMAND, @@ -1895,7 +1895,7 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam ) if (!pressed) return; - if (wParam == HTMINBUTTON) + if (wParam == HTMINBUTTON) SendMessageA( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, MAKELONG(msg.pt.x,msg.pt.y) ); else SendMessageA( hwnd, WM_SYSCOMMAND, @@ -1921,7 +1921,7 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam) return; state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); - + /* If the item close of the sysmenu is disabled or not there do nothing */ if((state & MF_DISABLED) || (state & MF_GRAYED) || (state == 0xFFFFFFFF)) return; @@ -2037,14 +2037,14 @@ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) if (TWEAK_WineLook == WIN31_LOOK) NC_TrackMinMaxBox( hwnd, wParam ); else - NC_TrackMinMaxBox95( hwnd, wParam ); + NC_TrackMinMaxBox95( hwnd, wParam ); break; case HTCLOSE: if (TWEAK_WineLook >= WIN95_LOOK) NC_TrackCloseButton95 (hwnd, wParam); break; - + case HTLEFT: case HTRIGHT: case HTTOP: @@ -2079,7 +2079,7 @@ LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam ) { SendMessageW( hwnd, WM_SYSCOMMAND, SC_RESTORE, lParam ); return 0; - } + } switch(wParam) /* Hit test */ { @@ -2127,7 +2127,7 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) case SC_MINIMIZE: if (hwnd == GetForegroundWindow()) ShowOwnedPopups(hwnd,FALSE); - ShowWindow( hwnd, SW_MINIMIZE ); + ShowWindow( hwnd, SW_MINIMIZE ); break; case SC_MAXIMIZE: @@ -2169,7 +2169,7 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) break; case SC_TASKLIST: - WinExec( "taskman.exe", SW_SHOWNORMAL ); + WinExec( "taskman.exe", SW_SHOWNORMAL ); break; case SC_SCREENSAVE: @@ -2183,11 +2183,11 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) FreeLibrary( hmodule ); } } - else + else if (wParam == SC_PUTMARK) TRACE_(shell)("Mark requested by user\n"); break; - + case SC_HOTKEY: case SC_ARRANGE: case SC_NEXTWINDOW: @@ -2212,21 +2212,21 @@ BOOL NC_DrawGrayButton(HDC hdc, int x, int y) HBRUSH hOldBrush; hMaskBmp = CreateBitmap (12, 10, 1, 1, lpGrayMask); - + if(hMaskBmp == 0) return FALSE; - + SelectObject (hdcMask, hMaskBmp); - + /* Draw the grayed bitmap using the mask */ hOldBrush = SelectObject (hdc, RGB(128, 128, 128)); BitBlt (hdc, x, y, 12, 10, hdcMask, 0, 0, 0xB8074A); - + /* Clean up */ SelectObject (hdc, hOldBrush); DeleteObject(hMaskBmp); DeleteDC (hdcMask); - + return TRUE; } diff --git a/windows/painting.c b/windows/painting.c index b7ae05b8bce..1acf92186c8 100644 --- a/windows/painting.c +++ b/windows/painting.c @@ -96,7 +96,7 @@ static void add_paint_count( HWND hwnd, int incr ) * WIN_HaveToDelayNCPAINT * * Currently, in the Wine painting mechanism, the WM_NCPAINT message - * is generated as soon as a region intersecting the non-client area + * is generated as soon as a region intersecting the non-client area * of a window is invalidated. * * This technique will work fine for all windows whose parents @@ -108,7 +108,7 @@ static void add_paint_count( HWND hwnd, int incr ) * non-client area. * * This method looks at the current state of a window to determine - * if the sending of the WM_NCPAINT message should be delayed until + * if the sending of the WM_NCPAINT message should be delayed until * the BeginPaint call. * * PARAMS: @@ -118,12 +118,12 @@ static void add_paint_count( HWND hwnd, int incr ) * function. This is a shortcut for the cases when * we already know when to avoid scanning all the * parents of a window. If you already know that this - * window's NCPAINT should be delayed, set the - * UNC_DELAY_NCPAINT flag for this parameter. + * window's NCPAINT should be delayed, set the + * UNC_DELAY_NCPAINT flag for this parameter. * * This shortcut behavior is implemented in the * RDW_Paint() method. - * + * */ static BOOL WIN_HaveToDelayNCPAINT( HWND hwnd, UINT uncFlags) { @@ -145,7 +145,7 @@ static BOOL WIN_HaveToDelayNCPAINT( HWND hwnd, UINT uncFlags) /* * Scan all the parents of this window to find a window * that doesn't have the WS_CLIPCHILDREN style and that - * has an invalid region. + * has an invalid region. */ while ((hwnd = GetAncestor( hwnd, GA_PARENT ))) { @@ -171,7 +171,7 @@ static BOOL WIN_HaveToDelayNCPAINT( HWND hwnd, UINT uncFlags) * NOTE: UNC_REGION is mainly for the RDW_Paint() chunk that sends WM_ERASEBKGND message. * The trick is that when the returned region handle may be different from hRgn. * In this case the old hRgn must be considered gone. BUT, if the returned value - * is 1 then the hRgn is preserved and RDW_Paint() will have to get + * is 1 then the hRgn is preserved and RDW_Paint() will have to get * a DC without extra clipping region. */ static HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT uncFlags ) @@ -180,7 +180,7 @@ static HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT uncFlags ) HRGN hClip = 0; HRGN hrgnRet = 0; - TRACE_(nonclient)("hwnd %04x [%04x] hrgn %04x, unc %04x, ncf %i\n", + TRACE_(nonclient)("hwnd %04x [%04x] hrgn %04x, unc %04x, ncf %i\n", wnd->hwndSelf, wnd->hrgnUpdate, hRgn, uncFlags, wnd->flags & WIN_NEEDS_NCPAINT); /* desktop window doesn't have a nonclient area */ @@ -189,7 +189,7 @@ static HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT uncFlags ) wnd->flags &= ~WIN_NEEDS_NCPAINT; if( wnd->hrgnUpdate > 1 ) hrgnRet = REGION_CropRgn( hRgn, wnd->hrgnUpdate, NULL, NULL ); - else + else { hrgnRet = wnd->hrgnUpdate; } @@ -200,21 +200,21 @@ static HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT uncFlags ) !(wnd->flags & WIN_NCACTIVATED) ) { wnd->flags |= WIN_NCACTIVATED; - uncFlags |= UNC_ENTIRE; + uncFlags |= UNC_ENTIRE; } /* - * If the window's non-client area needs to be painted, + * If the window's non-client area needs to be painted, */ if ( ( wnd->flags & WIN_NEEDS_NCPAINT ) && !WIN_HaveToDelayNCPAINT(wnd->hwndSelf, uncFlags) ) { RECT r2, r3; - wnd->flags &= ~WIN_NEEDS_NCPAINT; + wnd->flags &= ~WIN_NEEDS_NCPAINT; GETCLIENTRECTW( wnd, r ); - TRACE_(nonclient)( "\tclient box (%i,%i-%i,%i), hrgnUpdate %04x\n", + TRACE_(nonclient)( "\tclient box (%i,%i-%i,%i), hrgnUpdate %04x\n", r.left, r.top, r.right, r.bottom, wnd->hrgnUpdate ); if( wnd->hrgnUpdate > 1 ) { @@ -222,7 +222,7 @@ static HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT uncFlags ) GetRgnBox( wnd->hrgnUpdate, &r2 ); UnionRect( &r3, &r2, &r ); - if( r3.left != r.left || r3.top != r.top || + if( r3.left != r.left || r3.top != r.top || r3.right != r.right || r3.bottom != r.bottom ) /* it does */ { /* crop hrgnUpdate, save old one in hClip - the only @@ -238,7 +238,7 @@ static HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT uncFlags ) GetRgnBox( wnd->hrgnUpdate, &r3 ); if( IsRectEmpty( &r3 ) ) { - /* delete the update region since all invalid + /* delete the update region since all invalid * parts were in the nonclient area */ DeleteObject( wnd->hrgnUpdate ); @@ -252,7 +252,7 @@ static HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT uncFlags ) if(!hClip && wnd->hrgnUpdate ) goto copyrgn; } - else + else if( wnd->hrgnUpdate == 1 )/* entire window */ { if( uncFlags & UNC_UPDATE ) wnd->hrgnUpdate = CreateRectRgnIndirect( &r ); @@ -271,7 +271,7 @@ copyrgn: else if( wnd->hrgnUpdate == 1 && (uncFlags & UNC_UPDATE) ) { - GETCLIENTRECTW( wnd, r ); + GETCLIENTRECTW( wnd, r ); wnd->hrgnUpdate = CreateRectRgnIndirect( &r ); if( uncFlags & UNC_REGION ) hrgnRet = 1; } @@ -311,7 +311,7 @@ copyrgn: /*********************************************************************** - * RDW_ValidateParent [RDW_UpdateRgns() helper] + * RDW_ValidateParent [RDW_UpdateRgns() helper] * * Validate the portions of parents that are covered by a validated child * wndPtr = child @@ -369,7 +369,7 @@ static void RDW_ValidateParent(WND *wndChild) } /*********************************************************************** - * RDW_UpdateRgns [RedrawWindow() helper] + * RDW_UpdateRgns [RedrawWindow() helper] * * Walks the window tree and adds/removes parts of the hRgn to/from update * regions of windows that overlap it. Also, manages internal paint flags. @@ -379,7 +379,7 @@ static void RDW_ValidateParent(WND *wndChild) */ static void RDW_UpdateRgns( WND* wndPtr, HRGN hRgn, UINT flags, BOOL firstRecursLevel ) { - /* + /* * Called only when one of the following is set: * (RDW_INVALIDATE | RDW_VALIDATE | RDW_INTERNALPAINT | RDW_NOINTERNALPAINT) */ @@ -406,8 +406,8 @@ static void RDW_UpdateRgns( WND* wndPtr, HRGN hRgn, UINT flags, BOOL firstRecurs CombineRgn( wndPtr->hrgnUpdate, wndPtr->hrgnUpdate, hRgn, RGN_OR ); /* fall through */ case 0: - wndPtr->hrgnUpdate = REGION_CropRgn( wndPtr->hrgnUpdate, - wndPtr->hrgnUpdate ? wndPtr->hrgnUpdate : hRgn, + wndPtr->hrgnUpdate = REGION_CropRgn( wndPtr->hrgnUpdate, + wndPtr->hrgnUpdate ? wndPtr->hrgnUpdate : hRgn, &r, NULL ); if( !bHadOne ) { @@ -577,7 +577,7 @@ end: static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex ) { /* NOTE: wndPtr is locked by caller. - * + * * FIXME: Windows uses WM_SYNCPAINT to cut down the number of intertask * SendMessage() calls. This is a comment inside DefWindowProc() source * from 16-bit SDK: @@ -616,10 +616,10 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex ) UINT dcx = DCX_INTERSECTRGN | DCX_USESTYLE | DCX_KEEPCLIPRGN | DCX_WINDOWPAINT | DCX_CACHE; HRGN hrgnRet; - hrgnRet = WIN_UpdateNCRgn(wndPtr, - hrgn, - UNC_REGION | UNC_CHECK | - ((ex & RDW_EX_DELAY_NCPAINT) ? UNC_DELAY_NCPAINT : 0) ); + hrgnRet = WIN_UpdateNCRgn(wndPtr, + hrgn, + UNC_REGION | UNC_CHECK | + ((ex & RDW_EX_DELAY_NCPAINT) ? UNC_DELAY_NCPAINT : 0) ); if( hrgnRet ) { @@ -627,9 +627,9 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex ) if( wndPtr->flags & WIN_NEEDS_ERASEBKGND ) { if( bIcon ) dcx |= DCX_WINDOW; - else + else if( hrgnRet ) - OffsetRgn( hrgnRet, wndPtr->rectWindow.left - wndPtr->rectClient.left, + OffsetRgn( hrgnRet, wndPtr->rectWindow.left - wndPtr->rectClient.left, wndPtr->rectWindow.top - wndPtr->rectClient.top); else dcx &= ~DCX_INTERSECTRGN; @@ -704,7 +704,7 @@ BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rectUpdate, else SetRectEmpty( &r ); TRACE( "%04x (%04x) %s %d,%d-%d,%d %04x flags=%04x\n", - hwnd, wndPtr->hrgnUpdate, rectUpdate ? "rect" : "NULL", r.left, + hwnd, wndPtr->hrgnUpdate, rectUpdate ? "rect" : "NULL", r.left, r.top, r.right, r.bottom, hrgnUpdate, flags ); } } @@ -736,8 +736,8 @@ BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rectUpdate, { if( wndPtr->hrgnUpdate ) hRgn = REGION_CropRgn( 0, hrgnUpdate, NULL, &pt ); - else - wndPtr->hrgnUpdate = REGION_CropRgn( 0, hrgnUpdate, &r, &pt ); + else + wndPtr->hrgnUpdate = REGION_CropRgn( 0, hrgnUpdate, &r, &pt ); } else if( rectUpdate ) { @@ -782,7 +782,7 @@ BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rectUpdate, } else /* entire window or client depending on RDW_FRAME */ { - if( flags & RDW_FRAME ) + if( flags & RDW_FRAME ) hRgn = 1; else { @@ -888,7 +888,7 @@ BOOL WINAPI GetUpdateRect( HWND hwnd, LPRECT rect, BOOL erase ) GetClientRect( hwnd, rect ); if (erase) RedrawWindow( hwnd, NULL, 0, RDW_FRAME | RDW_ERASENOW | RDW_NOCHILDREN ); } - else + else SetRectEmpty( rect ); } retvalue = (wndPtr->hrgnUpdate >= 1); @@ -953,7 +953,7 @@ INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd ) if( wndPtr->hrgnUpdate > 1 ) { CombineRgn(hrgn, wndPtr->hrgnUpdate, 0, RGN_COPY); - OffsetRgn(hrgn, wndPtr->rectWindow.left - wndPtr->rectClient.left, + OffsetRgn(hrgn, wndPtr->rectWindow.left - wndPtr->rectClient.left, wndPtr->rectWindow.top - wndPtr->rectClient.top ); } @@ -963,7 +963,7 @@ INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd ) DeleteObject( hrgn ); WIN_ReleaseWndPtr(wndPtr); return ret; - } + } WIN_ReleaseWndPtr(wndPtr); return GetClipBox( hdc, &rect ); } @@ -1028,7 +1028,7 @@ void WINAPI InvertRect16( HDC16 hdc, const RECT16 *rect ) BOOL WINAPI InvertRect( HDC hdc, const RECT *rect ) { return PatBlt( hdc, rect->left, rect->top, - rect->right - rect->left, rect->bottom - rect->top, + rect->right - rect->left, rect->bottom - rect->top, DSTINVERT ); } @@ -1043,7 +1043,7 @@ INT WINAPI FrameRect( HDC hdc, const RECT *rect, HBRUSH hbrush ) if ( (r.right <= r.left) || (r.bottom <= r.top) ) return 0; if (!(prevBrush = SelectObject( hdc, hbrush ))) return 0; - + PatBlt( hdc, r.left, r.top, 1, r.bottom - r.top, PATCOPY ); PatBlt( hdc, r.right - 1, r.top, 1, @@ -1135,7 +1135,7 @@ static BOOL PAINTING_DrawStateJam(HDC hdc, UINT opcode, BOOL retval; INT cx = rc->right - rc->left; INT cy = rc->bottom - rc->top; - + switch(opcode) { case DST_TEXT: @@ -1152,7 +1152,7 @@ static BOOL PAINTING_DrawStateJam(HDC hdc, UINT opcode, memdc = CreateCompatibleDC(hdc); if(!memdc) return FALSE; hbmsave = (HBITMAP)SelectObject(memdc, (HBITMAP)lp); - if(!hbmsave) + if(!hbmsave) { DeleteDC(memdc); return FALSE; @@ -1161,7 +1161,7 @@ static BOOL PAINTING_DrawStateJam(HDC hdc, UINT opcode, SelectObject(memdc, hbmsave); DeleteDC(memdc); return retval; - + case DST_COMPLEX: if(func) { BOOL bRet; @@ -1220,14 +1220,14 @@ static BOOL PAINTING_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM l retval = GetTextExtentPoint32A(hdc, (LPSTR)lp, len, &s); if(!retval) return FALSE; break; - + case DST_ICON: ici = (CURSORICONINFO *)GlobalLock16((HGLOBAL16)lp); if(!ici) return FALSE; s.cx = ici->nWidth; s.cy = ici->nHeight; GlobalUnlock16((HGLOBAL16)lp); - break; + break; case DST_BITMAP: if(!GetObjectA((HBITMAP)lp, sizeof(bm), &bm)) @@ -1235,11 +1235,11 @@ static BOOL PAINTING_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM l s.cx = bm.bmWidth; s.cy = bm.bmHeight; break; - + case DST_COMPLEX: /* cx and cy must be set in this mode */ return FALSE; } - + if(!cx) cx = s.cx; if(!cy) cy = s.cy; } @@ -1267,7 +1267,7 @@ static BOOL PAINTING_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM l hbm = (HBITMAP)NULL; hbmsave = (HBITMAP)NULL; memdc = (HDC)NULL; hbsave = (HBRUSH)NULL; retval = FALSE; /* assume failure */ - + /* From here on we must use "goto cleanup" when something goes wrong */ hbm = CreateBitmap(cx, cy, 1, 1, NULL); if(!hbm) goto cleanup; @@ -1290,7 +1290,7 @@ static BOOL PAINTING_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM l tmp = PAINTING_DrawStateJam(memdc, opcode, func, lp, len, &rc, dtflags, unicode); if(hfsave) SelectObject(memdc, hfsave); if(!tmp) goto cleanup; - + /* This state cause the image to be dithered */ if(flags & DSS_UNION) { @@ -1329,12 +1329,12 @@ static BOOL PAINTING_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM l } hbsave = (HBRUSH)SelectObject(hdc, hbr); - + if(!BitBlt(hdc, x, y, cx, cy, memdc, 0, 0, 0x00B8074A)) goto cleanup; - + retval = TRUE; /* We succeeded */ - -cleanup: + +cleanup: SetTextColor(hdc, fg); SetBkColor(hdc, bg); diff --git a/windows/queue.c b/windows/queue.c index 5f0b6d48021..88d2f745544 100644 --- a/windows/queue.c +++ b/windows/queue.c @@ -101,9 +101,9 @@ static void PERQDATA_Release( PERQUEUEDATA *pQData ) static PERQUEUEDATA * PERQDATA_CreateInstance(void) { PERQUEUEDATA *pQData; - + BOOL16 bIsWin16 = 0; - + TRACE_(msg)("()\n"); /* Share a single instance of perQData for all 16 bit tasks */ @@ -137,7 +137,7 @@ static PERQUEUEDATA * PERQDATA_CreateInstance(void) /* Save perQData globally for 16 bit tasks */ if ( bIsWin16 ) pQDataWin16 = pQData; - + return pQData; } @@ -331,7 +331,7 @@ void QUEUE_Unlock( MESSAGEQUEUE *queue ) CloseHandle( queue->server_queue ); GlobalFree16( queue->self ); } - + HeapUnlock( GetProcessHeap() ); } } @@ -378,10 +378,10 @@ static HQUEUE16 QUEUE_CreateMsgQueue( BOOL16 bCreatePerQData ) msgQueue->self = hQueue; msgQueue->lockCount = 1; msgQueue->magic = QUEUE_MAGIC; - + /* Create and initialize our per queue data */ msgQueue->pQData = bCreatePerQData ? PERQDATA_CreateInstance() : NULL; - + return hQueue; } @@ -471,7 +471,7 @@ HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags ) ERR_(msg)("failed!\n"); return FALSE; } - + /* Link new queue into list */ queuePtr = QUEUE_Lock( hQueue ); queuePtr->teb = NtCurrentTeb(); @@ -480,7 +480,7 @@ HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags ) SetThreadQueue16( 0, hQueue ); NtCurrentTeb()->queue = hQueue; HeapUnlock( GetProcessHeap() ); - + QUEUE_Unlock( queuePtr ); } @@ -525,13 +525,13 @@ BOOL WINAPI GetInputState(void) /*********************************************************************** * GetMessagePos (USER.119) * GetMessagePos (USER32.@) - * + * * The GetMessagePos() function returns a long value representing a * cursor position, in screen coordinates, when the last message * retrieved by the GetMessage() function occurs. The x-coordinate is * in the low-order word of the return value, the y-coordinate is in * the high-order word. The application can use the MAKEPOINT() - * macro to obtain a POINT structure from the return value. + * macro to obtain a POINT structure from the return value. * * For the current cursor position, use GetCursorPos(). * @@ -571,7 +571,7 @@ DWORD WINAPI GetMessagePos(void) * CONFORMANCE * * ECMA-234, Win32 - * + * */ LONG WINAPI GetMessageTime(void) { @@ -608,7 +608,7 @@ LONG WINAPI GetMessageExtraInfo(void) * TODO: * 1. Reset the Key State (currenly per thread key state is not maintained) */ -BOOL WINAPI AttachThreadInput( +BOOL WINAPI AttachThreadInput( DWORD idAttach, /* [in] Thread to attach */ DWORD idAttachTo, /* [in] Thread to attach to */ BOOL fAttach) /* [in] Attach or detach */ @@ -627,7 +627,7 @@ BOOL WINAPI AttachThreadInput( */ if ( HOOK_IsHooked( WH_JOURNALRECORD ) ) goto CLEANUP; - + /* Retrieve message queues corresponding to the thread id's */ pTgtMsgQ = QUEUE_Lock( GetThreadQueue16( idAttach ) ); pSrcMsgQ = QUEUE_Lock( GetThreadQueue16( idAttachTo ) ); @@ -645,7 +645,7 @@ BOOL WINAPI AttachThreadInput( { /* First release the target threads perQData */ PERQDATA_Release( pTgtMsgQ->pQData ); - + /* Share a reference to the source threads perQDATA */ PERQDATA_Addref( pSrcMsgQ->pQData ); pTgtMsgQ->pQData = pSrcMsgQ->pQData; @@ -658,7 +658,7 @@ BOOL WINAPI AttachThreadInput( { /* First release the target threads perQData */ PERQDATA_Release( pTgtMsgQ->pQData ); - + /* Give the target thread its own private perQDATA once more */ pTgtMsgQ->pQData = PERQDATA_CreateInstance(); } @@ -667,7 +667,7 @@ BOOL WINAPI AttachThreadInput( /* TODO: Reset the Key State */ bRet = 1; /* Success */ - + CLEANUP: /* Unlock the queues before returning */ @@ -675,6 +675,6 @@ CLEANUP: QUEUE_Unlock( pSrcMsgQ ); if ( pTgtMsgQ ) QUEUE_Unlock( pTgtMsgQ ); - + return bRet; } diff --git a/windows/rect.c b/windows/rect.c index 73ffe0e26d9..bba18ef19b9 100644 --- a/windows/rect.c +++ b/windows/rect.c @@ -145,7 +145,7 @@ void WINAPI OffsetRect16( LPRECT16 rect, INT16 x, INT16 y ) rect->left += x; rect->right += x; rect->top += y; - rect->bottom += y; + rect->bottom += y; } @@ -158,7 +158,7 @@ BOOL WINAPI OffsetRect( LPRECT rect, INT x, INT y ) rect->left += x; rect->right += x; rect->top += y; - rect->bottom += y; + rect->bottom += y; return TRUE; } @@ -255,7 +255,7 @@ BOOL16 WINAPI UnionRect16( LPRECT16 dest, const RECT16 *src1, dest->left = min( src1->left, src2->left ); dest->right = max( src1->right, src2->right ); dest->top = min( src1->top, src2->top ); - dest->bottom = max( src1->bottom, src2->bottom ); + dest->bottom = max( src1->bottom, src2->bottom ); } } return TRUE; @@ -286,7 +286,7 @@ BOOL WINAPI UnionRect( LPRECT dest, const RECT *src1, dest->left = min( src1->left, src2->left ); dest->right = max( src1->right, src2->right ); dest->top = min( src1->top, src2->top ); - dest->bottom = max( src1->bottom, src2->bottom ); + dest->bottom = max( src1->bottom, src2->bottom ); } } return TRUE; diff --git a/windows/scroll.c b/windows/scroll.c index ac215dc3af7..976e4aac041 100644 --- a/windows/scroll.c +++ b/windows/scroll.c @@ -64,7 +64,7 @@ BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect, /************************************************************************* * ScrollDC (USER32.@) - * + * * Only the hrgnUpdate is return in device coordinate. * rcUpdate must be returned in logical coordinate to comply with win API. * diff --git a/windows/spy.c b/windows/spy.c index ad5b6565f77..2467e426f4e 100644 --- a/windows/spy.c +++ b/windows/spy.c @@ -2,7 +2,7 @@ * Message spying routines * * Copyright 1994, Bob Amstadt - * 1995, Alex Korobka + * 1995, Alex Korobka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -41,8 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(message); static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = { "WM_NULL", /* 0x00 */ - "WM_CREATE", - "WM_DESTROY", + "WM_CREATE", + "WM_DESTROY", "WM_MOVE", "wm_sizewait", "WM_SIZE", @@ -90,38 +90,38 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_CHARTOITEM", "WM_SETFONT", /* 0x30 */ "WM_GETFONT", - "WM_SETHOTKEY", - "WM_GETHOTKEY", - "wm_filesyschange", + "WM_SETHOTKEY", + "WM_GETHOTKEY", + "wm_filesyschange", "wm_isactiveicon", "wm_queryparkicon", "WM_QUERYDRAGICON", "wm_querysavestate", - "WM_COMPAREITEM", + "WM_COMPAREITEM", "wm_testing", - NULL, - "wm_otherwindowcreated", - "wm_otherwindowdestroyed", + NULL, + "wm_otherwindowcreated", + "wm_otherwindowdestroyed", "wm_activateshellwindow", NULL, NULL, /* 0x40 */ - "wm_compacting", NULL, NULL, - "WM_COMMNOTIFY", NULL, + "wm_compacting", NULL, NULL, + "WM_COMMNOTIFY", NULL, "WM_WINDOWPOSCHANGING", /* 0x0046 */ "WM_WINDOWPOSCHANGED", /* 0x0047 */ - "WM_POWER", NULL, - "WM_COPYDATA", - "WM_CANCELJOURNAL", NULL, NULL, + "WM_POWER", NULL, + "WM_COPYDATA", + "WM_CANCELJOURNAL", NULL, NULL, "WM_NOTIFY", NULL, /* 0x0050 */ "WM_INPUTLANGCHANGEREQUEST", - "WM_INPUTLANGCHANGE", - "WM_TCARD", - "WM_HELP", - "WM_USERCHANGED", - "WM_NOTIFYFORMAT", NULL, NULL, + "WM_INPUTLANGCHANGE", + "WM_TCARD", + "WM_HELP", + "WM_USERCHANGED", + "WM_NOTIFYFORMAT", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x0060 */ @@ -130,11 +130,11 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = /* 0x0070 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, - "WM_CONTEXTMENU", - "WM_STYLECHANGING", - "WM_STYLECHANGED", - "WM_DISPLAYCHANGE", + NULL, NULL, NULL, + "WM_CONTEXTMENU", + "WM_STYLECHANGING", + "WM_STYLECHANGED", + "WM_DISPLAYCHANGE", "WM_GETICON", "WM_SETICON", /* 0x0080 */ @@ -145,7 +145,7 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_NCPAINT", /* 0x0085 */ "WM_NCACTIVATE", /* 0x0086 */ "WM_GETDLGCODE", /* 0x0087 */ - "WM_SYNCPAINT", + "WM_SYNCPAINT", "WM_SYNCTASK", NULL, NULL, NULL, NULL, NULL, NULL, /* 0x0090 */ @@ -421,10 +421,10 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_ENTERMENULOOP", /* 0x0211 */ "WM_EXITMENULOOP", /* 0x0212 */ "WM_NEXTMENU", /* 0x0213 */ - "WM_SIZING", + "WM_SIZING", "WM_CAPTURECHANGED", "WM_MOVING", NULL, - "WM_POWERBROADCAST", + "WM_POWERBROADCAST", "WM_DEVICECHANGE", NULL, NULL, NULL, NULL, NULL, NULL, "WM_MDICREATE", /* 0x0220 */ @@ -438,22 +438,22 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_MDIICONARRANGE", /* 0x0228 */ "WM_MDIGETACTIVE", /* 0x0229 */ - "WM_DROPOBJECT", - "WM_QUERYDROPOBJECT", + "WM_DROPOBJECT", + "WM_QUERYDROPOBJECT", "WM_BEGINDRAG", "WM_DRAGLOOP", "WM_DRAGSELECT", "WM_DRAGMOVE", - + /* 0x0230*/ "WM_MDISETMENU", /* 0x0230 */ "WM_ENTERSIZEMOVE", /* 0x0231 */ "WM_EXITSIZEMOVE", /* 0x0232 */ "WM_DROPFILES", /* 0x0233 */ - "WM_MDIREFRESHMENU", NULL, NULL, NULL, + "WM_MDIREFRESHMENU", NULL, NULL, NULL, /* 0x0238*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - + /* 0x0240 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -461,7 +461,7 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = /* 0x0250 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - + /* 0x0260 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -492,18 +492,18 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "WM_CUT", /* 0x0300 */ - "WM_COPY", - "WM_PASTE", - "WM_CLEAR", - "WM_UNDO", - "WM_RENDERFORMAT", - "WM_RENDERALLFORMATS", + "WM_COPY", + "WM_PASTE", + "WM_CLEAR", + "WM_UNDO", + "WM_RENDERFORMAT", + "WM_RENDERALLFORMATS", "WM_DESTROYCLIPBOARD", - "WM_DRAWCLIPBOARD", - "WM_PAINTCLIPBOARD", - "WM_VSCROLLCLIPBOARD", - "WM_SIZECLIPBOARD", - "WM_ASKCBFORMATNAME", + "WM_DRAWCLIPBOARD", + "WM_PAINTCLIPBOARD", + "WM_VSCROLLCLIPBOARD", + "WM_SIZECLIPBOARD", + "WM_ASKCBFORMATNAME", "WM_CHANGECBCHAIN", "WM_HSCROLLCLIPBOARD", "WM_QUERYNEWPALETTE", /* 0x030f*/ @@ -511,10 +511,10 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_PALETTEISCHANGING", "WM_PALETTECHANGED", "WM_HOTKEY", /* 0x0312 */ - NULL, NULL, NULL, NULL, - "WM_PRINT", - "WM_PRINTCLIENT", - NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + "WM_PRINT", + "WM_PRINTCLIENT", + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -570,23 +570,23 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "WM_COALESCE_LAST", /* 0x039F */ - + /* 0x03a0 */ - "MM_JOY1MOVE", - "MM_JOY2MOVE", - "MM_JOY1ZMOVE", - "MM_JOY2ZMOVE", + "MM_JOY1MOVE", + "MM_JOY2MOVE", + "MM_JOY1ZMOVE", + "MM_JOY2ZMOVE", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x03b0 */ - NULL, NULL, NULL, NULL, NULL, - "MM_JOY1BUTTONDOWN", - "MM_JOY2BUTTONDOWN", + NULL, NULL, NULL, NULL, NULL, + "MM_JOY1BUTTONDOWN", + "MM_JOY2BUTTONDOWN", "MM_JOY1BUTTONUP", "MM_JOY2BUTTONUP", "MM_MCINOTIFY", - NULL, + NULL, "MM_WOM_OPEN", "MM_WOM_CLOSE", "MM_WOM_DONE", @@ -620,7 +620,7 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "WM_DDE_EXECUTE", /* 0x3E8 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, - + /* 0x03f0 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1279,41 +1279,41 @@ const USER_MSG *classmsg; /* pointer to first USER_MSG for class */ /* number. (First method prefered.) */ static const USER_MSG rebar_array[] = { - USM(RB_INSERTBANDA, 0), - USM(RB_DELETEBAND, 0), - USM(RB_GETBARINFO, 0), - USM(RB_SETBARINFO, 0), - USM(RB_GETBANDINFO, 0), - USM(RB_SETBANDINFOA, 0), - USM(RB_SETPARENT, 0), - USM(RB_HITTEST, 0), - USM(RB_GETRECT, 0), - USM(RB_INSERTBANDW, 0), - USM(RB_SETBANDINFOW, 0), - USM(RB_GETBANDCOUNT, 0), - USM(RB_GETROWCOUNT, 0), - USM(RB_GETROWHEIGHT, 0), - USM(RB_IDTOINDEX, 0), - USM(RB_GETTOOLTIPS, 0), - USM(RB_SETTOOLTIPS, 0), - USM(RB_SETBKCOLOR, 0), - USM(RB_GETBKCOLOR, 0), - USM(RB_SETTEXTCOLOR, 0), - USM(RB_GETTEXTCOLOR, 0), - USM(RB_SIZETORECT, 0), - USM(RB_BEGINDRAG, 0), - USM(RB_ENDDRAG, 0), - USM(RB_DRAGMOVE, 0), - USM(RB_GETBARHEIGHT, 0), - USM(RB_GETBANDINFOW, 0), - USM(RB_GETBANDINFOA, 0), - USM(RB_MINIMIZEBAND, 0), - USM(RB_MAXIMIZEBAND, 0), - USM(RB_GETBANDBORDERS, 0), - USM(RB_SHOWBAND, 0), - USM(RB_SETPALETTE, 0), - USM(RB_GETPALETTE, 0), - USM(RB_MOVEBAND, 0), + USM(RB_INSERTBANDA, 0), + USM(RB_DELETEBAND, 0), + USM(RB_GETBARINFO, 0), + USM(RB_SETBARINFO, 0), + USM(RB_GETBANDINFO, 0), + USM(RB_SETBANDINFOA, 0), + USM(RB_SETPARENT, 0), + USM(RB_HITTEST, 0), + USM(RB_GETRECT, 0), + USM(RB_INSERTBANDW, 0), + USM(RB_SETBANDINFOW, 0), + USM(RB_GETBANDCOUNT, 0), + USM(RB_GETROWCOUNT, 0), + USM(RB_GETROWHEIGHT, 0), + USM(RB_IDTOINDEX, 0), + USM(RB_GETTOOLTIPS, 0), + USM(RB_SETTOOLTIPS, 0), + USM(RB_SETBKCOLOR, 0), + USM(RB_GETBKCOLOR, 0), + USM(RB_SETTEXTCOLOR, 0), + USM(RB_GETTEXTCOLOR, 0), + USM(RB_SIZETORECT, 0), + USM(RB_BEGINDRAG, 0), + USM(RB_ENDDRAG, 0), + USM(RB_DRAGMOVE, 0), + USM(RB_GETBARHEIGHT, 0), + USM(RB_GETBANDINFOW, 0), + USM(RB_GETBANDINFOA, 0), + USM(RB_MINIMIZEBAND, 0), + USM(RB_MAXIMIZEBAND, 0), + USM(RB_GETBANDBORDERS, 0), + USM(RB_SHOWBAND, 0), + USM(RB_SETPALETTE, 0), + USM(RB_GETPALETTE, 0), + USM(RB_MOVEBAND, 0), {0,0,0} }; static const USER_MSG toolbar_array[] = { @@ -1323,9 +1323,9 @@ static const USER_MSG toolbar_array[] = { USM(TB_HIDEBUTTON ,0), USM(TB_INDETERMINATE ,0), USM(TB_MARKBUTTON ,0), - USM(TB_ISBUTTONENABLED ,0), - USM(TB_ISBUTTONCHECKED ,0), - USM(TB_ISBUTTONPRESSED ,0), + USM(TB_ISBUTTONENABLED ,0), + USM(TB_ISBUTTONCHECKED ,0), + USM(TB_ISBUTTONPRESSED ,0), USM(TB_ISBUTTONHIDDEN ,0), USM(TB_ISBUTTONINDETERMINATE ,0), USM(TB_ISBUTTONHIGHLIGHTED ,0), @@ -1340,7 +1340,7 @@ static const USER_MSG toolbar_array[] = { USM(TB_COMMANDTOINDEX ,0), USM(TB_SAVERESTOREA ,0), USM(TB_CUSTOMIZE ,0), - USM(TB_ADDSTRINGA ,0), + USM(TB_ADDSTRINGA ,0), USM(TB_GETITEMRECT ,0), USM(TB_BUTTONSTRUCTSIZE ,0), USM(TB_SETBUTTONSIZE ,0), @@ -1387,7 +1387,7 @@ static const USER_MSG toolbar_array[] = { USM(TB_GETANCHORHIGHLIGHT ,0), USM(TB_GETBUTTONTEXTW ,0), USM(TB_SAVERESTOREW ,0), - USM(TB_ADDSTRINGW ,0), + USM(TB_ADDSTRINGW ,0), USM(TB_MAPACCELERATORA ,0), USM(TB_GETINSERTMARK ,0), USM(TB_SETINSERTMARK ,0), @@ -1481,12 +1481,12 @@ typedef struct /* locate the correct 'value'. */ static const SPY_NOTIFY spnfy_array[] = { /* common 0U to 0U-99U */ - SPNFY(NM_OUTOFMEMORY, NMHDR), - SPNFY(NM_CLICK, NMHDR), + SPNFY(NM_OUTOFMEMORY, NMHDR), + SPNFY(NM_CLICK, NMHDR), SPNFY(NM_DBLCLK, NMHDR), - SPNFY(NM_RETURN, NMHDR), + SPNFY(NM_RETURN, NMHDR), SPNFY(NM_RCLICK, NMHDR), - SPNFY(NM_RDBLCLK, NMHDR), + SPNFY(NM_RDBLCLK, NMHDR), SPNFY(NM_SETFOCUS, NMHDR), SPNFY(NM_KILLFOCUS, NMHDR), SPNFY(NM_CUSTOMDRAW, NMCUSTOMDRAW), @@ -1496,7 +1496,7 @@ static const SPY_NOTIFY spnfy_array[] = { SPNFY(NM_RELEASEDCAPTURE, NMHDR), SPNFY(NM_SETCURSOR, NMMOUSE), SPNFY(NM_CHAR, NMCHAR), - SPNFY(NM_TOOLTIPSCREATED, NMTOOLTIPSCREATED), + SPNFY(NM_TOOLTIPSCREATED, NMTOOLTIPSCREATED), /* Listview 0U-100U to 0U-199U */ SPNFY(LVN_ITEMCHANGING, NMLISTVIEW), SPNFY(LVN_ITEMCHANGED, NMLISTVIEW), @@ -1613,7 +1613,7 @@ static const SPY_NOTIFY spnfy_array[] = { SPNFY(TBN_GETINFOTIPW, NMTBGETINFOTIPW), SPNFY(TBN_GETBUTTONINFOW, NMTOOLBARW), /* Up/Down 0U-721U to 0U-740U */ - SPNFY(UDN_DELTAPOS, NMHDR), + SPNFY(UDN_DELTAPOS, NMHDR), /* Month Calendar 0U-750U to 0U-759U */ /* ******************* WARNING ***************************** */ /* The following appear backwards but needs to be this way. */ @@ -1631,9 +1631,9 @@ static const SPY_NOTIFY spnfy_array[] = { /* Thank you MS for your obvious quality control!! */ /* ******************* WARNING ***************************** */ /* Date/Time 0U-760U to 0U-799U */ - /* SPNFY(MCN_SELECT, NMHDR), */ - /* SPNFY(MCN_GETDAYSTATE, NMHDR), */ - /* SPNFY(MCN_SELCHANGE, NMHDR), */ + /* SPNFY(MCN_SELECT, NMHDR), */ + /* SPNFY(MCN_GETDAYSTATE, NMHDR), */ + /* SPNFY(MCN_SELCHANGE, NMHDR), */ /* ******************* WARNING ***************************** */ /* The following appear backwards but needs to be this way. */ /* The reason is that MS (and us) define the MCNs as */ @@ -1642,20 +1642,20 @@ static const SPY_NOTIFY spnfy_array[] = { /* TBN_FIRST - n */ /* The only place that this is important is in this list */ /* ******************* WARNING ***************************** */ - SPNFY(DTN_FORMATQUERYW, NMHDR), - SPNFY(DTN_FORMATW, NMHDR), - SPNFY(DTN_WMKEYDOWNW, NMHDR), - SPNFY(DTN_USERSTRINGW, NMHDR), - SPNFY(MCN_SELECT, NMHDR), - SPNFY(MCN_GETDAYSTATE, NMHDR), - SPNFY(MCN_SELCHANGE, NMHDR), - SPNFY(DTN_CLOSEUP, NMHDR), - SPNFY(DTN_DROPDOWN, NMHDR), - SPNFY(DTN_FORMATQUERYA, NMHDR), - SPNFY(DTN_FORMATA, NMHDR), - SPNFY(DTN_WMKEYDOWNA, NMHDR), - SPNFY(DTN_USERSTRINGA, NMHDR), - SPNFY(DTN_DATETIMECHANGE, NMHDR), + SPNFY(DTN_FORMATQUERYW, NMHDR), + SPNFY(DTN_FORMATW, NMHDR), + SPNFY(DTN_WMKEYDOWNW, NMHDR), + SPNFY(DTN_USERSTRINGW, NMHDR), + SPNFY(MCN_SELECT, NMHDR), + SPNFY(MCN_GETDAYSTATE, NMHDR), + SPNFY(MCN_SELCHANGE, NMHDR), + SPNFY(DTN_CLOSEUP, NMHDR), + SPNFY(DTN_DROPDOWN, NMHDR), + SPNFY(DTN_FORMATQUERYA, NMHDR), + SPNFY(DTN_FORMATA, NMHDR), + SPNFY(DTN_WMKEYDOWNA, NMHDR), + SPNFY(DTN_USERSTRINGA, NMHDR), + SPNFY(DTN_DATETIMECHANGE, NMHDR), /* ComboBoxEx 0U-800U to 0U-830U */ SPNFY(CBEN_GETDISPINFOA, NMCOMBOBOXEXA), SPNFY(CBEN_INSERTITEM, NMCOMBOBOXEXA), @@ -1677,7 +1677,7 @@ static const SPY_NOTIFY spnfy_array[] = { SPNFY(RBN_DELETEDBAND, NMREBAR), SPNFY(RBN_CHILDSIZE, NMREBARCHILDSIZE), /* IP Adderss 0U-860U to 0U-879U */ - SPNFY(IPN_FIELDCHANGED, NMHDR), + SPNFY(IPN_FIELDCHANGED, NMHDR), /* Status bar 0U-880U to 0U-899U */ SPNFY(SBN_SIMPLEMODECHANGE, NMHDR), /* Pager 0U-900U to 0U-950U */ @@ -1842,8 +1842,8 @@ static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e ) strcmpW(cc_array[i].classname, sp_e->wnd_class) !=0) i++; if (!cc_array[i].classname) return; - /* TRACE("process class %s, first %p, last %p\n", - debugstr_w(cc_array[i].classname), cc_array[i].classmsg, + /* TRACE("process class %s, first %p, last %p\n", + debugstr_w(cc_array[i].classname), cc_array[i].classmsg, cc_array[i].lastmsg); */ p = SPY_Bsearch_Msg (cc_array[i].classmsg, cc_array[i].lastmsg, sp_e->msgnum); @@ -1857,7 +1857,7 @@ static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e ) /*********************************************************************** * SPY_GetWndName * - * Sets the value of "wnd_name" and "wnd_class" members of the + * Sets the value of "wnd_name" and "wnd_class" members of the * instance structure. * */ @@ -1866,7 +1866,7 @@ void SPY_GetWndName( SPY_INSTANCE *sp_e ) DWORD save_error; INT len; - /* save and restore error code over the next call */ + /* save and restore error code over the next call */ save_error = GetLastError(); GetClassNameW(sp_e->msg_hwnd, sp_e->wnd_class, sizeof(sp_e->wnd_class)/sizeof(WCHAR)); SetLastError(save_error); @@ -1887,7 +1887,7 @@ void SPY_GetWndName( SPY_INSTANCE *sp_e ) /*********************************************************************** * SPY_GetMsgName * - * **** External function **** + * **** External function **** * * Get message name */ @@ -2008,7 +2008,7 @@ void SPY_DumpStructure (SPY_INSTANCE *sp_e, BOOL enter) { LPRECT rc = (LPRECT) sp_e->lParam; if (rc) { - TRACE("lParam rect (%d,%d)-(%d,%d)\n", + TRACE("lParam rect (%d,%d)-(%d,%d)\n", rc->left, rc->top, rc->right, rc->bottom); } break; @@ -2035,7 +2035,7 @@ void SPY_DumpStructure (SPY_INSTANCE *sp_e, BOOL enter) { LPINT ptmin = (LPINT) sp_e->wParam; LPINT ptmax = (LPINT) sp_e->lParam; - if (ptmin && ptmax) + if (ptmin && ptmax) TRACE("min=%d max=%d\n", *ptmin, *ptmax); else if (ptmin) TRACE("min=%d max=n/a\n", *ptmin); @@ -2045,24 +2045,24 @@ void SPY_DumpStructure (SPY_INSTANCE *sp_e, BOOL enter) } case WM_DRAWITEM: if (!enter) break; - { + { DRAWITEMSTRUCT *lpdis = (DRAWITEMSTRUCT*) sp_e->lParam; - TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", + TRACE("DRAWITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", lpdis->CtlType, lpdis->CtlID); - TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n", + TRACE("itemID=0x%08x itemAction=0x%08x itemState=0x%08x\n", lpdis->itemID, lpdis->itemAction, lpdis->itemState); TRACE("hWnd=0x%04x hDC=0x%04x (%d,%d)-(%d,%d) itemData=0x%08lx\n", - lpdis->hwndItem, lpdis->hDC, lpdis->rcItem.left, + lpdis->hwndItem, lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top, lpdis->rcItem.right, lpdis->rcItem.bottom, lpdis->itemData); } break; case WM_MEASUREITEM: - { + { MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*) sp_e->lParam; - TRACE("MEASUREITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", + TRACE("MEASUREITEMSTRUCT: CtlType=0x%08x CtlID=0x%08x\n", lpmis->CtlType, lpmis->CtlID); - TRACE("itemID=0x%08x itemWidth=0x%08x itemHeight=0x%08x\n", + TRACE("itemID=0x%08x itemWidth=0x%08x itemHeight=0x%08x\n", lpmis->itemID, lpmis->itemWidth, lpmis->itemHeight); TRACE("itemData=0x%08lx\n", lpmis->itemData); } @@ -2070,7 +2070,7 @@ void SPY_DumpStructure (SPY_INSTANCE *sp_e, BOOL enter) case WM_WINDOWPOSCHANGED: if (!enter) break; case WM_WINDOWPOSCHANGING: - { + { WINDOWPOS *lpwp = (WINDOWPOS *)sp_e->lParam; TRACE("WINDOWPOS hwnd=0x%04x, after=0x%04x, at (%d,%d) w=%d h=%d, flags=0x%08x\n", lpwp->hwnd, lpwp->hwndInsertAfter, lpwp->x, lpwp->y, @@ -2080,10 +2080,10 @@ void SPY_DumpStructure (SPY_INSTANCE *sp_e, BOOL enter) case WM_STYLECHANGED: if (!enter) break; case WM_STYLECHANGING: - { + { LPSTYLESTRUCT ss = (LPSTYLESTRUCT) sp_e->lParam; TRACE("STYLESTRUCT: StyleOld=0x%08lx, StyleNew=0x%08lx\n", - ss->styleOld, ss->styleNew); + ss->styleOld, ss->styleNew); } break; case WM_NCCALCSIZE: @@ -2095,14 +2095,14 @@ void SPY_DumpStructure (SPY_INSTANCE *sp_e, BOOL enter) break; case WM_NOTIFY: /* if (!enter) break; */ - { + { NMHDR * pnmh = (NMHDR*) sp_e->lParam; UINT *q, dumplen; const SPY_NOTIFY *p; WCHAR from_class[60]; DWORD save_error; - p = SPY_Bsearch_Notify (&spnfy_array[0], end_spnfy_array, + p = SPY_Bsearch_Notify (&spnfy_array[0], end_spnfy_array, pnmh->code); if (p) { TRACE("NMHDR hwndFrom=0x%08x idFrom=0x%08x code=%s<0x%08x>, extra=0x%x\n", @@ -2111,12 +2111,12 @@ void SPY_DumpStructure (SPY_INSTANCE *sp_e, BOOL enter) /* for CUSTOMDRAW, dump all the data for TOOLBARs */ if (pnmh->code == NM_CUSTOMDRAW) { - /* save and restore error code over the next call */ + /* save and restore error code over the next call */ save_error = GetLastError(); - GetClassNameW(pnmh->hwndFrom, from_class, + GetClassNameW(pnmh->hwndFrom, from_class, sizeof(from_class)/sizeof(WCHAR)); SetLastError(save_error); - if (strcmpW(TOOLBARCLASSNAMEW, from_class) == 0) + if (strcmpW(TOOLBARCLASSNAMEW, from_class) == 0) dumplen = sizeof(NMTBCUSTOMDRAW)-sizeof(NMHDR); } if (dumplen > 0) { @@ -2133,7 +2133,7 @@ void SPY_DumpStructure (SPY_INSTANCE *sp_e, BOOL enter) SPY_DumpMem ("MSG lParam", (UINT *)sp_e->lParam, sp_e->data_len); break; } - + } /*********************************************************************** * SPY_EnterMessage @@ -2165,7 +2165,7 @@ void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg, case SPY_DISPATCHMESSAGE: TRACE("%*s(%08x) %-16s message [%04x] %s dispatched wp=%08x lp=%08lx\n", - indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg, + indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg, sp_e.msg_name, wParam, lParam); break; @@ -2194,7 +2194,7 @@ void SPY_EnterMessage( INT iFlag, HWND hWnd, UINT msg, SPY_DumpStructure(&sp_e, TRUE); } } - break; + break; case SPY_DEFWNDPROC16: if( SPY_ExcludeDWP ) return; @@ -2262,7 +2262,7 @@ void SPY_ExitMessage( INT iFlag, HWND hWnd, UINT msg, LRESULT lReturn, indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg, sp_e.msg_name, lReturn ); SPY_DumpStructure(&sp_e, FALSE); - break; + break; case SPY_RESULT_INVALIDHWND16: WARN(" %*s(%04x) %-16s message [%04x] %s HAS INVALID HWND\n", @@ -2348,7 +2348,7 @@ int SPY_Init(void) p--; end_spnfy_array = p; - /* find last good entry in each common control message array + /* find last good entry in each common control message array * and save addr for b-search. */ i = 0; diff --git a/windows/syscolor.c b/windows/syscolor.c index 83f838360ac..47a639881ff 100644 --- a/windows/syscolor.c +++ b/windows/syscolor.c @@ -162,7 +162,7 @@ static void SYSCOLOR_SetColor( int index, COLORREF color ) if (SysColorPens[index]) { SYSCOLOR_MakeObjectSystem(SysColorPens[index], FALSE); - DeleteObject( SysColorPens[index] ); + DeleteObject( SysColorPens[index] ); } SysColorPens[index] = CreatePen( PS_SOLID, 1, color ); SYSCOLOR_MakeObjectSystem(SysColorPens[index], TRUE); @@ -193,7 +193,7 @@ void SYSCOLOR_Init(void) { DWORD dwDataSize = sizeof(buffer); if (!(RegQueryValueExA(hKey,(LPSTR)p[i*2], 0, 0, buffer, &dwDataSize))) - if (sscanf( buffer, "%d %d %d", &r, &g, &b ) == 3) + if (sscanf( buffer, "%d %d %d", &r, &g, &b ) == 3) bOk = TRUE; } @@ -203,13 +203,13 @@ void SYSCOLOR_Init(void) if (sscanf( buffer, " %d %d %d", &r, &g, &b ) == 3) bOk = TRUE; } - + /* last chance, take the default */ if (!bOk) { int iNumColors = sscanf( p[i*2+1], " %d %d %d", &r, &g, &b ); assert (iNumColors==3); } - + SYSCOLOR_SetColor( i, RGB(r,g,b) ); } if (!bNoReg) @@ -290,7 +290,7 @@ BOOL WINAPI SetSysColors( INT nChanges, const INT *lpSysColor, * SetSysColorsTemp (USER32.@) * * UNDOCUMENTED !! - * + * * Called by W98SE desk.cpl Control Panel Applet: * handle = SetSysColorsTemp(ptr, ptr, nCount); ("set" call) * result = SetSysColorsTemp(NULL, NULL, handle); ("restore" call) diff --git a/windows/sysmetrics.c b/windows/sysmetrics.c index 0b3b7dad53a..047170ec10f 100644 --- a/windows/sysmetrics.c +++ b/windows/sysmetrics.c @@ -40,13 +40,13 @@ static int sysMetrics[SM_WINE_CMETRICS+1]; * * Convert a a dimension value that was obtained from the registry. These are * quoted as being "twips" values if negative and pixels if positive. - * See for example + * See for example * MSDN Library - April 2001 -> Resource Kits -> * Windows 2000 Resource Kit Reference -> * Technical Reference to the Windows 2000 Registry -> * HKEY_CURRENT_USE -> Control Panel -> Desktop -> WindowMetrics * - * This is written as a function to prevent repeated evaluation of the + * This is written as a function to prevent repeated evaluation of the * argument. */ inline static int RegistryTwips2Pixels(int x) @@ -107,9 +107,9 @@ static int SYSMETRICS_GetRegistryMetric ( * SM_CYMENU x-1 x Already fixed * SM_CYFULLSCREEN x-1 x * SM_CXFRAME Fixed July 6, 2001 - Bill Medland - * + * * (collides with TWEAK_WineLook sometimes, - * so changing anything might be difficult) + * so changing anything might be difficult) * * Starting at Win95 there are now a large number or Registry entries in the * [WindowMetrics] section that are probably relevant here. @@ -231,7 +231,7 @@ void SYSMETRICS_Init(void) sysMetrics[SM_CYMINIMIZED] = 24; /* FIXME: How do I calculate these? */ - sysMetrics[SM_CXMAXTRACK] = + sysMetrics[SM_CXMAXTRACK] = sysMetrics[SM_CXSCREEN] + 4 + 2 * sysMetrics[SM_CXFRAME]; sysMetrics[SM_CYMAXTRACK] = sysMetrics[SM_CYSCREEN] + 4 + 2 * sysMetrics[SM_CYFRAME]; diff --git a/windows/sysparams.c b/windows/sysparams.c index f7fce712278..a23f61cb175 100644 --- a/windows/sysparams.c +++ b/windows/sysparams.c @@ -356,7 +356,7 @@ void SYSPARAMS_NotifyChange( UINT uiAction, UINT fWinIni ) SendMessageA(HWND_BROADCAST, WM_SETTINGCHANGE, uiAction, (LPARAM) ""); } - else + else { /* FIXME notify other wine processes with internal message */ } @@ -543,9 +543,9 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, BOOL ret = TRUE; unsigned spi_idx = 0; - + TRACE("(%u, %u, %p, %u)\n", uiAction, uiParam, pvParam, fWinIni); - + switch (uiAction) { case SPI_GETBEEP: /* 1 */ @@ -553,12 +553,12 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, if (!spi_loaded[spi_idx]) { char buf[5]; - + if (SYSPARAMS_Load( SPI_SETBEEP_REGKEY, SPI_SETBEEP_VALNAME, buf )) beep_active = !strcasecmp( "Yes", buf ); spi_loaded[spi_idx] = TRUE; } - + *(BOOL *)pvParam = beep_active; break; @@ -595,7 +595,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, ((INT *)pvParam)[1] = mouse_threshold2; ((INT *)pvParam)[2] = mouse_speed; break; - + case SPI_SETMOUSE: /* 4 */ { char buf[10]; @@ -656,7 +656,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, if (SYSPARAMS_Save( SPI_SETBORDER_REGKEY, SPI_SETBORDER_VALNAME, buf, fWinIni )) { - if (uiParam > 0) + if (uiParam > 0) { border = uiParam; spi_loaded[spi_idx] = TRUE; @@ -718,7 +718,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, if (!spi_loaded[spi_idx]) { char buf[10]; - + if (SYSPARAMS_Load( SPI_ICONHORIZONTALSPACING_REGKEY, SPI_ICONHORIZONTALSPACING_VALNAME, buf )) { @@ -782,7 +782,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, ret = FALSE; break; } - + case SPI_GETSCREENSAVEACTIVE: /* 16 */ *(BOOL *)pvParam = USER_Driver.pGetScreenSaveActive(); break; @@ -799,7 +799,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, buf, fWinIni ); break; } - + case SPI_GETGRIDGRANULARITY: /* 18 */ spi_idx = SPI_SETGRIDGRANULARITY_IDX; if (!spi_loaded[spi_idx]) @@ -810,7 +810,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, SPI_SETGRIDGRANULARITY_VALNAME, buf )) grid_granularity = atoi( buf ); - + spi_loaded[spi_idx] = TRUE; } *(INT *)pvParam = grid_granularity; @@ -844,8 +844,8 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, if ((INT16)uiParam == -1) { char buffer[256]; - GetProfileStringA( "Desktop", "Pattern", - "170 85 170 85 170 85 170 85", + GetProfileStringA( "Desktop", "Pattern", + "170 85 170 85 170 85 170 85", buffer, sizeof(buffer) ); ret = DESKTOP_SetPattern( (LPSTR)buffer ); } else @@ -865,7 +865,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, int i = atoi( buf ); if ( (i >= 0) && (i <= 3)) keyboard_delay = i; } - + spi_loaded[spi_idx] = TRUE; } *(INT *)pvParam = keyboard_delay; @@ -898,7 +898,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, if (!spi_loaded[spi_idx]) { char buf[10]; - + if (SYSPARAMS_Load( SPI_ICONVERTICALSPACING_REGKEY, SPI_ICONVERTICALSPACING_VALNAME, buf )) { @@ -926,7 +926,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, else ret = FALSE; } - + break; case SPI_GETICONTITLEWRAP: /* 25 */ @@ -940,7 +940,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, icon_title_wrap = atoi(buf); spi_loaded[spi_idx] = TRUE; } - + *(BOOL *)pvParam = icon_title_wrap; break; @@ -961,14 +961,14 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, ret = FALSE; break; } - + case SPI_GETMENUDROPALIGNMENT: /* 27 */ spi_idx = SPI_SETMENUDROPALIGNMENT_IDX; if (!spi_loaded[spi_idx]) { char buf[5]; - + if (SYSPARAMS_Load( SPI_SETMENUDROPALIGNMENT_REGKEY, SPI_SETMENUDROPALIGNMENT_VALNAME, buf )) { @@ -976,7 +976,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, } spi_loaded[spi_idx] = TRUE; } - + *(BOOL *)pvParam = GetSystemMetrics( SM_MENUDROPALIGNMENT ); break; @@ -1048,7 +1048,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, SYSPARAMS_GetGUIFont( &lfDefault ); GetProfileStringA( "Desktop", "IconTitleFaceName", - lfDefault.lfFaceName, + lfDefault.lfFaceName, lpLogFont->lfFaceName, LF_FACESIZE ); lpLogFont->lfHeight = -GetProfileIntA( "Desktop", "IconTitleSize", 13 ); lpLogFont->lfWidth = 0; @@ -1113,7 +1113,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, /* the action is disabled */ ret = FALSE; break; - + case SPI_SETDRAGFULLWINDOWS: /* 37 WINVER >= 0x0400 */ { char buf[5]; @@ -1143,18 +1143,18 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, drag_full_windows = atoi(buf); spi_loaded[spi_idx] = TRUE; } - + *(BOOL *)pvParam = drag_full_windows; break; case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */ { LPNONCLIENTMETRICSA lpnm = (LPNONCLIENTMETRICSA)pvParam; - + if (lpnm->cbSize == sizeof(NONCLIENTMETRICSA)) { LPLOGFONTA lpLogFont = &(lpnm->lfMenuFont); - + /* clear the struct, so we have 'sane' members */ memset( (char *)pvParam + sizeof(lpnm->cbSize), @@ -1180,11 +1180,11 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, /* menus, FIXME: names of wine.conf entries are bogus */ lpnm->iMenuWidth = GetProfileIntA( "Desktop", "MenuWidth", 13 ); /* size of the menu buttons*/ - lpnm->iMenuHeight = GetProfileIntA( "Desktop", "MenuHeight", + lpnm->iMenuHeight = GetProfileIntA( "Desktop", "MenuHeight", (TWEAK_WineLook > WIN31_LOOK) ? 13 : 27 ); - GetProfileStringA( "Desktop", "MenuFont", - (TWEAK_WineLook > WIN31_LOOK) ? lpnm->lfCaptionFont.lfFaceName : "System", + GetProfileStringA( "Desktop", "MenuFont", + (TWEAK_WineLook > WIN31_LOOK) ? lpnm->lfCaptionFont.lfFaceName : "System", lpLogFont->lfFaceName, LF_FACESIZE ); lpLogFont->lfHeight = -GetProfileIntA( "Desktop", "MenuFontSize", 13 ); @@ -1270,7 +1270,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, SetRect( &work_area, 0, 0, GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ) ); - + if (SYSPARAMS_Load( SPI_SETWORKAREA_REGKEY, SPI_SETWORKAREA_VALNAME, buf )) @@ -1353,7 +1353,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, if (!spi_loaded[spi_idx]) { char buf[10]; - + if (SYSPARAMS_Load( SPI_SETSHOWSOUNDS_REGKEY, SPI_SETSHOWSOUNDS_VALNAME, buf )) { @@ -1361,7 +1361,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, } spi_loaded[spi_idx] = TRUE; } - + *(INT *)pvParam = GetSystemMetrics( SM_SHOWSOUNDS ); break; @@ -1466,7 +1466,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, break; } WINE_SPI_FIXME(SPI_SETSOUNDSENTRY); /* 65 */ - + case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */ { LPHIGHCONTRASTA lpHighContrastA = (LPHIGHCONTRASTA)pvParam; @@ -1496,7 +1496,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, keyboard_pref = atoi(buf); spi_loaded[spi_idx] = TRUE; } - + *(BOOL *)pvParam = keyboard_pref; break; @@ -1529,7 +1529,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, screen_reader = atoi(buf); spi_loaded[spi_idx] = TRUE; } - + *(BOOL *)pvParam = screen_reader; break; @@ -1554,7 +1554,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, case SPI_GETANIMATION: /* 72 WINVER >= 0x400 */ { LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)pvParam; - + /* Tell it "disabled" */ if (lpAnimInfo->cbSize == sizeof(ANIMATIONINFO)) lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */ @@ -1580,7 +1580,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, WINE_SPI_FIXME(SPI_GETPOWEROFFACTIVE); /* 84 WINVER >= 0x400 */ WINE_SPI_FIXME(SPI_SETLOWPOWERACTIVE); /* 85 WINVER >= 0x400 */ WINE_SPI_FIXME(SPI_SETPOWEROFFACTIVE); /* 86 WINVER >= 0x400 */ - + WINE_SPI_FIXME(SPI_SETCURSORS); /* 87 WINVER >= 0x400 */ WINE_SPI_FIXME(SPI_SETICONS); /* 88 WINVER >= 0x400 */ @@ -1596,7 +1596,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, WINE_SPI_FIXME(SPI_SETMOUSETRAILS); /* 93 WINVER >= 0x400 */ WINE_SPI_FIXME(SPI_GETMOUSETRAILS); /* 94 WINVER >= 0x400 */ - + case SPI_SETSCREENSAVERRUNNING: /* 97 WINVER >= 0x400 */ { /* SPI_SCREENSAVERRUNNING is an alias for SPI_SETSCREENSAVERRUNNING */ @@ -1632,9 +1632,9 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, *(UINT *)pvParam = 400; /* default for menu dropdowns */ break; WINE_SPI_FIXME(SPI_SETMOUSEHOVERTIME); /* 103 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */ - + case SPI_GETWHEELSCROLLLINES: /* 104 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */ - *(UINT *)pvParam = 3; /* default for num scroll lines */ + *(UINT *)pvParam = 3; /* default for num scroll lines */ break; WINE_SPI_FIXME(SPI_SETWHEELSCROLLLINES); /* 105 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */ @@ -1651,13 +1651,13 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, if (!spi_loaded[spi_idx]) { char buf[5]; - + if (SYSPARAMS_Load( SPI_SETSCREENSAVERRUNNING_REGKEY, SPI_SETSCREENSAVERRUNNING_VALNAME, buf )) screensaver_running = atoi( buf ); spi_loaded[spi_idx] = TRUE; } - + *(BOOL *)pvParam = screensaver_running; break; @@ -1695,7 +1695,7 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, if (ret) SYSPARAMS_NotifyChange( uiAction, fWinIni ); return ret; - + #undef WINE_SPI_FIXME #undef WINE_SPI_WARN } @@ -1710,7 +1710,7 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam, BOOL16 ret; TRACE("(%u, %u, %p, %u)\n", uAction, uParam, lpvParam, fuWinIni); - + switch (uAction) { case SPI_GETBEEP: /* 1 */ @@ -1774,7 +1774,7 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam, ret = SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni ); break; } - + case SPI_GETWORKAREA: /* 48 WINVER >= 0x400 */ { RECT tmp; @@ -1783,7 +1783,7 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam, CONV_RECT32TO16( &tmp, (RECT16 *)lpvParam ); break; } - + case SPI_GETMOUSEHOVERWIDTH: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */ case SPI_GETMOUSEHOVERHEIGHT: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */ case SPI_GETMOUSEHOVERTIME: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */ @@ -1811,7 +1811,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, BOOL ret; TRACE("(%u, %u, %p, %u)\n", uiAction, uiParam, pvParam, fuWinIni); - + switch (uiAction) { case SPI_SETDESKWALLPAPER: /* 20 */ @@ -1890,7 +1890,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, ret = FALSE; break; } - + default: ret = SystemParametersInfoA( uiAction, uiParam, pvParam, fuWinIni ); break; diff --git a/windows/timer.c b/windows/timer.c index f4e8a551441..4ba0c3c032e 100644 --- a/windows/timer.c +++ b/windows/timer.c @@ -79,7 +79,7 @@ void TIMER_RemoveWindowTimers( HWND hwnd ) TIMER *pTimer; EnterCriticalSection( &csTimer ); - + for (i = NB_TIMERS, pTimer = TimersArray; i > 0; i--, pTimer++) if ((pTimer->hwnd == hwnd) && pTimer->timeout) TIMER_ClearTimer( pTimer ); @@ -99,11 +99,11 @@ void TIMER_RemoveQueueTimers( HQUEUE16 hqueue ) TIMER *pTimer; EnterCriticalSection( &csTimer ); - + for (i = NB_TIMERS, pTimer = TimersArray; i > 0; i--, pTimer++) if ((pTimer->hq == hqueue) && pTimer->timeout) TIMER_ClearTimer( pTimer ); - + LeaveCriticalSection( &csTimer ); } @@ -127,11 +127,11 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout, if (!timeout) { /* timeout==0 is a legal argument UB 990821*/ WARN("Timeout== 0 not implemented, using timeout=1\n"); - timeout=1; + timeout=1; } EnterCriticalSection( &csTimer ); - + /* Check if there's already a timer with the same hwnd and id */ for (i = 0, pTimer = TimersArray; i < NB_TIMERS; i++, pTimer++) @@ -145,7 +145,7 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout, if ( i == NB_TIMERS ) { /* Find a free timer */ - + for (i = 0, pTimer = TimersArray; i < NB_TIMERS; i++, pTimer++) if (!pTimer->timeout) break; @@ -158,7 +158,7 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout, } if (!hwnd) id = i + 1; - + if (proc) WINPROC_SetProc( &winproc, proc, type, WIN_PROC_TIMER ); SERVER_START_REQ( set_win_timer ) @@ -181,12 +181,12 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout, pTimer->timeout = timeout; pTimer->proc = winproc; - TRACE("Timer added: %p, %04x, %04x, %04x, %08lx\n", + TRACE("Timer added: %p, %04x, %04x, %04x, %08lx\n", pTimer, pTimer->hwnd, pTimer->msg, pTimer->id, (DWORD)pTimer->proc ); LeaveCriticalSection( &csTimer ); - + if (!id) return TRUE; else return id; } @@ -199,7 +199,7 @@ static BOOL TIMER_KillTimer( HWND hwnd, UINT id, BOOL sys ) { int i; TIMER * pTimer; - + SERVER_START_REQ( kill_win_timer ) { req->win = hwnd; @@ -210,9 +210,9 @@ static BOOL TIMER_KillTimer( HWND hwnd, UINT id, BOOL sys ) SERVER_END_REQ; EnterCriticalSection( &csTimer ); - + /* Find the timer */ - + for (i = 0, pTimer = TimersArray; i < NB_TIMERS; i++, pTimer++) if ((pTimer->hwnd == hwnd) && (pTimer->id == id) && (pTimer->timeout != 0)) break; @@ -229,9 +229,9 @@ static BOOL TIMER_KillTimer( HWND hwnd, UINT id, BOOL sys ) /* Delete the timer */ TIMER_ClearTimer( pTimer ); - + LeaveCriticalSection( &csTimer ); - + return TRUE; } @@ -292,7 +292,7 @@ BOOL TIMER_IsTimerValid( HWND hwnd, UINT id, HWINDOWPROC hProc ) UINT16 WINAPI SetSystemTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout, TIMERPROC16 proc ) { - TRACE("%04x %d %d %08lx\n", + TRACE("%04x %d %d %08lx\n", hwnd, id, timeout, (LONG)proc ); return TIMER_SetTimer( WIN_Handle32(hwnd), id, timeout, (WNDPROC16)proc, WIN_PROC_16, TRUE ); @@ -305,7 +305,7 @@ UINT16 WINAPI SetSystemTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout, UINT WINAPI SetSystemTimer( HWND hwnd, UINT id, UINT timeout, TIMERPROC proc ) { - TRACE("%04x %d %d %08lx\n", + TRACE("%04x %d %d %08lx\n", hwnd, id, timeout, (LONG)proc ); return TIMER_SetTimer( hwnd, id, timeout, (WNDPROC16)proc, WIN_PROC_32A, TRUE ); } diff --git a/windows/user.c b/windows/user.c index 1abf7d9e04a..d7864c288da 100644 --- a/windows/user.c +++ b/windows/user.c @@ -2,7 +2,7 @@ * Misc. USER functions * * Copyright 1993 Robert J. Amstadt - * 1996 Alex Korobka + * 1996 Alex Korobka * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -166,7 +166,7 @@ void WINAPI FinalUserInit16( void ) * SignalProc32 (USER.391) * UserSignalProc (USER32.@) * - * For comments about the meaning of uCode and dwFlags + * For comments about the meaning of uCode and dwFlags * see PROCESS_CallUserSignalProc. * */ @@ -278,7 +278,7 @@ LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags ) MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n"); if (devmode==NULL) FIXME_(system)(" devmode=NULL (return to default mode)\n"); - else if ( (devmode->dmBitsPerPel != GetSystemMetrics(SM_WINE_BPP)) + else if ( (devmode->dmBitsPerPel != GetSystemMetrics(SM_WINE_BPP)) || (devmode->dmPelsHeight != GetSystemMetrics(SM_CYSCREEN)) || (devmode->dmPelsWidth != GetSystemMetrics(SM_CXSCREEN)) ) @@ -290,9 +290,9 @@ LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags ) FIXME_(system)(" width=%ld\n",devmode->dmPelsWidth); if (devmode->dmFields & DM_PELSHEIGHT) FIXME_(system)(" height=%ld\n",devmode->dmPelsHeight); - FIXME_(system)(" (Putting X in this mode beforehand might help)\n"); + FIXME_(system)(" (Putting X in this mode beforehand might help)\n"); /* we don't, but the program ... does not need to know */ - return DISP_CHANGE_SUCCESSFUL; + return DISP_CHANGE_SUCCESSFUL; } return DISP_CHANGE_SUCCESSFUL; } @@ -309,7 +309,7 @@ LONG WINAPI ChangeDisplaySettings16( LPDEVMODEA devmode, DWORD flags ) /*********************************************************************** * ChangeDisplaySettingsExA (USER32.@) */ -LONG WINAPI ChangeDisplaySettingsExA( +LONG WINAPI ChangeDisplaySettingsExA( LPCSTR devname, LPDEVMODEA devmode, HWND hwnd, DWORD flags, LPARAM lparam ) { @@ -329,9 +329,9 @@ LONG WINAPI ChangeDisplaySettingsExA( FIXME_(system)(" width=%ld\n",devmode->dmPelsWidth); if (devmode->dmFields & DM_PELSHEIGHT) FIXME_(system)(" height=%ld\n",devmode->dmPelsHeight); - FIXME_(system)(" (Putting X in this mode beforehand might help)\n"); + FIXME_(system)(" (Putting X in this mode beforehand might help)\n"); /* we don't, but the program ... does not need to know */ - return DISP_CHANGE_SUCCESSFUL; + return DISP_CHANGE_SUCCESSFUL; } return DISP_CHANGE_SUCCESSFUL; } @@ -415,7 +415,7 @@ BOOL16 WINAPI EnumDisplaySettings16( * EnumDisplaySettingsExA (USER32.@) */ BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum, - LPDEVMODEA lpDevMode, DWORD dwFlags) + LPDEVMODEA lpDevMode, DWORD dwFlags) { TRACE_(system)("(%s,%lu,%p,%08lx): stub\n", debugstr_a(lpszDeviceName), iModeNum, lpDevMode, dwFlags); @@ -427,7 +427,7 @@ BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum, * EnumDisplaySettingsExW (USER32.@) */ BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, - LPDEVMODEW lpDevMode, DWORD dwFlags) + LPDEVMODEW lpDevMode, DWORD dwFlags) { TRACE_(system)("(%s,%lu,%p,%08lx): stub\n", debugstr_w(lpszDeviceName), iModeNum, lpDevMode, dwFlags); @@ -500,7 +500,7 @@ DWORD WINAPI UserSeeUserDo16(WORD wReqType, WORD wParam1, WORD wParam2, WORD wPa case USUD_LOCALHEAP: return USER_HeapSel; case USUD_FIRSTCLASS: - FIXME_(local)("return a pointer to the first window class.\n"); + FIXME_(local)("return a pointer to the first window class.\n"); return (DWORD)-1; default: WARN_(local)("wReqType %04x (unknown)", wReqType); diff --git a/windows/win.c b/windows/win.c index 6f21aba2abd..f88d1e1890b 100644 --- a/windows/win.c +++ b/windows/win.c @@ -872,7 +872,7 @@ static void WIN_FixCoordinates( CREATESTRUCTA *cs, INT *sw) else { /* neither x nor cx are default. Check the y values . - * In the trace we see Outlook and Outlook Express using + * In the trace we see Outlook and Outlook Express using * cy set to CW_USEDEFAULT when opening the address book. */ if (cs->cy == CW_USEDEFAULT || cs->cy == CW_USEDEFAULT16) { @@ -1912,15 +1912,15 @@ static LONG WIN_GetWindowLong( HWND hwnd, INT offset, WINDOWPROCTYPE type ) * code using illegal offset value. Hopefully this is * what those programs really expect. */ - if (type == WIN_PROC_16 && + if (type == WIN_PROC_16 && wndPtr->cbWndExtra >= 4 && offset == wndPtr->cbWndExtra - sizeof(WORD)) { INT offset2 = wndPtr->cbWndExtra - sizeof(LONG); - + ERR( "- replaced invalid offset %d with %d\n", offset, offset2 ); - + retvalue = *(LONG *)(((char *)wndPtr->wExtra) + offset2); WIN_ReleasePtr( wndPtr ); return retvalue; diff --git a/windows/winhelp.c b/windows/winhelp.c index 49c6bbc6eaa..e6123ddaed3 100644 --- a/windows/winhelp.c +++ b/windows/winhelp.c @@ -83,7 +83,7 @@ BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand, int size,dsize,nlen; - if(!WM_WINHELP) + if(!WM_WINHELP) { WM_WINHELP=RegisterWindowMessageA("WM_WINHELP"); if(!WM_WINHELP) diff --git a/windows/winpos.c b/windows/winpos.c index 228a95f2c2a..98b8bd37ae8 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -122,7 +122,7 @@ void WINPOS_CheckInternalPos( HWND hwnd ) if( lpPos ) { - if( IsWindow(lpPos->hwndIconTitle) ) + if( IsWindow(lpPos->hwndIconTitle) ) DestroyWindow( lpPos->hwndIconTitle ); HeapFree( GetProcessHeap(), 0, lpPos ); } @@ -823,10 +823,10 @@ BOOL WINAPI BringWindowToTop( HWND hwnd ) */ BOOL WINAPI MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint ) -{ +{ int flags = SWP_NOZORDER | SWP_NOACTIVATE; if (!repaint) flags |= SWP_NOREDRAW; - TRACE("%04x %d,%d %dx%d %d\n", + TRACE("%04x %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint ); return SetWindowPos( hwnd, 0, x, y, cx, cy, flags ); } @@ -840,7 +840,7 @@ static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *res atomInternalPos ); if( !lpPos ) { - /* this happens when the window is minimized/maximized + /* this happens when the window is minimized/maximized * for the first time (rectWindow is not adjusted yet) */ lpPos = HeapAlloc( GetProcessHeap(), 0, sizeof(INTERNALPOS) ); @@ -852,11 +852,11 @@ static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *res *(UINT*)&lpPos->ptIconPos = *(UINT*)&lpPos->ptMaxPos = 0xFFFFFFFF; } - if( wnd->dwStyle & WS_MINIMIZE ) + if( wnd->dwStyle & WS_MINIMIZE ) CONV_POINT32TO16( &pt, &lpPos->ptIconPos ); - else if( wnd->dwStyle & WS_MAXIMIZE ) + else if( wnd->dwStyle & WS_MAXIMIZE ) CONV_POINT32TO16( &pt, &lpPos->ptMaxPos ); - else if( restoreRect ) + else if( restoreRect ) CONV_RECT32TO16( restoreRect, &lpPos->rectNormal ); return lpPos; @@ -1016,7 +1016,7 @@ UINT16 WINAPI GetInternalWindowPos16( HWND16 hwnd, LPRECT16 rectWnd, LPPOINT16 ptIcon ) { WINDOWPLACEMENT16 wndpl; - if (GetWindowPlacement16( hwnd, &wndpl )) + if (GetWindowPlacement16( hwnd, &wndpl )) { if (rectWnd) *rectWnd = wndpl.rcNormalPosition; if (ptIcon) *ptIcon = wndpl.ptMinPosition; @@ -1095,7 +1095,7 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f if( wndpl->flags & WPF_SETMINPOSITION && !EMPTYPOINT(lpPos->ptIconPos)) SetWindowPos( hwnd, 0, lpPos->ptIconPos.x, lpPos->ptIconPos.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); - } + } else if( pWnd->dwStyle & WS_MAXIMIZE ) { if( !EMPTYPOINT(lpPos->ptMaxPos) ) @@ -1288,7 +1288,7 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus) /* if prev wnd is minimized redraw icon title */ if( IsIconic( hwndPrevActive ) ) WINPOS_RedrawIconTitle(hwndPrevActive); - /* managed windows will get ConfigureNotify event */ + /* managed windows will get ConfigureNotify event */ if (wndPtr && !(wndPtr->dwStyle & WS_CHILD) && !(wndPtr->dwExStyle & WS_EX_MANAGED)) { /* check Z-order and bring hWnd to the top */ @@ -1297,9 +1297,9 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus) tmp = GetWindow( tmp, GW_HWNDNEXT ); if( tmp != hWnd ) - SetWindowPos(hWnd, HWND_TOP, 0,0,0,0, + SetWindowPos(hWnd, HWND_TOP, 0,0,0,0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE ); - if (!IsWindow(hWnd)) + if (!IsWindow(hWnd)) goto CLEANUP; } @@ -1336,7 +1336,7 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus) } HeapFree( GetProcessHeap(), 0, list ); } - + if (hWnd && !IsWindow(hWnd)) goto CLEANUP; } @@ -1367,13 +1367,13 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus) HWND hOldFocus = PERQDATA_GetFocusWnd( pNewActiveQueue->pQData ); if ( !hOldFocus || GetAncestor( hOldFocus, GA_ROOT ) != hwndActive ) - FOCUS_SwitchFocus( pNewActiveQueue, hOldFocus, + FOCUS_SwitchFocus( pNewActiveQueue, hOldFocus, (wndPtr && (wndPtr->dwStyle & WS_MINIMIZE))? 0 : hwndActive ); } - if ( pOldActiveQueue && - ( !pNewActiveQueue || + if ( pOldActiveQueue && + ( !pNewActiveQueue || pNewActiveQueue->pQData != pOldActiveQueue->pQData ) ) { HWND hOldFocus = PERQDATA_GetFocusWnd( pOldActiveQueue->pQData ); @@ -1391,7 +1391,7 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus) if( IsIconic(hwndActive) ) WINPOS_RedrawIconTitle(hwndActive); bRet = (hWnd == hwndActive); /* Success? */ - + CLEANUP: /* Unlock the message queues before returning */ if ( pNewActiveQueue ) @@ -1544,7 +1544,7 @@ HDWP WINAPI BeginDeferWindowPos( INT count ) HDWP handle; DWP *pDWP; - if (count < 0) + if (count < 0) { SetLastError(ERROR_INVALID_PARAMETER); return 0; @@ -1700,7 +1700,7 @@ HWND WINAPI GetProgmanWindow(void) * | | |-> tooltips_class32 * | | * | |-> SysHeader32 - * | + * | * |-> ProxyTarget */ HWND WINAPI SetShellWindowEx ( HWND hwndProgman, HWND hwndListView ) @@ -1714,7 +1714,7 @@ HWND WINAPI SetShellWindowEx ( HWND hwndProgman, HWND hwndListView ) /*********************************************************************** * SetTaskmanWindow (USER32.@) * NOTES - * hwnd = MSTaskSwWClass + * hwnd = MSTaskSwWClass * |-> SysTabControl32 */ HWND WINAPI SetTaskmanWindow ( HWND hwnd ) diff --git a/windows/winproc.c b/windows/winproc.c index 48dea55f548..36ec3754f8d 100644 --- a/windows/winproc.c +++ b/windows/winproc.c @@ -424,10 +424,10 @@ WNDPROC16 WINPROC_GetProc( HWINDOWPROC proc, WINDOWPROCTYPE type ) * * 3) timer -> wp - SetTimer() * - * Initially, winproc of the window points to the current winproc - * thunk of its class. Subclassing prepends a new thunk to the - * window winproc chain at the head of the list. Thus, window thunk - * list includes class thunks and the latter are preserved when the + * Initially, winproc of the window points to the current winproc + * thunk of its class. Subclassing prepends a new thunk to the + * window winproc chain at the head of the list. Thus, window thunk + * list includes class thunks and the latter are preserved when the * window is destroyed. * */ @@ -476,7 +476,7 @@ BOOL WINPROC_SetProc( HWINDOWPROC *pFirst, WNDPROC16 func, break; } } - + /* WPF_CLASS thunk terminates window thunk list */ if ((*ppPrev)->user != user) break; ppPrev = &(*ppPrev)->next; @@ -568,7 +568,7 @@ inline static BOOL WINPROC_TestLBForStr( HWND hwnd ) * * FIXME: * WM_GETTEXT/WM_SETTEXT and static control with SS_ICON style: - * the first four bytes are the handle of the icon + * the first four bytes are the handle of the icon * when the WM_SETTEXT message has been used to set the icon */ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plparam ) @@ -603,7 +603,7 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM *pwparam, LPARAM *plpara case WM_NCCREATE: case WM_CREATE: { - struct s + struct s { CREATESTRUCTW cs; /* new structure */ LPCWSTR lpszName; /* allocated Name */ LPCWSTR lpszClass; /* allocated Class */ @@ -743,7 +743,7 @@ LRESULT WINPROC_UnmapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_NCCREATE: case WM_CREATE: { - struct s + struct s { CREATESTRUCTW cs; /* new structure */ LPWSTR lpszName; /* allocated Name */ LPWSTR lpszClass; /* allocated Class */ @@ -1360,7 +1360,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms case WM_SIZECLIPBOARD: FIXME_(msg)("message %04x needs translation\n",msg16 ); return -1; - case WM_DDE_INITIATE: + case WM_DDE_INITIATE: case WM_DDE_TERMINATE: case WM_DDE_UNADVISE: case WM_DDE_REQUEST: @@ -1398,7 +1398,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms switch (flag) { case 0: - if (hi) + if (hi) { MESSAGE("DDE_ACK: neither atom nor handle!!!\n"); hi = 0; @@ -2144,7 +2144,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, case WM_STYLECHANGING: case WM_STYLECHANGED: return -1; - case WM_DDE_INITIATE: + case WM_DDE_INITIATE: case WM_DDE_TERMINATE: case WM_DDE_UNADVISE: case WM_DDE_REQUEST: @@ -2179,7 +2179,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, switch (flag) { case 0: - if (hi) + if (hi) { MESSAGE("DDE_ACK: neither atom nor handle!!!\n"); hi = 0; @@ -2212,7 +2212,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, * Unmap a message that was mapped from 32-bit Ansi to 16-bit. */ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, - MSGPARAM16* p16 ) + MSGPARAM16* p16 ) { switch(msg) { @@ -2723,7 +2723,7 @@ LRESULT WINAPI CallWindowProc16( WNDPROC16 func, HWND16 hwnd, UINT16 msg, func = WINPROC_GetProc( (HWINDOWPROC)proc, WIN_PROC_16 ); return WINPROC_CallWndProc16( func, hwnd, msg, wParam, lParam ); #endif - + switch(proc->type) { case WIN_PROC_16: @@ -2765,9 +2765,9 @@ LRESULT WINAPI CallWindowProc16( WNDPROC16 func, HWND16 hwnd, UINT16 msg, * * CONFORMANCE * - * ECMA-234, Win32 + * ECMA-234, Win32 */ -LRESULT WINAPI CallWindowProcA( +LRESULT WINAPI CallWindowProcA( WNDPROC func, /* [in] window procedure */ HWND hwnd, /* [in] target window */ UINT msg, /* [in] message */